@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.
- package/README.md +162 -120
- package/config/locales/ds.en.yml +1 -1
- package/dist/@vcita/design-system.esm.js +1191 -919
- package/dist/@vcita/design-system.min.js +2 -2
- package/dist/@vcita/design-system.ssr.js +1091 -812
- package/init/DesignSystem.js +8 -2
- package/package.json +9 -8
- package/src/components/VcActionList/VcActionList.stories.js +6 -2
- package/src/components/VcActions/VcActions.stories.js +13 -11
- package/src/components/VcActions/VcActions.vue +7 -0
- package/src/components/VcAlert/VcAlert.stories.js +23 -45
- package/src/components/VcAutoComplete/VcAutoComplete.stories.js +34 -4
- package/src/components/VcAutoComplete/VcAutoComplete.vue +8 -4
- package/src/components/VcAvatar/VcAvatar.stories.js +164 -14
- package/src/components/VcAvatar/VcAvatar.vue +2 -1
- package/src/components/VcBadge/VcBadge.stories.js +46 -25
- package/src/components/VcBanner/VcBanner.stories.js +4 -0
- package/src/components/VcBottomActions/VcBottomActions.stories.js +10 -6
- package/src/components/VcBottomActions/VcBottomActions.vue +9 -2
- package/src/components/VcBottomSheet/VcBottomSheet.stories.js +18 -6
- package/src/components/VcBottomSheet/VcBottomSheet.vue +6 -0
- package/src/components/VcButton/VcButton.stories.js +114 -58
- package/src/components/VcButton/VcButton.vue +20 -5
- package/src/components/VcButton/VcButtonDocs.mdx +59 -0
- package/src/components/VcButtonGroup/VcButtonGroup.stories.js +44 -31
- package/src/components/VcCard/VcCard.stories.js +4 -0
- package/src/components/VcCheckbox/VcCheckbox.stories.js +36 -31
- package/src/components/VcChip/VcChip.stories.js +7 -3
- package/src/components/VcDocItem/VcDocItem.stories.js +11 -8
- package/src/components/VcDraggableList/VcDraggableList.stories.js +5 -0
- package/src/components/VcDropzone/VcDropzone.stories.js +5 -5
- package/src/components/VcEmptyState/VcEmptyState.stories.js +13 -2
- package/src/components/VcExpansionCard/VcExpansionCard.stories.js +6 -2
- package/src/components/VcFilterPanel/VcFilterPanel.stories.js +7 -1
- package/src/components/VcFocusArea/VcFocusArea.stories.js +6 -1
- package/src/components/VcForm/VcForm.stories.js +14 -10
- package/src/components/VcForm/VcForm.vue +1 -0
- package/src/components/VcIcon/VcIcon.stories.js +5 -1
- package/src/components/VcIconWithTooltip/VcIconWithTooltip.stories.js +5 -1
- package/src/components/VcImage/VcImage.stories.js +5 -1
- package/src/components/VcInputBottomSheet/VcInputBottomSheet.stories.js +25 -6
- package/src/components/VcInputPopover/VcInputPopover.stories.js +26 -5
- package/src/components/VcLayout/VcLayout.stories.js +4 -0
- package/src/components/VcLink/VcLink.stories.js +19 -9
- package/src/components/VcLoader/VcLoader.stories.js +13 -2
- package/src/components/VcLoader/VcLoader.vue +11 -0
- package/src/components/VcMenu/VcMenu.stories.js +24 -18
- package/src/components/VcPopover/VcPopover.stories.js +13 -2
- package/src/components/VcProgressCircular/VcProgressCircular.stories.js +12 -7
- package/src/components/VcRadio/VcRadio.stories.js +8 -7
- package/src/components/VcRadioGroup/VcRadioGroup.stories.js +31 -26
- package/src/components/VcSearchBar/VcSearchBar.stories.js +8 -4
- package/src/components/VcSearchBar/VcSearchBar.vue +5 -1
- package/src/components/VcSearchPicker/VcSearchPicker.stories.js +63 -62
- package/src/components/VcSegmentedControl/VcSegmentedControl.stories.js +4 -0
- package/src/components/VcSelectField/VcSelectField.stories.js +71 -127
- package/src/components/VcSvg/VcSvg.stories.js +4 -0
- package/src/components/VcSwitch/VcSwitch.stories.js +63 -30
- package/src/components/VcTabs/VcTabs.spec.js +140 -0
- package/src/components/VcTabs/VcTabs.stories.js +191 -0
- package/src/components/VcTabs/VcTabs.vue +136 -0
- package/src/components/VcTextArea/VcTextArea.stories.js +93 -100
- package/src/components/VcTextArea/VcTextArea.vue +3 -0
- package/src/components/VcTextField/VcTextField.stories.js +8 -15
- package/src/components/VcTimeSince/VcTimeSince.stories.js +12 -3
- package/src/components/VcToast/VcToast.stories.js +5 -1
- package/src/components/VcTooltip/VcTooltip.stories.js +77 -133
- package/src/components/VcTooltip/VcTooltip.vue +17 -15
- package/src/components/VcUpsellBlock/VcUpsellBlock.stories.js +69 -44
- package/src/components/index.js +1 -0
- package/src/components/list/VcBaseListItem/VcBaseListItem.stories.js +7 -5
- package/src/components/list/VcList/VcList.stories.js +59 -68
- package/src/components/list/VcList/VcList.vue +1 -1
- package/src/components/list/VcList/pattern/VcMobilePickerPattern.stories.js +103 -38
- package/src/components/list/VcListEntity/VcListEntity.stories.js +28 -10
- package/src/components/list/VcListEntity/VcListEntity.vue +0 -2
- package/src/components/listBox/VcChecklistItem/VcChecklistItem.spec.js +1 -1
- package/src/components/listBox/VcChecklistItem/VcChecklistItem.stories.js +34 -15
- package/src/components/listBox/VcListbox/VcListbox.spec.js +3 -3
- package/src/components/listBox/VcListbox/VcListbox.stories.js +29 -16
- package/src/components/listBox/VcListbox/VcListbox.vue +4 -0
- package/src/components/listPage/VcGroupHeader/VcGroupHeader.stories.js +10 -2
- package/src/components/listPage/VcInfiniteScroll/VcInfiniteScroll.stories.js +7 -0
- package/src/components/listPage/VcListItem/VcListItem.stories.js +13 -5
- package/src/components/modal/VcConfirmModal/VcConfirmModal.stories.js +4 -0
- package/src/components/modal/VcConfirmProminentModal/VcConfirmProminentModal.stories.js +4 -0
- package/src/components/modal/VcInputModal/VcInputModal.stories.js +4 -0
- package/src/components/modal/VcNoticeModal/VcNoticeModal.stories.js +4 -0
- package/src/components/modal/elements/VcModalContainer.stories.js +4 -0
- package/src/components/modal/elements/VcModalFooter.stories.js +4 -0
- package/src/components/modal/elements/VcModalHeader.stories.js +4 -0
- package/src/components/modal/elements/VcModalWrapper.stories.js +4 -0
- package/src/components/wizard/VcMobileWizardProgress/VcMobileWizardProgress.stories.js +20 -10
- package/src/components/wizard/VcSteperContent/VcStepperContent.stories.js +18 -11
- package/src/components/wizard/VcStepsBar/VcStepsBar.stories.js +14 -3
- package/src/components/wizard/VcWizard/VcWizard.spec.js +1 -1
- package/src/components/wizard/VcWizard/VcWizard.stories.js +29 -18
- package/src/components/wizard/VcWizard/VcWizard.vue +0 -1
- package/src/components/wizard/VcWizard/demoWizardPage.vue +11 -9
- package/src/components/wizard/VcWizardCtaContainer/VcWizardCtaContainer.spec.js +6 -6
- package/src/components/wizard/VcWizardCtaContainer/VcWizardCtaContainer.stories.js +15 -25
- package/src/components/wizard/VcWizardCtaContainer/VcWizardCtaContainer.vue +3 -3
- package/src/stories/VcBaseDocs.mdx +21 -0
- package/src/stories/assets/pics/avatar1.png +0 -0
- package/src/stories/assets/pics/avatar2.png +0 -0
- package/src/stories/assets/pics/avatar3.png +0 -0
- package/src/stories/assets/pics/avatar4.png +0 -0
- package/src/stories/changelog.stories.mdx +7 -0
- package/src/stories/readme.stories.mdx +7 -0
- package/src/stories/variables.stories.mdx +218 -0
- package/src/stories/welcome.stories.mdx +4 -124
- package/utils/colorUtil.js +1 -1
- package/CHANGELOG.MD +0 -299
- package/src/stories/assets/pics/black-widow.jpeg +0 -0
- package/src/stories/assets/pics/hulk.png +0 -0
- package/src/stories/assets/pics/ironman.png +0 -0
- package/src/stories/assets/pics/mufasa.png +0 -0
- package/src/stories/assets/pics/spider-man.png +0 -0
- package/src/stories/assets/pics/wolverine.png +0 -0
package/README.md
CHANGED
|
@@ -1,179 +1,221 @@
|
|
|
1
1
|
# design-system
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
https://vcita.github.io/design-system
|
|
3
|
+
You can find storybook [here](https://vcita.github.io/design-system)
|
|
5
4
|
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
###
|
|
12
|
+
### External Dependencies
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
###
|
|
17
|
+
### Initializing in your project
|
|
18
|
+
To initialize the project create plugins/designSystem.js
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
26
|
+
Vue.use(DesignSystem);
|
|
27
|
+
export default DesignSystemInit();
|
|
28
|
+
```
|
|
31
29
|
|
|
32
|
-
|
|
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
|
-
|
|
35
|
+
new Vue({
|
|
36
|
+
...
|
|
37
|
+
vuetify: ds,
|
|
38
|
+
...
|
|
39
|
+
render: h => h(App)
|
|
40
|
+
}).$mount("#app");
|
|
41
|
+
```
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
If you need to also adjust some values, such as theme or configurations, it will look something like this:
|
|
37
44
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
51
|
+
Vue.use(DesignSystem);
|
|
44
52
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
const config = {
|
|
54
|
+
// Your configuration choices
|
|
55
|
+
};
|
|
48
56
|
|
|
49
|
-
|
|
57
|
+
export default DesignSystemInit(config);
|
|
58
|
+
```
|
|
50
59
|
|
|
51
|
-
|
|
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
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
107
|
-
|
|
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
|
-
|
|
137
|
+
Available locales:
|
|
138
|
+
en, de, es, fr, he, it, nl, pl, pt, ru, sl, tr
|
|
110
139
|
|
|
111
|
-
|
|
140
|
+
##### During startup
|
|
112
141
|
|
|
113
142
|
```
|
|
114
|
-
|
|
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
|
-
|
|
151
|
+
##### During runtime
|
|
118
152
|
|
|
153
|
+
In a component, such as App.vue, add this call
|
|
119
154
|
```
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
npm run build
|
|
123
|
-
npm publish --tag beta
|
|
155
|
+
// App.vue
|
|
156
|
+
this.$ds.setLocale(locale);
|
|
124
157
|
```
|
|
125
158
|
|
|
126
|
-
|
|
159
|
+
## Component configuration options
|
|
160
|
+
### VcTextField
|
|
161
|
+
#### Usage of VcTextField with googleAddressAutoComplete set to 'true'
|
|
127
162
|
|
|
128
163
|
```
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
164
|
+
// plugins/designSystem.js
|
|
165
|
+
const config = {
|
|
166
|
+
options: {googleAppKey: 'yourGoogleAddressKey'}
|
|
167
|
+
};
|
|
133
168
|
```
|
|
134
169
|
|
|
135
|
-
###
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
188
|
+
export default {
|
|
189
|
+
yourKey1: `<svg ... /></svg>`,
|
|
190
|
+
yourKey2: `<svg ... /></svg>`,
|
|
191
|
+
}
|
|
145
192
|
```
|
|
146
193
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
To initialize the project
|
|
150
|
-
|
|
194
|
+
And passing that to the DesignSystem initialization
|
|
151
195
|
```
|
|
152
|
-
|
|
153
|
-
import
|
|
154
|
-
|
|
155
|
-
|
|
196
|
+
// plugins/designSystem.js
|
|
197
|
+
import extIcons from './yourFile.js';
|
|
198
|
+
const config = {
|
|
199
|
+
extIcons
|
|
200
|
+
};
|
|
156
201
|
```
|
|
157
|
-
|
|
158
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
218
|
+
[//]: # ()
|
|
219
|
+
[//]: # (See [Configuration Reference](https://cli.vuejs.org/config/).)
|
|
178
220
|
|
|
179
221
|
|