@dolanske/vui 1.0.3 → 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/{index.scss → style.scss} +1 -1
- package/dist/style.css +0 -1
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
<script setup lang='ts'>
|
|
2
|
-
import { useCssVar, useMouseInElement, useTimeoutFn, watchThrottled } from '@vueuse/core'
|
|
3
|
-
import { computed, onMounted, useSlots, useTemplateRef } from 'vue'
|
|
4
|
-
import { isNil } from '../../shared/helpers'
|
|
5
|
-
import './sidebar.scss'
|
|
6
|
-
|
|
7
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
8
|
-
width: 224,
|
|
9
|
-
mini: false,
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
interface Props {
|
|
13
|
-
width?: number
|
|
14
|
-
/**
|
|
15
|
-
* Controls wether the sidebar is displayed in full size, or a small version
|
|
16
|
-
*/
|
|
17
|
-
mini?: boolean
|
|
18
|
-
/**
|
|
19
|
-
* Allow sidebar showing up, when user hovers at very left of the screen. The
|
|
20
|
-
* sidebar will apear over content, not pushing anything over
|
|
21
|
-
*/
|
|
22
|
-
appear?: boolean
|
|
23
|
-
/**
|
|
24
|
-
* Add edges of background around sidebar
|
|
25
|
-
*/
|
|
26
|
-
floaty?: boolean
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const sidebar = useTemplateRef('sidebar')
|
|
30
|
-
const open = defineModel<boolean>({
|
|
31
|
-
default: true,
|
|
32
|
-
})
|
|
33
|
-
const slots = useSlots()
|
|
34
|
-
const offset = useCssVar('--vui-sidebar-float-offset', sidebar, {
|
|
35
|
-
initialValue: '8px',
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
const width = computed(() => {
|
|
39
|
-
if (props.mini) {
|
|
40
|
-
return props.floaty ? '73px' : `65px`
|
|
41
|
-
}
|
|
42
|
-
if (!props.floaty)
|
|
43
|
-
return `${props.width}px`
|
|
44
|
-
return `calc(${props.width}px + ${offset.value})`
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
const slotProps = computed(() => ({
|
|
48
|
-
mini: props.mini,
|
|
49
|
-
floaty: props.floaty,
|
|
50
|
-
width: props.width,
|
|
51
|
-
open,
|
|
52
|
-
close: () => open.value = false,
|
|
53
|
-
}))
|
|
54
|
-
|
|
55
|
-
// Sidebar `appear` implementation
|
|
56
|
-
const { start, stop, isPending } = useTimeoutFn(() => {
|
|
57
|
-
if (props.appear) {
|
|
58
|
-
open.value = true
|
|
59
|
-
}
|
|
60
|
-
}, 250)
|
|
61
|
-
|
|
62
|
-
const APPEAR_OFFSET = 32
|
|
63
|
-
|
|
64
|
-
const wrap = useTemplateRef('wrap')
|
|
65
|
-
const { elementX } = useMouseInElement(wrap)
|
|
66
|
-
|
|
67
|
-
onMounted(() => {
|
|
68
|
-
if (props.appear && open.value) {
|
|
69
|
-
open.value = false
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
watchThrottled(elementX, (pos) => {
|
|
74
|
-
if (!props.appear || (pos <= APPEAR_OFFSET && pos >= 0 && isPending.value))
|
|
75
|
-
return
|
|
76
|
-
|
|
77
|
-
if (pos <= APPEAR_OFFSET && pos >= 0 && !open.value && !isPending.value) {
|
|
78
|
-
start()
|
|
79
|
-
}
|
|
80
|
-
else if (isPending.value) {
|
|
81
|
-
stop()
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const openWidth = props.mini
|
|
85
|
-
? 65
|
|
86
|
-
: props.floaty
|
|
87
|
-
? props.width
|
|
88
|
-
: props.width - (isNil(offset.value) ? 0 : Number(offset.value?.replace('px', '')))
|
|
89
|
-
|
|
90
|
-
if ((pos > APPEAR_OFFSET + openWidth || pos < 0) && open.value) {
|
|
91
|
-
open.value = false
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
throttle: 100,
|
|
95
|
-
})
|
|
96
|
-
</script>
|
|
97
|
-
|
|
98
|
-
<template>
|
|
99
|
-
<div ref="wrap" class="vui-sidebar-outer" :style="{ width }" :class="{ open }">
|
|
100
|
-
<aside ref="sidebar" class="vui-sidebar" :class="{ open, floaty: props.floaty, mini: props.mini }" :style="{ width: `${props.mini ? 65 : props.width}px` }">
|
|
101
|
-
<div v-if="slots.header" class="vui-sidebar-header">
|
|
102
|
-
<slot name="header" v-bind="slotProps" />
|
|
103
|
-
</div>
|
|
104
|
-
<div class="vui-sidebar-content">
|
|
105
|
-
<div class="vui-sidebar-content-wrap">
|
|
106
|
-
<slot v-bind="slotProps" />
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
<div v-if="slots.footer" class="vui-sidebar-footer">
|
|
111
|
-
<slot name="footer" v-bind="slotProps" />
|
|
112
|
-
</div>
|
|
113
|
-
</aside>
|
|
114
|
-
</div>
|
|
115
|
-
</template>
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import { useCssVar, useMouseInElement, useTimeoutFn, watchThrottled } from '@vueuse/core'
|
|
3
|
+
import { computed, onMounted, useSlots, useTemplateRef } from 'vue'
|
|
4
|
+
import { isNil } from '../../shared/helpers'
|
|
5
|
+
import './sidebar.scss'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
8
|
+
width: 224,
|
|
9
|
+
mini: false,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
width?: number
|
|
14
|
+
/**
|
|
15
|
+
* Controls wether the sidebar is displayed in full size, or a small version
|
|
16
|
+
*/
|
|
17
|
+
mini?: boolean
|
|
18
|
+
/**
|
|
19
|
+
* Allow sidebar showing up, when user hovers at very left of the screen. The
|
|
20
|
+
* sidebar will apear over content, not pushing anything over
|
|
21
|
+
*/
|
|
22
|
+
appear?: boolean
|
|
23
|
+
/**
|
|
24
|
+
* Add edges of background around sidebar
|
|
25
|
+
*/
|
|
26
|
+
floaty?: boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const sidebar = useTemplateRef('sidebar')
|
|
30
|
+
const open = defineModel<boolean>({
|
|
31
|
+
default: true,
|
|
32
|
+
})
|
|
33
|
+
const slots = useSlots()
|
|
34
|
+
const offset = useCssVar('--vui-sidebar-float-offset', sidebar, {
|
|
35
|
+
initialValue: '8px',
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const width = computed(() => {
|
|
39
|
+
if (props.mini) {
|
|
40
|
+
return props.floaty ? '73px' : `65px`
|
|
41
|
+
}
|
|
42
|
+
if (!props.floaty)
|
|
43
|
+
return `${props.width}px`
|
|
44
|
+
return `calc(${props.width}px + ${offset.value})`
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const slotProps = computed(() => ({
|
|
48
|
+
mini: props.mini,
|
|
49
|
+
floaty: props.floaty,
|
|
50
|
+
width: props.width,
|
|
51
|
+
open,
|
|
52
|
+
close: () => open.value = false,
|
|
53
|
+
}))
|
|
54
|
+
|
|
55
|
+
// Sidebar `appear` implementation
|
|
56
|
+
const { start, stop, isPending } = useTimeoutFn(() => {
|
|
57
|
+
if (props.appear) {
|
|
58
|
+
open.value = true
|
|
59
|
+
}
|
|
60
|
+
}, 250)
|
|
61
|
+
|
|
62
|
+
const APPEAR_OFFSET = 32
|
|
63
|
+
|
|
64
|
+
const wrap = useTemplateRef('wrap')
|
|
65
|
+
const { elementX } = useMouseInElement(wrap)
|
|
66
|
+
|
|
67
|
+
onMounted(() => {
|
|
68
|
+
if (props.appear && open.value) {
|
|
69
|
+
open.value = false
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
watchThrottled(elementX, (pos) => {
|
|
74
|
+
if (!props.appear || (pos <= APPEAR_OFFSET && pos >= 0 && isPending.value))
|
|
75
|
+
return
|
|
76
|
+
|
|
77
|
+
if (pos <= APPEAR_OFFSET && pos >= 0 && !open.value && !isPending.value) {
|
|
78
|
+
start()
|
|
79
|
+
}
|
|
80
|
+
else if (isPending.value) {
|
|
81
|
+
stop()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const openWidth = props.mini
|
|
85
|
+
? 65
|
|
86
|
+
: props.floaty
|
|
87
|
+
? props.width
|
|
88
|
+
: props.width - (isNil(offset.value) ? 0 : Number(offset.value?.replace('px', '')))
|
|
89
|
+
|
|
90
|
+
if ((pos > APPEAR_OFFSET + openWidth || pos < 0) && open.value) {
|
|
91
|
+
open.value = false
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
throttle: 100,
|
|
95
|
+
})
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<div ref="wrap" class="vui-sidebar-outer" :style="{ width }" :class="{ open }">
|
|
100
|
+
<aside ref="sidebar" class="vui-sidebar" :class="{ open, floaty: props.floaty, mini: props.mini }" :style="{ width: `${props.mini ? 65 : props.width}px` }">
|
|
101
|
+
<div v-if="slots.header" class="vui-sidebar-header">
|
|
102
|
+
<slot name="header" v-bind="slotProps" />
|
|
103
|
+
</div>
|
|
104
|
+
<div class="vui-sidebar-content">
|
|
105
|
+
<div class="vui-sidebar-content-wrap">
|
|
106
|
+
<slot v-bind="slotProps" />
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div v-if="slots.footer" class="vui-sidebar-footer">
|
|
111
|
+
<slot name="footer" v-bind="slotProps" />
|
|
112
|
+
</div>
|
|
113
|
+
</aside>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
// TODO: flesh out better
|
|
2
|
-
.vui-sidebar-layout {
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-wrap: nowrap;
|
|
5
|
-
gap: 0;
|
|
6
|
-
height: 100vh;
|
|
7
|
-
position: relative;
|
|
8
|
-
|
|
9
|
-
main {
|
|
10
|
-
flex: 1;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.vui-sidebar-outer {
|
|
14
|
-
transition: var(--transition-slow);
|
|
15
|
-
|
|
16
|
-
&:not(.open) {
|
|
17
|
-
width: 0px !important;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.vui-sidebar {
|
|
23
|
-
--vui-sidebar-float-offset: 8px;
|
|
24
|
-
display: flex;
|
|
25
|
-
height: 100%;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
gap: var(--space-sm);
|
|
28
|
-
width: 224px;
|
|
29
|
-
position: absolute;
|
|
30
|
-
top: 0;
|
|
31
|
-
z-index: 50;
|
|
32
|
-
background-color: var(--color-bg);
|
|
33
|
-
border-right: 1px solid var(--color-border);
|
|
34
|
-
transition: var(--transition-slow);
|
|
35
|
-
transform: translateX(-100%);
|
|
36
|
-
will-change: transform;
|
|
37
|
-
|
|
38
|
-
&.open {
|
|
39
|
-
transform: translateX(0);
|
|
40
|
-
|
|
41
|
-
&.floaty {
|
|
42
|
-
transform: translateX(0);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&.floaty {
|
|
47
|
-
top: var(--vui-sidebar-float-offset);
|
|
48
|
-
left: var(--vui-sidebar-float-offset);
|
|
49
|
-
bottom: var(--vui-sidebar-float-offset);
|
|
50
|
-
height: calc(100% - calc(var(--vui-sidebar-float-offset) * 2));
|
|
51
|
-
border-radius: var(--border-radius-m);
|
|
52
|
-
border: 1px solid var(--color-border);
|
|
53
|
-
transform: translateX(calc(-100% - calc(var(--vui-sidebar-float-offset) * 2)));
|
|
54
|
-
box-shadow: var(--box-shadow);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.vui-sidebar-header,
|
|
58
|
-
.vui-sidebar-footer,
|
|
59
|
-
.vui-sidebar-content .vui-sidebar-content-wrap {
|
|
60
|
-
padding: var(--space-s);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.vui-sidebar-header:not(:only-child) {
|
|
64
|
-
padding-bottom: 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.vui-sidebar-footer:not(:only-child) {
|
|
68
|
-
padding-top: 0;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.vui-sidebar-content {
|
|
72
|
-
flex: 1;
|
|
73
|
-
position: relative;
|
|
74
|
-
|
|
75
|
-
.vui-sidebar-content-wrap {
|
|
76
|
-
position: absolute;
|
|
77
|
-
inset: 0;
|
|
78
|
-
overflow-y: auto;
|
|
79
|
-
overflow-x: hidden;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Note: elements in sidebar (& mini) should have a slight modification
|
|
84
|
-
|
|
85
|
-
// Accordion
|
|
86
|
-
// Does not have a border under content
|
|
87
|
-
.vui-accordion {
|
|
88
|
-
border-bottom: 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// DropdownItems (sidebar items
|
|
92
|
-
// Should have a bit less spacing between slots
|
|
93
|
-
.vui-dropdown-item {
|
|
94
|
-
padding-inline: var(--space-xs);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&.mini {
|
|
98
|
-
.vui-dropdown-item .vui-dropdown-item-icon {
|
|
99
|
-
width: 20px;
|
|
100
|
-
height: 20px;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.vui-dropdown-item,
|
|
104
|
-
.vui-button {
|
|
105
|
-
--button-height: 40px;
|
|
106
|
-
width: var(--button-height) !important;
|
|
107
|
-
height: var(--button-height) !important;
|
|
108
|
-
justify-content: center;
|
|
109
|
-
align-items: center;
|
|
110
|
-
|
|
111
|
-
svg {
|
|
112
|
-
width: 20px;
|
|
113
|
-
height: 20px;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.vui-dropdown-item-slot,
|
|
117
|
-
.vui-dropdown-item-hint,
|
|
118
|
-
.vui-button-slot-end,
|
|
119
|
-
.vui-button-slot-start {
|
|
120
|
-
display: none;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
1
|
+
// TODO: flesh out better
|
|
2
|
+
.vui-sidebar-layout {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-wrap: nowrap;
|
|
5
|
+
gap: 0;
|
|
6
|
+
height: 100vh;
|
|
7
|
+
position: relative;
|
|
8
|
+
|
|
9
|
+
main {
|
|
10
|
+
flex: 1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.vui-sidebar-outer {
|
|
14
|
+
transition: var(--transition-slow);
|
|
15
|
+
|
|
16
|
+
&:not(.open) {
|
|
17
|
+
width: 0px !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.vui-sidebar {
|
|
23
|
+
--vui-sidebar-float-offset: 8px;
|
|
24
|
+
display: flex;
|
|
25
|
+
height: 100%;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
gap: var(--space-sm);
|
|
28
|
+
width: 224px;
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 0;
|
|
31
|
+
z-index: 50;
|
|
32
|
+
background-color: var(--color-bg);
|
|
33
|
+
border-right: 1px solid var(--color-border);
|
|
34
|
+
transition: var(--transition-slow);
|
|
35
|
+
transform: translateX(-100%);
|
|
36
|
+
will-change: transform;
|
|
37
|
+
|
|
38
|
+
&.open {
|
|
39
|
+
transform: translateX(0);
|
|
40
|
+
|
|
41
|
+
&.floaty {
|
|
42
|
+
transform: translateX(0);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.floaty {
|
|
47
|
+
top: var(--vui-sidebar-float-offset);
|
|
48
|
+
left: var(--vui-sidebar-float-offset);
|
|
49
|
+
bottom: var(--vui-sidebar-float-offset);
|
|
50
|
+
height: calc(100% - calc(var(--vui-sidebar-float-offset) * 2));
|
|
51
|
+
border-radius: var(--border-radius-m);
|
|
52
|
+
border: 1px solid var(--color-border);
|
|
53
|
+
transform: translateX(calc(-100% - calc(var(--vui-sidebar-float-offset) * 2)));
|
|
54
|
+
box-shadow: var(--box-shadow);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.vui-sidebar-header,
|
|
58
|
+
.vui-sidebar-footer,
|
|
59
|
+
.vui-sidebar-content .vui-sidebar-content-wrap {
|
|
60
|
+
padding: var(--space-s);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.vui-sidebar-header:not(:only-child) {
|
|
64
|
+
padding-bottom: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.vui-sidebar-footer:not(:only-child) {
|
|
68
|
+
padding-top: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.vui-sidebar-content {
|
|
72
|
+
flex: 1;
|
|
73
|
+
position: relative;
|
|
74
|
+
|
|
75
|
+
.vui-sidebar-content-wrap {
|
|
76
|
+
position: absolute;
|
|
77
|
+
inset: 0;
|
|
78
|
+
overflow-y: auto;
|
|
79
|
+
overflow-x: hidden;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Note: elements in sidebar (& mini) should have a slight modification
|
|
84
|
+
|
|
85
|
+
// Accordion
|
|
86
|
+
// Does not have a border under content
|
|
87
|
+
.vui-accordion {
|
|
88
|
+
border-bottom: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// DropdownItems (sidebar items
|
|
92
|
+
// Should have a bit less spacing between slots
|
|
93
|
+
.vui-dropdown-item {
|
|
94
|
+
padding-inline: var(--space-xs);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.mini {
|
|
98
|
+
.vui-dropdown-item .vui-dropdown-item-icon {
|
|
99
|
+
width: 20px;
|
|
100
|
+
height: 20px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.vui-dropdown-item,
|
|
104
|
+
.vui-button {
|
|
105
|
+
--button-height: 40px;
|
|
106
|
+
width: var(--button-height) !important;
|
|
107
|
+
height: var(--button-height) !important;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
align-items: center;
|
|
110
|
+
|
|
111
|
+
svg {
|
|
112
|
+
width: 20px;
|
|
113
|
+
height: 20px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.vui-dropdown-item-slot,
|
|
117
|
+
.vui-dropdown-item-hint,
|
|
118
|
+
.vui-button-slot-end,
|
|
119
|
+
.vui-button-slot-start {
|
|
120
|
+
display: none;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
<!-- eslint-disable ts/no-use-before-define -->
|
|
2
|
-
<script setup lang='ts'>
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
import { formatUnitValue } from '../../shared/helpers'
|
|
5
|
-
import './skeleton.scss'
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
radius?: string | number
|
|
9
|
-
width?: string | number
|
|
10
|
-
height?: string | number
|
|
11
|
-
circle?: boolean
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const {
|
|
15
|
-
// @ts-expect-error I can't get ESLint to STOP moving DEFAULT_RADIUS below
|
|
16
|
-
// this props declaration wtf
|
|
17
|
-
radius = DEFAULT_RADIUS,
|
|
18
|
-
width = '100%',
|
|
19
|
-
height = '32px',
|
|
20
|
-
circle,
|
|
21
|
-
} = defineProps<Props>()
|
|
22
|
-
|
|
23
|
-
const DEFAULT_RADIUS = 'var(--border-radius-s)'
|
|
24
|
-
|
|
25
|
-
// Give priority to radius, if it is NOT set to default
|
|
26
|
-
const bR = computed(() => formatUnitValue(circle && radius === DEFAULT_RADIUS ? 9999 : radius))
|
|
27
|
-
|
|
28
|
-
// When using `circle` prop, we want to use the same
|
|
29
|
-
// value for both height and width, but we can't
|
|
30
|
-
// know which one will be defined
|
|
31
|
-
const w = computed(() => formatUnitValue(circle ? (width || height) : width))
|
|
32
|
-
const h = computed(() => formatUnitValue(circle ? (width || height) : height))
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<template>
|
|
36
|
-
<div
|
|
37
|
-
class="vui-skeleton" :style="{
|
|
38
|
-
borderRadius: bR,
|
|
39
|
-
width: w,
|
|
40
|
-
height: h,
|
|
41
|
-
}"
|
|
42
|
-
/>
|
|
43
|
-
</template>
|
|
1
|
+
<!-- eslint-disable ts/no-use-before-define -->
|
|
2
|
+
<script setup lang='ts'>
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import { formatUnitValue } from '../../shared/helpers'
|
|
5
|
+
import './skeleton.scss'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
radius?: string | number
|
|
9
|
+
width?: string | number
|
|
10
|
+
height?: string | number
|
|
11
|
+
circle?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
// @ts-expect-error I can't get ESLint to STOP moving DEFAULT_RADIUS below
|
|
16
|
+
// this props declaration wtf
|
|
17
|
+
radius = DEFAULT_RADIUS,
|
|
18
|
+
width = '100%',
|
|
19
|
+
height = '32px',
|
|
20
|
+
circle,
|
|
21
|
+
} = defineProps<Props>()
|
|
22
|
+
|
|
23
|
+
const DEFAULT_RADIUS = 'var(--border-radius-s)'
|
|
24
|
+
|
|
25
|
+
// Give priority to radius, if it is NOT set to default
|
|
26
|
+
const bR = computed(() => formatUnitValue(circle && radius === DEFAULT_RADIUS ? 9999 : radius))
|
|
27
|
+
|
|
28
|
+
// When using `circle` prop, we want to use the same
|
|
29
|
+
// value for both height and width, but we can't
|
|
30
|
+
// know which one will be defined
|
|
31
|
+
const w = computed(() => formatUnitValue(circle ? (width || height) : width))
|
|
32
|
+
const h = computed(() => formatUnitValue(circle ? (width || height) : height))
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div
|
|
37
|
+
class="vui-skeleton" :style="{
|
|
38
|
+
borderRadius: bR,
|
|
39
|
+
width: w,
|
|
40
|
+
height: h,
|
|
41
|
+
}"
|
|
42
|
+
/>
|
|
43
|
+
</template>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
.vui-skeleton {
|
|
2
|
-
animation: pulse 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
3
|
-
background-color: var(--color-border);
|
|
4
|
-
|
|
5
|
-
@keyframes pulse {
|
|
6
|
-
0%,
|
|
7
|
-
100% {
|
|
8
|
-
opacity: 1;
|
|
9
|
-
}
|
|
10
|
-
50% {
|
|
11
|
-
opacity: 0.5;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
1
|
+
.vui-skeleton {
|
|
2
|
+
animation: pulse 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
3
|
+
background-color: var(--color-border);
|
|
4
|
+
|
|
5
|
+
@keyframes pulse {
|
|
6
|
+
0%,
|
|
7
|
+
100% {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
}
|
|
10
|
+
50% {
|
|
11
|
+
opacity: 0.5;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Sizes } from '../../shared/types'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
import { Size } from '../../shared/types'
|
|
5
|
-
import './spinner.scss'
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
size?: Sizes
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
size = 's',
|
|
13
|
-
} = defineProps<Props>()
|
|
14
|
-
|
|
15
|
-
const w = computed(() => {
|
|
16
|
-
switch (size) {
|
|
17
|
-
case Size.s: return '16px'
|
|
18
|
-
case Size.l: return '38px'
|
|
19
|
-
case Size.m:
|
|
20
|
-
default: return '26px'
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const bW = computed(() => {
|
|
25
|
-
switch (size) {
|
|
26
|
-
case Size.s: return '3px'
|
|
27
|
-
case Size.l: return '5px'
|
|
28
|
-
case Size.m:
|
|
29
|
-
default: return '4px'
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<div
|
|
36
|
-
:class="{ size }" class="vui-spinner" :style="{
|
|
37
|
-
width: w,
|
|
38
|
-
height: w,
|
|
39
|
-
borderWidth: bW,
|
|
40
|
-
}"
|
|
41
|
-
/>
|
|
42
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Sizes } from '../../shared/types'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import { Size } from '../../shared/types'
|
|
5
|
+
import './spinner.scss'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
size?: Sizes
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
size = 's',
|
|
13
|
+
} = defineProps<Props>()
|
|
14
|
+
|
|
15
|
+
const w = computed(() => {
|
|
16
|
+
switch (size) {
|
|
17
|
+
case Size.s: return '16px'
|
|
18
|
+
case Size.l: return '38px'
|
|
19
|
+
case Size.m:
|
|
20
|
+
default: return '26px'
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const bW = computed(() => {
|
|
25
|
+
switch (size) {
|
|
26
|
+
case Size.s: return '3px'
|
|
27
|
+
case Size.l: return '5px'
|
|
28
|
+
case Size.m:
|
|
29
|
+
default: return '4px'
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<div
|
|
36
|
+
:class="{ size }" class="vui-spinner" :style="{
|
|
37
|
+
width: w,
|
|
38
|
+
height: w,
|
|
39
|
+
borderWidth: bW,
|
|
40
|
+
}"
|
|
41
|
+
/>
|
|
42
|
+
</template>
|