@vcita/design-system 1.2.0 → 1.2.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/@vcita/design-system.esm.js +1089 -918
  3. package/dist/@vcita/design-system.min.js +2 -2
  4. package/dist/@vcita/design-system.ssr.js +954 -815
  5. package/init/SvgIcons.js +1 -1
  6. package/package.json +1 -1
  7. package/src/components/.DS_Store +0 -0
  8. package/src/components/VcButton/VcButton.stories.js +23 -23
  9. package/src/components/VcChip/VcChip.stories.js +3 -2
  10. package/src/components/VcChipList/VcChipList.stories.js +34 -21
  11. package/src/components/VcDocItem/VcDocItem.spec.js +10 -0
  12. package/src/components/VcDocItem/VcDocItem.stories.js +3 -0
  13. package/src/components/VcDocItem/VcDocItem.vue +17 -5
  14. package/src/components/VcDocItem/mockData.js +3 -3
  15. package/src/components/VcIcon/VcIcon.stories.js +30 -7
  16. package/src/components/VcIcon/VcIcon.vue +11 -2
  17. package/src/components/VcMenu/.DS_Store +0 -0
  18. package/src/components/VcSideNav/VcSideNav.spec.js +105 -0
  19. package/src/components/VcSideNav/VcSideNav.stories.js +117 -0
  20. package/src/components/VcSideNav/VcSideNav.vue +136 -0
  21. package/src/components/VcTextField/VcTextField.stories.js +60 -101
  22. package/src/components/VcTextField/VcTextField.vue +4 -0
  23. package/src/components/index.js +1 -0
  24. package/src/components/list/VcList/pattern/VcMobilePickerPattern.stories.js +22 -8
  25. package/src/components/list/VcListEntity/VcListEntity.stories.js +14 -19
  26. package/src/components/modal/VcConfirmModal/VcConfirmModal.stories.js +73 -46
  27. package/src/components/modal/VcConfirmModal/VcConfirmModal.vue +12 -2
  28. package/src/components/modal/VcConfirmProminentModal/VcConfirmProminentModal.stories.js +6 -10
  29. package/src/components/modal/VcConfirmProminentModal/VcConfirmProminentModal.vue +5 -0
  30. package/src/components/modal/VcInputModal/VcInputModal.stories.js +47 -56
  31. package/src/components/modal/VcInputModal/VcInputModal.vue +2 -1
  32. package/src/components/modal/VcNoticeModal/VcNoticeModal.stories.js +36 -45
  33. package/src/components/modal/VcNoticeModal/VcNoticeModal.vue +5 -0
  34. package/src/components/modal/elements/VcModalContainer.stories.js +35 -12
  35. package/src/components/modal/elements/VcModalContainer.vue +8 -1
  36. package/src/components/modal/elements/VcModalFooter.stories.js +10 -6
  37. package/src/components/modal/elements/VcModalWrapper.stories.js +13 -6
@@ -1,6 +1,23 @@
1
1
  import VcConfirmModalCmp from './VcConfirmModal';
2
2
  import VcModalFooter from "@/components/modal/elements/VcModalFooter";
3
3
  import VcBaseDocs from "@/stories/VcBaseDocs.mdx";
4
+ import icons from "../../../../init/SvgIcons";
5
+
6
+ const baseProps = {
7
+ showDialog: true,
8
+ useOffset: true,
9
+ topTitle: '',
10
+ title: 'Some header text',
11
+ subtitle: '',
12
+ contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
13
+ size: 'lg',
14
+ okButtonLabel: '',
15
+ cancelButtonLabel: '',
16
+ headerImage: '',
17
+ headerIcon: '',
18
+ loading: false,
19
+ dataQa: 'VcConfirmModal',
20
+ };
4
21
 
5
22
  const Template = (args, {argTypes}) => ({
6
23
  components: {VcConfirmModal: VcConfirmModalCmp},
@@ -9,13 +26,18 @@ const Template = (args, {argTypes}) => ({
9
26
  <div>
10
27
  <VcConfirmModal
11
28
  :show-dialog="showDialog"
12
- :useOffset="useOffset" :topTitle="topTitle"
13
- :title="title" :subtitle="subtitle"
29
+ :useOffset="useOffset"
30
+ :topTitle="topTitle"
31
+ :title="title"
32
+ :subtitle="subtitle"
14
33
  :header-icon="headerIcon"
34
+ :header-image="headerImage"
15
35
  :content-text="contentText"
16
36
  :size="size"
17
37
  :ok-button-label="okButtonLabel"
18
38
  :cancel-button-label="cancelButtonLabel"
39
+ :loading="loading"
40
+ :data-qa="dataQa"
19
41
  @onCloseButtonClicked="onCloseButtonClicked"
20
42
  @onOkClicked="onOkClicked"
21
43
  @onCancelClicked="onCancelClicked"/>
@@ -26,28 +48,15 @@ export const Playground = Template.bind({});
26
48
 
27
49
  // Set default values
28
50
  Playground.args = {
29
- showDialog: true,
30
- useOffset: true,
31
- topTitle: '',
32
- title: 'Some header text',
33
- subtitle: '',
34
- contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
35
- size: 'lg',
36
- okButtonLabel: undefined,
37
- cancelButtonLabel: undefined,
51
+ ...baseProps,
38
52
  }
39
53
 
40
- export const Danger = Template.bind({});
54
+ export const WithHeaderIcon = Template.bind({});
41
55
 
42
56
  // Set default values
43
- Danger.args = {
44
- showDialog: true,
45
- title: 'Some header text',
46
- headerIcon: 'mdi-delete',
47
- contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
48
- size: 'lg',
49
- buttons: [{label: "Cancel", event: "onCancelClicked", color: "white"},
50
- {label: "Archive", event: "onOkClicked", color: "primary"},]
57
+ WithHeaderIcon.args = {
58
+ ...baseProps,
59
+ headerIcon: '$trash',
51
60
  }
52
61
 
53
62
  const UsingFooterSlotTemplate = (args, {argTypes}) => ({
@@ -55,9 +64,19 @@ const UsingFooterSlotTemplate = (args, {argTypes}) => ({
55
64
  props: Object.keys(argTypes),
56
65
  template: `
57
66
  <div>
58
- <VcConfirmModal :show-dialog="showDialog" :title="title"
59
- :header-icon="headerIcon" :content-text="contentText"
60
- :size="size">
67
+ <VcConfirmModal :show-dialog="showDialog"
68
+ :useOffset="useOffset"
69
+ :topTitle="topTitle"
70
+ :title="title"
71
+ :subtitle="subtitle"
72
+ :header-icon="headerIcon"
73
+ :header-image="headerImage"
74
+ :content-text="contentText"
75
+ :size="size"
76
+ :ok-button-label="okButtonLabel"
77
+ :cancel-button-label="cancelButtonLabel"
78
+ :loading="loading"
79
+ :data-qa="dataQa">
61
80
  <template #footer>
62
81
  <VcModalFooter
63
82
  :buttons='[
@@ -78,13 +97,8 @@ export const UsingFooterSlot = UsingFooterSlotTemplate.bind({});
78
97
 
79
98
  // Set default values
80
99
  UsingFooterSlot.args = {
81
- showDialog: true,
82
- title: 'Some header text',
100
+ ...baseProps,
83
101
  headerIcon: 'mdi-delete',
84
- contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
85
- size: 'lg',
86
- buttons: [{label: "Cancel", event: "onCancelClicked", color: "white"},
87
- {label: "Archive", event: "onOkClicked", color: "primary"},]
88
102
  }
89
103
 
90
104
  const TemplateWithImage = (args, {argTypes}) => ({
@@ -95,30 +109,32 @@ const TemplateWithImage = (args, {argTypes}) => ({
95
109
  return require('@/stories/assets/HeaderImage.svg');
96
110
  },
97
111
  },
98
- template: '<div><VcConfirmModal :show-dialog="showDialog" ' +
99
- ':topTitle="topTitle" ' +
100
- ':title="title" ' +
101
- ':subtitle="subtitle" ' +
102
- ':header-image="imageParam" ' +
103
- ':content-text="contentText" ' +
104
- ':size="size" ' +
105
- ':buttons="buttons" ' +
106
- '@onCloseButtonClicked="onCloseButtonClicked" ' +
107
- '@onOkClicked="onOkClicked" ' +
108
- '@onCancelClicked="onCancelClicked"/></div>',
112
+ template: `
113
+ <div>
114
+ <VcConfirmModal :show-dialog="showDialog"
115
+ :useOffset="useOffset"
116
+ :topTitle="topTitle"
117
+ :title="title"
118
+ :subtitle="subtitle"
119
+ :header-icon="headerIcon"
120
+ :header-image="headerImage"
121
+ :content-text="contentText"
122
+ :size="size"
123
+ :ok-button-label="okButtonLabel"
124
+ :cancel-button-label="cancelButtonLabel"
125
+ :loading="loading"
126
+ @onCloseButtonClicked="onCloseButtonClicked"
127
+ @onOkClicked="onOkClicked"
128
+ @onCancelClicked="onCancelClicked"/>
129
+ </div>`,
109
130
  })
110
131
 
111
132
  export const WithHeaderImage = TemplateWithImage.bind({});
112
133
 
113
134
  // Set default values
114
135
  WithHeaderImage.args = {
115
- showDialog: true,
136
+ ...baseProps,
116
137
  topTitle: 'Top title',
117
- title: 'Some header text',
118
- contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
119
- size: 'lg',
120
- buttons: [{label: "Cancel", event: "onCancelClicked", color: "white"},
121
- {label: "Archive", event: "onOkClicked", color: "primary"},]
122
138
  }
123
139
 
124
140
  export default {
@@ -130,6 +146,17 @@ export default {
130
146
  options: ['sm', 'md', 'lg'],
131
147
  control: {type: 'radio'}
132
148
  },
149
+ headerIcon: {
150
+ options: Object.keys(icons).map(item => `$${item}`),
151
+ control: {type: 'select'},
152
+ table: {category: 'header'},
153
+ },
154
+ headerImage: {table: {category: 'header'}},
155
+ topTitle: {table: {category: 'header'}},
156
+ title: {table: {category: 'header'}},
157
+ subtitle: {table: {category: 'header'}},
158
+ okButtonLabel: {table: {category: 'footer'}},
159
+ cancelButtonLabel: {table: {category: 'footer'}},
133
160
  onContactClicked: {action: 'onContactClicked', table: {disable: true}},
134
161
  onClearClicked: {action: 'onClearClicked', table: {disable: true}},
135
162
  onSaveClicked: {action: 'onSaveClicked', table: {disable: true}},
@@ -2,6 +2,7 @@
2
2
  <VcModalContainer showCloseButton
3
3
  :useOffset="useOffset"
4
4
  :showDialog="showDialog" :size="$vuetify.breakpoint.mdAndUp ? size : 'responsive'"
5
+ :data-qa="dataQa"
5
6
  @onCloseButtonClicked="$emit('onCloseButtonClicked')">
6
7
  <template #header>
7
8
  <slot name="header">
@@ -10,7 +11,9 @@
10
11
  @onCloseButtonClicked="$emit('onCloseButtonClicked')"/>
11
12
  </slot>
12
13
  </template>
13
- <template #content> <slot name="content"> {{ contentText }} </slot></template>
14
+ <template #content>
15
+ <slot name="content"> {{ contentText }}</slot>
16
+ </template>
14
17
  <template #footer>
15
18
  <slot name="footer">
16
19
  <VcModalFooter
@@ -65,6 +68,9 @@ export default {
65
68
  type: String,
66
69
  required: false
67
70
  },
71
+ /**
72
+ * In case the component is being displayed in an iframe, and so can become un centered, this allows to correct the position, when combined with the --modal-desktop-offset css variable.
73
+ */
68
74
  useOffset: {
69
75
  type: Boolean,
70
76
  default: true
@@ -85,7 +91,11 @@ export default {
85
91
  loading: {
86
92
  type: Boolean,
87
93
  default: false
88
- }
94
+ },
95
+ dataQa: {
96
+ type: String,
97
+ default: 'VcConfirmModal',
98
+ },
89
99
  }
90
100
  }
91
101
  </script>
@@ -4,18 +4,12 @@ import VcBaseDocs from "@/stories/VcBaseDocs.mdx";
4
4
  const Template = (args, {argTypes}) => ({
5
5
  components: {VcConfirmProminentModal: VcConfirmProminentModalCmp},
6
6
  props: Object.keys(argTypes),
7
- computed: {
8
- iconParam() {
9
- return require('@/stories/assets/rabbit.svg');
10
- },
11
- },
12
7
  template: `
13
8
  <div>
14
9
  <VcConfirmProminentModal :show-dialog="showDialog"
15
10
  :useOffset="useOffset"
16
11
  :title-text="titleText"
17
- :subtitle-text="subtitleText"
18
- :icon="iconParam"
12
+ :icon="image"
19
13
  :content-text="contentText"
20
14
  :size="size"
21
15
  :ok-button-label="okButtonLabel"
@@ -33,11 +27,11 @@ Playground.args = {
33
27
  showDialog: true,
34
28
  useOffset: false,
35
29
  titleText: 'Notice header text',
36
- subtitleText: 'some more information about this issue, and some more information about this issue',
37
30
  contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
38
31
  size: 'md',
39
- okButtonLabel: undefined,
40
- cancelButtonLabel: undefined,
32
+ okButtonLabel: '',
33
+ cancelButtonLabel: '',
34
+ image: require('@/stories/assets/rabbit.svg'),
41
35
  }
42
36
 
43
37
  export default {
@@ -49,6 +43,8 @@ export default {
49
43
  options: ['sm', 'md'],
50
44
  control: {type: 'radio'}
51
45
  },
46
+ okButtonLabel: {table: {category: 'footer'}},
47
+ cancelButtonLabel: {table: {category: 'footer'}},
52
48
  },
53
49
  parameters: {
54
50
  design: {
@@ -6,6 +6,7 @@
6
6
  :size="size"
7
7
  flavor="prominent"
8
8
  :useOffset="useOffset"
9
+ :data-qa="dataQa"
9
10
  @onCloseButtonClicked="$emit('onCloseButtonClicked')"
10
11
  @onOkClicked="$emit('onOkClicked')"
11
12
  @onCancelClicked="$emit('onCancelClicked')">
@@ -63,6 +64,10 @@ export default {
63
64
  type: String,
64
65
  required: false
65
66
  },
67
+ dataQa: {
68
+ type: String,
69
+ default: 'VcProminentModal',
70
+ },
66
71
  },
67
72
  }
68
73
  </script>
@@ -3,6 +3,24 @@ import VcTextField from "@/components/VcTextField/VcTextField";
3
3
  import VcModalFooter from "@/components/modal/elements/VcModalFooter";
4
4
  import VcBaseDocs from "@/stories/VcBaseDocs.mdx";
5
5
 
6
+ const baseProps = {
7
+ showDialog: true,
8
+ useOffset: false,
9
+ topTitle: '',
10
+ title: 'Input form',
11
+ subtitle: '',
12
+ size: 'lg',
13
+ okButtonLabel: undefined,
14
+ cancelButtonLabel: undefined,
15
+ showBackButton: true,
16
+ closeButton: false,
17
+ showFooter: true,
18
+ dataQa: 'VcInputModal',
19
+ closeOnEsc: true,
20
+ okButtonLabel: '',
21
+ cancelButtonLabel: '',
22
+ }
23
+
6
24
  const Template = (args, {argTypes}) => ({
7
25
  components: {VcInputModal: VcInputModalCmp, VcTextField},
8
26
  props: Object.keys(argTypes),
@@ -43,19 +61,7 @@ export const Playground = Template.bind({});
43
61
 
44
62
  // Set default values
45
63
  Playground.args = {
46
- showDialog: true,
47
- useOffset: false,
48
- topTitle: '',
49
- title: 'Input form',
50
- subtitle: '',
51
- size: 'lg',
52
- okButtonLabel: undefined,
53
- cancelButtonLabel: undefined,
54
- showBackButton: true,
55
- closeButton: false,
56
- showFooter: true,
57
- dataQa: 'VcInputModal',
58
- closeOnEsc: true
64
+ ...baseProps,
59
65
  }
60
66
 
61
67
  const TemplateWithAdditional = (args, {argTypes}) => ({
@@ -67,34 +73,28 @@ const TemplateWithAdditional = (args, {argTypes}) => ({
67
73
  v => (v && v.length <= 10) || 'Name must be less than 10 characters',
68
74
  ],
69
75
  }),
70
- template: '<div><VcInputModal :show-dialog="showDialog" ' +
71
- ':useOffset="useOffset" ' +
72
- ':topTitle="topTitle" ' +
73
- ':title="title" ' +
74
- ':subtitle="subtitle" ' +
75
- ':header-icon="headerIcon" ' +
76
- ':size="size" ' +
77
- '@onCloseButtonClicked="onCloseButtonClicked" ' +
78
- '@onOkClicked="onOkClicked" ' +
79
- '@onCancelClicked="onCancelClicked"' +
80
- '@onValidationChanged="onValidationChanged">' +
81
- '<template #content> ' +
82
- ' <VcTextField label="text field label" :rules="nameRules"></VcTextField>' +
83
- '</template>' +
84
- '<template #additional> ' +
85
- ' <VcTextField label="text field label" :rules="nameRules"></VcTextField>' +
86
- '</template>' +
87
- '</VcInputModal></div>',
76
+ template: `
77
+ <div>
78
+ <VcInputModal :show-dialog="showDialog" :useOffset="useOffset" :topTitle="topTitle" :title="title"
79
+ :subtitle="subtitle" :header-icon="headerIcon" :size="size"
80
+ @onCloseButtonClicked="onCloseButtonClicked" @onOkClicked="onOkClicked"
81
+ @onCancelClicked="onCancelClicked" @onValidationChanged="onValidationChanged">
82
+ <template #content>
83
+ <VcTextField label="text field label" :rules="nameRules"></VcTextField>
84
+ </template>
85
+ <template #additional>
86
+ <VcTextField label="text field label" :rules="nameRules"></VcTextField>
87
+ </template>
88
+ </VcInputModal>
89
+ </div>`,
88
90
  })
89
91
 
90
92
  export const WithAdditionalPanel = TemplateWithAdditional.bind({});
91
93
 
92
94
  // Set default values
93
95
  WithAdditionalPanel.args = {
94
- showDialog: true,
95
- useOffset: false,
96
+ ...baseProps,
96
97
  title: 'With additional pane (when large)',
97
- size: 'lg'
98
98
  }
99
99
 
100
100
  const TemplateWithFooter = (args, {argTypes}) => ({
@@ -138,10 +138,8 @@ export const UsingFooterSlot = TemplateWithFooter.bind({});
138
138
 
139
139
  // Set default values
140
140
  UsingFooterSlot.args = {
141
- showDialog: true,
142
- useOffset: false,
141
+ ...baseProps,
143
142
  title: 'With additional pane (when large)',
144
- size: 'lg',
145
143
  }
146
144
 
147
145
  const TemplateWithImage = (args, {argTypes}) => ({
@@ -158,32 +156,25 @@ const TemplateWithImage = (args, {argTypes}) => ({
158
156
  v => (v && v.length <= 10) || 'Name must be less than 10 characters',
159
157
  ],
160
158
  }),
161
- template: '<div><VcInputModal :show-dialog="showDialog" ' +
162
- ':useOffset="useOffset" ' +
163
- ':topTitle="topTitle" ' +
164
- ':title="title" ' +
165
- ':subtitle="subtitle" ' +
166
- ':size="size" ' +
167
- ':headerImage="imageParam" ' +
168
- '@onCloseButtonClicked="onCloseButtonClicked" ' +
169
- '@onOkClicked="onOkClicked" ' +
170
- '@onCancelClicked="onCancelClicked"' +
171
- '@onValidationChanged="onValidationChanged">' +
172
- '<template #content> ' +
173
- ' <VcTextField label="text field label" :rules="nameRules"></VcTextField>' +
174
- '</template>' +
175
- '</VcInputModal></div>',
159
+ template: `
160
+ <div>
161
+ <VcInputModal :show-dialog="showDialog" :useOffset="useOffset" :topTitle="topTitle" :title="title"
162
+ :subtitle="subtitle" :size="size" :headerImage="imageParam"
163
+ @onCloseButtonClicked="onCloseButtonClicked" @onOkClicked="onOkClicked"
164
+ @onCancelClicked="onCancelClicked" @onValidationChanged="onValidationChanged">
165
+ <template #content>
166
+ <VcTextField label="text field label" :rules="nameRules"></VcTextField>
167
+ </template>
168
+ </VcInputModal>
169
+ </div>`,
176
170
  })
177
171
 
178
172
  export const WithHeaderImage = TemplateWithImage.bind({});
179
173
 
180
174
  // Set default values
181
175
  WithHeaderImage.args = {
182
- showDialog: true,
183
- useOffset: false,
184
- topTitle: 'Top title',
176
+ ...baseProps,
185
177
  title: 'Input form',
186
- size: 'lg'
187
178
  }
188
179
 
189
180
  export default {
@@ -3,6 +3,7 @@
3
3
  :useOffset="useOffset" :showDialog="showDialog"
4
4
  :size="$vuetify.breakpoint.mdAndUp ? size : 'responsive'"
5
5
  :closeOnEsc="closeOnEsc"
6
+ :data-qa="dataQa"
6
7
  @onCloseButtonClicked="$emit('onCloseButtonClicked')">
7
8
  <template #header>
8
9
  <slot name="header">
@@ -113,7 +114,7 @@ export default {
113
114
  closeOnEsc: {
114
115
  type: Boolean,
115
116
  default: true
116
- }
117
+ },
117
118
  },
118
119
  data: () => ({
119
120
  mainValid: true,
@@ -4,6 +4,19 @@ import VcLayout from "@/components/VcLayout/VcLayout";
4
4
  import VcModalFooter from "@/components/modal/elements/VcModalFooter";
5
5
  import VcBaseDocs from "@/stories/VcBaseDocs.mdx";
6
6
 
7
+ const baseProps = {
8
+ showDialog: true,
9
+ useOffset: false,
10
+ titleText: 'Notice header text',
11
+ subtitleText: 'some more information about this issue, and some more information about this issue',
12
+ contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
13
+ size: 'lg',
14
+ image: require('@/stories/assets/rabbit.svg'),
15
+ okButtonLabel: '',
16
+ cancelButtonLabel: '',
17
+ dataQa: 'VcNoticeModal',
18
+ }
19
+
7
20
  const Template = (args, {argTypes}) => ({
8
21
  components: {VcNoticeModal: VcNoticeModalCmp},
9
22
  props: Object.keys(argTypes),
@@ -18,6 +31,7 @@ const Template = (args, {argTypes}) => ({
18
31
  :size="size"
19
32
  :ok-button-label="okButtonLabel"
20
33
  :cancel-button-label="cancelButtonLabel"
34
+ :data-qa="dataQa"
21
35
  @onCloseButtonClicked="onCloseButtonClicked"
22
36
  @onOkClicked="onOkClicked"
23
37
  @onCancelClicked="onCancelClicked"/>
@@ -28,48 +42,33 @@ export const Playground = Template.bind({});
28
42
 
29
43
  // Set default values
30
44
  Playground.args = {
31
- showDialog: true,
32
- useOffset: false,
33
- titleText: 'Notice header text',
34
- subtitleText: 'some more information about this issue, and some more information about this issue',
35
- contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
36
- size: 'lg',
37
- okButtonLabel: undefined,
38
- cancelButtonLabel: undefined,
39
- image: require('@/stories/assets/rabbit.svg'),
45
+ ...baseProps,
40
46
  }
41
47
 
42
48
  const TemplateUsingSlot = (args, {argTypes}) => ({
43
49
  components: {VcNoticeModal: VcNoticeModalCmp, VcLayout, VcIcon},
44
50
  props: Object.keys(argTypes),
45
- template: '<div><VcNoticeModal :show-dialog="showDialog" ' +
46
- ':useOffset="useOffset" ' +
47
- ':title-text="titleText" ' +
48
- ':subtitle-text="subtitleText" ' +
49
- ':image="image" ' +
50
- ':size="size" ' +
51
- '@onCloseButtonClicked="onCloseButtonClicked" ' +
52
- '@onOkClicked="onOkClicked" ' +
53
- '@onCancelClicked="onCancelClicked">' +
54
- '<template #content>' +
55
- '<VcLayout justify-center>' +
56
- '<VcIcon small>mdi-check-bold</VcIcon> Receive a dedicated SMS number for back-and-forth texting with your clients.' +
57
- '</VcLayout>' +
58
- '</template>' +
59
- '</VcNoticeModal></div>',
51
+ template: `
52
+ <div>
53
+ <VcNoticeModal :show-dialog="showDialog" :useOffset="useOffset" :title-text="titleText"
54
+ :subtitle-text="subtitleText" :image="image" :size="size"
55
+ @onCloseButtonClicked="onCloseButtonClicked" @onOkClicked="onOkClicked"
56
+ @onCancelClicked="onCancelClicked">
57
+ <template #content>
58
+ <VcLayout justify-center>
59
+ <VcIcon small>mdi-check-bold</VcIcon>
60
+ Receive a dedicated SMS number for back-and-forth texting with your clients.
61
+ </VcLayout>
62
+ </template>
63
+ </VcNoticeModal>
64
+ </div>`,
60
65
  })
61
66
 
62
67
  export const UsingContentSlot = TemplateUsingSlot.bind({});
63
68
 
64
69
  // Set default values
65
70
  UsingContentSlot.args = {
66
- showDialog: true,
67
- useOffset: false,
68
- titleText: 'Notice header text',
69
- subtitleText: 'some more information about this issue, and some more information about this issue',
70
- contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
71
- size: 'lg',
72
- image: require('@/stories/assets/rabbit.svg')
71
+ ...baseProps,
73
72
  }
74
73
 
75
74
  const TemplateUsingFooterSlot = (args, {argTypes}) => ({
@@ -100,26 +99,14 @@ export const UsingFooterSlot = TemplateUsingFooterSlot.bind({});
100
99
 
101
100
  // Set default values
102
101
  UsingFooterSlot.args = {
103
- showDialog: true,
104
- useOffset: false,
105
- titleText: 'Notice header text',
106
- subtitleText: 'some more information about this issue, and some more information about this issue',
107
- contentText: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
108
- size: 'lg',
109
- image: require('@/stories/assets/rabbit.svg'),
102
+ ...baseProps,
110
103
  }
111
104
 
112
105
  export const WithImageAsComponents = Template.bind({});
113
106
 
114
107
  // Set default values
115
108
  WithImageAsComponents.args = {
116
- showDialog: true,
117
- useOffset: false,
118
- titleText: 'Notice with image slot',
119
- subtitleText: 'It looks the same, what\'s the deal?',
120
- contentText: 'In some projects you will have infrastructure that makes it impossible to pass an SVG in the usual way, because SVGs are treated as components. So the right way to pass them is using a slot.',
121
- size: 'lg',
122
- image: require('@/stories/assets/rabbit.svg'),
109
+ ...baseProps,
123
110
  }
124
111
 
125
112
  export default {
@@ -132,6 +119,10 @@ export default {
132
119
  options: ['md', 'lg'],
133
120
  control: {type: 'radio'}
134
121
  },
122
+ titleText: {table: {category: 'header'}},
123
+ subtitleText: {table: {category: 'header'}},
124
+ okButtonLabel: {table: {category: 'footer'}},
125
+ cancelButtonLabel: {table: {category: 'footer'}},
135
126
  onContactClicked: {action: 'onContactClicked', table: {disable: true}},
136
127
  onClearClicked: {action: 'onClearClicked', table: {disable: true}},
137
128
  onSaveClicked: {action: 'onSaveClicked', table: {disable: true}},
@@ -2,6 +2,7 @@
2
2
  <VcModalContainer :showFooterDivider="flavor === 'prominent'" :flavor="flavor"
3
3
  :useOffset="useOffset" :showDialog="showDialog"
4
4
  :size="$vuetify.breakpoint.mdAndUp ? size : 'responsive'"
5
+ :data-qa="dataQa"
5
6
  showCloseButton
6
7
  @onCloseButtonClicked="$emit('onCloseButtonClicked')">
7
8
  <template #content>
@@ -87,6 +88,10 @@ export default {
87
88
  type: String,
88
89
  required: false
89
90
  },
91
+ dataQa: {
92
+ type: String,
93
+ default: 'VcNoticeModal'
94
+ }
90
95
  },
91
96
  computed: {
92
97
  currentImage() {