@mozaic-ds/vue 1.0.0-beta.1 → 1.0.0-beta.4
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 +218 -84
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +920 -0
- package/dist/mozaic-vue.js +877 -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 +80 -50
- package/src/components/Contributing.mdx +118 -0
- package/src/components/GettingStarted.mdx +39 -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/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 +274 -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/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/MStatusDot.vue +32 -0
- package/src/components/statusbadge/MstatusBadge.spec.ts +16 -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/usingIcons.mdx +43 -0
- package/src/components/usingPresets.mdx +125 -0
- package/src/main.ts +39 -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/MBreadcrumb.vue +0 -73
- 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/MPasswordInput.vue +0 -96
- 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
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
|
+
import { Source } from '@storybook/addon-docs';
|
|
3
|
+
|
|
4
|
+
<Meta title="Using Presets" />
|
|
5
|
+
|
|
6
|
+
# Mozaic's presets
|
|
7
|
+
|
|
8
|
+
**Mozaic** is a **multi-brand** design system.<br/>
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
To simplify this aspect of customising **Mozaic** for you, we have created themes _(which we also call **"presets"**)_ ready to use according to your context of use.
|
|
12
|
+
|
|
13
|
+
Currently **Mozaic** can be customized with the following presets:
|
|
14
|
+
|
|
15
|
+
- Preset **Leroy Merlin**: this is the default preset/theme configured when **Mozaic** was first installed
|
|
16
|
+
- Preset **Adeo**: dedicated to the **Adeo Group's** internal interfaces and products
|
|
17
|
+
- Preset **Bricoman**: dedicated to the interfaces and products of the **Bricoman** brand
|
|
18
|
+
|
|
19
|
+
The rest of this documentation shows you how to use/install the Adeo preset in your project.
|
|
20
|
+
|
|
21
|
+
> Note that the procedure remains the same for all other presets.<br/> You just need to replace all references to "Adeo" with the brand name of your choice.
|
|
22
|
+
|
|
23
|
+
## Using the Adeo's preset
|
|
24
|
+
|
|
25
|
+
Before anything else, make sure you have followed the **Mozaic-Vue** installation procedure as described in the [Getting Started](?path=/docs/getting-started--docs) page.
|
|
26
|
+
|
|
27
|
+
Once **Mozaic-Vue** is installed as shown, we can make the following changes:
|
|
28
|
+
|
|
29
|
+
### 1. Loading preset
|
|
30
|
+
|
|
31
|
+
All it has to do is insert the following code into its main Sass file (entrypoint stylesheet):
|
|
32
|
+
|
|
33
|
+
<Source
|
|
34
|
+
language='css'
|
|
35
|
+
dark
|
|
36
|
+
code={`
|
|
37
|
+
// Entrypoint stylesheet
|
|
38
|
+
@use "@mozaic-ds/tokens/<presetName>" as *;
|
|
39
|
+
`} />
|
|
40
|
+
|
|
41
|
+
> [!NOTE]
|
|
42
|
+
> The `<presetName>` string should be replaced by the name of the preset you want, one of the following values: `adeo | enki | mbrand`.
|
|
43
|
+
> As the `leroymerlin` preset is the default preset, you don't need to use this syntax to use it.
|
|
44
|
+
|
|
45
|
+
For example, for ADEO
|
|
46
|
+
|
|
47
|
+
<Source
|
|
48
|
+
language='css'
|
|
49
|
+
dark
|
|
50
|
+
code={`
|
|
51
|
+
// Entrypoint stylesheet
|
|
52
|
+
@use "@mozaic-ds/tokens/adeo" as *;
|
|
53
|
+
`} />
|
|
54
|
+
|
|
55
|
+
### 2. Font by brand
|
|
56
|
+
|
|
57
|
+
Each brand is distinguished not only by different styles but also by a different font.
|
|
58
|
+
|
|
59
|
+
The table below summarises which font to use depending on the brand.
|
|
60
|
+
|
|
61
|
+
<table>
|
|
62
|
+
<tr>
|
|
63
|
+
<td>Brand</td>
|
|
64
|
+
<td>Font</td>
|
|
65
|
+
</tr>
|
|
66
|
+
<tr>
|
|
67
|
+
<td>Leroy Merlin</td>
|
|
68
|
+
<td>[LeroyMerlinSans](https://mozaic.adeo.cloud/foundations/typography/font-families/)</td>
|
|
69
|
+
</tr>
|
|
70
|
+
<tr>
|
|
71
|
+
<td>Adeo</td>
|
|
72
|
+
<td>[Roboto](https://fonts.google.com/specimen/Roboto)</td>
|
|
73
|
+
</tr>
|
|
74
|
+
<tr>
|
|
75
|
+
<td>Bricoman</td>
|
|
76
|
+
<td>[Inter](https://fonts.google.com/specimen/Inter)</td>
|
|
77
|
+
</tr>
|
|
78
|
+
</table>
|
|
79
|
+
|
|
80
|
+
From there, we can update the main style sheet of your project, in order to import the right font.
|
|
81
|
+
|
|
82
|
+
<Source
|
|
83
|
+
language='css'
|
|
84
|
+
dark
|
|
85
|
+
code={`
|
|
86
|
+
@use "@mozaic-ds/styles/tools/t.font" as *;
|
|
87
|
+
|
|
88
|
+
body {
|
|
89
|
+
@include set-font-family();
|
|
90
|
+
}
|
|
91
|
+
`} />
|
|
92
|
+
|
|
93
|
+
Specific for LM fonts
|
|
94
|
+
|
|
95
|
+
> This section describes the use of fonts for the **Leroy Merlin** preset, but if you are using another preset, please see [the associated documentation](?path=/docs/using-presets--docs).
|
|
96
|
+
|
|
97
|
+
The theme defined by default when **Mozaic-Vue** is first installed/used is the theme corresponding to the **Leroy Merlin** charter.
|
|
98
|
+
|
|
99
|
+
For any use of the **Leroy Merlin** theme, it is recommended to use the font [LeroyMerlinSans](/typography/font-families/) which has been specially designed for **Leroy Merlin** products.
|
|
100
|
+
|
|
101
|
+
To use the `LeroyMerlinSans` font in your project, you must copy it into your project so that it is present in your `assets`.
|
|
102
|
+
|
|
103
|
+
You can do this as follows:
|
|
104
|
+
|
|
105
|
+
1. Create a folder in your project where you can save the fonts, for example: `static/assets/fonts`
|
|
106
|
+
|
|
107
|
+
2. Copy fonts from Mozaic dependencies:
|
|
108
|
+
|
|
109
|
+
<Source
|
|
110
|
+
language="bash"
|
|
111
|
+
dark
|
|
112
|
+
code='cp node_modules/@mozaic-ds/web-fonts/*.{woff,woff2} static/assets/fonts'
|
|
113
|
+
/>
|
|
114
|
+
|
|
115
|
+
### 3. Usage
|
|
116
|
+
|
|
117
|
+
At this stage, the integration of the **Mozaic-Vue** components should normally be customised with the preset values.
|
|
118
|
+
|
|
119
|
+
All that remains is to use the components as usual:
|
|
120
|
+
|
|
121
|
+
<Source
|
|
122
|
+
language="html"
|
|
123
|
+
dark
|
|
124
|
+
code='<MButton label="This is a Mozaic Button" />'
|
|
125
|
+
/>
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import MBadge from './components/badge/MBadge.vue';
|
|
2
|
+
import MButton from './components/button/MButton.vue';
|
|
3
|
+
import MCheckbox from './components/checkbox/MCheckbox.vue';
|
|
4
|
+
import MCheckboxGroup from './components/checkboxgroup/MCheckboxGroup.vue';
|
|
5
|
+
import MField from './components/field/MField.vue';
|
|
6
|
+
import MFieldGroup from './components/fieldgroup/MFieldGroup.vue';
|
|
7
|
+
import MIconButton from './components/iconbutton/MIconButton.vue';
|
|
8
|
+
import MLink from './components/link/MLink.vue';
|
|
9
|
+
import MLoader from './components/loader/MLoader.vue';
|
|
10
|
+
import MOverlay from './components/overlay/MOverlay.vue';
|
|
11
|
+
import MQuantitySelector from './components/quantityselector/MQuantitySelector.vue';
|
|
12
|
+
import MRadio from './components/radio/MRadio.vue';
|
|
13
|
+
import MRadioGroup from './components/radiogroup/MRadioGroup.vue';
|
|
14
|
+
import MSelect from './components/select/MSelect.vue';
|
|
15
|
+
import MStatusBadge from './components/statusbadge/MStatusBadge.vue';
|
|
16
|
+
import MTextArea from './components/textarea/MTextArea.vue';
|
|
17
|
+
import MTextInput from './components/textinput/MTextInput.vue';
|
|
18
|
+
import MToggle from './components/toggle/MToggle.vue';
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
MBadge,
|
|
22
|
+
MButton,
|
|
23
|
+
MCheckbox,
|
|
24
|
+
MCheckboxGroup,
|
|
25
|
+
MField,
|
|
26
|
+
MFieldGroup,
|
|
27
|
+
MIconButton,
|
|
28
|
+
MLink,
|
|
29
|
+
MLoader,
|
|
30
|
+
MOverlay,
|
|
31
|
+
MQuantitySelector,
|
|
32
|
+
MRadio,
|
|
33
|
+
MRadioGroup,
|
|
34
|
+
MSelect,
|
|
35
|
+
MStatusBadge,
|
|
36
|
+
MTextArea,
|
|
37
|
+
MTextInput,
|
|
38
|
+
MToggle,
|
|
39
|
+
};
|
package/dist/demo.html
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!doctype html><meta charset="utf-8"><title>vue demo</title><script src="./mozaic-vue.adeo.umd.js"></script><link rel="stylesheet" href="./mozaic-vue.adeo.css"><script>console.log(vue)</script>
|