@mozaic-ds/vue 1.0.0-beta.8 → 1.0.0-beta.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 +1 -1
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +410 -198
- package/dist/mozaic-vue.js +1100 -777
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +1 -1
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +8 -11
- package/src/components/Contributing.mdx +1 -1
- package/src/components/GettingStarted.mdx +2 -7
- package/src/components/Introduction.mdx +41 -21
- package/src/components/Support.mdx +1 -1
- package/src/components/breadcrumb/MBreadcrumb.stories.ts +11 -13
- package/src/components/breadcrumb/MBreadcrumb.vue +1 -1
- package/src/components/button/MButton.stories.ts +1 -8
- package/src/components/checkbox/MCheckbox.stories.ts +2 -2
- package/src/components/checkboxgroup/MCheckboxGroup.stories.ts +2 -2
- package/src/components/divider/MDivider.stories.ts +2 -2
- package/src/components/divider/MDivider.vue +2 -2
- package/src/components/drawer/MDrawer.spec.ts +100 -0
- package/src/components/drawer/MDrawer.stories.ts +128 -0
- package/src/components/drawer/MDrawer.vue +140 -0
- package/src/components/field/MField.stories.ts +2 -9
- package/src/components/fieldgroup/MFieldGroup.stories.ts +2 -9
- package/src/components/iconbutton/MIconButton.stories.ts +12 -4
- package/src/components/link/MLink.stories.ts +3 -12
- package/src/components/loader/MLoader.stories.ts +3 -5
- package/src/components/loader/MLoader.vue +1 -0
- package/src/components/loadingoverlay/MLoadingOverlay.spec.ts +37 -0
- package/src/components/loadingoverlay/MLoadingOverlay.stories.ts +40 -0
- package/src/components/loadingoverlay/MLoadingOverlay.vue +28 -0
- package/src/components/modal/MModal.spec.ts +103 -0
- package/src/components/modal/MModal.stories.ts +127 -0
- package/src/components/modal/MModal.vue +131 -0
- package/src/components/numberbadge/MNumberBadge.stories.ts +3 -5
- package/src/components/overlay/MOverlay.stories.ts +3 -8
- package/src/components/pagination/MPagination.stories.ts +3 -3
- package/src/components/pagination/MPagination.vue +5 -3
- package/src/components/passwordinput/MPasswordInput.stories.ts +2 -2
- package/src/components/passwordinput/MPasswordInput.vue +2 -5
- package/src/components/pincode/MPincode.spec.ts +126 -0
- package/src/components/pincode/MPincode.stories.ts +68 -0
- package/src/components/pincode/MPincode.vue +139 -0
- package/src/components/quantityselector/MQuantitySelector.stories.ts +2 -2
- package/src/components/radio/MRadio.stories.ts +2 -2
- package/src/components/radiogroup/MRadioGroup.stories.ts +2 -2
- package/src/components/select/MSelect.stories.ts +2 -2
- package/src/components/statusbadge/MStatusBadge.stories.ts +1 -1
- package/src/components/statusdot/MStatusDot.stories.ts +1 -1
- package/src/components/statusnotification/MStatusNotification.spec.ts +12 -8
- package/src/components/statusnotification/MStatusNotification.stories.ts +2 -9
- package/src/components/statusnotification/MStatusNotification.vue +8 -8
- package/src/components/tabs/MTabs.stories.ts +4 -4
- package/src/components/tabs/MTabs.vue +2 -2
- package/src/components/tabs/Mtabs.spec.ts +56 -61
- package/src/components/tag/MTag.stories.ts +2 -2
- package/src/components/tag/MTag.vue +1 -4
- package/src/components/textarea/MTextArea.stories.ts +2 -2
- package/src/components/textinput/MTextInput.stories.ts +2 -9
- package/src/components/toggle/MToggle.stories.ts +2 -2
- package/src/components/togglegroup/MToggleGroup.stories.ts +2 -2
- package/src/components/usingIcons.mdx +5 -13
- package/src/components/usingPresets.mdx +12 -9
- package/src/main.ts +4 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
2
|
import { describe, it, expect } from 'vitest';
|
|
3
3
|
import MStatusNotification from './MStatusNotification.vue';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import InfoCircleFilled32 from '@mozaic-ds/icons-vue/src/components/InfoCircleFilled32/InfoCircleFilled32.vue';
|
|
5
|
+
import WarningCircleFilled32 from '@mozaic-ds/icons-vue/src/components/WarningCircleFilled32/WarningCircleFilled32.vue';
|
|
6
|
+
import CrossCircleFilled32 from '@mozaic-ds/icons-vue/src/components/CrossCircleFilled32/CrossCircleFilled32.vue';
|
|
7
|
+
import CheckCircleFilled32 from '@mozaic-ds/icons-vue/src/components/CheckCircleFilled32/CheckCircleFilled32.vue';
|
|
8
8
|
|
|
9
9
|
describe('MStatusNotification.vue', () => {
|
|
10
10
|
it('should render correctly with the default props', () => {
|
|
@@ -17,7 +17,7 @@ describe('MStatusNotification.vue', () => {
|
|
|
17
17
|
|
|
18
18
|
expect(wrapper.text()).toContain('Test Title');
|
|
19
19
|
expect(wrapper.text()).toContain('Test Description');
|
|
20
|
-
expect(wrapper.findComponent(
|
|
20
|
+
expect(wrapper.findComponent(InfoCircleFilled32).exists()).toBe(true); // Default icon is InfoCircle32
|
|
21
21
|
expect(wrapper.classes()).toContain('mc-status-notification');
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -29,7 +29,9 @@ describe('MStatusNotification.vue', () => {
|
|
|
29
29
|
status: 'success',
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
-
expect(wrapperSuccess.findComponent(
|
|
32
|
+
expect(wrapperSuccess.findComponent(CheckCircleFilled32).exists()).toBe(
|
|
33
|
+
true,
|
|
34
|
+
);
|
|
33
35
|
|
|
34
36
|
const wrapperWarning = mount(MStatusNotification, {
|
|
35
37
|
props: {
|
|
@@ -38,7 +40,9 @@ describe('MStatusNotification.vue', () => {
|
|
|
38
40
|
status: 'warning',
|
|
39
41
|
},
|
|
40
42
|
});
|
|
41
|
-
expect(wrapperWarning.findComponent(
|
|
43
|
+
expect(wrapperWarning.findComponent(WarningCircleFilled32).exists()).toBe(
|
|
44
|
+
true,
|
|
45
|
+
);
|
|
42
46
|
|
|
43
47
|
const wrapperError = mount(MStatusNotification, {
|
|
44
48
|
props: {
|
|
@@ -47,7 +51,7 @@ describe('MStatusNotification.vue', () => {
|
|
|
47
51
|
status: 'error',
|
|
48
52
|
},
|
|
49
53
|
});
|
|
50
|
-
expect(wrapperError.findComponent(
|
|
54
|
+
expect(wrapperError.findComponent(CrossCircleFilled32).exists()).toBe(true);
|
|
51
55
|
});
|
|
52
56
|
|
|
53
57
|
it('should show the close button if closable prop is true', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
2
|
import MStatusNotification from './MStatusNotification.vue';
|
|
3
|
-
import { action } from '
|
|
3
|
+
import { action } from 'storybook/actions';
|
|
4
4
|
import MButton from '../button/MButton.vue';
|
|
5
5
|
import MLink from '../link/MLink.vue';
|
|
6
6
|
import ArrowNext20 from '@mozaic-ds/icons-vue/src/components/ArrowNext20/ArrowNext20.vue';
|
|
@@ -21,13 +21,6 @@ const meta: Meta<typeof MStatusNotification> = {
|
|
|
21
21
|
'This is a title, be concise and use the description message to give details.',
|
|
22
22
|
description: 'Description message.',
|
|
23
23
|
},
|
|
24
|
-
argTypes: {
|
|
25
|
-
$slots: {
|
|
26
|
-
table: {
|
|
27
|
-
disable: true,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
24
|
render: (args) => ({
|
|
32
25
|
components: { MStatusNotification, MButton, MLink, ArrowNext20 },
|
|
33
26
|
setup() {
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
<script setup lang="ts">
|
|
35
35
|
import { computed, type VNode } from 'vue';
|
|
36
36
|
import Cross20 from '@mozaic-ds/icons-vue/src/components/Cross20/Cross20.vue';
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
37
|
+
import InfoCircleFilled32 from '@mozaic-ds/icons-vue/src/components/InfoCircleFilled32/InfoCircleFilled32.vue';
|
|
38
|
+
import WarningCircleFilled32 from '@mozaic-ds/icons-vue/src/components/WarningCircleFilled32/WarningCircleFilled32.vue';
|
|
39
|
+
import CrossCircleFilled32 from '@mozaic-ds/icons-vue/src/components/CrossCircleFilled32/CrossCircleFilled32.vue';
|
|
40
|
+
import CheckCircleFilled32 from '@mozaic-ds/icons-vue/src/components/CheckCircleFilled32/CheckCircleFilled32.vue';
|
|
41
41
|
/**
|
|
42
42
|
* A Status Notification is used to draw the user’s attention to important information that needs to be acknowledged. It often provides feedback on a process, highlights a status update, or alerts users about an issue. Notifications are typically triggered by user actions or system events and are designed to be easily noticeable while maintaining a non-intrusive experience.
|
|
43
43
|
*/
|
|
@@ -82,14 +82,14 @@ const classObject = computed(() => {
|
|
|
82
82
|
const iconComponent = computed(() => {
|
|
83
83
|
switch (props.status) {
|
|
84
84
|
case 'success':
|
|
85
|
-
return
|
|
85
|
+
return CheckCircleFilled32;
|
|
86
86
|
case 'warning':
|
|
87
|
-
return
|
|
87
|
+
return WarningCircleFilled32;
|
|
88
88
|
case 'error':
|
|
89
|
-
return
|
|
89
|
+
return CrossCircleFilled32;
|
|
90
90
|
case 'info':
|
|
91
91
|
default:
|
|
92
|
-
return
|
|
92
|
+
return InfoCircleFilled32;
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
-
import { action } from '
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import { action } from 'storybook/actions';
|
|
3
3
|
|
|
4
4
|
import Mtabs from './MTabs.vue';
|
|
5
5
|
import ChevronRight24 from '@mozaic-ds/icons-vue/src/components/ChevronRight24/ChevronRight24.vue';
|
|
@@ -83,7 +83,7 @@ export const NoDivider: Story = {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export const Disabled: Story = {
|
|
86
|
-
args: {
|
|
86
|
+
args: {
|
|
87
87
|
tabs: [
|
|
88
88
|
{
|
|
89
89
|
label: 'Label',
|
|
@@ -100,5 +100,5 @@ export const Disabled: Story = {
|
|
|
100
100
|
disabled: true,
|
|
101
101
|
},
|
|
102
102
|
],
|
|
103
|
-
|
|
103
|
+
},
|
|
104
104
|
};
|
|
@@ -94,11 +94,11 @@ const onClickTab = (index: number) => {
|
|
|
94
94
|
modelValue.value = index;
|
|
95
95
|
emit('update:modelValue', index);
|
|
96
96
|
}
|
|
97
|
-
}
|
|
97
|
+
};
|
|
98
98
|
|
|
99
99
|
const isTabSelected = (index: number) => {
|
|
100
100
|
return modelValue.value === index;
|
|
101
|
-
}
|
|
101
|
+
};
|
|
102
102
|
|
|
103
103
|
const emit = defineEmits<{
|
|
104
104
|
/**
|
|
@@ -4,11 +4,7 @@ import MTabs from './MTabs.vue';
|
|
|
4
4
|
import { defineComponent, h } from 'vue';
|
|
5
5
|
|
|
6
6
|
describe('MTabs.vue', () => {
|
|
7
|
-
const tabs = [
|
|
8
|
-
{ label: 'Tab 1' },
|
|
9
|
-
{ label: 'Tab 2' },
|
|
10
|
-
{ label: 'Tab 3' },
|
|
11
|
-
];
|
|
7
|
+
const tabs = [{ label: 'Tab 1' }, { label: 'Tab 2' }, { label: 'Tab 3' }];
|
|
12
8
|
|
|
13
9
|
it('renders tabs with correct labels', () => {
|
|
14
10
|
const wrapper = mount(MTabs, {
|
|
@@ -26,44 +22,43 @@ describe('MTabs.vue', () => {
|
|
|
26
22
|
});
|
|
27
23
|
|
|
28
24
|
it('applies selected class and aria-selected attribute based on modelValue and updates on tab click', async () => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
37
|
-
|
|
38
|
-
buttons.forEach((button, i) => {
|
|
39
|
-
if (i === 0) {
|
|
40
|
-
expect(button.classes()).toContain('mc-tabs__tab--selected');
|
|
41
|
-
expect(button.attributes('aria-selected')).toBe('true');
|
|
42
|
-
} else {
|
|
43
|
-
expect(button.classes()).not.toContain('mc-tabs__tab--selected');
|
|
44
|
-
expect(button.attributes('aria-selected')).toBe('false');
|
|
45
|
-
}
|
|
46
|
-
});
|
|
25
|
+
const wrapper = mount(MTabs, {
|
|
26
|
+
props: {
|
|
27
|
+
tabs,
|
|
28
|
+
modelValue: 0,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
47
31
|
|
|
48
|
-
|
|
32
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
49
33
|
|
|
50
|
-
|
|
51
|
-
|
|
34
|
+
buttons.forEach((button, i) => {
|
|
35
|
+
if (i === 0) {
|
|
36
|
+
expect(button.classes()).toContain('mc-tabs__tab--selected');
|
|
37
|
+
expect(button.attributes('aria-selected')).toBe('true');
|
|
38
|
+
} else {
|
|
39
|
+
expect(button.classes()).not.toContain('mc-tabs__tab--selected');
|
|
40
|
+
expect(button.attributes('aria-selected')).toBe('false');
|
|
41
|
+
}
|
|
42
|
+
});
|
|
52
43
|
|
|
53
|
-
|
|
44
|
+
await buttons[1].trigger('click');
|
|
54
45
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
expect(wrapper.emitted('update:modelValue')).toBeTruthy();
|
|
47
|
+
expect(wrapper.emitted('update:modelValue')![0]).toEqual([1]);
|
|
48
|
+
|
|
49
|
+
await wrapper.setProps({ modelValue: 1 });
|
|
50
|
+
|
|
51
|
+
const updatedButtons = wrapper.findAll('button.mc-tabs__tab');
|
|
52
|
+
updatedButtons.forEach((button, i) => {
|
|
53
|
+
if (i === 1) {
|
|
54
|
+
expect(button.classes()).toContain('mc-tabs__tab--selected');
|
|
55
|
+
expect(button.attributes('aria-selected')).toBe('true');
|
|
56
|
+
} else {
|
|
57
|
+
expect(button.classes()).not.toContain('mc-tabs__tab--selected');
|
|
58
|
+
expect(button.attributes('aria-selected')).toBe('false');
|
|
59
|
+
}
|
|
60
|
+
});
|
|
64
61
|
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
62
|
|
|
68
63
|
it('adds divider and centered classes based on props', async () => {
|
|
69
64
|
const wrapper = mount(MTabs, {
|
|
@@ -124,31 +119,31 @@ describe('MTabs.vue', () => {
|
|
|
124
119
|
});
|
|
125
120
|
|
|
126
121
|
it('renders icon component when icon prop is provided', () => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
122
|
+
const DummyIcon = defineComponent({
|
|
123
|
+
name: 'DummyIcon',
|
|
124
|
+
render() {
|
|
125
|
+
return h('svg', { class: 'dummy-icon' }, [
|
|
126
|
+
h('circle', { cx: 10, cy: 10, r: 10 }),
|
|
127
|
+
]);
|
|
128
|
+
},
|
|
129
|
+
});
|
|
135
130
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
const tabsWithIcon = [
|
|
132
|
+
{ label: 'Tab 1', icon: DummyIcon },
|
|
133
|
+
{ label: 'Tab 2' },
|
|
134
|
+
];
|
|
140
135
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
136
|
+
const wrapper = mount(MTabs, {
|
|
137
|
+
props: {
|
|
138
|
+
tabs: tabsWithIcon,
|
|
139
|
+
},
|
|
140
|
+
});
|
|
146
141
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
const firstTabButton = wrapper.findAll('button.mc-tabs__tab')[0];
|
|
143
|
+
expect(firstTabButton.findComponent(DummyIcon).exists()).toBe(true);
|
|
144
|
+
expect(firstTabButton.find('svg.dummy-icon').exists()).toBe(true);
|
|
150
145
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
});
|
|
146
|
+
const secondTabButton = wrapper.findAll('button.mc-tabs__tab')[1];
|
|
147
|
+
expect(secondTabButton.findComponent(DummyIcon).exists()).toBe(false);
|
|
148
|
+
});
|
|
154
149
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
-
import { action } from '
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import { action } from 'storybook/actions';
|
|
3
3
|
import MTag from './MTag.vue';
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof MTag> = {
|
|
@@ -59,10 +59,7 @@
|
|
|
59
59
|
type="button"
|
|
60
60
|
@click="id && emit('remove-tag', id)"
|
|
61
61
|
>
|
|
62
|
-
<CrossCircleFilled24
|
|
63
|
-
class="mc-tag-removable__icon"
|
|
64
|
-
aria-hidden="true"
|
|
65
|
-
/>
|
|
62
|
+
<CrossCircleFilled24 class="mc-tag-removable__icon" aria-hidden="true" />
|
|
66
63
|
<span class="mc-tag-removable__text">removableLabel</span>
|
|
67
64
|
</button>
|
|
68
65
|
</span>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
-
import { action } from '
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import { action } from 'storybook/actions';
|
|
3
3
|
|
|
4
4
|
import MTextInput from './MTextInput.vue';
|
|
5
5
|
import Search24 from '@mozaic-ds/icons-vue/src/components/Search24/Search24.vue';
|
|
@@ -19,13 +19,6 @@ const meta: Meta<typeof MTextInput> = {
|
|
|
19
19
|
id: 'textInputId',
|
|
20
20
|
placeholder: 'Placeholder',
|
|
21
21
|
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
$slots: {
|
|
24
|
-
table: {
|
|
25
|
-
disable: true,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
22
|
render: (args) => ({
|
|
30
23
|
components: { MTextInput, Search24 },
|
|
31
24
|
setup() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/vue3';
|
|
2
|
-
import { action } from '
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import { action } from 'storybook/actions';
|
|
3
3
|
|
|
4
4
|
import MToggleGroup from './MToggleGroup.vue';
|
|
5
5
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Meta } from '@storybook/blocks';
|
|
2
|
-
import { Source } from '@storybook/addon-docs';
|
|
1
|
+
import { Meta, Source } from '@storybook/addon-docs/blocks';
|
|
3
2
|
|
|
4
3
|
<Meta title="Using Icons" />
|
|
5
4
|
|
|
@@ -9,19 +8,11 @@ To use icons in Vue applications, you need to install a dedicated package.
|
|
|
9
8
|
|
|
10
9
|
You must first install the [npm package](https://www.npmjs.com/package/@mozaic-ds/icons-vue):
|
|
11
10
|
|
|
12
|
-
<Source
|
|
13
|
-
language="bash"
|
|
14
|
-
dark
|
|
15
|
-
code="npm install @mozaic-ds/icons-vue"
|
|
16
|
-
/>
|
|
11
|
+
<Source language="bash" dark code="npm install @mozaic-ds/icons-vue" />
|
|
17
12
|
|
|
18
13
|
Or with **Yarn**:
|
|
19
14
|
|
|
20
|
-
<Source
|
|
21
|
-
language="bash"
|
|
22
|
-
dark
|
|
23
|
-
code="yarn add @mozaic-ds/icons-vue"
|
|
24
|
-
/>
|
|
15
|
+
<Source language="bash" dark code="yarn add @mozaic-ds/icons-vue" />
|
|
25
16
|
|
|
26
17
|
You can then start importing the icon of your choice into your Vue component:
|
|
27
18
|
|
|
@@ -36,8 +27,9 @@ You can then start importing the icon of your choice into your Vue component:
|
|
|
36
27
|
</template>
|
|
37
28
|
|
|
38
29
|
<script setup>
|
|
39
|
-
import A11y20 from '@mozaic-ds/icons-vue/src/components/A11y20/A11y20.vue';
|
|
30
|
+
import A11y20 from '@mozaic-ds/icons-vue/src/components/A11y20/A11y20.vue';
|
|
40
31
|
</script>
|
|
32
|
+
|
|
41
33
|
`} />
|
|
42
34
|
|
|
43
35
|
[The full list of icons is available here](https://github.com/adeo/mozaic-icons-vue/tree/main/src/components).
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Meta } from '@storybook/blocks';
|
|
2
|
-
import { Source } from '@storybook/addon-docs';
|
|
1
|
+
import { Meta, Source } from '@storybook/addon-docs/blocks';
|
|
3
2
|
|
|
4
3
|
<Meta title="Using Presets" />
|
|
5
4
|
|
|
@@ -31,12 +30,13 @@ Once **Mozaic-Vue** is installed as shown, we can make the following changes:
|
|
|
31
30
|
All it has to do is insert the following code into its main Sass file (entrypoint stylesheet):
|
|
32
31
|
|
|
33
32
|
<Source
|
|
34
|
-
language=
|
|
33
|
+
language="css"
|
|
35
34
|
dark
|
|
36
35
|
code={`
|
|
37
36
|
// Entrypoint stylesheet
|
|
38
37
|
@use "@mozaic-ds/tokens/<presetName>" as *;
|
|
39
|
-
`}
|
|
38
|
+
`}
|
|
39
|
+
/>
|
|
40
40
|
|
|
41
41
|
> [!NOTE]
|
|
42
42
|
> The `<presetName>` string should be replaced by the name of the preset you want, one of the following values: `adeo | enki | mbrand`.
|
|
@@ -45,12 +45,13 @@ All it has to do is insert the following code into its main Sass file (entrypoin
|
|
|
45
45
|
For example, for ADEO
|
|
46
46
|
|
|
47
47
|
<Source
|
|
48
|
-
language=
|
|
48
|
+
language="css"
|
|
49
49
|
dark
|
|
50
50
|
code={`
|
|
51
51
|
// Entrypoint stylesheet
|
|
52
52
|
@use "@mozaic-ds/tokens/adeo" as *;
|
|
53
|
-
`}
|
|
53
|
+
`}
|
|
54
|
+
/>
|
|
54
55
|
|
|
55
56
|
### 2. Font by brand
|
|
56
57
|
|
|
@@ -65,7 +66,9 @@ The table below summarises which font to use depending on the brand.
|
|
|
65
66
|
</tr>
|
|
66
67
|
<tr>
|
|
67
68
|
<td>Leroy Merlin</td>
|
|
68
|
-
<td>
|
|
69
|
+
<td>
|
|
70
|
+
[LeroyMerlinSans](https://mozaic.adeo.cloud/foundations/typography/font-families/)
|
|
71
|
+
</td>
|
|
69
72
|
</tr>
|
|
70
73
|
<tr>
|
|
71
74
|
<td>Adeo</td>
|
|
@@ -86,7 +89,7 @@ From there, we can update the main style sheet of your project, in order to impo
|
|
|
86
89
|
@use "@mozaic-ds/styles/tools/t.font" as *;
|
|
87
90
|
|
|
88
91
|
body {
|
|
89
|
-
|
|
92
|
+
@include set-font-family();
|
|
90
93
|
}
|
|
91
94
|
`} />
|
|
92
95
|
|
|
@@ -109,7 +112,7 @@ You can do this as follows:
|
|
|
109
112
|
<Source
|
|
110
113
|
language="bash"
|
|
111
114
|
dark
|
|
112
|
-
code=
|
|
115
|
+
code="cp node_modules/@mozaic-ds/web-fonts/*.{woff,woff2} static/assets/fonts"
|
|
113
116
|
/>
|
|
114
117
|
|
|
115
118
|
### 3. Usage
|
package/src/main.ts
CHANGED
|
@@ -3,15 +3,19 @@ export { default as MButton } from './components/button/MButton.vue';
|
|
|
3
3
|
export { default as MCheckbox } from './components/checkbox/MCheckbox.vue';
|
|
4
4
|
export { default as MCheckboxGroup } from './components/checkboxgroup/MCheckboxGroup.vue';
|
|
5
5
|
export { default as MDivider } from './components/divider/MDivider.vue';
|
|
6
|
+
export { default as MDrawer } from './components/drawer/MDrawer.vue';
|
|
6
7
|
export { default as MField } from './components/field/MField.vue';
|
|
7
8
|
export { default as MFieldGroup } from './components/fieldgroup/MFieldGroup.vue';
|
|
8
9
|
export { default as MIconButton } from './components/iconbutton/MIconButton.vue';
|
|
9
10
|
export { default as MLink } from './components/link/MLink.vue';
|
|
10
11
|
export { default as MLoader } from './components/loader/MLoader.vue';
|
|
12
|
+
export { default as MLoadingOverlay } from './components/loadingoverlay/MLoadingOverlay.vue';
|
|
13
|
+
export { default as MModal } from './components/modal/MModal.vue';
|
|
11
14
|
export { default as MNumberBadge } from './components/numberbadge/MNumberBadge.vue';
|
|
12
15
|
export { default as MOverlay } from './components/overlay/MOverlay.vue';
|
|
13
16
|
export { default as MPagination } from './components/pagination/MPagination.vue';
|
|
14
17
|
export { default as MPasswordInput } from './components/passwordinput/MPasswordInput.vue';
|
|
18
|
+
export { default as MPincode } from './components/pincode/MPincode.vue';
|
|
15
19
|
export { default as MQuantitySelector } from './components/quantityselector/MQuantitySelector.vue';
|
|
16
20
|
export { default as MRadio } from './components/radio/MRadio.vue';
|
|
17
21
|
export { default as MRadioGroup } from './components/radiogroup/MRadioGroup.vue';
|