@dolanske/vui 1.0.4 → 1.1.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/LICENSE +673 -673
- package/README.md +42 -42
- 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 +3 -2
- package/dist/components/Avatar/Avatar.vue.d.ts +3 -2
- package/dist/components/Badge/Badge.vue.d.ts +3 -2
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +3 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +3 -2
- package/dist/components/Button/Button.vue.d.ts +3 -2
- package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +3 -2
- package/dist/components/Calendar/Calendar.vue.d.ts +6 -6
- package/dist/components/Card/Card.vue.d.ts +4 -3
- package/dist/components/Checkbox/Checkbox.vue.d.ts +7 -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 +10 -9
- package/dist/components/Dropdown/Dropdown.vue.d.ts +66 -3
- package/dist/components/Dropdown/DropdownItem.vue.d.ts +3 -2
- package/dist/components/Dropdown/DropdownTitle.vue.d.ts +6 -6
- package/dist/components/Flex/Flex.vue.d.ts +13 -12
- package/dist/components/Grid/Grid.vue.d.ts +7 -6
- package/dist/components/Input/Color.vue.d.ts +5 -5
- package/dist/components/Input/Counter.vue.d.ts +5 -5
- package/dist/components/Input/Dropzone.vue.d.ts +95 -10
- package/dist/components/Input/File.vue.d.ts +4 -3
- package/dist/components/Input/Input.vue.d.ts +7 -6
- 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 +2 -1
- package/dist/components/Modal/Confirm.vue.d.ts +7 -9
- package/dist/components/Modal/Modal.vue.d.ts +16 -13
- 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 +3 -2
- package/dist/components/Popout/Popout.vue.d.ts +3 -2
- package/dist/components/Progress/Progress.vue.d.ts +5 -5
- package/dist/components/Radio/Radio.vue.d.ts +7 -6
- package/dist/components/Radio/RadioGroup.vue.d.ts +7 -6
- package/dist/components/Select/Select.vue.d.ts +4 -8
- package/dist/components/Sheet/Sheet.vue.d.ts +22 -13
- package/dist/components/Sidebar/Sidebar.vue.d.ts +7 -6
- 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 +7 -6
- package/dist/components/Table/Cell.vue.d.ts +5 -2
- package/dist/components/Table/Head.vue.d.ts +3 -2
- package/dist/components/Table/Root.vue.d.ts +3 -2
- package/dist/components/Table/table.d.ts +2 -2
- package/dist/components/Tabs/Tab.vue.d.ts +3 -2
- package/dist/components/Tabs/Tabs.vue.d.ts +7 -6
- package/dist/components/Toast/toast.d.ts +6 -6
- package/dist/components/Tooltip/Tooltip.vue.d.ts +2 -1
- package/dist/internal/Backdrop/Backdrop.vue.d.ts +3 -2
- package/dist/vui.css +1 -0
- package/dist/vui.js +8090 -7884
- package/package.json +73 -72
- package/src/App.vue +95 -95
- package/src/components/Accordion/Accordion.vue +91 -91
- package/src/components/Accordion/AccordionGroup.vue +43 -43
- package/src/components/Accordion/accordion.scss +82 -82
- package/src/components/Alert/Alert.vue +59 -59
- package/src/components/Alert/alert.scss +161 -161
- package/src/components/Avatar/Avatar.vue +53 -53
- package/src/components/Avatar/avatar.scss +52 -52
- package/src/components/Badge/Badge.vue +21 -21
- package/src/components/Badge/badge.scss +210 -206
- package/src/components/Breadcrumbs/BreadcrumbItem.vue +26 -26
- package/src/components/Breadcrumbs/Breadcrumbs.vue +30 -30
- package/src/components/Breadcrumbs/breadcrumbs.scss +31 -31
- package/src/components/Button/Button.vue +85 -85
- package/src/components/Button/button.scss +279 -279
- package/src/components/ButtonGroup/ButtonGroup.vue +28 -28
- package/src/components/ButtonGroup/button-group.scss +51 -51
- package/src/components/Calendar/Calendar.vue +66 -66
- package/src/components/Calendar/calendar.scss +83 -83
- package/src/components/Card/Card.vue +48 -48
- package/src/components/Card/card.scss +53 -53
- package/src/components/Checkbox/Checkbox.vue +54 -54
- package/src/components/Checkbox/checkbox.scss +80 -80
- package/src/components/CopyClipboard/CopyClipboard.vue +91 -91
- package/src/components/CopyClipboard/copy-clipboard.scss +25 -25
- package/src/components/Divider/Divider.vue +44 -44
- package/src/components/Divider/divider.scss +35 -35
- package/src/components/Drawer/Drawer.vue +102 -97
- package/src/components/Drawer/drawer.scss +37 -37
- package/src/components/Dropdown/Dropdown.vue +135 -135
- package/src/components/Dropdown/DropdownItem.vue +33 -33
- package/src/components/Dropdown/DropdownTitle.vue +14 -14
- package/src/components/Dropdown/dropdown-item.scss +84 -84
- package/src/components/Dropdown/dropdown.scss +53 -53
- package/src/components/Flex/Flex.vue +113 -113
- package/src/components/Grid/Grid.vue +79 -80
- package/src/components/Input/Color.vue +26 -26
- package/src/components/Input/Counter.vue +66 -66
- package/src/components/Input/Dropzone.vue +65 -65
- package/src/components/Input/File.vue +15 -15
- package/src/components/Input/Input.vue +123 -123
- package/src/components/Input/Password.vue +35 -35
- package/src/components/Input/Textarea.vue +78 -78
- package/src/components/Input/input.scss +302 -302
- package/src/components/Kbd/Kbd.vue +48 -48
- package/src/components/Kbd/KbdGroup.vue +27 -27
- package/src/components/Kbd/kbd.scss +19 -19
- package/src/components/Modal/Confirm.vue +56 -56
- package/src/components/Modal/Modal.vue +103 -99
- package/src/components/Modal/modal.scss +54 -54
- package/src/components/OTP/OTP.vue +133 -133
- package/src/components/OTP/OTPItem.vue +37 -37
- package/src/components/OTP/otp.scss +84 -84
- package/src/components/Pagination/Pagination.vue +77 -77
- package/src/components/Pagination/pagination.ts +78 -78
- package/src/components/Popout/Popout.vue +52 -52
- package/src/components/Popout/popout.scss +15 -15
- package/src/components/Progress/Progress.vue +103 -103
- package/src/components/Progress/progress.scss +47 -47
- package/src/components/Radio/Radio.vue +38 -38
- package/src/components/Radio/RadioGroup.vue +40 -40
- package/src/components/Radio/radio.scss +78 -78
- package/src/components/Select/Select.vue +211 -211
- package/src/components/Select/select.scss +77 -77
- package/src/components/Sheet/Sheet.vue +108 -98
- package/src/components/Sheet/sheet.scss +69 -69
- package/src/components/Sidebar/Sidebar.vue +115 -115
- package/src/components/Sidebar/sidebar.scss +124 -124
- package/src/components/Skeleton/Skeleton.vue +43 -43
- package/src/components/Skeleton/skeleton.scss +14 -14
- package/src/components/Spinner/Spinner.vue +42 -42
- package/src/components/Spinner/spinner.scss +47 -47
- package/src/components/Switch/Switch.vue +31 -31
- package/src/components/Switch/switch.scss +93 -93
- package/src/components/Table/Cell.vue +23 -23
- package/src/components/Table/Head.vue +59 -59
- package/src/components/Table/Root.vue +66 -66
- package/src/components/Table/SelectAll.vue +23 -23
- package/src/components/Table/SelectRow.vue +30 -30
- package/src/components/Table/index.ts +7 -7
- package/src/components/Table/table.scss +154 -154
- package/src/components/Table/table.ts +248 -248
- package/src/components/Tabs/Tab.vue +25 -25
- package/src/components/Tabs/Tabs.vue +90 -90
- package/src/components/Tabs/tabs.scss +87 -87
- package/src/components/Toast/Toasts.vue +52 -52
- package/src/components/Toast/toast.scss +45 -45
- package/src/components/Toast/toast.ts +75 -75
- package/src/components/Tooltip/Tooltip.vue +86 -86
- package/src/components/Tooltip/tooltip.scss +8 -8
- package/src/examples/ExampleAccordions.vue +58 -58
- package/src/examples/ExampleAlerts.vue +78 -78
- package/src/examples/ExampleAvatars.vue +44 -44
- package/src/examples/ExampleBadges.vue +48 -48
- package/src/examples/ExampleBreadcrumbs.vue +46 -46
- package/src/examples/ExampleButtons.vue +140 -140
- package/src/examples/ExampleCalendars.vue +40 -40
- package/src/examples/ExampleCards.vue +94 -94
- package/src/examples/ExampleCheckboxes.vue +123 -123
- package/src/examples/ExampleCopyClipboard.vue +47 -47
- package/src/examples/ExampleDividers.vue +39 -39
- package/src/examples/ExampleDrawers.vue +67 -67
- package/src/examples/ExampleDropdowns.vue +114 -114
- package/src/examples/ExampleFlexGrid.vue +124 -122
- package/src/examples/ExampleInputs.vue +234 -234
- package/src/examples/ExampleKBD.vue +65 -65
- package/src/examples/ExampleModals.vue +143 -143
- package/src/examples/ExamplePalette.vue +159 -159
- package/src/examples/ExamplePopouts.vue +41 -41
- package/src/examples/ExampleSheets.vue +77 -77
- package/src/examples/ExampleSidebars.vue +270 -270
- package/src/examples/ExampleSkeletons.vue +26 -26
- package/src/examples/ExampleSpinners.vue +80 -78
- package/src/examples/ExampleTables.vue +195 -195
- package/src/examples/ExampleTabs.vue +119 -119
- package/src/examples/ExampleToasts.vue +96 -96
- package/src/examples/ExampleTooltips.vue +70 -70
- package/src/examples/shared/ExampleColor.vue +28 -28
- package/src/index.ts +116 -116
- package/src/internal/Backdrop/Backdrop.vue +22 -22
- package/src/internal/Backdrop/backdrop.scss +34 -34
- package/src/main.ts +5 -5
- package/src/shared/helpers.ts +117 -117
- package/src/shared/theme.ts +22 -22
- package/src/shared/types.ts +29 -29
- package/src/style/animation.scss +22 -22
- package/src/style/core.scss +119 -125
- package/src/style/layout.scss +207 -233
- package/src/style/media-query.scss +29 -29
- package/src/style/reset.scss +135 -135
- package/src/style/text.scss +137 -124
- package/src/style/theme.scss +195 -195
- package/src/style/tooltip.scss +146 -146
- package/src/style/typography.scss +415 -415
- package/src/style/utils.scss +36 -36
- package/src/style.scss +1 -1
- package/dist/style.css +0 -1
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import type { Component } from 'vue'
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
interface ToastAction {
|
|
5
|
-
label: string
|
|
6
|
-
handler: (toastId: number) => void
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface ToastOptions {
|
|
10
|
-
persist?: boolean
|
|
11
|
-
timeout?: number
|
|
12
|
-
action?: ToastAction
|
|
13
|
-
description?: string
|
|
14
|
-
body?: Component
|
|
15
|
-
bodyProps?: object
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface Toast {
|
|
19
|
-
id: number
|
|
20
|
-
// type: ToastType
|
|
21
|
-
title: string
|
|
22
|
-
action?: ToastAction
|
|
23
|
-
createdAt: number
|
|
24
|
-
expiresAt: number
|
|
25
|
-
description?: string
|
|
26
|
-
body?: Component
|
|
27
|
-
bodyProps?: object
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Store in a ref so the toast component can import it
|
|
31
|
-
export const toasts = ref(new Map<number, Toast>())
|
|
32
|
-
|
|
33
|
-
// Simple incremental id system
|
|
34
|
-
let id = 0
|
|
35
|
-
|
|
36
|
-
// function toast(type: ToastType, title: string, options?: ToastOptions): Toast {
|
|
37
|
-
export function pushToast(title: string, options?: ToastOptions): Toast {
|
|
38
|
-
const parsedOptions = Object.assign({
|
|
39
|
-
persist: false,
|
|
40
|
-
timeout: 7000,
|
|
41
|
-
}, options)
|
|
42
|
-
|
|
43
|
-
const newToast = {
|
|
44
|
-
id,
|
|
45
|
-
// type,
|
|
46
|
-
title,
|
|
47
|
-
persist: parsedOptions.persist,
|
|
48
|
-
description: parsedOptions.description,
|
|
49
|
-
action: parsedOptions.action,
|
|
50
|
-
createdAt: Date.now(),
|
|
51
|
-
expiresAt: Date.now() + parsedOptions.timeout,
|
|
52
|
-
body: parsedOptions.body,
|
|
53
|
-
bodyProps: parsedOptions.bodyProps ?? {},
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
toasts.value.set(id, newToast)
|
|
57
|
-
|
|
58
|
-
// If options include timeout (by default) remove the toast after timeout
|
|
59
|
-
// passes
|
|
60
|
-
if (!parsedOptions.persist) {
|
|
61
|
-
setTimeout((_id: number) => {
|
|
62
|
-
toasts.value.delete(_id)
|
|
63
|
-
// Pass Id as an optional argument, becasue by the time it is executed the
|
|
64
|
-
// Id will have been increased
|
|
65
|
-
}, parsedOptions.timeout, id)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
id++
|
|
69
|
-
|
|
70
|
-
return newToast
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function removeToast(id: number): void {
|
|
74
|
-
toasts.value.delete(id)
|
|
75
|
-
}
|
|
1
|
+
import type { Component } from 'vue'
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface ToastAction {
|
|
5
|
+
label: string
|
|
6
|
+
handler: (toastId: number) => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface ToastOptions {
|
|
10
|
+
persist?: boolean
|
|
11
|
+
timeout?: number
|
|
12
|
+
action?: ToastAction
|
|
13
|
+
description?: string
|
|
14
|
+
body?: Component
|
|
15
|
+
bodyProps?: object
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface Toast {
|
|
19
|
+
id: number
|
|
20
|
+
// type: ToastType
|
|
21
|
+
title: string
|
|
22
|
+
action?: ToastAction
|
|
23
|
+
createdAt: number
|
|
24
|
+
expiresAt: number
|
|
25
|
+
description?: string
|
|
26
|
+
body?: Component
|
|
27
|
+
bodyProps?: object
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Store in a ref so the toast component can import it
|
|
31
|
+
export const toasts = ref(new Map<number, Toast>())
|
|
32
|
+
|
|
33
|
+
// Simple incremental id system
|
|
34
|
+
let id = 0
|
|
35
|
+
|
|
36
|
+
// function toast(type: ToastType, title: string, options?: ToastOptions): Toast {
|
|
37
|
+
export function pushToast(title: string, options?: ToastOptions): Toast {
|
|
38
|
+
const parsedOptions = Object.assign({
|
|
39
|
+
persist: false,
|
|
40
|
+
timeout: 7000,
|
|
41
|
+
}, options)
|
|
42
|
+
|
|
43
|
+
const newToast = {
|
|
44
|
+
id,
|
|
45
|
+
// type,
|
|
46
|
+
title,
|
|
47
|
+
persist: parsedOptions.persist,
|
|
48
|
+
description: parsedOptions.description,
|
|
49
|
+
action: parsedOptions.action,
|
|
50
|
+
createdAt: Date.now(),
|
|
51
|
+
expiresAt: Date.now() + parsedOptions.timeout,
|
|
52
|
+
body: parsedOptions.body,
|
|
53
|
+
bodyProps: parsedOptions.bodyProps ?? {},
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
toasts.value.set(id, newToast)
|
|
57
|
+
|
|
58
|
+
// If options include timeout (by default) remove the toast after timeout
|
|
59
|
+
// passes
|
|
60
|
+
if (!parsedOptions.persist) {
|
|
61
|
+
setTimeout((_id: number) => {
|
|
62
|
+
toasts.value.delete(_id)
|
|
63
|
+
// Pass Id as an optional argument, becasue by the time it is executed the
|
|
64
|
+
// Id will have been increased
|
|
65
|
+
}, parsedOptions.timeout, id)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
id++
|
|
69
|
+
|
|
70
|
+
return newToast
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function removeToast(id: number): void {
|
|
74
|
+
toasts.value.delete(id)
|
|
75
|
+
}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
<script setup lang='ts'>
|
|
2
|
-
import type { Placement } from '../../shared/types'
|
|
3
|
-
import { ref, useId, useTemplateRef, watch } from 'vue'
|
|
4
|
-
import Popout from '../Popout/Popout.vue'
|
|
5
|
-
import './tooltip.scss'
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
/**
|
|
9
|
-
* Tooltip placement related to the anchor
|
|
10
|
-
*/
|
|
11
|
-
placement?: Placement
|
|
12
|
-
/**
|
|
13
|
-
* Amount of time user should hover the anchor until the tooltip shows up
|
|
14
|
-
*/
|
|
15
|
-
delay?: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
placement,
|
|
20
|
-
delay = 0,
|
|
21
|
-
} = defineProps<Props>()
|
|
22
|
-
|
|
23
|
-
const popoutAnchorRef = useTemplateRef('popoutAnchor')
|
|
24
|
-
// Track if user is hovering the anchor
|
|
25
|
-
const hoverAnchor = ref(false)
|
|
26
|
-
|
|
27
|
-
// Display tooltip
|
|
28
|
-
const showTooltip = ref(false)
|
|
29
|
-
|
|
30
|
-
let timeoutId: NodeJS.Timeout
|
|
31
|
-
watch(hoverAnchor, (isHovering) => {
|
|
32
|
-
if (isHovering) {
|
|
33
|
-
if (!delay || delay <= 0) {
|
|
34
|
-
showTooltip.value = true
|
|
35
|
-
return
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
clearTimeout(timeoutId)
|
|
39
|
-
|
|
40
|
-
timeoutId = setTimeout(() => {
|
|
41
|
-
// Need to reference the ref itself as this will execute without the
|
|
42
|
-
// outside scope (as far as I know tbh)
|
|
43
|
-
if (hoverAnchor.value) {
|
|
44
|
-
showTooltip.value = true
|
|
45
|
-
}
|
|
46
|
-
}, delay)
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
clearTimeout(timeoutId)
|
|
50
|
-
showTooltip.value = false
|
|
51
|
-
}
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
const id = useId()
|
|
55
|
-
</script>
|
|
56
|
-
|
|
57
|
-
<template>
|
|
58
|
-
<div
|
|
59
|
-
ref="popoutAnchor"
|
|
60
|
-
:style="{
|
|
61
|
-
width: 'fit-content',
|
|
62
|
-
}"
|
|
63
|
-
:aria-describedby="id"
|
|
64
|
-
@mouseenter="hoverAnchor = true"
|
|
65
|
-
@mouseleave="hoverAnchor = false"
|
|
66
|
-
>
|
|
67
|
-
<slot />
|
|
68
|
-
</div>
|
|
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
|
-
</template>
|
|
75
|
-
|
|
76
|
-
<!-- <style scoped>
|
|
77
|
-
.tooltip-enter-active,
|
|
78
|
-
.tooltip-leave-active {
|
|
79
|
-
transition: var(--transition-fast);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.tooltip-enter-from,
|
|
83
|
-
.tooltip-leave-to {
|
|
84
|
-
opacity: 0;
|
|
85
|
-
}
|
|
86
|
-
</style> -->
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { Placement } from '../../shared/types'
|
|
3
|
+
import { ref, useId, useTemplateRef, watch } from 'vue'
|
|
4
|
+
import Popout from '../Popout/Popout.vue'
|
|
5
|
+
import './tooltip.scss'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
/**
|
|
9
|
+
* Tooltip placement related to the anchor
|
|
10
|
+
*/
|
|
11
|
+
placement?: Placement
|
|
12
|
+
/**
|
|
13
|
+
* Amount of time user should hover the anchor until the tooltip shows up
|
|
14
|
+
*/
|
|
15
|
+
delay?: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
placement,
|
|
20
|
+
delay = 0,
|
|
21
|
+
} = defineProps<Props>()
|
|
22
|
+
|
|
23
|
+
const popoutAnchorRef = useTemplateRef('popoutAnchor')
|
|
24
|
+
// Track if user is hovering the anchor
|
|
25
|
+
const hoverAnchor = ref(false)
|
|
26
|
+
|
|
27
|
+
// Display tooltip
|
|
28
|
+
const showTooltip = ref(false)
|
|
29
|
+
|
|
30
|
+
let timeoutId: NodeJS.Timeout
|
|
31
|
+
watch(hoverAnchor, (isHovering) => {
|
|
32
|
+
if (isHovering) {
|
|
33
|
+
if (!delay || delay <= 0) {
|
|
34
|
+
showTooltip.value = true
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
clearTimeout(timeoutId)
|
|
39
|
+
|
|
40
|
+
timeoutId = setTimeout(() => {
|
|
41
|
+
// Need to reference the ref itself as this will execute without the
|
|
42
|
+
// outside scope (as far as I know tbh)
|
|
43
|
+
if (hoverAnchor.value) {
|
|
44
|
+
showTooltip.value = true
|
|
45
|
+
}
|
|
46
|
+
}, delay)
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
clearTimeout(timeoutId)
|
|
50
|
+
showTooltip.value = false
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const id = useId()
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<div
|
|
59
|
+
ref="popoutAnchor"
|
|
60
|
+
:style="{
|
|
61
|
+
width: 'fit-content',
|
|
62
|
+
}"
|
|
63
|
+
:aria-describedby="id"
|
|
64
|
+
@mouseenter="hoverAnchor = true"
|
|
65
|
+
@mouseleave="hoverAnchor = false"
|
|
66
|
+
>
|
|
67
|
+
<slot />
|
|
68
|
+
</div>
|
|
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
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<!-- <style scoped>
|
|
77
|
+
.tooltip-enter-active,
|
|
78
|
+
.tooltip-leave-active {
|
|
79
|
+
transition: var(--transition-fast);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.tooltip-enter-from,
|
|
83
|
+
.tooltip-leave-to {
|
|
84
|
+
opacity: 0;
|
|
85
|
+
}
|
|
86
|
+
</style> -->
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
.vui-tooltip {
|
|
2
|
-
padding: var(--space-s);
|
|
3
|
-
max-width: 512px;
|
|
4
|
-
background-color: var(--color-bg-raised);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// :root.light {
|
|
8
|
-
// }
|
|
1
|
+
.vui-tooltip {
|
|
2
|
+
padding: var(--space-s);
|
|
3
|
+
max-width: 512px;
|
|
4
|
+
background-color: var(--color-bg-raised);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// :root.light {
|
|
8
|
+
// }
|
|
@@ -1,58 +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>
|
|
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>
|
|
@@ -1,78 +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
|
|
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>
|
|
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 y-center x-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>
|