@vcita/design-system 0.3.13 → 0.3.14
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/CHANGELOG.MD +10 -0
- package/config/locales/ds.en.yml +2 -0
- package/dist/@vcita/design-system.esm.js +1082 -707
- package/dist/@vcita/design-system.min.js +1 -1
- package/dist/@vcita/design-system.ssr.js +953 -614
- package/init/SvgIcons.js +1 -0
- package/package.json +1 -1
- package/src/components/VcAvatar/VcAvatar.stories.js +13 -2
- package/src/components/VcAvatar/VcAvatar.vue +56 -20
- package/src/components/VcBanner/VcBanner.stories.js +11 -0
- package/src/components/VcBanner/VcBanner.vue +23 -18
- package/src/components/VcCheckbox/VcCheckbox.stories.js +2 -0
- package/src/components/VcCheckbox/VcCheckbox.vue +19 -14
- package/src/components/VcEmptyState/VcEmptyState.stories.js +18 -9
- package/src/components/VcEmptyState/VcEmptyState.vue +24 -15
- package/src/components/VcExpansionCard/VcExpansionCard.stories.js +35 -2
- package/src/components/VcExpansionCard/VcExpansionCard.vue +63 -53
- package/src/components/VcIconWithTooltip/VcIconWithTooltip.spec.js +1 -1
- package/src/components/VcImage/VcImage.spec.js +46 -0
- package/src/components/VcImage/VcImage.stories.js +34 -0
- package/src/components/VcImage/VcImage.vue +40 -0
- package/src/components/VcTooltip/VcTooltip.stories.js +3 -1
- package/src/components/VcTooltip/VcTooltip.vue +5 -0
- package/src/components/index.js +3 -0
- package/src/components/listBox/VcChecklistItem/VcChecklistItem.spec.js +93 -0
- package/src/components/listBox/VcChecklistItem/VcChecklistItem.stories.js +56 -0
- package/src/components/listBox/VcChecklistItem/VcChecklistItem.vue +112 -0
- package/src/components/listBox/VcListbox/VcListbox.spec.js +131 -0
- package/src/components/listBox/VcListbox/VcListbox.stories.js +79 -0
- package/src/components/listBox/VcListbox/VcListbox.vue +141 -0
- package/src/components/modal/VcNoticeModal/VcNoticeModal.stories.js +20 -19
- package/src/components/modal/VcNoticeModal/VcNoticeModal.vue +17 -6
- package/src/components/wizard/VcStepsBar/VcStepsBar.vue +26 -24
- package/src/components/wizard/VcWizard/VcWizard.spec.js +1 -1
- package/src/components/wizard/VcWizard/VcWizard.stories.js +1 -0
package/init/SvgIcons.js
CHANGED
|
@@ -5,6 +5,7 @@ export default {
|
|
|
5
5
|
vip: `<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.9556 5.35938L9.6 9.125H2.4L1.04438 5.35938C0.997504 5.36718 0.948743 5.375 0.9 5.375C0.403125 5.375 0 4.95508 0 4.4375C0 3.91992 0.404993 3.5 0.901868 3.5C1.39874 3.5 1.80187 3.91992 1.80187 4.4375C1.80187 4.57616 1.77001 4.70703 1.71938 4.82421L3.075 5.67188C3.36187 5.85157 3.73687 5.75 3.90375 5.4453L5.43188 2.66016C5.23125 2.48829 5.1 2.23047 5.1 1.9375C5.1 1.41992 5.50313 1 6 1C6.49687 1 6.9 1.41992 6.9 1.9375C6.9 2.23047 6.76875 2.48829 6.56812 2.66016L8.09625 5.4453C8.26313 5.75 8.63624 5.85157 8.925 5.67188L10.2825 4.82421C10.23 4.70508 10.2 4.57616 10.2 4.4375C10.2 3.91992 10.6031 3.5 11.1 3.5C11.5969 3.5 12 3.91992 12 4.4375C12 4.95508 11.5969 5.375 11.1 5.375C11.0513 5.375 11.0025 5.36718 10.9556 5.35938ZM10.2 10.6875C10.2 10.8594 10.065 11 9.9 11H2.1C1.935 11 1.8 10.8594 1.8 10.6875V10.0625C1.8 9.89063 1.935 9.75 2.1 9.75H9.9C10.065 9.75 10.2 9.89063 10.2 10.0625V10.6875Z"/></svg>`,
|
|
6
6
|
success: `<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M4.0789 10.6903L0.180509 6.79191C-0.0536593 6.5577 -0.0536593 6.17791 0.180509 5.94371L1.02871 5.09555C1.26291 4.86134 1.6427 4.86134 1.8769 5.09555L4.50302 7.7217L10.1279 2.09682C10.3621 1.86258 10.7419 1.86258 10.9761 2.09682L11.8243 2.94498C12.0585 3.17919 12.0585 3.55898 11.8243 3.79318L4.92713 10.6903C4.69289 10.9245 4.31314 10.9245 4.0789 10.6903Z" /></g><defs><clipPath id="clip0"><rect width="12" height="12" fill="white"/></clipPath></defs></svg>`,
|
|
7
7
|
close_button: `<svg viewBox="0 0 14 15" xmlns="http://www.w3.org/2000/svg"><path d="M12.3047 13.0138L13.0119 12.3066C13.1093 12.2091 13.1093 12.0507 13.0119 11.9532L8.05931 7.00064L13.0065 2.05349C13.104 1.95599 13.104 1.79754 13.0065 1.70007L12.2993 0.992855C12.2018 0.895382 12.0434 0.895382 11.9459 0.992855L6.99867 5.94L2.04911 0.99012C1.9516 0.892616 1.79316 0.892616 1.69568 0.99012L0.988167 1.6973C0.890663 1.79481 0.890663 1.95325 0.988167 2.05076L5.93803 7.00064L0.993702 11.9447C0.896198 12.0422 0.896198 12.2006 0.993702 12.2981L1.70088 13.0053C1.79839 13.1028 1.95683 13.1028 2.05434 13.0053L6.99867 8.06127L11.9512 13.0138C12.0487 13.1113 12.2072 13.1113 12.3047 13.0138Z"/> </svg>`,
|
|
8
|
+
plus: `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M13.75 7.25101H8.75V2.25101C8.75 2.12601 8.625 2.00101 8.5 2.00101H7.5C7.34375 2.00101 7.25 2.12601 7.25 2.25101V7.25101H2.25C2.09375 7.25101 2 7.37601 2 7.50101V8.50101C2 8.65726 2.09375 8.75101 2.25 8.75101H7.25V13.751C7.25 13.9072 7.34375 14.001 7.5 14.001H8.5C8.625 14.001 8.75 13.9072 8.75 13.751V8.75101H13.75C13.875 8.75101 14 8.65726 14 8.50101V7.50101C14 7.37601 13.875 7.25101 13.75 7.25101Z"/></svg>`,
|
|
8
9
|
arrow_right: `<svg class="arrow-right" viewBox="0 0 12 13" xmlns="http://www.w3.org/2000/svg"><path d="M6.40093 0.683058C6.15685 0.438981 5.76112 0.438981 5.51704 0.683058C5.27296 0.927136 5.27296 1.32286 5.51704 1.56694L7.78311 3.83301H0.625C0.279822 3.83301 0 4.11283 0 4.45801C0 4.80319 0.279822 5.08301 0.625 5.08301H7.78343L5.51704 7.3494C5.27296 7.59348 5.27296 7.98921 5.51704 8.23328C5.76112 8.47736 6.15685 8.47736 6.40093 8.23328L9.72198 4.91223C9.72612 4.90831 9.73021 4.90433 9.73426 4.90028C9.85634 4.77819 9.91736 4.61818 9.91732 4.45817C9.91736 4.29817 9.85634 4.13815 9.73426 4.01607C9.73021 4.01201 9.72611 4.00803 9.72198 4.00411L6.40093 0.683058Z"/></svg>`,
|
|
9
10
|
warning: `<svg class="vc-notif" viewBox="0 0 16 15" xmlns="http://www.w3.org/2000/svg"><path d="M8.31873 10.5C8.41874 10.5 8.50309 10.4188 8.50623 10.3188L8.74061 5.19378C8.74372 5.08752 8.65934 5.00002 8.55311 5.00002H7.44374C7.33747 5.00002 7.25309 5.08752 7.25624 5.19378L7.49061 10.3188C7.49372 10.4219 7.5781 10.5 7.67811 10.5H8.31873Z"/><path d="M7.99998 12.875C8.48435 12.875 8.87498 12.4844 8.87498 12C8.87498 11.5156 8.48435 11.125 7.99998 11.125C7.5156 11.125 7.12498 11.5156 7.12498 12C7.12498 12.4844 7.5156 12.875 7.99998 12.875Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6.844 0.65625C7.33344 -0.177083 8.52333 -0.216766 9.07706 0.537202L9.15518 0.65625L15.8194 13.0312C16.3119 13.8698 15.7405 14.9092 14.7923 14.9944L14.6665 15H1.33541C0.35042 15 -0.277403 13.993 0.121864 13.1414L6.844 0.65625ZM8.2917 1.16064C8.18032 0.969949 7.90489 0.948761 7.76849 1.07583L7.72445 1.13039L1.0426 13.5368C0.935848 13.719 1.04882 13.9484 1.26113 13.9925L1.33541 14H14.6665C14.8973 14 15.0441 13.7892 14.9714 13.5762L14.9389 13.5054L8.2917 1.16064Z"/></svg>`,
|
|
10
11
|
warning_fill: `<svg class="vc-warning-fill" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.665 15.1111C15.689 15.1111 16.3326 14.0002 15.8199 13.1115L9.1549 1.55518C8.64283 0.667643 7.35802 0.666016 6.84506 1.55518L0.179883 13.1115C-0.331836 13.9985 0.308789 15.1111 1.3348 15.1111H14.665ZM8.60496 9.85592H7.39499C7.23615 9.85592 7.10501 9.73174 7.09637 9.57314L6.91149 5.31541C6.90214 5.14408 7.03852 5.00002 7.21008 5.00002H8.78984C8.96141 5.00002 9.09781 5.14408 9.08846 5.31541L8.90358 9.57314C8.89494 9.73174 8.7638 9.85592 8.60496 9.85592ZM6.85349 11.871C6.85349 12.5042 7.36678 13.0175 7.99998 13.0175C8.63317 13.0175 9.14647 12.5042 9.14647 11.871C9.14647 11.2378 8.63317 10.7246 7.99998 10.7246C7.36678 10.7246 6.85349 11.2378 6.85349 11.871Z"/></svg>`,
|
package/package.json
CHANGED
|
@@ -13,7 +13,9 @@ const Template = (args, {argTypes}) => ({
|
|
|
13
13
|
:lightMode="lightMode"
|
|
14
14
|
:lightModeTooltip="lightModeTooltip"
|
|
15
15
|
:badgePosition="badgePosition"
|
|
16
|
-
:image-path="imagePath"
|
|
16
|
+
:image-path="imagePath"
|
|
17
|
+
:disabled="disabled"
|
|
18
|
+
:show-border="showBorder"/>
|
|
17
19
|
</div>`,
|
|
18
20
|
});
|
|
19
21
|
|
|
@@ -22,7 +24,9 @@ export const Playground = Template.bind({});
|
|
|
22
24
|
Playground.args = {
|
|
23
25
|
size: 'lg',
|
|
24
26
|
colorId: 1,
|
|
25
|
-
name: 'John Smith'
|
|
27
|
+
name: 'John Smith',
|
|
28
|
+
showBorder: true,
|
|
29
|
+
disabled: false
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
export const WithImage = Template.bind({});
|
|
@@ -32,6 +36,13 @@ WithImage.args = {
|
|
|
32
36
|
size: 'md'
|
|
33
37
|
}
|
|
34
38
|
|
|
39
|
+
export const WithImageAsComponent = Template.bind({});
|
|
40
|
+
|
|
41
|
+
WithImageAsComponent.args = {
|
|
42
|
+
imagePath: require('@/stories/assets/upgrade.svg'),
|
|
43
|
+
size: 'md'
|
|
44
|
+
}
|
|
45
|
+
|
|
35
46
|
export const WithText = Template.bind({});
|
|
36
47
|
|
|
37
48
|
WithText.args = {
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
:class="computedClasses"
|
|
4
4
|
:data-qa="dataQa">
|
|
5
5
|
<v-tooltip bottom>
|
|
6
|
-
<template
|
|
7
|
-
<
|
|
6
|
+
<template #activator="{ on, attrs }">
|
|
7
|
+
<VcImage v-on="lightMode && lightModeTooltip && on" v-if="imagePath"
|
|
8
8
|
data-qa="avatarImage"
|
|
9
9
|
class="avatar-image"
|
|
10
|
-
:
|
|
11
|
-
|
|
12
|
-
<div v-on="lightMode && lightModeTooltip && on" v-else-if="!imagePath && name || text"
|
|
10
|
+
:image="imagePath"/>
|
|
11
|
+
<div v-on="lightMode && lightModeTooltip && on" v-if="!imagePath && name || text"
|
|
13
12
|
class="avatar-initials" data-qa="avatar-initials">
|
|
14
13
|
{{ text || initials }}
|
|
15
14
|
</div>
|
|
@@ -25,7 +24,9 @@
|
|
|
25
24
|
</template>
|
|
26
25
|
|
|
27
26
|
<script>
|
|
27
|
+
import VcImage from "@/components/VcImage/VcImage.vue";
|
|
28
28
|
export default {
|
|
29
|
+
components: {VcImage},
|
|
29
30
|
data() {
|
|
30
31
|
return {
|
|
31
32
|
icons: {
|
|
@@ -40,7 +41,7 @@ export default {
|
|
|
40
41
|
name: "VcAvatar",
|
|
41
42
|
props: {
|
|
42
43
|
imagePath: {
|
|
43
|
-
type: String
|
|
44
|
+
type: [String, Object],
|
|
44
45
|
},
|
|
45
46
|
name: {
|
|
46
47
|
type: String
|
|
@@ -71,14 +72,31 @@ export default {
|
|
|
71
72
|
type: String,
|
|
72
73
|
default: ''
|
|
73
74
|
},
|
|
75
|
+
showBorder: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: true
|
|
78
|
+
},
|
|
79
|
+
disabled: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
74
83
|
dataQa: {
|
|
75
84
|
type: String,
|
|
76
85
|
default: 'VcAvatar'
|
|
77
86
|
}
|
|
78
87
|
},
|
|
79
88
|
computed: {
|
|
89
|
+
setLightModeClass() {
|
|
90
|
+
return this.lightMode && !this.imagePath ? "light-mode" : ""
|
|
91
|
+
},
|
|
92
|
+
setShowBorder() {
|
|
93
|
+
return this.showBorder ? 'show-border' : ''
|
|
94
|
+
},
|
|
95
|
+
setdisabled() {
|
|
96
|
+
return this.disabled ? 'vc-disabled' : ''
|
|
97
|
+
},
|
|
80
98
|
computedClasses() {
|
|
81
|
-
return this.colorClass
|
|
99
|
+
return `${this.colorClass} ${this.size} ${this.setLightModeClass} ${this.setShowBorder} ${this.setdisabled}`
|
|
82
100
|
},
|
|
83
101
|
computedBadgeClass() {
|
|
84
102
|
return this.badgeIcon + " " + this.size + " " + this.badgePosition
|
|
@@ -112,6 +130,8 @@ export default {
|
|
|
112
130
|
</script>
|
|
113
131
|
|
|
114
132
|
<style lang="scss" scoped>
|
|
133
|
+
@import '@/../styles/variables.scss';
|
|
134
|
+
|
|
115
135
|
// Avatar Colors
|
|
116
136
|
$avatar_color_0: rgb(254, 214, 47);
|
|
117
137
|
$avatar_color_1: rgb(254, 194, 46);
|
|
@@ -151,37 +171,44 @@ $avatar_colors: $avatar_color_0 $avatar_color_1 $avatar_color_2 $avatar_color_3
|
|
|
151
171
|
border-radius: 50%;
|
|
152
172
|
background-color: #a7a9ac;;
|
|
153
173
|
text-align: center;
|
|
154
|
-
|
|
155
|
-
|
|
174
|
+
color: var(--modal-bg-color);
|
|
175
|
+
|
|
176
|
+
&.show-border {
|
|
177
|
+
border: 1px solid var(--modal-bg-color);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&.vc-disabled {
|
|
181
|
+
filter: grayscale(100%);;
|
|
182
|
+
}
|
|
156
183
|
|
|
157
184
|
&.light-mode {
|
|
158
185
|
border: 1px solid rgba(#000000, .3);
|
|
159
186
|
color: rgba(#000000, .3);
|
|
160
|
-
background-color:
|
|
187
|
+
background-color: var(--modal-bg-color);
|
|
161
188
|
}
|
|
162
189
|
|
|
163
190
|
&.x-sm {
|
|
164
191
|
height: var(--avatar-x-sm);
|
|
165
192
|
width: var(--avatar-x-sm);
|
|
166
|
-
font-size:
|
|
193
|
+
font-size: var(--font-size-xxx-small);
|
|
167
194
|
}
|
|
168
195
|
|
|
169
196
|
&.sm {
|
|
170
197
|
height: var(--avatar-sm);
|
|
171
198
|
width: var(--avatar-sm);
|
|
172
|
-
font-size:
|
|
199
|
+
font-size: var(--font-size-xx-small);
|
|
173
200
|
}
|
|
174
201
|
|
|
175
202
|
&.md {
|
|
176
203
|
height: var(--avatar-md);
|
|
177
204
|
width: var(--avatar-md);
|
|
178
|
-
font-size:
|
|
205
|
+
font-size: var(--font-size-small);
|
|
179
206
|
}
|
|
180
207
|
|
|
181
208
|
&.lg {
|
|
182
209
|
height: var(--avatar-lg);
|
|
183
210
|
width: var(--avatar-lg);
|
|
184
|
-
font-size:
|
|
211
|
+
font-size: var(--font-size-small3);
|
|
185
212
|
}
|
|
186
213
|
|
|
187
214
|
.avatar-image {
|
|
@@ -191,6 +218,15 @@ $avatar_colors: $avatar_color_0 $avatar_color_1 $avatar_color_2 $avatar_color_3
|
|
|
191
218
|
width: 100%;
|
|
192
219
|
object-fit: cover;
|
|
193
220
|
border-radius: 50%;
|
|
221
|
+
overflow: hidden;
|
|
222
|
+
|
|
223
|
+
::v-deep svg {
|
|
224
|
+
height: 100%;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
::v-deep img {
|
|
228
|
+
height: 100%;
|
|
229
|
+
}
|
|
194
230
|
}
|
|
195
231
|
|
|
196
232
|
.avatar-initials {
|
|
@@ -204,16 +240,16 @@ $avatar_colors: $avatar_color_0 $avatar_color_1 $avatar_color_2 $avatar_color_3
|
|
|
204
240
|
fill: white;
|
|
205
241
|
position: absolute;
|
|
206
242
|
--gap: 0;
|
|
207
|
-
height:
|
|
208
|
-
width:
|
|
243
|
+
height: var(--size-value4);
|
|
244
|
+
width: var(--size-value4);
|
|
209
245
|
border-radius: 50%;
|
|
210
246
|
|
|
211
247
|
&.x-sm {
|
|
212
|
-
--gap:
|
|
248
|
+
--gap: var(--size-value1);
|
|
213
249
|
}
|
|
214
250
|
|
|
215
251
|
&.sm {
|
|
216
|
-
--gap:
|
|
252
|
+
--gap: var(--size-value1);
|
|
217
253
|
}
|
|
218
254
|
|
|
219
255
|
&.md {
|
|
@@ -221,7 +257,7 @@ $avatar_colors: $avatar_color_0 $avatar_color_1 $avatar_color_2 $avatar_color_3
|
|
|
221
257
|
}
|
|
222
258
|
|
|
223
259
|
&.lg {
|
|
224
|
-
--gap:
|
|
260
|
+
--gap: var(--size-value0);
|
|
225
261
|
}
|
|
226
262
|
|
|
227
263
|
bottom: calc(var(--gap) * -1);
|
|
@@ -233,7 +269,7 @@ $avatar_colors: $avatar_color_0 $avatar_color_1 $avatar_color_2 $avatar_color_3
|
|
|
233
269
|
}
|
|
234
270
|
|
|
235
271
|
&.confirmed {
|
|
236
|
-
border: 2px
|
|
272
|
+
border: 2px var(--modal-bg-color) solid;
|
|
237
273
|
}
|
|
238
274
|
}
|
|
239
275
|
}
|
|
@@ -39,6 +39,17 @@ Slim.args = {
|
|
|
39
39
|
buttonLabel: ''
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
export const WithImageAsComponent = Template.bind({});
|
|
43
|
+
|
|
44
|
+
// Set default values
|
|
45
|
+
WithImageAsComponent.args = {
|
|
46
|
+
buttonLabel: "Upgrade Now",
|
|
47
|
+
image: require('@/stories/assets/rabbit.svg'),
|
|
48
|
+
title: "Upgrade to get Reports!",
|
|
49
|
+
subtitle: "All the insights you need to understand your business and increase your bottom line.",
|
|
50
|
+
backgroundColor: "#f5fafd"
|
|
51
|
+
}
|
|
52
|
+
|
|
42
53
|
export default {
|
|
43
54
|
title: 'Content display / VcBanner', // This will control the story sidebar position
|
|
44
55
|
id: 'VcBanner', // This will be the link to this component
|
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="VcBanner pa-6 py-md-3 px-md-10 d-flex flex-column flex-md-row align-start align-md-center"
|
|
3
|
-
|
|
2
|
+
<div class="VcBanner pa-6 py-md-3 px-md-10 d-flex flex-column flex-md-row align-start align-md-center"
|
|
3
|
+
:data-qa="dataQa" :style="{backgroundColor: backgroundColor}">
|
|
4
|
+
<VcImage class="d-none d-md-block" :image="image"/>
|
|
4
5
|
<div class="text-container px-md-8 flex-grow-1">
|
|
5
|
-
<div class="banner-title pb-2 pb-md-0">{{title}}</div>
|
|
6
|
+
<div class="banner-title pb-2 pb-md-0">{{ title }}</div>
|
|
6
7
|
<div class="banner-subtitle pb-4 pb-md-0" v-if="subtitle || $slots.subtitle">
|
|
7
8
|
<slot name="subtitle">
|
|
8
|
-
{{subtitle}}
|
|
9
|
+
{{ subtitle }}
|
|
9
10
|
</slot>
|
|
10
11
|
</div>
|
|
11
12
|
</div>
|
|
12
|
-
<VcButton :large="$vuetify.breakpoint.smAndUp" v-if="buttonLabel" @click="$emit('onAction')">
|
|
13
|
+
<VcButton :large="$vuetify.breakpoint.smAndUp" v-if="buttonLabel" @click="$emit('onAction')">
|
|
14
|
+
{{ buttonLabel }}
|
|
15
|
+
</VcButton>
|
|
13
16
|
</div>
|
|
14
17
|
</template>
|
|
15
18
|
|
|
16
19
|
<script>
|
|
17
20
|
import VcButton from "@/components/VcButton/VcButton.vue";
|
|
21
|
+
import VcImage from "@/components/VcImage/VcImage.vue";
|
|
18
22
|
|
|
19
23
|
export default {
|
|
20
24
|
name: "VcBanner",
|
|
21
|
-
components: {VcButton},
|
|
22
|
-
|
|
25
|
+
components: {VcImage, VcButton},
|
|
23
26
|
props: {
|
|
24
27
|
dataQa: {
|
|
25
28
|
type: String,
|
|
26
29
|
default: 'VcBanner'
|
|
27
30
|
},
|
|
28
|
-
image:{
|
|
29
|
-
type: String,
|
|
31
|
+
image: {
|
|
32
|
+
type: [String, Object],
|
|
33
|
+
required: true,
|
|
30
34
|
},
|
|
31
35
|
backgroundColor: {
|
|
32
36
|
type: String,
|
|
33
37
|
default: "#FFFFFF"
|
|
34
38
|
},
|
|
35
|
-
title:{
|
|
39
|
+
title: {
|
|
36
40
|
type: String
|
|
37
41
|
},
|
|
38
|
-
subtitle:{
|
|
42
|
+
subtitle: {
|
|
39
43
|
type: String
|
|
40
44
|
},
|
|
41
45
|
buttonLabel: {
|
|
@@ -48,8 +52,8 @@ export default {
|
|
|
48
52
|
<style lang="scss" scoped>
|
|
49
53
|
@import "../../scss/mixins.scss";
|
|
50
54
|
|
|
51
|
-
.VcBanner{
|
|
52
|
-
|
|
55
|
+
.VcBanner {
|
|
56
|
+
height: 128px;
|
|
53
57
|
box-sizing: border-box;
|
|
54
58
|
box-shadow: var(--shadow-10);
|
|
55
59
|
@include md-and-up {
|
|
@@ -57,10 +61,11 @@ export default {
|
|
|
57
61
|
border-radius: var(--size-value3);
|
|
58
62
|
border: 1px solid var(--neutral-lighten-2);
|
|
59
63
|
}
|
|
60
|
-
|
|
61
|
-
.text-container{
|
|
64
|
+
|
|
65
|
+
.text-container {
|
|
62
66
|
color: var(--gray-darken-5);
|
|
63
|
-
|
|
67
|
+
|
|
68
|
+
.banner-title {
|
|
64
69
|
font-weight: var(--font-weight-large2);
|
|
65
70
|
font-size: var(--font-size-small3);
|
|
66
71
|
line-height: 22px;
|
|
@@ -69,7 +74,8 @@ export default {
|
|
|
69
74
|
line-height: var(--size-value8);
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
|
-
|
|
77
|
+
|
|
78
|
+
.banner-subtitle {
|
|
73
79
|
font-size: var(--font-size-small2);
|
|
74
80
|
line-height: var(--size-value5);
|
|
75
81
|
font-weight: var(--font-weight-medium);
|
|
@@ -77,5 +83,4 @@ export default {
|
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
|
|
80
|
-
|
|
81
86
|
</style>
|
|
@@ -14,6 +14,7 @@ const Template = (args, {argTypes}) => ({
|
|
|
14
14
|
:indeterminate="indeterminate"
|
|
15
15
|
:disabled="disabled"
|
|
16
16
|
:tooltip="tooltip"
|
|
17
|
+
:show-avatar-border="showAvatarBorder"
|
|
17
18
|
@change="onChange"/>
|
|
18
19
|
</div>`,
|
|
19
20
|
})
|
|
@@ -31,6 +32,7 @@ Playground.args = {
|
|
|
31
32
|
indeterminate: false,
|
|
32
33
|
disabled: false,
|
|
33
34
|
tooltip: "tooltip example text",
|
|
35
|
+
showAvatarBorder: true,
|
|
34
36
|
onChange: action('changed'),
|
|
35
37
|
}
|
|
36
38
|
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-checkbox
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
>
|
|
3
|
+
class="vc-checkbox d-flex align-center"
|
|
4
|
+
hide-details="true"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:ripple="false"
|
|
7
|
+
on-icon="check"
|
|
8
|
+
off-icon=""
|
|
9
|
+
indeterminate-icon="$indeterminate"
|
|
10
|
+
:indeterminate="indeterminate"
|
|
11
|
+
color="white"
|
|
12
|
+
v-model="selected"
|
|
13
|
+
:label="label"
|
|
14
|
+
:value="value"
|
|
15
|
+
:data-qa="dataQa">
|
|
17
16
|
<template #label>
|
|
18
17
|
<div class="d-flex align-center">
|
|
19
18
|
<VcAvatar v-if="avatar && label" class="ms-1 me-3"
|
|
20
19
|
:image-path="avatar.path"
|
|
21
20
|
:name="avatar.name"
|
|
22
21
|
:color-id="avatar.colorId"
|
|
22
|
+
:disabled="disabled"
|
|
23
|
+
:show-border="showAvatarBorder"
|
|
23
24
|
size="x-sm"/>
|
|
24
25
|
<span class="checkbox-label" v-if="label">{{ label }}</span>
|
|
25
26
|
<VcTooltip v-if="tooltip && label" dark :content="tooltip" bottom>
|
|
@@ -78,6 +79,10 @@ export default {
|
|
|
78
79
|
type: [String, Boolean, Number],
|
|
79
80
|
default: false,
|
|
80
81
|
},
|
|
82
|
+
showAvatarBorder: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: true
|
|
85
|
+
},
|
|
81
86
|
dataQa: {
|
|
82
87
|
type: String,
|
|
83
88
|
default: 'VcCheckbox'
|
|
@@ -3,19 +3,15 @@ import VcEmptyStateCmp from './VcEmptyState';
|
|
|
3
3
|
const Template = (args, {argTypes}) => ({
|
|
4
4
|
components: {VcEmptyState: VcEmptyStateCmp},
|
|
5
5
|
props: Object.keys(argTypes),
|
|
6
|
-
computed: {
|
|
7
|
-
iconParam() {
|
|
8
|
-
return require('@/stories/assets/rabbit.svg');
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
6
|
template: `
|
|
12
7
|
<div>
|
|
13
|
-
<VcEmptyState :
|
|
14
|
-
:subtitle="subtitle"
|
|
8
|
+
<VcEmptyState :title="title"
|
|
9
|
+
:subtitle="subtitle"
|
|
15
10
|
:size="size"
|
|
16
11
|
:button="button"
|
|
17
12
|
:link-label="linkLabel"
|
|
18
13
|
:link-url="linkUrl"
|
|
14
|
+
:image="image"
|
|
19
15
|
@click="onClick"/>
|
|
20
16
|
</div>`,
|
|
21
17
|
})
|
|
@@ -26,11 +22,24 @@ export const Playground = Template.bind({});
|
|
|
26
22
|
Playground.args = {
|
|
27
23
|
title: 'Title',
|
|
28
24
|
subtitle: 'Subtitle',
|
|
29
|
-
content: 'content text',
|
|
30
25
|
size: 'md',
|
|
31
26
|
button: 'Reload',
|
|
32
27
|
linkLabel: 'link label',
|
|
33
|
-
linkUrl: 'www.google.com'
|
|
28
|
+
linkUrl: 'www.google.com',
|
|
29
|
+
image: require('@/stories/assets/rabbit.svg'),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const WithImageAsComponent = Template.bind({});
|
|
33
|
+
|
|
34
|
+
// Set default values
|
|
35
|
+
WithImageAsComponent.args = {
|
|
36
|
+
title: 'What is different here?',
|
|
37
|
+
subtitle: 'It looks the same, but this one gets the image in a slot and not as a prop, which might come in handy in some cases',
|
|
38
|
+
size: 'md',
|
|
39
|
+
button: 'Reload',
|
|
40
|
+
linkLabel: 'link label',
|
|
41
|
+
linkUrl: 'www.google.com',
|
|
42
|
+
image: require('@/stories/assets/rabbit.svg'),
|
|
34
43
|
}
|
|
35
44
|
|
|
36
45
|
export default {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<VcLayout column :class="`VcEmptyState ${size}`" :data-qa="dataQa">
|
|
3
3
|
<VcLayout column align-content-center>
|
|
4
|
-
<
|
|
5
|
-
<VcSvg v-if="svg" :svg="svg" class="VcEmptyStateImage"/>
|
|
4
|
+
<VcImage v-if="currentImage" :image="currentImage" class="VcEmptyStateImage"/>
|
|
6
5
|
<div class="VcEmptyStateTitle">{{ title }}</div>
|
|
7
6
|
</VcLayout>
|
|
8
7
|
<VcLayout class="VcEmptyStateSubtitle" column>{{ subtitle }}</VcLayout>
|
|
9
8
|
<slot name="buttonArea">
|
|
10
9
|
<VcLayout v-if="button || (linkLabel && linkUrl)" column align-center>
|
|
11
|
-
<VcButton v-if="button" small pill
|
|
10
|
+
<VcButton v-if="button" small pill :block="false" class="VcEmptyStateButton"
|
|
11
|
+
@click="$emit('click')">
|
|
12
|
+
{{ button }}
|
|
13
|
+
</VcButton>
|
|
12
14
|
<VcLink v-if="linkLabel && linkUrl" :url="linkUrl" :label="linkLabel"></VcLink>
|
|
13
15
|
</VcLayout>
|
|
14
16
|
</slot>
|
|
@@ -20,23 +22,28 @@ import VcLayout from "@/components/VcLayout/VcLayout.vue";
|
|
|
20
22
|
import VcButton from "@/components/VcButton/VcButton.vue";
|
|
21
23
|
import VcLink from "@/components/VcLink/VcLink.vue";
|
|
22
24
|
import VcSvg from "@/components/VcSvg/VcSvg.vue";
|
|
25
|
+
import VcImage from "@/components/VcImage/VcImage.vue";
|
|
23
26
|
|
|
24
27
|
export default {
|
|
25
28
|
name: 'VcEmptyState',
|
|
26
|
-
components: {VcSvg, VcButton, VcLayout, VcLink},
|
|
29
|
+
components: {VcImage, VcSvg, VcButton, VcLayout, VcLink},
|
|
27
30
|
props: {
|
|
28
31
|
size: {
|
|
29
32
|
type: String,
|
|
30
33
|
default: 'md',
|
|
31
34
|
validator: prop => ['sm', 'md', 'lg'].includes(prop)
|
|
32
35
|
},
|
|
36
|
+
image: {
|
|
37
|
+
type: [String, Object],
|
|
38
|
+
comment: 'This is the standard way to pass the image, the icon and svg props are for backward compatibility'
|
|
39
|
+
},
|
|
33
40
|
icon: {
|
|
34
|
-
type: String,
|
|
35
|
-
comment: 'url to some image'
|
|
41
|
+
type: [String, Object],
|
|
42
|
+
comment: 'url to some image, deprecated',
|
|
36
43
|
},
|
|
37
44
|
svg: {
|
|
38
|
-
type: String,
|
|
39
|
-
comment: 'using the svgImage design system object'
|
|
45
|
+
type: [String, Object],
|
|
46
|
+
comment: 'using the svgImage design system object, deprecated',
|
|
40
47
|
},
|
|
41
48
|
title: {
|
|
42
49
|
type: String,
|
|
@@ -63,6 +70,12 @@ export default {
|
|
|
63
70
|
default: 'VcEmptyState'
|
|
64
71
|
}
|
|
65
72
|
},
|
|
73
|
+
computed: {
|
|
74
|
+
currentImage() {
|
|
75
|
+
// for backward compatibility
|
|
76
|
+
return this.image || this.icon || this.svg;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
66
79
|
}
|
|
67
80
|
</script>
|
|
68
81
|
|
|
@@ -79,11 +92,7 @@ export default {
|
|
|
79
92
|
|
|
80
93
|
.VcEmptyStateImage {
|
|
81
94
|
margin-bottom: var(--size-value4);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
::v-deep svg {
|
|
85
|
-
width: 160px;
|
|
86
|
-
}
|
|
95
|
+
height: 160px;
|
|
87
96
|
}
|
|
88
97
|
|
|
89
98
|
.VcEmptyStateTitle {
|
|
@@ -104,7 +113,7 @@ export default {
|
|
|
104
113
|
|
|
105
114
|
.sm {
|
|
106
115
|
.VcEmptyStateImage {
|
|
107
|
-
|
|
116
|
+
height: 48px;
|
|
108
117
|
margin-bottom: var(--size-value8);
|
|
109
118
|
|
|
110
119
|
::v-deep svg {
|
|
@@ -115,7 +124,7 @@ export default {
|
|
|
115
124
|
|
|
116
125
|
.lg {
|
|
117
126
|
.VcEmptyStateImage {
|
|
118
|
-
|
|
127
|
+
height: 280px;
|
|
119
128
|
margin-bottom: var(--size-value8);
|
|
120
129
|
|
|
121
130
|
::v-deep svg {
|
|
@@ -14,7 +14,15 @@ const Template = (args, {argTypes}) => ({
|
|
|
14
14
|
return require('../../stories/assets/HeaderImage.svg');
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
|
-
template:
|
|
17
|
+
template: `
|
|
18
|
+
<div>
|
|
19
|
+
<VcExpansionCard
|
|
20
|
+
:disabled="disabled"
|
|
21
|
+
:value="value"
|
|
22
|
+
:toLogo="logoAppParam"
|
|
23
|
+
:fromLogo="logoDirectoryParam"
|
|
24
|
+
:title="title"/>
|
|
25
|
+
</div>`,
|
|
18
26
|
})
|
|
19
27
|
|
|
20
28
|
export const Playground = Template.bind({});
|
|
@@ -23,7 +31,32 @@ export const Playground = Template.bind({});
|
|
|
23
31
|
Playground.args = {
|
|
24
32
|
disabled: false,
|
|
25
33
|
value: false,
|
|
26
|
-
title:'text to <b>storybook</b>'
|
|
34
|
+
title: 'text to <b>storybook</b>'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const TemplateWithLogos = (args, {argTypes}) => ({
|
|
38
|
+
components: {VcExpansionCard: VcExpansionCardCmp},
|
|
39
|
+
props: Object.keys(argTypes),
|
|
40
|
+
template: `
|
|
41
|
+
<div>
|
|
42
|
+
<VcExpansionCard
|
|
43
|
+
:disabled="disabled"
|
|
44
|
+
:value="value"
|
|
45
|
+
:toLogo="toLogo"
|
|
46
|
+
:fromLogo="fromLogo"
|
|
47
|
+
:title="title"/>
|
|
48
|
+
</div>`,
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
export const WithLogosAsComponents = TemplateWithLogos.bind({});
|
|
52
|
+
|
|
53
|
+
// Set default values
|
|
54
|
+
WithLogosAsComponents.args = {
|
|
55
|
+
disabled: false,
|
|
56
|
+
value: false,
|
|
57
|
+
title: 'text to <b>storybook</b>',
|
|
58
|
+
fromLogo: require('../../stories/assets/rabbit.svg'),
|
|
59
|
+
toLogo: require('../../stories/assets/HeaderImage.svg'),
|
|
27
60
|
}
|
|
28
61
|
|
|
29
62
|
export default {
|