@mozaic-ds/vue 2.11.0 → 2.13.0
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/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +791 -353
- package/dist/mozaic-vue.js +2945 -2404
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +5 -5
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +7 -6
- package/src/components/{usingPresets.mdx → BrandPresets.mdx} +2 -2
- package/src/components/Changelog.mdx +19 -0
- package/src/components/Color.mdx +226 -0
- package/src/components/Contributing.mdx +12 -6
- package/src/components/GettingStarted.mdx +1 -1
- package/src/components/Icon.stories.ts +134 -0
- package/src/components/Welcome.mdx +49 -0
- package/src/components/accordionlist/MAccordionList.spec.ts +136 -0
- package/src/components/accordionlist/MAccordionList.stories.ts +123 -0
- package/src/components/accordionlist/MAccordionList.vue +91 -0
- package/src/components/accordionlist/README.md +24 -0
- package/src/components/accordionlist/m-accordion-list.const.ts +9 -0
- package/src/components/accordionlistitem/MAccordionListItem.spec.ts +123 -0
- package/src/components/accordionlistitem/MAccordionListItem.vue +95 -0
- package/src/components/accordionlistitem/README.md +23 -0
- package/src/components/actionbottombar/MActionBottomBar.spec.ts +52 -0
- package/src/components/actionbottombar/MActionBottomBar.stories.ts +162 -0
- package/src/components/actionbottombar/MActionBottomBar.vue +45 -0
- package/src/components/actionbottombar/README.md +31 -0
- package/src/components/actionlistbox/MActionListbox.spec.ts +134 -0
- package/src/components/actionlistbox/MActionListbox.stories.ts +74 -0
- package/src/components/actionlistbox/MActionListbox.vue +89 -0
- package/src/components/actionlistbox/README.md +25 -0
- package/src/components/avatar/MAvatar.stories.ts +1 -1
- package/src/components/breadcrumb/README.md +14 -0
- package/src/components/builtinmenu/MBuiltInMenu.spec.ts +111 -0
- package/src/components/builtinmenu/MBuiltInMenu.stories.ts +59 -0
- package/src/components/builtinmenu/MBuiltInMenu.vue +110 -0
- package/src/components/builtinmenu/README.md +32 -0
- package/src/components/button/MButton.spec.ts +1 -1
- package/src/components/button/MButton.stories.ts +165 -5
- package/src/components/button/README.md +33 -1
- package/src/components/callout/MCallout.spec.ts +7 -6
- package/src/components/callout/MCallout.stories.ts +1 -2
- package/src/components/carousel/MCarousel.spec.ts +1 -2
- package/src/components/carousel/MCarousel.stories.ts +2 -1
- package/src/components/carousel/MCarousel.vue +1 -2
- package/src/components/carousel/README.md +14 -0
- package/src/components/checkbox/README.md +14 -0
- package/src/components/checkboxgroup/README.md +14 -0
- package/src/components/checklistmenu/MCheckListMenu.spec.ts +77 -0
- package/src/components/checklistmenu/MCheckListMenu.stories.ts +47 -0
- package/src/components/checklistmenu/MCheckListMenu.vue +61 -0
- package/src/components/checklistmenu/README.md +32 -0
- package/src/components/circularprogressbar/README.md +15 -1
- package/src/components/datepicker/MDatepicker.vue +1 -1
- package/src/components/divider/README.md +22 -0
- package/src/components/drawer/MDrawer.vue +1 -2
- package/src/components/drawer/README.md +16 -0
- package/src/components/field/README.md +14 -0
- package/src/components/fileuploader/MFileUploader.spec.ts +304 -0
- package/src/components/fileuploader/MFileUploader.stories.ts +123 -0
- package/src/components/fileuploader/MFileUploader.vue +314 -0
- package/src/components/fileuploader/README.md +58 -0
- package/src/components/fileuploaderitem/MFileUploaderItem.spec.ts +91 -0
- package/src/components/fileuploaderitem/MFileUploaderItem.vue +180 -0
- package/src/components/fileuploaderitem/README.md +58 -0
- package/src/components/flag/README.md +1 -1
- package/src/components/iconbutton/MIconButton.spec.ts +1 -1
- package/src/components/iconbutton/MIconButton.stories.ts +116 -7
- package/src/components/iconbutton/README.md +25 -1
- package/src/components/kpiitem/MKpiItem.vue +5 -3
- package/src/components/linearprogressbarbuffer/README.md +14 -0
- package/src/components/link/MLink.stories.ts +1 -2
- package/src/components/link/README.md +14 -0
- package/src/components/loader/README.md +20 -0
- package/src/components/loadingoverlay/README.md +14 -0
- package/src/components/modal/MModal.stories.ts +1 -2
- package/src/components/modal/MModal.vue +1 -1
- package/src/components/modal/README.md +16 -0
- package/src/components/numberbadge/README.md +17 -1
- package/src/components/overlay/README.md +16 -0
- package/src/components/pagination/MPagination.vue +1 -2
- package/src/components/pagination/README.md +18 -0
- package/src/components/passwordinput/MPasswordInput.vue +1 -1
- package/src/components/passwordinput/README.md +14 -0
- package/src/components/phonenumber/MPhoneNumber.spec.ts +7 -6
- package/src/components/phonenumber/MPhoneNumber.vue +1 -1
- package/src/components/quantityselector/MQuantitySelector.vue +1 -2
- package/src/components/radio/README.md +14 -0
- package/src/components/radiogroup/README.md +14 -0
- package/src/components/select/README.md +14 -0
- package/src/components/starrating/MStarRating.spec.ts +1 -2
- package/src/components/starrating/MStarRating.vue +1 -3
- package/src/components/statusbadge/README.md +14 -0
- package/src/components/statusdot/README.md +14 -0
- package/src/components/statusmessage/MStatusMessage.spec.ts +6 -4
- package/src/components/statusmessage/MStatusMessage.vue +6 -4
- package/src/components/statusmessage/README.md +14 -0
- package/src/components/statusnotification/MStatusNotification.spec.ts +6 -4
- package/src/components/statusnotification/MStatusNotification.stories.ts +1 -1
- package/src/components/statusnotification/MStatusNotification.vue +7 -5
- package/src/components/statusnotification/README.md +14 -0
- package/src/components/stepperbottombar/MStepperBottomBar.spec.ts +134 -0
- package/src/components/stepperbottombar/MStepperBottomBar.stories.ts +72 -0
- package/src/components/stepperbottombar/MStepperBottomBar.vue +131 -0
- package/src/components/stepperbottombar/README.md +40 -0
- package/src/components/steppercompact/README.md +14 -0
- package/src/components/stepperinline/MStepperInline.spec.ts +78 -0
- package/src/components/stepperinline/MStepperInline.stories.ts +49 -0
- package/src/components/stepperinline/MStepperInline.vue +93 -0
- package/src/components/stepperinline/README.md +11 -0
- package/src/components/tabs/MTabs.stories.ts +1 -1
- package/src/components/tabs/README.md +16 -0
- package/src/components/tag/MTag.vue +1 -1
- package/src/components/tag/README.md +14 -0
- package/src/components/textinput/MTextInput.spec.ts +1 -1
- package/src/components/textinput/MTextInput.stories.ts +1 -1
- package/src/components/textinput/MTextInput.vue +1 -1
- package/src/components/toaster/MToaster.spec.ts +6 -4
- package/src/components/toaster/MToaster.vue +7 -5
- package/src/components/toaster/README.md +16 -0
- package/src/components/toggle/README.md +14 -0
- package/src/components/togglegroup/README.md +14 -0
- package/src/main.ts +8 -0
- package/src/components/Introduction.mdx +0 -100
- package/src/components/Support.mdx +0 -18
- package/src/components/usingIcons.mdx +0 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mozaic-ds/vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Mozaic-Vue is the Vue.js implementation of ADEO Design system",
|
|
6
6
|
"author": "ADEO - ADEO Design system",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"lint": "eslint . --fix",
|
|
22
22
|
"test:unit": "vitest",
|
|
23
23
|
"format": "prettier --write src/",
|
|
24
|
-
"build": "vite build",
|
|
24
|
+
"build": "vue-tsc -b tsconfig.app.json && vite build",
|
|
25
25
|
"readme": "node generate-readmes.js ",
|
|
26
26
|
"storybook": "storybook dev -p 6006",
|
|
27
27
|
"storybook:build": "npm run build-storybook",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"*.d.ts"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@mozaic-ds/styles": "^2.
|
|
44
|
+
"@mozaic-ds/styles": "^2.7.0",
|
|
45
45
|
"@mozaic-ds/web-fonts": "^1.65.0",
|
|
46
46
|
"postcss-scss": "^4.0.9",
|
|
47
47
|
"vue": "^3.5.13"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@commitlint/cli": "^20.1.0",
|
|
51
51
|
"@commitlint/config-conventional": "^20.0.0",
|
|
52
52
|
"@mozaic-ds/css-dev-tools": "1.75.0",
|
|
53
|
-
"@mozaic-ds/icons-vue": "^
|
|
53
|
+
"@mozaic-ds/icons-vue": "^2.2.0",
|
|
54
54
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
55
55
|
"@storybook/addon-a11y": "^10.0.4",
|
|
56
56
|
"@storybook/addon-docs": "^10.0.4",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"npm-run-all": "^4.1.5",
|
|
77
77
|
"prettier": "^3.5.3",
|
|
78
78
|
"release-it": "^19.0.4",
|
|
79
|
-
"sass": "
|
|
79
|
+
"sass": "1.94.2",
|
|
80
80
|
"storybook": "^10.0.4",
|
|
81
81
|
"storybook-addon-tag-badges": "^3.0.2",
|
|
82
82
|
"typescript": "^5.7.2",
|
|
@@ -84,7 +84,8 @@
|
|
|
84
84
|
"vite-plugin-dts": "^4.5.3",
|
|
85
85
|
"vitest": "^4.0.7",
|
|
86
86
|
"vue-component-meta": "^3.0.8",
|
|
87
|
-
"vue-eslint-parser": "^10.1.1"
|
|
87
|
+
"vue-eslint-parser": "^10.1.1",
|
|
88
|
+
"vue-tsc": "^3.1.8"
|
|
88
89
|
},
|
|
89
90
|
"bugs": {
|
|
90
91
|
"url": "https://github.com/adeo/mozaic-vue/issues"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Meta, Source } from '@storybook/addon-docs/blocks';
|
|
2
2
|
|
|
3
|
-
<Meta title="
|
|
3
|
+
<Meta title="Brand Presets" />
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# Brand Presets
|
|
6
6
|
|
|
7
7
|
**Mozaic** is a **multi-brand** design system.<br/>
|
|
8
8
|
This means that it is fully customisable so that its constituent elements _(foundations, components, etc.)_ can be adapted to the graphic charter of the brand that uses it.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Meta, Markdown } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import Changelog from '../../CHANGELOG.md?raw';
|
|
3
|
+
|
|
4
|
+
<style>
|
|
5
|
+
{`
|
|
6
|
+
.sbdocs-toc--custom {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
`}
|
|
10
|
+
</style>
|
|
11
|
+
|
|
12
|
+
<Meta
|
|
13
|
+
title="Changelog"
|
|
14
|
+
parameters={{
|
|
15
|
+
docs: { toc: { disable: true } },
|
|
16
|
+
}}
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<Markdown>{Changelog}</Markdown>
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { Meta, ColorPalette, ColorItem } from '@storybook/addon-docs/blocks';
|
|
2
|
+
|
|
3
|
+
<style>
|
|
4
|
+
{`
|
|
5
|
+
.css-1gwggp0 span {
|
|
6
|
+
display: none;
|
|
7
|
+
}
|
|
8
|
+
`}
|
|
9
|
+
</style>
|
|
10
|
+
|
|
11
|
+
<Meta title="Foundations/Color" />
|
|
12
|
+
|
|
13
|
+
# Color
|
|
14
|
+
|
|
15
|
+
Colors are foundational elements of the interface used to convey meaning, establish hierarchy, and reinforce brand identity. They help guide user attention, communicate status, and ensure readability across different contexts and themes.
|
|
16
|
+
|
|
17
|
+
Each color should be used according to its designated role to preserve visual consistency, contrast, and usability across the interface.
|
|
18
|
+
|
|
19
|
+
<br />
|
|
20
|
+
|
|
21
|
+
### Text
|
|
22
|
+
|
|
23
|
+
Text colors define the appearance of all written content. Use primary and secondary text colors for readability and hierarchy, tertiary for subtle information, accent for emphasis, and inverse variants for dark backgrounds.
|
|
24
|
+
|
|
25
|
+
<ColorPalette>
|
|
26
|
+
{/* Text */}
|
|
27
|
+
<ColorItem
|
|
28
|
+
title="Text / Primary"
|
|
29
|
+
colors={{
|
|
30
|
+
'--color-text-primary': 'var(--color-text-primary)',
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<ColorItem
|
|
35
|
+
title="Text / Secondary"
|
|
36
|
+
colors={{
|
|
37
|
+
'--color-text-secondary': 'var(--color-text-secondary)',
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
<ColorItem
|
|
42
|
+
title="Text / Tertiary"
|
|
43
|
+
colors={{
|
|
44
|
+
'--color-text-tertiary': 'var(--color-text-tertiary)',
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<ColorItem
|
|
49
|
+
title="Text / Accent"
|
|
50
|
+
colors={{
|
|
51
|
+
'--color-text-accent': 'var(--color-text-accent)',
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
<ColorItem
|
|
56
|
+
title="Text / Disabled"
|
|
57
|
+
colors={{
|
|
58
|
+
'--color-text-disabled': 'var(--color-text-disabled)',
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
|
|
62
|
+
<ColorItem
|
|
63
|
+
title="Text / Primary Inverse"
|
|
64
|
+
colors={{
|
|
65
|
+
'--color-text-primary-inverse': 'var(--color-text-primary-inverse)',
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
<ColorItem
|
|
70
|
+
title="Text / Secondary Inverse"
|
|
71
|
+
colors={{
|
|
72
|
+
'--color-text-secondary-inverse':
|
|
73
|
+
'var(--color-text-secondary-inverse)',
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
</ColorPalette>
|
|
77
|
+
|
|
78
|
+
### Background
|
|
79
|
+
|
|
80
|
+
Background colors are used to create contrast and define sections of the interface. Primary is the default canvas, secondary provides subtle separation, accent highlights areas, ghost is for overlays, and inverse variants for dark parts.
|
|
81
|
+
|
|
82
|
+
<ColorPalette>
|
|
83
|
+
{/* Background */}
|
|
84
|
+
<ColorItem
|
|
85
|
+
title="Background / Primary"
|
|
86
|
+
colors={{
|
|
87
|
+
'--color-background-primary': 'var(--color-background-primary)',
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
<ColorItem
|
|
92
|
+
title="Background / Secondary"
|
|
93
|
+
colors={{
|
|
94
|
+
'--color-background-secondary': 'var(--color-background-secondary)',
|
|
95
|
+
}}
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<ColorItem
|
|
99
|
+
title="Background / Secondary Inverse"
|
|
100
|
+
colors={{
|
|
101
|
+
'--color-background-secondary-inverse':
|
|
102
|
+
'var(--color-background-secondary-inverse)',
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
|
|
106
|
+
<ColorItem
|
|
107
|
+
title="Background / Accent"
|
|
108
|
+
colors={{
|
|
109
|
+
'--color-background-accent': 'var(--color-background-accent)',
|
|
110
|
+
}}
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
<ColorItem
|
|
114
|
+
title="Background / Accent Inverse"
|
|
115
|
+
colors={{
|
|
116
|
+
'--color-background-accent-inverse':
|
|
117
|
+
'var(--color-background-accent-inverse)',
|
|
118
|
+
}}
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
<ColorItem
|
|
122
|
+
title="Background / Ghost"
|
|
123
|
+
colors={{
|
|
124
|
+
'--color-background-ghost': 'var(--color-background-ghost)',
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
|
|
128
|
+
<ColorItem
|
|
129
|
+
title="Background / Disabled"
|
|
130
|
+
colors={{
|
|
131
|
+
'--color-background-disabled': 'var(--color-background-disabled)',
|
|
132
|
+
}}
|
|
133
|
+
/>
|
|
134
|
+
</ColorPalette>
|
|
135
|
+
|
|
136
|
+
### Border
|
|
137
|
+
|
|
138
|
+
Border colors provide visual separation between interface elements. Use primary for main borders, secondary and tertiary for subtle dividers, and inverse for dark backgrounds.
|
|
139
|
+
|
|
140
|
+
<ColorPalette>
|
|
141
|
+
{/* Border */}
|
|
142
|
+
<ColorItem
|
|
143
|
+
title="Border / Primary"
|
|
144
|
+
colors={{
|
|
145
|
+
'--color-border-primary': 'var(--color-border-primary)',
|
|
146
|
+
}}
|
|
147
|
+
/>
|
|
148
|
+
|
|
149
|
+
<ColorItem
|
|
150
|
+
title="Border / Secondary"
|
|
151
|
+
colors={{
|
|
152
|
+
'--color-border-secondary': 'var(--color-border-secondary)',
|
|
153
|
+
}}
|
|
154
|
+
/>
|
|
155
|
+
|
|
156
|
+
<ColorItem
|
|
157
|
+
title="Border / Tertiary"
|
|
158
|
+
colors={{
|
|
159
|
+
'--color-border-tertiary': 'var(--color-border-tertiary)',
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
|
|
163
|
+
<ColorItem
|
|
164
|
+
title="Border / Inverse"
|
|
165
|
+
colors={{
|
|
166
|
+
'--color-border-inverse': 'var(--color-border-inverse)',
|
|
167
|
+
}}
|
|
168
|
+
/>
|
|
169
|
+
</ColorPalette>
|
|
170
|
+
|
|
171
|
+
### Icon
|
|
172
|
+
|
|
173
|
+
Icon colors communicate meaning and status. Primary icons are default, secondary and tertiary support hierarchy, accent icons draw attention, disabled icons indicate inactivity, and inverse variants are for dark backgrounds.
|
|
174
|
+
|
|
175
|
+
<ColorPalette>
|
|
176
|
+
{/* Icon */}
|
|
177
|
+
<ColorItem
|
|
178
|
+
title="Icon / Primary"
|
|
179
|
+
colors={{
|
|
180
|
+
'--color-icon-primary': 'var(--color-icon-primary)',
|
|
181
|
+
}}
|
|
182
|
+
/>
|
|
183
|
+
|
|
184
|
+
<ColorItem
|
|
185
|
+
title="Icon / Secondary"
|
|
186
|
+
colors={{
|
|
187
|
+
'--color-icon-secondary': 'var(--color-icon-secondary)',
|
|
188
|
+
}}
|
|
189
|
+
/>
|
|
190
|
+
|
|
191
|
+
<ColorItem
|
|
192
|
+
title="Icon / Tertiary"
|
|
193
|
+
colors={{
|
|
194
|
+
'--color-icon-tertiary': 'var(--color-icon-tertiary)',
|
|
195
|
+
}}
|
|
196
|
+
/>
|
|
197
|
+
|
|
198
|
+
<ColorItem
|
|
199
|
+
title="Icon / Accent"
|
|
200
|
+
colors={{
|
|
201
|
+
'--color-icon-accent': 'var(--color-icon-accent)',
|
|
202
|
+
}}
|
|
203
|
+
/>
|
|
204
|
+
|
|
205
|
+
<ColorItem
|
|
206
|
+
title="Icon / Disabled"
|
|
207
|
+
colors={{
|
|
208
|
+
'--color-icon-disabled': 'var(--color-icon-disabled)',
|
|
209
|
+
}}
|
|
210
|
+
/>
|
|
211
|
+
|
|
212
|
+
<ColorItem
|
|
213
|
+
title="Icon / Primary Inverse"
|
|
214
|
+
colors={{
|
|
215
|
+
'--color-icon-primary-inverse': 'var(--color-icon-primary-inverse)',
|
|
216
|
+
}}
|
|
217
|
+
/>
|
|
218
|
+
|
|
219
|
+
<ColorItem
|
|
220
|
+
title="Icon / Secondary Inverse"
|
|
221
|
+
colors={{
|
|
222
|
+
'--color-icon-secondary-inverse':
|
|
223
|
+
'var(--color-icon-secondary-inverse)',
|
|
224
|
+
}}
|
|
225
|
+
/>
|
|
226
|
+
</ColorPalette>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Meta } from '@storybook/addon-docs/blocks';
|
|
1
|
+
import { Meta, Source } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import { Mermaid } from 'mdx-mermaid/Mermaid';
|
|
3
3
|
|
|
4
|
-
<Meta title="
|
|
4
|
+
<Meta title="Contributing" />
|
|
5
5
|
|
|
6
6
|
# Be part of something bigger!
|
|
7
7
|
|
|
@@ -77,7 +77,10 @@ If you’re only fixing a bug, it should be fine to submit a pull request but we
|
|
|
77
77
|
|
|
78
78
|
### Project setup
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
<Source
|
|
81
|
+
language='bash'
|
|
82
|
+
dark
|
|
83
|
+
code={`
|
|
81
84
|
// Clone mozaic-vue repo
|
|
82
85
|
git clone git@github.com:adeo/mozaic-vue.git
|
|
83
86
|
|
|
@@ -89,7 +92,7 @@ git checkout <branch name>
|
|
|
89
92
|
|
|
90
93
|
// Install dependencies
|
|
91
94
|
npm install
|
|
92
|
-
|
|
95
|
+
`} />
|
|
93
96
|
|
|
94
97
|
## Submitting Changes/ Pull Requests
|
|
95
98
|
|
|
@@ -100,7 +103,10 @@ Mozaic's team is keeping an eye on pull requests. We will check your pull reques
|
|
|
100
103
|
|
|
101
104
|
Before submitting please make sure to run:
|
|
102
105
|
|
|
103
|
-
|
|
106
|
+
<Source
|
|
107
|
+
language='bash'
|
|
108
|
+
dark
|
|
109
|
+
code={`
|
|
104
110
|
// Pull down the latest
|
|
105
111
|
$ git pull origin main
|
|
106
112
|
|
|
@@ -115,4 +121,4 @@ $ npm run lint
|
|
|
115
121
|
|
|
116
122
|
// Run formatter
|
|
117
123
|
$ npm run format
|
|
118
|
-
|
|
124
|
+
`} />
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
import * as Icons from '@mozaic-ds/icons-vue';
|
|
4
|
+
import {
|
|
5
|
+
Release32,
|
|
6
|
+
CheckCircleFilled20,
|
|
7
|
+
CheckCircleFilled24,
|
|
8
|
+
CheckCircleFilled32,
|
|
9
|
+
CheckCircleFilled48,
|
|
10
|
+
CheckCircleFilled64,
|
|
11
|
+
} from '@mozaic-ds/icons-vue';
|
|
12
|
+
|
|
13
|
+
const meta: Meta = {
|
|
14
|
+
title: 'Foundations/Icon',
|
|
15
|
+
component: Release32,
|
|
16
|
+
parameters: {
|
|
17
|
+
docs: {
|
|
18
|
+
description: {
|
|
19
|
+
component:
|
|
20
|
+
'Icons are compact visual elements used to represent actions, objects, or concepts in a clear and recognizable way. They can be used as standalone components or paired with other UI elements to enhance meaning and usability. Their style, size, and emphasis depend on the function they communicate and the context in which they appear.',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
tags: ['v2'],
|
|
25
|
+
argTypes: {
|
|
26
|
+
color: {
|
|
27
|
+
description: 'customize the color of the SVG.',
|
|
28
|
+
control: 'select',
|
|
29
|
+
options: [
|
|
30
|
+
undefined,
|
|
31
|
+
'var(--color-icon-primary)',
|
|
32
|
+
'var(--color-icon-secondary)',
|
|
33
|
+
'var(--color-icon-tertiary)',
|
|
34
|
+
'var(--color-icon-primary-inverse)',
|
|
35
|
+
'var(--color-icon-secondary-inverse)',
|
|
36
|
+
'var(--color-icon-accent)',
|
|
37
|
+
'var(--color-icon-disabled)',
|
|
38
|
+
],
|
|
39
|
+
table: {
|
|
40
|
+
category: 'Properties',
|
|
41
|
+
type: { summary: 'string' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
render: (args) => ({
|
|
46
|
+
components: Icons,
|
|
47
|
+
setup() {
|
|
48
|
+
return { args };
|
|
49
|
+
},
|
|
50
|
+
template: `
|
|
51
|
+
<Release32 v-bind="args"/>
|
|
52
|
+
`,
|
|
53
|
+
}),
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default meta;
|
|
57
|
+
type Story = StoryObj;
|
|
58
|
+
|
|
59
|
+
export const Default: Story = {};
|
|
60
|
+
|
|
61
|
+
export const Size: Story = {
|
|
62
|
+
parameters: {
|
|
63
|
+
docs: {
|
|
64
|
+
source: {
|
|
65
|
+
code: `
|
|
66
|
+
<template>
|
|
67
|
+
<CheckCircleFilled20 />
|
|
68
|
+
<CheckCircleFilled24 />
|
|
69
|
+
<CheckCircleFilled32 />
|
|
70
|
+
<CheckCircleFilled48 />
|
|
71
|
+
<CheckCircleFilled64 />
|
|
72
|
+
</template>
|
|
73
|
+
`,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
render: (args) => ({
|
|
78
|
+
components: {
|
|
79
|
+
CheckCircleFilled20,
|
|
80
|
+
CheckCircleFilled24,
|
|
81
|
+
CheckCircleFilled32,
|
|
82
|
+
CheckCircleFilled48,
|
|
83
|
+
CheckCircleFilled64,
|
|
84
|
+
},
|
|
85
|
+
setup() {
|
|
86
|
+
return { args };
|
|
87
|
+
},
|
|
88
|
+
template: `
|
|
89
|
+
<CheckCircleFilled20/>
|
|
90
|
+
<CheckCircleFilled24/>
|
|
91
|
+
<CheckCircleFilled32/>
|
|
92
|
+
<CheckCircleFilled48/>
|
|
93
|
+
<CheckCircleFilled64/>
|
|
94
|
+
`,
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const Color: Story = {
|
|
99
|
+
args: {
|
|
100
|
+
color: 'var(--color-icon-accent)',
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const IconList: Story = {
|
|
105
|
+
parameters: {
|
|
106
|
+
docs: {
|
|
107
|
+
canvas: {
|
|
108
|
+
sourceState: 'hidden',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
render: () => ({
|
|
113
|
+
components: Icons,
|
|
114
|
+
setup() {
|
|
115
|
+
const icons32: Record<string, Component> = Object.fromEntries(
|
|
116
|
+
Object.entries(Icons).filter(([name]) => name.endsWith('32')),
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
return { icons32 };
|
|
120
|
+
},
|
|
121
|
+
template: `
|
|
122
|
+
<div class="icon-grid">
|
|
123
|
+
<div
|
|
124
|
+
v-for="(Icon, name) in icons32"
|
|
125
|
+
:key="name"
|
|
126
|
+
class="icon-item"
|
|
127
|
+
>
|
|
128
|
+
<component :is="Icon" width="32" height="32" />
|
|
129
|
+
<div class="icon-label"><{{ name }}/></div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
`,
|
|
133
|
+
}),
|
|
134
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Meta, Source } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import ads from '../../.storybook/assets/logo.svg';
|
|
3
|
+
import vue from '../../.storybook/assets/vue.svg';
|
|
4
|
+
import '@mozaic-ds/styles';
|
|
5
|
+
|
|
6
|
+
<style>
|
|
7
|
+
{`
|
|
8
|
+
.sbdocs-toc--custom {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
`}
|
|
12
|
+
</style>
|
|
13
|
+
|
|
14
|
+
<Meta title="Welcome" />
|
|
15
|
+
|
|
16
|
+
<div class="hero">
|
|
17
|
+
<p
|
|
18
|
+
style={{
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
gap: '1rem',
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<img src={ads} alt="ADEO Design system logo" style={{ height: '80px' }} />
|
|
26
|
+
<span style={{ fontSize: '32px' }}>x</span>
|
|
27
|
+
<img src={vue} alt="Vue.js logo" style={{ height: '80px' }} />
|
|
28
|
+
</p>
|
|
29
|
+
<h1 class="mt-heading--l">ADEO Design system - Vue.js library</h1>
|
|
30
|
+
|
|
31
|
+
<p class="mt-body-l">A library of **Vue.js** components implementing **ADEO Design system** guidelines.</p>
|
|
32
|
+
|
|
33
|
+
<div class="hero-links">
|
|
34
|
+
<a href="https://github.com/adeo/mozaic-vue" target="_blank" class="mc-button mc-button--outlined">
|
|
35
|
+
<svg class="mc-button__icon" width="24" height="24" aria-hidden="true" viewBox="0 0 1024 1024" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z" transform="scale(64)" fill="#000"/></svg>
|
|
36
|
+
<span class="mc-button__label">Github</span>
|
|
37
|
+
</a>
|
|
38
|
+
<a href="https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-" target="_blank" class="mc-button mc-button--outlined">
|
|
39
|
+
<svg lass="mc-button__icon" width="24" height="24" aria-hidden="true" viewBox="0 0 54 80" fill="none"><g clip-path="url(#figma__clip0_912_3)"><path d="M13.3333 80.0002C20.6933 80.0002 26.6667 74.0268 26.6667 66.6668V53.3335H13.3333C5.97333 53.3335 0 59.3068 0 66.6668C0 74.0268 5.97333 80.0002 13.3333 80.0002Z" fill="#0ACF83"/><path d="M0 39.9998C0 32.6398 5.97333 26.6665 13.3333 26.6665H26.6667V53.3332H13.3333C5.97333 53.3332 0 47.3598 0 39.9998Z" fill="#A259FF"/><path d="M0 13.3333C0 5.97333 5.97333 0 13.3333 0H26.6667V26.6667H13.3333C5.97333 26.6667 0 20.6933 0 13.3333Z" fill="#F24E1E"/><path d="M26.6667 0H40.0001C47.3601 0 53.3334 5.97333 53.3334 13.3333C53.3334 20.6933 47.3601 26.6667 40.0001 26.6667H26.6667V0Z" fill="#FF7262"/><path d="M53.3334 39.9998C53.3334 47.3598 47.3601 53.3332 40.0001 53.3332C32.6401 53.3332 26.6667 47.3598 26.6667 39.9998C26.6667 32.6398 32.6401 26.6665 40.0001 26.6665C47.3601 26.6665 53.3334 32.6398 53.3334 39.9998Z" fill="#1ABCFE"/></g><defs><clipPath id="figma__clip0_912_3"><rect width="53.3333" height="80" fill="white"/></clipPath></defs></svg>
|
|
40
|
+
<span class="mc-button__label">Figma</span>
|
|
41
|
+
</a>
|
|
42
|
+
<a href="?path=/docs/getting-started--docs" class="mc-button mc-button--accent">
|
|
43
|
+
<span class="mc-button__label">Get Started</span>
|
|
44
|
+
<svg class="mc-button__icon" width="24" height="24" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
45
|
+
<path fill-rule="evenodd" d="M15.2929 6.29289c.3905-.39052 1.0237-.39052 1.4142 0l5 5.00001c.3905.3905.3905 1.0237 0 1.4142l-5 5c-.3905.3905-1.0237.3905-1.4142 0-.3905-.3905-.3905-1.0237 0-1.4142L18.5858 13H3c-.55228 0-1-.4477-1-1s.44772-1 1-1h15.5858l-3.2929-3.29289c-.3905-.39053-.3905-1.02369 0-1.41422Z"></path>
|
|
46
|
+
</svg>
|
|
47
|
+
</a>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import { inject, defineComponent } from 'vue';
|
|
4
|
+
|
|
5
|
+
import MAccordionList from './MAccordionList.vue';
|
|
6
|
+
import {
|
|
7
|
+
AccordionStateKey,
|
|
8
|
+
AccordionToggleFnKey,
|
|
9
|
+
} from './m-accordion-list.const';
|
|
10
|
+
|
|
11
|
+
const AccordionItemsMock = defineComponent({
|
|
12
|
+
setup() {
|
|
13
|
+
const toggle = inject(AccordionToggleFnKey)!;
|
|
14
|
+
const openIds = inject(AccordionStateKey);
|
|
15
|
+
return { toggle, openIds };
|
|
16
|
+
},
|
|
17
|
+
template: `
|
|
18
|
+
<div>
|
|
19
|
+
<button id="a" @click="toggle('a')" />
|
|
20
|
+
<button id="b" @click="toggle('b')" />
|
|
21
|
+
</div>
|
|
22
|
+
`,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('MAccordionList', () => {
|
|
26
|
+
it('renders default slot content', () => {
|
|
27
|
+
const wrapper = mount(MAccordionList, {
|
|
28
|
+
slots: {
|
|
29
|
+
default: '<div class="slot-content">Content</div>',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
expect(wrapper.find('.slot-content').exists()).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('applies ghost modifier class when appearance is ghost', () => {
|
|
37
|
+
const wrapper = mount(MAccordionList, {
|
|
38
|
+
props: {
|
|
39
|
+
appearance: 'ghost',
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
expect(wrapper.classes()).toContain('mc-accordion--ghost');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('does not apply ghost modifier class by default', () => {
|
|
47
|
+
const wrapper = mount(MAccordionList);
|
|
48
|
+
|
|
49
|
+
expect(wrapper.classes()).not.toContain('mc-accordion--ghost');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('provides openIds state based on modelValue', async () => {
|
|
53
|
+
const wrapper = mount(MAccordionList, {
|
|
54
|
+
props: {
|
|
55
|
+
modelValue: ['a', 'b'],
|
|
56
|
+
},
|
|
57
|
+
slots: {
|
|
58
|
+
default: AccordionItemsMock,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const consumer = wrapper.findComponent(AccordionItemsMock);
|
|
63
|
+
expect(consumer.vm.openIds).toEqual(['a', 'b']);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('emits update:modelValue when toggling in multiple mode', async () => {
|
|
67
|
+
const wrapper = mount(MAccordionList, {
|
|
68
|
+
props: {
|
|
69
|
+
modelValue: [],
|
|
70
|
+
behavior: 'multiple',
|
|
71
|
+
},
|
|
72
|
+
slots: {
|
|
73
|
+
default: AccordionItemsMock,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
await wrapper.findAll('button')[0].trigger('click');
|
|
78
|
+
|
|
79
|
+
expect(wrapper.emitted('update:modelValue')).toEqual([[['a']]]);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('adds and removes ids in multiple behavior', async () => {
|
|
83
|
+
const Parent = defineComponent({
|
|
84
|
+
components: { MAccordionList, AccordionItemsMock },
|
|
85
|
+
data() {
|
|
86
|
+
return {
|
|
87
|
+
value: ['a'],
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
template: `
|
|
91
|
+
<MAccordionList v-model="value" behavior="multiple">
|
|
92
|
+
<AccordionItemsMock />
|
|
93
|
+
</MAccordionList>
|
|
94
|
+
`,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const wrapper = mount(Parent);
|
|
98
|
+
|
|
99
|
+
await wrapper.find('#b').trigger('click');
|
|
100
|
+
expect(wrapper.vm.value).toEqual(['a', 'b']);
|
|
101
|
+
|
|
102
|
+
await wrapper.find('#a').trigger('click');
|
|
103
|
+
expect(wrapper.vm.value).toEqual(['b']);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it('allows only one open item in single behavior', async () => {
|
|
107
|
+
const wrapper = mount(MAccordionList, {
|
|
108
|
+
props: {
|
|
109
|
+
modelValue: ['a'],
|
|
110
|
+
behavior: 'single',
|
|
111
|
+
},
|
|
112
|
+
slots: {
|
|
113
|
+
default: AccordionItemsMock,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
await wrapper.find('#b').trigger('click');
|
|
118
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toEqual(['b']);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('closes the open item when toggled again in single mode', async () => {
|
|
122
|
+
const wrapper = mount(MAccordionList, {
|
|
123
|
+
props: {
|
|
124
|
+
modelValue: ['a'],
|
|
125
|
+
behavior: 'single',
|
|
126
|
+
},
|
|
127
|
+
slots: {
|
|
128
|
+
default: AccordionItemsMock,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
await wrapper.findAll('button')[0].trigger('click');
|
|
133
|
+
|
|
134
|
+
expect(wrapper.emitted('update:modelValue')?.[0][0]).toEqual([]);
|
|
135
|
+
});
|
|
136
|
+
});
|