@dolanske/vui 0.3.4 → 0.5.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.
Files changed (114) hide show
  1. package/LICENSE +673 -673
  2. package/README.md +41 -40
  3. package/dist/components/Dropdown/DropdownItem.vue.d.ts +1 -0
  4. package/dist/components/Flex/Flex.vue.d.ts +3 -1
  5. package/dist/components/Grid/Grid.vue.d.ts +3 -1
  6. package/dist/components/Tabs/Tabs.vue.d.ts +4 -0
  7. package/dist/style.css +1 -1
  8. package/dist/vui.js +1547 -1534
  9. package/package.json +68 -68
  10. package/src/App.vue +176 -175
  11. package/src/components/Accordion/Accordion.vue +91 -91
  12. package/src/components/Accordion/AccordionGroup.vue +43 -43
  13. package/src/components/Accordion/accordion.scss +81 -80
  14. package/src/components/Alert/Alert.vue +53 -53
  15. package/src/components/Alert/alert.scss +80 -80
  16. package/src/components/Avatar/Avatar.vue +50 -50
  17. package/src/components/Avatar/avatar.scss +52 -52
  18. package/src/components/Badge/Badge.vue +21 -21
  19. package/src/components/Badge/badge.scss +89 -89
  20. package/src/components/Breadcrumbs/BreadcrumbItem.vue +26 -26
  21. package/src/components/Breadcrumbs/Breadcrumbs.vue +33 -33
  22. package/src/components/Breadcrumbs/breadcrumbs.scss +30 -30
  23. package/src/components/Button/Button.vue +90 -90
  24. package/src/components/Button/button.scss +178 -176
  25. package/src/components/ButtonGroup/ButtonGroup.vue +25 -25
  26. package/src/components/ButtonGroup/button-group.scss +51 -51
  27. package/src/components/Calendar/Calendar.vue +63 -60
  28. package/src/components/Calendar/calendar.scss +60 -56
  29. package/src/components/Card/Card.vue +48 -48
  30. package/src/components/Card/card.scss +53 -53
  31. package/src/components/Checkbox/Checkbox.vue +51 -52
  32. package/src/components/Checkbox/checkbox.scss +75 -66
  33. package/src/components/CopyClipboard/CopyClipboard.vue +82 -82
  34. package/src/components/CopyClipboard/copy-clipboard.scss +17 -17
  35. package/src/components/Divider/Divider.vue +44 -44
  36. package/src/components/Divider/divider.scss +35 -35
  37. package/src/components/Drawer/Drawer.vue +97 -97
  38. package/src/components/Drawer/drawer.scss +36 -36
  39. package/src/components/Dropdown/Dropdown.vue +111 -111
  40. package/src/components/Dropdown/DropdownItem.vue +33 -29
  41. package/src/components/Dropdown/DropdownTitle.vue +8 -8
  42. package/src/components/Dropdown/dropdown-item.scss +77 -0
  43. package/src/components/Dropdown/dropdown.scss +39 -117
  44. package/src/components/Flex/Flex.vue +113 -106
  45. package/src/components/Grid/Grid.vue +60 -54
  46. package/src/components/Input/Counter.vue +70 -70
  47. package/src/components/Input/Dropzone.vue +65 -65
  48. package/src/components/Input/File.vue +15 -15
  49. package/src/components/Input/Input.vue +121 -121
  50. package/src/components/Input/Password.vue +47 -47
  51. package/src/components/Input/Textarea.vue +76 -76
  52. package/src/components/Input/input.scss +208 -208
  53. package/src/components/Kbd/Kbd.vue +48 -48
  54. package/src/components/Kbd/KbdGroup.vue +31 -31
  55. package/src/components/Kbd/kbd.scss +18 -18
  56. package/src/components/Modal/Confirm.vue +56 -56
  57. package/src/components/Modal/Modal.vue +91 -91
  58. package/src/components/Modal/modal.scss +49 -49
  59. package/src/components/OTP/OTP.vue +133 -133
  60. package/src/components/OTP/OTPItem.vue +37 -37
  61. package/src/components/OTP/otp.scss +83 -83
  62. package/src/components/Pagination/Pagination.vue +74 -74
  63. package/src/components/Pagination/pagination.ts +78 -78
  64. package/src/components/Popout/Popout.vue +42 -42
  65. package/src/components/Popout/popout.scss +8 -8
  66. package/src/components/Progress/Progress.vue +90 -90
  67. package/src/components/Progress/progress.scss +41 -41
  68. package/src/components/Radio/Radio.vue +36 -36
  69. package/src/components/Radio/RadioGroup.vue +40 -40
  70. package/src/components/Radio/radio.scss +68 -59
  71. package/src/components/Select/Select.vue +180 -180
  72. package/src/components/Select/select.scss +44 -44
  73. package/src/components/Sheet/Sheet.vue +92 -92
  74. package/src/components/Sheet/sheet.scss +60 -60
  75. package/src/components/Sidebar/Sidebar.vue +102 -0
  76. package/src/components/Sidebar/sidebar.scss +123 -0
  77. package/src/components/Skeleton/Skeleton.vue +43 -43
  78. package/src/components/Skeleton/skeleton.scss +14 -14
  79. package/src/components/Spinner/Spinner.vue +42 -42
  80. package/src/components/Spinner/spinner.scss +46 -46
  81. package/src/components/Switch/Switch.vue +30 -30
  82. package/src/components/Switch/switch.scss +60 -52
  83. package/src/components/Table/Cell.vue +23 -23
  84. package/src/components/Table/Header.vue +59 -59
  85. package/src/components/Table/Row.vue +9 -9
  86. package/src/components/Table/SelectAll.vue +23 -23
  87. package/src/components/Table/SelectRow.vue +29 -29
  88. package/src/components/Table/Table.vue +66 -66
  89. package/src/components/Table/table.scss +134 -134
  90. package/src/components/Table/table.ts +244 -244
  91. package/src/components/Tabs/Tab.vue +27 -27
  92. package/src/components/Tabs/Tabs.vue +89 -82
  93. package/src/components/Tabs/tabs.scss +80 -79
  94. package/src/components/Toast/Toasts.vue +47 -47
  95. package/src/components/Toast/toast.scss +41 -41
  96. package/src/components/Toast/toast.ts +68 -68
  97. package/src/components/Tooltip/Tooltip.vue +86 -86
  98. package/src/components/Tooltip/tooltip.scss +4 -4
  99. package/src/index.scss +1 -1
  100. package/src/index.ts +119 -119
  101. package/src/internal/Backdrop/Backdrop.vue +22 -22
  102. package/src/internal/Backdrop/backdrop.scss +28 -28
  103. package/src/main.ts +5 -5
  104. package/src/shared/helpers.ts +74 -74
  105. package/src/shared/types.ts +29 -29
  106. package/src/style/animation.scss +21 -21
  107. package/src/style/core.scss +150 -148
  108. package/src/style/layout.scss +168 -136
  109. package/src/style/media-query.scss +29 -29
  110. package/src/style/reset.scss +135 -135
  111. package/src/style/{fonts.scss → text.scss} +74 -53
  112. package/src/style/tooltip.scss +128 -128
  113. package/src/style/typography.scss +338 -338
  114. package/src/style/utils.scss +36 -36
@@ -1,97 +1,97 @@
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
- * Title for accessibility.
11
- */
12
- title?: string
13
- /**
14
- * CSS class applied to the container of the drawer content. Accepts Vue's
15
- * class conditional declaration, string, object or an array.
16
- */
17
- containerClass?: VueClass
18
- /**
19
- * Size of the container. Either use a preset size or number to specify
20
- * max-width of the container.
21
- */
22
- containerSize?: Sizes | 'xl' | 'full' | number
23
- /**
24
- * Wether to display the handle symbol. It doesn't actually do anything, it's
25
- * just for the visuals.
26
- */
27
- handle?: boolean
28
- /**
29
- * Control the underlying Vaul root component
30
- */
31
- rootProps?: DrawerRootProps
32
- portalProps?: DrawerPortalProps
33
- }
34
-
35
- const {
36
- title,
37
- containerClass,
38
- containerSize = 'm',
39
- rootProps,
40
- portalProps,
41
- handle = true,
42
- } = defineProps<Props>()
43
-
44
- const open = defineModel<boolean>()
45
-
46
- const mW = computed(() => {
47
- if (typeof containerSize === 'string') {
48
- if (containerClass === 'full') {
49
- return '100%'
50
- }
51
- else {
52
- return getComputedStyle(document.documentElement)
53
- .getPropertyValue(`--container-${containerSize}`)
54
- }
55
- }
56
- else {
57
- return `${containerSize}px`
58
- }
59
- })
60
-
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
- })
68
- </script>
69
-
70
- <template>
71
- <DrawerRoot
72
- :open
73
- should-scale-background
74
- v-bind="rootProps"
75
- @close="open = false"
76
- @update:open="(state) => open = state"
77
- >
78
- <DrawerPortal v-bind="portalProps">
79
- <DrawerOverlay class="vui-drawer-overlay" />
80
- <DrawerContent class="vui-drawer-content" :class="{ 'hide-handle': handle === false }" :aria-describedby="id">
81
- <div :key="mW" class="vui-drawer-container container" :class="containerClass" :style="{ 'max-width': mW }">
82
- <DrawerTitle class="visually-hidden" :name="id">
83
- {{ title }}
84
- </DrawerTitle>
85
- <slot />
86
- </div>
87
- </DrawerContent>
88
- </DrawerPortal>
89
- </DrawerRoot>
90
- </template>
91
-
92
- <style lang="scss" scoped>
93
- :global(body) {
94
- transition: var(--transition-fast);
95
- background-color: var(--color-bg);
96
- }
97
- </style>
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
+ * Title for accessibility.
11
+ */
12
+ title?: string
13
+ /**
14
+ * CSS class applied to the container of the drawer content. Accepts Vue's
15
+ * class conditional declaration, string, object or an array.
16
+ */
17
+ containerClass?: VueClass
18
+ /**
19
+ * Size of the container. Either use a preset size or number to specify
20
+ * max-width of the container.
21
+ */
22
+ containerSize?: Sizes | 'xl' | 'full' | number
23
+ /**
24
+ * Wether to display the handle symbol. It doesn't actually do anything, it's
25
+ * just for the visuals.
26
+ */
27
+ handle?: boolean
28
+ /**
29
+ * Control the underlying Vaul root component
30
+ */
31
+ rootProps?: DrawerRootProps
32
+ portalProps?: DrawerPortalProps
33
+ }
34
+
35
+ const {
36
+ title,
37
+ containerClass,
38
+ containerSize = 'm',
39
+ rootProps,
40
+ portalProps,
41
+ handle = true,
42
+ } = defineProps<Props>()
43
+
44
+ const open = defineModel<boolean>()
45
+
46
+ const mW = computed(() => {
47
+ if (typeof containerSize === 'string') {
48
+ if (containerClass === 'full') {
49
+ return '100%'
50
+ }
51
+ else {
52
+ return getComputedStyle(document.documentElement)
53
+ .getPropertyValue(`--container-${containerSize}`)
54
+ }
55
+ }
56
+ else {
57
+ return `${containerSize}px`
58
+ }
59
+ })
60
+
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
+ })
68
+ </script>
69
+
70
+ <template>
71
+ <DrawerRoot
72
+ :open
73
+ should-scale-background
74
+ v-bind="rootProps"
75
+ @close="open = false"
76
+ @update:open="(state) => open = state"
77
+ >
78
+ <DrawerPortal v-bind="portalProps">
79
+ <DrawerOverlay class="vui-drawer-overlay" />
80
+ <DrawerContent class="vui-drawer-content" :class="{ 'hide-handle': handle === false }" :aria-describedby="id">
81
+ <div :key="mW" class="vui-drawer-container container" :class="containerClass" :style="{ 'max-width': mW }">
82
+ <DrawerTitle class="visually-hidden" :name="id">
83
+ {{ title }}
84
+ </DrawerTitle>
85
+ <slot />
86
+ </div>
87
+ </DrawerContent>
88
+ </DrawerPortal>
89
+ </DrawerRoot>
90
+ </template>
91
+
92
+ <style lang="scss" scoped>
93
+ :global(body) {
94
+ transition: var(--transition-fast);
95
+ background-color: var(--color-bg);
96
+ }
97
+ </style>
@@ -1,36 +1,36 @@
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
-
14
- &.hide-handle:before {
15
- display: none;
16
- }
17
-
18
- &.vaul-dragging {
19
- &:before {
20
- background-color: var(--color-text-lighter);
21
- }
22
- }
23
-
24
- &:before {
25
- content: '';
26
- position: absolute;
27
- left: 50%;
28
- transform: translateX(-50%);
29
- width: 56px;
30
- height: 6px;
31
- top: 12px;
32
- border-radius: 3px;
33
- background-color: var(--color-border-strong);
34
- transition: var(--transition-fast);
35
- }
36
- }
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
+
14
+ &.hide-handle:before {
15
+ display: none;
16
+ }
17
+
18
+ &.vaul-dragging {
19
+ &:before {
20
+ background-color: var(--color-text-lighter);
21
+ }
22
+ }
23
+
24
+ &:before {
25
+ content: '';
26
+ position: absolute;
27
+ left: 50%;
28
+ transform: translateX(-50%);
29
+ width: 56px;
30
+ height: 6px;
31
+ top: 12px;
32
+ border-radius: 3px;
33
+ background-color: var(--color-border-strong);
34
+ transition: var(--transition-fast);
35
+ }
36
+ }
@@ -1,111 +1,111 @@
1
- <script setup lang='ts'>
2
- import type { MaybeElement } from '@vueuse/core'
3
- import type { Placement } from '../../shared/types'
4
- import { onClickOutside } from '@vueuse/core'
5
- import { computed, ref, useTemplateRef } 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
- const {
26
- placement = 'bottom-start',
27
- expand,
28
- minWidth = 156,
29
- } = defineProps<Props>()
30
-
31
- const anchorRef = useTemplateRef<HTMLDivElement>('anchor')
32
- const dropdownRef = useTemplateRef<MaybeElement>('dropdown')
33
-
34
- const showMenu = ref(false)
35
-
36
- function open() {
37
- showMenu.value = true
38
- }
39
-
40
- function close() {
41
- showMenu.value = false
42
- }
43
-
44
- function toggle() {
45
- showMenu.value = !showMenu.value
46
- }
47
-
48
- onClickOutside(dropdownRef, (event) => {
49
- // Hide dropdown when it is clicked outside EXCEPT when we click the trigger,
50
- // as that is either by the slot itself
51
- if (!anchorRef.value?.contains(event.target as Node | null))
52
- showMenu.value = false
53
- })
54
-
55
- const anchorWidth = computed(() => {
56
- if (!expand || !window)
57
- return 0
58
- return anchorRef.value?.getBoundingClientRect().width
59
- })
60
-
61
- defineExpose({
62
- open,
63
- close,
64
- toggle,
65
- isOpen: showMenu,
66
- })
67
-
68
- const mW = computed(() => formatUnitValue(minWidth))
69
- const w = computed(() => expand ? `${anchorWidth.value}px` : 'initial')
70
- </script>
71
-
72
- <template>
73
- <div
74
- ref="anchor"
75
- class="vui-dropdown-trigger-wrap"
76
- role="button"
77
- :aria-expanded="showMenu"
78
- :aria-haspopup="true"
79
- name="Dropdown menu"
80
- >
81
- <slot name="trigger" :open :is-open="showMenu" :close :toggle />
82
- </div>
83
-
84
- <Transition appear name="dropdown">
85
- <Popout
86
- v-if="showMenu"
87
- ref="dropdown"
88
- :anchor="anchorRef"
89
- class="vui-dropdown"
90
- :placement
91
- :style="{
92
- minWidth: mW,
93
- width: w,
94
- }"
95
- >
96
- <slot :open :close :toggle :is-open="showMenu" />
97
- </Popout>
98
- </Transition>
99
- </template>
100
-
101
- <style scoped lang="scss">
102
- .dropdown-enter-active,
103
- .dropdown-leave-active {
104
- transition: 0.1s opacity ease-in-out;
105
- }
106
-
107
- .dropdown-enter-from,
108
- .dropdown-leave-to {
109
- opacity: 0;
110
- }
111
- </style>
1
+ <script setup lang='ts'>
2
+ import type { MaybeElement } from '@vueuse/core'
3
+ import type { Placement } from '../../shared/types'
4
+ import { onClickOutside } from '@vueuse/core'
5
+ import { computed, ref, useTemplateRef } 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
+ const {
26
+ placement = 'bottom-start',
27
+ expand,
28
+ minWidth = 156,
29
+ } = defineProps<Props>()
30
+
31
+ const anchorRef = useTemplateRef<HTMLDivElement>('anchor')
32
+ const dropdownRef = useTemplateRef<MaybeElement>('dropdown')
33
+
34
+ const showMenu = ref(false)
35
+
36
+ function open() {
37
+ showMenu.value = true
38
+ }
39
+
40
+ function close() {
41
+ showMenu.value = false
42
+ }
43
+
44
+ function toggle() {
45
+ showMenu.value = !showMenu.value
46
+ }
47
+
48
+ onClickOutside(dropdownRef, (event) => {
49
+ // Hide dropdown when it is clicked outside EXCEPT when we click the trigger,
50
+ // as that is either by the slot itself
51
+ if (!anchorRef.value?.contains(event.target as Node | null))
52
+ showMenu.value = false
53
+ })
54
+
55
+ const anchorWidth = computed(() => {
56
+ if (!expand || !window)
57
+ return 0
58
+ return anchorRef.value?.getBoundingClientRect().width
59
+ })
60
+
61
+ defineExpose({
62
+ open,
63
+ close,
64
+ toggle,
65
+ isOpen: showMenu,
66
+ })
67
+
68
+ const mW = computed(() => formatUnitValue(minWidth))
69
+ const w = computed(() => expand ? `${anchorWidth.value}px` : 'initial')
70
+ </script>
71
+
72
+ <template>
73
+ <div
74
+ ref="anchor"
75
+ class="vui-dropdown-trigger-wrap"
76
+ role="button"
77
+ :aria-expanded="showMenu"
78
+ :aria-haspopup="true"
79
+ name="Dropdown menu"
80
+ >
81
+ <slot name="trigger" :open :is-open="showMenu" :close :toggle />
82
+ </div>
83
+
84
+ <Transition appear name="dropdown">
85
+ <Popout
86
+ v-if="showMenu"
87
+ ref="dropdown"
88
+ :anchor="anchorRef"
89
+ class="vui-dropdown"
90
+ :placement
91
+ :style="{
92
+ minWidth: mW,
93
+ width: w,
94
+ }"
95
+ >
96
+ <slot :open :close :toggle :is-open="showMenu" />
97
+ </Popout>
98
+ </Transition>
99
+ </template>
100
+
101
+ <style scoped lang="scss">
102
+ .dropdown-enter-active,
103
+ .dropdown-leave-active {
104
+ transition: 0.1s opacity ease-in-out;
105
+ }
106
+
107
+ .dropdown-enter-from,
108
+ .dropdown-leave-to {
109
+ opacity: 0;
110
+ }
111
+ </style>
@@ -1,29 +1,33 @@
1
- <script setup lang='ts'>
2
- import { Icon } from '@iconify/vue'
3
-
4
- interface Props {
5
- disabled?: boolean
6
- icon?: string
7
- }
8
-
9
- const props = defineProps<Props>()
10
- </script>
11
-
12
- <template>
13
- <button class="vui-dropdown-item" :class="{ disabled }">
14
- <!-- This should always be here to offset items which dont have icons -->
15
- <div class="vui-dropdown-item-icon">
16
- <Transition name="fade" appear>
17
- <Icon v-if="props.icon" :icon="props.icon" />
18
- </Transition>
19
- </div>
20
-
21
- <div class="vui-dropdown-item-slot">
22
- <slot />
23
- </div>
24
-
25
- <div class="vui-dropdown-item-hint">
26
- <slot name="hint" />
27
- </div>
28
- </button>
29
- </template>
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 }">
16
+ <!-- This should always be here to offset items which dont have icons -->
17
+ <div class="vui-dropdown-item-icon">
18
+ <Icon v-if="props.icon" :icon="props.icon" />
19
+ </div>
20
+
21
+ <div class="vui-dropdown-item-slot">
22
+ <slot />
23
+ </div>
24
+
25
+ <div 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,8 +1,8 @@
1
- <template>
2
- <div class="vui-dropdown-title">
3
- <slot />
4
- <div v-if="$slots.end" class="vui-dropdown-title-end">
5
- <slot name="end" />
6
- </div>
7
- </div>
8
- </template>
1
+ <template>
2
+ <div class="vui-dropdown-title">
3
+ <slot />
4
+ <div v-if="$slots.end" class="vui-dropdown-title-end">
5
+ <slot name="end" />
6
+ </div>
7
+ </div>
8
+ </template>
@@ -0,0 +1,77 @@
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-s);
11
+ cursor: default;
12
+ transition: var(--transition);
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: -1;
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
+ margin-left: 8px;
59
+ font-size: 0.9rem;
60
+ // white-space: nowrap;
61
+ color: var(--color-text-lighter);
62
+ }
63
+
64
+ .vui-dropdown-item-slot {
65
+ flex: 1;
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: flex-start;
69
+ color: var(--color-text);
70
+ flex-wrap: nowrap;
71
+ }
72
+
73
+ &.selected,
74
+ &:hover {
75
+ background-color: var(--color-button-gray-hover);
76
+ }
77
+ }