@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/src/index.ts DELETED
@@ -1,116 +0,0 @@
1
- import Accordion from './components/Accordion/Accordion.vue'
2
- import AccordionGroup from './components/Accordion/AccordionGroup.vue'
3
- import Alert from './components/Alert/Alert.vue'
4
- import Avatar from './components/Avatar/Avatar.vue'
5
- import Badge from './components/Badge/Badge.vue'
6
- import BreadcrumbItem from './components/Breadcrumbs/BreadcrumbItem.vue'
7
- import Breadcrumbs from './components/Breadcrumbs/Breadcrumbs.vue'
8
- import Button from './components/Button/Button.vue'
9
- import ButtonGroup from './components/ButtonGroup/ButtonGroup.vue'
10
- import Calendar from './components/Calendar/Calendar.vue'
11
- import Card from './components/Card/Card.vue'
12
- import Checkbox from './components/Checkbox/Checkbox.vue'
13
- import CopyClipboard from './components/CopyClipboard/CopyClipboard.vue'
14
- import Divider from './components/Divider/Divider.vue'
15
- import Drawer from './components/Drawer/Drawer.vue'
16
- import Dropdown from './components/Dropdown/Dropdown.vue'
17
- import DropdownItem from './components/Dropdown/DropdownItem.vue'
18
- import DropdownTitle from './components/Dropdown/DropdownTitle.vue'
19
- import Flex from './components/Flex/Flex.vue'
20
- import Grid from './components/Grid/Grid.vue'
21
- import Color from './components/Input/Color.vue'
22
- import Counter from './components/Input/Counter.vue'
23
- import Dropzone from './components/Input/Dropzone.vue'
24
- import File from './components/Input/File.vue'
25
- import Input from './components/Input/Input.vue'
26
- import Password from './components/Input/Password.vue'
27
- import Textarea from './components/Input/Textarea.vue'
28
- import Kbd from './components/Kbd/Kbd.vue'
29
- import KbdGroup from './components/Kbd/KbdGroup.vue'
30
- import Confirm from './components/Modal/Confirm.vue'
31
- import Modal from './components/Modal/Modal.vue'
32
- import OTP from './components/OTP/OTP.vue'
33
- import OTPItem from './components/OTP/OTPItem.vue'
34
- import { paginate } from './components/Pagination/pagination'
35
- import Pagination from './components/Pagination/Pagination.vue'
36
- import Popout from './components/Popout/Popout.vue'
37
- import Progress from './components/Progress/Progress.vue'
38
- import Radio from './components/Radio/Radio.vue'
39
- import RadioGroup from './components/Radio/RadioGroup.vue'
40
- import Select from './components/Select/Select.vue'
41
- import Sheet from './components/Sheet/Sheet.vue'
42
- import Sidebar from './components/Sidebar/Sidebar.vue'
43
- import Skeleton from './components/Skeleton/Skeleton.vue'
44
- import Spinner from './components/Spinner/Spinner.vue'
45
- import Switch from './components/Switch/Switch.vue'
46
- import * as Table from './components/Table'
47
- import { defineTable } from './components/Table/table'
48
- import Tab from './components/Tabs/Tab.vue'
49
- import Tabs from './components/Tabs/Tabs.vue'
50
- import { pushToast, removeToast } from './components/Toast/toast'
51
- import Toasts from './components/Toast/Toasts.vue'
52
- import Tooltip from './components/Tooltip/Tooltip.vue'
53
- import Backdrop from './internal/Backdrop/Backdrop.vue'
54
- import { searchString } from './shared/helpers'
55
- import { setColorTheme, theme } from './shared/theme'
56
- import './style.scss'
57
-
58
- export {
59
- Accordion,
60
- AccordionGroup,
61
- Alert,
62
- Avatar,
63
- Backdrop,
64
- Badge,
65
- BreadcrumbItem,
66
- Breadcrumbs,
67
- Button,
68
- ButtonGroup,
69
- Calendar,
70
- Card,
71
- Checkbox,
72
- Color,
73
- Confirm,
74
- CopyClipboard,
75
- Counter,
76
- defineTable,
77
- Divider,
78
- Drawer,
79
- Dropdown,
80
- DropdownItem,
81
- DropdownTitle,
82
- Dropzone,
83
- File,
84
- Flex,
85
- Grid,
86
- Input,
87
- Kbd,
88
- KbdGroup,
89
- Modal,
90
- OTP,
91
- OTPItem,
92
- paginate,
93
- Pagination,
94
- Password,
95
- Popout,
96
- Progress,
97
- pushToast,
98
- Radio,
99
- RadioGroup,
100
- removeToast,
101
- searchString,
102
- Select,
103
- setColorTheme,
104
- Sheet,
105
- Sidebar,
106
- Skeleton,
107
- Spinner,
108
- Switch,
109
- Tab,
110
- Table,
111
- Tabs,
112
- Textarea,
113
- theme,
114
- Toasts,
115
- Tooltip,
116
- }
@@ -1,22 +0,0 @@
1
- <script setup lang="ts">
2
- import { onMounted } from 'vue'
3
- import './backdrop.scss'
4
-
5
- const emits = defineEmits<{
6
- (e: 'close'): void
7
- }>()
8
-
9
- onMounted(() => {
10
- window.addEventListener('keydown', (e) => {
11
- if (e.key === 'Escape') {
12
- emits('close')
13
- }
14
- })
15
- })
16
- </script>
17
-
18
- <template>
19
- <div class="vui-backdrop" @click.self="emits('close')">
20
- <slot />
21
- </div>
22
- </template>
@@ -1,34 +0,0 @@
1
- :root {
2
- --backdrop-offset: 64px;
3
- }
4
-
5
- .vui-backdrop {
6
- z-index: var(--z-overlay);
7
- position: fixed;
8
- display: block;
9
- width: 100dvw;
10
- height: 100dvh;
11
- top: 0;
12
- left: 0;
13
- padding: var(--backdrop-offset);
14
- overflow-y: auto;
15
-
16
- &:after {
17
- content: '';
18
- position: fixed;
19
- z-index: var(--z-behind);
20
- inset: 0;
21
- background-color: var(--color-bg-lowered);
22
- opacity: 0.75;
23
- }
24
- }
25
-
26
- html:has(.vui-backdrop) {
27
- overflow: hidden;
28
- }
29
-
30
- :root.light {
31
- .vui-backdrop:after {
32
- background-color: var(--dark-color-bg);
33
- }
34
- }
package/src/main.ts DELETED
@@ -1,5 +0,0 @@
1
- import { createApp } from 'vue'
2
- import App from './App.vue'
3
- import './style/core.scss'
4
-
5
- createApp(App).mount('#app')
@@ -1,124 +0,0 @@
1
- import type { Placement } from '@floating-ui/vue'
2
-
3
- export function createArray(length: number, startOffset: number = 0): number[] {
4
- return Array
5
- .from({ length })
6
- .map((_, index) => startOffset + index)
7
- }
8
-
9
- // Searches through the input and checkes wether it contains match
10
- // It searches the input by splitting it by whitespace and matching each
11
- // word against the string
12
- export function searchString(match: string | string[], input: string): boolean {
13
- if (!match)
14
- return false
15
-
16
- const joint: string = Array.isArray(match) ? match.join(' ') : match
17
-
18
- const split = input.trim().split(/\s+/)
19
- return split.every(s => joint.toLowerCase().includes(s.toLowerCase()))
20
- }
21
-
22
- export function getMaybeRefLength(value: string | number): number {
23
- return typeof value === 'number' ? value : value.length
24
- }
25
-
26
- export function isNil(value: any): value is undefined | null {
27
- return value === undefined || value === null
28
- }
29
-
30
- /**
31
- * Checks wether a color is light or dark, depending on
32
- */
33
- export function calculateColorLightness(r: number, g: number, b: number): 'dark' | 'light' {
34
- const yiq = (r * 299 + g * 587 + b * 114) / 1000
35
- return yiq >= 128 ? 'light' : 'dark'
36
- }
37
-
38
- /**
39
- * Convert a CSS rgb string to a tuple of actual r,g,b values
40
- *
41
- * 'rgb(12,16,24)' --> [12, 16, 24]
42
- */
43
- export function stringRgbToValues(rgbString: string): [number, number, number] {
44
- return rgbString.match(/\d+/g)!.map(Number) as any as [number, number, number]
45
- }
46
-
47
- // export function rgbToHex(r: number, g: number, b: number): string {
48
- // return `#${[r, g, b].map((x) => {
49
- // const hex = x.toString(16)
50
- // return hex.length === 1 ? `0${hex}` : hex
51
- // }).join('')}`
52
- // }
53
-
54
- export function randomMinMax(min: number, max: number): number {
55
- min = Math.ceil(min)
56
- max = Math.floor(max)
57
- return Math.floor(Math.random() * (max - min + 1)) + min
58
- }
59
-
60
- export function delay(amount: number): Promise<any> {
61
- return new Promise(r => setTimeout(r, amount))
62
- }
63
-
64
- export function setCharAt(str: string, char: string | number, index: number): string {
65
- if (str.length === 0)
66
- return char.toString()
67
- return str.substring(0, index) + char + str.substring(index + 1)
68
- }
69
-
70
- /**
71
- * Takes in a value and if it is a number, appends "px" to it, otherwise returns
72
- * the original value.
73
- *
74
- */
75
- export function formatUnitValue(value: string | number, unit: string = 'px'): string {
76
- return typeof value === 'number'
77
- ? `${value}${unit}`
78
- // If last value of string is NOT a number, do not add "px" at the end
79
- // eslint-disable-next-line unicorn/prefer-number-properties
80
- : isNaN(Number(value[value.length - 1]))
81
- ? value
82
- : `${value}${unit}`
83
- }
84
-
85
- export function clamp(min: number, max: number, value: number): number {
86
- return Math.min(Math.max(value, min), max)
87
- }
88
-
89
- /**
90
- * Checks wether an object is inside of Set, based on comparing values. Not reference
91
- *
92
- * @param set The Set
93
- * @param obj Object which should be in the side
94
- * @returns If object is inside the set
95
- */
96
- export function isObjectInSet(set: Set<any>, obj: any): boolean {
97
- for (const item of set) {
98
- // Check if both have the same number of keys
99
- if (Object.keys(item).length !== Object.keys(obj).length) {
100
- continue
101
- }
102
-
103
- // Compare each key-value pair
104
- let isEqual = true
105
-
106
- for (const key in item) {
107
- if (key in item && item[key] !== obj[key]) {
108
- isEqual = false
109
- break
110
- }
111
- }
112
-
113
- if (isEqual) {
114
- return true
115
- }
116
- }
117
-
118
- return false
119
- }
120
-
121
- export function getPlacementAnimationName(position: Placement): string {
122
- const suffix = position.includes('-') ? position.split('-')[0] : position
123
- return `fade-${suffix}`
124
- }
@@ -1,61 +0,0 @@
1
- import type { ShallowRef, VNode } from 'vue'
2
- import { computed, Fragment, shallowRef, watchEffect } from 'vue'
3
-
4
- type VNodesProps<T extends object> = Array<VNode & { props: T }>
5
-
6
- /**
7
- * Flattens slot children and keeps them in sync reactively.
8
- * @param slotFn The slot function (e.g., slots.default)
9
- * @returns Computed array of flattened VNodes
10
- */
11
- export function useFlattenedSlot<T extends object>(slotFn?: () => VNode[] | undefined): ShallowRef<VNodesProps<T>> {
12
- const rawChildren = shallowRef<VNodesProps<T>>([])
13
-
14
- // Flatten VNodes recursively (handles Fragments)
15
- function flatten(vnodes: VNode[]): VNodesProps<T> {
16
- const result: VNode[] = []
17
-
18
- const walk = (nodes: VNode[] | VNode | undefined): void => {
19
- if (!nodes)
20
- return
21
-
22
- if (Array.isArray(nodes)) {
23
- nodes.forEach(walk)
24
- }
25
- else if (nodes.type === Fragment || Array.isArray(nodes.children)) {
26
- walk(nodes.children as VNode[])
27
- }
28
- else {
29
- result.push(nodes)
30
- }
31
- }
32
-
33
- walk(vnodes)
34
- return result as VNodesProps<T>
35
- }
36
-
37
- // Re-compute children whenever slot content changes
38
- watchEffect(() => {
39
- const content = slotFn?.() ?? []
40
- rawChildren.value = flatten(content)
41
- })
42
-
43
- return computed(() => rawChildren.value)
44
- }
45
-
46
- /**
47
- * Checks whether all of the provided VNodes are of the same type. Throws an
48
- * error if not. This function should be used in components that only allow a
49
- * single type of component
50
- *
51
- * @param vnodes Array of VNodes to check
52
- * @param name Expected name of the components
53
- */
54
- export function enforceSlotType(vnodes: ShallowRef<VNodesProps<any>>, name: string): void {
55
- watchEffect(() => {
56
- // @ts-expect-error Accessing internals
57
- if (vnodes.value.some(item => item.type.__name !== name)) {
58
- throw new Error(`You can only pass \`<${name} />\` components as children.`)
59
- }
60
- })
61
- }
@@ -1,22 +0,0 @@
1
- import { useColorMode } from '@vueuse/core'
2
- import { readonly } from 'vue'
3
-
4
- export type VuiTheme = 'light' | 'dark' | 'auto'
5
-
6
- const themeImpl = useColorMode({
7
- modes: {
8
- dark: 'dark',
9
- light: 'light',
10
- // TODO: add black theme
11
- // TODO: add high contrast light & dark theme
12
- },
13
- })
14
-
15
- export const theme = readonly(themeImpl)
16
-
17
- export function setColorTheme(newTheme: VuiTheme): void {
18
- if (newTheme === themeImpl.value)
19
- return
20
-
21
- themeImpl.value = newTheme
22
- }
@@ -1,29 +0,0 @@
1
- import type { ComponentPublicInstance } from 'vue'
2
-
3
- export enum Size {
4
- s = 's',
5
- m = 'm',
6
- l = 'l',
7
- }
8
-
9
- export type Sizes = 's' | 'm' | 'l'
10
-
11
- export type DeepRequired<T> = { [K in keyof T]: DeepRequired<T[K]> } & Required<T>
12
-
13
- export type VueClass = string | Record<string, | boolean> | Array<string | Record<string, string | boolean>>
14
-
15
- // FLoating UI imported types were ruining the build so here we go
16
- export type PopoutMaybeElement<T> = T | ComponentPublicInstance | null | undefined
17
- export type Placement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end'
18
-
19
- export type Space = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl'
20
- export enum SpaceSize {
21
- xxs = 'xxs',
22
- xs = 'xs',
23
- s = 's',
24
- m = 'm',
25
- l = 'l',
26
- xl = 'xl',
27
- xxl = 'xxl',
28
- xxxl = 'xxxl',
29
- }
@@ -1,50 +0,0 @@
1
- .fade-enter-active,
2
- .fade-leave-active {
3
- transition: opacity 0.15s cubic-bezier(0.65, 0, 0.35, 1);
4
- will-change: opacity;
5
- }
6
-
7
- .fade-enter-from,
8
- .fade-leave-to {
9
- opacity: 0;
10
- }
11
-
12
- // Positioned fade-ins
13
-
14
- // Defaults
15
- .fade-top-enter-active,
16
- .fade-top-leave-active,
17
- .fade-bottom-enter-active,
18
- .fade-bottom-leave-active,
19
- .fade-right-enter-active,
20
- .fade-right-leave-active,
21
- .fade-left-enter-active,
22
- .fade-left-leave-active {
23
- transition: var(--transition);
24
- transition-property: transform, opacity;
25
- }
26
-
27
- // Specifics
28
- .fade-top-enter-from,
29
- .fade-top-leave-to {
30
- opacity: 0;
31
- transform: translateY(8px);
32
- }
33
-
34
- .fade-bottom-enter-from,
35
- .fade-bottom-leave-to {
36
- opacity: 0;
37
- transform: translateY(8px);
38
- }
39
-
40
- .fade-right-enter-from,
41
- .fade-right-leave-to {
42
- opacity: 0;
43
- transform: translateX(8px);
44
- }
45
-
46
- .fade-left-enter-from,
47
- .fade-left-leave-to {
48
- opacity: 0;
49
- transform: translateX(-8px);
50
- }
@@ -1,133 +0,0 @@
1
- @use 'sass:meta';
2
- // Core of the UI library, it should only contain styles which are relevant to
3
- // the library and each component should import it
4
-
5
- // To overwrite any of these styles, simply create a style file and import it
6
- // after this one
7
- @use './reset.scss';
8
- @use './fonts.scss';
9
- @use './theme.scss';
10
-
11
- :root {
12
- color-scheme: dark;
13
-
14
- --container-xs: 360px;
15
- --container-s: 498px;
16
- --container-m: 856px;
17
- --container-l: 1140px;
18
- --container-xl: 1540px;
19
- --container-xxl: 1920px;
20
-
21
- --border-radius-xs: 3px;
22
- --border-radius-s: 5px;
23
- --border-radius-m: 8px;
24
- --border-radius-l: 12px;
25
-
26
- --font-size-xxs: 1rem;
27
- --font-size-xs: 1.15rem;
28
- --font-size-s: 1.3rem;
29
- --font-size-m: 1.5rem;
30
- --font-size-l: 1.8rem;
31
- --font-size-xl: 2rem;
32
- --font-size-xxl: 2.6rem;
33
- --font-size-xxxl: 3.4rem;
34
- --font-size-xxxxl: 4.8rem;
35
-
36
- --space-xxs: 4px;
37
- --space-xs: 8px;
38
- --space-s: 12px;
39
- --space-m: 18px;
40
- --space-l: 24px;
41
- --space-xl: 34px;
42
- --space-xxl: 48px;
43
- --space-xxxl: 64px;
44
-
45
- --transition-fast: 0.055s all ease-in-out;
46
- --transition: 0.1s all cubic-bezier(0.65, 0, 0.35, 1);
47
- --transition-slow: 0.25s all cubic-bezier(0.65, 0, 0.35, 1);
48
-
49
- --global-font: 'Inter', sans-serif;
50
- --global-font-mono: 'Geist Mono', 'Courier New', 'Courier', monospace;
51
-
52
- --font-weight: 300;
53
- --font-weight: 400;
54
- --font-weight-medium: 500;
55
- --font-weight-semibold: 600;
56
- --font-weight-bold: 700;
57
- --font-weight-extrabold: 800;
58
- --font-weight-black: 900;
59
-
60
- --line-height-tight: 1.125em;
61
- --line-height-title: 1.25em;
62
- --line-height-base: 1.4em;
63
-
64
- --z-behind: -1;
65
- --z-default: 1;
66
- --z-active: 50;
67
- --z-mask: 75;
68
- --z-sticky: 100;
69
- --z-nav: 200;
70
- --z-overlay: 300;
71
- --z-popout: 400;
72
- --z-toast: 500;
73
- --z-modal: 600;
74
-
75
- --interactive-el-height: 36px;
76
- }
77
-
78
- // Disable motion for users who have requested it
79
- @media (prefers-reduced-motion: reduce) {
80
- :root {
81
- --transition-fast: 0s all linear;
82
- --transition: 0s all linear;
83
- --transition-slow: 0s all linear;
84
- }
85
- }
86
-
87
- :root {
88
- font-family: var(--global-font);
89
- font-size: 63.5%;
90
- position: relative;
91
- background-color: var(--color-bg);
92
-
93
- overflow-x: hidden;
94
- width: 100%;
95
- font-weight: var(--font-weight);
96
-
97
- font-feature-settings: normal;
98
- font-variation-settings: normal;
99
-
100
- font-synthesis: none;
101
- text-rendering: optimizeLegibility;
102
- -webkit-font-smoothing: antialiased;
103
- -moz-osx-font-smoothing: grayscale;
104
-
105
- * {
106
- -webkit-box-sizing: border-box;
107
- -moz-box-sizing: border-box;
108
- box-sizing: border-box;
109
- outline: none;
110
-
111
- &:focus-visible {
112
- outline: 2px solid var(--color-text);
113
- }
114
- }
115
- }
116
-
117
- body {
118
- color: var(--color-text);
119
- min-height: 100dvh;
120
- }
121
-
122
- // Set base icon color
123
- .iconify {
124
- color: var(--color-text-light);
125
- }
126
-
127
- @include meta.load-css('typography.scss');
128
- @include meta.load-css('layout.scss');
129
- @include meta.load-css('animation.scss');
130
- @include meta.load-css('tooltip.scss');
131
- @include meta.load-css('utils.scss');
132
- @include meta.load-css('text.scss');
133
- @include meta.load-css('media-query.scss');
@@ -1,73 +0,0 @@
1
- // Regular
2
- @font-face {
3
- font-display: swap;
4
- font-family: 'Inter';
5
- font-style: normal;
6
- font-weight: 300;
7
- src: url('/fonts/Inter_18pt-Light.ttf') format('truetype');
8
- }
9
-
10
- @font-face {
11
- font-display: swap;
12
- font-family: 'Inter';
13
- font-style: normal;
14
- font-weight: 400;
15
- src: url('/fonts/Inter_18pt-Regular.ttf') format('truetype');
16
- }
17
-
18
- @font-face {
19
- font-display: swap;
20
- font-family: 'Inter';
21
- font-style: normal;
22
- font-weight: 500;
23
- src: url('/fonts/Inter_18pt-Medium.ttf') format('truetype');
24
- }
25
-
26
- @font-face {
27
- font-display: swap;
28
- font-family: 'Inter';
29
- font-style: normal;
30
- font-weight: 600;
31
- src: url('/fonts/Inter_18pt-SemiBold.ttf') format('truetype');
32
- }
33
-
34
- @font-face {
35
- font-display: swap;
36
- font-family: 'Inter';
37
- font-style: normal;
38
- font-weight: 700;
39
- src: url('/fonts/Inter_18pt-Bold.ttf') format('truetype');
40
- }
41
-
42
- @font-face {
43
- font-display: swap;
44
- font-family: 'Inter';
45
- font-style: normal;
46
- font-weight: 800;
47
- src: url('/fonts/Inter_18pt-ExtraBold.ttf') format('truetype');
48
- }
49
-
50
- @font-face {
51
- font-display: swap;
52
- font-family: 'Inter';
53
- font-style: normal;
54
- font-weight: 900;
55
- src: url('/fonts/Inter_18pt-Black.ttf') format('truetype');
56
- }
57
-
58
- // Monospace
59
- @font-face {
60
- font-display: swap;
61
- font-family: 'Geist Mono';
62
- font-style: normal;
63
- font-weight: 400;
64
- src: url('/fonts/GeistMono-Regular.ttf') format('truetype');
65
- }
66
-
67
- @font-face {
68
- font-display: swap;
69
- font-family: 'Geist Mono';
70
- font-style: normal;
71
- font-weight: 600;
72
- src: url('/fonts/GeistMono-SemiBold.ttf') format('truetype');
73
- }