@vcita/design-system 0.0.12-prod.beta.27 → 0.1.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 (102) hide show
  1. package/README.md +30 -21
  2. package/dist/@vcita/design-system.esm.js +519 -676
  3. package/dist/@vcita/design-system.min.js +1 -1
  4. package/dist/@vcita/design-system.ssr.js +449 -608
  5. package/init/DesignSystem.js +77 -0
  6. package/init/VcSvg/VcSvg.stories.js +25 -0
  7. package/{src/components → init}/VcSvg/VcSvg.vue +0 -0
  8. package/init/vuetify.config.js +132 -0
  9. package/package.json +6 -5
  10. package/src/assets/logo.png +0 -0
  11. package/src/assets/logo.svg +1 -0
  12. package/src/components/VcActionList/VcActionList.spec.js +57 -0
  13. package/src/components/VcActionList/VcActionList.stories.js +56 -0
  14. package/src/components/VcActionList/VcActionList.vue +1 -1
  15. package/src/components/VcActions/VcActions.spec.js +153 -0
  16. package/src/components/VcActions/VcActions.stories.js +103 -0
  17. package/src/components/VcActions/VcActions.vue +14 -6
  18. package/src/components/VcAlert/VcAlert.spec.js +162 -0
  19. package/src/components/VcAlert/VcAlert.stories.js +105 -0
  20. package/src/components/VcAlert/VcAlert.vue +7 -8
  21. package/src/components/VcAutoComplete/VcAutoComplete.spec.js +67 -0
  22. package/src/components/VcAutoComplete/VcAutoComplete.stories.js +99 -0
  23. package/src/components/VcAvatar/VcAvatar.spec.js +110 -0
  24. package/src/components/VcAvatar/VcAvatar.stories.js +101 -0
  25. package/src/components/VcBottomActions/VcBottomActions.spec.js +64 -0
  26. package/src/components/VcBottomActions/VcBottomActions.stories.js +103 -0
  27. package/src/components/VcBottomActions/VcBottomActions.vue +4 -4
  28. package/src/components/VcButton/VcButton.spec.js +181 -0
  29. package/src/components/VcButton/VcButton.stories.js +123 -0
  30. package/src/components/VcButton/VcButton.stories.mdx.old +40 -0
  31. package/src/components/VcButtonGroup/VcButtonGroup.spec.js +209 -0
  32. package/src/components/VcButtonGroup/VcButtonGroup.stories.js +109 -0
  33. package/src/components/VcButtonGroup/VcButtonGroup.vue +5 -1
  34. package/src/components/VcCard/VcCard.spec.js +38 -0
  35. package/src/components/VcCard/VcCard.stories.js +28 -0
  36. package/src/components/VcCard/VcCard.vue +46 -0
  37. package/src/components/VcExpansionPanels/VcExpansionPanels.stories.js +36 -0
  38. package/src/components/VcForm/VcForm.spec.js +38 -0
  39. package/src/components/VcForm/VcForm.stories.js +44 -0
  40. package/src/components/VcHourInput/VcHourInput.stories.js +36 -0
  41. package/src/components/VcIcon/VcIcon.spec.js +38 -0
  42. package/src/components/VcIcon/VcIcon.stories.js +53 -0
  43. package/src/components/VcIconWithTooltip/VcIconWithTooltip.spec.js +156 -0
  44. package/src/components/VcIconWithTooltip/VcIconWithTooltip.stories.js +77 -0
  45. package/src/components/VcIconWithTooltip/VcIconWithTooltip.vue +7 -6
  46. package/src/components/VcLayout/VcLayout.spec.js +38 -0
  47. package/src/components/VcLayout/VcLayout.stories.js +26 -0
  48. package/src/components/VcLoader/VcLoader.spec.js +38 -0
  49. package/src/components/VcLoader/VcLoader.stories.js +30 -0
  50. package/src/components/VcLoader/VcLoader.vue +1 -1
  51. package/src/components/VcMenu/VcMenu.spec.js +38 -0
  52. package/src/components/VcMenu/VcMenu.stories.js +45 -0
  53. package/src/components/VcSwitch/VcSwitch.spec.js +38 -0
  54. package/src/components/VcSwitch/VcSwitch.stories.js +87 -0
  55. package/src/components/VcSwitch/VcSwitch.vue +14 -1
  56. package/src/components/VcTextArea/VcTextArea.spec.js +41 -0
  57. package/src/components/VcTextArea/VcTextArea.stories.js +144 -0
  58. package/src/components/VcTextArea/VcTextArea.vue +21 -10
  59. package/src/components/VcTextField/VcTextField.spec.js +170 -0
  60. package/src/components/VcTextField/VcTextField.stories.js +65 -0
  61. package/src/components/VcTextField/VcTextField.vue +4 -3
  62. package/src/components/VcToast/VcToast.spec.js +75 -0
  63. package/src/components/VcToast/VcToast.stories.js +80 -0
  64. package/src/components/VcToast/VcToast.vue +11 -15
  65. package/src/components/VcTooltip/VcTooltip.spec.js +58 -0
  66. package/src/components/VcTooltip/VcTooltip.stories.js +163 -0
  67. package/src/components/VcTooltip/VcTooltip.vue +4 -4
  68. package/src/components/index.js +26 -0
  69. package/src/components/modal/VcConfirmModal/VcConfirmModal.spec.js +48 -0
  70. package/src/components/modal/VcConfirmModal/VcConfirmModal.stories.js +142 -0
  71. package/src/components/modal/VcConfirmProminentModal/VcConfirmProminentModal.spec.js +49 -0
  72. package/src/components/modal/VcConfirmProminentModal/VcConfirmProminentModal.stories.js +53 -0
  73. package/src/components/modal/VcInputModal/VcInputModal.spec.js +79 -0
  74. package/src/components/modal/VcInputModal/VcInputModal.stories.js +188 -0
  75. package/src/components/modal/VcNoticeModal/VcNoticeModal.spec.js +54 -0
  76. package/src/components/modal/VcNoticeModal/VcNoticeModal.stories.js +136 -0
  77. package/src/components/modal/elements/VcModalContainer.spec.js +38 -0
  78. package/src/components/modal/elements/VcModalContainer.stories.js +49 -0
  79. package/src/components/modal/elements/VcModalFooter.spec.js +82 -0
  80. package/src/components/modal/elements/VcModalFooter.stories.js +47 -0
  81. package/src/components/modal/elements/VcModalHeader.spec.js +103 -0
  82. package/src/components/modal/elements/VcModalHeader.stories.js +91 -0
  83. package/src/components/modal/elements/VcModalWrapper.spec.js +38 -0
  84. package/src/components/modal/elements/VcModalWrapper.stories.js +34 -0
  85. package/src/entry.esm.js +16 -0
  86. package/src/entry.js +13 -0
  87. package/src/scss/_i18n-mixins.scss +174 -0
  88. package/src/scss/mixins.scss +7 -0
  89. package/src/stories/assets/HeaderImage.svg +9 -0
  90. package/src/stories/assets/code-brackets.svg +1 -0
  91. package/src/stories/assets/colors.svg +1 -0
  92. package/src/stories/assets/comments.svg +1 -0
  93. package/src/stories/assets/direction.svg +1 -0
  94. package/src/stories/assets/flow.svg +1 -0
  95. package/src/stories/assets/plugin.svg +1 -0
  96. package/src/stories/assets/rabbit.svg +17 -0
  97. package/src/stories/assets/repo.svg +1 -0
  98. package/src/stories/assets/stackalt.svg +1 -0
  99. package/src/stories/colors.stories.mdx +78 -0
  100. package/src/stories/welcome.stories.mdx +210 -0
  101. package/styles/variables.scss +65 -7
  102. package/utils/colorUtil.js +41 -0
@@ -0,0 +1,44 @@
1
+ import VcFormCmp from './VcForm';
2
+ import {action} from "@storybook/addon-actions";
3
+ import VcTextField from "@/components/VcTextField/VcTextField";
4
+
5
+ const Template = (args, {argTypes}) => ({
6
+ components: {VcForm: VcFormCmp, VcTextField},
7
+ props: Object.keys(argTypes),
8
+ data: () => ({
9
+ name: '',
10
+ nameRules: [
11
+ v => !!v || 'Name is required',
12
+ v => (v && v.length <= 10) || 'Name must be less than 10 characters',
13
+ ],
14
+ }),
15
+ template: '<div>' +
16
+ '<VcForm @input="onInput" @submit="onSubmit">' +
17
+ '<VcTextField v-model="name" :counter="10"' +
18
+ ' :rules="nameRules"' +
19
+ ' label="Name"' +
20
+ ' required/>' +
21
+ '</VcForm>' +
22
+ '</div>',
23
+ })
24
+
25
+ export const Playground = Template.bind({});
26
+
27
+ // Set default values
28
+ Playground.args = {
29
+ param: 'value',
30
+ onSubmit: action('onSubmit'),
31
+ onInput: action('onInput'),
32
+ }
33
+
34
+ export default {
35
+ title: 'Form / VcForm',
36
+ id: 'VcForm',
37
+ component: VcFormCmp,
38
+ parameters: {
39
+ status: {
40
+ type: 'stable', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
41
+ url: 'https://vuetifyjs.com/en/components/forms', // will make the tag a link
42
+ },
43
+ },
44
+ };
@@ -0,0 +1,36 @@
1
+ // import VcHourInputCmp from './VcHourInput';
2
+ //
3
+ // const Template = (args, {argTypes}) => ({
4
+ // components: {VcHourInput: VcHourInputCmp},
5
+ // props: Object.keys(argTypes),
6
+ // template: '<div><VcHourInput :param="param" @onClick="onClick"/></div>',
7
+ // })
8
+ //
9
+ // // export const Playground = Template.bind({});
10
+ // //
11
+ // // // Set default values
12
+ // // Playground.args = {
13
+ // // param: 'value',
14
+ // // }
15
+ //
16
+ // // export default {
17
+ // // title: 'VcHourInput',
18
+ // // id: 'VcHourInput',
19
+ // // component: VcHourInputCmp,
20
+ // // argTypes: {
21
+ // // param: {
22
+ // // options: ['value1', 'value2'],
23
+ // // control: {type: 'radio'}
24
+ // // },
25
+ // // },
26
+ // // parameters: {
27
+ // // design: {
28
+ // // type: 'figma',
29
+ // // url: 'https://www.figma.com',
30
+ // // },
31
+ // // status: {
32
+ // // type: 'beta', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
33
+ // // url: 'http://www.url.com/status', // will make the tag a link
34
+ // // },
35
+ // // },
36
+ // // };
@@ -0,0 +1,38 @@
1
+ import '@testing-library/jest-dom'
2
+ import VcIcon from "./VcIcon.vue";
3
+ import init from "../../../testing-library.config"
4
+ import Vuetify from 'vuetify'
5
+ import {render} from "@testing-library/vue";
6
+
7
+ init();
8
+
9
+ describe("VcIcon.vue", () => {
10
+
11
+ const renderWithVuetify = (component, options, callback) => {
12
+ const root = document.createElement('div')
13
+ root.setAttribute('data-app', 'true')
14
+
15
+ return render(
16
+ component,
17
+ {
18
+ container: document.body.appendChild(root),
19
+ // for Vuetify components that use the vuetify instance property
20
+ vuetify: new Vuetify(),
21
+ ...options,
22
+ mocks: {},
23
+ },
24
+ callback,
25
+ )
26
+ }
27
+
28
+ it("mounts", () => {
29
+ // Queries: https://testing-library.com/docs/queries/about#types-of-queries
30
+ const {container} = renderWithVuetify(VcIcon, {
31
+ props: {}
32
+ })
33
+
34
+ // Expect options: https://github.com/testing-library/jest-dom
35
+ expect(container).toHaveAttribute('data-app', 'true')
36
+ });
37
+
38
+ });
@@ -0,0 +1,53 @@
1
+ import VcIconCmp from './VcIcon';
2
+
3
+ const Template = (args, {argTypes}) => ({
4
+ components: {VcIcon: VcIconCmp},
5
+ props: Object.keys(argTypes),
6
+ template: '<div><VcIcon :color="color">{{iconName}}</VcIcon></div>',
7
+ })
8
+
9
+ export const Playground = Template.bind({});
10
+
11
+ // Set default values
12
+ Playground.args = {
13
+ iconName: 'mdi-close',
14
+ color: 'black'
15
+ }
16
+
17
+ export const WithColor = Template.bind({});
18
+
19
+ // Set default values
20
+ WithColor.args = {
21
+ iconName: 'mdi-close',
22
+ color: 'orange',
23
+ }
24
+
25
+ const TemplateSmall = (args, {argTypes}) => ({
26
+ components: {VcIcon: VcIconCmp},
27
+ props: Object.keys(argTypes),
28
+ template: '<div><VcIcon :color="color" small>{{iconName}}</VcIcon></div>',
29
+ })
30
+
31
+ export const Small = TemplateSmall.bind({});
32
+
33
+ // Set default values
34
+ Small.args = {
35
+ iconName: 'mdi-close',
36
+ color: 'black'
37
+ }
38
+
39
+ export default {
40
+ title: 'Content Display / VcIcon',
41
+ id: 'VcIcon',
42
+ component: VcIconCmp,
43
+ parameters: {
44
+ design: {
45
+ type: 'figma',
46
+ url: 'https://www.figma.com',
47
+ },
48
+ status: {
49
+ type: 'stable', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
50
+ url: 'http://www.url.com/status', // will make the tag a link
51
+ },
52
+ },
53
+ };
@@ -0,0 +1,156 @@
1
+ import '@testing-library/jest-dom'
2
+ import VcIconWithTooltip from "./VcIconWithTooltip.vue";
3
+ import Vuetify from 'vuetify'
4
+ import {render, waitFor} from "@testing-library/vue";
5
+ import userEvent from '@testing-library/user-event';
6
+ import init from "../../../testing-library.config";
7
+
8
+ init();
9
+
10
+ describe("VcIconWithTooltip.vue", () => {
11
+
12
+ const renderWithVuetify = (component, options, callback) => {
13
+ const root = document.createElement('div')
14
+ root.setAttribute('data-app', 'true')
15
+
16
+ return render(
17
+ component,
18
+ {
19
+ container: document.body.appendChild(root),
20
+ // for Vuetify components that use the vuetify instance property
21
+ vuetify: new Vuetify(),
22
+ ...options,
23
+ mocks: {},
24
+ },
25
+ callback,
26
+ )
27
+ }
28
+
29
+ const defaultProps = {
30
+ size: 12,
31
+ header: "John Lennon",
32
+ content: "Life is what happens when you're busy making other plans",
33
+ top: true,
34
+ bottom: false,
35
+ nudgeLeft: 0,
36
+ nudgeRight: 0,
37
+ dataQa: 'test-tooltip',
38
+ }
39
+
40
+ it("mounts", async () => {
41
+ // Queries: https://testing-library.com/docs/queries/about#types-of-queries
42
+ const {container, getByTestId, getByText, queryByText} = renderWithVuetify(VcIconWithTooltip, {
43
+ props: defaultProps
44
+ })
45
+
46
+ // Expect options: https://github.com/testing-library/jest-dom
47
+ expect(container).toHaveAttribute('data-app', 'true')
48
+
49
+ const tooltipButton = getByTestId(`${defaultProps.dataQa}-icon`)
50
+ expect(getByText('$information')).toBeInTheDocument()
51
+ expect(queryByText('$info_fill')).toBeNull()
52
+
53
+ let tooltipContent = null
54
+ await userEvent.hover(tooltipButton)
55
+ // Let the hover commence
56
+ await waitFor(() => {
57
+ tooltipContent = getByTestId(`${defaultProps.dataQa}-content`)
58
+ // Check tooltip is active and with the correct data
59
+ expect(tooltipContent).toBeVisible()
60
+ expect(queryByText('$information')).toBeNull()
61
+ expect(getByText('$info_fill')).toBeInTheDocument()
62
+ expect(getByText(defaultProps.header)).toBeVisible()
63
+ expect(getByText(defaultProps.content)).toBeVisible()
64
+ }, {timeout: 200})
65
+
66
+ await userEvent.unhover(tooltipButton)
67
+ // Check tooltip is inactive
68
+ await waitFor(() => {
69
+ expect(tooltipContent).not.toBeVisible()
70
+ expect(getByText('$information')).toBeInTheDocument()
71
+ expect(queryByText('$info_fill')).toBeNull()
72
+ }, {timeout: 200})
73
+ });
74
+
75
+ it("dark mode", async () => {
76
+ // Queries: https://testing-library.com/docs/queries/about#types-of-queries
77
+ const {getByTestId, getByText, queryByText} = renderWithVuetify(VcIconWithTooltip, {
78
+ props: {
79
+ ...defaultProps,
80
+ dark: true,
81
+ icon: 'question'
82
+ }
83
+ })
84
+
85
+ const tooltipButton = getByTestId(`${defaultProps.dataQa}-icon`)
86
+ expect(getByText('$question')).toBeInTheDocument()
87
+ expect(queryByText('$question_fill')).toBeNull()
88
+
89
+ let tooltipContent = null
90
+ await userEvent.hover(tooltipButton)
91
+
92
+ // Let the hover commence
93
+ await waitFor(() => {
94
+ tooltipContent = getByTestId(`${defaultProps.dataQa}-dark-content`)
95
+ // Check tooltip is active and with the correct data
96
+ expect(tooltipContent).toBeVisible()
97
+ expect(queryByText('$question')).toBeNull()
98
+ expect(getByText('$question_fill')).toBeInTheDocument()
99
+ expect(getByText(`${defaultProps.header} ${defaultProps.content}`)).toBeVisible()
100
+ }, {timeout: 200})
101
+
102
+ await userEvent.unhover(tooltipButton)
103
+ // Check tooltip is inactive
104
+ await waitFor(() => {
105
+ expect(tooltipContent).not.toBeVisible()
106
+ expect(getByText('$question')).toBeInTheDocument()
107
+ expect(queryByText('$question_fill')).toBeNull()
108
+ }, {timeout: 200})
109
+ });
110
+
111
+ it("attention icon", async () => {
112
+ // Queries: https://testing-library.com/docs/queries/about#types-of-queries
113
+ const {getByText, getByTestId, queryByText} = renderWithVuetify(VcIconWithTooltip, {
114
+ props: {
115
+ ...defaultProps,
116
+ icon: 'attention'
117
+ }
118
+ })
119
+
120
+ const tooltipButton = getByTestId(`${defaultProps.dataQa}-icon`)
121
+ expect(getByText('$attention')).toBeVisible()
122
+ expect(queryByText('$attention_fill')).toBeNull()
123
+ await userEvent.hover(tooltipButton)
124
+ // Let the hover commence
125
+ await waitFor(() => {
126
+ // Check tooltip is active and with the correct data
127
+ const tooltipContent = getByTestId(`${defaultProps.dataQa}-content`)
128
+ expect(getByText('$attention_fill')).toBeVisible()
129
+ expect(queryByText('$attention')).toBeNull()
130
+ expect(tooltipContent).toBeVisible()
131
+ }, {timeout: 200})
132
+ });
133
+
134
+ it("default icon", async () => {
135
+ // Queries: https://testing-library.com/docs/queries/about#types-of-queries
136
+ const {getByText, getByTestId} = renderWithVuetify(VcIconWithTooltip, {
137
+ props: {
138
+ ...defaultProps,
139
+ icon: 'default'
140
+ }
141
+ })
142
+
143
+ const tooltipButton = getByTestId(`${defaultProps.dataQa}-icon`)
144
+ expect(getByText('$information')).toBeVisible()
145
+ await userEvent.hover(tooltipButton)
146
+ // Let the hover commence
147
+ await waitFor(() => {
148
+ const tooltipContent = getByTestId(`${defaultProps.dataQa}-content`)
149
+
150
+ // Check tooltip is active and with the correct data
151
+ expect(tooltipContent).toBeVisible()
152
+ }, {timeout: 200})
153
+
154
+ });
155
+
156
+ });
@@ -0,0 +1,77 @@
1
+ import VcIconWithTooltipCmp from './VcIconWithTooltip';
2
+
3
+ const GeneralTemplate = (args, {argTypes}) => ({
4
+ components: {VcIconWithTooltip: VcIconWithTooltipCmp},
5
+ props: Object.keys(argTypes),
6
+ template: `
7
+ <div>
8
+ <br/>
9
+ <br/>
10
+ <br/>
11
+ <br/>
12
+ <br/>
13
+ <br/>
14
+ <br/>
15
+ <br/>
16
+ <br/>
17
+ <br/>
18
+ <br/>
19
+ <br/>
20
+ <VcIconWithTooltip
21
+ :icon="icon"
22
+ :size="size"
23
+ :header="header"
24
+ :content="content"
25
+ :flavor="flavor"
26
+ :top="top"
27
+ :bottom="bottom"
28
+ :nudge-left="nudgeLeft"
29
+ :nudge-right="nudgeRight"
30
+ :dark="dark"
31
+ :data-qa="dataQa">
32
+ </VcIconWithTooltip>
33
+ </div>`
34
+ })
35
+
36
+ export const Playground = GeneralTemplate.bind({});
37
+
38
+ // Set default values
39
+ Playground.args = {
40
+ icon: "information",
41
+ size: 12,
42
+ header: "John Lennon",
43
+ content: "Life is what happens when you're busy making other plans",
44
+ flavor: 'alert',
45
+ dark: false,
46
+ top: true,
47
+ bottom: false,
48
+ nudgeLeft: 0,
49
+ nudgeRight: 0,
50
+ dataQa: 'vc-tooltip',
51
+ }
52
+
53
+ export default {
54
+ title: 'Content Display / VcIconWithTooltip',
55
+ id: 'VcIconWithTooltip',
56
+ component: VcIconWithTooltipCmp,
57
+ argTypes: {
58
+ flavor: {
59
+ options: ['information', 'alert'],
60
+ control: {type: 'radio'}
61
+ },
62
+ icon: {
63
+ options: ['information', 'question', 'attention', 'default'],
64
+ control: {type: 'radio'}
65
+ }
66
+ },
67
+ parameters: {
68
+ design: {
69
+ type: 'figma',
70
+ url: 'https://www.figma.com/file/xIOY6fBoA1wpy1tHv3i5js/vcita---ui-library?node-id=70%3A87',
71
+ },
72
+ status: {
73
+ type: 'stable', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
74
+ url: 'http://www.url.com/status', // will make the tag a link
75
+ }
76
+ },
77
+ };
@@ -1,8 +1,9 @@
1
1
  <template>
2
- <VcTooltip v-bind="$attrs">
2
+ <VcTooltip v-bind="$attrs"
3
+ :data-qa="dataQa">
3
4
  <template>
4
5
  <v-icon :size="size" class="tooltip-icon"
5
- :data-qa="dataQa"
6
+ :data-qa="`${dataQa}-icon`"
6
7
  @mouseover="inHover"
7
8
  @mouseleave="iconInUse = icon"
8
9
  :class="{'vc-default': iconInUse === 'default', 'vc-default_hovering': iconInUse === 'default_hovering'}">
@@ -31,7 +32,7 @@ export default {
31
32
  },
32
33
  dataQa: {
33
34
  type: String,
34
- default: 'vc-icon-with-tooltip'
35
+ default: 'vc-tooltip'
35
36
  },
36
37
  },
37
38
  data() {
@@ -80,7 +81,7 @@ export default {
80
81
  }
81
82
 
82
83
  .vc-question-fill {
83
- fill: $grey-1;
84
+ fill: var(--gray-darken-4);
84
85
  }
85
86
 
86
87
  .vc-information, .vc-info-fill {
@@ -88,7 +89,7 @@ export default {
88
89
  }
89
90
 
90
91
  .vc-attention, .vc-attention-fill {
91
- fill: var(--v-danger-base);
92
+ fill: var(--red);
92
93
  }
93
94
 
94
95
  &.vc-default {
@@ -99,7 +100,7 @@ export default {
99
100
 
100
101
  &.vc-default_hovering {
101
102
  .vc-information, .vc-info-fill {
102
- fill: $grey-1;
103
+ fill: var(--gray-darken-4);
103
104
  }
104
105
  }
105
106
  }
@@ -0,0 +1,38 @@
1
+ import '@testing-library/jest-dom'
2
+ import VcLayout from "./VcLayout.vue";
3
+ import init from "../../../testing-library.config"
4
+ import Vuetify from 'vuetify'
5
+ import {render} from "@testing-library/vue";
6
+
7
+ init();
8
+
9
+ describe("VcLayout.vue", () => {
10
+
11
+ const renderWithVuetify = (component, options, callback) => {
12
+ const root = document.createElement('div')
13
+ root.setAttribute('data-app', 'true')
14
+
15
+ return render(
16
+ component,
17
+ {
18
+ container: document.body.appendChild(root),
19
+ // for Vuetify components that use the vuetify instance property
20
+ vuetify: new Vuetify(),
21
+ ...options,
22
+ mocks: {},
23
+ },
24
+ callback,
25
+ )
26
+ }
27
+
28
+ it("mounts", () => {
29
+ // Queries: https://testing-library.com/docs/queries/about#types-of-queries
30
+ const {container} = renderWithVuetify(VcLayout, {
31
+ props: {}
32
+ })
33
+
34
+ // Expect options: https://github.com/testing-library/jest-dom
35
+ expect(container).toHaveAttribute('data-app', 'true')
36
+ });
37
+
38
+ });
@@ -0,0 +1,26 @@
1
+ import VcLayoutCmp from './VcLayout';
2
+
3
+ const Template = (args, {argTypes}) => ({
4
+ components: {VcLayout: VcLayoutCmp},
5
+ props: Object.keys(argTypes),
6
+ template: '<div><VcLayout><div>div in the layout</div></VcLayout></div>',
7
+ })
8
+
9
+ export const Playground = Template.bind({});
10
+
11
+ // Set default values
12
+ Playground.args = {
13
+ // param: 'value',
14
+ }
15
+
16
+ export default {
17
+ title: 'Containers / VcLayout',
18
+ id: 'VcLayout',
19
+ component: VcLayoutCmp,
20
+ parameters: {
21
+ status: {
22
+ type: 'stable', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
23
+ url: 'https://vuetifyjs.com/en/api/v-layout', // will make the tag a link
24
+ },
25
+ },
26
+ };
@@ -0,0 +1,38 @@
1
+ import '@testing-library/jest-dom'
2
+ import VcLoader from "./VcLoader.vue";
3
+ import init from "../../../testing-library.config"
4
+ import Vuetify from 'vuetify'
5
+ import {render} from "@testing-library/vue";
6
+
7
+ init();
8
+
9
+ describe("VcLoader.vue", () => {
10
+
11
+ const renderWithVuetify = (component, options, callback) => {
12
+ const root = document.createElement('div')
13
+ root.setAttribute('data-app', 'true')
14
+
15
+ return render(
16
+ component,
17
+ {
18
+ container: document.body.appendChild(root),
19
+ // for Vuetify components that use the vuetify instance property
20
+ vuetify: new Vuetify(),
21
+ ...options,
22
+ mocks: {},
23
+ },
24
+ callback,
25
+ )
26
+ }
27
+
28
+ it("mounts", () => {
29
+ // Queries: https://testing-library.com/docs/queries/about#types-of-queries
30
+ const {container} = renderWithVuetify(VcLoader, {
31
+ props: {}
32
+ })
33
+
34
+ // Expect options: https://github.com/testing-library/jest-dom
35
+ expect(container).toHaveAttribute('data-app', 'true')
36
+ });
37
+
38
+ });
@@ -0,0 +1,30 @@
1
+ import VcLoaderCmp from './VcLoader';
2
+
3
+ const Template = (args, {argTypes}) => ({
4
+ components: {VcLoader: VcLoaderCmp},
5
+ props: Object.keys(argTypes),
6
+ template: '<div><VcLoader :color="color" :value="value" :size="size" :width="width"/></div>',
7
+ })
8
+
9
+ export const Playground = Template.bind({});
10
+
11
+ // Set default values
12
+ Playground.args = {
13
+ color: 'primary'
14
+ }
15
+
16
+ export default {
17
+ title: 'Loaders / VcLoader',
18
+ id: 'VcLoader',
19
+ component: VcLoaderCmp,
20
+ parameters: {
21
+ design: {
22
+ type: 'figma',
23
+ url: 'https://www.figma.com',
24
+ },
25
+ status: {
26
+ type: 'stable', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
27
+ url: 'http://www.url.com/status', // will make the tag a link
28
+ },
29
+ },
30
+ };
@@ -17,7 +17,7 @@ export default {
17
17
  },
18
18
  color: {
19
19
  type: String,
20
- default: "#0c315e"
20
+ default: "primary"
21
21
  },
22
22
  size: {
23
23
  type: Number,
@@ -0,0 +1,38 @@
1
+ import '@testing-library/jest-dom'
2
+ import VcMenu from "./VcMenu.vue";
3
+ import init from "../../../testing-library.config"
4
+ import Vuetify from 'vuetify'
5
+ import {render} from "@testing-library/vue";
6
+
7
+ init();
8
+
9
+ describe("VcMenu.vue", () => {
10
+
11
+ const renderWithVuetify = (component, options, callback) => {
12
+ const root = document.createElement('div')
13
+ root.setAttribute('data-app', 'true')
14
+
15
+ return render(
16
+ component,
17
+ {
18
+ container: document.body.appendChild(root),
19
+ // for Vuetify components that use the vuetify instance property
20
+ vuetify: new Vuetify(),
21
+ ...options,
22
+ mocks: {},
23
+ },
24
+ callback,
25
+ )
26
+ }
27
+
28
+ it("mounts", () => {
29
+ // Queries: https://testing-library.com/docs/queries/about#types-of-queries
30
+ const {container} = renderWithVuetify(VcMenu, {
31
+ props: {}
32
+ })
33
+
34
+ // Expect options: https://github.com/testing-library/jest-dom
35
+ expect(container).toHaveAttribute('data-app', 'true')
36
+ });
37
+
38
+ });
@@ -0,0 +1,45 @@
1
+ import VcMenuCmp from './VcMenu';
2
+ import VcButton from "@/components/VcButton/VcButton";
3
+
4
+ const Template = (args, {argTypes}) => ({
5
+ components: {VcMenu: VcMenuCmp, VcButton},
6
+ props: Object.keys(argTypes),
7
+ template: '<div><VcMenu>' +
8
+ ' <template #activator="{ on, attrs }"> ' +
9
+ ' <VcButton v-bind="attrs" v-on="on"> Click me </VcButton> ' +
10
+ ' </template> ' +
11
+ ' <v-list> ' +
12
+ ' <v-list-item> ' +
13
+ ' <v-list-item-title>Option 1</v-list-item-title> ' +
14
+ ' </v-list-item> ' +
15
+ ' <v-list-item disabled> ' +
16
+ ' <v-list-item-title>Option 2</v-list-item-title> ' +
17
+ ' </v-list-item> ' +
18
+ ' <v-list-item> ' +
19
+ ' <v-list-item-title>Option 3</v-list-item-title> ' +
20
+ ' </v-list-item> ' +
21
+ ' </v-list>' +
22
+ '</VcMenu></div>',
23
+ })
24
+
25
+ export const Playground = Template.bind({});
26
+
27
+ // Set default values
28
+ Playground.args = {
29
+ }
30
+
31
+ // export default {
32
+ // title: 'Containers / VcMenu',
33
+ // id: 'VcMenu',
34
+ // component: VcMenuCmp,
35
+ // parameters: {
36
+ // design: {
37
+ // type: 'figma',
38
+ // url: 'https://www.figma.com',
39
+ // },
40
+ // status: {
41
+ // type: 'beta', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
42
+ // url: 'http://www.url.com/status', // will make the tag a link
43
+ // },
44
+ // },
45
+ // };