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