@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.
- package/package.json +1 -2
- package/src/App.vue +0 -103
- package/src/components/Accordion/Accordion.vue +0 -98
- package/src/components/Accordion/AccordionGroup.vue +0 -49
- package/src/components/Accordion/accordion.scss +0 -97
- package/src/components/Alert/Alert.vue +0 -59
- package/src/components/Alert/alert.scss +0 -162
- package/src/components/Avatar/Avatar.vue +0 -53
- package/src/components/Avatar/avatar.scss +0 -52
- package/src/components/Badge/Badge.vue +0 -21
- package/src/components/Badge/badge.scss +0 -210
- package/src/components/Breadcrumbs/BreadcrumbItem.vue +0 -26
- package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -29
- package/src/components/Breadcrumbs/breadcrumbs.scss +0 -31
- package/src/components/Button/Button.vue +0 -86
- package/src/components/Button/button.scss +0 -292
- package/src/components/ButtonGroup/ButtonGroup.vue +0 -28
- package/src/components/ButtonGroup/button-group.scss +0 -51
- package/src/components/Calendar/Calendar.vue +0 -66
- package/src/components/Calendar/calendar.scss +0 -88
- package/src/components/Card/Card.vue +0 -48
- package/src/components/Card/card.scss +0 -55
- package/src/components/Checkbox/Checkbox.vue +0 -54
- package/src/components/Checkbox/checkbox.scss +0 -80
- package/src/components/CopyClipboard/CopyClipboard.vue +0 -98
- package/src/components/CopyClipboard/copy-clipboard.scss +0 -25
- package/src/components/Divider/Divider.vue +0 -38
- package/src/components/Divider/divider.scss +0 -37
- package/src/components/Drawer/Drawer.vue +0 -102
- package/src/components/Drawer/drawer.scss +0 -37
- package/src/components/Dropdown/Dropdown.vue +0 -120
- package/src/components/Dropdown/DropdownItem.vue +0 -33
- package/src/components/Dropdown/DropdownTitle.vue +0 -14
- package/src/components/Dropdown/dropdown-item.scss +0 -84
- package/src/components/Dropdown/dropdown.scss +0 -53
- package/src/components/Flex/Flex.vue +0 -113
- package/src/components/Grid/Grid.vue +0 -87
- package/src/components/Input/Color.vue +0 -26
- package/src/components/Input/Counter.vue +0 -66
- package/src/components/Input/Dropzone.vue +0 -65
- package/src/components/Input/File.vue +0 -15
- package/src/components/Input/Input.vue +0 -123
- package/src/components/Input/Password.vue +0 -35
- package/src/components/Input/Textarea.vue +0 -78
- package/src/components/Input/input.scss +0 -302
- package/src/components/Kbd/Kbd.vue +0 -48
- package/src/components/Kbd/KbdGroup.vue +0 -28
- package/src/components/Kbd/kbd.scss +0 -19
- package/src/components/Modal/Confirm.vue +0 -56
- package/src/components/Modal/Modal.vue +0 -103
- package/src/components/Modal/modal.scss +0 -54
- package/src/components/OTP/OTP.vue +0 -133
- package/src/components/OTP/OTPItem.vue +0 -37
- package/src/components/OTP/otp.scss +0 -84
- package/src/components/Pagination/Pagination.vue +0 -92
- package/src/components/Pagination/pagination.ts +0 -78
- package/src/components/Popout/Popout.vue +0 -73
- package/src/components/Popout/popout.scss +0 -16
- package/src/components/Progress/Progress.vue +0 -103
- package/src/components/Progress/progress.scss +0 -47
- package/src/components/Radio/Radio.vue +0 -38
- package/src/components/Radio/RadioGroup.vue +0 -34
- package/src/components/Radio/radio.scss +0 -78
- package/src/components/Select/Select.vue +0 -212
- package/src/components/Select/select.scss +0 -82
- package/src/components/Sheet/Sheet.vue +0 -106
- package/src/components/Sheet/sheet.scss +0 -71
- package/src/components/Sidebar/Sidebar.vue +0 -116
- package/src/components/Sidebar/sidebar.scss +0 -124
- package/src/components/Skeleton/Skeleton.vue +0 -43
- package/src/components/Skeleton/skeleton.scss +0 -14
- package/src/components/Spinner/Spinner.vue +0 -42
- package/src/components/Spinner/spinner.scss +0 -47
- package/src/components/Switch/Switch.vue +0 -31
- package/src/components/Switch/switch.scss +0 -93
- package/src/components/Table/Cell.vue +0 -23
- package/src/components/Table/Head.vue +0 -66
- package/src/components/Table/Root.vue +0 -66
- package/src/components/Table/SelectAll.vue +0 -23
- package/src/components/Table/SelectRow.vue +0 -30
- package/src/components/Table/index.ts +0 -7
- package/src/components/Table/table.scss +0 -155
- package/src/components/Table/table.ts +0 -248
- package/src/components/Tabs/Tab.vue +0 -25
- package/src/components/Tabs/Tabs.vue +0 -90
- package/src/components/Tabs/tabs.scss +0 -87
- package/src/components/Toast/Toasts.vue +0 -52
- package/src/components/Toast/toast.scss +0 -45
- package/src/components/Toast/toast.ts +0 -75
- package/src/components/Tooltip/Tooltip.vue +0 -78
- package/src/components/Tooltip/tooltip.scss +0 -5
- package/src/examples/ExampleAccordions.vue +0 -69
- package/src/examples/ExampleAlerts.vue +0 -78
- package/src/examples/ExampleAvatars.vue +0 -44
- package/src/examples/ExampleBadges.vue +0 -48
- package/src/examples/ExampleBreadcrumbs.vue +0 -46
- package/src/examples/ExampleButtons.vue +0 -148
- package/src/examples/ExampleCalendars.vue +0 -40
- package/src/examples/ExampleCards.vue +0 -94
- package/src/examples/ExampleCheckboxes.vue +0 -123
- package/src/examples/ExampleCopyClipboard.vue +0 -47
- package/src/examples/ExampleDividers.vue +0 -39
- package/src/examples/ExampleDrawers.vue +0 -67
- package/src/examples/ExampleDropdowns.vue +0 -114
- package/src/examples/ExampleFlexGrid.vue +0 -124
- package/src/examples/ExampleInputs.vue +0 -236
- package/src/examples/ExampleKBD.vue +0 -65
- package/src/examples/ExampleModals.vue +0 -143
- package/src/examples/ExamplePalette.vue +0 -165
- package/src/examples/ExamplePopouts.vue +0 -41
- package/src/examples/ExampleSheets.vue +0 -77
- package/src/examples/ExampleSidebars.vue +0 -276
- package/src/examples/ExampleSkeletons.vue +0 -26
- package/src/examples/ExampleSpinners.vue +0 -80
- package/src/examples/ExampleTables.vue +0 -359
- package/src/examples/ExampleTabs.vue +0 -142
- package/src/examples/ExampleToasts.vue +0 -96
- package/src/examples/ExampleTooltips.vue +0 -70
- package/src/examples/shared/ExampleColor.vue +0 -28
- package/src/index.ts +0 -116
- package/src/internal/Backdrop/Backdrop.vue +0 -22
- package/src/internal/Backdrop/backdrop.scss +0 -34
- package/src/main.ts +0 -5
- package/src/shared/helpers.ts +0 -124
- package/src/shared/slots.ts +0 -61
- package/src/shared/theme.ts +0 -22
- package/src/shared/types.ts +0 -29
- package/src/style/animation.scss +0 -50
- package/src/style/core.scss +0 -133
- package/src/style/fonts.scss +0 -73
- package/src/style/layout.scss +0 -179
- package/src/style/media-query.scss +0 -29
- package/src/style/reset.scss +0 -135
- package/src/style/text.scss +0 -137
- package/src/style/theme.scss +0 -195
- package/src/style/tooltip.scss +0 -146
- package/src/style/typography.scss +0 -435
- package/src/style/utils.scss +0 -36
- package/src/style.scss +0 -1
- package/src/vite-env.d.ts +0 -1
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import './badge.scss'
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
variant?: 'neutral' | 'danger' | 'warning' | 'success' | 'info' | 'accent'
|
|
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>
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
.vui-badge {
|
|
2
|
-
--vui-badge-padding-block: 2px;
|
|
3
|
-
--vui-badge-padding-inline: var(--space-s);
|
|
4
|
-
--vui-badge-font-size: var(--font-size-s);
|
|
5
|
-
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
gap: var(--space-xxs);
|
|
8
|
-
place-items: center;
|
|
9
|
-
padding-inline: var(--vui-badge-padding-inline);
|
|
10
|
-
padding-block: var(--vui-badge-padding-block);
|
|
11
|
-
border-radius: 999px;
|
|
12
|
-
font-size: var(--vui-badge-font-size);
|
|
13
|
-
color: var(--color-text);
|
|
14
|
-
border: 1px solid transparent;
|
|
15
|
-
|
|
16
|
-
svg,
|
|
17
|
-
path {
|
|
18
|
-
color: var(--color-text);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.filled {
|
|
22
|
-
font-weight: 500;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&.vui-badge-variant-neutral {
|
|
26
|
-
&:not(.outline) {
|
|
27
|
-
background-color: var(--color-bg-raised);
|
|
28
|
-
|
|
29
|
-
&.filled {
|
|
30
|
-
background-color: var(--color-text);
|
|
31
|
-
color: var(--color-text-invert);
|
|
32
|
-
border-color: transparent;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
color: var(--color-text);
|
|
37
|
-
// border: 1px solid var(--color-border);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&.vui-badge-variant-info {
|
|
41
|
-
color: var(--color-text-blue);
|
|
42
|
-
|
|
43
|
-
svg,
|
|
44
|
-
path {
|
|
45
|
-
color: var(--color-text-blue);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&:not(.outline) {
|
|
49
|
-
background-color: hsla(from var(--color-bg-blue-raised) h s l / 0.2);
|
|
50
|
-
|
|
51
|
-
&.filled {
|
|
52
|
-
background-color: var(--color-text-blue);
|
|
53
|
-
color: var(--color-text-invert);
|
|
54
|
-
|
|
55
|
-
svg,
|
|
56
|
-
path {
|
|
57
|
-
color: var(--color-text-invert);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&.outline {
|
|
63
|
-
border-color: var(--color-text-blue);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&.vui-badge-variant-success {
|
|
68
|
-
color: var(--color-text-green);
|
|
69
|
-
|
|
70
|
-
svg,
|
|
71
|
-
path {
|
|
72
|
-
color: var(--color-text-green);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&:not(.outline) {
|
|
76
|
-
background-color: hsla(from var(--color-bg-green-raised) h s l / 0.15);
|
|
77
|
-
|
|
78
|
-
&.filled {
|
|
79
|
-
background-color: var(--color-text-green);
|
|
80
|
-
color: var(--color-text-invert);
|
|
81
|
-
|
|
82
|
-
svg,
|
|
83
|
-
path {
|
|
84
|
-
color: var(--color-text-invert);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&.outline {
|
|
90
|
-
border-color: var(--color-text-green);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&.vui-badge-variant-warning {
|
|
95
|
-
color: var(--color-text-yellow);
|
|
96
|
-
|
|
97
|
-
svg,
|
|
98
|
-
path {
|
|
99
|
-
color: var(--color-text-yellow);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&:not(.outline) {
|
|
103
|
-
background-color: hsla(from var(--color-bg-yellow-raised) h s l / 0.15);
|
|
104
|
-
|
|
105
|
-
&.filled {
|
|
106
|
-
background-color: var(--color-text-yellow);
|
|
107
|
-
color: var(--color-text-invert);
|
|
108
|
-
|
|
109
|
-
svg,
|
|
110
|
-
path {
|
|
111
|
-
color: var(--color-text-invert);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
&.outline {
|
|
117
|
-
border-color: var(--color-text-yellow);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&.vui-badge-variant-danger {
|
|
122
|
-
color: var(--color-text-red);
|
|
123
|
-
|
|
124
|
-
svg,
|
|
125
|
-
path {
|
|
126
|
-
color: var(--color-text-red);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
&:not(.outline) {
|
|
130
|
-
background-color: hsla(from var(--color-bg-red-raised) h s l / 0.15);
|
|
131
|
-
|
|
132
|
-
&.filled {
|
|
133
|
-
background-color: var(--color-text-red);
|
|
134
|
-
color: var(--color-text-invert);
|
|
135
|
-
|
|
136
|
-
svg,
|
|
137
|
-
path {
|
|
138
|
-
color: var(--color-text-yellow);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
&.outline {
|
|
144
|
-
border-color: var(--color-text-red);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
color: var(--color-text-red);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
&.vui-badge-variant-accent {
|
|
151
|
-
color: var(--color-accent);
|
|
152
|
-
|
|
153
|
-
svg,
|
|
154
|
-
path {
|
|
155
|
-
color: var(--color-accent);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&:not(.outline) {
|
|
159
|
-
background-color: hsla(from var(--color-bg-accent-raised) h s l / 0.15);
|
|
160
|
-
|
|
161
|
-
&.filled {
|
|
162
|
-
background-color: var(--color-accent);
|
|
163
|
-
color: var(--color-text-invert);
|
|
164
|
-
|
|
165
|
-
svg,
|
|
166
|
-
path {
|
|
167
|
-
color: var(--color-text-invert);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
&.outline {
|
|
173
|
-
border-color: var(--color-accent);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
:root.light {
|
|
179
|
-
.vui-badge.vui-badge-variant-accent:not(.outline).filled,
|
|
180
|
-
.vui-badge.vui-badge-variant-warning:not(.outline).filled {
|
|
181
|
-
color: var(--color-text);
|
|
182
|
-
|
|
183
|
-
svg,
|
|
184
|
-
path {
|
|
185
|
-
color: var(--color-text);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.vui-badge.vui-badge-variant-success:not(.filled, .outline) {
|
|
190
|
-
background-color: hsla(from var(--color-text-green) h s l / 0.15);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.vui-badge.vui-badge-variant-warning:not(.outline).filled {
|
|
194
|
-
background-color: var(--color-bg-yellow-raised);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.vui-badge.vui-badge-variant-success:not(.outline).filled {
|
|
198
|
-
color: var(--color-text-invert);
|
|
199
|
-
background-color: var(--color-text-green);
|
|
200
|
-
|
|
201
|
-
svg,
|
|
202
|
-
path {
|
|
203
|
-
color: var(--color-text-invert);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.vui-badge:not(.filled) {
|
|
208
|
-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script setup lang='ts'>
|
|
2
|
-
import '../Button/button.scss'
|
|
3
|
-
|
|
4
|
-
export interface BreadcrumbItemProps {
|
|
5
|
-
label?: string
|
|
6
|
-
href?: string
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const props = defineProps<BreadcrumbItemProps>()
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<li>
|
|
14
|
-
<a v-if="props.href" :href="props.href" 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>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script setup lang='ts'>
|
|
2
|
-
import { Icon } from '@iconify/vue'
|
|
3
|
-
import { enforceSlotType, useFlattenedSlot } from '../../shared/slots'
|
|
4
|
-
import './breadcrumbs.scss'
|
|
5
|
-
|
|
6
|
-
interface Props {
|
|
7
|
-
separator?: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const {
|
|
11
|
-
separator = 'ph:caret-right',
|
|
12
|
-
} = defineProps<Props>()
|
|
13
|
-
|
|
14
|
-
const slots = defineSlots()
|
|
15
|
-
const flattened = useFlattenedSlot(slots.default)
|
|
16
|
-
enforceSlotType(flattened, 'BreadcrumbItem')
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<template>
|
|
20
|
-
<ul class="vui-breadcrumbs">
|
|
21
|
-
<template v-for="(vnode, index) of flattened" :key="vnode.props?.label || index">
|
|
22
|
-
<component :is="vnode" />
|
|
23
|
-
<template v-if="index !== flattened.length - 1">
|
|
24
|
-
<Icon v-if="separator.length > 1 && separator.includes(':')" class="vui-breadcrumb-custom-separator" :icon="separator" />
|
|
25
|
-
<span v-else class="vui-breadcrumb-custom-separator">{{ separator }}</span>
|
|
26
|
-
</template>
|
|
27
|
-
</template>
|
|
28
|
-
</ul>
|
|
29
|
-
</template>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
.vui-breadcrumbs {
|
|
2
|
-
display: flex;
|
|
3
|
-
gap: var(--space-s);
|
|
4
|
-
align-items: center;
|
|
5
|
-
|
|
6
|
-
.vui-breadcrumb-custom-separator {
|
|
7
|
-
color: var(--color-text-lighter);
|
|
8
|
-
font-size: var(--font-size-m);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
li {
|
|
12
|
-
font-size: var(--font-size-m);
|
|
13
|
-
color: var(--color-text-lighter);
|
|
14
|
-
|
|
15
|
-
.vui-breadcrumb-text-simple {
|
|
16
|
-
color: var(--color-text-lighter);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.vui-breadcrumb-link {
|
|
20
|
-
color: var(--color-text);
|
|
21
|
-
background: transparent;
|
|
22
|
-
text-underline-offset: 4px;
|
|
23
|
-
text-decoration: none;
|
|
24
|
-
|
|
25
|
-
&:hover {
|
|
26
|
-
text-decoration: underline;
|
|
27
|
-
}
|
|
28
|
-
// cursor: pointer;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
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 { isNil } from '../../shared/helpers'
|
|
6
|
-
import { Size } from '../../shared/types'
|
|
7
|
-
import Spinner from '../Spinner/Spinner.vue'
|
|
8
|
-
import './button.scss'
|
|
9
|
-
|
|
10
|
-
export type Variants = 'fill' | 'danger' | 'success' | 'link' | 'accent' | 'gray'
|
|
11
|
-
|
|
12
|
-
interface Props {
|
|
13
|
-
// Provide URL to turn button into anchor
|
|
14
|
-
// href?: string
|
|
15
|
-
// target?: string
|
|
16
|
-
|
|
17
|
-
// State props
|
|
18
|
-
loading?: boolean
|
|
19
|
-
|
|
20
|
-
size?: Sizes
|
|
21
|
-
expand?: boolean
|
|
22
|
-
square?: boolean
|
|
23
|
-
icon?: string
|
|
24
|
-
|
|
25
|
-
variant?: Variants
|
|
26
|
-
outline?: boolean
|
|
27
|
-
// dashed?: boolean
|
|
28
|
-
// outlineDashed?: boolean
|
|
29
|
-
disabled?: boolean
|
|
30
|
-
plain?: boolean
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const {
|
|
34
|
-
loading,
|
|
35
|
-
disabled,
|
|
36
|
-
expand,
|
|
37
|
-
size = 'm',
|
|
38
|
-
variant = 'gray',
|
|
39
|
-
icon,
|
|
40
|
-
// dashed,
|
|
41
|
-
} = defineProps<Props>()
|
|
42
|
-
|
|
43
|
-
const height = computed(() => {
|
|
44
|
-
switch (size) {
|
|
45
|
-
case Size.s: return '28px'
|
|
46
|
-
case Size.l: return '42px'
|
|
47
|
-
case Size.m:
|
|
48
|
-
default: return 'var(--interactive-el-height)'
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
const padding = computed(() => {
|
|
53
|
-
switch (size) {
|
|
54
|
-
case Size.s: return '4px'
|
|
55
|
-
case Size.l: return '18px'
|
|
56
|
-
case Size.m:
|
|
57
|
-
default: return '8px'
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<template>
|
|
63
|
-
<button
|
|
64
|
-
class="vui-button"
|
|
65
|
-
:class="[{ loading, expand, disabled, plain, icon, square, outline }, `vui-button-variant-${variant}`, `vui-button-size-${size}`]"
|
|
66
|
-
:disabled
|
|
67
|
-
role="button"
|
|
68
|
-
:style="{
|
|
69
|
-
'--button-height': height,
|
|
70
|
-
'--button-padding': padding,
|
|
71
|
-
}"
|
|
72
|
-
:name="icon && !$slots.default ? icon.split(':')[1] : undefined"
|
|
73
|
-
>
|
|
74
|
-
<Spinner v-if="!isNil(loading)" size="s" />
|
|
75
|
-
<div class="vui-button-slot">
|
|
76
|
-
<div class="vui-button-slot-start">
|
|
77
|
-
<slot name="start" />
|
|
78
|
-
</div>
|
|
79
|
-
<Icon v-if="icon" :icon="icon" />
|
|
80
|
-
<slot v-else />
|
|
81
|
-
<div class="vui-button-slot-end">
|
|
82
|
-
<slot name="end" />
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</button>
|
|
86
|
-
</template>
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
.vui-button {
|
|
2
|
-
--button-height: var(--interactive-el-height);
|
|
3
|
-
--button-padding: 8px;
|
|
4
|
-
--button-font-size: var(--font-size-s);
|
|
5
|
-
--button-font-size-l: 1.4rem;
|
|
6
|
-
|
|
7
|
-
&.disabled {
|
|
8
|
-
// color: var(--color-text-lighter) !important;
|
|
9
|
-
cursor: not-allowed !important;
|
|
10
|
-
filter: saturate(75%) opacity(50%);
|
|
11
|
-
|
|
12
|
-
svg path {
|
|
13
|
-
color: var(--color-text-light) !important;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&.expand {
|
|
18
|
-
width: 100%;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.loading {
|
|
22
|
-
.vui-spinner {
|
|
23
|
-
opacity: 1;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.vui-button-slot {
|
|
27
|
-
opacity: 0;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&.icon {
|
|
32
|
-
width: var(--button-height);
|
|
33
|
-
padding: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.vui-button-slot svg {
|
|
37
|
-
display: block;
|
|
38
|
-
color: var(--color-text);
|
|
39
|
-
width: 17px;
|
|
40
|
-
height: 17px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&.square {
|
|
44
|
-
width: var(--button-height);
|
|
45
|
-
min-width: var(--button-height);
|
|
46
|
-
min-height: var(--button-height);
|
|
47
|
-
padding: 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&.dashed {
|
|
51
|
-
border-style: dashed !important;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&.vui-button-size-l {
|
|
55
|
-
font-size: var(--button-font-size-l);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
svg path {
|
|
59
|
-
transition: var(--transition-fast);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
height: var(--button-height);
|
|
63
|
-
display: flex;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
border-radius: var(--border-radius-s);
|
|
67
|
-
background: transparent;
|
|
68
|
-
padding-inline: var(--button-padding);
|
|
69
|
-
font-size: var(--button-font-size);
|
|
70
|
-
position: relative;
|
|
71
|
-
transition: var(--transition-fast);
|
|
72
|
-
border: 1px solid transparent;
|
|
73
|
-
background-color: transparent;
|
|
74
|
-
color: var(--color-text);
|
|
75
|
-
font-weight: var(--font-weight-medium);
|
|
76
|
-
|
|
77
|
-
// Default gray
|
|
78
|
-
|
|
79
|
-
.vui-button-slot {
|
|
80
|
-
display: flex;
|
|
81
|
-
place-items: center;
|
|
82
|
-
transition: var(--transition-fast);
|
|
83
|
-
opacity: 1;
|
|
84
|
-
font-weight: var(--font-weight-medium);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.vui-button-slot-start,
|
|
88
|
-
.vui-button-slot-end {
|
|
89
|
-
display: flex;
|
|
90
|
-
place-items: center;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.vui-button-slot-start {
|
|
94
|
-
margin-right: 6px;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.vui-button-slot-end {
|
|
98
|
-
margin-left: 6px;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.vui-spinner {
|
|
102
|
-
transition: var(--transition-fast);
|
|
103
|
-
opacity: 0;
|
|
104
|
-
position: absolute;
|
|
105
|
-
pointer-events: none;
|
|
106
|
-
--spinner-color: var(--color-text);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Variants
|
|
110
|
-
&.vui-button-variant-danger {
|
|
111
|
-
&:not(.plain):not(.outline) {
|
|
112
|
-
color: var(--color-text);
|
|
113
|
-
background-color: var(--color-bg-red-raised);
|
|
114
|
-
|
|
115
|
-
svg,
|
|
116
|
-
path {
|
|
117
|
-
color: var(--color-text);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&.outline {
|
|
122
|
-
border-color: var(--color-bg-red-lowered);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&:not(.plain):not(.disabled):not(.plain):hover,
|
|
126
|
-
&:hover:not(.disabled) {
|
|
127
|
-
background-color: var(--color-bg-red-lowered);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&.vui-button-variant-success {
|
|
132
|
-
&:not(.plain):not(.outline) {
|
|
133
|
-
color: var(--color-text);
|
|
134
|
-
background-color: var(--color-bg-green-raised);
|
|
135
|
-
|
|
136
|
-
svg,
|
|
137
|
-
path {
|
|
138
|
-
color: var(--color-text);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
&.outline {
|
|
143
|
-
border-color: var(--color-bg-green-lowered);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
&:not(.plain):not(.disabled):not(.plain):hover,
|
|
147
|
-
&:hover:not(.disabled) {
|
|
148
|
-
background-color: var(--color-bg-green-lowered);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&.vui-button-variant-gray {
|
|
153
|
-
&:not(.plain):not(.outline) {
|
|
154
|
-
color: var(--color-text);
|
|
155
|
-
background-color: var(--color-button-gray);
|
|
156
|
-
|
|
157
|
-
svg,
|
|
158
|
-
path {
|
|
159
|
-
color: var(--color-text);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
&.outline {
|
|
164
|
-
border-color: var(--color-button-gray-hover);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&:not(.plain):not(.disabled):not(.plain):hover,
|
|
168
|
-
&:hover:not(.disabled) {
|
|
169
|
-
background-color: var(--color-button-gray-hover);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
&.vui-button-variant-fill {
|
|
174
|
-
&:not(.plain):not(.outline) {
|
|
175
|
-
color: var(--color-text-invert);
|
|
176
|
-
background-color: var(--color-button-fill);
|
|
177
|
-
|
|
178
|
-
.vui-spinner {
|
|
179
|
-
--spinner-color: var(--color-text-invert);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
svg,
|
|
183
|
-
path {
|
|
184
|
-
color: var(--color-text-invert);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
&.outline {
|
|
189
|
-
border-color: var(--color-button-fill-hover);
|
|
190
|
-
|
|
191
|
-
&:hover {
|
|
192
|
-
color: var(--color-text-invert);
|
|
193
|
-
|
|
194
|
-
svg,
|
|
195
|
-
path {
|
|
196
|
-
color: var(--color-text-invert);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
&:not(.plain):not(.disabled):not(.plain):hover,
|
|
202
|
-
&:hover:not(.disabled) {
|
|
203
|
-
background-color: var(--color-button-fill-hover);
|
|
204
|
-
|
|
205
|
-
&.plain {
|
|
206
|
-
color: var(--color-text-invert);
|
|
207
|
-
|
|
208
|
-
svg,
|
|
209
|
-
path {
|
|
210
|
-
color: var(--color-text-invert);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
&.vui-button-variant-accent {
|
|
217
|
-
&:not(.plain):not(.outline) {
|
|
218
|
-
color: var(--color-text);
|
|
219
|
-
background-color: var(--color-bg-accent-raised);
|
|
220
|
-
|
|
221
|
-
svg,
|
|
222
|
-
path {
|
|
223
|
-
color: var(--color-text);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
&.outline {
|
|
228
|
-
border-color: var(--color-bg-accent-lowered);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
&:not(.plain):not(.disabled):not(.plain):hover,
|
|
232
|
-
&:hover:not(.disabled) {
|
|
233
|
-
background-color: var(--color-bg-accent-lowered);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
&.vui-button-variant-link {
|
|
238
|
-
color: var(--color-text);
|
|
239
|
-
background: transparent;
|
|
240
|
-
text-underline-offset: 4px;
|
|
241
|
-
cursor: pointer;
|
|
242
|
-
|
|
243
|
-
&:not(:disabled).active,
|
|
244
|
-
&:not(:disabled):hover {
|
|
245
|
-
text-decoration: underline;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
:root.light {
|
|
251
|
-
.vui-button {
|
|
252
|
-
&.vui-button-variant-danger {
|
|
253
|
-
&:not(.plain):not(.outline) {
|
|
254
|
-
color: var(--color-text-invert);
|
|
255
|
-
|
|
256
|
-
svg,
|
|
257
|
-
path {
|
|
258
|
-
color: var(--color-text-invert);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
&.outline:hover {
|
|
263
|
-
color: var(--color-text-invert);
|
|
264
|
-
|
|
265
|
-
svg,
|
|
266
|
-
path {
|
|
267
|
-
color: var(--color-text-invert);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
&.vui-button-variant-success {
|
|
273
|
-
&:not(.plain):not(.outline) {
|
|
274
|
-
color: var(--color-text-invert);
|
|
275
|
-
|
|
276
|
-
svg,
|
|
277
|
-
path {
|
|
278
|
-
color: var(--color-text-invert);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
&.outline:hover {
|
|
283
|
-
color: var(--color-text-invert);
|
|
284
|
-
|
|
285
|
-
svg,
|
|
286
|
-
path {
|
|
287
|
-
color: var(--color-text-invert);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|