@dolanske/vui 1.4.0 → 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/dist/components/Accordion/Accordion.vue.d.ts +48 -0
- package/dist/components/Accordion/AccordionGroup.vue.d.ts +21 -0
- package/dist/components/Alert/Alert.vue.d.ts +36 -0
- package/dist/components/Avatar/Avatar.vue.d.ts +25 -0
- package/dist/components/Badge/Badge.vue.d.ts +22 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +22 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +18 -0
- package/dist/components/Button/Button.vue.d.ts +32 -0
- package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +22 -0
- package/dist/components/Calendar/Calendar.vue.d.ts +27 -0
- package/dist/components/Card/Card.vue.d.ts +26 -0
- package/dist/components/Checkbox/Checkbox.vue.d.ts +33 -0
- package/dist/components/CopyClipboard/CopyClipboard.vue.d.ts +46 -0
- package/dist/components/Divider/Divider.vue.d.ts +23 -0
- package/dist/components/Drawer/Drawer.vue.d.ts +53 -0
- package/dist/components/Dropdown/Dropdown.vue.d.ts +177 -0
- package/dist/components/Dropdown/DropdownItem.vue.d.ts +23 -0
- package/dist/components/Dropdown/DropdownTitle.vue.d.ts +21 -0
- package/dist/components/Flex/Flex.vue.d.ts +41 -0
- package/dist/components/Grid/Grid.vue.d.ts +35 -0
- package/dist/components/Input/Color.vue.d.ts +11 -0
- package/dist/components/Input/Counter.vue.d.ts +19 -0
- package/dist/components/Input/Dropzone.vue.d.ts +193 -0
- package/dist/components/Input/File.vue.d.ts +8 -0
- package/dist/components/Input/Input.vue.d.ts +56 -0
- package/dist/components/Input/Password.vue.d.ts +6 -0
- package/dist/components/Input/Textarea.vue.d.ts +31 -0
- package/dist/components/Kbd/Kbd.vue.d.ts +23 -0
- package/dist/components/Kbd/KbdGroup.vue.d.ts +19 -0
- package/dist/components/Modal/Confirm.vue.d.ts +43 -0
- package/dist/components/Modal/Modal.vue.d.ts +58 -0
- package/dist/components/OTP/OTP.vue.d.ts +44 -0
- package/dist/components/OTP/OTPItem.vue.d.ts +5 -0
- package/dist/components/Pagination/Pagination.vue.d.ts +46 -0
- package/dist/components/Pagination/pagination.d.ts +12 -0
- package/dist/components/Popout/Popout.vue.d.ts +36 -0
- package/dist/components/Progress/Progress.vue.d.ts +33 -0
- package/dist/components/Radio/Radio.vue.d.ts +29 -0
- package/dist/components/Radio/RadioGroup.vue.d.ts +27 -0
- package/dist/components/Select/Select.vue.d.ts +35 -0
- package/dist/components/Sheet/Sheet.vue.d.ts +47 -0
- package/dist/components/Sidebar/Sidebar.vue.d.ts +70 -0
- package/dist/components/Skeleton/Skeleton.vue.d.ts +8 -0
- package/dist/components/Spinner/Spinner.vue.d.ts +6 -0
- package/dist/components/Switch/Switch.vue.d.ts +28 -0
- package/dist/components/Table/Cell.vue.d.ts +22 -0
- package/dist/components/Table/Head.vue.d.ts +30 -0
- package/dist/components/Table/Root.vue.d.ts +41 -0
- package/dist/components/Table/SelectAll.vue.d.ts +2 -0
- package/dist/components/Table/SelectRow.vue.d.ts +6 -0
- package/dist/components/Table/index.d.ts +6 -0
- package/dist/components/Table/table.d.ts +68 -0
- package/dist/components/Tabs/Tab.vue.d.ts +22 -0
- package/dist/components/Tabs/Tabs.vue.d.ts +34 -0
- package/dist/components/Toast/Toasts.vue.d.ts +2 -0
- package/dist/components/Toast/toast.d.ts +287 -0
- package/dist/components/Tooltip/Tooltip.vue.d.ts +33 -0
- package/dist/fonts/GeistMono-Regular.ttf +0 -0
- package/dist/fonts/GeistMono-SemiBold.ttf +0 -0
- package/dist/fonts/Inter_18pt-Black.ttf +0 -0
- package/dist/fonts/Inter_18pt-Bold.ttf +0 -0
- package/dist/fonts/Inter_18pt-ExtraBold.ttf +0 -0
- package/dist/fonts/Inter_18pt-Light.ttf +0 -0
- package/dist/fonts/Inter_18pt-Medium.ttf +0 -0
- package/dist/fonts/Inter_18pt-Regular.ttf +0 -0
- package/dist/fonts/Inter_18pt-SemiBold.ttf +0 -0
- package/dist/index.d.ts +56 -0
- package/dist/internal/Backdrop/Backdrop.vue.d.ts +21 -0
- package/dist/shared/helpers.d.ts +34 -0
- package/dist/shared/slots.d.ts +20 -0
- package/dist/shared/theme.d.ts +3 -0
- package/dist/shared/types.d.ts +24 -0
- package/dist/vui.css +1 -0
- package/dist/vui.js +16215 -0
- 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,102 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { DrawerPortalProps, DrawerRootProps } from 'vaul-vue'
|
|
3
|
-
import type { Sizes, VueClass } from '../../shared/types'
|
|
4
|
-
import { DrawerContent, DrawerOverlay, DrawerPortal, DrawerRoot, DrawerTitle } from 'vaul-vue'
|
|
5
|
-
import { computed, onMounted, useId } from 'vue'
|
|
6
|
-
import './drawer.scss'
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
/**
|
|
10
|
-
* Controls the visibility of the drawer
|
|
11
|
-
*/
|
|
12
|
-
open?: boolean
|
|
13
|
-
/**
|
|
14
|
-
* Title for accessibility.
|
|
15
|
-
*/
|
|
16
|
-
title?: string
|
|
17
|
-
/**
|
|
18
|
-
* CSS class applied to the container of the drawer content. Accepts Vue's
|
|
19
|
-
* class conditional declaration, string, object or an array.
|
|
20
|
-
*/
|
|
21
|
-
containerClass?: VueClass
|
|
22
|
-
/**
|
|
23
|
-
* Size of the container. Either use a preset size or number to specify
|
|
24
|
-
* max-width of the container.
|
|
25
|
-
*/
|
|
26
|
-
containerSize?: Sizes | 'xl' | 'full' | number
|
|
27
|
-
/**
|
|
28
|
-
* Wether to display the handle symbol. It doesn't actually do anything, it's
|
|
29
|
-
* just for the visuals.
|
|
30
|
-
*/
|
|
31
|
-
handle?: boolean
|
|
32
|
-
/**
|
|
33
|
-
* Control the underlying Vaul root component
|
|
34
|
-
*/
|
|
35
|
-
rootProps?: DrawerRootProps
|
|
36
|
-
portalProps?: DrawerPortalProps
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const {
|
|
40
|
-
title,
|
|
41
|
-
containerClass,
|
|
42
|
-
containerSize = 'm',
|
|
43
|
-
rootProps,
|
|
44
|
-
portalProps,
|
|
45
|
-
handle = true,
|
|
46
|
-
open = false,
|
|
47
|
-
} = defineProps<Props>()
|
|
48
|
-
|
|
49
|
-
const emit = defineEmits<{ close: [] }>()
|
|
50
|
-
|
|
51
|
-
const mW = computed(() => {
|
|
52
|
-
if (typeof containerSize === 'string') {
|
|
53
|
-
if (containerSize === 'full') {
|
|
54
|
-
return '100%'
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
return getComputedStyle(document.documentElement)
|
|
58
|
-
.getPropertyValue(`--container-${containerSize}`)
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
return `${containerSize}px`
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
const id = useId()
|
|
67
|
-
|
|
68
|
-
onMounted(() => {
|
|
69
|
-
if (!document.querySelector('[vaul-drawer-wrapper]')) {
|
|
70
|
-
console.error('Your root component is missing \'vaul-drawer-wrapper\' attribute. \n Without it the <Drawer /> component will not be functional.')
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
</script>
|
|
74
|
-
|
|
75
|
-
<template>
|
|
76
|
-
<DrawerRoot
|
|
77
|
-
:open
|
|
78
|
-
v-bind="rootProps"
|
|
79
|
-
:aria-describedby="id"
|
|
80
|
-
@close=" emit('close')"
|
|
81
|
-
@update:open="(state) => state === false && emit('close')"
|
|
82
|
-
>
|
|
83
|
-
<DrawerPortal v-bind="portalProps">
|
|
84
|
-
<DrawerOverlay class="vui-drawer-overlay" />
|
|
85
|
-
<DrawerContent class="vui-drawer-content" :class="{ 'hide-handle': handle === false }">
|
|
86
|
-
<div :key="mW" class="vui-drawer-container container" :class="containerClass" :style="{ 'max-width': mW }">
|
|
87
|
-
<DrawerTitle class="visually-hidden" :name="id">
|
|
88
|
-
{{ title }}
|
|
89
|
-
</DrawerTitle>
|
|
90
|
-
<slot />
|
|
91
|
-
</div>
|
|
92
|
-
</DrawerContent>
|
|
93
|
-
</DrawerPortal>
|
|
94
|
-
</DrawerRoot>
|
|
95
|
-
</template>
|
|
96
|
-
|
|
97
|
-
<style lang="scss" scoped>
|
|
98
|
-
:global(body) {
|
|
99
|
-
transition: var(--transition-fast);
|
|
100
|
-
background-color: var(--color-bg);
|
|
101
|
-
}
|
|
102
|
-
</style>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
.vui-drawer-content {
|
|
2
|
-
background-color: var(--color-bg-raised);
|
|
3
|
-
padding-inline: var(--space-l);
|
|
4
|
-
border-top: 1px solid var(--color-border);
|
|
5
|
-
border-top-left-radius: var(--border-radius-l);
|
|
6
|
-
border-top-right-radius: var(--border-radius-l);
|
|
7
|
-
padding-top: 30px;
|
|
8
|
-
padding-bottom: 64px;
|
|
9
|
-
position: fixed;
|
|
10
|
-
bottom: 0;
|
|
11
|
-
left: 0;
|
|
12
|
-
right: 0;
|
|
13
|
-
box-shadow: var(--box-shadow);
|
|
14
|
-
|
|
15
|
-
&.hide-handle:before {
|
|
16
|
-
display: none;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.vaul-dragging {
|
|
20
|
-
&:before {
|
|
21
|
-
background-color: var(--color-text-lighter);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&:before {
|
|
26
|
-
content: '';
|
|
27
|
-
position: absolute;
|
|
28
|
-
left: 50%;
|
|
29
|
-
transform: translateX(-50%);
|
|
30
|
-
width: 56px;
|
|
31
|
-
height: 6px;
|
|
32
|
-
top: 12px;
|
|
33
|
-
border-radius: 3px;
|
|
34
|
-
background-color: var(--color-border-strong);
|
|
35
|
-
transition: var(--transition-fast);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
<script setup lang='ts'>
|
|
2
|
-
import type { MaybeElement } from '@vueuse/core'
|
|
3
|
-
import type { Placement } from '../../shared/types'
|
|
4
|
-
import { onClickOutside, useMagicKeys, whenever } from '@vueuse/core'
|
|
5
|
-
import { computed, onMounted, ref, useTemplateRef, watch } from 'vue'
|
|
6
|
-
import { formatUnitValue } from '../../shared/helpers'
|
|
7
|
-
import Popout from '../Popout/Popout.vue'
|
|
8
|
-
import './dropdown.scss'
|
|
9
|
-
|
|
10
|
-
export interface Props {
|
|
11
|
-
/**
|
|
12
|
-
* Tooltip placement related to the anchor
|
|
13
|
-
*/
|
|
14
|
-
placement?: Placement
|
|
15
|
-
/**
|
|
16
|
-
* Set the minimum width of the dropdown element
|
|
17
|
-
*/
|
|
18
|
-
minWidth?: number | string
|
|
19
|
-
/**
|
|
20
|
-
* Sets the width of the dropdown to the width of its anchor
|
|
21
|
-
*/
|
|
22
|
-
expand?: boolean
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Set he max height of the dropdown element before it starts scrolling
|
|
26
|
-
*/
|
|
27
|
-
maxHeight?: number | string
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const {
|
|
31
|
-
placement = 'bottom-start',
|
|
32
|
-
maxHeight = 356,
|
|
33
|
-
expand,
|
|
34
|
-
minWidth = 156,
|
|
35
|
-
} = defineProps<Props>()
|
|
36
|
-
|
|
37
|
-
const emit = defineEmits<{
|
|
38
|
-
close: []
|
|
39
|
-
}>()
|
|
40
|
-
|
|
41
|
-
const anchorRef = useTemplateRef<HTMLDivElement>('anchor')
|
|
42
|
-
const dropdownRef = useTemplateRef<MaybeElement>('dropdown')
|
|
43
|
-
|
|
44
|
-
const showMenu = ref(false)
|
|
45
|
-
|
|
46
|
-
function open() {
|
|
47
|
-
showMenu.value = true
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function close() {
|
|
51
|
-
showMenu.value = false
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function toggle() {
|
|
55
|
-
showMenu.value = !showMenu.value
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
onClickOutside(dropdownRef, (event) => {
|
|
59
|
-
// Hide dropdown when it is clicked outside EXCEPT when we click the trigger,
|
|
60
|
-
// as that is either by the slot itself
|
|
61
|
-
if (!anchorRef.value?.contains(event.target as Node | null))
|
|
62
|
-
showMenu.value = false
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
const anchorWidth = computed(() => {
|
|
66
|
-
if (!expand || !window)
|
|
67
|
-
return 0
|
|
68
|
-
return anchorRef.value?.getBoundingClientRect().width
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
defineExpose({
|
|
72
|
-
open,
|
|
73
|
-
close,
|
|
74
|
-
toggle,
|
|
75
|
-
isOpen: showMenu,
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
const mW = computed(() => formatUnitValue(minWidth))
|
|
79
|
-
const w = computed(() => expand ? `${anchorWidth.value}px` : 'initial')
|
|
80
|
-
|
|
81
|
-
const { escape } = useMagicKeys()
|
|
82
|
-
whenever(escape, close)
|
|
83
|
-
|
|
84
|
-
watch(showMenu, (v) => {
|
|
85
|
-
if (!v)
|
|
86
|
-
emit('close')
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
onMounted(() => {
|
|
90
|
-
if (expand && minWidth !== 156)
|
|
91
|
-
console.warn('[Dropdown] Dropdown: minWidth prop is ignored when expand is set to true')
|
|
92
|
-
})
|
|
93
|
-
</script>
|
|
94
|
-
|
|
95
|
-
<template>
|
|
96
|
-
<div
|
|
97
|
-
ref="anchor"
|
|
98
|
-
class="vui-dropdown-trigger-wrap"
|
|
99
|
-
role="button"
|
|
100
|
-
:aria-expanded="showMenu"
|
|
101
|
-
:aria-haspopup="true"
|
|
102
|
-
name="Dropdown menu"
|
|
103
|
-
>
|
|
104
|
-
<slot name="trigger" :open :is-open="showMenu" :close :toggle />
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<Popout
|
|
108
|
-
ref="dropdown"
|
|
109
|
-
:visible="showMenu"
|
|
110
|
-
:anchor="anchorRef"
|
|
111
|
-
class="vui-dropdown"
|
|
112
|
-
:placement
|
|
113
|
-
:style="{
|
|
114
|
-
minWidth: expand ? w : mW,
|
|
115
|
-
maxHeight: formatUnitValue(maxHeight),
|
|
116
|
-
}"
|
|
117
|
-
>
|
|
118
|
-
<slot :open :close :toggle :is-open="showMenu" />
|
|
119
|
-
</Popout>
|
|
120
|
-
</template>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<script setup lang='ts'>
|
|
2
|
-
import { Icon } from '@iconify/vue'
|
|
3
|
-
import './dropdown-item.scss'
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
disabled?: boolean
|
|
7
|
-
icon?: string
|
|
8
|
-
iconEnd?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const props = defineProps<Props>()
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<button class="vui-dropdown-item" :class="{ disabled }" :disabled>
|
|
16
|
-
<!-- This should always be here to offset items which dont have icons -->
|
|
17
|
-
<div v-if="props.icon" class="vui-dropdown-item-icon">
|
|
18
|
-
<Icon :icon="props.icon" />
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div class="vui-dropdown-item-slot">
|
|
22
|
-
<slot />
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<div v-if="$slots.hint" class="vui-dropdown-item-hint">
|
|
26
|
-
<slot name="hint" />
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<div v-if="props.iconEnd" class="vui-dropdown-item-icon">
|
|
30
|
-
<Icon :icon="props.iconEnd" />
|
|
31
|
-
</div>
|
|
32
|
-
</button>
|
|
33
|
-
</template>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
const { sticky } = defineProps<{
|
|
3
|
-
sticky?: boolean
|
|
4
|
-
}>()
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<div class="vui-dropdown-title" :class="{ sticky }">
|
|
9
|
-
<slot />
|
|
10
|
-
<div v-if="$slots.end" class="vui-dropdown-title-end">
|
|
11
|
-
<slot name="end" />
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
.vui-dropdown-item {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: flex-start;
|
|
5
|
-
width: fit-content;
|
|
6
|
-
gap: var(--space-xs);
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: var(--interactive-el-height);
|
|
9
|
-
border-radius: var(--border-radius-m);
|
|
10
|
-
font-size: var(--font-size-m);
|
|
11
|
-
cursor: default;
|
|
12
|
-
transition: var(--transition-fast);
|
|
13
|
-
padding-inline: var(--space-s);
|
|
14
|
-
white-space: nowrap;
|
|
15
|
-
margin-bottom: 4px;
|
|
16
|
-
|
|
17
|
-
&:last-child {
|
|
18
|
-
margin-bottom: 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.disabled {
|
|
22
|
-
pointer-events: none;
|
|
23
|
-
|
|
24
|
-
&:hover {
|
|
25
|
-
background-color: transparent;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.vui-dropdown-item-slot,
|
|
29
|
-
.vui-dropdown-item-icon svg path {
|
|
30
|
-
color: var(--color-text-lighter);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.vui-dropdown-item-hint {
|
|
34
|
-
visibility: hidden;
|
|
35
|
-
opacity: 0;
|
|
36
|
-
z-index: var(--z-behind);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.vui-dropdown-item-icon {
|
|
41
|
-
width: 16px;
|
|
42
|
-
height: 16px;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: center;
|
|
46
|
-
|
|
47
|
-
svg {
|
|
48
|
-
width: 16px;
|
|
49
|
-
height: 16px;
|
|
50
|
-
|
|
51
|
-
path {
|
|
52
|
-
color: var(--color-text-light);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.vui-dropdown-item-hint {
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
gap: 2px;
|
|
61
|
-
margin-left: 8px;
|
|
62
|
-
font-size: 0.9rem;
|
|
63
|
-
// white-space: nowrap;
|
|
64
|
-
color: var(--color-text-lighter);
|
|
65
|
-
|
|
66
|
-
svg {
|
|
67
|
-
color: var(--color-text-lighter);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.vui-dropdown-item-slot {
|
|
72
|
-
flex: 1;
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
justify-content: flex-start;
|
|
76
|
-
color: var(--color-text);
|
|
77
|
-
flex-wrap: nowrap;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&.selected,
|
|
81
|
-
&:hover {
|
|
82
|
-
background-color: var(--color-button-gray-hover);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
.vui-dropdown-trigger-wrap {
|
|
2
|
-
// width: fit-content;
|
|
3
|
-
position: relative;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.vui-dropdown {
|
|
7
|
-
min-width: 156px;
|
|
8
|
-
border-radius: var(--border-radius-m);
|
|
9
|
-
border: 1px solid var(--color-border);
|
|
10
|
-
padding: 4px;
|
|
11
|
-
overflow-y: auto;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.vui-dropdown-title {
|
|
15
|
-
position: relative;
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: flex-start;
|
|
19
|
-
padding-block: var(--space-xs);
|
|
20
|
-
padding-inline: calc(var(--space-xs) + 8px);
|
|
21
|
-
font-size: var(--font-size-m);
|
|
22
|
-
border-bottom: 1px solid var(--color-border);
|
|
23
|
-
font-weight: var(--font-weight-semibold);
|
|
24
|
-
margin-inline: -4px;
|
|
25
|
-
margin-top: -4px;
|
|
26
|
-
margin-bottom: 4px;
|
|
27
|
-
gap: var(--space-m);
|
|
28
|
-
justify-content: space-between;
|
|
29
|
-
background-color: var(--color-bg-medium);
|
|
30
|
-
z-index: var(--z-popout);
|
|
31
|
-
|
|
32
|
-
&.sticky {
|
|
33
|
-
position: sticky;
|
|
34
|
-
top: -4px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&:not(:first-child) {
|
|
38
|
-
margin-top: 4px;
|
|
39
|
-
border-top: 1px solid var(--color-border);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.vui-dropdown-title-end {
|
|
43
|
-
font-size: var(--font-size-s);
|
|
44
|
-
font-weight: var(--font-weight);
|
|
45
|
-
color: var(--color-text-lighter);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:root.light {
|
|
50
|
-
.vui-dropdown-title {
|
|
51
|
-
background-color: var(--color-bg);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Space } from '../../shared/types'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
import { formatUnitValue } from '../../shared/helpers'
|
|
5
|
-
|
|
6
|
-
export interface FlexProps {
|
|
7
|
-
inline?: boolean
|
|
8
|
-
wrap?: boolean
|
|
9
|
-
wrapReverse?: boolean
|
|
10
|
-
|
|
11
|
-
row?: boolean
|
|
12
|
-
column?: boolean
|
|
13
|
-
rowReverse?: boolean
|
|
14
|
-
columnReverse?: boolean
|
|
15
|
-
|
|
16
|
-
gap?: Space | number
|
|
17
|
-
|
|
18
|
-
// NOTE: Add more if needed
|
|
19
|
-
xStart?: boolean
|
|
20
|
-
xEnd?: boolean
|
|
21
|
-
xCenter?: boolean
|
|
22
|
-
xBetween?: boolean
|
|
23
|
-
xAround?: boolean
|
|
24
|
-
xEvenly?: boolean
|
|
25
|
-
|
|
26
|
-
// NOTE: Add more if needed
|
|
27
|
-
yCenter?: boolean
|
|
28
|
-
yStart?: boolean
|
|
29
|
-
yEnd?: boolean
|
|
30
|
-
yBaseline?: boolean
|
|
31
|
-
|
|
32
|
-
expand?: boolean
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const props = withDefaults(defineProps<FlexProps>(), {
|
|
36
|
-
// eslint-disable-next-line vue/require-valid-default-prop
|
|
37
|
-
gap: 's',
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
// Flex gap
|
|
41
|
-
const ag = computed(() => typeof props.gap === 'number'
|
|
42
|
-
? formatUnitValue(props.gap)
|
|
43
|
-
: `var(--space-${props.gap})`,
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
// Flex direction
|
|
47
|
-
const ad = computed(() => {
|
|
48
|
-
if (props.row)
|
|
49
|
-
return 'row'
|
|
50
|
-
else if (props.column)
|
|
51
|
-
return 'column'
|
|
52
|
-
else if (props.rowReverse)
|
|
53
|
-
return 'row-reverse'
|
|
54
|
-
else if (props.columnReverse)
|
|
55
|
-
return 'column-reverse'
|
|
56
|
-
else return 'row'
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
// Justify content
|
|
60
|
-
const aj = computed(() => {
|
|
61
|
-
if (props.xStart)
|
|
62
|
-
return 'flex-start'
|
|
63
|
-
else if (props.xEnd)
|
|
64
|
-
return 'flex-end'
|
|
65
|
-
else if (props.xCenter)
|
|
66
|
-
return 'center'
|
|
67
|
-
else if (props.xBetween)
|
|
68
|
-
return 'space-between'
|
|
69
|
-
else if (props.xEvenly)
|
|
70
|
-
return 'space-evenly'
|
|
71
|
-
else if (props.xAround)
|
|
72
|
-
return 'space-around'
|
|
73
|
-
else return 'flex-start'
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
// Align items
|
|
77
|
-
const aA = computed(() => {
|
|
78
|
-
if (props.yStart)
|
|
79
|
-
return 'flex-start'
|
|
80
|
-
else if (props.yEnd)
|
|
81
|
-
return 'flex-end'
|
|
82
|
-
else if (props.yCenter)
|
|
83
|
-
return 'center'
|
|
84
|
-
else if (props.yBaseline)
|
|
85
|
-
return 'baseline'
|
|
86
|
-
return 'flex-start'
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
const aY = computed(() => props.inline ? 'inline-flex' : 'flex')
|
|
90
|
-
const aW = computed(() => props.wrap
|
|
91
|
-
? 'wrap'
|
|
92
|
-
: props.wrapReverse
|
|
93
|
-
? 'wrap-reverse'
|
|
94
|
-
: 'nowrap')
|
|
95
|
-
|
|
96
|
-
const aH = computed(() => props.expand ? '100%' : 'auto')
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<template>
|
|
100
|
-
<div
|
|
101
|
-
class="vui-flex" :style="{
|
|
102
|
-
display: aY,
|
|
103
|
-
flexWrap: aW,
|
|
104
|
-
flexDirection: ad,
|
|
105
|
-
justifyContent: aj,
|
|
106
|
-
gap: ag,
|
|
107
|
-
alignItems: aA,
|
|
108
|
-
width: aH,
|
|
109
|
-
}"
|
|
110
|
-
>
|
|
111
|
-
<slot />
|
|
112
|
-
</div>
|
|
113
|
-
</template>
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Space } from '../../shared/types'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
import { createArray, formatUnitValue } from '../../shared/helpers'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This component is not meant for complex grids
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
interface Props {
|
|
11
|
-
inline?: boolean
|
|
12
|
-
gap?: Space | number
|
|
13
|
-
rows?: number | string
|
|
14
|
-
columns?: number | string
|
|
15
|
-
// areas?: string[]
|
|
16
|
-
|
|
17
|
-
// NOTE: Add more if needed
|
|
18
|
-
yCenter?: boolean
|
|
19
|
-
yStart?: boolean
|
|
20
|
-
yEnd?: boolean
|
|
21
|
-
yBaseline?: boolean
|
|
22
|
-
yStretch?: boolean
|
|
23
|
-
|
|
24
|
-
expand?: boolean
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
28
|
-
// eslint-disable-next-line vue/require-valid-default-prop
|
|
29
|
-
gap: 's',
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const ag = computed(() => typeof props.gap === 'number'
|
|
33
|
-
? formatUnitValue(props.gap)
|
|
34
|
-
: `var(--space-${props.gap})`,
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
const aTC = computed(() => {
|
|
38
|
-
if (typeof props.columns === 'number') {
|
|
39
|
-
return createArray(props.columns)
|
|
40
|
-
.map(() => '1fr')
|
|
41
|
-
.join(' ')
|
|
42
|
-
}
|
|
43
|
-
return props.columns ?? 'none'
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
const aTR = computed(() => {
|
|
47
|
-
if (typeof props.rows === 'number') {
|
|
48
|
-
return createArray(props.rows || 1)
|
|
49
|
-
.map(() => '')
|
|
50
|
-
.join('1fr')
|
|
51
|
-
}
|
|
52
|
-
return props.rows ?? 'none'
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
const aA = computed(() => {
|
|
56
|
-
if (props.yStart)
|
|
57
|
-
return 'flex-start'
|
|
58
|
-
else if (props.yEnd)
|
|
59
|
-
return 'flex-end'
|
|
60
|
-
else if (props.yCenter)
|
|
61
|
-
return 'center'
|
|
62
|
-
else if (props.yBaseline)
|
|
63
|
-
return 'baseline'
|
|
64
|
-
else if (props.yStretch)
|
|
65
|
-
return 'stretch'
|
|
66
|
-
return 'flex-start'
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
|
|
70
|
-
|
|
71
|
-
const aH = computed(() => props.expand ? '100%' : 'auto')
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
<template>
|
|
75
|
-
<div
|
|
76
|
-
class="vui-grid" :style="{
|
|
77
|
-
display: aD,
|
|
78
|
-
gap: ag,
|
|
79
|
-
gridTemplateColumns: aTC,
|
|
80
|
-
gridTemplateRows: aTR,
|
|
81
|
-
alignItems: aA,
|
|
82
|
-
width: aH,
|
|
83
|
-
}"
|
|
84
|
-
>
|
|
85
|
-
<slot />
|
|
86
|
-
</div>
|
|
87
|
-
</template>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { InputProps } from './Input.vue'
|
|
3
|
-
import { Icon } from '@iconify/vue'
|
|
4
|
-
import { useAttrs, useId } from 'vue'
|
|
5
|
-
import Input from './Input.vue'
|
|
6
|
-
|
|
7
|
-
const props = defineProps<InputProps>()
|
|
8
|
-
|
|
9
|
-
const attrs = useAttrs()
|
|
10
|
-
const color = defineModel<string>()
|
|
11
|
-
const id = useId()
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<Input v-bind="{ ...attrs, ...props }" type="color" class="vui-input-color">
|
|
16
|
-
<template #__internal_replace_input>
|
|
17
|
-
<input :id v-model="color" type="color" tabindex="0">
|
|
18
|
-
<label :for="id">
|
|
19
|
-
<div class="vui-input-color-indicator" :style="{ backgroundColor: color }">
|
|
20
|
-
<Icon v-if="!color" icon="ph:palette" />
|
|
21
|
-
</div>
|
|
22
|
-
<input v-model="color" type="text" :placeholder="props.placeholder">
|
|
23
|
-
</label>
|
|
24
|
-
</template>
|
|
25
|
-
</Input>
|
|
26
|
-
</template>
|