@mozaic-ds/vue 2.6.0 → 2.7.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/README.md +3 -3
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +334 -274
- package/dist/mozaic-vue.js +1215 -1144
- 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 +9 -7
- package/src/components/Contributing.mdx +1 -1
- package/src/components/GettingStarted.mdx +1 -1
- package/src/components/Introduction.mdx +1 -1
- package/src/components/Support.mdx +1 -1
- package/src/components/avatar/MAvatar.stories.ts +1 -0
- package/src/components/avatar/MAvatar.vue +2 -2
- package/src/components/avatar/README.md +16 -0
- package/src/components/breadcrumb/MBreadcrumb.stories.ts +1 -0
- package/src/components/breadcrumb/MBreadcrumb.vue +3 -3
- package/src/components/breadcrumb/README.md +11 -0
- package/src/components/button/MButton.stories.ts +1 -2
- package/src/components/button/MButton.vue +7 -2
- package/src/components/button/README.md +24 -0
- package/src/components/callout/MCallout.stories.ts +1 -0
- package/src/components/callout/MCallout.vue +5 -5
- package/src/components/callout/README.md +19 -0
- package/src/components/checkbox/MCheckbox.vue +5 -1
- package/src/components/checkbox/README.md +23 -0
- package/src/components/checkboxgroup/MCheckboxGroup.stories.ts +1 -1
- package/src/components/checkboxgroup/MCheckboxGroup.vue +1 -1
- package/src/components/checkboxgroup/README.md +20 -0
- package/src/components/circularprogressbar/MCircularProgressbar.stories.ts +1 -0
- package/src/components/circularprogressbar/MCircularProgressbar.vue +2 -2
- package/src/components/circularprogressbar/README.md +14 -0
- package/src/components/container/MContainer.stories.ts +11 -3
- package/src/components/container/MContainer.vue +3 -3
- package/src/components/container/README.md +16 -0
- package/src/components/datepicker/MDatepicker.stories.ts +2 -1
- package/src/components/datepicker/MDatepicker.vue +7 -3
- package/src/components/datepicker/README.md +24 -0
- package/src/components/divider/MDivider.spec.ts +5 -5
- package/src/components/divider/MDivider.stories.ts +8 -13
- package/src/components/divider/MDivider.vue +8 -8
- package/src/components/divider/README.md +18 -0
- package/src/components/drawer/MDrawer.spec.ts +28 -0
- package/src/components/drawer/MDrawer.stories.ts +1 -0
- package/src/components/drawer/MDrawer.vue +16 -5
- package/src/components/drawer/README.md +29 -0
- package/src/components/field/MField.vue +1 -1
- package/src/components/field/README.md +24 -0
- package/src/components/fieldgroup/README.md +22 -0
- package/src/components/flag/MFlag.vue +2 -2
- package/src/components/flag/README.md +11 -0
- package/src/components/iconbutton/MIconButton.stories.ts +1 -0
- package/src/components/iconbutton/MIconButton.vue +2 -2
- package/src/components/iconbutton/README.md +21 -0
- package/src/components/linearprogressbarbuffer/MLinearProgressbarBuffer.stories.ts +1 -0
- package/src/components/linearprogressbarbuffer/MLinearProgressbarBuffer.vue +5 -1
- package/src/components/linearprogressbarbuffer/README.md +11 -0
- package/src/components/linearprogressbarpercentage/MLinearProgressbarPercentage.stories.ts +1 -0
- package/src/components/linearprogressbarpercentage/MLinearProgressbarPercentage.vue +4 -0
- package/src/components/linearprogressbarpercentage/README.md +10 -0
- package/src/components/link/MLink.stories.ts +2 -2
- package/src/components/link/MLink.vue +22 -12
- package/src/components/link/README.md +23 -0
- package/src/components/loader/MLoader.vue +1 -1
- package/src/components/loader/README.md +12 -0
- package/src/components/loadingoverlay/MLoadingOverlay.stories.ts +1 -1
- package/src/components/loadingoverlay/MLoadingOverlay.vue +4 -0
- package/src/components/loadingoverlay/README.md +11 -0
- package/src/components/modal/MModal.vue +11 -7
- package/src/components/modal/README.md +28 -0
- package/src/components/numberbadge/MNumberBadge.vue +4 -4
- package/src/components/numberbadge/README.md +12 -0
- package/src/components/overlay/MOverlay.stories.ts +1 -1
- package/src/components/overlay/MOverlay.vue +2 -2
- package/src/components/overlay/README.md +17 -0
- package/src/components/pagination/MPagination.stories.ts +1 -0
- package/src/components/pagination/MPagination.vue +1 -1
- package/src/components/pagination/README.md +20 -0
- package/src/components/passwordinput/MPasswordInput.vue +6 -2
- package/src/components/passwordinput/README.md +25 -0
- package/src/components/pincode/MPincode.spec.ts +4 -1
- package/src/components/pincode/MPincode.stories.ts +2 -1
- package/src/components/pincode/MPincode.vue +10 -2
- package/src/components/pincode/README.md +22 -0
- package/src/components/quantityselector/MQuantitySelector.stories.ts +1 -1
- package/src/components/quantityselector/MQuantitySelector.vue +6 -2
- package/src/components/quantityselector/README.md +27 -0
- package/src/components/radio/MRadio.vue +5 -1
- package/src/components/radio/README.md +21 -0
- package/src/components/radiogroup/MRadioGroup.vue +1 -1
- package/src/components/radiogroup/README.md +21 -0
- package/src/components/segmentedcontrol/MSegmentedControl.spec.ts +116 -0
- package/src/components/segmentedcontrol/MSegmentedControl.stories.ts +78 -0
- package/src/components/segmentedcontrol/MSegmentedControl.vue +92 -0
- package/src/components/segmentedcontrol/README.md +19 -0
- package/src/components/select/MSelect.vue +6 -2
- package/src/components/select/README.md +24 -0
- package/src/components/statusbadge/MStatusBadge.stories.ts +1 -1
- package/src/components/statusbadge/MStatusBadge.vue +3 -3
- package/src/components/statusbadge/README.md +11 -0
- package/src/components/statusdot/MStatusDot.stories.ts +1 -0
- package/src/components/statusdot/MStatusDot.vue +3 -3
- package/src/components/statusdot/README.md +11 -0
- package/src/components/statusnotification/MStatusNotification.vue +3 -3
- package/src/components/statusnotification/README.md +25 -0
- package/src/components/tabs/MTabs.stories.ts +23 -1
- package/src/components/tabs/MTabs.vue +8 -0
- package/src/components/tabs/Mtabs.spec.ts +30 -9
- package/src/components/tabs/README.md +20 -0
- package/src/components/tag/MTag.stories.ts +1 -1
- package/src/components/tag/MTag.vue +4 -0
- package/src/components/tag/README.md +25 -0
- package/src/components/textarea/MTextArea.vue +5 -1
- package/src/components/textarea/README.md +25 -0
- package/src/components/textinput/MTextInput.vue +10 -6
- package/src/components/textinput/README.md +32 -0
- package/src/components/toaster/MToaster.stories.ts +1 -0
- package/src/components/toaster/MToaster.vue +4 -4
- package/src/components/toaster/README.md +28 -0
- package/src/components/toggle/MToggle.vue +6 -2
- package/src/components/toggle/README.md +21 -0
- package/src/components/togglegroup/MToggleGroup.vue +2 -2
- package/src/components/togglegroup/README.md +20 -0
- package/src/components/tooltip/MTooltip.vue +8 -10
- package/src/components/tooltip/README.md +19 -0
- package/src/components/usingIcons.mdx +1 -1
- package/src/components/usingPresets.mdx +1 -1
- package/src/main.ts +6 -4
|
@@ -19,9 +19,9 @@ describe('MDivider component', () => {
|
|
|
19
19
|
expect(innerDiv.classes()).toContain('mc-divider-vertical');
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
it('applies the correct
|
|
22
|
+
it('applies the correct appearance class', () => {
|
|
23
23
|
const wrapper = mount(MDivider, {
|
|
24
|
-
props: {
|
|
24
|
+
props: { appearance: 'secondary' },
|
|
25
25
|
});
|
|
26
26
|
const innerDiv = wrapper.find('.mc-divider > div');
|
|
27
27
|
expect(innerDiv.classes()).toContain('mc-divider-horizontal--secondary');
|
|
@@ -38,7 +38,7 @@ describe('MDivider component', () => {
|
|
|
38
38
|
it('uses default props when none are provided', () => {
|
|
39
39
|
const wrapper = mount(MDivider);
|
|
40
40
|
expect(wrapper.props().orientation).toBe('horizontal');
|
|
41
|
-
expect(wrapper.props().
|
|
41
|
+
expect(wrapper.props().appearance).toBe('primary');
|
|
42
42
|
expect(wrapper.props().size).toBe('s');
|
|
43
43
|
});
|
|
44
44
|
|
|
@@ -46,12 +46,12 @@ describe('MDivider component', () => {
|
|
|
46
46
|
const wrapper = mount(MDivider, {
|
|
47
47
|
props: {
|
|
48
48
|
orientation: 'vertical',
|
|
49
|
-
|
|
49
|
+
appearance: 'tertiary',
|
|
50
50
|
size: 'l',
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
53
|
expect(wrapper.props().orientation).toBe('vertical');
|
|
54
|
-
expect(wrapper.props().
|
|
54
|
+
expect(wrapper.props().appearance).toBe('tertiary');
|
|
55
55
|
expect(wrapper.props().size).toBe('l');
|
|
56
56
|
});
|
|
57
57
|
});
|
|
@@ -4,18 +4,13 @@ import MDivider from './MDivider.vue';
|
|
|
4
4
|
const meta: Meta<typeof MDivider> = {
|
|
5
5
|
title: 'Structure/Divider',
|
|
6
6
|
component: MDivider,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
options: ['primary', 'secondary', 'tertiary', 'inverse'],
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
control: 'radio',
|
|
18
|
-
options: ['s', 'm', 'l'],
|
|
7
|
+
tags: ['v2'],
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component:
|
|
12
|
+
'A divider is a visual element used to separate content or sections within an interface. It helps improve readability and organization by creating clear distinctions between groups of information. Dividers can be thin lines, thick separators, or even styled with spacing variations, adapting to different layouts. They are commonly used in menus, lists, forms, and content blocks to create a structured visual hierarchy.',
|
|
13
|
+
},
|
|
19
14
|
},
|
|
20
15
|
},
|
|
21
16
|
render: (args) => ({
|
|
@@ -60,5 +55,5 @@ export const Size: Story = {
|
|
|
60
55
|
};
|
|
61
56
|
|
|
62
57
|
export const Secondary: Story = {
|
|
63
|
-
args: {
|
|
58
|
+
args: { appearance: 'secondary' },
|
|
64
59
|
};
|
|
@@ -8,26 +8,26 @@
|
|
|
8
8
|
<script setup lang="ts">
|
|
9
9
|
import { computed, type VNode } from 'vue';
|
|
10
10
|
/**
|
|
11
|
-
* A
|
|
11
|
+
* A divider is a visual element used to separate content or sections within an interface. It helps improve readability and organization by creating clear distinctions between groups of information. Dividers can be thin lines, thick separators, or even styled with spacing variations, adapting to different layouts. They are commonly used in menus, lists, forms, and content blocks to create a structured visual hierarchy.
|
|
12
12
|
*/
|
|
13
13
|
const props = withDefaults(
|
|
14
14
|
defineProps<{
|
|
15
15
|
/**
|
|
16
|
-
* Determines the orientation of the divider
|
|
16
|
+
* Determines the orientation of the divider.
|
|
17
17
|
*/
|
|
18
18
|
orientation?: 'vertical' | 'horizontal';
|
|
19
19
|
/**
|
|
20
|
-
* Determines the
|
|
20
|
+
* Determines the appearance of the divider.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
appearance?: 'primary' | 'secondary' | 'tertiary' | 'inverse';
|
|
23
23
|
/**
|
|
24
|
-
* Determines the size of the divider
|
|
24
|
+
* Determines the size of the divider.
|
|
25
25
|
*/
|
|
26
26
|
size?: 's' | 'm' | 'l';
|
|
27
27
|
}>(),
|
|
28
28
|
{
|
|
29
29
|
orientation: 'horizontal',
|
|
30
|
-
|
|
30
|
+
appearance: 'primary',
|
|
31
31
|
size: 's',
|
|
32
32
|
},
|
|
33
33
|
);
|
|
@@ -42,8 +42,8 @@ defineSlots<{
|
|
|
42
42
|
const classObject = computed(() => {
|
|
43
43
|
return {
|
|
44
44
|
[`mc-divider-${props.orientation}`]: props.orientation,
|
|
45
|
-
[`mc-divider-horizontal--${props.
|
|
46
|
-
props.
|
|
45
|
+
[`mc-divider-horizontal--${props.appearance}`]:
|
|
46
|
+
props.appearance && props.appearance != 'primary',
|
|
47
47
|
[`mc-divider-horizontal--${props.size}`]: props.size && props.size != 's',
|
|
48
48
|
};
|
|
49
49
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# MDivider
|
|
2
|
+
|
|
3
|
+
A divider is a visual element used to separate content or sections within an interface. It helps improve readability and organization by creating clear distinctions between groups of information. Dividers can be thin lines, thick separators, or even styled with spacing variations, adapting to different layouts. They are commonly used in menus, lists, forms, and content blocks to create a structured visual hierarchy.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `orientation` | Determines the orientation of the divider. | `"horizontal"` `"vertical"` | `"horizontal"` |
|
|
11
|
+
| `appearance` | Determines the appearance of the divider. | `"inverse"` `"primary"` `"secondary"` `"tertiary"` | `"primary"` |
|
|
12
|
+
| `size` | Determines the size of the divider. | `"s"` `"m"` `"l"` | `"s"` |
|
|
13
|
+
|
|
14
|
+
## Slots
|
|
15
|
+
|
|
16
|
+
| Name | Description |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `default` | Use this slot to insert the content who need a vertical divider |
|
|
@@ -97,4 +97,32 @@ describe('MDrawer component', () => {
|
|
|
97
97
|
|
|
98
98
|
expect(wrapper.find('.mc-drawer__back').exists()).toBe(false);
|
|
99
99
|
});
|
|
100
|
+
|
|
101
|
+
it('sets the focus on the title when the drawer opens', async () => {
|
|
102
|
+
const wrapper = mount(MDrawer, {
|
|
103
|
+
props: {
|
|
104
|
+
title: 'Test Title',
|
|
105
|
+
},
|
|
106
|
+
attachTo: document.body,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const titleElement = wrapper.find('.mc-drawer__title').element;
|
|
110
|
+
expect(document.activeElement).not.toBe(titleElement);
|
|
111
|
+
await wrapper.setProps({ open: true });
|
|
112
|
+
expect(document.activeElement).toBe(titleElement);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('does not set the focus on the title when the drawer closes', async () => {
|
|
116
|
+
const wrapper = mount(MDrawer, {
|
|
117
|
+
props: {
|
|
118
|
+
title: 'Test Title',
|
|
119
|
+
open: true
|
|
120
|
+
},
|
|
121
|
+
attachTo: document.body,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const titleElement = wrapper.find('.mc-drawer__title').element;
|
|
125
|
+
await wrapper.setProps({ open: false });
|
|
126
|
+
expect(document.activeElement).not.toBe(titleElement);
|
|
127
|
+
});
|
|
100
128
|
});
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<ArrowBack24 aria-hidden="true" />
|
|
25
25
|
</template>
|
|
26
26
|
</MIconButton>
|
|
27
|
-
<h2 class="mc-drawer__title" id="drawerTitle">{{ title }}</h2>
|
|
27
|
+
<h2 class="mc-drawer__title" tabindex="-1" id="drawerTitle" ref="titleRef">{{ title }}</h2>
|
|
28
28
|
<MIconButton
|
|
29
29
|
class="mc-drawer__close"
|
|
30
30
|
aria-label="Close"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script setup lang="ts">
|
|
56
|
-
import { computed, watch, type VNode } from 'vue';
|
|
56
|
+
import { computed, watch, type VNode, ref } from 'vue';
|
|
57
57
|
import ArrowBack24 from '@mozaic-ds/icons-vue/src/components/ArrowBack24/ArrowBack24.vue';
|
|
58
58
|
import Cross24 from '@mozaic-ds/icons-vue/src/components/Cross24/Cross24.vue';
|
|
59
59
|
import MIconButton from '../iconbutton/MIconButton.vue';
|
|
@@ -67,7 +67,7 @@ const props = defineProps<{
|
|
|
67
67
|
*/
|
|
68
68
|
open?: boolean;
|
|
69
69
|
/**
|
|
70
|
-
* Position of the drawer
|
|
70
|
+
* Position of the drawer.
|
|
71
71
|
*/
|
|
72
72
|
position?: 'left' | 'right';
|
|
73
73
|
/**
|
|
@@ -79,11 +79,11 @@ const props = defineProps<{
|
|
|
79
79
|
*/
|
|
80
80
|
back?: boolean;
|
|
81
81
|
/**
|
|
82
|
-
* Title of the drawer
|
|
82
|
+
* Title of the drawer.
|
|
83
83
|
*/
|
|
84
84
|
title: string;
|
|
85
85
|
/**
|
|
86
|
-
* Title of the content of the drawer
|
|
86
|
+
* Title of the content of the drawer.
|
|
87
87
|
*/
|
|
88
88
|
contentTitle?: string;
|
|
89
89
|
}>();
|
|
@@ -115,6 +115,13 @@ watch(
|
|
|
115
115
|
},
|
|
116
116
|
);
|
|
117
117
|
|
|
118
|
+
const titleRef = ref<HTMLElement | null>(null);
|
|
119
|
+
watch(() => props.open, (newValue) => {
|
|
120
|
+
if (newValue && titleRef.value) {
|
|
121
|
+
titleRef.value.focus();
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
118
125
|
const onClose = () => {
|
|
119
126
|
emit('update:open', false);
|
|
120
127
|
};
|
|
@@ -129,6 +136,10 @@ const emit = defineEmits<{
|
|
|
129
136
|
*/
|
|
130
137
|
(on: 'back'): void;
|
|
131
138
|
}>();
|
|
139
|
+
|
|
140
|
+
defineOptions({
|
|
141
|
+
inheritAttrs: false,
|
|
142
|
+
});
|
|
132
143
|
</script>
|
|
133
144
|
|
|
134
145
|
<style lang="scss" scoped>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# MDrawer
|
|
2
|
+
|
|
3
|
+
A drawer is a sliding panel that appears from the side of the screen, providing additional content, settings, or actions without disrupting the main view. It is often used for filtering options, or contextual details. It enhances usability by keeping interfaces clean while offering expandable functionality.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `open` | If `true`, display the drawer. | `boolean` | - |
|
|
11
|
+
| `position` | Position of the drawer. | `"left"` `"right"` | - |
|
|
12
|
+
| `extended` | If `true`, the drawer have a bigger width. | `boolean` | - |
|
|
13
|
+
| `back` | If `true`, display the back button. | `boolean` | - |
|
|
14
|
+
| `title*` | Title of the drawer. | `string` | - |
|
|
15
|
+
| `contentTitle` | Title of the content of the drawer. | `string` | - |
|
|
16
|
+
|
|
17
|
+
## Slots
|
|
18
|
+
|
|
19
|
+
| Name | Description |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `default` | Use this slot to insert the content of the drawer |
|
|
22
|
+
| `footer` | Use this slot to insert buttons in the footer |
|
|
23
|
+
|
|
24
|
+
## Events
|
|
25
|
+
|
|
26
|
+
| Name | Description | Type |
|
|
27
|
+
| --- | --- | --- |
|
|
28
|
+
| `back` | Emits when click back button of the drawer. | [] |
|
|
29
|
+
| `update:open` | Emits when the drawer open state changes, updating the modelValue prop. | [value: boolean] |
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<script setup lang="ts">
|
|
30
30
|
import { computed, type VNode } from 'vue';
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* A field label is a text element that identifies the purpose of an input field, providing users with clear guidance on what information to enter. It is typically placed above the input field and may include indicators for required or optional fields. Field Labels improve form usability, accessibility, and data entry accuracy by ensuring users understand the expected input.
|
|
33
33
|
*/
|
|
34
34
|
const props = defineProps<{
|
|
35
35
|
/**
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# MField
|
|
2
|
+
|
|
3
|
+
A field label is a text element that identifies the purpose of an input field, providing users with clear guidance on what information to enter. It is typically placed above the input field and may include indicators for required or optional fields. Field Labels improve form usability, accessibility, and data entry accuracy by ensuring users understand the expected input.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the form field, used to associate the label with the form element. | `string` | - |
|
|
11
|
+
| `label*` | The text displayed as the label for the form field. | `string` | - |
|
|
12
|
+
| `requirementText` | Additional text displayed alongside the label, typically used to indicate if the form field is required or optional | `string` | - |
|
|
13
|
+
| `helpText` | Text shown below the form field to provide additional context or instructions for the user. | `string` | - |
|
|
14
|
+
| `helpId` | The value of the `id` attribute set on the **helpText** element. _This value is mandatory when using a helpText in order to guarantee the accessibility of the component._ | `string` | - |
|
|
15
|
+
| `isValid` | If `true`, applies a valid state to the form field. | `boolean` | - |
|
|
16
|
+
| `isInvalid` | If `true`, applies an invalid state to the form field. | `boolean` | - |
|
|
17
|
+
| `messageId` | The value of the `id` attribute set on the **validationMessage** element. _This value is mandatory when using a validationMessage in order to guarantee the accessibility of the component._ | `string` | - |
|
|
18
|
+
| `message` | message displayed when the form field has a valid or invalid state, usually indicating validation or errors. | `string` | - |
|
|
19
|
+
|
|
20
|
+
## Slots
|
|
21
|
+
|
|
22
|
+
| Name | Description |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `default` | Use this slot to insert the form element of your choice |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# MFieldGroup
|
|
2
|
+
|
|
3
|
+
This component creates a structured form field for group field such as Radio Group, Checkbox Group or Toggle Group with a label, optional help text, error and validation message handling.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the form field, used to associate the label with the form element. | `string` | - |
|
|
11
|
+
| `legend*` | The text displayed as the legend for the form fieldset. | `string` | - |
|
|
12
|
+
| `requirementText` | Additional text displayed alongside the label, typically used to indicate if the form field is required or optional | `string` | - |
|
|
13
|
+
| `helpText` | Text shown below the form field to provide additional context or instructions for the user. | `string` | - |
|
|
14
|
+
| `isValid` | If `true`, applies a valid state to the form field. | `boolean` | - |
|
|
15
|
+
| `isInvalid` | If `true`, applies an invalid state to the form field. | `boolean` | - |
|
|
16
|
+
| `message` | message displayed when the form field has a valid or invalid state, usually indicating validation or errors. | `string` | - |
|
|
17
|
+
|
|
18
|
+
## Slots
|
|
19
|
+
|
|
20
|
+
| Name | Description |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `default` | Use this slot to insert the form element of your choice |
|
|
@@ -13,11 +13,11 @@ import { computed } from 'vue';
|
|
|
13
13
|
*/
|
|
14
14
|
const props = defineProps<{
|
|
15
15
|
/**
|
|
16
|
-
* Label of the Flag
|
|
16
|
+
* Label of the Flag.
|
|
17
17
|
*/
|
|
18
18
|
label: string;
|
|
19
19
|
/**
|
|
20
|
-
* Allows to define the Flag
|
|
20
|
+
* Allows to define the Flag appearance.
|
|
21
21
|
*/
|
|
22
22
|
appearance?: 'danger' | 'accent' | 'inverse' | 'standard';
|
|
23
23
|
}>();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# MFlag
|
|
2
|
+
|
|
3
|
+
A flag is used to display meta-information about a product or service, acting as a visual indicator of the main category of content. It is typically placed at the top of an element to ensure immediate visibility.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `label*` | Label of the Flag. | `string` | - |
|
|
11
|
+
| `appearance` | Allows to define the Flag appearance. | `"standard"` `"inverse"` `"accent"` `"danger"` | - |
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<script setup lang="ts">
|
|
15
15
|
import { computed, type VNode } from 'vue';
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Buttons are key interactive elements used to perform actions and can be used as standalone element, or as part of another component. Their appearance depends on the type of action required from the user and the context in which they are used.
|
|
18
18
|
*/
|
|
19
19
|
const props = withDefaults(
|
|
20
20
|
defineProps<{
|
|
@@ -52,7 +52,7 @@ const props = withDefaults(
|
|
|
52
52
|
|
|
53
53
|
defineSlots<{
|
|
54
54
|
/**
|
|
55
|
-
* Use this slot to insert
|
|
55
|
+
* Use this slot to insert an icon for the Button.
|
|
56
56
|
*/
|
|
57
57
|
icon: VNode;
|
|
58
58
|
}>();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIconButton
|
|
2
|
+
|
|
3
|
+
Buttons are key interactive elements used to perform actions and can be used as standalone element, or as part of another component. Their appearance depends on the type of action required from the user and the context in which they are used.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `appearance` | Defines the visual style of the icon button. | `"standard"` `"inverse"` `"accent"` `"danger"` | `"standard"` |
|
|
11
|
+
| `size` | Determines the size of the icon button. | `"s"` `"m"` `"l"` | `"m"` |
|
|
12
|
+
| `disabled` | If `true`, disables the icon button, making it non-interactive. | `boolean` | - |
|
|
13
|
+
| `ghost` | If `true`, applies a "ghost" style to the icon button. | `boolean` | - |
|
|
14
|
+
| `outlined` | If `true`, the icon button gets an outlined style. | `boolean` | - |
|
|
15
|
+
| `type` | Specifies the button's HTML `type` attribute. | `"button"` `"reset"` `"submit"` | `"button"` |
|
|
16
|
+
|
|
17
|
+
## Slots
|
|
18
|
+
|
|
19
|
+
| Name | Description |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `icon` | Use this slot to insert an icon for the Button. |
|
|
@@ -4,6 +4,7 @@ import MLinearProgressbarBuffer from './MLinearProgressbarBuffer.vue';
|
|
|
4
4
|
const meta: Meta<typeof MLinearProgressbarBuffer> = {
|
|
5
5
|
title: 'Indicators/Linear Progress Bar (Buffer)',
|
|
6
6
|
component: MLinearProgressbarBuffer,
|
|
7
|
+
tags: ['v2'],
|
|
7
8
|
parameters: {
|
|
8
9
|
docs: {
|
|
9
10
|
description: {
|
|
@@ -20,7 +20,7 @@ import { computed } from 'vue';
|
|
|
20
20
|
const props = withDefaults(
|
|
21
21
|
defineProps<{
|
|
22
22
|
/**
|
|
23
|
-
* Allows to define the progress bar size
|
|
23
|
+
* Allows to define the progress bar size.
|
|
24
24
|
*/
|
|
25
25
|
size?: 's' | 'm' | 'l';
|
|
26
26
|
/**
|
|
@@ -39,6 +39,10 @@ const classObject = computed(() => {
|
|
|
39
39
|
props.size && props.size != 'm',
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
|
+
|
|
43
|
+
defineOptions({
|
|
44
|
+
inheritAttrs: false,
|
|
45
|
+
});
|
|
42
46
|
</script>
|
|
43
47
|
|
|
44
48
|
<style lang="scss" scoped>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# MLinearProgressbarBuffer
|
|
2
|
+
|
|
3
|
+
A linear progress bar (Buffer) visually represents the progress of a task along a horizontal track, often indicating both current progress and a secondary buffered state. This type of progress bar is commonly used for loading processes, file uploads, or streaming indicators, where part of the task is completed while another portion is preloaded or buffered. It provides users with real-time feedback on task advancement.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `size` | Allows to define the progress bar size. | `"s"` `"m"` `"l"` | - |
|
|
11
|
+
| `value` | The current value of the progress bar. | `number` | `0` |
|
|
@@ -4,6 +4,7 @@ import MLinearProgressbarPercentage from './MLinearProgressbarPercentage.vue';
|
|
|
4
4
|
const meta: Meta<typeof MLinearProgressbarPercentage> = {
|
|
5
5
|
title: 'Indicators/Linear Progress Bar (Percentage)',
|
|
6
6
|
component: MLinearProgressbarPercentage,
|
|
7
|
+
tags: ['v2'],
|
|
7
8
|
parameters: {
|
|
8
9
|
docs: {
|
|
9
10
|
description: {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# MLinearProgressbarPercentage
|
|
2
|
+
|
|
3
|
+
A linear progress bar (Percentage) visually represents the completion of a task along a horizontal track, displaying the exact progress in percentage within the bar. It is commonly used for file uploads, installations, form completion, or any process requiring user awareness of progress. The percentage label provides clear and immediate feedback, helping users track progress with precision.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `value` | The current value of the progress bar. | `number` | `0` |
|
|
@@ -4,13 +4,13 @@ import ChevronLeft24 from '@mozaic-ds/icons-vue/src/components/ChevronLeft24/Che
|
|
|
4
4
|
import ChevronRight24 from '@mozaic-ds/icons-vue/src/components/ChevronRight24/ChevronRight24.vue';
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof MLink> = {
|
|
7
|
-
title: 'Navigation/Link
|
|
7
|
+
title: 'Navigation/Link',
|
|
8
8
|
component: MLink,
|
|
9
9
|
parameters: {
|
|
10
10
|
docs: {
|
|
11
11
|
description: {
|
|
12
12
|
component:
|
|
13
|
-
'A link is
|
|
13
|
+
'A link is an interactive text element used to navigate between pages, sections, or external resources. It is typically underlined and styled to indicate its clickable nature. Links can be standalone or embedded within text, and they may include icons to reinforce their purpose. They are essential for navigation and content referencing in web and application interfaces.',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
:is="router ? 'router-link' : 'a'"
|
|
4
4
|
class="mc-link"
|
|
5
5
|
:class="classObject"
|
|
6
|
-
|
|
7
|
-
:target="target"
|
|
8
|
-
:to="router ? href : undefined"
|
|
6
|
+
v-bind="linkProps"
|
|
9
7
|
>
|
|
10
8
|
<span
|
|
11
9
|
v-if="$slots.icon && iconPosition == 'left'"
|
|
@@ -30,7 +28,7 @@
|
|
|
30
28
|
<script setup lang="ts">
|
|
31
29
|
import { computed, type VNode } from 'vue';
|
|
32
30
|
/**
|
|
33
|
-
* A link is
|
|
31
|
+
* A link is an interactive text element used to navigate between pages, sections, or external resources. It is typically underlined and styled to indicate its clickable nature. Links can be standalone or embedded within text, and they may include icons to reinforce their purpose. They are essential for navigation and content referencing in web and application interfaces.
|
|
34
32
|
*/
|
|
35
33
|
const props = withDefaults(
|
|
36
34
|
defineProps<{
|
|
@@ -39,11 +37,11 @@ const props = withDefaults(
|
|
|
39
37
|
*/
|
|
40
38
|
iconPosition?: 'left' | 'right';
|
|
41
39
|
/**
|
|
42
|
-
* Allows to define the link
|
|
40
|
+
* Allows to define the link appearance.
|
|
43
41
|
*/
|
|
44
42
|
appearance?: 'secondary' | 'accent' | 'inverse' | 'standard';
|
|
45
43
|
/**
|
|
46
|
-
* Allows to define the link size
|
|
44
|
+
* Allows to define the link size.
|
|
47
45
|
*/
|
|
48
46
|
size?: 's' | 'm';
|
|
49
47
|
/**
|
|
@@ -51,11 +49,11 @@ const props = withDefaults(
|
|
|
51
49
|
*/
|
|
52
50
|
href?: string;
|
|
53
51
|
/**
|
|
54
|
-
* Where to open the link
|
|
52
|
+
* Where to open the link.
|
|
55
53
|
*/
|
|
56
54
|
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
57
55
|
/**
|
|
58
|
-
* Specify wether the link is inline
|
|
56
|
+
* Specify wether the link is inline.
|
|
59
57
|
*/
|
|
60
58
|
inline?: boolean;
|
|
61
59
|
/**
|
|
@@ -64,8 +62,6 @@ const props = withDefaults(
|
|
|
64
62
|
router?: boolean;
|
|
65
63
|
}>(),
|
|
66
64
|
{
|
|
67
|
-
href: undefined,
|
|
68
|
-
target: undefined,
|
|
69
65
|
appearance: 'standard',
|
|
70
66
|
size: 's',
|
|
71
67
|
iconPosition: 'left',
|
|
@@ -74,11 +70,11 @@ const props = withDefaults(
|
|
|
74
70
|
|
|
75
71
|
defineSlots<{
|
|
76
72
|
/**
|
|
77
|
-
* Use this slot to insert the textual content of the Link
|
|
73
|
+
* Use this slot to insert the textual content of the Link.
|
|
78
74
|
*/
|
|
79
75
|
default: string;
|
|
80
76
|
/**
|
|
81
|
-
* Use this slot to insert an icon for the Link
|
|
77
|
+
* Use this slot to insert an icon for the Link.
|
|
82
78
|
*/
|
|
83
79
|
icon?: VNode;
|
|
84
80
|
}>();
|
|
@@ -92,6 +88,20 @@ const classObject = computed(() => {
|
|
|
92
88
|
'mc-link--stand-alone': !props.inline,
|
|
93
89
|
};
|
|
94
90
|
});
|
|
91
|
+
|
|
92
|
+
const linkProps = computed(() => {
|
|
93
|
+
if (props.router) {
|
|
94
|
+
return {
|
|
95
|
+
to: props.href,
|
|
96
|
+
target: props.target,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
href: props.href,
|
|
102
|
+
target: props.target,
|
|
103
|
+
};
|
|
104
|
+
});
|
|
95
105
|
</script>
|
|
96
106
|
|
|
97
107
|
<style lang="scss" scoped>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# MLink
|
|
2
|
+
|
|
3
|
+
A link is an interactive text element used to navigate between pages, sections, or external resources. It is typically underlined and styled to indicate its clickable nature. Links can be standalone or embedded within text, and they may include icons to reinforce their purpose. They are essential for navigation and content referencing in web and application interfaces.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `iconPosition` | Position of the icon relative to the text. | `"left"` `"right"` | `"left"` |
|
|
11
|
+
| `appearance` | Allows to define the link appearance. | `"standard"` `"inverse"` `"accent"` `"secondary"` | `"standard"` |
|
|
12
|
+
| `size` | Allows to define the link size. | `"s"` `"m"` | `"s"` |
|
|
13
|
+
| `href` | URL for the link (for external links or the `to` prop for `router-link`). | `string` | - |
|
|
14
|
+
| `target` | Where to open the link. | `"_self"` `"_blank"` `"_parent"` `"_top"` | - |
|
|
15
|
+
| `inline` | Specify wether the link is inline. | `boolean` | - |
|
|
16
|
+
| `router` | If `true`, the link will be rendered as a `router-link` for internal navigation (Vue Router). | `boolean` | - |
|
|
17
|
+
|
|
18
|
+
## Slots
|
|
19
|
+
|
|
20
|
+
| Name | Description |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `default` | Use this slot to insert the textual content of the Link. |
|
|
23
|
+
| `icon` | Use this slot to insert an icon for the Link. |
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<script setup lang="ts">
|
|
23
23
|
import { computed } from 'vue';
|
|
24
24
|
/**
|
|
25
|
-
* A loader
|
|
25
|
+
* A loader is a visual indicator used to inform users that a process is in progress, typically during data fetching, page loading, or background operations. It provides feedback that the system is working, helping to manage user expectations and reduce perceived wait time.
|
|
26
26
|
*/
|
|
27
27
|
const props = withDefaults(
|
|
28
28
|
defineProps<{
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# MLoader
|
|
2
|
+
|
|
3
|
+
A loader is a visual indicator used to inform users that a process is in progress, typically during data fetching, page loading, or background operations. It provides feedback that the system is working, helping to manage user expectations and reduce perceived wait time.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `appearance` | Specifies the visual appearance of the loader. | `"standard"` `"inverse"` `"accent"` | `"standard"` |
|
|
11
|
+
| `size` | Defines the size of the loader. | `"s"` `"m"` `"l"` | `"m"` |
|
|
12
|
+
| `text` | Text to display alongside the loader when using the loader inside an `Overlay`. | `string` | - |
|
|
@@ -10,7 +10,7 @@ const meta: Meta<typeof MLoadingOverlay> = {
|
|
|
10
10
|
story: { height: '400px' },
|
|
11
11
|
description: {
|
|
12
12
|
component:
|
|
13
|
-
'
|
|
13
|
+
'A loading overlay is a full-screen or container-level layer that indicates a process is in progress, preventing user interaction until the task is completed. It includes a progress indicator, and a message to inform users about the loading state. Loading Overlays are commonly used in data-heavy applications, form submissions, and page transitions to enhance user experience by managing wait times effectively.',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|