@dolanske/vui 1.4.1 → 1.4.2
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/package.json +1 -2
- package/src/App.vue +0 -103
- package/src/components/Accordion/Accordion.vue +0 -98
- package/src/components/Accordion/AccordionGroup.vue +0 -49
- package/src/components/Accordion/accordion.scss +0 -97
- package/src/components/Alert/Alert.vue +0 -59
- package/src/components/Alert/alert.scss +0 -162
- package/src/components/Avatar/Avatar.vue +0 -53
- package/src/components/Avatar/avatar.scss +0 -52
- package/src/components/Badge/Badge.vue +0 -21
- package/src/components/Badge/badge.scss +0 -210
- package/src/components/Breadcrumbs/BreadcrumbItem.vue +0 -26
- package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -29
- package/src/components/Breadcrumbs/breadcrumbs.scss +0 -31
- package/src/components/Button/Button.vue +0 -86
- package/src/components/Button/button.scss +0 -292
- package/src/components/ButtonGroup/ButtonGroup.vue +0 -28
- package/src/components/ButtonGroup/button-group.scss +0 -51
- package/src/components/Calendar/Calendar.vue +0 -66
- package/src/components/Calendar/calendar.scss +0 -88
- package/src/components/Card/Card.vue +0 -48
- package/src/components/Card/card.scss +0 -55
- package/src/components/Checkbox/Checkbox.vue +0 -54
- package/src/components/Checkbox/checkbox.scss +0 -80
- package/src/components/CopyClipboard/CopyClipboard.vue +0 -98
- package/src/components/CopyClipboard/copy-clipboard.scss +0 -25
- package/src/components/Divider/Divider.vue +0 -38
- package/src/components/Divider/divider.scss +0 -37
- package/src/components/Drawer/Drawer.vue +0 -102
- package/src/components/Drawer/drawer.scss +0 -37
- package/src/components/Dropdown/Dropdown.vue +0 -120
- package/src/components/Dropdown/DropdownItem.vue +0 -33
- package/src/components/Dropdown/DropdownTitle.vue +0 -14
- package/src/components/Dropdown/dropdown-item.scss +0 -84
- package/src/components/Dropdown/dropdown.scss +0 -53
- package/src/components/Flex/Flex.vue +0 -113
- package/src/components/Grid/Grid.vue +0 -87
- package/src/components/Input/Color.vue +0 -26
- package/src/components/Input/Counter.vue +0 -66
- package/src/components/Input/Dropzone.vue +0 -65
- package/src/components/Input/File.vue +0 -15
- package/src/components/Input/Input.vue +0 -123
- package/src/components/Input/Password.vue +0 -35
- package/src/components/Input/Textarea.vue +0 -78
- package/src/components/Input/input.scss +0 -302
- package/src/components/Kbd/Kbd.vue +0 -48
- package/src/components/Kbd/KbdGroup.vue +0 -28
- package/src/components/Kbd/kbd.scss +0 -19
- package/src/components/Modal/Confirm.vue +0 -56
- package/src/components/Modal/Modal.vue +0 -103
- package/src/components/Modal/modal.scss +0 -54
- package/src/components/OTP/OTP.vue +0 -133
- package/src/components/OTP/OTPItem.vue +0 -37
- package/src/components/OTP/otp.scss +0 -84
- package/src/components/Pagination/Pagination.vue +0 -92
- package/src/components/Pagination/pagination.ts +0 -78
- package/src/components/Popout/Popout.vue +0 -73
- package/src/components/Popout/popout.scss +0 -16
- package/src/components/Progress/Progress.vue +0 -103
- package/src/components/Progress/progress.scss +0 -47
- package/src/components/Radio/Radio.vue +0 -38
- package/src/components/Radio/RadioGroup.vue +0 -34
- package/src/components/Radio/radio.scss +0 -78
- package/src/components/Select/Select.vue +0 -212
- package/src/components/Select/select.scss +0 -82
- package/src/components/Sheet/Sheet.vue +0 -106
- package/src/components/Sheet/sheet.scss +0 -71
- package/src/components/Sidebar/Sidebar.vue +0 -116
- package/src/components/Sidebar/sidebar.scss +0 -124
- package/src/components/Skeleton/Skeleton.vue +0 -43
- package/src/components/Skeleton/skeleton.scss +0 -14
- package/src/components/Spinner/Spinner.vue +0 -42
- package/src/components/Spinner/spinner.scss +0 -47
- package/src/components/Switch/Switch.vue +0 -31
- package/src/components/Switch/switch.scss +0 -93
- package/src/components/Table/Cell.vue +0 -23
- package/src/components/Table/Head.vue +0 -66
- package/src/components/Table/Root.vue +0 -66
- package/src/components/Table/SelectAll.vue +0 -23
- package/src/components/Table/SelectRow.vue +0 -30
- package/src/components/Table/index.ts +0 -7
- package/src/components/Table/table.scss +0 -155
- package/src/components/Table/table.ts +0 -248
- package/src/components/Tabs/Tab.vue +0 -25
- package/src/components/Tabs/Tabs.vue +0 -90
- package/src/components/Tabs/tabs.scss +0 -87
- package/src/components/Toast/Toasts.vue +0 -52
- package/src/components/Toast/toast.scss +0 -45
- package/src/components/Toast/toast.ts +0 -75
- package/src/components/Tooltip/Tooltip.vue +0 -78
- package/src/components/Tooltip/tooltip.scss +0 -5
- package/src/examples/ExampleAccordions.vue +0 -69
- package/src/examples/ExampleAlerts.vue +0 -78
- package/src/examples/ExampleAvatars.vue +0 -44
- package/src/examples/ExampleBadges.vue +0 -48
- package/src/examples/ExampleBreadcrumbs.vue +0 -46
- package/src/examples/ExampleButtons.vue +0 -148
- package/src/examples/ExampleCalendars.vue +0 -40
- package/src/examples/ExampleCards.vue +0 -94
- package/src/examples/ExampleCheckboxes.vue +0 -123
- package/src/examples/ExampleCopyClipboard.vue +0 -47
- package/src/examples/ExampleDividers.vue +0 -39
- package/src/examples/ExampleDrawers.vue +0 -67
- package/src/examples/ExampleDropdowns.vue +0 -114
- package/src/examples/ExampleFlexGrid.vue +0 -124
- package/src/examples/ExampleInputs.vue +0 -236
- package/src/examples/ExampleKBD.vue +0 -65
- package/src/examples/ExampleModals.vue +0 -143
- package/src/examples/ExamplePalette.vue +0 -165
- package/src/examples/ExamplePopouts.vue +0 -41
- package/src/examples/ExampleSheets.vue +0 -77
- package/src/examples/ExampleSidebars.vue +0 -276
- package/src/examples/ExampleSkeletons.vue +0 -26
- package/src/examples/ExampleSpinners.vue +0 -80
- package/src/examples/ExampleTables.vue +0 -359
- package/src/examples/ExampleTabs.vue +0 -142
- package/src/examples/ExampleToasts.vue +0 -96
- package/src/examples/ExampleTooltips.vue +0 -70
- package/src/examples/shared/ExampleColor.vue +0 -28
- package/src/index.ts +0 -116
- package/src/internal/Backdrop/Backdrop.vue +0 -22
- package/src/internal/Backdrop/backdrop.scss +0 -34
- package/src/main.ts +0 -5
- package/src/shared/helpers.ts +0 -124
- package/src/shared/slots.ts +0 -61
- package/src/shared/theme.ts +0 -22
- package/src/shared/types.ts +0 -29
- package/src/style/animation.scss +0 -50
- package/src/style/core.scss +0 -133
- package/src/style/fonts.scss +0 -73
- package/src/style/layout.scss +0 -179
- package/src/style/media-query.scss +0 -29
- package/src/style/reset.scss +0 -135
- package/src/style/text.scss +0 -137
- package/src/style/theme.scss +0 -195
- package/src/style/tooltip.scss +0 -146
- package/src/style/typography.scss +0 -435
- package/src/style/utils.scss +0 -36
- package/src/style.scss +0 -1
- package/src/vite-env.d.ts +0 -1
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
.vui-input-container {
|
|
2
|
-
&.vui-select {
|
|
3
|
-
width: auto;
|
|
4
|
-
min-width: 96px;
|
|
5
|
-
|
|
6
|
-
&.expand {
|
|
7
|
-
.vui-dropdown-trigger-wrap,
|
|
8
|
-
.vui-dropdown-trigger-content {
|
|
9
|
-
width: 100%;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&.disabled {
|
|
14
|
-
.vui-input-style {
|
|
15
|
-
cursor: not-allowed;
|
|
16
|
-
|
|
17
|
-
&:hover {
|
|
18
|
-
border-color: var(--color-border);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.vui-select-trigger-container {
|
|
24
|
-
&.has-value span {
|
|
25
|
-
color: var(--color-text);
|
|
26
|
-
font-weight: var(--font-weight-medium);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.vui-button {
|
|
30
|
-
border: none !important;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
span {
|
|
34
|
-
white-space: nowrap;
|
|
35
|
-
text-overflow: ellipsis;
|
|
36
|
-
overflow-x: hidden;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.vue-select-no-results {
|
|
41
|
-
text-align: center;
|
|
42
|
-
padding-block: var(--space-xs);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.vui-input-style {
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: space-between;
|
|
49
|
-
gap: var(--space-s);
|
|
50
|
-
|
|
51
|
-
& > button {
|
|
52
|
-
margin-right: -6px;
|
|
53
|
-
|
|
54
|
-
.vui-button-slot svg {
|
|
55
|
-
color: var(--color-text-light);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&:hover {
|
|
60
|
-
border-color: var(--color-border-strong);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
select {
|
|
67
|
-
display: block;
|
|
68
|
-
height: var(--interactive-el-height);
|
|
69
|
-
line-height: var(--interactive-el-height);
|
|
70
|
-
background-color: var(--color-bg);
|
|
71
|
-
border: 1px solid var(--color-border);
|
|
72
|
-
border-radius: var(--border-radius-s);
|
|
73
|
-
padding-inline: var(--space-xs);
|
|
74
|
-
transition: var(--transition-fast);
|
|
75
|
-
z-index: var(--z-default);
|
|
76
|
-
font-size: var(--font-size-m);
|
|
77
|
-
color: var(--color-text);
|
|
78
|
-
|
|
79
|
-
&:hover {
|
|
80
|
-
border-color: var(--color-border-strong);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
<script setup lang='ts'>
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
import Backdrop from '../../internal/Backdrop/Backdrop.vue'
|
|
4
|
-
import { formatUnitValue } from '../../shared/helpers'
|
|
5
|
-
import Button from '../Button/Button.vue'
|
|
6
|
-
import Divider from '../Divider/Divider.vue'
|
|
7
|
-
import './sheet.scss'
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
/**
|
|
11
|
-
* Controls the visibility of the sheet
|
|
12
|
-
*/
|
|
13
|
-
open?: boolean
|
|
14
|
-
/**
|
|
15
|
-
* Controls the position of the sheet
|
|
16
|
-
*/
|
|
17
|
-
position?: 'left' | 'right' | 'top' | 'bottom'
|
|
18
|
-
/**
|
|
19
|
-
* Sets the width of the sheet
|
|
20
|
-
*/
|
|
21
|
-
size?: number | string
|
|
22
|
-
/**
|
|
23
|
-
* Wether to show a divider between header and content
|
|
24
|
-
*/
|
|
25
|
-
separator?: boolean
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const {
|
|
29
|
-
position = 'right',
|
|
30
|
-
size = 398,
|
|
31
|
-
separator,
|
|
32
|
-
open = false,
|
|
33
|
-
} = defineProps<Props>()
|
|
34
|
-
|
|
35
|
-
const emit = defineEmits<{ close: [] }>()
|
|
36
|
-
|
|
37
|
-
const TRANSITION_OFFSET = 16
|
|
38
|
-
|
|
39
|
-
const style = computed(() => {
|
|
40
|
-
if (position === 'left' || position === 'right') {
|
|
41
|
-
return { width: formatUnitValue(size) }
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return undefined
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
// Used to compute base location so that sheet appears to animate form the edge of the screen
|
|
48
|
-
const baseTransform = computed(() => {
|
|
49
|
-
switch (position) {
|
|
50
|
-
case 'left': return `translate(-${TRANSITION_OFFSET}px, 0)`
|
|
51
|
-
case 'top': return `translate(0, -${TRANSITION_OFFSET}px)`
|
|
52
|
-
case 'bottom': return `translate(0, ${TRANSITION_OFFSET}px)`
|
|
53
|
-
case 'right':
|
|
54
|
-
default: return `translate(${TRANSITION_OFFSET}px, 0)`
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
</script>
|
|
58
|
-
|
|
59
|
-
<template>
|
|
60
|
-
<Teleport to="body">
|
|
61
|
-
<Transition appear name="sheet">
|
|
62
|
-
<Backdrop v-if="open" @close="emit('close')">
|
|
63
|
-
<div v-if="open" class="vui-sheet" :class="[`vui-sheet-position-${position}`]" :style>
|
|
64
|
-
<div class="vui-sheet-header">
|
|
65
|
-
<slot name="header" :close="() => emit('close')" />
|
|
66
|
-
<Button plain square icon="ph:x" @click="emit('close')" />
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<Divider v-if="separator && $slots.header" :size="1" />
|
|
70
|
-
|
|
71
|
-
<div v-if="$slots.default" class="vui-sheet-content">
|
|
72
|
-
<slot :close="() => emit('close')" />
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
<Divider v-if="separator && $slots.footer" :size="1" />
|
|
76
|
-
|
|
77
|
-
<div class="vui-sheet-footer">
|
|
78
|
-
<slot name="footer" :close="() => emit('close')" />
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</Backdrop>
|
|
82
|
-
</Transition>
|
|
83
|
-
</Teleport>
|
|
84
|
-
</template>
|
|
85
|
-
|
|
86
|
-
<style scoped lang="scss">
|
|
87
|
-
.vui-backdrop {
|
|
88
|
-
padding: 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.sheet-enter-active,
|
|
92
|
-
.sheet-leave-active {
|
|
93
|
-
transition: var(--transition);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.sheet-enter-to,
|
|
97
|
-
.sheet-leave-from {
|
|
98
|
-
transform: translate(0, 0);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.sheet-enter-from,
|
|
102
|
-
.sheet-leave-to {
|
|
103
|
-
opacity: 0;
|
|
104
|
-
transform: v-bind(baseTransform);
|
|
105
|
-
}
|
|
106
|
-
</style>
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
.vui-sheet {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
position: absolute;
|
|
5
|
-
background-color: var(--color-bg);
|
|
6
|
-
border-color: var(--color-border);
|
|
7
|
-
height: 100dvh;
|
|
8
|
-
|
|
9
|
-
&.vui-sheet-position-top {
|
|
10
|
-
top: 0;
|
|
11
|
-
border-bottom: 1px solid var(--color-border);
|
|
12
|
-
height: auto;
|
|
13
|
-
border-bottom-right-radius: var(--border-radius-l);
|
|
14
|
-
border-bottom-left-radius: var(--border-radius-l);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&.vui-sheet-position-bottom {
|
|
18
|
-
bottom: 0;
|
|
19
|
-
border-top: 1px solid var(--color-border);
|
|
20
|
-
height: auto;
|
|
21
|
-
border-top-right-radius: var(--border-radius-l);
|
|
22
|
-
border-top-left-radius: var(--border-radius-l);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&.vui-sheet-position-right {
|
|
26
|
-
right: 0;
|
|
27
|
-
top: 0;
|
|
28
|
-
border-left: 1px solid var(--color-border);
|
|
29
|
-
border-top-left-radius: var(--border-radius-l);
|
|
30
|
-
border-bottom-left-radius: var(--border-radius-l);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&.vui-sheet-position-left {
|
|
34
|
-
left: 0;
|
|
35
|
-
top: 0;
|
|
36
|
-
border-right: 1px solid var(--color-border);
|
|
37
|
-
border-top-right-radius: var(--border-radius-l);
|
|
38
|
-
border-bottom-right-radius: var(--border-radius-l);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&.vui-sheet-position-top,
|
|
42
|
-
&.vui-sheet-position-bottom {
|
|
43
|
-
max-height: 35dvh;
|
|
44
|
-
width: 100%;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.vui-sheet-footer,
|
|
48
|
-
.vui-sheet-header,
|
|
49
|
-
.vui-sheet-content {
|
|
50
|
-
width: 100%;
|
|
51
|
-
padding: var(--space-m);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.vui-sheet-content {
|
|
55
|
-
flex: 1 1 0%;
|
|
56
|
-
overflow-y: auto;
|
|
57
|
-
height: 100%;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.vui-sheet-header {
|
|
61
|
-
display: grid;
|
|
62
|
-
grid-template-columns: 1fr 34px;
|
|
63
|
-
gap: var(--space-m);
|
|
64
|
-
align-self: flex-start;
|
|
65
|
-
align-items: center;
|
|
66
|
-
|
|
67
|
-
& + .vui-sheet-content {
|
|
68
|
-
padding-top: var(--space-s);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
<script setup lang='ts'>
|
|
2
|
-
import { useCssVar, useMouseInElement, useTimeoutFn, watchThrottled } from '@vueuse/core'
|
|
3
|
-
import { computed, onBeforeMount, 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 sidebarRef = useTemplateRef('sidebar')
|
|
30
|
-
const open = defineModel<boolean>({
|
|
31
|
-
default: true,
|
|
32
|
-
})
|
|
33
|
-
const slots = useSlots()
|
|
34
|
-
const offset = useCssVar('--vui-sidebar-float-offset', sidebarRef, {
|
|
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 wrapEl = useTemplateRef('wrap')
|
|
65
|
-
const { elementX } = useMouseInElement(wrapEl)
|
|
66
|
-
|
|
67
|
-
onBeforeMount(() => {
|
|
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
|
-
immediate: true,
|
|
96
|
-
})
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<template>
|
|
100
|
-
<div ref="wrap" class="vui-sidebar-outer" :style="{ width }" :class="{ open }">
|
|
101
|
-
<aside ref="sidebar" class="vui-sidebar" :class="{ open, floaty: props.floaty, mini: props.mini }" :style="{ width: `${props.mini ? 65 : props.width}px` }">
|
|
102
|
-
<div v-if="slots.header" class="vui-sidebar-header">
|
|
103
|
-
<slot name="header" v-bind="slotProps" />
|
|
104
|
-
</div>
|
|
105
|
-
<div class="vui-sidebar-content">
|
|
106
|
-
<div class="vui-sidebar-content-wrap">
|
|
107
|
-
<slot v-bind="slotProps" />
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<div v-if="slots.footer" class="vui-sidebar-footer">
|
|
112
|
-
<slot name="footer" v-bind="slotProps" />
|
|
113
|
-
</div>
|
|
114
|
-
</aside>
|
|
115
|
-
</div>
|
|
116
|
-
</template>
|
|
@@ -1,124 +0,0 @@
|
|
|
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: var(--z-nav);
|
|
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 +0,0 @@
|
|
|
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,42 +0,0 @@
|
|
|
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,47 +0,0 @@
|
|
|
1
|
-
.vui-spinner {
|
|
2
|
-
--spinner-color: var(--color-accent);
|
|
3
|
-
|
|
4
|
-
aspect-ratio: 1;
|
|
5
|
-
border-radius: 50%;
|
|
6
|
-
border: 3px solid var(--spinner-color);
|
|
7
|
-
animation:
|
|
8
|
-
l20-1 0.8s infinite linear alternate,
|
|
9
|
-
l20-2 1.6s infinite linear;
|
|
10
|
-
}
|
|
11
|
-
@keyframes l20-1 {
|
|
12
|
-
0% {
|
|
13
|
-
clip-path: polygon(50% 50%, 0 0, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
|
|
14
|
-
}
|
|
15
|
-
12.5% {
|
|
16
|
-
clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0%);
|
|
17
|
-
}
|
|
18
|
-
25% {
|
|
19
|
-
clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100%);
|
|
20
|
-
}
|
|
21
|
-
50% {
|
|
22
|
-
clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
|
|
23
|
-
}
|
|
24
|
-
62.5% {
|
|
25
|
-
clip-path: polygon(50% 50%, 100% 0, 100% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
|
|
26
|
-
}
|
|
27
|
-
75% {
|
|
28
|
-
clip-path: polygon(50% 50%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 50% 100%, 0% 100%);
|
|
29
|
-
}
|
|
30
|
-
100% {
|
|
31
|
-
clip-path: polygon(50% 50%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 0% 100%);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
@keyframes l20-2 {
|
|
35
|
-
0% {
|
|
36
|
-
transform: scaleY(1) rotate(0deg);
|
|
37
|
-
}
|
|
38
|
-
49.99% {
|
|
39
|
-
transform: scaleY(1) rotate(135deg);
|
|
40
|
-
}
|
|
41
|
-
50% {
|
|
42
|
-
transform: scaleY(-1) rotate(0deg);
|
|
43
|
-
}
|
|
44
|
-
100% {
|
|
45
|
-
transform: scaleY(-1) rotate(-135deg);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useId } from 'vue'
|
|
3
|
-
import './switch.scss'
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
label?: string
|
|
7
|
-
disabled?: boolean
|
|
8
|
-
accent?: boolean
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const { label, disabled, accent } = defineProps<Props>()
|
|
12
|
-
const slots = defineSlots()
|
|
13
|
-
const checked = defineModel<boolean>()
|
|
14
|
-
const id = useId()
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<div class="vui-switch" :class="{ disabled, checked, accent }">
|
|
19
|
-
<input :id v-model="checked" type="checkbox" :disabled>
|
|
20
|
-
<label :for="id">
|
|
21
|
-
<div class="vui-switch-icon">
|
|
22
|
-
<span class="vui-switch-indicator" />
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<p v-if="!slots.default" class="vui-switch-content">{{ label }}</p>
|
|
26
|
-
<div v-else class="vui-switch-content">
|
|
27
|
-
<slot />
|
|
28
|
-
</div>
|
|
29
|
-
</label>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|