@mozaic-ds/vue 1.0.0-beta.3 → 1.0.0-beta.5
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/LICENSE +51 -0
- package/README.md +224 -82
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +1202 -0
- package/dist/mozaic-vue.js +1220 -0
- package/dist/mozaic-vue.js.map +1 -0
- package/dist/mozaic-vue.umd.cjs +2 -0
- package/dist/mozaic-vue.umd.cjs.map +1 -0
- package/env.d.ts +1 -0
- package/package.json +81 -50
- package/src/components/Contributing.mdx +118 -0
- package/src/components/GettingStarted.mdx +50 -0
- package/src/components/Introduction.mdx +54 -0
- package/src/components/Support.mdx +18 -0
- package/src/components/badge/MBadge.spec.ts +16 -0
- package/src/components/badge/MBadge.stories.ts +50 -0
- package/src/components/badge/MBadge.vue +36 -34
- package/src/components/breadcrumb/MBreadcrumb.spec.ts +105 -0
- package/src/components/breadcrumb/MBreadcrumb.stories.ts +57 -0
- package/src/components/breadcrumb/MBreadcrumb.vue +52 -55
- package/src/components/button/MButton.spec.ts +191 -0
- package/src/components/button/MButton.stories.ts +66 -0
- package/src/components/button/MButton.vue +98 -154
- package/src/components/checkbox/MCheckbox.spec.ts +104 -0
- package/src/components/checkbox/MCheckbox.stories.ts +83 -0
- package/src/components/checkbox/MCheckbox.vue +60 -101
- package/src/components/checkboxgroup/MCheckboxGroup.spec.ts +78 -0
- package/src/components/checkboxgroup/MCheckboxGroup.stories.ts +61 -0
- package/src/components/checkboxgroup/MCheckboxGroup.vue +97 -0
- package/src/components/field/MField.spec.ts +166 -0
- package/src/components/field/MField.stories.ts +376 -0
- package/src/components/field/MField.vue +78 -61
- package/src/components/fieldgroup/MFieldGroup.spec.ts +165 -0
- package/src/components/fieldgroup/MFieldGroup.stories.ts +423 -0
- package/src/components/fieldgroup/MFieldGroup.vue +79 -0
- package/src/components/iconbutton/MIconButton.spec.ts +108 -0
- package/src/components/iconbutton/MIconButton.stories.ts +66 -0
- package/src/components/iconbutton/MIconButton.vue +73 -0
- package/src/components/link/MLink.spec.ts +154 -0
- package/src/components/link/MLink.stories.ts +98 -0
- package/src/components/link/MLink.vue +86 -109
- package/src/components/loader/MLoader.spec.ts +104 -0
- package/src/components/loader/MLoader.stories.ts +45 -0
- package/src/components/loader/MLoader.vue +65 -55
- package/src/components/overlay/MOverlay.spec.ts +51 -0
- package/src/components/overlay/MOverlay.stories.ts +40 -0
- package/src/components/overlay/MOverlay.vue +27 -19
- package/src/components/passwordinput/MPasswordInput.spec.ts +104 -0
- package/src/components/passwordinput/MPasswordInput.stories.ts +75 -0
- package/src/components/passwordinput/MPasswordInput.vue +129 -76
- package/src/components/quantityselector/MQuantitySelector.spec.ts +262 -0
- package/src/components/quantityselector/MQuantitySelector.stories.ts +89 -0
- package/src/components/quantityselector/MQuantitySelector.vue +160 -136
- package/src/components/radio/MRadio.spec.ts +104 -0
- package/src/components/radio/MRadio.stories.ts +68 -0
- package/src/components/radio/MRadio.vue +56 -39
- package/src/components/radiogroup/MRadioGroup.spec.ts +54 -0
- package/src/components/radiogroup/MRadioGroup.stories.ts +61 -0
- package/src/components/radiogroup/MRadioGroup.vue +79 -0
- package/src/components/select/MSelect.spec.ts +114 -0
- package/src/components/select/MSelect.stories.ts +101 -0
- package/src/components/select/MSelect.vue +77 -119
- package/src/components/statusbadge/MStatusBadge.stories.ts +45 -0
- package/src/components/statusbadge/MStatusBadge.vue +40 -0
- package/src/components/statusbadge/MstatusBadge.spec.ts +16 -0
- package/src/components/statusdot/MStatusDot.spec.ts +51 -0
- package/src/components/statusdot/MStatusDot.stories.ts +48 -0
- package/src/components/statusdot/MStatusDot.vue +36 -0
- package/src/components/statusnotification/MStatusNotification.spec.ts +99 -0
- package/src/components/statusnotification/MStatusNotification.stories.ts +96 -0
- package/src/components/statusnotification/MStatusNotification.vue +106 -0
- package/src/components/textarea/MTextArea.spec.ts +112 -0
- package/src/components/textarea/MTextArea.stories.ts +67 -0
- package/src/components/textarea/MTextArea.vue +81 -42
- package/src/components/textinput/MTextInput.spec.ts +121 -0
- package/src/components/textinput/MTextInput.stories.ts +114 -0
- package/src/components/textinput/MTextInput.vue +127 -47
- package/src/components/toggle/MToggle.spec.ts +99 -0
- package/src/components/toggle/MToggle.stories.ts +68 -0
- package/src/components/toggle/MToggle.vue +63 -103
- package/src/components/togglegroup/MToggleGroup.spec.ts +78 -0
- package/src/components/togglegroup/MToggleGroup.stories.ts +61 -0
- package/src/components/togglegroup/MToggleGroup.vue +97 -0
- package/src/components/usingIcons.mdx +43 -0
- package/src/components/usingPresets.mdx +125 -0
- package/src/main.ts +47 -0
- package/dist/demo.html +0 -1
- package/dist/mozaic-vue.adeo.css +0 -45
- package/dist/mozaic-vue.adeo.umd.js +0 -41775
- package/dist/mozaic-vue.common.js +0 -41765
- package/dist/mozaic-vue.common.js.map +0 -1
- package/dist/mozaic-vue.umd.js +0 -41776
- package/dist/mozaic-vue.umd.js.map +0 -1
- package/dist/mozaic-vue.umd.min.js +0 -4
- package/dist/mozaic-vue.umd.min.js.map +0 -1
- package/postinstall.js +0 -3
- package/src/components/accordion/MAccordion.vue +0 -128
- package/src/components/accordion/index.js +0 -7
- package/src/components/autocomplete/MAutocomplete.vue +0 -198
- package/src/components/autocomplete/index.js +0 -7
- package/src/components/badge/index.js +0 -7
- package/src/components/breadcrumb/index.js +0 -7
- package/src/components/button/index.js +0 -7
- package/src/components/card/MCard.vue +0 -78
- package/src/components/card/index.js +0 -7
- package/src/components/checkbox/MCheckboxGroup.vue +0 -155
- package/src/components/checkbox/index.js +0 -12
- package/src/components/container/MContainer.vue +0 -33
- package/src/components/container/index.js +0 -7
- package/src/components/datatable/MDataTable.vue +0 -651
- package/src/components/datatable/MDataTableHeader.vue +0 -55
- package/src/components/datatable/MDataTableTop.vue +0 -35
- package/src/components/datatable/helpers.js +0 -132
- package/src/components/datatable/index.js +0 -12
- package/src/components/field/index.js +0 -7
- package/src/components/fileuploader/MFileResult.vue +0 -149
- package/src/components/fileuploader/MFileUploader.vue +0 -142
- package/src/components/fileuploader/index.js +0 -7
- package/src/components/flag/MFlag.vue +0 -46
- package/src/components/flag/index.js +0 -7
- package/src/components/heading/MHeading.vue +0 -75
- package/src/components/heading/index.js +0 -7
- package/src/components/hero/MHero.vue +0 -93
- package/src/components/hero/index.js +0 -7
- package/src/components/icon/MIcon.vue +0 -120
- package/src/components/icon/index.js +0 -7
- package/src/components/index.js +0 -43
- package/src/components/layer/MLayer.vue +0 -208
- package/src/components/layer/index.js +0 -7
- package/src/components/link/index.js +0 -7
- package/src/components/listbox/MListBox.vue +0 -106
- package/src/components/listbox/index.js +0 -7
- package/src/components/loader/index.js +0 -7
- package/src/components/modal/MModal.vue +0 -179
- package/src/components/modal/index.js +0 -7
- package/src/components/notification/MNotification.vue +0 -110
- package/src/components/notification/index.js +0 -7
- package/src/components/optionbutton/MOptionButton.vue +0 -67
- package/src/components/optionbutton/index.js +0 -7
- package/src/components/optioncard/MOptionCard.vue +0 -132
- package/src/components/optioncard/index.js +0 -7
- package/src/components/optiongroup/MOptionGroup.vue +0 -18
- package/src/components/optiongroup/index.js +0 -7
- package/src/components/overlay/MOverlayLoader.vue +0 -43
- package/src/components/overlay/index.js +0 -12
- package/src/components/pagination/MPagination.vue +0 -162
- package/src/components/pagination/index.js +0 -7
- package/src/components/passwordinput/index.js +0 -7
- package/src/components/phonenumber/MPhoneNumber.vue +0 -390
- package/src/components/phonenumber/index.js +0 -7
- package/src/components/progressbar/MProgress.vue +0 -102
- package/src/components/progressbar/index.js +0 -7
- package/src/components/quantityselector/index.js +0 -7
- package/src/components/radio/MRadioGroup.vue +0 -111
- package/src/components/radio/index.js +0 -12
- package/src/components/ratingstars/MStarsInput.vue +0 -118
- package/src/components/ratingstars/MStarsResult.vue +0 -89
- package/src/components/ratingstars/index.js +0 -12
- package/src/components/select/index.js +0 -7
- package/src/components/stepper/MStepper.vue +0 -70
- package/src/components/stepper/index.js +0 -7
- package/src/components/tabs/MTab.vue +0 -184
- package/src/components/tabs/index.js +0 -7
- package/src/components/tags/MTag.vue +0 -173
- package/src/components/tags/index.js +0 -7
- package/src/components/textarea/index.js +0 -7
- package/src/components/textinput/MTextInputField.vue +0 -105
- package/src/components/textinput/MTextInputIcon.vue +0 -42
- package/src/components/textinput/index.js +0 -7
- package/src/components/toggle/index.js +0 -7
- package/src/components/tooltip/MTooltip.vue +0 -42
- package/src/components/tooltip/index.js +0 -7
- package/src/index.js +0 -62
- package/src/shims-tsx.d.ts +0 -13
- package/src/shims.vue.d.ts +0 -4
- package/src/tokens/adeo/android/colors.xml +0 -391
- package/src/tokens/adeo/android/font_dimens.xml +0 -18
- package/src/tokens/adeo/css/_variables.scss +0 -385
- package/src/tokens/adeo/css/root.scss +0 -387
- package/src/tokens/adeo/ios/StyleDictionaryColor.h +0 -399
- package/src/tokens/adeo/ios/StyleDictionaryColor.m +0 -411
- package/src/tokens/adeo/ios/StyleDictionaryColor.swift +0 -394
- package/src/tokens/adeo/ios/StyleDictionarySize.h +0 -69
- package/src/tokens/adeo/ios/StyleDictionarySize.m +0 -70
- package/src/tokens/adeo/ios/StyleDictionarySize.swift +0 -71
- package/src/tokens/adeo/js/tokens.js +0 -483
- package/src/tokens/adeo/js/tokensObject.js +0 -10354
- package/src/tokens/adeo/scss/_tokens.scss +0 -1300
- package/src/utils/mozaicClasses.js +0 -16
- package/src/utils/theme.validator.js +0 -19
- package/types/index.d.ts +0 -100
package/package.json
CHANGED
|
@@ -1,73 +1,104 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mozaic-ds/vue",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Mozaic-Vue is the Vue.js implementation of ADEO Design system",
|
|
6
|
+
"author": "ADEO - ADEO Design system",
|
|
7
|
+
"main": "./dist/mozaic-vue.umd.cjs",
|
|
8
|
+
"module": "./dist/mozaic-vue.js",
|
|
9
|
+
"types": "./dist/mozaic-vue.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/mozaic-vue.d.ts",
|
|
13
|
+
"import": "./dist/mozaic-vue.js",
|
|
14
|
+
"require": "./dist/mozaic-vue.umd.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./style.css": "./dist/mozaic-vue.css"
|
|
17
|
+
},
|
|
6
18
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"lint": "
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
19
|
+
"start": "npm-run-all --parallel dev storybook",
|
|
20
|
+
"dev": "vite --mode development",
|
|
21
|
+
"lint": "eslint . --fix",
|
|
22
|
+
"test:unit": "vitest",
|
|
23
|
+
"format": "prettier --write src/",
|
|
24
|
+
"build": "vite build",
|
|
25
|
+
"storybook": "storybook dev -p 6006",
|
|
26
|
+
"storybook:build": "npm run build-storybook",
|
|
27
|
+
"storybook:deploy": "storybook-to-ghpages",
|
|
28
|
+
"prepare": "node .husky/install.mjs",
|
|
29
|
+
"build-storybook": "storybook build",
|
|
30
|
+
"release": "release-it",
|
|
31
|
+
"release:beta": "release-it --preRelease=beta",
|
|
32
|
+
"prepublishOnly": "npm run build",
|
|
33
|
+
"npm:publish": "npm publish --access public",
|
|
34
|
+
"npm:publish:beta": "npm publish --access public --tag beta"
|
|
16
35
|
},
|
|
17
|
-
"main": "./dist/mozaic-vue.umd.min.js",
|
|
18
36
|
"files": [
|
|
19
37
|
"dist/*",
|
|
20
38
|
"src/*",
|
|
21
39
|
"types/*",
|
|
22
|
-
"*.d.ts"
|
|
23
|
-
"postinstall.js"
|
|
40
|
+
"*.d.ts"
|
|
24
41
|
],
|
|
25
42
|
"dependencies": {
|
|
26
|
-
"@mozaic-ds/
|
|
27
|
-
"@mozaic-ds/
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"core-js": "^3.18.3",
|
|
31
|
-
"libphonenumber-js": "1.9.50",
|
|
32
|
-
"postcss-scss": "^4.0.1",
|
|
33
|
-
"vue": "^2.6.14",
|
|
34
|
-
"vue-country-flag": "2.3.2"
|
|
43
|
+
"@mozaic-ds/styles": "2.0.0-alpha.2",
|
|
44
|
+
"@mozaic-ds/web-fonts": "1.65.0",
|
|
45
|
+
"postcss-scss": "^4.0.9",
|
|
46
|
+
"vue": "^3.5.13"
|
|
35
47
|
},
|
|
36
48
|
"devDependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
49
|
+
"@commitlint/cli": "^19.8.0",
|
|
50
|
+
"@commitlint/config-conventional": "^19.8.0",
|
|
51
|
+
"@mozaic-ds/css-dev-tools": "1.75.0",
|
|
52
|
+
"@mozaic-ds/icons-vue": "^0.0.1-beta.0",
|
|
53
|
+
"@release-it/conventional-changelog": "^8.0.2",
|
|
54
|
+
"@storybook/addon-a11y": "^8.6.7",
|
|
55
|
+
"@storybook/addon-essentials": "^8.6.7",
|
|
56
|
+
"@storybook/addon-themes": "^8.6.7",
|
|
57
|
+
"@storybook/manager-api": "^8.4.7",
|
|
58
|
+
"@storybook/theming": "^8.4.7",
|
|
59
|
+
"@storybook/vue3": "^8.4.6",
|
|
60
|
+
"@storybook/vue3-vite": "^8.6.7",
|
|
61
|
+
"@types/jsdom": "^21.1.7",
|
|
62
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
63
|
+
"@vitest/coverage-v8": "^3.0.9",
|
|
64
|
+
"@vitest/eslint-plugin": "^1.1.38",
|
|
65
|
+
"@vue/eslint-config-prettier": "^10.2.0",
|
|
66
|
+
"@vue/eslint-config-typescript": "^14.5.0",
|
|
67
|
+
"@vue/test-utils": "^2.4.6",
|
|
68
|
+
"all-contributors-cli": "^6.26.1",
|
|
69
|
+
"eslint": "^9.22.0",
|
|
70
|
+
"eslint-plugin-vue": "^10.0.0",
|
|
71
|
+
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
72
|
+
"husky": "^9.1.7",
|
|
73
|
+
"jsdom": "^26.0.0",
|
|
74
|
+
"lint-staged": "^15.5.0",
|
|
75
|
+
"mdx-mermaid": "^2.0.3",
|
|
76
|
+
"mermaid": "^11.5.0",
|
|
77
|
+
"npm-run-all": "^4.1.5",
|
|
78
|
+
"prettier": "^3.5.3",
|
|
79
|
+
"release-it": "^18.1.2",
|
|
80
|
+
"sass": "^1.86.0",
|
|
81
|
+
"storybook": "^8.6.7",
|
|
82
|
+
"typescript": "^5.7.2",
|
|
83
|
+
"vite": "^6.2.2",
|
|
84
|
+
"vite-plugin-dts": "^4.5.3",
|
|
85
|
+
"vitest": "^3.0.9",
|
|
86
|
+
"vue-eslint-parser": "^10.1.1"
|
|
53
87
|
},
|
|
54
88
|
"bugs": {
|
|
55
89
|
"url": "https://github.com/adeo/mozaic-vue/issues"
|
|
56
90
|
},
|
|
57
91
|
"homepage": "https://github.com/adeo/mozaic-vue#readme",
|
|
58
92
|
"keywords": [
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"scss",
|
|
65
|
-
"adeo"
|
|
93
|
+
"Adeo",
|
|
94
|
+
"Adeo Design system",
|
|
95
|
+
"Design System",
|
|
96
|
+
"Vue",
|
|
97
|
+
"Mozaic"
|
|
66
98
|
],
|
|
67
|
-
"license": "
|
|
99
|
+
"license": "Apache-2.0",
|
|
68
100
|
"repository": {
|
|
69
101
|
"type": "git",
|
|
70
102
|
"url": "git+https://github.com/adeo/mozaic-vue.git"
|
|
71
|
-
}
|
|
72
|
-
"types": "./types/index.d.ts"
|
|
103
|
+
}
|
|
73
104
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
|
+
import { Mermaid } from 'mdx-mermaid/Mermaid';
|
|
3
|
+
|
|
4
|
+
<Meta title="Contributing" />
|
|
5
|
+
|
|
6
|
+
# Be part of something bigger!
|
|
7
|
+
|
|
8
|
+
**Mozaic-Vue** is made possible by an incredible community that finds issues and creates pull requests.<br/>
|
|
9
|
+
It is our job to enable you to create amazing applications.
|
|
10
|
+
|
|
11
|
+
Most of the time, you find something that can be made better. You could find a bug, or you have an idea for additional functionality.<br/>
|
|
12
|
+
That's great! It's as easy as cloning the [Mozaic-Vue repository](https://github.com/adeo/mozaic-vue) to get started working in the development environment.
|
|
13
|
+
|
|
14
|
+
Hopefully this document makes the process for contributing clear and answers some questions that you may have.<br/>
|
|
15
|
+
If you have any questions, please reach out to us on our [slack channel](https://adeo-tech-community.slack.com/archives/CN4K3A99R).
|
|
16
|
+
|
|
17
|
+
## Contribution model
|
|
18
|
+
|
|
19
|
+
The contribution process can be summarized as follows:
|
|
20
|
+
|
|
21
|
+
<Mermaid
|
|
22
|
+
chart={`flowchart TD;
|
|
23
|
+
A((I have a need <br/>fix or new feature));
|
|
24
|
+
A --> B{An issue already exists?};
|
|
25
|
+
B --> |YES| I;
|
|
26
|
+
I([The issue corresponds to my needs <br/>or I complete it]);
|
|
27
|
+
I --> D;
|
|
28
|
+
B --> |NO| C;
|
|
29
|
+
C([I create an issue <br/>]);
|
|
30
|
+
C --> D;
|
|
31
|
+
D{I can contribute?};
|
|
32
|
+
D --> |YES| E;
|
|
33
|
+
D --> |NO| J;
|
|
34
|
+
E([I clone the repo <br/>& create a PR associated to the issue]);
|
|
35
|
+
E --> F;
|
|
36
|
+
F([The PR is ready <br/>and I assign it to reviewers]);
|
|
37
|
+
F --> G;
|
|
38
|
+
G{The proofreading is OK <br/>and the PR is validated?};
|
|
39
|
+
G --> |YES| H;
|
|
40
|
+
G --> |NO| K;
|
|
41
|
+
H([The PR is merged and will be released soon]);
|
|
42
|
+
H;
|
|
43
|
+
J([In this case, I wait for the issue <br/>to be traited and delivered.]);
|
|
44
|
+
K([I make the requested changes]);
|
|
45
|
+
K --> F;
|
|
46
|
+
click B "https://github.com/adeo/mozaic-vue/issues" _blank;
|
|
47
|
+
click C "https://github.com/adeo/mozaic-vue/issues/new/choose" _blank;
|
|
48
|
+
`}
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
You can now discover the details of each of these steps below.
|
|
52
|
+
|
|
53
|
+
## Reporting issues
|
|
54
|
+
|
|
55
|
+
### Where to find known issues
|
|
56
|
+
|
|
57
|
+
We are using [GitHub Issues](https://github.com/adeo/mozaic-vue/issues) for our bugs.<br/>
|
|
58
|
+
We keep a close eye on this and try to make it clear when we have an internal fix in progress.<br/>
|
|
59
|
+
|
|
60
|
+
**Before filing a new task, try to make sure your problem doesn't already exist.**
|
|
61
|
+
|
|
62
|
+
### Reporting new issue
|
|
63
|
+
|
|
64
|
+
The best way to get your bug fixed is to provide a reduced test case.
|
|
65
|
+
|
|
66
|
+
Once you've gathered all information, please fill out an issue [here](https://github.com/adeo/mozaic-vue/issues/new/choose).
|
|
67
|
+
|
|
68
|
+
## Proposing a change
|
|
69
|
+
|
|
70
|
+
If you intend to add a new component, or make any non-trivial changes, we recommend filing an issue.
|
|
71
|
+
|
|
72
|
+
This will lets us prepare an agreement on your proposal before you put significant effort into it.
|
|
73
|
+
|
|
74
|
+
If you’re only fixing a bug, it should be fine to submit a pull request but we still recommend to submit an issue detailing what you’re looking to fix.
|
|
75
|
+
|
|
76
|
+
## Setup Dev Environment
|
|
77
|
+
|
|
78
|
+
### Project setup
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
// Clone mozaic-vue repo
|
|
82
|
+
git clone git@github.com:adeo/mozaic-vue.git
|
|
83
|
+
|
|
84
|
+
// Go to the cloned directory
|
|
85
|
+
cd mozaic-vue
|
|
86
|
+
|
|
87
|
+
// Checkout the branch you are working on
|
|
88
|
+
git checkout <branch name>
|
|
89
|
+
|
|
90
|
+
// Install dependencies
|
|
91
|
+
npm install
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Submitting Changes/ Pull Requests
|
|
95
|
+
|
|
96
|
+
Working on your first Pull Request? You can learn how from this video series:
|
|
97
|
+
[How to contribute to an open source project on Github](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github).
|
|
98
|
+
|
|
99
|
+
Mozaic's team is keeping an eye on pull requests. We will check your pull request, either merge it, request changes or close it with explanation.
|
|
100
|
+
|
|
101
|
+
Before submitting please make sure to run:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
// Pull down the latest
|
|
105
|
+
$ git pull origin master
|
|
106
|
+
|
|
107
|
+
// Create your working branch
|
|
108
|
+
$ git branch - b type-id-description
|
|
109
|
+
|
|
110
|
+
// Resolve bugs or implement new pattern
|
|
111
|
+
// Add Tests and documentation
|
|
112
|
+
|
|
113
|
+
// Run linter
|
|
114
|
+
$ npm run lint
|
|
115
|
+
|
|
116
|
+
// Run formatter
|
|
117
|
+
$ npm run format
|
|
118
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
|
+
import { Source } from '@storybook/addon-docs';
|
|
3
|
+
|
|
4
|
+
<Meta title="Getting Started" />
|
|
5
|
+
|
|
6
|
+
# Getting Started
|
|
7
|
+
|
|
8
|
+
**Mozaic-Vue** is the [Vue.js](https://vuejs.org/) implementation of ADEO Design system.
|
|
9
|
+
|
|
10
|
+
## 📦 Installation
|
|
11
|
+
|
|
12
|
+
In order to use **Mozaic-Vue** in your **Vue.js** project, you must first install the [npm package](https://www.npmjs.com/package/@mozaic-ds/vue):
|
|
13
|
+
|
|
14
|
+
<Source
|
|
15
|
+
language="bash"
|
|
16
|
+
dark
|
|
17
|
+
code="npm i @mozaic-ds/vue@beta"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
Or with **Yarn**:
|
|
21
|
+
|
|
22
|
+
<Source language="bash" dark code="yarn add @mozaic-ds/vue@beta" />
|
|
23
|
+
|
|
24
|
+
## 📝 Usage
|
|
25
|
+
|
|
26
|
+
Import the styles
|
|
27
|
+
|
|
28
|
+
<Source
|
|
29
|
+
language='typescript'
|
|
30
|
+
dark
|
|
31
|
+
code={`
|
|
32
|
+
// main.ts
|
|
33
|
+
|
|
34
|
+
import '@mozaic-ds/vue/style.css';
|
|
35
|
+
`} />
|
|
36
|
+
|
|
37
|
+
To import and use a component, you can proceed as follows:
|
|
38
|
+
|
|
39
|
+
<Source
|
|
40
|
+
language='html'
|
|
41
|
+
dark
|
|
42
|
+
code={`
|
|
43
|
+
<script setup>
|
|
44
|
+
import { MButton } from '@mozaic-ds/vue';
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<MButton label="This is a Mozaic Button" />
|
|
49
|
+
</template>
|
|
50
|
+
`} />
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
|
+
import { Source } from '@storybook/addon-docs';
|
|
3
|
+
import logo from '../../.storybook/assets/logo.svg';
|
|
4
|
+
|
|
5
|
+
<Meta title="Introduction" />
|
|
6
|
+
|
|
7
|
+
<h1>
|
|
8
|
+
<img
|
|
9
|
+
src={logo}
|
|
10
|
+
alt="Mozaic-Vue logo"
|
|
11
|
+
style={{ height: '48px', marginRight: '8px', verticalAlign: 'middle' }}
|
|
12
|
+
/>
|
|
13
|
+
<span style={{ fontSize: '32px' }}>Vue.js library</span>
|
|
14
|
+
</h1>
|
|
15
|
+
|
|
16
|
+
This project contains **Vue.js** components that implements the **ADEO Design system** guidelines.
|
|
17
|
+
|
|
18
|
+
## 🪄 Introduction
|
|
19
|
+
|
|
20
|
+
ADEO Design system is a global and collaborative design system
|
|
21
|
+
that facilitates the designer and developer experience,
|
|
22
|
+
enabling them to create universal interfaces
|
|
23
|
+
perfectly aligned with the business strategy of Adeo.
|
|
24
|
+
|
|
25
|
+
## 🎨 Getting Started
|
|
26
|
+
|
|
27
|
+
Ready to begin using Mozaic in your project?\
|
|
28
|
+
Our Getting Started guide will walk you through the basics, \
|
|
29
|
+
from setting up the system to implementing core components in your application.
|
|
30
|
+
|
|
31
|
+
Whether you're new to Mozaic or just need a refresher, \
|
|
32
|
+
this guide has everything you need to hit the ground running.
|
|
33
|
+
|
|
34
|
+
Read how to **[Setup your application](/docs/getting-started--docs)**!
|
|
35
|
+
|
|
36
|
+
## 🤝 Contributing
|
|
37
|
+
|
|
38
|
+
Be part of something bigger!
|
|
39
|
+
|
|
40
|
+
**Mozaic-Vue** is made possible by an incredible community that finds issues and creates pull requests.\
|
|
41
|
+
It is our job to enable you to create amazing applications.
|
|
42
|
+
|
|
43
|
+
To do so, see our **[contributing process](/docs/contributing--docs)**.
|
|
44
|
+
|
|
45
|
+
## ℹ️ Support
|
|
46
|
+
|
|
47
|
+
If you have any questions or need assistance,\
|
|
48
|
+
we are here to help.
|
|
49
|
+
|
|
50
|
+
Whether you're troubleshooting, looking for documentation,\
|
|
51
|
+
or need to get in touch with our team,\
|
|
52
|
+
you'll find all the resources you need to get the most out of **Mozaic-Vue**.
|
|
53
|
+
|
|
54
|
+
Visit our **[Support page](/docs/support--docs)** for more information.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title="Support" />
|
|
4
|
+
|
|
5
|
+
# Support
|
|
6
|
+
|
|
7
|
+
Need help?
|
|
8
|
+
|
|
9
|
+
Any feedback, ideas or questions?
|
|
10
|
+
|
|
11
|
+
The **Mozaic Design System team** would welcome any feedback, ideas, or requirements that you have.<br/>
|
|
12
|
+
Our goal is to make your lives easier.
|
|
13
|
+
|
|
14
|
+
If you want to get more detailed information on the components or any other topic related to **Mozaic-Vue**, you can contact us through the channels below:
|
|
15
|
+
|
|
16
|
+
- Join the [#mozaic-vue](https://app.slack.com/client/T4R6RCZFA/CN4K3A99R/) channel on **Slack**
|
|
17
|
+
- Join the [#mozaic-support](https://app.slack.com/client/T4R6RCZFA/CKQJZL7C4/) channel on **Slack**
|
|
18
|
+
- Join our [Workplace group](https://adeo.workplace.com/groups/427492661454646/)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { mount } from '@vue/test-utils';
|
|
4
|
+
import MBadge from './MBadge.vue';
|
|
5
|
+
|
|
6
|
+
describe('MBadge component', () => {
|
|
7
|
+
it('renders properly', () => {
|
|
8
|
+
const wrapper = mount(MBadge, {
|
|
9
|
+
props: {
|
|
10
|
+
label: 99,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
expect(wrapper.text()).toContain('99');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
+
import MBadge from './MBadge.vue';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof MBadge> = {
|
|
5
|
+
title: 'Indicators/Badge (number)',
|
|
6
|
+
component: MBadge,
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component:
|
|
11
|
+
'A Badge represents a numeric count, often used to indicate notifications, updates, or items requiring attention. Its distinct appearance makes it easy to spot changes at a glance, ensuring users stay informed without breaking their workflow. Badges are commonly attached to icons, buttons, or tabs to provide contextual awareness.',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
args: { label: 99 },
|
|
16
|
+
render: (args) => ({
|
|
17
|
+
components: { MBadge },
|
|
18
|
+
setup() {
|
|
19
|
+
return { args };
|
|
20
|
+
},
|
|
21
|
+
template: `
|
|
22
|
+
<MBadge v-bind="args"></MBadge>
|
|
23
|
+
`,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof MBadge>;
|
|
28
|
+
|
|
29
|
+
export const Standard: Story = {};
|
|
30
|
+
|
|
31
|
+
export const Accent: Story = {
|
|
32
|
+
args: { appearance: 'accent' },
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Danger: Story = {
|
|
36
|
+
args: { appearance: 'danger' },
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Inverse: Story = {
|
|
40
|
+
parameters: {
|
|
41
|
+
backgrounds: {
|
|
42
|
+
default: 'Inverse',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
args: { appearance: 'inverse' },
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const Size: Story = {
|
|
49
|
+
args: { size: 'm' },
|
|
50
|
+
};
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
</
|
|
2
|
+
<span class="mc-badge" :class="classObject">
|
|
3
|
+
{{ label }}
|
|
4
|
+
</span>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
|
-
<script>
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { computed } from 'vue';
|
|
9
|
+
/**
|
|
10
|
+
* A badge indicates the status of an entity and can evolve at any time.
|
|
11
|
+
*/
|
|
12
|
+
const props = withDefaults(
|
|
13
|
+
defineProps<{
|
|
14
|
+
/**
|
|
15
|
+
* Content of the badge
|
|
16
|
+
*/
|
|
17
|
+
label: number;
|
|
18
|
+
/**
|
|
19
|
+
* Allows to define the Badge style
|
|
20
|
+
*/
|
|
21
|
+
appearance?: 'danger' | 'accent' | 'inverse' | 'standard';
|
|
10
22
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
htmlTag: {
|
|
21
|
-
type: String,
|
|
22
|
-
default: 'span',
|
|
23
|
-
},
|
|
23
|
+
/**
|
|
24
|
+
* Allows to define the Badge size
|
|
25
|
+
*/
|
|
26
|
+
size?: 's' | 'm';
|
|
27
|
+
}>(),
|
|
28
|
+
{
|
|
29
|
+
appearance: 'standard',
|
|
30
|
+
size: 's',
|
|
24
31
|
},
|
|
32
|
+
);
|
|
25
33
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return classes;
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
};
|
|
34
|
+
const classObject = computed(() => {
|
|
35
|
+
return {
|
|
36
|
+
[`mc-badge--${props.appearance}`]:
|
|
37
|
+
props.appearance && props.appearance != 'standard',
|
|
38
|
+
[`mc-badge--${props.size}`]: props.size && props.size != 's',
|
|
39
|
+
};
|
|
40
|
+
});
|
|
38
41
|
</script>
|
|
39
42
|
|
|
40
|
-
<style lang="scss">
|
|
41
|
-
@
|
|
42
|
-
@import 'components/_c.badge';
|
|
43
|
+
<style lang="scss" scoped>
|
|
44
|
+
@use '@mozaic-ds/styles/components/badge';
|
|
43
45
|
</style>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import MBreadcrumb from './MBreadcrumb.vue';
|
|
4
|
+
|
|
5
|
+
const MLinkStub = {
|
|
6
|
+
template: '<a><slot /></a>',
|
|
7
|
+
props: ['href', 'appearance', 'inline', 'router', 'class', 'ariaCurrent'],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
describe('MBreadcrumb', () => {
|
|
11
|
+
const defaultLinks = [
|
|
12
|
+
{ label: 'Home', href: '/' },
|
|
13
|
+
{ label: 'Products', href: '/products' },
|
|
14
|
+
{ label: 'Electronics', href: '/products/electronics' },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
it('renders all breadcrumb links', () => {
|
|
18
|
+
const wrapper = mount(MBreadcrumb, {
|
|
19
|
+
props: {
|
|
20
|
+
links: defaultLinks,
|
|
21
|
+
},
|
|
22
|
+
global: {
|
|
23
|
+
components: { MLink: MLinkStub },
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const items = wrapper.findAll('.mc-breadcrumb__item');
|
|
28
|
+
expect(items).toHaveLength(defaultLinks.length);
|
|
29
|
+
defaultLinks.forEach((link, index) => {
|
|
30
|
+
expect(items[index].text()).toContain(link.label);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('adds mc-breadcrumb__current class to the last link', () => {
|
|
35
|
+
const wrapper = mount(MBreadcrumb, {
|
|
36
|
+
props: {
|
|
37
|
+
links: defaultLinks,
|
|
38
|
+
},
|
|
39
|
+
global: {
|
|
40
|
+
components: { MLink: MLinkStub },
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const lastLink = wrapper.findAllComponents(MLinkStub).at(-1);
|
|
45
|
+
expect(lastLink?.classes()).toContain('mc-breadcrumb__current');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('sets aria-current="page" on the last link', () => {
|
|
49
|
+
const wrapper = mount(MBreadcrumb, {
|
|
50
|
+
props: {
|
|
51
|
+
links: defaultLinks,
|
|
52
|
+
},
|
|
53
|
+
global: {
|
|
54
|
+
components: { MLink: MLinkStub },
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const lastLink = wrapper.findAllComponents(MLinkStub).at(-1);
|
|
59
|
+
expect(lastLink?.attributes('aria-current')).toBe('page');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('does not set aria-current on non-last links', () => {
|
|
63
|
+
const wrapper = mount(MBreadcrumb, {
|
|
64
|
+
props: {
|
|
65
|
+
links: defaultLinks,
|
|
66
|
+
},
|
|
67
|
+
global: {
|
|
68
|
+
components: { MLink: MLinkStub },
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const linkComponents = wrapper.findAllComponents(MLinkStub);
|
|
73
|
+
for (let i = 0; i < linkComponents.length - 1; i++) {
|
|
74
|
+
expect(linkComponents[i].attributes('aria-current')).toBeUndefined();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('applies appearance class modifier when not standard', () => {
|
|
79
|
+
const wrapper = mount(MBreadcrumb, {
|
|
80
|
+
props: {
|
|
81
|
+
appearance: 'inverse',
|
|
82
|
+
links: defaultLinks,
|
|
83
|
+
},
|
|
84
|
+
global: {
|
|
85
|
+
components: { MLink: MLinkStub },
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
expect(wrapper.classes()).toContain('mc-breadcrumb--inverse');
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('does not apply appearance modifier for standard (default)', () => {
|
|
93
|
+
const wrapper = mount(MBreadcrumb, {
|
|
94
|
+
props: {
|
|
95
|
+
appearance: 'standard',
|
|
96
|
+
links: defaultLinks,
|
|
97
|
+
},
|
|
98
|
+
global: {
|
|
99
|
+
components: { MLink: MLinkStub },
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
expect(wrapper.classes()).not.toContain('mc-breadcrumb--standard');
|
|
104
|
+
});
|
|
105
|
+
});
|