@dolanske/vui 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/components/Accordion/Accordion.vue.d.ts +45 -0
- package/dist/components/Accordion/AccordionGroup.vue.d.ts +32 -0
- package/dist/components/Alert/Alert.vue.d.ts +29 -0
- package/dist/components/Avatar/Avatar.vue.d.ts +9 -0
- package/dist/components/Badge/Badge.vue.d.ts +21 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +21 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +27 -0
- package/dist/components/Button/Button.vue.d.ts +41 -0
- package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +19 -0
- package/dist/components/Calendar/Calendar.vue.d.ts +27 -0
- package/dist/components/Card/Card.vue.d.ts +25 -0
- package/dist/components/Checkbox/Checkbox.vue.d.ts +31 -0
- package/dist/components/CopyClipboard/CopyClipboard.vue.d.ts +40 -0
- package/dist/components/Divider/Divider.vue.d.ts +24 -0
- package/dist/components/Drawer/Drawer.vue.d.ts +52 -0
- package/dist/components/Dropdown/DropdownItem.vue.d.ts +21 -0
- package/dist/components/Dropdown/DropdownTitle.vue.d.ts +17 -0
- package/dist/components/Flex/Flex.vue.d.ts +38 -0
- package/dist/components/Grid/Grid.vue.d.ts +27 -0
- package/dist/components/Input/Counter.vue.d.ts +19 -0
- package/dist/components/Input/Dropzone.vue.d.ts +107 -0
- package/dist/components/Input/File.vue.d.ts +7 -0
- package/dist/components/Input/Input.vue.d.ts +54 -0
- package/dist/components/Input/Password.vue.d.ts +6 -0
- package/dist/components/Input/Textarea.vue.d.ts +30 -0
- package/dist/components/Kbd/Kbd.vue.d.ts +23 -0
- package/dist/components/Kbd/KbdGroup.vue.d.ts +31 -0
- package/dist/components/Modal/Confirm.vue.d.ts +45 -0
- package/dist/components/Modal/Modal.vue.d.ts +55 -0
- package/dist/components/Pagination/Pagination.vue.d.ts +42 -0
- package/dist/components/Pagination/pagination.d.ts +12 -0
- package/dist/components/Popout/Popout.vue.d.ts +34 -0
- package/dist/components/Progress/Progress.vue.d.ts +31 -0
- package/dist/components/Radio/Radio.vue.d.ts +27 -0
- package/dist/components/Radio/RadioGroup.vue.d.ts +40 -0
- package/dist/components/Select/Select.vue.d.ts +37 -0
- package/dist/components/Sheet/Sheet.vue.d.ts +35 -0
- package/dist/components/Skeleton/Skeleton.vue.d.ts +8 -0
- package/dist/components/Spinner/Spinner.vue.d.ts +6 -0
- package/dist/components/Switch/Switch.vue.d.ts +26 -0
- package/dist/components/Table/Cell.vue.d.ts +19 -0
- package/dist/components/Table/Header.vue.d.ts +29 -0
- package/dist/components/Table/Row.vue.d.ts +16 -0
- package/dist/components/Table/SelectAll.vue.d.ts +2 -0
- package/dist/components/Table/SelectRow.vue.d.ts +6 -0
- package/dist/components/Table/Table.vue.d.ts +40 -0
- package/dist/components/Table/table.d.ts +68 -0
- package/dist/components/Tabs/Tab.vue.d.ts +8 -0
- package/dist/components/Tabs/Tabs.vue.d.ts +43 -0
- package/dist/components/Toast/Toasts.vue.d.ts +2 -0
- package/dist/components/Toast/toast.d.ts +42 -0
- package/dist/components/Tooltip/Tooltip.vue.d.ts +32 -0
- package/dist/index.d.ts +54 -1
- package/dist/internal/Backdrop/Backdrop.vue.d.ts +20 -0
- package/dist/shared/composables.d.ts +3 -0
- package/dist/shared/helpers.d.ts +16 -0
- package/dist/shared/types.d.ts +10 -0
- package/dist/style.css +1 -1
- package/package.json +11 -9
- package/src/App.vue +158 -0
- package/src/components/Accordion/Accordion.vue +75 -0
- package/src/components/Accordion/AccordionGroup.vue +43 -0
- package/src/components/Accordion/accordion.scss +44 -0
- package/src/components/Alert/Alert.vue +53 -0
- package/src/components/Alert/alert.scss +80 -0
- package/src/components/Avatar/Avatar.vue +36 -0
- package/src/components/Avatar/avatar.scss +46 -0
- package/src/components/Badge/Badge.vue +21 -0
- package/src/components/Badge/badge.scss +89 -0
- package/src/components/Breadcrumbs/BreadcrumbItem.vue +26 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +33 -0
- package/src/components/Breadcrumbs/breadcrumbs.scss +30 -0
- package/src/components/Button/Button.vue +90 -0
- package/src/components/Button/button.scss +176 -0
- package/src/components/ButtonGroup/ButtonGroup.vue +25 -0
- package/src/components/ButtonGroup/button-group.scss +51 -0
- package/src/components/Calendar/Calendar.vue +58 -0
- package/src/components/Calendar/calendar.scss +56 -0
- package/src/components/Card/Card.vue +48 -0
- package/src/components/Card/card.scss +53 -0
- package/src/components/Checkbox/Checkbox.vue +49 -0
- package/src/components/Checkbox/checkbox.scss +60 -0
- package/src/components/CopyClipboard/CopyClipboard.vue +82 -0
- package/src/components/CopyClipboard/copy-clipboard.scss +17 -0
- package/src/components/Divider/Divider.vue +34 -0
- package/src/components/Divider/divider.scss +35 -0
- package/src/components/Drawer/Drawer.vue +93 -0
- package/src/components/Drawer/drawer.scss +49 -0
- package/src/components/Dropdown/Dropdown.vue +100 -0
- package/src/components/Dropdown/DropdownItem.vue +29 -0
- package/src/components/Dropdown/DropdownTitle.vue +8 -0
- package/src/components/Dropdown/dropdown.scss +112 -0
- package/src/components/Flex/Flex.vue +109 -0
- package/src/components/Grid/Grid.vue +59 -0
- package/src/components/Input/Counter.vue +70 -0
- package/src/components/Input/Dropzone.vue +63 -0
- package/src/components/Input/File.vue +15 -0
- package/src/components/Input/Input.vue +118 -0
- package/src/components/Input/Password.vue +47 -0
- package/src/components/Input/Textarea.vue +73 -0
- package/src/components/Input/input.scss +199 -0
- package/src/components/Kbd/Kbd.vue +48 -0
- package/src/components/Kbd/KbdGroup.vue +31 -0
- package/src/components/Kbd/kbd.scss +18 -0
- package/src/components/Modal/Confirm.vue +56 -0
- package/src/components/Modal/Modal.vue +91 -0
- package/src/components/Modal/modal.scss +49 -0
- package/src/components/Pagination/Pagination.vue +74 -0
- package/src/components/Pagination/pagination.ts +78 -0
- package/src/components/Popout/Popout.vue +39 -0
- package/src/components/Popout/popout.scss +7 -0
- package/src/components/Progress/Progress.vue +84 -0
- package/src/components/Progress/progress.scss +41 -0
- package/src/components/Radio/Radio.vue +36 -0
- package/src/components/Radio/RadioGroup.vue +35 -0
- package/src/components/Radio/radio.scss +59 -0
- package/src/components/Select/Select.vue +180 -0
- package/src/components/Select/select.scss +43 -0
- package/src/components/Sheet/Sheet.vue +91 -0
- package/src/components/Sheet/sheet.scss +56 -0
- package/src/components/Skeleton/Skeleton.vue +46 -0
- package/src/components/Skeleton/skeleton.scss +14 -0
- package/src/components/Spinner/Spinner.vue +44 -0
- package/src/components/Spinner/spinner.scss +46 -0
- package/src/components/Switch/Switch.vue +30 -0
- package/src/components/Switch/switch.scss +52 -0
- package/src/components/Table/Cell.vue +23 -0
- package/src/components/Table/Header.vue +59 -0
- package/src/components/Table/Row.vue +9 -0
- package/src/components/Table/SelectAll.vue +23 -0
- package/src/components/Table/SelectRow.vue +29 -0
- package/src/components/Table/Table.vue +66 -0
- package/src/components/Table/table.scss +134 -0
- package/src/components/Table/table.ts +243 -0
- package/src/components/Tabs/Tab.vue +21 -0
- package/src/components/Tabs/Tabs.vue +76 -0
- package/src/components/Tabs/tabs.scss +78 -0
- package/src/components/Toast/Toasts.vue +47 -0
- package/src/components/Toast/toast.scss +41 -0
- package/src/components/Toast/toast.ts +92 -0
- package/src/components/Tooltip/Tooltip.vue +80 -0
- package/src/components/Tooltip/tooltip.scss +4 -0
- package/src/index.scss +1 -0
- package/src/index.ts +111 -0
- package/src/internal/Backdrop/Backdrop.vue +22 -0
- package/src/internal/Backdrop/backdrop.scss +28 -0
- package/src/main.ts +5 -0
- package/src/shared/composables.ts +18 -0
- package/src/shared/helpers.ts +53 -0
- package/src/shared/types.ts +11 -0
- package/src/style/animation.scss +21 -0
- package/src/style/core.scss +128 -0
- package/src/style/fonts.scss +0 -0
- package/src/style/layout.scss +9 -0
- package/src/style/media-query.scss +29 -0
- package/src/style/reset.scss +135 -0
- package/src/style/tooltip.scss +128 -0
- package/src/style/typography.scss +339 -0
- package/src/style/utils.scss +22 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { VNode } from 'vue'
|
|
3
|
+
import type { AccordionProps } from './Accordion.vue'
|
|
4
|
+
import type Accordion from './Accordion.vue'
|
|
5
|
+
import { useTemplateRef } from 'vue'
|
|
6
|
+
// Renderless component which is used to house multiple accordions which can be triggered together in some way
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
/**
|
|
10
|
+
* If set to true, if an accordion opens, all other close
|
|
11
|
+
*/
|
|
12
|
+
single?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = defineProps<Props>()
|
|
16
|
+
|
|
17
|
+
const slots = defineSlots<{
|
|
18
|
+
default: () => Array<VNode & { props: AccordionProps }>
|
|
19
|
+
}>()
|
|
20
|
+
|
|
21
|
+
const accordionRefs = useTemplateRef<InstanceType<typeof Accordion>[]>('accordionRefs')
|
|
22
|
+
|
|
23
|
+
function handleAccordionOpen(newIndex: number) {
|
|
24
|
+
if (!accordionRefs.value || !props.single)
|
|
25
|
+
return
|
|
26
|
+
|
|
27
|
+
accordionRefs.value.forEach((item, index) => {
|
|
28
|
+
if (index !== newIndex) {
|
|
29
|
+
item.close()
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<component
|
|
37
|
+
:is="item"
|
|
38
|
+
v-for="(item, index) of slots.default()"
|
|
39
|
+
ref="accordionRefs"
|
|
40
|
+
:key="item"
|
|
41
|
+
@open="handleAccordionOpen(index)"
|
|
42
|
+
/>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.vui-accordion {
|
|
2
|
+
width: 100%;
|
|
3
|
+
transition: var(--transition);
|
|
4
|
+
border-bottom: 1px solid var(--color-border);
|
|
5
|
+
padding-bottom: 0;
|
|
6
|
+
|
|
7
|
+
&.open {
|
|
8
|
+
padding-bottom: var(--space-m);
|
|
9
|
+
|
|
10
|
+
.vui-accordion-header svg {
|
|
11
|
+
transform: rotate(180deg);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.vui-accordion-header {
|
|
16
|
+
display: flex;
|
|
17
|
+
width: 100%;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
align-items: center;
|
|
20
|
+
padding: var(--space-m) 0;
|
|
21
|
+
color: pointer;
|
|
22
|
+
font-size: var(--font-size-m);
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
color: var(--color-text);
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
text-decoration: underline;
|
|
28
|
+
text-underline-offset: 4px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
svg {
|
|
32
|
+
transition: var(--transition);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// padding-bottom: var(--w);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.vui-accordion-content {
|
|
39
|
+
transition: var(--transition-slow);
|
|
40
|
+
width: 100%;
|
|
41
|
+
max-height: 0;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
/**
|
|
14
|
+
* Setting a title and description will use slightly different styling other than slots.
|
|
15
|
+
*/
|
|
16
|
+
title?: string
|
|
17
|
+
description?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
icon = 'ph:circle-light',
|
|
22
|
+
variant = 'neutral',
|
|
23
|
+
title,
|
|
24
|
+
description,
|
|
25
|
+
} = defineProps<Props>()
|
|
26
|
+
|
|
27
|
+
const actualIcon = computed(() => {
|
|
28
|
+
switch (variant) {
|
|
29
|
+
case 'info': return 'ph:info'
|
|
30
|
+
case 'success': return 'ph:check-circle'
|
|
31
|
+
case 'warning': return 'ph:warning'
|
|
32
|
+
case 'danger': return 'ph:warning-diamond'
|
|
33
|
+
default: return icon
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<div class="vui-alert" :class="[`vui-alert-variant-${variant}`]">
|
|
40
|
+
<Icon v-if="actualIcon" class="vui-alert-icon" :icon="actualIcon" />
|
|
41
|
+
<div v-if="$slots.default" class="vui-alert-content">
|
|
42
|
+
<slot />
|
|
43
|
+
</div>
|
|
44
|
+
<div v-else class="vui-alert-default-content">
|
|
45
|
+
<strong v-if="title">{{ title }}</strong>
|
|
46
|
+
<p v-if="description">
|
|
47
|
+
{{ description }}
|
|
48
|
+
</p>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<slot name="end" />
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
@@ -0,0 +1,80 @@
|
|
|
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: flex-start;
|
|
9
|
+
|
|
10
|
+
svg {
|
|
11
|
+
width: 22px;
|
|
12
|
+
height: 22px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.vui-alert-content,
|
|
16
|
+
.vui-alert-default-content {
|
|
17
|
+
flex: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.vui-alert-default-content {
|
|
21
|
+
padding-top: 3px;
|
|
22
|
+
|
|
23
|
+
strong {
|
|
24
|
+
display: block;
|
|
25
|
+
font-size: var(--font-size-l);
|
|
26
|
+
font-weight: 550;
|
|
27
|
+
margin-bottom: 6px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
p {
|
|
31
|
+
font-size: var(--font-size-ms);
|
|
32
|
+
color: var(--color-text-light);
|
|
33
|
+
font-weight: 350;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.vui-alert-content {
|
|
38
|
+
font-size: var(--font-size-m);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.vui-alert-variant-neutral {
|
|
42
|
+
border: 1px solid var(--color-border);
|
|
43
|
+
|
|
44
|
+
svg path {
|
|
45
|
+
color: var(--color-text);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.vui-alert-variant-info {
|
|
50
|
+
border: 1px solid var(--color-border-blue);
|
|
51
|
+
|
|
52
|
+
svg path {
|
|
53
|
+
color: var(--color-text-blue);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.vui-alert-variant-success {
|
|
58
|
+
border: 1px solid var(--color-border-green);
|
|
59
|
+
|
|
60
|
+
svg path {
|
|
61
|
+
color: var(--color-text-green);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.vui-alert-variant-warning {
|
|
66
|
+
border: 1px solid var(--color-border-yellow);
|
|
67
|
+
|
|
68
|
+
svg path {
|
|
69
|
+
color: var(--color-text-yellow);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.vui-alert-variant-danger {
|
|
74
|
+
border: 1px solid var(--color-border-red);
|
|
75
|
+
|
|
76
|
+
svg path {
|
|
77
|
+
color: var(--color-text-red);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 './avatar.scss'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
size?: Sizes
|
|
9
|
+
url?: string
|
|
10
|
+
fallback?: string
|
|
11
|
+
icon?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
size = 'm',
|
|
16
|
+
url,
|
|
17
|
+
fallback,
|
|
18
|
+
} = defineProps<Props>()
|
|
19
|
+
|
|
20
|
+
const showFallback = ref(false)
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div
|
|
25
|
+
class="vui-avatar"
|
|
26
|
+
:class="[`vui-avatar-size-${size}`]"
|
|
27
|
+
>
|
|
28
|
+
<img v-if="url && !showFallback" :src="url" @error="showFallback = true">
|
|
29
|
+
<strong v-else>
|
|
30
|
+
<template v-if="showFallback">
|
|
31
|
+
{{ fallback }}
|
|
32
|
+
</template>
|
|
33
|
+
<Icon v-else :icon="icon ?? 'ph:user'" />
|
|
34
|
+
</strong>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.vui-avatar {
|
|
2
|
+
--button-size: 36px;
|
|
3
|
+
|
|
4
|
+
&.vui-avatar-size-s {
|
|
5
|
+
--button-size: 28px;
|
|
6
|
+
|
|
7
|
+
strong {
|
|
8
|
+
font-size: var(--font-size-xs);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.vui-avatar-size-l {
|
|
13
|
+
--button-size: 48px;
|
|
14
|
+
|
|
15
|
+
strong {
|
|
16
|
+
font-size: var(--font-size-m);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
width: var(--button-size);
|
|
21
|
+
height: var(--button-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
|
+
strong {
|
|
31
|
+
display: block;
|
|
32
|
+
font-size: var(--font-size-s);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
img {
|
|
36
|
+
display: block;
|
|
37
|
+
height: 100%;
|
|
38
|
+
width: 100%;
|
|
39
|
+
object-position: center;
|
|
40
|
+
object-fit: cover;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
img[src=''] {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import './badge.scss'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
variant?: 'neutral' | 'danger' | 'warning' | 'success' | 'info'
|
|
6
|
+
outline?: boolean
|
|
7
|
+
filled?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
variant = 'neutral',
|
|
12
|
+
outline,
|
|
13
|
+
filled,
|
|
14
|
+
} = defineProps<Props>()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div class="vui-badge" :class="[{ outline, filled }, `vui-badge-variant-${variant}`]">
|
|
19
|
+
<slot />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.vui-badge {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
gap: var(--space-s);
|
|
4
|
+
place-items: center;
|
|
5
|
+
height: 26px;
|
|
6
|
+
padding-inline: var(--space-s);
|
|
7
|
+
border-radius: 999px;
|
|
8
|
+
font-weight: 300;
|
|
9
|
+
font-size: var(--font-size-s);
|
|
10
|
+
|
|
11
|
+
&.filled {
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.vui-badge-variant-neutral {
|
|
16
|
+
&:not(.outline) {
|
|
17
|
+
background-color: var(--color-bg-raised);
|
|
18
|
+
|
|
19
|
+
&.filled {
|
|
20
|
+
background-color: var(--color-text);
|
|
21
|
+
color: var(--color-text-invert);
|
|
22
|
+
border-color: transparent;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
color: var(--color-text);
|
|
27
|
+
border: 1px solid var(--color-border);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.vui-badge-variant-info {
|
|
31
|
+
&:not(.outline) {
|
|
32
|
+
background-color: var(--color-bg-blue-lowered);
|
|
33
|
+
|
|
34
|
+
&.filled {
|
|
35
|
+
background-color: var(--color-text-blue);
|
|
36
|
+
color: var(--color-text-invert);
|
|
37
|
+
border-color: transparent;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
color: var(--color-text);
|
|
42
|
+
border: 1px solid var(--color-border-blue);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.vui-badge-variant-success {
|
|
46
|
+
&:not(.outline) {
|
|
47
|
+
background-color: var(--color-bg-green-lowered);
|
|
48
|
+
|
|
49
|
+
&.filled {
|
|
50
|
+
background-color: var(--color-text-green);
|
|
51
|
+
color: var(--color-text-invert);
|
|
52
|
+
border-color: transparent;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
color: var(--color-text);
|
|
57
|
+
border: 1px solid var(--color-border-green);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.vui-badge-variant-warning {
|
|
61
|
+
&:not(.outline) {
|
|
62
|
+
background-color: var(--color-bg-yellow-lowered);
|
|
63
|
+
|
|
64
|
+
&.filled {
|
|
65
|
+
background-color: var(--color-text-yellow);
|
|
66
|
+
color: var(--color-text-invert);
|
|
67
|
+
border-color: transparent;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
color: var(--color-text);
|
|
72
|
+
border: 1px solid var(--color-border-yellow);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.vui-badge-variant-danger {
|
|
76
|
+
&:not(.outline) {
|
|
77
|
+
background-color: var(--color-bg-red-lowered);
|
|
78
|
+
|
|
79
|
+
&.filled {
|
|
80
|
+
background-color: var(--color-text-red);
|
|
81
|
+
color: var(--color-text-invert);
|
|
82
|
+
border-color: transparent;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
color: var(--color-text);
|
|
87
|
+
border: 1px solid var(--color-border-red);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import '../Button/button.scss'
|
|
3
|
+
|
|
4
|
+
export interface BreadcrumbItemProps {
|
|
5
|
+
label?: string
|
|
6
|
+
path?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props = defineProps<BreadcrumbItemProps>()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<li>
|
|
14
|
+
<a v-if="props.path" :href="props.path" class="vui-breadcrumb-link">
|
|
15
|
+
<slot>
|
|
16
|
+
{{ props.label }}
|
|
17
|
+
</slot>
|
|
18
|
+
</a>
|
|
19
|
+
|
|
20
|
+
<slot v-else>
|
|
21
|
+
<span class="vui-breadcrumb-text-simple">
|
|
22
|
+
{{ props.label }}
|
|
23
|
+
</span>
|
|
24
|
+
</slot>
|
|
25
|
+
</li>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { VNode } from 'vue'
|
|
3
|
+
import type { BreadcrumbItemProps } from './BreadcrumbItem.vue'
|
|
4
|
+
import { Icon } from '@iconify/vue'
|
|
5
|
+
import './breadcrumbs.scss'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
separator?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
separator = 'ph:caret-right',
|
|
13
|
+
} = defineProps<Props>()
|
|
14
|
+
|
|
15
|
+
const slots = defineSlots<{
|
|
16
|
+
default: () => Array<VNode & { props: BreadcrumbItemProps }>
|
|
17
|
+
}>()
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<ul class="vui-breadcrumbs">
|
|
22
|
+
<template v-for="(vnode, index) of slots.default()" :key="vnode.props.label">
|
|
23
|
+
<component
|
|
24
|
+
:is="vnode"
|
|
25
|
+
v-bind="vnode.props"
|
|
26
|
+
/>
|
|
27
|
+
<template v-if="index !== slots.default().length - 1">
|
|
28
|
+
<Icon v-if="separator.length > 1 && separator.includes(':')" class="vui-breadcrumb-custom-separator" :icon="separator" />
|
|
29
|
+
<span v-else class="vui-breadcrumb-custom-separator">{{ separator }}</span>
|
|
30
|
+
</template>
|
|
31
|
+
</template>
|
|
32
|
+
</ul>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.vui-breadcrumbs {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: var(--space-m);
|
|
4
|
+
align-items: center;
|
|
5
|
+
|
|
6
|
+
.vui-breadcrumb-custom-separator {
|
|
7
|
+
color: var(--color-text-lighter);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
li {
|
|
11
|
+
font-size: var(--font-size-s);
|
|
12
|
+
color: var(--color-text-lighter);
|
|
13
|
+
|
|
14
|
+
.vui-breadcrumb-text-simple {
|
|
15
|
+
color: var(--color-text-lighter);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.vui-breadcrumb-link {
|
|
19
|
+
color: var(--color-text);
|
|
20
|
+
background: transparent;
|
|
21
|
+
text-underline-offset: 4px;
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
text-decoration: underline;
|
|
26
|
+
}
|
|
27
|
+
// cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Sizes } from '../../shared/types'
|
|
3
|
+
import { Icon } from '@iconify/vue'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import { Size } from '../../shared/types'
|
|
6
|
+
import Spinner from '../Spinner/Spinner.vue'
|
|
7
|
+
import './button.scss'
|
|
8
|
+
|
|
9
|
+
export type Variants = 'default' | 'danger' | 'success' | 'link' | 'blue' | 'accent'
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
// Provide URL to turn button into anchor
|
|
13
|
+
// href?: string
|
|
14
|
+
// target?: string
|
|
15
|
+
loading?: boolean
|
|
16
|
+
expand?: boolean
|
|
17
|
+
square?: boolean
|
|
18
|
+
dashed?: boolean
|
|
19
|
+
disabled?: boolean
|
|
20
|
+
size?: Sizes
|
|
21
|
+
/**
|
|
22
|
+
* Sets the hover styling property
|
|
23
|
+
*/
|
|
24
|
+
active?: boolean
|
|
25
|
+
/**
|
|
26
|
+
* No styling applied to the button unless hovered
|
|
27
|
+
*/
|
|
28
|
+
plain?: boolean
|
|
29
|
+
variant?: Variants
|
|
30
|
+
/**
|
|
31
|
+
* The children will be set to an icon and the icon will become a square
|
|
32
|
+
*/
|
|
33
|
+
icon?: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
loading,
|
|
38
|
+
disabled,
|
|
39
|
+
expand,
|
|
40
|
+
size = 'm',
|
|
41
|
+
variant = 'default',
|
|
42
|
+
icon,
|
|
43
|
+
dashed,
|
|
44
|
+
} = defineProps<Props>()
|
|
45
|
+
|
|
46
|
+
const actualHeight = computed(() => {
|
|
47
|
+
switch (size) {
|
|
48
|
+
case Size.s: return '24px'
|
|
49
|
+
case Size.l: return '40px'
|
|
50
|
+
case Size.m:
|
|
51
|
+
default: return '32px'
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const actualPadding = computed(() => {
|
|
56
|
+
switch (size) {
|
|
57
|
+
case Size.s: return '5px'
|
|
58
|
+
case Size.l: return '16px'
|
|
59
|
+
case Size.m:
|
|
60
|
+
default: return '8px'
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<button
|
|
67
|
+
class="vui-button"
|
|
68
|
+
:class="[{ loading, expand, disabled, plain, active, icon, square, dashed }, `vui-button-variant-${variant}`]"
|
|
69
|
+
:disabled
|
|
70
|
+
>
|
|
71
|
+
<Spinner size="s" />
|
|
72
|
+
<div class="vui-button-slot">
|
|
73
|
+
<div class="vui-button-slot-start">
|
|
74
|
+
<slot name="start" />
|
|
75
|
+
</div>
|
|
76
|
+
<Icon v-if="icon" :icon="icon" />
|
|
77
|
+
<slot v-else />
|
|
78
|
+
<div class="vui-button-slot-end">
|
|
79
|
+
<slot name="end" />
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</button>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
.vui-button {
|
|
87
|
+
--button-height: v-bind(actualHeight);
|
|
88
|
+
--button-padding: v-bind(actualPadding);
|
|
89
|
+
}
|
|
90
|
+
</style>
|