@vcita/design-system 1.2.2 → 1.3.0
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 +16 -1
- package/config/locales/ds.en.yml +8 -1
- package/config/locales/ds.he.yml +3 -0
- package/dist/@vcita/design-system.esm.js +1652 -958
- package/dist/@vcita/design-system.min.js +2 -2
- package/dist/@vcita/design-system.ssr.js +1468 -854
- package/init/DesignSystem.js +2 -0
- package/init/SvgIcons.js +12 -2
- package/package.json +1 -1
- package/src/components/VcAvatar/VcAvatar.stories.js +0 -1
- package/src/components/VcBreadcrumbs/VcBreadcrumbs.spec.js +82 -0
- package/src/components/VcBreadcrumbs/VcBreadcrumbs.stories.js +86 -0
- package/src/components/VcBreadcrumbs/VcBreadcrumbs.vue +59 -0
- package/src/components/VcButton/VcButton.stories.js +13 -2
- package/src/components/VcButton/VcButton.vue +16 -7
- package/src/components/VcGalleryItem/VcGalleryItem.spec.js +120 -0
- package/src/components/VcGalleryItem/VcGalleryItem.stories.js +94 -0
- package/src/components/VcGalleryItem/VcGalleryItem.vue +161 -0
- package/src/components/VcGalleryList/VcGalleryList.spec.js +86 -0
- package/src/components/VcGalleryList/VcGalleryList.stories.js +63 -0
- package/src/components/VcGalleryList/VcGalleryList.vue +102 -0
- package/src/components/VcGalleryList/mockData.js +50 -0
- package/src/components/VcLink/VcLink.vue +13 -1
- package/src/components/VcMiniBanner/VcMiniBanner.spec.js +74 -0
- package/src/components/VcMiniBanner/VcMiniBanner.stories.js +75 -0
- package/src/components/VcMiniBanner/VcMiniBanner.vue +129 -0
- package/src/components/VcSearchPicker/VcSearchPicker.vue +12 -5
- package/src/components/VcSideNav/VcSideNav.vue +2 -0
- package/src/components/VcTextField/VcTextField.stories.js +2 -1
- package/src/components/VcUpsellBlock/VcUpsellBlock.stories.js +7 -2
- package/src/components/VcUpsellBlock/VcUpsellBlock.vue +3 -0
- package/src/components/index.js +5 -0
- package/src/components/list/VcList/pattern/VcMobilePickerPattern.stories.js +3 -0
- package/src/components/modal/elements/VcModalContainer.stories.js +6 -0
- package/src/components/modal/elements/VcModalContainer.vue +7 -14
- package/src/components/page/elements/VcPageHeader.spec.js +123 -0
- package/src/components/page/elements/VcPageHeader.stories.js +80 -0
- package/src/components/page/elements/VcPageHeader.vue +96 -0
- package/src/components/page/layouts/SideNavPage/SideNavLayout.stories.js +223 -0
- package/src/components/page/layouts/centeredPage/CenteredPageLayout.stories.js +162 -0
- package/src/stories/assets/app-market/fc.svg +31 -0
- package/src/stories/assets/app-market/google.svg +1 -0
- package/src/stories/assets/app-market/qb.svg +9 -0
- package/src/stories/assets/app-market/stripe.svg +1 -0
- package/src/stories/assets/app-market/zapier.svg +1 -0
- package/src/stories/assets/pics/gallery-item-1.jpg +0 -0
- package/src/stories/assets/pics/gallery-item-2.jpg +0 -0
- package/src/stories/assets/pics/gallery-item-3.jpg +0 -0
- package/src/stories/assets/pics/gallery-item-4.jpg +0 -0
- package/src/stories/assets/pics/gallery-item-5.jpg +0 -0
- package/src/stories/variables.stories.mdx +9 -2
- package/styles/variables.scss +9 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/VcMenu/.DS_Store +0 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vc-gallery-item" :data-qa="dataQa"
|
|
3
|
+
:class="{'vc-gallery-item--is-create': isCreate}">
|
|
4
|
+
<div class="vc-gallery-item__thumbnail"
|
|
5
|
+
:data-qa="`${dataQa}-thumbnail`"
|
|
6
|
+
@click="isCreate ? $emit('onCreate') : isMobile && $emit('onExpend', { uid })">
|
|
7
|
+
<div class="vc-gallery-item__image" :style="{ backgroundImage: `url(${src})` }" v-if="!isCreate" role="image" />
|
|
8
|
+
<div class="buttons flex-column align-center justify-center" v-if="!isMobile || isCreate" >
|
|
9
|
+
<slot name="actions">
|
|
10
|
+
<VcButton @click="$emit('onSelect', { uid })"
|
|
11
|
+
pill
|
|
12
|
+
:label="$dst('ds.gallery_item.select')"
|
|
13
|
+
:data-qa="`${dataQa}-select-btn`"
|
|
14
|
+
v-if="!isCreate"
|
|
15
|
+
class="buttons__select" />
|
|
16
|
+
<VcButton @click="$emit('onPreview', { uid })"
|
|
17
|
+
flavor="secondary"
|
|
18
|
+
pill
|
|
19
|
+
:label="$dst('ds.gallery_item.preview')"
|
|
20
|
+
:data-qa="`${dataQa}-preview-btn`"
|
|
21
|
+
v-if="!isCreate"
|
|
22
|
+
class="buttons__preview" />
|
|
23
|
+
<div class="create__wrap" v-else>
|
|
24
|
+
<VcButton class="create__button" icon plain :data-qa="`${dataQa}-create-button`">
|
|
25
|
+
<template #prepend>
|
|
26
|
+
<VcIcon size="32" :color="$vuetify.theme.defaults.light.secondary.base">$plus</VcIcon>
|
|
27
|
+
</template>
|
|
28
|
+
</VcButton>
|
|
29
|
+
</div>
|
|
30
|
+
</slot>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<h3 class="vc-gallery-item__label" :data-qa="`${dataQa}-label`">
|
|
34
|
+
<slot name="label">
|
|
35
|
+
{{ !isCreate ? label : $dst('ds.gallery_item.create') }}
|
|
36
|
+
</slot>
|
|
37
|
+
</h3>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import VcButton from "@/components/VcButton/VcButton.vue";
|
|
43
|
+
import VcIcon from "@/components/VcIcon/VcIcon.vue";
|
|
44
|
+
export default {
|
|
45
|
+
name: "VcGalleryItem",
|
|
46
|
+
components: {
|
|
47
|
+
VcButton,
|
|
48
|
+
VcIcon
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
dataQa: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: 'VcGalleryItem'
|
|
54
|
+
},
|
|
55
|
+
isMobile: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
required: true
|
|
58
|
+
},
|
|
59
|
+
uid: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: true
|
|
62
|
+
},
|
|
63
|
+
src: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: ''
|
|
66
|
+
},
|
|
67
|
+
label: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: ''
|
|
70
|
+
},
|
|
71
|
+
isCreate: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
required: false
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="scss" scoped>
|
|
80
|
+
@import "../../scss/mixins.scss";
|
|
81
|
+
|
|
82
|
+
.vc-gallery-item {
|
|
83
|
+
max-width: 252px;
|
|
84
|
+
margin-bottom: var(--size-value4);
|
|
85
|
+
|
|
86
|
+
@include sm-and-up {
|
|
87
|
+
min-width: 200px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.VcButton.secondary__text {
|
|
91
|
+
background-color: var(--v-secondary-lighten2);
|
|
92
|
+
color: var(--v-secondary-base)!important;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__thumbnail {
|
|
96
|
+
position: relative;
|
|
97
|
+
height: 0;
|
|
98
|
+
padding-bottom: 136%;
|
|
99
|
+
border-radius: var(--border-radius);
|
|
100
|
+
box-shadow: var(--shadow-4);
|
|
101
|
+
margin-bottom: var(--size-value3);
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
|
|
104
|
+
.vc-gallery-item--is-create & {
|
|
105
|
+
background: var(--v-secondary-lighten3);
|
|
106
|
+
border: 1px dashed var(--v-secondary-base);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&__image {
|
|
111
|
+
padding-bottom: inherit;
|
|
112
|
+
width: 100%;
|
|
113
|
+
height: 100%;
|
|
114
|
+
background-size: cover;
|
|
115
|
+
background-repeat: no-repeat;
|
|
116
|
+
background-position: top center;
|
|
117
|
+
|
|
118
|
+
.vc-gallery-item__thumbnail:hover & {
|
|
119
|
+
filter: blur(5px);
|
|
120
|
+
transition: filter 0.3s ease-out;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&__label {
|
|
125
|
+
font-weight: var(--font-weight-medium2);
|
|
126
|
+
font-size: var(--font-size-small);
|
|
127
|
+
line-height: 1.5;
|
|
128
|
+
text-align: center;
|
|
129
|
+
color: var(--gray-darken-5);
|
|
130
|
+
|
|
131
|
+
.vc-gallery-item--is-create & {
|
|
132
|
+
color: var(--v-secondary-base);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.buttons {
|
|
138
|
+
position: absolute;
|
|
139
|
+
width: 100%;
|
|
140
|
+
height: 100%;
|
|
141
|
+
left: 0;
|
|
142
|
+
top: 0;
|
|
143
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
144
|
+
display: none;
|
|
145
|
+
|
|
146
|
+
.vc-gallery-item--is-create & {
|
|
147
|
+
display: flex;
|
|
148
|
+
background-color: var(--neutral-lighten-3);
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.vc-gallery-item__thumbnail:hover & {
|
|
153
|
+
display: flex;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&__select {
|
|
157
|
+
margin-bottom: var(--size-value4);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import '@testing-library/jest-dom'
|
|
2
|
+
import VcGalleryList from './VcGalleryList.vue';
|
|
3
|
+
import Vuetify from 'vuetify'
|
|
4
|
+
import { render } from '@testing-library/vue';
|
|
5
|
+
import init from '../../../testing-library.config';
|
|
6
|
+
import { fireEvent } from "@testing-library/dom";
|
|
7
|
+
import { items } from './mockData';
|
|
8
|
+
|
|
9
|
+
init();
|
|
10
|
+
|
|
11
|
+
const baseProps = {
|
|
12
|
+
isMobile: false,
|
|
13
|
+
showCreate: true,
|
|
14
|
+
items,
|
|
15
|
+
title: 'Nice list'
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe('VcGalleryList.vue', () => {
|
|
19
|
+
|
|
20
|
+
const renderWithVuetify = (options, callback) => {
|
|
21
|
+
const root = document.createElement('div')
|
|
22
|
+
root.setAttribute('data-app', 'true')
|
|
23
|
+
|
|
24
|
+
return render(
|
|
25
|
+
VcGalleryList,
|
|
26
|
+
{
|
|
27
|
+
container: document.body.appendChild(root),
|
|
28
|
+
vuetify: new Vuetify(),
|
|
29
|
+
...options,
|
|
30
|
+
mocks: { $dst: value => value },
|
|
31
|
+
},
|
|
32
|
+
callback,
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
it('Mounts', () => {
|
|
37
|
+
const {container} = renderWithVuetify({
|
|
38
|
+
props: baseProps
|
|
39
|
+
})
|
|
40
|
+
expect(container).toHaveAttribute('data-app', 'true')
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('Renders correct title', async () => {
|
|
44
|
+
const { queryByText, updateProps } = renderWithVuetify({
|
|
45
|
+
props: baseProps
|
|
46
|
+
});
|
|
47
|
+
expect(queryByText(baseProps.title.repeat(2))).not.toBeInTheDocument();
|
|
48
|
+
expect(queryByText(baseProps.title)).toBeInTheDocument();
|
|
49
|
+
await updateProps({ title: baseProps.title.repeat(2) })
|
|
50
|
+
expect(queryByText(baseProps.title.repeat(2))).toBeInTheDocument();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('Toggles title rendering', async () => {
|
|
54
|
+
const { queryByTestId, updateProps } = renderWithVuetify({
|
|
55
|
+
props: baseProps
|
|
56
|
+
});
|
|
57
|
+
const title = queryByTestId('VcGalleryList-title')
|
|
58
|
+
expect(title).toBeTruthy();
|
|
59
|
+
await updateProps({ title: '' })
|
|
60
|
+
const currentTitle = queryByTestId('VcGalleryList-title')
|
|
61
|
+
expect(currentTitle).toBeFalsy();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('Toggles "create" button display', async () => {
|
|
65
|
+
const { queryByTestId, updateProps } = renderWithVuetify({
|
|
66
|
+
props: baseProps
|
|
67
|
+
});
|
|
68
|
+
const createBtn = queryByTestId('create-thumbnail')
|
|
69
|
+
expect(createBtn).toBeTruthy();
|
|
70
|
+
await updateProps({ showCreate: false })
|
|
71
|
+
const currentCreateBtn = queryByTestId('create-thumbnail')
|
|
72
|
+
expect(currentCreateBtn).toBeFalsy();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('Events emission', async () => {
|
|
76
|
+
const { queryByTestId, emitted } = renderWithVuetify({
|
|
77
|
+
props: baseProps
|
|
78
|
+
});
|
|
79
|
+
const createBtn = queryByTestId('create-thumbnail')
|
|
80
|
+
expect(createBtn).toBeTruthy();
|
|
81
|
+
expect(emitted().onCreate).toBeFalsy()
|
|
82
|
+
await fireEvent.click(createBtn)
|
|
83
|
+
expect(emitted().onCreate.length).toBe(1)
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import VcGalleryListCmp from './VcGalleryList';
|
|
2
|
+
import { items } from './mockData';
|
|
3
|
+
|
|
4
|
+
const baseProps = {
|
|
5
|
+
isMobile: false,
|
|
6
|
+
items,
|
|
7
|
+
title: 'Holidays & Special Events',
|
|
8
|
+
showCreate: false,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Template = (args, {argTypes}) => ({
|
|
12
|
+
components: {VcGalleryList: VcGalleryListCmp},
|
|
13
|
+
props: Object.keys(argTypes),
|
|
14
|
+
template:
|
|
15
|
+
`<div>
|
|
16
|
+
<div class="description" :style="{margin: '20px 0'}">
|
|
17
|
+
<h4 :style="{margin: '8px 0'}">
|
|
18
|
+
This component functions as a list/grid.
|
|
19
|
+
</h4>
|
|
20
|
+
<h4 :style="{fontWeight: 400}">
|
|
21
|
+
Responsive breakpoints are derived from vuetify.<br />
|
|
22
|
+
It is coupled with VcGalleryItem.<br />
|
|
23
|
+
It can present a 'new item' button using a 'showCreate' prop.<br />
|
|
24
|
+
</h4>
|
|
25
|
+
</div>
|
|
26
|
+
<VcGalleryList :isMobile="isMobile"
|
|
27
|
+
:items="items"
|
|
28
|
+
:title="title"
|
|
29
|
+
:showCreate="showCreate"
|
|
30
|
+
@onSelect="onSelect"
|
|
31
|
+
@onPreview="onPreview"
|
|
32
|
+
@onExpend="onExpend"
|
|
33
|
+
@onCreate="onCreate"
|
|
34
|
+
/>
|
|
35
|
+
</div>`,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export const Playground = Template.bind({});
|
|
39
|
+
Playground.args = baseProps;
|
|
40
|
+
|
|
41
|
+
export const WithCreateButton = Template.bind({});
|
|
42
|
+
WithCreateButton.args = {
|
|
43
|
+
...baseProps,
|
|
44
|
+
showCreate: true
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
title: 'Content display / VcGalleryList',
|
|
49
|
+
id: 'VcGalleryList',
|
|
50
|
+
component: VcGalleryListCmp,
|
|
51
|
+
argTypes: {
|
|
52
|
+
createHandler: { action: 'create' },
|
|
53
|
+
},
|
|
54
|
+
parameters: {
|
|
55
|
+
design: {
|
|
56
|
+
type: 'figma',
|
|
57
|
+
url: 'https://www.figma.com/file/7FONyMxCo0nkhyz013Xmai/Campaign-editor?node-id=1504%3A205665',
|
|
58
|
+
},
|
|
59
|
+
status: {
|
|
60
|
+
type: 'stable', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vc-gallery-list" :data-qa="dataQa">
|
|
3
|
+
<h2 v-if="title" class="vc-gallery-list__title" :data-qa="`${dataQa}-title`">{{ title }}</h2>
|
|
4
|
+
<div :class="`vc-gallery-list__items vc-gallery-list__items--${$vuetify.breakpoint.name}`">
|
|
5
|
+
<VcGalleryItem v-if="showCreate"
|
|
6
|
+
:isCreate="true"
|
|
7
|
+
:isMobile="false"
|
|
8
|
+
uid="1"
|
|
9
|
+
src="1"
|
|
10
|
+
dataQa="create"
|
|
11
|
+
@onCreate="$emit('onCreate')"
|
|
12
|
+
/>
|
|
13
|
+
<VcGalleryItem v-for="item in items"
|
|
14
|
+
:key="item.uid"
|
|
15
|
+
:uid="item.uid"
|
|
16
|
+
:isMobile="isMobile"
|
|
17
|
+
:src="item.src"
|
|
18
|
+
:label="item.label"
|
|
19
|
+
@onSelect="(uid) => $emit('onSelect', uid)"
|
|
20
|
+
@onPreview="(uid) => $emit('onPreview', uid)"
|
|
21
|
+
@onExpend="(uid) => $emit('onExpend', uid)"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import VcGalleryItem from "@/components/VcGalleryItem/VcGalleryItem.vue";
|
|
30
|
+
export default {
|
|
31
|
+
name: "VcGalleryList",
|
|
32
|
+
components: {
|
|
33
|
+
VcGalleryItem
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
dataQa: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: 'VcGalleryList'
|
|
39
|
+
},
|
|
40
|
+
isMobile: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
items: {
|
|
45
|
+
type: Array,
|
|
46
|
+
required: true,
|
|
47
|
+
validator: prop => prop.every(item => item.uid),
|
|
48
|
+
},
|
|
49
|
+
title: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: false
|
|
52
|
+
},
|
|
53
|
+
showCreate: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style lang="scss" scoped>
|
|
62
|
+
@import "../../scss/mixins.scss";
|
|
63
|
+
|
|
64
|
+
.vc-gallery-list {
|
|
65
|
+
|
|
66
|
+
.vc-gallery-list__title {
|
|
67
|
+
font-size: var(--font-size-small2);
|
|
68
|
+
font-weight: var(--font-weight-large);
|
|
69
|
+
margin-bottom: var(--size-value4);
|
|
70
|
+
|
|
71
|
+
@include sm-and-up{
|
|
72
|
+
margin-bottom: var(--size-value12);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.vc-gallery-list__items {
|
|
77
|
+
display: grid;
|
|
78
|
+
grid-template-columns: repeat(2, 1fr);
|
|
79
|
+
grid-gap: var(--size-value5);
|
|
80
|
+
|
|
81
|
+
&--sm {
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&--md {
|
|
85
|
+
grid-template-columns: repeat(3, 1fr);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&--lg {
|
|
89
|
+
grid-template-columns: repeat(5, 1fr);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&--xl {
|
|
93
|
+
grid-template-columns: repeat(6, 1fr);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--md, &--lg, &--xl {
|
|
97
|
+
grid-gap: var(--size-value8);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const IMAGES = {
|
|
2
|
+
gallery_item1: require('@/stories/assets/pics/gallery-item-1.jpg'),
|
|
3
|
+
gallery_item2: require('@/stories/assets/pics/gallery-item-2.jpg'),
|
|
4
|
+
gallery_item3: require('@/stories/assets/pics/gallery-item-3.jpg'),
|
|
5
|
+
gallery_item4: require('@/stories/assets/pics/gallery-item-4.jpg'),
|
|
6
|
+
gallery_item5: require('@/stories/assets/pics/gallery-item-5.jpg'),
|
|
7
|
+
}
|
|
8
|
+
const items = [
|
|
9
|
+
{
|
|
10
|
+
"uid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bef",
|
|
11
|
+
"src": IMAGES.gallery_item1,
|
|
12
|
+
"label": "Thank’s for your application"
|
|
13
|
+
}, {
|
|
14
|
+
"uid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bea",
|
|
15
|
+
"src": IMAGES.gallery_item2,
|
|
16
|
+
"label": "Nice template"
|
|
17
|
+
}, {
|
|
18
|
+
"uid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4beg",
|
|
19
|
+
"src": IMAGES.gallery_item3,
|
|
20
|
+
"label": "Celebrate wine week"
|
|
21
|
+
}, {
|
|
22
|
+
"uid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4befz",
|
|
23
|
+
"src": IMAGES.gallery_item4,
|
|
24
|
+
"label": "Thank’s for your application"
|
|
25
|
+
}, {
|
|
26
|
+
"uid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4beax",
|
|
27
|
+
"src": IMAGES.gallery_item5,
|
|
28
|
+
"label": "Nice template"
|
|
29
|
+
}, {
|
|
30
|
+
"uid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4begc",
|
|
31
|
+
"src": IMAGES.gallery_item1,
|
|
32
|
+
"label": "Celebrate wine week"
|
|
33
|
+
}, {
|
|
34
|
+
"uid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bef1",
|
|
35
|
+
"src": IMAGES.gallery_item2,
|
|
36
|
+
"label": "Thank’s for your application"
|
|
37
|
+
}, {
|
|
38
|
+
"uid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bea2",
|
|
39
|
+
"src": IMAGES.gallery_item3,
|
|
40
|
+
"label": "Nice template"
|
|
41
|
+
}, {
|
|
42
|
+
"uid": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4beg3",
|
|
43
|
+
"src": IMAGES.gallery_item4,
|
|
44
|
+
"label": "Celebrate wine week"
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
items
|
|
50
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a :href="url" :target="target"
|
|
2
|
+
<a :href="url" :target="target"
|
|
3
|
+
class="VcLink"
|
|
4
|
+
:class="{'link-secondary': secondary, 'disabled' : disabled}"
|
|
5
|
+
:data-qa="dataQa"
|
|
6
|
+
@click="$emit('click')">
|
|
3
7
|
<VcIcon v-if="!!prependIcon" class="prepend-icon" small>{{ getIcon }}</VcIcon>
|
|
4
8
|
<label>{{ label }}</label>
|
|
5
9
|
</a>
|
|
@@ -39,6 +43,10 @@ export default {
|
|
|
39
43
|
type: String,
|
|
40
44
|
default: '_blank',
|
|
41
45
|
validator: prop => ['_blank', '_self', '_parent', '_top', '_system'].includes(prop)
|
|
46
|
+
},
|
|
47
|
+
disabled: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false,
|
|
42
50
|
}
|
|
43
51
|
},
|
|
44
52
|
computed: {
|
|
@@ -94,5 +102,9 @@ export default {
|
|
|
94
102
|
}
|
|
95
103
|
}
|
|
96
104
|
}
|
|
105
|
+
|
|
106
|
+
&.disabled {
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
}
|
|
97
109
|
}
|
|
98
110
|
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import '@testing-library/jest-dom'
|
|
2
|
+
import VcMiniBanner from './VcMiniBanner.vue';
|
|
3
|
+
import Vuetify from 'vuetify'
|
|
4
|
+
import { render } from '@testing-library/vue';
|
|
5
|
+
import init from '../../../testing-library.config';
|
|
6
|
+
import { fireEvent, within } from "@testing-library/dom";
|
|
7
|
+
|
|
8
|
+
init();
|
|
9
|
+
|
|
10
|
+
const baseProps = {
|
|
11
|
+
title: 'Mini',
|
|
12
|
+
subtitle: 'Banner',
|
|
13
|
+
dataQa: 'VcMiniBanner',
|
|
14
|
+
ctaLabel: 'now!',
|
|
15
|
+
gradientHue: '#dfd',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe('VcMiniBanner.vue', () => {
|
|
19
|
+
|
|
20
|
+
const renderWithVuetify = (options, callback) => {
|
|
21
|
+
const root = document.createElement('div')
|
|
22
|
+
root.setAttribute('data-app', 'true')
|
|
23
|
+
|
|
24
|
+
return render(
|
|
25
|
+
VcMiniBanner,
|
|
26
|
+
{
|
|
27
|
+
container: document.body.appendChild(root),
|
|
28
|
+
// for Vuetify components that use the vuetify instance property
|
|
29
|
+
vuetify: new Vuetify(),
|
|
30
|
+
...options,
|
|
31
|
+
mocks: {},
|
|
32
|
+
},
|
|
33
|
+
callback,
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
it('mounts', () => {
|
|
38
|
+
const {container} = renderWithVuetify( {
|
|
39
|
+
props: baseProps
|
|
40
|
+
})
|
|
41
|
+
expect(container).toHaveAttribute('data-app', 'true')
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('Emit on full banner area', async () => {
|
|
45
|
+
const {getByTestId, emitted} = renderWithVuetify( {
|
|
46
|
+
props: baseProps
|
|
47
|
+
})
|
|
48
|
+
const banner = getByTestId('VcMiniBanner')
|
|
49
|
+
const VcButton = getByTestId('VcMiniBanner-button')
|
|
50
|
+
await fireEvent.click(VcButton)
|
|
51
|
+
expect(emitted().onAction.length).toBe(1)
|
|
52
|
+
await fireEvent.click(banner)
|
|
53
|
+
expect(emitted().onAction.length).toBe(2)
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('Render title', () => {
|
|
57
|
+
const {getByTestId} = renderWithVuetify( {
|
|
58
|
+
props: baseProps
|
|
59
|
+
})
|
|
60
|
+
const title = getByTestId('VcMiniBanner-title')
|
|
61
|
+
const text = within(title).getByText(baseProps.title)
|
|
62
|
+
expect(text).toBeInTheDocument()
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('Render subtitle', () => {
|
|
66
|
+
const {getByTestId} = renderWithVuetify( {
|
|
67
|
+
props: baseProps
|
|
68
|
+
})
|
|
69
|
+
const title = getByTestId('VcMiniBanner-subtitle')
|
|
70
|
+
const text = within(title).getByText(baseProps.subtitle)
|
|
71
|
+
expect(text).toBeInTheDocument()
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import VcMiniBanner from './VcMiniBanner';
|
|
2
|
+
import VcBaseDocs from "@/stories/VcBaseDocs.mdx";
|
|
3
|
+
|
|
4
|
+
const Template = (args, {argTypes}) => ({
|
|
5
|
+
components: { VcMiniBanner },
|
|
6
|
+
props: Object.keys(argTypes),
|
|
7
|
+
template: `
|
|
8
|
+
<div>
|
|
9
|
+
<div class="description" :style="{margin: '20px 0'}">
|
|
10
|
+
<h4 :style="{margin: '8px 0'}">
|
|
11
|
+
This component functions as a slim banner used for marketing purposes.
|
|
12
|
+
</h4>
|
|
13
|
+
<h4 :style="{fontWeight: 400}">
|
|
14
|
+
Is has a flexible height with a minimum value.
|
|
15
|
+
It's props api offers title, subtitle, cta-label, thumb-image and gradient-hue. <br />
|
|
16
|
+
As it is a banner, the whole surface is clickable and emits an event <br />
|
|
17
|
+
Mobile layout id column based with align-to-start centering and a vertical gradient.
|
|
18
|
+
</h4>
|
|
19
|
+
</div>
|
|
20
|
+
<VcMiniBanner
|
|
21
|
+
:thumbImage="thumbImage"
|
|
22
|
+
:title="title"
|
|
23
|
+
:subtitle="subtitle"
|
|
24
|
+
:ctaLabel="ctaLabel"
|
|
25
|
+
:gradientHue="gradientHue"
|
|
26
|
+
@onAction="onAction" />
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
`,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export const Playground = Template.bind({});
|
|
33
|
+
|
|
34
|
+
Playground.args = {
|
|
35
|
+
thumbImage: require(`@/stories/assets/app-market/fc.svg`),
|
|
36
|
+
title: 'Install Pro Campaigns to create pixel-perfect templates with a few clicks',
|
|
37
|
+
subtitle: 'Get creative freedom for your campaigns with a growing collection of templates for every occasion.',
|
|
38
|
+
ctaLabel: 'Install app',
|
|
39
|
+
gradientHue: '#f1f9fe',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const LongSubtitle = Template.bind({});
|
|
43
|
+
LongSubtitle.args = {
|
|
44
|
+
thumbImage: require(`@/stories/assets/app-market/zapier.svg`),
|
|
45
|
+
title: 'This is what automation feels like',
|
|
46
|
+
subtitle: 'Zapier empowers you to automate your work across 5,000+ apps—so you can move forward, faster. From side hustlers to enterprise leaders, Zapier connects your work apps so you get more focus and less frustration.',
|
|
47
|
+
ctaLabel: 'Read more',
|
|
48
|
+
gradientHue: '#fefef3',
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const WithoutHue = Template.bind({});
|
|
52
|
+
WithoutHue.args = {
|
|
53
|
+
thumbImage: require(`@/stories/assets/app-market/qb.svg`),
|
|
54
|
+
title: 'Save time and automate your reporting process',
|
|
55
|
+
subtitle: 'Connect your day-to-day business activity with your accounting platform to save time and automate your reporting process',
|
|
56
|
+
ctaLabel: 'Connect',
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
title: 'Content display / VcMiniBanner',
|
|
61
|
+
id: 'VcMiniBanner',
|
|
62
|
+
component: VcMiniBanner,
|
|
63
|
+
parameters: {
|
|
64
|
+
design: {
|
|
65
|
+
type: 'figma',
|
|
66
|
+
url: 'https://www.figma.com/file/ZSwWaGaUJcSSxQ8CVs74VA/Upsell-%26-empty-states?node-id=263%3A18966',
|
|
67
|
+
},
|
|
68
|
+
status: {
|
|
69
|
+
type: 'beta', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
|
|
70
|
+
},
|
|
71
|
+
docs: {
|
|
72
|
+
page: VcBaseDocs,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
};
|