@vcita/design-system 0.2.6 → 0.3.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/CHANGELOG.MD +3 -0
- package/README.md +1 -0
- package/dist/@vcita/design-system.esm.js +986 -571
- package/dist/@vcita/design-system.min.js +1 -1
- package/dist/@vcita/design-system.ssr.js +874 -478
- package/package.json +1 -1
- package/src/components/VcBanner/VcBanner.stories.js +14 -2
- package/src/components/VcBanner/VcBanner.vue +5 -2
- package/src/components/index.js +1 -0
- package/src/components/modal/VcConfirmModal/VcConfirmModal.vue +6 -2
- package/src/components/wizard/VcSteperContent/VcStepperContent.vue +2 -1
- package/src/components/wizard/VcWizard/VcWizard.spec.js +7 -0
- package/src/components/wizard/VcWizard/VcWizard.stories.js +3 -0
- package/src/components/wizard/VcWizard/VcWizard.vue +12 -4
- package/src/components/wizard/VcWizard/demoWizardPage.vue +1 -1
package/package.json
CHANGED
|
@@ -3,8 +3,20 @@ import VcBanner from './VcBanner';
|
|
|
3
3
|
const Template = (args, {argTypes}) => ({
|
|
4
4
|
components: {VcBanner: VcBanner},
|
|
5
5
|
props: Object.keys(argTypes),
|
|
6
|
-
template:
|
|
7
|
-
|
|
6
|
+
template: `
|
|
7
|
+
<div>
|
|
8
|
+
<VcBanner
|
|
9
|
+
:title="title"
|
|
10
|
+
:subtitle="subtitle"
|
|
11
|
+
:backgroundColor="backgroundColor"
|
|
12
|
+
:image="image"
|
|
13
|
+
:buttonLabel="buttonLabel"
|
|
14
|
+
@onAction="onAction">
|
|
15
|
+
</VcBanner>
|
|
16
|
+
<br>
|
|
17
|
+
<p><b>Note</b>: You can add subtitle as a prop or as a slot</p>
|
|
18
|
+
</div>
|
|
19
|
+
`,
|
|
8
20
|
})
|
|
9
21
|
|
|
10
22
|
export const Playground = Template.bind({});
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
<img class="d-none d-md-block" v-if="image" :src="image">
|
|
4
4
|
<div class="text-container px-md-8 flex-grow-1">
|
|
5
5
|
<div class="banner-title pb-2 pb-md-0">{{title}}</div>
|
|
6
|
-
<div class="banner-subtitle pb-4 pb-md-0" v-if="subtitle">
|
|
6
|
+
<div class="banner-subtitle pb-4 pb-md-0" v-if="subtitle || $slots.subtitle">
|
|
7
|
+
<slot name="subtitle">
|
|
8
|
+
{{subtitle}}
|
|
9
|
+
</slot>
|
|
10
|
+
</div>
|
|
7
11
|
</div>
|
|
8
12
|
<VcButton :large="$vuetify.breakpoint.smAndUp" v-if="buttonLabel" @click="$emit('onAction')">{{buttonLabel}}</VcButton>
|
|
9
13
|
</div>
|
|
@@ -45,7 +49,6 @@ export default {
|
|
|
45
49
|
@import "../../scss/mixins.scss";
|
|
46
50
|
|
|
47
51
|
.VcBanner{
|
|
48
|
-
//font-family: var(--primary-font-family);
|
|
49
52
|
min-height: 128px;
|
|
50
53
|
box-sizing: border-box;
|
|
51
54
|
box-shadow: var(--shadow-10);
|
package/src/components/index.js
CHANGED
|
@@ -36,3 +36,4 @@ export {default as VcEmptyState} from './VcEmptyState/VcEmptyState.vue';
|
|
|
36
36
|
export {default as VcSvg} from './VcSvg/VcSvg.vue';
|
|
37
37
|
export {default as VcBanner} from './VcBanner/VcBanner.vue'
|
|
38
38
|
export {default as VcWizardCtaContainer} from './wizard/VcWizardCtaContainer/VcWizardCtaContainer.vue';
|
|
39
|
+
export {default as VcWizard} from './wizard/VcWizard/VcWizard.vue';
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
<VcModalFooter
|
|
17
17
|
direction="horizontal"
|
|
18
18
|
:buttons='[
|
|
19
|
-
{label: cancelButtonLabel || $dst("ds.modal.cancel"),event:"onCancelClicked",color:"white"},
|
|
20
|
-
{label: okButtonLabel || $dst("ds.modal.ok"),event:"onOkClicked",color:"secondary"}
|
|
19
|
+
{label: cancelButtonLabel || $dst("ds.modal.cancel"), event:"onCancelClicked", color:"white", loading},
|
|
20
|
+
{label: okButtonLabel || $dst("ds.modal.ok"), event:"onOkClicked", color:"secondary", loading}
|
|
21
21
|
]'
|
|
22
22
|
@onOkClicked="$emit('onOkClicked')"
|
|
23
23
|
@onCancelClicked="$emit('onCancelClicked')"
|
|
@@ -83,6 +83,10 @@ export default {
|
|
|
83
83
|
type: String,
|
|
84
84
|
required: false
|
|
85
85
|
},
|
|
86
|
+
loading: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: false
|
|
89
|
+
}
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
</script>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
<script>
|
|
32
32
|
import VcLoader from "@/components/VcLoader/VcLoader.vue";
|
|
33
|
-
import VcLayout from "@/components/VcLayout/VcLayout";
|
|
33
|
+
import VcLayout from "@/components/VcLayout/VcLayout.vue";
|
|
34
34
|
|
|
35
35
|
export default {
|
|
36
36
|
name: "VcStepperContent",
|
|
@@ -128,6 +128,7 @@ export default {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
.stepper-header {
|
|
131
|
+
flex: var(--size-value0);
|
|
131
132
|
margin-block-end: var(--size-value7);
|
|
132
133
|
@include md-and-up {
|
|
133
134
|
padding-block-start: var(--size-value3);
|
|
@@ -120,6 +120,11 @@ describe("VcWizard.vue", () => {
|
|
|
120
120
|
props: {
|
|
121
121
|
steps: defaultSteps,
|
|
122
122
|
dataQa: 'vcWizard',
|
|
123
|
+
initialWizardData: {
|
|
124
|
+
textFieldValue: 'initial value'
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
|
|
123
128
|
}
|
|
124
129
|
})
|
|
125
130
|
const stepperElement = getByTestId("vc-steps-bar")
|
|
@@ -132,6 +137,8 @@ describe("VcWizard.vue", () => {
|
|
|
132
137
|
expect(nextButton).toHaveClass('v-btn--disabled')
|
|
133
138
|
|
|
134
139
|
const textInput = await findByTestId('text-input')
|
|
140
|
+
expect(textInput.value).toBe('initial value')
|
|
141
|
+
await userEvent.clear(textInput)
|
|
135
142
|
await userEvent.type(textInput, "1");
|
|
136
143
|
await userEvent.type(textInput, "2");
|
|
137
144
|
await userEvent.type(textInput, "3");
|
|
@@ -41,6 +41,10 @@ export default {
|
|
|
41
41
|
name: "VcWizard",
|
|
42
42
|
components: {VcStepsBar, VcStepperContent, VcMobileWizardProgress, VcWizardCtaContainer},
|
|
43
43
|
props: {
|
|
44
|
+
initialWizardData: {
|
|
45
|
+
type: Object,
|
|
46
|
+
default: () => ({}),
|
|
47
|
+
},
|
|
44
48
|
steps: {
|
|
45
49
|
type: [Array],
|
|
46
50
|
validator: steps => steps.every(step => step.name),
|
|
@@ -87,13 +91,16 @@ export default {
|
|
|
87
91
|
if(this.currentStep < this.wizardSteps.length) {
|
|
88
92
|
this.currentStep++;
|
|
89
93
|
} else {
|
|
90
|
-
this.$emit('submit', this.
|
|
94
|
+
this.$emit('submit', this.wizardData)
|
|
91
95
|
}
|
|
92
96
|
},
|
|
93
97
|
},
|
|
94
98
|
computed: {
|
|
95
99
|
wizardData() {
|
|
96
|
-
return Object.values(this.wizardStepsData).reduce((acc, currentValue) =>
|
|
100
|
+
return Object.values(this.wizardStepsData).reduce((acc, currentValue) => {
|
|
101
|
+
Object.assign(acc,currentValue)
|
|
102
|
+
return acc
|
|
103
|
+
}, {...this.initialWizardData})
|
|
97
104
|
},
|
|
98
105
|
currentStepObj() {
|
|
99
106
|
return this.wizardSteps[this.currentStep - 1]
|
|
@@ -120,8 +127,8 @@ export default {
|
|
|
120
127
|
height: 100%;
|
|
121
128
|
@include md-and-up {
|
|
122
129
|
display: grid;
|
|
123
|
-
grid-template-columns: minmax(
|
|
124
|
-
grid-template-rows:
|
|
130
|
+
grid-template-columns: minmax(250px,1fr) 3fr;
|
|
131
|
+
grid-template-rows: 562px 80px;
|
|
125
132
|
grid-column-gap: var(--size-value10);
|
|
126
133
|
grid-row-gap: 0px;
|
|
127
134
|
}
|
|
@@ -133,6 +140,7 @@ export default {
|
|
|
133
140
|
.vc-stepper-container {
|
|
134
141
|
grid-area: 1 / 1 / 3 / 2;
|
|
135
142
|
border-inline-end: 1px solid #E0E0E0;
|
|
143
|
+
max-height: calc( 100% - 24px );
|
|
136
144
|
}
|
|
137
145
|
.wizard-cta-container {
|
|
138
146
|
grid-area: 2 / 2 / 3 / 3;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<v-btn @click="$emit('submit', {stepData: {backButtonLabel: 'new text'}} )" data-qa="test-button" class="demo-page-button">
|
|
4
4
|
demo button text
|
|
5
5
|
</v-btn>
|
|
6
|
-
<VcTextArea data-qa="text-input" class="text-input" placeholder="enter 123 to proceed" @input="(data) => $emit('submit', {wizardData: {textFieldValue: data}} )" >
|
|
6
|
+
<VcTextArea :value="textFieldValue" data-qa="text-input" class="text-input" placeholder="enter 123 to proceed" @input="(data) => $emit('submit', {wizardData: {textFieldValue: data}} )" >
|
|
7
7
|
|
|
8
8
|
</VcTextArea>
|
|
9
9
|
<v-layout>
|