@dolanske/vui 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/package.json +1 -2
  2. package/src/App.vue +0 -103
  3. package/src/components/Accordion/Accordion.vue +0 -98
  4. package/src/components/Accordion/AccordionGroup.vue +0 -49
  5. package/src/components/Accordion/accordion.scss +0 -97
  6. package/src/components/Alert/Alert.vue +0 -59
  7. package/src/components/Alert/alert.scss +0 -162
  8. package/src/components/Avatar/Avatar.vue +0 -53
  9. package/src/components/Avatar/avatar.scss +0 -52
  10. package/src/components/Badge/Badge.vue +0 -21
  11. package/src/components/Badge/badge.scss +0 -210
  12. package/src/components/Breadcrumbs/BreadcrumbItem.vue +0 -26
  13. package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -29
  14. package/src/components/Breadcrumbs/breadcrumbs.scss +0 -31
  15. package/src/components/Button/Button.vue +0 -86
  16. package/src/components/Button/button.scss +0 -292
  17. package/src/components/ButtonGroup/ButtonGroup.vue +0 -28
  18. package/src/components/ButtonGroup/button-group.scss +0 -51
  19. package/src/components/Calendar/Calendar.vue +0 -66
  20. package/src/components/Calendar/calendar.scss +0 -88
  21. package/src/components/Card/Card.vue +0 -48
  22. package/src/components/Card/card.scss +0 -55
  23. package/src/components/Checkbox/Checkbox.vue +0 -54
  24. package/src/components/Checkbox/checkbox.scss +0 -80
  25. package/src/components/CopyClipboard/CopyClipboard.vue +0 -98
  26. package/src/components/CopyClipboard/copy-clipboard.scss +0 -25
  27. package/src/components/Divider/Divider.vue +0 -38
  28. package/src/components/Divider/divider.scss +0 -37
  29. package/src/components/Drawer/Drawer.vue +0 -102
  30. package/src/components/Drawer/drawer.scss +0 -37
  31. package/src/components/Dropdown/Dropdown.vue +0 -120
  32. package/src/components/Dropdown/DropdownItem.vue +0 -33
  33. package/src/components/Dropdown/DropdownTitle.vue +0 -14
  34. package/src/components/Dropdown/dropdown-item.scss +0 -84
  35. package/src/components/Dropdown/dropdown.scss +0 -53
  36. package/src/components/Flex/Flex.vue +0 -113
  37. package/src/components/Grid/Grid.vue +0 -87
  38. package/src/components/Input/Color.vue +0 -26
  39. package/src/components/Input/Counter.vue +0 -66
  40. package/src/components/Input/Dropzone.vue +0 -65
  41. package/src/components/Input/File.vue +0 -15
  42. package/src/components/Input/Input.vue +0 -123
  43. package/src/components/Input/Password.vue +0 -35
  44. package/src/components/Input/Textarea.vue +0 -78
  45. package/src/components/Input/input.scss +0 -302
  46. package/src/components/Kbd/Kbd.vue +0 -48
  47. package/src/components/Kbd/KbdGroup.vue +0 -28
  48. package/src/components/Kbd/kbd.scss +0 -19
  49. package/src/components/Modal/Confirm.vue +0 -56
  50. package/src/components/Modal/Modal.vue +0 -103
  51. package/src/components/Modal/modal.scss +0 -54
  52. package/src/components/OTP/OTP.vue +0 -133
  53. package/src/components/OTP/OTPItem.vue +0 -37
  54. package/src/components/OTP/otp.scss +0 -84
  55. package/src/components/Pagination/Pagination.vue +0 -92
  56. package/src/components/Pagination/pagination.ts +0 -78
  57. package/src/components/Popout/Popout.vue +0 -73
  58. package/src/components/Popout/popout.scss +0 -16
  59. package/src/components/Progress/Progress.vue +0 -103
  60. package/src/components/Progress/progress.scss +0 -47
  61. package/src/components/Radio/Radio.vue +0 -38
  62. package/src/components/Radio/RadioGroup.vue +0 -34
  63. package/src/components/Radio/radio.scss +0 -78
  64. package/src/components/Select/Select.vue +0 -212
  65. package/src/components/Select/select.scss +0 -82
  66. package/src/components/Sheet/Sheet.vue +0 -106
  67. package/src/components/Sheet/sheet.scss +0 -71
  68. package/src/components/Sidebar/Sidebar.vue +0 -116
  69. package/src/components/Sidebar/sidebar.scss +0 -124
  70. package/src/components/Skeleton/Skeleton.vue +0 -43
  71. package/src/components/Skeleton/skeleton.scss +0 -14
  72. package/src/components/Spinner/Spinner.vue +0 -42
  73. package/src/components/Spinner/spinner.scss +0 -47
  74. package/src/components/Switch/Switch.vue +0 -31
  75. package/src/components/Switch/switch.scss +0 -93
  76. package/src/components/Table/Cell.vue +0 -23
  77. package/src/components/Table/Head.vue +0 -66
  78. package/src/components/Table/Root.vue +0 -66
  79. package/src/components/Table/SelectAll.vue +0 -23
  80. package/src/components/Table/SelectRow.vue +0 -30
  81. package/src/components/Table/index.ts +0 -7
  82. package/src/components/Table/table.scss +0 -155
  83. package/src/components/Table/table.ts +0 -248
  84. package/src/components/Tabs/Tab.vue +0 -25
  85. package/src/components/Tabs/Tabs.vue +0 -90
  86. package/src/components/Tabs/tabs.scss +0 -87
  87. package/src/components/Toast/Toasts.vue +0 -52
  88. package/src/components/Toast/toast.scss +0 -45
  89. package/src/components/Toast/toast.ts +0 -75
  90. package/src/components/Tooltip/Tooltip.vue +0 -78
  91. package/src/components/Tooltip/tooltip.scss +0 -5
  92. package/src/examples/ExampleAccordions.vue +0 -69
  93. package/src/examples/ExampleAlerts.vue +0 -78
  94. package/src/examples/ExampleAvatars.vue +0 -44
  95. package/src/examples/ExampleBadges.vue +0 -48
  96. package/src/examples/ExampleBreadcrumbs.vue +0 -46
  97. package/src/examples/ExampleButtons.vue +0 -148
  98. package/src/examples/ExampleCalendars.vue +0 -40
  99. package/src/examples/ExampleCards.vue +0 -94
  100. package/src/examples/ExampleCheckboxes.vue +0 -123
  101. package/src/examples/ExampleCopyClipboard.vue +0 -47
  102. package/src/examples/ExampleDividers.vue +0 -39
  103. package/src/examples/ExampleDrawers.vue +0 -67
  104. package/src/examples/ExampleDropdowns.vue +0 -114
  105. package/src/examples/ExampleFlexGrid.vue +0 -124
  106. package/src/examples/ExampleInputs.vue +0 -236
  107. package/src/examples/ExampleKBD.vue +0 -65
  108. package/src/examples/ExampleModals.vue +0 -143
  109. package/src/examples/ExamplePalette.vue +0 -165
  110. package/src/examples/ExamplePopouts.vue +0 -41
  111. package/src/examples/ExampleSheets.vue +0 -77
  112. package/src/examples/ExampleSidebars.vue +0 -276
  113. package/src/examples/ExampleSkeletons.vue +0 -26
  114. package/src/examples/ExampleSpinners.vue +0 -80
  115. package/src/examples/ExampleTables.vue +0 -359
  116. package/src/examples/ExampleTabs.vue +0 -142
  117. package/src/examples/ExampleToasts.vue +0 -96
  118. package/src/examples/ExampleTooltips.vue +0 -70
  119. package/src/examples/shared/ExampleColor.vue +0 -28
  120. package/src/index.ts +0 -116
  121. package/src/internal/Backdrop/Backdrop.vue +0 -22
  122. package/src/internal/Backdrop/backdrop.scss +0 -34
  123. package/src/main.ts +0 -5
  124. package/src/shared/helpers.ts +0 -124
  125. package/src/shared/slots.ts +0 -61
  126. package/src/shared/theme.ts +0 -22
  127. package/src/shared/types.ts +0 -29
  128. package/src/style/animation.scss +0 -50
  129. package/src/style/core.scss +0 -133
  130. package/src/style/fonts.scss +0 -73
  131. package/src/style/layout.scss +0 -179
  132. package/src/style/media-query.scss +0 -29
  133. package/src/style/reset.scss +0 -135
  134. package/src/style/text.scss +0 -137
  135. package/src/style/theme.scss +0 -195
  136. package/src/style/tooltip.scss +0 -146
  137. package/src/style/typography.scss +0 -435
  138. package/src/style/utils.scss +0 -36
  139. package/src/style.scss +0 -1
  140. 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.1",
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
- }