@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.
Files changed (214) hide show
  1. package/dist/components/Accordion/Accordion.vue.d.ts +48 -0
  2. package/dist/components/Accordion/AccordionGroup.vue.d.ts +21 -0
  3. package/dist/components/Alert/Alert.vue.d.ts +36 -0
  4. package/dist/components/Avatar/Avatar.vue.d.ts +25 -0
  5. package/dist/components/Badge/Badge.vue.d.ts +22 -0
  6. package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +22 -0
  7. package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +18 -0
  8. package/dist/components/Button/Button.vue.d.ts +32 -0
  9. package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +22 -0
  10. package/dist/components/Calendar/Calendar.vue.d.ts +27 -0
  11. package/dist/components/Card/Card.vue.d.ts +26 -0
  12. package/dist/components/Checkbox/Checkbox.vue.d.ts +33 -0
  13. package/dist/components/CopyClipboard/CopyClipboard.vue.d.ts +46 -0
  14. package/dist/components/Divider/Divider.vue.d.ts +23 -0
  15. package/dist/components/Drawer/Drawer.vue.d.ts +53 -0
  16. package/dist/components/Dropdown/Dropdown.vue.d.ts +177 -0
  17. package/dist/components/Dropdown/DropdownItem.vue.d.ts +23 -0
  18. package/dist/components/Dropdown/DropdownTitle.vue.d.ts +21 -0
  19. package/dist/components/Flex/Flex.vue.d.ts +41 -0
  20. package/dist/components/Grid/Grid.vue.d.ts +35 -0
  21. package/dist/components/Input/Color.vue.d.ts +11 -0
  22. package/dist/components/Input/Counter.vue.d.ts +19 -0
  23. package/dist/components/Input/Dropzone.vue.d.ts +193 -0
  24. package/dist/components/Input/File.vue.d.ts +8 -0
  25. package/dist/components/Input/Input.vue.d.ts +56 -0
  26. package/dist/components/Input/Password.vue.d.ts +6 -0
  27. package/dist/components/Input/Textarea.vue.d.ts +31 -0
  28. package/dist/components/Kbd/Kbd.vue.d.ts +23 -0
  29. package/dist/components/Kbd/KbdGroup.vue.d.ts +19 -0
  30. package/dist/components/Modal/Confirm.vue.d.ts +43 -0
  31. package/dist/components/Modal/Modal.vue.d.ts +58 -0
  32. package/dist/components/OTP/OTP.vue.d.ts +44 -0
  33. package/dist/components/OTP/OTPItem.vue.d.ts +5 -0
  34. package/dist/components/Pagination/Pagination.vue.d.ts +46 -0
  35. package/dist/components/Pagination/pagination.d.ts +12 -0
  36. package/dist/components/Popout/Popout.vue.d.ts +36 -0
  37. package/dist/components/Progress/Progress.vue.d.ts +33 -0
  38. package/dist/components/Radio/Radio.vue.d.ts +29 -0
  39. package/dist/components/Radio/RadioGroup.vue.d.ts +27 -0
  40. package/dist/components/Select/Select.vue.d.ts +35 -0
  41. package/dist/components/Sheet/Sheet.vue.d.ts +47 -0
  42. package/dist/components/Sidebar/Sidebar.vue.d.ts +70 -0
  43. package/dist/components/Skeleton/Skeleton.vue.d.ts +8 -0
  44. package/dist/components/Spinner/Spinner.vue.d.ts +6 -0
  45. package/dist/components/Switch/Switch.vue.d.ts +28 -0
  46. package/dist/components/Table/Cell.vue.d.ts +22 -0
  47. package/dist/components/Table/Head.vue.d.ts +30 -0
  48. package/dist/components/Table/Root.vue.d.ts +41 -0
  49. package/dist/components/Table/SelectAll.vue.d.ts +2 -0
  50. package/dist/components/Table/SelectRow.vue.d.ts +6 -0
  51. package/dist/components/Table/index.d.ts +6 -0
  52. package/dist/components/Table/table.d.ts +68 -0
  53. package/dist/components/Tabs/Tab.vue.d.ts +22 -0
  54. package/dist/components/Tabs/Tabs.vue.d.ts +34 -0
  55. package/dist/components/Toast/Toasts.vue.d.ts +2 -0
  56. package/dist/components/Toast/toast.d.ts +287 -0
  57. package/dist/components/Tooltip/Tooltip.vue.d.ts +33 -0
  58. package/dist/fonts/GeistMono-Regular.ttf +0 -0
  59. package/dist/fonts/GeistMono-SemiBold.ttf +0 -0
  60. package/dist/fonts/Inter_18pt-Black.ttf +0 -0
  61. package/dist/fonts/Inter_18pt-Bold.ttf +0 -0
  62. package/dist/fonts/Inter_18pt-ExtraBold.ttf +0 -0
  63. package/dist/fonts/Inter_18pt-Light.ttf +0 -0
  64. package/dist/fonts/Inter_18pt-Medium.ttf +0 -0
  65. package/dist/fonts/Inter_18pt-Regular.ttf +0 -0
  66. package/dist/fonts/Inter_18pt-SemiBold.ttf +0 -0
  67. package/dist/index.d.ts +56 -0
  68. package/dist/internal/Backdrop/Backdrop.vue.d.ts +21 -0
  69. package/dist/shared/helpers.d.ts +34 -0
  70. package/dist/shared/slots.d.ts +20 -0
  71. package/dist/shared/theme.d.ts +3 -0
  72. package/dist/shared/types.d.ts +24 -0
  73. package/dist/vui.css +1 -0
  74. package/dist/vui.js +16215 -0
  75. package/package.json +1 -2
  76. package/src/App.vue +0 -103
  77. package/src/components/Accordion/Accordion.vue +0 -98
  78. package/src/components/Accordion/AccordionGroup.vue +0 -49
  79. package/src/components/Accordion/accordion.scss +0 -97
  80. package/src/components/Alert/Alert.vue +0 -59
  81. package/src/components/Alert/alert.scss +0 -162
  82. package/src/components/Avatar/Avatar.vue +0 -53
  83. package/src/components/Avatar/avatar.scss +0 -52
  84. package/src/components/Badge/Badge.vue +0 -21
  85. package/src/components/Badge/badge.scss +0 -210
  86. package/src/components/Breadcrumbs/BreadcrumbItem.vue +0 -26
  87. package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -29
  88. package/src/components/Breadcrumbs/breadcrumbs.scss +0 -31
  89. package/src/components/Button/Button.vue +0 -86
  90. package/src/components/Button/button.scss +0 -292
  91. package/src/components/ButtonGroup/ButtonGroup.vue +0 -28
  92. package/src/components/ButtonGroup/button-group.scss +0 -51
  93. package/src/components/Calendar/Calendar.vue +0 -66
  94. package/src/components/Calendar/calendar.scss +0 -88
  95. package/src/components/Card/Card.vue +0 -48
  96. package/src/components/Card/card.scss +0 -55
  97. package/src/components/Checkbox/Checkbox.vue +0 -54
  98. package/src/components/Checkbox/checkbox.scss +0 -80
  99. package/src/components/CopyClipboard/CopyClipboard.vue +0 -98
  100. package/src/components/CopyClipboard/copy-clipboard.scss +0 -25
  101. package/src/components/Divider/Divider.vue +0 -38
  102. package/src/components/Divider/divider.scss +0 -37
  103. package/src/components/Drawer/Drawer.vue +0 -102
  104. package/src/components/Drawer/drawer.scss +0 -37
  105. package/src/components/Dropdown/Dropdown.vue +0 -120
  106. package/src/components/Dropdown/DropdownItem.vue +0 -33
  107. package/src/components/Dropdown/DropdownTitle.vue +0 -14
  108. package/src/components/Dropdown/dropdown-item.scss +0 -84
  109. package/src/components/Dropdown/dropdown.scss +0 -53
  110. package/src/components/Flex/Flex.vue +0 -113
  111. package/src/components/Grid/Grid.vue +0 -87
  112. package/src/components/Input/Color.vue +0 -26
  113. package/src/components/Input/Counter.vue +0 -66
  114. package/src/components/Input/Dropzone.vue +0 -65
  115. package/src/components/Input/File.vue +0 -15
  116. package/src/components/Input/Input.vue +0 -123
  117. package/src/components/Input/Password.vue +0 -35
  118. package/src/components/Input/Textarea.vue +0 -78
  119. package/src/components/Input/input.scss +0 -302
  120. package/src/components/Kbd/Kbd.vue +0 -48
  121. package/src/components/Kbd/KbdGroup.vue +0 -28
  122. package/src/components/Kbd/kbd.scss +0 -19
  123. package/src/components/Modal/Confirm.vue +0 -56
  124. package/src/components/Modal/Modal.vue +0 -103
  125. package/src/components/Modal/modal.scss +0 -54
  126. package/src/components/OTP/OTP.vue +0 -133
  127. package/src/components/OTP/OTPItem.vue +0 -37
  128. package/src/components/OTP/otp.scss +0 -84
  129. package/src/components/Pagination/Pagination.vue +0 -92
  130. package/src/components/Pagination/pagination.ts +0 -78
  131. package/src/components/Popout/Popout.vue +0 -73
  132. package/src/components/Popout/popout.scss +0 -16
  133. package/src/components/Progress/Progress.vue +0 -103
  134. package/src/components/Progress/progress.scss +0 -47
  135. package/src/components/Radio/Radio.vue +0 -38
  136. package/src/components/Radio/RadioGroup.vue +0 -34
  137. package/src/components/Radio/radio.scss +0 -78
  138. package/src/components/Select/Select.vue +0 -212
  139. package/src/components/Select/select.scss +0 -82
  140. package/src/components/Sheet/Sheet.vue +0 -106
  141. package/src/components/Sheet/sheet.scss +0 -71
  142. package/src/components/Sidebar/Sidebar.vue +0 -116
  143. package/src/components/Sidebar/sidebar.scss +0 -124
  144. package/src/components/Skeleton/Skeleton.vue +0 -43
  145. package/src/components/Skeleton/skeleton.scss +0 -14
  146. package/src/components/Spinner/Spinner.vue +0 -42
  147. package/src/components/Spinner/spinner.scss +0 -47
  148. package/src/components/Switch/Switch.vue +0 -31
  149. package/src/components/Switch/switch.scss +0 -93
  150. package/src/components/Table/Cell.vue +0 -23
  151. package/src/components/Table/Head.vue +0 -66
  152. package/src/components/Table/Root.vue +0 -66
  153. package/src/components/Table/SelectAll.vue +0 -23
  154. package/src/components/Table/SelectRow.vue +0 -30
  155. package/src/components/Table/index.ts +0 -7
  156. package/src/components/Table/table.scss +0 -155
  157. package/src/components/Table/table.ts +0 -248
  158. package/src/components/Tabs/Tab.vue +0 -25
  159. package/src/components/Tabs/Tabs.vue +0 -90
  160. package/src/components/Tabs/tabs.scss +0 -87
  161. package/src/components/Toast/Toasts.vue +0 -52
  162. package/src/components/Toast/toast.scss +0 -45
  163. package/src/components/Toast/toast.ts +0 -75
  164. package/src/components/Tooltip/Tooltip.vue +0 -78
  165. package/src/components/Tooltip/tooltip.scss +0 -5
  166. package/src/examples/ExampleAccordions.vue +0 -69
  167. package/src/examples/ExampleAlerts.vue +0 -78
  168. package/src/examples/ExampleAvatars.vue +0 -44
  169. package/src/examples/ExampleBadges.vue +0 -48
  170. package/src/examples/ExampleBreadcrumbs.vue +0 -46
  171. package/src/examples/ExampleButtons.vue +0 -148
  172. package/src/examples/ExampleCalendars.vue +0 -40
  173. package/src/examples/ExampleCards.vue +0 -94
  174. package/src/examples/ExampleCheckboxes.vue +0 -123
  175. package/src/examples/ExampleCopyClipboard.vue +0 -47
  176. package/src/examples/ExampleDividers.vue +0 -39
  177. package/src/examples/ExampleDrawers.vue +0 -67
  178. package/src/examples/ExampleDropdowns.vue +0 -114
  179. package/src/examples/ExampleFlexGrid.vue +0 -124
  180. package/src/examples/ExampleInputs.vue +0 -236
  181. package/src/examples/ExampleKBD.vue +0 -65
  182. package/src/examples/ExampleModals.vue +0 -143
  183. package/src/examples/ExamplePalette.vue +0 -165
  184. package/src/examples/ExamplePopouts.vue +0 -41
  185. package/src/examples/ExampleSheets.vue +0 -77
  186. package/src/examples/ExampleSidebars.vue +0 -276
  187. package/src/examples/ExampleSkeletons.vue +0 -26
  188. package/src/examples/ExampleSpinners.vue +0 -80
  189. package/src/examples/ExampleTables.vue +0 -359
  190. package/src/examples/ExampleTabs.vue +0 -142
  191. package/src/examples/ExampleToasts.vue +0 -96
  192. package/src/examples/ExampleTooltips.vue +0 -70
  193. package/src/examples/shared/ExampleColor.vue +0 -28
  194. package/src/index.ts +0 -116
  195. package/src/internal/Backdrop/Backdrop.vue +0 -22
  196. package/src/internal/Backdrop/backdrop.scss +0 -34
  197. package/src/main.ts +0 -5
  198. package/src/shared/helpers.ts +0 -124
  199. package/src/shared/slots.ts +0 -61
  200. package/src/shared/theme.ts +0 -22
  201. package/src/shared/types.ts +0 -29
  202. package/src/style/animation.scss +0 -50
  203. package/src/style/core.scss +0 -133
  204. package/src/style/fonts.scss +0 -73
  205. package/src/style/layout.scss +0 -179
  206. package/src/style/media-query.scss +0 -29
  207. package/src/style/reset.scss +0 -135
  208. package/src/style/text.scss +0 -137
  209. package/src/style/theme.scss +0 -195
  210. package/src/style/tooltip.scss +0 -146
  211. package/src/style/typography.scss +0 -435
  212. package/src/style/utils.scss +0 -36
  213. package/src/style.scss +0 -1
  214. package/src/vite-env.d.ts +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dolanske/vui",
3
3
  "type": "module",
4
- "version": "1.4.0",
4
+ "version": "1.4.2",
5
5
  "private": false,
6
6
  "description": "Brother in Christ there's a new UI library",
7
7
  "author": "dolanske",
@@ -36,7 +36,6 @@
36
36
  "types": "./dist/index.d.ts",
37
37
  "files": [
38
38
  "./dist/*",
39
- "./src/*",
40
39
  "LICENSE",
41
40
  "README.md"
42
41
  ],
package/src/App.vue DELETED
@@ -1,103 +0,0 @@
1
- <script setup lang="ts">
2
- import Card from './components/Card/Card.vue'
3
- import Divider from './components/Divider/Divider.vue'
4
- import ExampleAccordions from './examples/ExampleAccordions.vue'
5
- import ExampleAlerts from './examples/ExampleAlerts.vue'
6
- import ExampleAvatars from './examples/ExampleAvatars.vue'
7
- import ExampleBadges from './examples/ExampleBadges.vue'
8
- import ExampleBreadcrumbs from './examples/ExampleBreadcrumbs.vue'
9
- import ExampleButtons from './examples/ExampleButtons.vue'
10
- import ExampleCalendars from './examples/ExampleCalendars.vue'
11
- import ExampleCards from './examples/ExampleCards.vue'
12
- import ExampleCheckboxes from './examples/ExampleCheckboxes.vue'
13
- import ExampleCopyClipboard from './examples/ExampleCopyClipboard.vue'
14
- import ExampleDividers from './examples/ExampleDividers.vue'
15
- import ExampleDrawers from './examples/ExampleDrawers.vue'
16
- import ExampleDropdowns from './examples/ExampleDropdowns.vue'
17
- import ExampleFlexGrid from './examples/ExampleFlexGrid.vue'
18
- import ExampleInputs from './examples/ExampleInputs.vue'
19
- import ExampleKBD from './examples/ExampleKBD.vue'
20
- import ExampleModals from './examples/ExampleModals.vue'
21
- import ExamplePalette from './examples/ExamplePalette.vue'
22
- import ExamplePopouts from './examples/ExamplePopouts.vue'
23
- import ExampleSheets from './examples/ExampleSheets.vue'
24
- import ExampleSidebars from './examples/ExampleSidebars.vue'
25
- import ExampleSkeletons from './examples/ExampleSkeletons.vue'
26
- import ExampleSpinners from './examples/ExampleSpinners.vue'
27
- import ExampleTables from './examples/ExampleTables.vue'
28
- import ExampleTabs from './examples/ExampleTabs.vue'
29
- import ExampleToasts from './examples/ExampleToasts.vue'
30
- import ExampleTooltips from './examples/ExampleTooltips.vue'
31
- </script>
32
-
33
- <template>
34
- <main vaul-drawer-wrapper>
35
- <div class="container container-l p-xl">
36
- <h1 class="mb-l">
37
- VUI
38
- </h1>
39
-
40
- <Card class="typeface">
41
- <pre><code>export function removeColorPrefix(value: string): string {
42
- return value.replace('--dark', '--').replace('--light', '--')
43
- }</code></pre>
44
- </Card>
45
-
46
- <p>The purpose of this page is to showcase and test every single component case</p>
47
- <Divider :size="64" />
48
- <ExamplePalette />
49
- <Divider :size="64" />
50
- <ExampleButtons />
51
- <Divider :size="64" />
52
- <ExampleCalendars />
53
- <Divider :size="64" />
54
- <ExampleBadges />
55
- <Divider :size="64" />
56
- <ExampleSpinners />
57
- <Divider :size="64" />
58
- <ExampleAvatars />
59
- <Divider :size="64" />
60
- <ExampleAlerts />
61
- <Divider :size="64" />
62
- <ExampleSkeletons />
63
- <Divider :size="64" />
64
- <ExampleAccordions />
65
- <Divider :size="64" />
66
- <ExampleBreadcrumbs />
67
- <Divider :size="64" />
68
- <ExampleCards />
69
- <Divider :size="64" />
70
- <ExampleCheckboxes />
71
- <Divider :size="64" />
72
- <ExampleCopyClipboard />
73
- <Divider :size="64" />
74
- <ExampleTabs />
75
- <Divider :size="64" />
76
- <ExampleInputs />
77
- <Divider :size="64" />
78
- <ExampleToasts />
79
- <Divider :size="64" />
80
- <ExampleTooltips />
81
- <Divider :size="64" />
82
- <ExampleSheets />
83
- <Divider :size="64" />
84
- <ExampleModals />
85
- <Divider :size="64" />
86
- <ExampleDrawers />
87
- <Divider :size="64" />
88
- <ExampleKBD />
89
- <Divider :size="64" />
90
- <ExamplePopouts />
91
- <Divider :size="64" />
92
- <ExampleDividers />
93
- <Divider :size="64" />
94
- <ExampleDropdowns />
95
- <Divider :size="64" />
96
- <ExampleFlexGrid />
97
- <Divider :size="64" />
98
- <ExampleTables />
99
- <Divider :size="64" />
100
- <ExampleSidebars />
101
- </div>
102
- </main>
103
- </template>
@@ -1,98 +0,0 @@
1
- <script setup lang="ts">
2
- import { Icon } from '@iconify/vue'
3
- import { useResizeObserver } from '@vueuse/core'
4
- import { onBeforeMount, onMounted, ref, useTemplateRef, watch, watchEffect } from 'vue'
5
- import './accordion.scss'
6
-
7
- export interface AccordionProps {
8
- open?: boolean
9
- label?: string
10
- card?: boolean
11
- unstyled?: boolean
12
- }
13
-
14
- const props = defineProps<AccordionProps>()
15
- const emits = defineEmits<{
16
- open: []
17
- close: []
18
- }>()
19
-
20
- const isOpen = ref(false)
21
- const contentRef = useTemplateRef('content')
22
- const contentMaxHeight = ref(0)
23
-
24
- watchEffect(() => {
25
- isOpen.value = props.open
26
- }, {
27
- flush: 'post',
28
- })
29
-
30
- watch(isOpen, (value) => {
31
- if (value) {
32
- emits('open')
33
- contentMaxHeight.value = contentRef.value?.scrollHeight || 0
34
- }
35
- else {
36
- emits('close')
37
- }
38
- }, {
39
- flush: 'post',
40
- immediate: true,
41
- })
42
-
43
- function open() {
44
- isOpen.value = true
45
- }
46
-
47
- function close() {
48
- isOpen.value = false
49
- }
50
-
51
- function toggle() {
52
- isOpen.value = !isOpen.value
53
- }
54
-
55
- defineExpose({
56
- open,
57
- close,
58
- toggle,
59
- isOpen,
60
- })
61
-
62
- onBeforeMount(() => {
63
- if (props.card && props.unstyled) {
64
- console.warn('[Accordion] Both \'card\' and \'unstyled\' props are selected. Unstyled will take precedence.')
65
- }
66
- })
67
-
68
- onMounted(() => {
69
- useResizeObserver(contentRef, ([entry]) => {
70
- if (isOpen.value && contentMaxHeight.value !== entry.contentRect.height) {
71
- contentMaxHeight.value = entry.contentRect.height || 0
72
- }
73
- })
74
- })
75
- </script>
76
-
77
- <template>
78
- <div class="vui-accordion" :class="{ 'open': isOpen, 'is-card': !!props.card && !props.unstyled, 'is-unstyled': !!props.unstyled }">
79
- <!-- Completely custom header which needs to be styled and implemented by the developer -->
80
- <slot v-if="$slots.trigger" name="trigger" :open :close :toggle :is-open />
81
- <button v-else class="vui-accordion-header" @click="isOpen = !isOpen">
82
- <slot name="header">
83
- {{ props.label }}
84
- </slot>
85
- <Icon v-if="!props.unstyled" icon="ph:caret-down" />
86
- </button>
87
-
88
- <div
89
- class="vui-accordion-content"
90
- :aria-hidden="!isOpen"
91
- :style="{ 'max-height': isOpen ? `${contentMaxHeight}px` : '0px' }"
92
- >
93
- <div ref="content" class="vui-accordtion-content-inner">
94
- <slot />
95
- </div>
96
- </div>
97
- </div>
98
- </template>
@@ -1,49 +0,0 @@
1
- <script setup lang="ts">
2
- import type { AccordionProps } from './Accordion.vue'
3
- import { useId } from 'vue'
4
- import { enforceSlotType, useFlattenedSlot } from '../../shared/slots'
5
- // Renderless component which is used to house multiple accordions which can be triggered together in some way
6
-
7
- interface Props {
8
- /**
9
- * If set to true, if an accordion opens, all other close
10
- */
11
- single?: boolean
12
- }
13
-
14
- const props = defineProps<Props>()
15
-
16
- const slots = defineSlots()
17
-
18
- // Since accordions do not have a child parent, we need to group them by a
19
- // common id
20
- const id = useId()
21
-
22
- const flattened = useFlattenedSlot<AccordionProps>(slots.default)
23
-
24
- function handleAccordionOpen(newIndex: number) {
25
- if (!props.single)
26
- return
27
-
28
- const grouped = document.querySelectorAll(`[data-accordion-group-id=${id}]`)
29
-
30
- grouped.forEach((item, index) => {
31
- if (index !== newIndex) {
32
- // @ts-expect-error We do a little accessin'
33
- item.__vnode.ctx.exposed.close()
34
- }
35
- })
36
- }
37
-
38
- enforceSlotType(flattened, 'Accordion')
39
- </script>
40
-
41
- <template>
42
- <component
43
- :is="item"
44
- v-for="(item, index) of flattened"
45
- :key="item"
46
- :data-accordion-group-id="id"
47
- @open="handleAccordionOpen(index)"
48
- />
49
- </template>
@@ -1,97 +0,0 @@
1
- .vui-accordion {
2
- width: 100%;
3
- transition: var(--transition);
4
- border-bottom: 1px solid var(--color-border);
5
- padding-bottom: 0;
6
-
7
- &.is-unstyled {
8
- border-bottom: none;
9
-
10
- .vui-accordion-header {
11
- padding: unset;
12
- text-decoration: unset;
13
-
14
- &:hover {
15
- text-decoration: unset;
16
- }
17
- }
18
- }
19
-
20
- &.is-card {
21
- border: 1px solid var(--color-border);
22
- border-radius: var(--border-radius-m);
23
-
24
- &.open {
25
- padding-bottom: 0;
26
-
27
- .vui-accordion-header {
28
- border-block-width: 1px;
29
- border-bottom-left-radius: 0;
30
- border-bottom-right-radius: 0;
31
- }
32
- }
33
-
34
- .vui-accordion-header {
35
- padding-inline: var(--space-m);
36
- border-bottom: 0px solid var(--color-border);
37
- text-decoration: inherit;
38
- border-radius: var(--border-radius-m);
39
-
40
- &:hover {
41
- text-decoration: inherit;
42
- text-underline-offset: inherit;
43
- background-color: var(--color-button-gray);
44
- }
45
- }
46
-
47
- .vui-accordtion-content-inner {
48
- padding: var(--space-m);
49
- }
50
- }
51
-
52
- &.open {
53
- &:not(.is-unstyled) {
54
- padding-bottom: var(--space-m);
55
-
56
- .vui-accordion-header svg {
57
- transform: rotate(180deg);
58
- }
59
- }
60
-
61
- .vui-accordion-content {
62
- visibility: visible;
63
- }
64
- }
65
-
66
- .vui-accordion-header {
67
- display: flex;
68
- width: 100%;
69
- justify-content: space-between;
70
- align-items: center;
71
- padding: var(--space-m) 0;
72
- color: pointer;
73
- font-size: var(--font-size-m);
74
- font-weight: 500;
75
- color: var(--color-text);
76
- border-radius: var(--border-radius-m);
77
-
78
- &:hover {
79
- text-decoration: underline;
80
- text-underline-offset: 4px;
81
- }
82
-
83
- svg {
84
- transition: var(--transition);
85
- color: var(--color-text-light);
86
- }
87
- }
88
-
89
- .vui-accordion-content {
90
- transition: var(--transition-slow);
91
- width: 100%;
92
- max-height: 0;
93
- overflow: hidden;
94
- visibility: hidden;
95
- font-size: var(--font-size-m);
96
- }
97
- }
@@ -1,59 +0,0 @@
1
- <script setup lang="ts">
2
- import { Icon } from '@iconify/vue'
3
- import { computed } from 'vue'
4
- import './alert.scss'
5
-
6
- interface Props {
7
- variant?: 'neutral' | 'info' | 'success' | 'warning' | 'danger'
8
- /**
9
- * Override the variant's default icon
10
- */
11
- icon?: string
12
- /**
13
- * Setting a title and description will use slightly different styling other
14
- * than slots.
15
- */
16
- title?: string
17
- /**
18
- * Use strong color
19
- */
20
- filled?: boolean
21
- description?: string
22
- }
23
-
24
- const {
25
- icon = 'ph:chat-teardrop',
26
- variant = 'neutral',
27
- title,
28
- description,
29
- filled,
30
- } = defineProps<Props>()
31
-
32
- const actualIcon = computed(() => {
33
- switch (variant) {
34
- case 'info': return 'ph:info'
35
- case 'success': return 'ph:check-circle'
36
- case 'warning': return 'ph:warning'
37
- case 'danger': return 'ph:warning-diamond'
38
- default: return icon
39
- }
40
- })
41
- </script>
42
-
43
- <template>
44
- <div class="vui-alert" :class="[{ filled }, `vui-alert-variant-${variant}`]">
45
- <Icon v-if="actualIcon" class="vui-alert-icon" :icon="actualIcon" />
46
- <div v-if="$slots.default && !title" class="vui-alert-content">
47
- <slot />
48
- </div>
49
- <div v-else class="vui-alert-default-content">
50
- <strong v-if="title">{{ title }}</strong>
51
- <p v-if="description">
52
- {{ description }}
53
- </p>
54
- <slot v-else-if="$slots.default" />
55
- </div>
56
-
57
- <slot name="end" />
58
- </div>
59
- </template>
@@ -1,162 +0,0 @@
1
- .vui-alert {
2
- display: flex;
3
- gap: var(--space-s);
4
- border-radius: var(--border-radius-m);
5
- padding: var(--space-s);
6
- font-size: var(--font-size-m);
7
- flex-wrap: nowrap;
8
- align-items: center;
9
- border: 1px solid var(--color-border);
10
- width: 100%;
11
-
12
- .vui-alert-icon {
13
- width: 22px;
14
- height: 22px;
15
- }
16
-
17
- .vui-alert-content,
18
- .vui-alert-default-content {
19
- flex: 1;
20
- }
21
-
22
- .vui-alert-default-content {
23
- strong {
24
- display: block;
25
- font-size: var(--font-size-m);
26
- margin-bottom: 2px;
27
- }
28
-
29
- p {
30
- font-size: var(--font-size-s);
31
- color: var(--color-text-light);
32
- }
33
- }
34
-
35
- .vui-alert-content {
36
- font-size: var(--font-size-m);
37
- font-weight: 400;
38
- }
39
-
40
- &.filled {
41
- border: none !important;
42
- }
43
-
44
- &.vui-alert-variant-neutral {
45
- .vui-alert-icon path {
46
- color: var(--color-text-light);
47
- }
48
-
49
- &.filled {
50
- background-color: var(--color-bg-raised);
51
- }
52
- }
53
-
54
- &.vui-alert-variant-info {
55
- .vui-alert-icon path {
56
- color: var(--color-text-blue);
57
- }
58
-
59
- &.filled {
60
- background-color: hsla(from var(--color-bg-blue-lowered) h s l / 0.5);
61
- }
62
- }
63
-
64
- &.vui-alert-variant-success {
65
- .vui-alert-icon path {
66
- color: var(--color-text-green);
67
- }
68
-
69
- &.filled {
70
- background-color: hsla(from var(--color-bg-green-lowered) h s l / 0.4);
71
- }
72
- }
73
-
74
- &.vui-alert-variant-warning {
75
- .vui-alert-icon path {
76
- color: var(--color-text-yellow);
77
- }
78
-
79
- &.filled {
80
- background-color: hsla(from var(--color-bg-yellow-lowered) h s l / 0.6);
81
- }
82
- }
83
-
84
- &.vui-alert-variant-danger {
85
- .vui-alert-icon path {
86
- color: var(--color-text-red);
87
- }
88
-
89
- &.filled {
90
- background-color: hsla(from var(--color-bg-red-lowered) h s l / 0.5);
91
- }
92
- }
93
- }
94
-
95
- :root.light {
96
- .vui-alert.filled {
97
- border: none;
98
-
99
- &.vui-alert-variant-neutral {
100
- background-color: var(--color-bg-medium);
101
- }
102
-
103
- &.vui-alert-variant-danger {
104
- background-color: hsla(from var(--color-bg-red-raised) h s l / 0.15);
105
- }
106
-
107
- &.vui-alert-variant-warning {
108
- background-color: hsla(from var(--color-bg-yellow-raised) h s l / 0.2);
109
- }
110
-
111
- &.vui-alert-variant-success {
112
- background-color: hsla(from var(--color-bg-green-raised) h s l / 0.15);
113
- }
114
-
115
- &.vui-alert-variant-info {
116
- background-color: hsla(from var(--color-bg-blue-raised) h s l / 0.15);
117
- }
118
- }
119
-
120
- // .vui-alert.vui-alert-variant-success:not(.filled, .outline) {
121
- // background-color: hsla(from var(--color-text-green) h s l / 0.15);
122
- // }
123
-
124
- // .vui-alert.vui-alert-variant-danger .vui-alert-icon path {
125
- // color: var(--color-border-red);
126
- // }
127
-
128
- // .vui-alert.vui-alert-variant-warning .vui-alert-icon path {
129
- // color: var(--color-border-yellow);
130
- // }
131
-
132
- // .vui-alert.vui-alert-variant-success .vui-alert-icon path {
133
- // color: var(--color-border-green);
134
- // }
135
-
136
- // .vui-alert.vui-alert-variant-info .vui-alert-icon path {
137
- // color: var(--color-border-blue);
138
- // }
139
-
140
- // .vui-alert {
141
- // &.filled {
142
- // &.vui-alert-variant-danger .vui-alert-icon path,
143
- // &.vui-alert-variant-warning .vui-alert-icon path,
144
- // &.vui-alert-variant-success .vui-alert-icon path,
145
- // &.vui-alert-variant-info .vui-alert-icon path {
146
- // color: var(--color-text-light);
147
- // }
148
-
149
- // strong,
150
- // p {
151
- // color: var(--color-text);
152
- // }
153
- // }
154
- // }
155
-
156
- // .vui-alert.filled.vui-alert-variant-danger .vui-alert-icon path,
157
- // .vui-alert.filled.vui-alert-variant-warning .vui-alert-icon path,
158
- // .vui-alert.filled.vui-alert-variant-success .vui-alert-icon path,
159
- // .vui-alert.filled.vui-alert-variant-info .vui-alert-icon path {
160
- // color: var(--color-text-light);
161
- // }
162
- }
@@ -1,53 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Sizes } from '../../shared/types'
3
- import { Icon } from '@iconify/vue'
4
- import { ref } from 'vue'
5
- import { formatUnitValue } from '../../shared/helpers'
6
- import { Size } from '../../shared/types'
7
- import './avatar.scss'
8
-
9
- interface Props {
10
- size?: Sizes | number
11
- url?: string
12
- fallback?: string
13
- icon?: string
14
- alt?: string
15
- }
16
-
17
- const {
18
- size = Size.m,
19
- url,
20
- fallback,
21
- alt = 'avatar',
22
- } = defineProps<Props>()
23
-
24
- const showFallback = ref(false)
25
- </script>
26
-
27
- <template>
28
- <div
29
- class="vui-avatar"
30
- :class="[`vui-avatar-size-${typeof size === 'number' ? 'l' : size}`]"
31
- :style="{
32
- ...(typeof size === 'number' && {
33
- '--avatar-size': formatUnitValue(size),
34
- }),
35
- }"
36
- >
37
- <span v-if="$slots.default">
38
- <slot />
39
- </span>
40
- <img
41
- v-else-if="url && !showFallback"
42
- :alt
43
- :src="url"
44
- @error="showFallback = true"
45
- >
46
- <strong v-else>
47
- <template v-if="showFallback">
48
- {{ fallback }}
49
- </template>
50
- <Icon v-else :icon="icon ?? 'ph:user'" />
51
- </strong>
52
- </div>
53
- </template>
@@ -1,52 +0,0 @@
1
- .vui-avatar {
2
- --avatar-size: 36px;
3
-
4
- &.vui-avatar-size-s {
5
- --avatar-size: 28px;
6
-
7
- strong {
8
- font-size: var(--font-size-xs);
9
- }
10
- }
11
-
12
- &.vui-avatar-size-l {
13
- --avatar-size: 48px;
14
-
15
- strong {
16
- font-size: var(--font-size-l);
17
- }
18
- }
19
-
20
- width: var(--avatar-size);
21
- height: var(--avatar-size);
22
- border-radius: 100%;
23
- display: flex;
24
- align-items: center;
25
- justify-content: center;
26
- overflow: hidden;
27
- background-color: var(--color-bg-raised);
28
- font-weight: 500;
29
-
30
- svg {
31
- color: var(--color-text-light);
32
- font-size: inherit;
33
- }
34
-
35
- strong {
36
- display: block;
37
- font-size: var(--font-size-m);
38
- line-height: 1;
39
- }
40
-
41
- img {
42
- display: block;
43
- height: 100%;
44
- width: 100%;
45
- object-position: center;
46
- object-fit: cover;
47
- }
48
-
49
- img[src=''] {
50
- display: none;
51
- }
52
- }