@vcita/design-system 1.1.8 → 1.1.9

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 (119) hide show
  1. package/README.md +162 -120
  2. package/config/locales/ds.en.yml +1 -1
  3. package/dist/@vcita/design-system.esm.js +1191 -919
  4. package/dist/@vcita/design-system.min.js +2 -2
  5. package/dist/@vcita/design-system.ssr.js +1091 -812
  6. package/init/DesignSystem.js +8 -2
  7. package/package.json +9 -8
  8. package/src/components/VcActionList/VcActionList.stories.js +6 -2
  9. package/src/components/VcActions/VcActions.stories.js +13 -11
  10. package/src/components/VcActions/VcActions.vue +7 -0
  11. package/src/components/VcAlert/VcAlert.stories.js +23 -45
  12. package/src/components/VcAutoComplete/VcAutoComplete.stories.js +34 -4
  13. package/src/components/VcAutoComplete/VcAutoComplete.vue +8 -4
  14. package/src/components/VcAvatar/VcAvatar.stories.js +164 -14
  15. package/src/components/VcAvatar/VcAvatar.vue +2 -1
  16. package/src/components/VcBadge/VcBadge.stories.js +46 -25
  17. package/src/components/VcBanner/VcBanner.stories.js +4 -0
  18. package/src/components/VcBottomActions/VcBottomActions.stories.js +10 -6
  19. package/src/components/VcBottomActions/VcBottomActions.vue +9 -2
  20. package/src/components/VcBottomSheet/VcBottomSheet.stories.js +18 -6
  21. package/src/components/VcBottomSheet/VcBottomSheet.vue +6 -0
  22. package/src/components/VcButton/VcButton.stories.js +114 -58
  23. package/src/components/VcButton/VcButton.vue +20 -5
  24. package/src/components/VcButton/VcButtonDocs.mdx +59 -0
  25. package/src/components/VcButtonGroup/VcButtonGroup.stories.js +44 -31
  26. package/src/components/VcCard/VcCard.stories.js +4 -0
  27. package/src/components/VcCheckbox/VcCheckbox.stories.js +36 -31
  28. package/src/components/VcChip/VcChip.stories.js +7 -3
  29. package/src/components/VcDocItem/VcDocItem.stories.js +11 -8
  30. package/src/components/VcDraggableList/VcDraggableList.stories.js +5 -0
  31. package/src/components/VcDropzone/VcDropzone.stories.js +5 -5
  32. package/src/components/VcEmptyState/VcEmptyState.stories.js +13 -2
  33. package/src/components/VcExpansionCard/VcExpansionCard.stories.js +6 -2
  34. package/src/components/VcFilterPanel/VcFilterPanel.stories.js +7 -1
  35. package/src/components/VcFocusArea/VcFocusArea.stories.js +6 -1
  36. package/src/components/VcForm/VcForm.stories.js +14 -10
  37. package/src/components/VcForm/VcForm.vue +1 -0
  38. package/src/components/VcIcon/VcIcon.stories.js +5 -1
  39. package/src/components/VcIconWithTooltip/VcIconWithTooltip.stories.js +5 -1
  40. package/src/components/VcImage/VcImage.stories.js +5 -1
  41. package/src/components/VcInputBottomSheet/VcInputBottomSheet.stories.js +25 -6
  42. package/src/components/VcInputPopover/VcInputPopover.stories.js +26 -5
  43. package/src/components/VcLayout/VcLayout.stories.js +4 -0
  44. package/src/components/VcLink/VcLink.stories.js +19 -9
  45. package/src/components/VcLoader/VcLoader.stories.js +13 -2
  46. package/src/components/VcLoader/VcLoader.vue +11 -0
  47. package/src/components/VcMenu/VcMenu.stories.js +24 -18
  48. package/src/components/VcPopover/VcPopover.stories.js +13 -2
  49. package/src/components/VcProgressCircular/VcProgressCircular.stories.js +12 -7
  50. package/src/components/VcRadio/VcRadio.stories.js +8 -7
  51. package/src/components/VcRadioGroup/VcRadioGroup.stories.js +31 -26
  52. package/src/components/VcSearchBar/VcSearchBar.stories.js +8 -4
  53. package/src/components/VcSearchBar/VcSearchBar.vue +5 -1
  54. package/src/components/VcSearchPicker/VcSearchPicker.stories.js +63 -62
  55. package/src/components/VcSegmentedControl/VcSegmentedControl.stories.js +4 -0
  56. package/src/components/VcSelectField/VcSelectField.stories.js +71 -127
  57. package/src/components/VcSvg/VcSvg.stories.js +4 -0
  58. package/src/components/VcSwitch/VcSwitch.stories.js +63 -30
  59. package/src/components/VcTabs/VcTabs.spec.js +140 -0
  60. package/src/components/VcTabs/VcTabs.stories.js +191 -0
  61. package/src/components/VcTabs/VcTabs.vue +136 -0
  62. package/src/components/VcTextArea/VcTextArea.stories.js +93 -100
  63. package/src/components/VcTextArea/VcTextArea.vue +3 -0
  64. package/src/components/VcTextField/VcTextField.stories.js +8 -15
  65. package/src/components/VcTimeSince/VcTimeSince.stories.js +12 -3
  66. package/src/components/VcToast/VcToast.stories.js +5 -1
  67. package/src/components/VcTooltip/VcTooltip.stories.js +77 -133
  68. package/src/components/VcTooltip/VcTooltip.vue +17 -15
  69. package/src/components/VcUpsellBlock/VcUpsellBlock.stories.js +69 -44
  70. package/src/components/index.js +1 -0
  71. package/src/components/list/VcBaseListItem/VcBaseListItem.stories.js +7 -5
  72. package/src/components/list/VcList/VcList.stories.js +59 -68
  73. package/src/components/list/VcList/VcList.vue +1 -1
  74. package/src/components/list/VcList/pattern/VcMobilePickerPattern.stories.js +103 -38
  75. package/src/components/list/VcListEntity/VcListEntity.stories.js +28 -10
  76. package/src/components/list/VcListEntity/VcListEntity.vue +0 -2
  77. package/src/components/listBox/VcChecklistItem/VcChecklistItem.spec.js +1 -1
  78. package/src/components/listBox/VcChecklistItem/VcChecklistItem.stories.js +34 -15
  79. package/src/components/listBox/VcListbox/VcListbox.spec.js +3 -3
  80. package/src/components/listBox/VcListbox/VcListbox.stories.js +29 -16
  81. package/src/components/listBox/VcListbox/VcListbox.vue +4 -0
  82. package/src/components/listPage/VcGroupHeader/VcGroupHeader.stories.js +10 -2
  83. package/src/components/listPage/VcInfiniteScroll/VcInfiniteScroll.stories.js +7 -0
  84. package/src/components/listPage/VcListItem/VcListItem.stories.js +13 -5
  85. package/src/components/modal/VcConfirmModal/VcConfirmModal.stories.js +4 -0
  86. package/src/components/modal/VcConfirmProminentModal/VcConfirmProminentModal.stories.js +4 -0
  87. package/src/components/modal/VcInputModal/VcInputModal.stories.js +4 -0
  88. package/src/components/modal/VcNoticeModal/VcNoticeModal.stories.js +4 -0
  89. package/src/components/modal/elements/VcModalContainer.stories.js +4 -0
  90. package/src/components/modal/elements/VcModalFooter.stories.js +4 -0
  91. package/src/components/modal/elements/VcModalHeader.stories.js +4 -0
  92. package/src/components/modal/elements/VcModalWrapper.stories.js +4 -0
  93. package/src/components/wizard/VcMobileWizardProgress/VcMobileWizardProgress.stories.js +20 -10
  94. package/src/components/wizard/VcSteperContent/VcStepperContent.stories.js +18 -11
  95. package/src/components/wizard/VcStepsBar/VcStepsBar.stories.js +14 -3
  96. package/src/components/wizard/VcWizard/VcWizard.spec.js +1 -1
  97. package/src/components/wizard/VcWizard/VcWizard.stories.js +29 -18
  98. package/src/components/wizard/VcWizard/VcWizard.vue +0 -1
  99. package/src/components/wizard/VcWizard/demoWizardPage.vue +11 -9
  100. package/src/components/wizard/VcWizardCtaContainer/VcWizardCtaContainer.spec.js +6 -6
  101. package/src/components/wizard/VcWizardCtaContainer/VcWizardCtaContainer.stories.js +15 -25
  102. package/src/components/wizard/VcWizardCtaContainer/VcWizardCtaContainer.vue +3 -3
  103. package/src/stories/VcBaseDocs.mdx +21 -0
  104. package/src/stories/assets/pics/avatar1.png +0 -0
  105. package/src/stories/assets/pics/avatar2.png +0 -0
  106. package/src/stories/assets/pics/avatar3.png +0 -0
  107. package/src/stories/assets/pics/avatar4.png +0 -0
  108. package/src/stories/changelog.stories.mdx +7 -0
  109. package/src/stories/readme.stories.mdx +7 -0
  110. package/src/stories/variables.stories.mdx +218 -0
  111. package/src/stories/welcome.stories.mdx +4 -124
  112. package/utils/colorUtil.js +1 -1
  113. package/CHANGELOG.MD +0 -299
  114. package/src/stories/assets/pics/black-widow.jpeg +0 -0
  115. package/src/stories/assets/pics/hulk.png +0 -0
  116. package/src/stories/assets/pics/ironman.png +0 -0
  117. package/src/stories/assets/pics/mufasa.png +0 -0
  118. package/src/stories/assets/pics/spider-man.png +0 -0
  119. package/src/stories/assets/pics/wolverine.png +0 -0
package/README.md CHANGED
@@ -1,179 +1,221 @@
1
1
  # design-system
2
2
 
3
- link to storybook
4
- https://vcita.github.io/design-system
3
+ You can find storybook [here](https://vcita.github.io/design-system)
5
4
 
6
- ## Goals
5
+ This project's goal is to create a set of tools that will enable future development to be quicker and more standard, while providing the vcita flavor.
7
6
 
8
- This project's goal is to create a set of tools that will enable future development to be quicker and more standard.
9
-
10
- ## Creating components
11
-
12
- ### The concept
13
-
14
- The components in this package are project agnostic. They should not contain anything that is specific to any project.
15
- Development will proceed by using the storybook.
7
+ ### Getting started
8
+ ```
9
+ npm i @vcita/design-system
10
+ ```
16
11
 
17
- ### Requirements
12
+ ### External Dependencies
18
13
 
19
- 1. Input variables will be well defined and validated
20
- 2. Components should be constructed so that they are composable - slots are your friends
14
+ This package depends on [Vuetify](https://vuetifyjs.com/en/getting-started/installation/) as an external dependency, so your project must have it installed.
15
+ Currently, the needed version is 2.4.0, we will update this from time to time.
21
16
 
22
- ### Code standards
17
+ ### Initializing in your project
18
+ To initialize the project create plugins/designSystem.js
23
19
 
24
- 1. The component name will start with Vc and be camel cased. example: VcComponent.vue
25
- 2. Emitted events will start with "on" and be camel cased. example: 'onButtonClicked'. Except for standard events such
26
- as "click" or "input".
27
- 3. Don't use v-bind="$attrs" and v-on="$listeners", that's not the way. If you find yourself needing a lot of props, you
28
- may need to implement it using a render function instead.
20
+ ```
21
+ // plugins/designSystem.js
22
+ import DesignSystem from '@vcita/design-system';
23
+ import DesignSystemInit from '@vcita/design-system/init/DesignSystem';
24
+ import Vue from "vue";
29
25
 
30
- ### Guidelines and best practices
26
+ Vue.use(DesignSystem);
27
+ export default DesignSystemInit();
28
+ ```
31
29
 
32
- Every component that is created in this project should have the following things:
30
+ Import into src/main.js and into the vue initialization
31
+ ```
32
+ // src/main.js
33
+ import ds from './plugins/designSystem';
33
34
 
34
- Unit test file with 100% coverage.
35
+ new Vue({
36
+ ...
37
+ vuetify: ds,
38
+ ...
39
+ render: h => h(App)
40
+ }).$mount("#app");
41
+ ```
35
42
 
36
- A storybook page with the following data
43
+ If you need to also adjust some values, such as theme or configurations, it will look something like this:
37
44
 
38
- 1. link to Figma page with the design of the component
39
- 2. controls definition that allows to manipulate the component parameters
40
- 3. use actions to demonstrate the output of the component in terms of emitted events and data
41
- 4. display variations will be clearly presented
45
+ ```
46
+ // plugins/designSystem.js
47
+ import Vue from "vue";
48
+ import DesignSystem from '@vcita/design-system';
49
+ import DesignSystemInit from '@vcita/design-system/init/DesignSystem';
42
50
 
43
- Consider localization issues, such as:
51
+ Vue.use(DesignSystem);
44
52
 
45
- 1. Texts that are set to uppercase by Vuetify need to be changed to text-transform: initial;
46
- 2. Date formatting should be flexible according to different localizations
47
- 3. components should not contain any constant texts, all texts must be passed in as a parameter.
53
+ const config = {
54
+ // Your configuration choices
55
+ };
48
56
 
49
- ## Adding component to the package
57
+ export default DesignSystemInit(config);
58
+ ```
50
59
 
51
- Add to src/components/index.js an entry for your new component, something like:
60
+ All configuration options are specified [here](#available-configuration-options)
52
61
 
62
+ ### Applying the styling to your project
63
+ create the file src/styles/variables.scss and edit to fit your needs. you may only need the import statement.
53
64
  ```
54
- export { default as VcYourComp } from './VcYourComp/VcYourComp.vue';
65
+ @import "~@vcita/design-system/styles/variables.scss";
55
66
  ```
67
+ In order to load the variables.scss file, add this to src/main.js
68
+ ```
69
+ import "@/../styles/variables.scss";
70
+ ```
71
+ The src/styles/variables.scss file can be used to override some styling variables.
72
+ You can do this by specifying a different value to one or more of the css variables that have been provided.
56
73
 
57
- ## Styling
58
-
59
- ### Design tokens and themes
60
-
61
- Since we want these components to be flexible enough that they can be used in multiple projects, we will be using
62
- variables to apply most of the design characteristics of each component.
63
-
64
- Colors will be applied by using the vuetify theme, as defined in preview.js
65
-
66
- Other design variables will be defined in TBD. Each project that uses this package will assign its own values to the
67
- design variables, and thus control its own design. Please be thoughtful when adding and using the design variables in
68
- your components.
69
-
70
- ### Styling best practices
71
-
72
- 1. Values such as margins or padding will be set using css variables, so that each project can adapt the design if need
73
- be. The initial values will be set in the @/styles/variables.scss file.
74
- 2. Changes and additions to general css variables will be documented in the @/stories/welcome.stories.mdx file
75
- 3. Changes and additions to components specific css variables will be documented TBD
76
- 4. Brand colors will be applied using the Vuetify theme, not through parameters. You can add values to the theme in
77
- .storybook/preview.js
78
-
79
- ### Using Vuetify SASS variables
80
-
81
- Changes to default SASS variable values can be made in styles/variables.scss
74
+ For example, to use another font
75
+ ```
76
+ body {
77
+ --primary-font-family: YourFont;
78
+ }
79
+ ```
80
+ All component styling options are specified [here](https://vcita.github.io/design-system/?path=/story/variables--page)
82
81
 
83
- When styling using the Vuetify SASS variables, please consider two situations:
82
+ ### Using the components
83
+ You can now use the components from the new library anywhere in the application, as you normally would
84
+ ```
85
+ <VcButton>label</VcButton>
86
+ ```
84
87
 
85
- 1. The styling decision you are making will be correct across all projects that use this package, in which case the
86
- value can be a constant
87
- 2. the styling decision you are making should be adjusted for different projects. In that case, use the css variables
88
- option, for example:
89
- ```
90
- $body-font-family: var(--primary-font-family);
91
- ```
92
- This will allow each project to apply their own value. The css variables must be documented.
88
+ ### Available configuration options
89
+ #### Theme
90
+ The default theme values are based on default vcita colors, but they can be set according to the current business.
91
+ Please note that colors must be set as hex values.
93
92
 
94
- ### Running Storybook
93
+ To facilitate that the file colorUtil.js has been included, which contains the following functions:
94
+ - rgbToHex() - Use this to convert rgb values to hex values.
95
+ - hexToRgb() - If you have other areas in your project that require rgb format, you can use this to convert any hex values to rgb.
96
+ - pSBC() - This function can calculate various opacity levels, based on an initial color, and return them in hex or rgb formats, as needed
97
+ ```
98
+ // stringUtil.pSBC(opacity, baseColor)
99
+ stringUtil.pSBC(0.6, this.secondaryColor)
100
+ ```
95
101
 
102
+ ##### During startup
103
+ This is how they can be set during startup of the app:
96
104
  ```
97
- npm run storybook
105
+ // plugins/designSystem.js
106
+ const config = {
107
+ theme: {
108
+ primary: '#0C315E',
109
+ secondary: {
110
+ base: '#0093B8',
111
+ lighten1: '#99D4E3',
112
+ lighten2: '#C2E5EE',
113
+ lighten3: '#EDF7FA'
114
+ },
115
+ }
116
+ }
98
117
  ```
118
+ ##### During runtime
119
+ ```
120
+ import colorUtil from '@vcita/design-system/utils/colorUtil.js';
99
121
 
100
- ### Ongoing development
122
+ this.$vuetify.theme.themes.light.primary = colorUtil.rgbToHex(this.primaryColor);
123
+ this.$vuetify.theme.themes.light.secondary = {
124
+ base: colorUtil.rgbToHex(this.secondaryColor),
125
+ lighten1: colorUtil.pSBC(0.6, colorUtil.rgbToHex(this.secondaryColor)),
126
+ lighten2: colorUtil.pSBC(0.76, colorUtil.rgbToHex(this.secondaryColor)),
127
+ lighten3: colorUtil.pSBC(0.93, colorUtil.rgbToHex(this.secondaryColor))
128
+ }
129
+ ```
101
130
 
102
- In many cases, you don't want to publish the package each time you make a change. In those cases it can may life much
103
- easier to install the package from your local project directory.
104
- To learn how to do this, please go [here](https://myvcita.atlassian.net/wiki/spaces/FG/pages/2021851137/Using+the+vcita+design+system+package#Installation-for-development-purposes).
131
+ ### Localization
105
132
 
106
- Note: before releasing, make sure to publish a version and use that in your project, or tracking version changes will
107
- become impossible.
133
+ There are a few components that contain localized strings.
134
+ For example, the wizard and modaql components.
135
+ By default, the texts will be presented in English, so should you need to display them in another locale, this is now you can set the locale as needed.
108
136
 
109
- ### Publishing the package to npm
137
+ Available locales:
138
+ en, de, es, fr, he, it, nl, pl, pt, ru, sl, tr
110
139
 
111
- You may first need to run
140
+ ##### During startup
112
141
 
113
142
  ```
114
- npm adduser
143
+ // plugins/designSystem.js
144
+ import DesignSystemInit from '@vcita/design-system/init/DesignSystem';
145
+ ...
146
+ const config = {...};
147
+ const locale = 'yourSelection';
148
+ export default DesignSystemInit(config, locale);
115
149
  ```
116
150
 
117
- Publishing beta version
151
+ ##### During runtime
118
152
 
153
+ In a component, such as App.vue, add this call
119
154
  ```
120
- git commit -a
121
- npm version [currentVersion]-beta.[NumOfBeta]
122
- npm run build
123
- npm publish --tag beta
155
+ // App.vue
156
+ this.$ds.setLocale(locale);
124
157
  ```
125
158
 
126
- Publishing regular version
159
+ ## Component configuration options
160
+ ### VcTextField
161
+ #### Usage of VcTextField with googleAddressAutoComplete set to 'true'
127
162
 
128
163
  ```
129
- git commit -a
130
- npm version [newVersion]
131
- npm run build
132
- npm publish
164
+ // plugins/designSystem.js
165
+ const config = {
166
+ options: {googleAppKey: 'yourGoogleAddressKey'}
167
+ };
133
168
  ```
134
169
 
135
- ### Run your unit tests
136
-
170
+ ### VcToast
171
+ #### Change VcToast default timeout
172
+ By default, the VcToast timeout is 3000ms.
173
+ You can change that for a specific instance by setting the timeout prop to your desired value.
174
+ In case you want to change that for the entire project, so any instance will use another timeout value, it can be done by calling this code
137
175
  ```
138
- npm run test:unit
176
+ // plugins/designSystem.js
177
+ const config = {
178
+ options: {toastTimeout: 5000 }
179
+ };
139
180
  ```
181
+ This will set the default timeout for all instances of VcToast in your project.
182
+ Any instance that is getting a different value in the timeout prop will keep using that value.
140
183
 
141
- ### Lints and fixes files
142
-
184
+ ## Adding external icons
185
+ The package comes with a set of icons already included, which can easily be displayed using the VcIcon component.
186
+ It is possible to extend that set by creating an object with key-value format
143
187
  ```
144
- npm run lint
188
+ export default {
189
+ yourKey1: `<svg ... /></svg>`,
190
+ yourKey2: `<svg ... /></svg>`,
191
+ }
145
192
  ```
146
193
 
147
- ### Initializing in your project
148
-
149
- To initialize the project
150
-
194
+ And passing that to the DesignSystem initialization
151
195
  ```
152
- import DesignSystem from '@vcita/design-system';
153
- import Vue from "vue";
154
-
155
- Vue.use(DesignSystem);
196
+ // plugins/designSystem.js
197
+ import extIcons from './yourFile.js';
198
+ const config = {
199
+ extIcons
200
+ };
156
201
  ```
157
-
158
- If you need to also adjust some values, such as theme or configurations, it will look something like this:
159
-
202
+ Then to use the icons
203
+ ```
204
+ <template>
205
+ <VcIcon>$yourKey1</VcIcon>
206
+ </template>
160
207
  ```
161
- import Vue from "vue";
162
- import DesignSystem from '@vcita/design-system';
163
- import DesignSystemInit from '@vcita/design-system/init/DesignSystem';
164
208
 
165
- Vue.use(DesignSystem);
209
+ ### Automation hooks
210
+ In order to facilitate automation, each design system component has a prop called dataQa.
211
+ This prop has a default value matching the component's name.
212
+ The value set in this prop will become an attribute on the component instance, which you can use in your automation code, to easily locate the component on the page.
166
213
 
167
- const config = {
168
- theme: { primary: '#123456'},
169
- options: {toastTimeout: 5000 }
170
- };
171
-
172
- export default DesignSystemInit(config);
173
- ```
214
+ To differentiate different instances, you can pass different dataQa values to different instances.
174
215
 
175
- ### Customize configuration
216
+ [//]: # (### Customize configuration)
176
217
 
177
- See [Configuration Reference](https://cli.vuejs.org/config/).
218
+ [//]: # ()
219
+ [//]: # (See [Configuration Reference]&#40;https://cli.vuejs.org/config/&#41;.)
178
220
 
179
221
 
@@ -11,7 +11,7 @@ en:
11
11
  progress_circular:
12
12
  next: 'Next:'
13
13
  listbox:
14
- add: Add new contact
14
+ add: Add new item
15
15
  empty_list: No result found
16
16
  dropzone:
17
17
  default_title: Submit