@dolanske/vui 0.2.0 → 0.3.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 +1 -7
- package/dist/components/Avatar/Avatar.vue.d.ts +1 -3
- package/dist/components/Calendar/Calendar.vue.d.ts +1 -1
- package/dist/components/Flex/Flex.vue.d.ts +2 -2
- package/dist/components/Grid/Grid.vue.d.ts +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/shared/types.d.ts +11 -0
- package/dist/style.css +1 -1
- package/dist/vui.js +4324 -4251
- package/package.json +6 -2
- package/src/App.vue +20 -4
- package/src/components/Accordion/accordion.scss +1 -1
- package/src/components/Alert/alert.scss +1 -1
- package/src/components/Avatar/Avatar.vue +7 -21
- package/src/components/Avatar/avatar.scss +6 -2
- package/src/components/Button/Button.vue +9 -9
- package/src/components/Divider/Divider.vue +9 -9
- package/src/components/Drawer/Drawer.vue +8 -2
- package/src/components/Drawer/drawer.scss +1 -1
- package/src/components/Dropdown/Dropdown.vue +11 -6
- package/src/components/Dropdown/dropdown.scss +4 -0
- package/src/components/Flex/Flex.vue +14 -17
- package/src/components/Grid/Grid.vue +9 -14
- package/src/components/Input/Textarea.vue +5 -7
- package/src/components/OTP/otp.scss +1 -2
- package/src/components/Popout/popout.scss +1 -0
- package/src/components/Progress/Progress.vue +6 -8
- package/src/components/Select/select.scss +1 -0
- package/src/components/Skeleton/Skeleton.vue +7 -9
- package/src/components/Spinner/Spinner.vue +7 -9
- package/src/components/Table/table.scss +1 -1
- package/src/components/Tabs/Tab.vue +7 -1
- package/src/components/Tabs/Tabs.vue +1 -0
- package/src/components/Tabs/tabs.scss +1 -0
- package/src/components/Toast/toast.ts +0 -24
- package/src/components/Tooltip/Tooltip.vue +6 -2
- package/src/index.ts +4 -0
- package/src/shared/types.ts +12 -0
- package/src/style/core.scss +29 -14
- package/src/style/fonts.scss +53 -0
- package/src/style/layout.scss +126 -3
- package/src/style/typography.scss +12 -13
- package/src/style/utils.scss +14 -0
- package/dist/shared/composables.d.ts +0 -3
- package/src/shared/composables.ts +0 -18
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dolanske/vui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Brother in Christ there's a new UI library ",
|
|
7
7
|
"author": "dolanske",
|
|
@@ -11,7 +11,11 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/dolanske/vui.git"
|
|
13
13
|
},
|
|
14
|
-
"keywords": [
|
|
14
|
+
"keywords": [
|
|
15
|
+
"vue",
|
|
16
|
+
"vue3",
|
|
17
|
+
"component"
|
|
18
|
+
],
|
|
15
19
|
"exports": {
|
|
16
20
|
".": {
|
|
17
21
|
"types": "./dist/index.d.ts",
|
package/src/App.vue
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import Avatar from './components/Avatar/Avatar.vue'
|
|
4
|
+
import Button from './components/Button/Button.vue'
|
|
4
5
|
import Divider from './components/Divider/Divider.vue'
|
|
5
6
|
import Tab from './components/Tabs/Tab.vue'
|
|
7
|
+
|
|
6
8
|
import Tabs from './components/Tabs/Tabs.vue'
|
|
9
|
+
import Tooltip from './components/Tooltip/Tooltip.vue'
|
|
7
10
|
|
|
8
11
|
const tab = ref('components')
|
|
9
12
|
</script>
|
|
@@ -21,11 +24,24 @@ const tab = ref('components')
|
|
|
21
24
|
</div>
|
|
22
25
|
|
|
23
26
|
<div v-if="tab === 'components'">
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
<h1 class="mb-xl">
|
|
28
|
+
Hii
|
|
29
|
+
<span class="counter text-color-accent">129</span>
|
|
30
|
+
</h1>
|
|
31
|
+
<p>I am down</p>
|
|
32
|
+
|
|
33
|
+
<Avatar :size="80" />
|
|
34
|
+
|
|
35
|
+
<Divider />
|
|
27
36
|
|
|
28
|
-
<
|
|
37
|
+
<Tooltip>
|
|
38
|
+
<span cl>Hello world</span>
|
|
39
|
+
<template #tooltip>
|
|
40
|
+
<p>
|
|
41
|
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Porro, animi! Nobis maxime neque cumque, in a amet voluptatibus tenetur dicta eos delectus illo soluta aliquam voluptatum nulla? In, incidunt asperiores?
|
|
42
|
+
</p>
|
|
43
|
+
</template>
|
|
44
|
+
</Tooltip>
|
|
29
45
|
</div>
|
|
30
46
|
<div v-else-if="tab === 'typography'" class="typeset" :style="{ maxWidth: '688px', margin: 'auto' }">
|
|
31
47
|
<h1>The Joke Tax Chronicles</h1>
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
&:hover {
|
|
28
28
|
text-decoration: inherit;
|
|
29
29
|
text-underline-offset: inherit;
|
|
30
|
-
|
|
31
30
|
background-color: var(--color-button-gray);
|
|
32
31
|
}
|
|
33
32
|
}
|
|
@@ -67,6 +66,7 @@
|
|
|
67
66
|
|
|
68
67
|
svg {
|
|
69
68
|
transition: var(--transition);
|
|
69
|
+
color: var(--color-text-light);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Sizes } from '../../shared/types'
|
|
3
3
|
import { Icon } from '@iconify/vue'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
import { formatUnitValue } from '../../shared/helpers'
|
|
6
6
|
import { Size } from '../../shared/types'
|
|
7
7
|
import './avatar.scss'
|
|
8
8
|
|
|
@@ -20,31 +20,17 @@ const {
|
|
|
20
20
|
} = defineProps<Props>()
|
|
21
21
|
|
|
22
22
|
const showFallback = ref(false)
|
|
23
|
-
|
|
24
|
-
// For some reason CSS variable assignemnt in scoped <style> is broken, so we
|
|
25
|
-
// have to go this way instead.
|
|
26
|
-
const avatarRef = useTemplateRef('avatar')
|
|
27
|
-
const avatarSize = useCssVar('--avatar-size', avatarRef)
|
|
28
|
-
watch(() => size, (val) => {
|
|
29
|
-
avatarSize.value = (() => {
|
|
30
|
-
if (typeof val == 'number') {
|
|
31
|
-
return `${val}px`
|
|
32
|
-
}
|
|
33
|
-
switch (size) {
|
|
34
|
-
case Size.s: return '28px'
|
|
35
|
-
case Size.l: return '48px'
|
|
36
|
-
case Size.m:
|
|
37
|
-
default: return '36px'
|
|
38
|
-
}
|
|
39
|
-
})()
|
|
40
|
-
})
|
|
41
23
|
</script>
|
|
42
24
|
|
|
43
25
|
<template>
|
|
44
26
|
<div
|
|
45
|
-
ref="avatar"
|
|
46
27
|
class="vui-avatar"
|
|
47
28
|
:class="[`vui-avatar-size-${typeof size === 'number' ? 'm' : size}`]"
|
|
29
|
+
:style="{
|
|
30
|
+
...(typeof size === 'number' && {
|
|
31
|
+
'--avatar-size': formatUnitValue(size),
|
|
32
|
+
}),
|
|
33
|
+
}"
|
|
48
34
|
>
|
|
49
35
|
<img v-if="url && !showFallback" :src="url" @error="showFallback = true">
|
|
50
36
|
<strong v-else>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
--avatar-size: 36px;
|
|
3
3
|
|
|
4
4
|
&.vui-avatar-size-s {
|
|
5
|
-
|
|
5
|
+
--avatar-size: 28px;
|
|
6
6
|
|
|
7
7
|
strong {
|
|
8
8
|
font-size: var(--font-size-xs);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
&.vui-avatar-size-l {
|
|
13
|
-
|
|
13
|
+
--avatar-size: 48px;
|
|
14
14
|
|
|
15
15
|
strong {
|
|
16
16
|
font-size: var(--font-size-m);
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
background-color: var(--color-bg-raised);
|
|
28
28
|
font-weight: 500;
|
|
29
29
|
|
|
30
|
+
svg {
|
|
31
|
+
color: var(--color-text-light);
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
strong {
|
|
31
35
|
display: block;
|
|
32
36
|
font-size: var(--font-size-s);
|
|
@@ -12,6 +12,8 @@ interface Props {
|
|
|
12
12
|
// Provide URL to turn button into anchor
|
|
13
13
|
// href?: string
|
|
14
14
|
// target?: string
|
|
15
|
+
|
|
16
|
+
// State props
|
|
15
17
|
loading?: boolean
|
|
16
18
|
expand?: boolean
|
|
17
19
|
square?: boolean
|
|
@@ -43,7 +45,7 @@ const {
|
|
|
43
45
|
dashed,
|
|
44
46
|
} = defineProps<Props>()
|
|
45
47
|
|
|
46
|
-
const
|
|
48
|
+
const height = computed(() => {
|
|
47
49
|
switch (size) {
|
|
48
50
|
case Size.s: return '24px'
|
|
49
51
|
case Size.l: return '40px'
|
|
@@ -52,7 +54,7 @@ const h = computed(() => {
|
|
|
52
54
|
}
|
|
53
55
|
})
|
|
54
56
|
|
|
55
|
-
const
|
|
57
|
+
const padding = computed(() => {
|
|
56
58
|
switch (size) {
|
|
57
59
|
case Size.s: return '5px'
|
|
58
60
|
case Size.l: return '16px'
|
|
@@ -67,6 +69,11 @@ const p = computed(() => {
|
|
|
67
69
|
class="vui-button"
|
|
68
70
|
:class="[{ loading, expand, disabled, plain, active, icon, square, dashed }, `vui-button-variant-${variant}`]"
|
|
69
71
|
:disabled
|
|
72
|
+
role="button"
|
|
73
|
+
:style="{
|
|
74
|
+
'--button-height': height,
|
|
75
|
+
'--button-padding': padding,
|
|
76
|
+
}"
|
|
70
77
|
>
|
|
71
78
|
<Spinner size="s" />
|
|
72
79
|
<div class="vui-button-slot">
|
|
@@ -81,10 +88,3 @@ const p = computed(() => {
|
|
|
81
88
|
</div>
|
|
82
89
|
</button>
|
|
83
90
|
</template>
|
|
84
|
-
|
|
85
|
-
<style scoped>
|
|
86
|
-
.vui-button {
|
|
87
|
-
--button-height: v-bind(h);
|
|
88
|
-
--button-padding: v-bind(p);
|
|
89
|
-
}
|
|
90
|
-
</style>
|
|
@@ -24,7 +24,13 @@ const m = computed(() => formatUnitValue(margin))
|
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
26
|
<template>
|
|
27
|
-
<div
|
|
27
|
+
<div
|
|
28
|
+
class="vui-divider" :class="{ vertical }" :style="{
|
|
29
|
+
margin: m,
|
|
30
|
+
width: w,
|
|
31
|
+
height: h,
|
|
32
|
+
}"
|
|
33
|
+
>
|
|
28
34
|
<div v-if="$slots.default" class="vui-divider-slot">
|
|
29
35
|
<slot />
|
|
30
36
|
</div>
|
|
@@ -32,13 +38,7 @@ const m = computed(() => formatUnitValue(margin))
|
|
|
32
38
|
</template>
|
|
33
39
|
|
|
34
40
|
<style lang="scss" scoped>
|
|
35
|
-
.vui-divider {
|
|
36
|
-
|
|
37
|
-
width: v-bind(w);
|
|
38
|
-
height: v-bind(h);
|
|
39
|
-
|
|
40
|
-
&:before {
|
|
41
|
-
border-width: v-bind(bW);
|
|
42
|
-
}
|
|
41
|
+
.vui-divider:before {
|
|
42
|
+
border-width: v-bind(bW);
|
|
43
43
|
}
|
|
44
44
|
</style>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { DrawerPortalProps, DrawerRootProps } from 'vaul-vue'
|
|
3
3
|
import type { Sizes, VueClass } from '../../shared/types'
|
|
4
4
|
import { DrawerContent, DrawerOverlay, DrawerPortal, DrawerRoot, DrawerTitle } from 'vaul-vue'
|
|
5
|
-
import { computed, useId } from 'vue'
|
|
5
|
+
import { computed, onMounted, useId } from 'vue'
|
|
6
6
|
import './drawer.scss'
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
@@ -59,6 +59,12 @@ const mW = computed(() => {
|
|
|
59
59
|
})
|
|
60
60
|
|
|
61
61
|
const id = useId()
|
|
62
|
+
|
|
63
|
+
onMounted(() => {
|
|
64
|
+
if (!document.querySelector('vaul-drawer-wrapper')) {
|
|
65
|
+
console.error('Your root component is missing \'vaul-drawer-wrapper\' attribute. \n Without it the <Drawer /> component will not be functional.')
|
|
66
|
+
}
|
|
67
|
+
})
|
|
62
68
|
</script>
|
|
63
69
|
|
|
64
70
|
<template>
|
|
@@ -85,7 +91,7 @@ const id = useId()
|
|
|
85
91
|
|
|
86
92
|
<style lang="scss" scoped>
|
|
87
93
|
:global(body) {
|
|
88
|
-
transition: var(--transition-
|
|
94
|
+
transition: var(--transition-fast);
|
|
89
95
|
background-color: var(--color-bg);
|
|
90
96
|
}
|
|
91
97
|
</style>
|
|
@@ -70,7 +70,17 @@ const w = computed(() => expand ? `${anchorWidth.value}px` : 'initial')
|
|
|
70
70
|
</script>
|
|
71
71
|
|
|
72
72
|
<template>
|
|
73
|
-
<div
|
|
73
|
+
<div
|
|
74
|
+
ref="anchor"
|
|
75
|
+
class="vui-dropdown-trigger-wrap"
|
|
76
|
+
:style="{
|
|
77
|
+
minWidth: mW,
|
|
78
|
+
width: w,
|
|
79
|
+
}"
|
|
80
|
+
role="button"
|
|
81
|
+
:aria-expanded="showMenu"
|
|
82
|
+
:aria-haspopup="true"
|
|
83
|
+
>
|
|
74
84
|
<slot name="trigger" :open :is-open="showMenu" :close :toggle />
|
|
75
85
|
</div>
|
|
76
86
|
|
|
@@ -88,11 +98,6 @@ const w = computed(() => expand ? `${anchorWidth.value}px` : 'initial')
|
|
|
88
98
|
</template>
|
|
89
99
|
|
|
90
100
|
<style scoped lang="scss">
|
|
91
|
-
.vui-dropdown {
|
|
92
|
-
min-width: v-bind(mW);
|
|
93
|
-
width: v-bind(w);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
101
|
.dropdown-enter-active,
|
|
97
102
|
.dropdown-leave-active {
|
|
98
103
|
transition: 0.1s opacity ease-in-out;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Space } from '../../shared/types'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
|
-
import { useActualGap } from '../../shared/composables'
|
|
5
4
|
|
|
6
5
|
export interface FlexProps {
|
|
7
6
|
inline?: boolean
|
|
@@ -13,7 +12,7 @@ export interface FlexProps {
|
|
|
13
12
|
rowReverse?: boolean
|
|
14
13
|
columnReverse?: boolean
|
|
15
14
|
|
|
16
|
-
gap?:
|
|
15
|
+
gap?: Space | number
|
|
17
16
|
|
|
18
17
|
// NOTE: Add more if needed
|
|
19
18
|
justifyStart?: boolean
|
|
@@ -35,7 +34,7 @@ export interface FlexProps {
|
|
|
35
34
|
const props = defineProps<FlexProps>()
|
|
36
35
|
|
|
37
36
|
// Flex gap
|
|
38
|
-
const ag =
|
|
37
|
+
const ag = computed(() => `var(--space-${props.gap})`)
|
|
39
38
|
|
|
40
39
|
// Flex direction
|
|
41
40
|
const ad = computed(() => {
|
|
@@ -91,19 +90,17 @@ const aH = computed(() => props.expand ? '100%' : 'auto')
|
|
|
91
90
|
</script>
|
|
92
91
|
|
|
93
92
|
<template>
|
|
94
|
-
<div
|
|
93
|
+
<div
|
|
94
|
+
class="vui-flex" :style="{
|
|
95
|
+
display: aY,
|
|
96
|
+
flexWrap: aW,
|
|
97
|
+
flexDirection: ad,
|
|
98
|
+
justifyContent: aj,
|
|
99
|
+
gap: ag,
|
|
100
|
+
alignItems: aA,
|
|
101
|
+
width: aH,
|
|
102
|
+
}"
|
|
103
|
+
>
|
|
95
104
|
<slot />
|
|
96
105
|
</div>
|
|
97
106
|
</template>
|
|
98
|
-
|
|
99
|
-
<style scoped lang="scss">
|
|
100
|
-
.vui-flex {
|
|
101
|
-
display: v-bind(aY);
|
|
102
|
-
flex-wrap: v-bind(aW);
|
|
103
|
-
flex-direction: v-bind(ad);
|
|
104
|
-
justify-content: v-bind(aj);
|
|
105
|
-
gap: v-bind(ag);
|
|
106
|
-
align-items: v-bind(aA);
|
|
107
|
-
width: v-bind(aH);
|
|
108
|
-
}
|
|
109
|
-
</style>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Space } from '../../shared/types'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
|
-
import { useActualGap } from '../../shared/composables'
|
|
5
4
|
import { createArray } from '../../shared/helpers'
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -10,7 +9,7 @@ import { createArray } from '../../shared/helpers'
|
|
|
10
9
|
|
|
11
10
|
interface Props {
|
|
12
11
|
inline?: boolean
|
|
13
|
-
gap?:
|
|
12
|
+
gap?: Space | number
|
|
14
13
|
rows?: number | string
|
|
15
14
|
columns?: number | string
|
|
16
15
|
areas?: string[]
|
|
@@ -18,7 +17,7 @@ interface Props {
|
|
|
18
17
|
|
|
19
18
|
const props = defineProps<Props>()
|
|
20
19
|
|
|
21
|
-
const
|
|
20
|
+
const ag = computed(() => `var(--space-${props.gap})`)
|
|
22
21
|
|
|
23
22
|
const aTC = computed(() => {
|
|
24
23
|
if (typeof props.columns === 'number') {
|
|
@@ -43,17 +42,13 @@ const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
|
|
|
43
42
|
|
|
44
43
|
<template>
|
|
45
44
|
<div
|
|
46
|
-
class="vui-grid"
|
|
45
|
+
class="vui-grid" :style="{
|
|
46
|
+
display: aD,
|
|
47
|
+
gap: ag,
|
|
48
|
+
gridTemplateColumns: aTC,
|
|
49
|
+
gridTemplateRows: aTR,
|
|
50
|
+
}"
|
|
47
51
|
>
|
|
48
52
|
<slot />
|
|
49
53
|
</div>
|
|
50
54
|
</template>
|
|
51
|
-
|
|
52
|
-
<style scoped lang="scss">
|
|
53
|
-
.vui-grid {
|
|
54
|
-
display: v-bind(aD);
|
|
55
|
-
gap: v-bind(aG);
|
|
56
|
-
grid-template-columns: v-bind(aTC);
|
|
57
|
-
grid-template-rows: v-bind(aTR);
|
|
58
|
-
}
|
|
59
|
-
</style>
|
|
@@ -56,6 +56,11 @@ const fS = computed(() => autoResize ? 'content' : 'auto')
|
|
|
56
56
|
:placeholder
|
|
57
57
|
:required
|
|
58
58
|
:max="limit"
|
|
59
|
+
:style="{
|
|
60
|
+
resize: r,
|
|
61
|
+
// @ts-expect-error Early-adoption CSS attribute
|
|
62
|
+
fieldSizing: fS,
|
|
63
|
+
}"
|
|
59
64
|
/>
|
|
60
65
|
</div>
|
|
61
66
|
<p v-if="limit" class="vui-input-limit">
|
|
@@ -69,10 +74,3 @@ const fS = computed(() => autoResize ? 'content' : 'auto')
|
|
|
69
74
|
<slot name="after" />
|
|
70
75
|
</div>
|
|
71
76
|
</template>
|
|
72
|
-
|
|
73
|
-
<style scoped lang="scss">
|
|
74
|
-
.vui-input-container .vui-input textarea {
|
|
75
|
-
resize: v-bind(r);
|
|
76
|
-
field-sizing: v-bind(fS);
|
|
77
|
-
}
|
|
78
|
-
</style>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
border: 1px solid var(--color-border-strong);
|
|
16
16
|
color: var(--color-text);
|
|
17
17
|
z-index: 1;
|
|
18
|
-
font-size: var(--font-size-
|
|
18
|
+
font-size: var(--font-size-m);
|
|
19
19
|
outline: 0 solid var(--color-text-light);
|
|
20
20
|
transition: var(--transition);
|
|
21
21
|
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
// TODO: animate blinking cursor
|
|
51
50
|
&.active {
|
|
52
51
|
z-index: 2;
|
|
53
52
|
outline-width: 2px;
|
|
@@ -80,13 +80,11 @@ const bC = computed(() => color)
|
|
|
80
80
|
'fixed-active': progressAmount > 0 && progressAmount < 100,
|
|
81
81
|
}"
|
|
82
82
|
>
|
|
83
|
-
<div
|
|
83
|
+
<div
|
|
84
|
+
class="vui-progress-indicator" :style="{
|
|
85
|
+
width: w,
|
|
86
|
+
backgroundColor: bC,
|
|
87
|
+
}"
|
|
88
|
+
/>
|
|
84
89
|
</div>
|
|
85
90
|
</template>
|
|
86
|
-
|
|
87
|
-
<style scoped lang="scss">
|
|
88
|
-
.vui-progress-indicator {
|
|
89
|
-
width: v-bind(w);
|
|
90
|
-
background-color: v-bind(bC);
|
|
91
|
-
}
|
|
92
|
-
</style>
|
|
@@ -33,13 +33,11 @@ const h = computed(() => formatUnitValue(circle ? (width || height) : height))
|
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<template>
|
|
36
|
-
<div
|
|
36
|
+
<div
|
|
37
|
+
class="vui-skeleton" :style="{
|
|
38
|
+
borderRadius: bR,
|
|
39
|
+
width: w,
|
|
40
|
+
height: h,
|
|
41
|
+
}"
|
|
42
|
+
/>
|
|
37
43
|
</template>
|
|
38
|
-
|
|
39
|
-
<style lang="scss" scoped>
|
|
40
|
-
.vui-skeleton {
|
|
41
|
-
border-radius: v-bind(bR);
|
|
42
|
-
width: v-bind(w);
|
|
43
|
-
height: v-bind(h);
|
|
44
|
-
}
|
|
45
|
-
</style>
|
|
@@ -32,13 +32,11 @@ const bW = computed(() => {
|
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<template>
|
|
35
|
-
<div
|
|
35
|
+
<div
|
|
36
|
+
:class="{ size }" class="vui-spinner" :style="{
|
|
37
|
+
width: w,
|
|
38
|
+
height: w,
|
|
39
|
+
borderWidth: bW,
|
|
40
|
+
}"
|
|
41
|
+
/>
|
|
36
42
|
</template>
|
|
37
|
-
|
|
38
|
-
<style lang="scss">
|
|
39
|
-
.vui-spinner {
|
|
40
|
-
width: v-bind(w);
|
|
41
|
-
height: v-bind(w);
|
|
42
|
-
border-width: v-bind(bW);
|
|
43
|
-
}
|
|
44
|
-
</style>
|
|
@@ -14,7 +14,13 @@ const id = computed(() => props.id ?? props.label)
|
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<template>
|
|
17
|
-
<button
|
|
17
|
+
<button
|
|
18
|
+
class="vui-tab"
|
|
19
|
+
:data-tab-id="id"
|
|
20
|
+
:class="{ disabled: props.disabled }"
|
|
21
|
+
role="tab"
|
|
22
|
+
:name="id"
|
|
23
|
+
>
|
|
18
24
|
<Icon v-if="props.icon" :icon="props.icon" />
|
|
19
25
|
{{ props.label }}
|
|
20
26
|
</button>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// share some tiny global state
|
|
2
|
-
|
|
3
1
|
import { ref } from 'vue'
|
|
4
2
|
|
|
5
3
|
interface ToastAction {
|
|
@@ -68,25 +66,3 @@ export function pushToast(title: string, options?: ToastOptions): Toast {
|
|
|
68
66
|
export function removeToast(id: number): void {
|
|
69
67
|
toasts.value.delete(id)
|
|
70
68
|
}
|
|
71
|
-
|
|
72
|
-
//////
|
|
73
|
-
|
|
74
|
-
// export const toastError: NewToastFn = (title, options) => {
|
|
75
|
-
// return pushToast('error', title, options)
|
|
76
|
-
// }
|
|
77
|
-
|
|
78
|
-
// export const toastSuccess: NewToastFn = (title, options) => {
|
|
79
|
-
// return pushToast('success', title, options)
|
|
80
|
-
// }
|
|
81
|
-
|
|
82
|
-
// export const toastInfo: NewToastFn = (title, options) => {
|
|
83
|
-
// return pushToast('info', title, options)
|
|
84
|
-
// }
|
|
85
|
-
|
|
86
|
-
// export const toastNeutral: NewToastFn = (title, options) => {
|
|
87
|
-
// return pushToast('neutral', title, options)
|
|
88
|
-
// }
|
|
89
|
-
|
|
90
|
-
// export const toastWarning: NewToastFn = (title, options) => {
|
|
91
|
-
// return pushToast('warning', title, options)
|
|
92
|
-
// }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
2
|
import type { Placement } from '../../shared/types'
|
|
3
|
-
import { ref, useTemplateRef, watch } from 'vue'
|
|
3
|
+
import { ref, useId, useTemplateRef, watch } from 'vue'
|
|
4
4
|
import Popout from '../Popout/Popout.vue'
|
|
5
5
|
import './tooltip.scss'
|
|
6
6
|
|
|
@@ -50,18 +50,22 @@ watch(hoverAnchor, (isHovering) => {
|
|
|
50
50
|
showTooltip.value = false
|
|
51
51
|
}
|
|
52
52
|
})
|
|
53
|
+
|
|
54
|
+
const id = useId()
|
|
53
55
|
</script>
|
|
54
56
|
|
|
55
57
|
<template>
|
|
56
58
|
<div
|
|
57
59
|
ref="popoutAnchor"
|
|
60
|
+
class="inline-block"
|
|
61
|
+
:aria-describedby="id"
|
|
58
62
|
@mouseenter="hoverAnchor = true"
|
|
59
63
|
@mouseleave="hoverAnchor = false"
|
|
60
64
|
>
|
|
61
65
|
<slot />
|
|
62
66
|
</div>
|
|
63
67
|
<Transition appear name="tooltip">
|
|
64
|
-
<Popout v-if="showTooltip" :anchor="popoutAnchorRef" class="vui-tooltip" :placement>
|
|
68
|
+
<Popout v-if="showTooltip" :id :anchor="popoutAnchorRef" class="vui-tooltip" :placement name="tooltip">
|
|
65
69
|
<slot name="tooltip" />
|
|
66
70
|
</Popout>
|
|
67
71
|
</Transition>
|