@mozaic-ds/vue 2.11.0 → 2.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozaic-ds/vue",
3
- "version": "2.11.0",
3
+ "version": "2.12.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",
@@ -41,7 +41,7 @@
41
41
  "*.d.ts"
42
42
  ],
43
43
  "dependencies": {
44
- "@mozaic-ds/styles": "^2.4.0",
44
+ "@mozaic-ds/styles": "^2.6.0",
45
45
  "@mozaic-ds/web-fonts": "^1.65.0",
46
46
  "postcss-scss": "^4.0.9",
47
47
  "vue": "^3.5.13"
@@ -0,0 +1,111 @@
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, it, expect } from 'vitest';
3
+ import MBuiltInMenu, { type MenuItem } from './MBuiltInMenu.vue';
4
+ import { defineComponent } from 'vue';
5
+
6
+ // Dummy icon component to simulate passed icon
7
+ const DummyIcon = defineComponent({
8
+ name: 'DummyIcon',
9
+ template: '<svg class="dummy-icon" />',
10
+ });
11
+
12
+ const items: MenuItem[] = [
13
+ { label: 'Item 1', icon: DummyIcon },
14
+ { label: 'Item 2', href: '/foo', target: '_blank' },
15
+ { label: 'Item 3' },
16
+ ];
17
+
18
+ describe('MBuiltInMenu', () => {
19
+ it('renders all item labels', () => {
20
+ const wrapper = mount(MBuiltInMenu, {
21
+ props: { items, modelValue: undefined },
22
+ });
23
+ const labels = wrapper.findAll('.mc-built-in-menu__label');
24
+ expect(labels.length).toBe(3);
25
+ expect(labels[0].text()).toBe('Item 1');
26
+ expect(labels[1].text()).toBe('Item 2');
27
+ expect(labels[2].text()).toBe('Item 3');
28
+ });
29
+
30
+ it('uses correct tags for link and buttons', () => {
31
+ const wrapper = mount(MBuiltInMenu, {
32
+ props: { items, modelValue: undefined },
33
+ });
34
+ expect(wrapper.findAll('a').length).toBe(1);
35
+ expect(wrapper.findAll('button').length).toBe(2);
36
+
37
+ const links = wrapper.findAll('.mc-built-in-menu__link');
38
+ const buttons = wrapper.findAll('.mc-built-in-menu__button');
39
+ expect(links.length).toBe(1);
40
+ expect(buttons.length).toBe(2);
41
+ });
42
+
43
+ it('renders an anchor with href and provided target', () => {
44
+ const items: MenuItem[] = [
45
+ { label: 'Anchor', href: '/path', target: '_blank' },
46
+ ];
47
+ const wrapper = mount(MBuiltInMenu, {
48
+ props: { items, modelValue: undefined },
49
+ });
50
+
51
+ const a = wrapper.find('a');
52
+ expect(a).not.toBeNull();
53
+ expect(a?.attributes('href')).toBe('/path');
54
+ expect(a?.attributes('target')).toBe('_blank');
55
+ });
56
+
57
+ it('renders a router-link with to and default target when target omitted', () => {
58
+ const items: MenuItem[] = [{ label: 'Router', to: '/route' }];
59
+ const wrapper = mount(MBuiltInMenu, {
60
+ props: { items, modelValue: undefined },
61
+ });
62
+
63
+ const routerLink = wrapper.find('router-link');
64
+ expect(routerLink).not.toBeNull();
65
+ expect(routerLink?.attributes('to')).toBe('/route');
66
+ expect(routerLink?.attributes('target')).toBe('_self');
67
+ });
68
+
69
+ it('emits update:modelValue when an item is clicked', async () => {
70
+ const wrapper = mount(MBuiltInMenu, {
71
+ props: { items, modelValue: undefined },
72
+ });
73
+ const menuItems = wrapper.findAll(
74
+ '.mc-built-in-menu__button, .mc-built-in-menu__link',
75
+ );
76
+
77
+ await menuItems[1].trigger('click');
78
+ const emitted = wrapper.emitted('update:modelValue');
79
+ expect(emitted).toBeTruthy();
80
+ expect(emitted![0][0]).toBe(1);
81
+ });
82
+
83
+ it('marks the selected item with aria-current and selected class', () => {
84
+ const wrapper = mount(MBuiltInMenu, {
85
+ props: { items, modelValue: 2 },
86
+ });
87
+ const lis = wrapper.findAll('li');
88
+ const selectedItem = lis[2];
89
+ expect(selectedItem.attributes('aria-current')).toBe('true');
90
+ expect(selectedItem.classes()).toContain(
91
+ 'mc-built-in-menu__item--selected',
92
+ );
93
+ });
94
+
95
+ it('renders provided icon component inside the item', () => {
96
+ const wrapper = mount(MBuiltInMenu, {
97
+ props: { items, modelValue: undefined },
98
+ });
99
+ const firstItem = wrapper.findAll('li')[0];
100
+ expect(firstItem.find('.dummy-icon').exists()).toBe(true);
101
+ });
102
+
103
+ it('applies outlined class when outlined prop is true', () => {
104
+ const wrapper = mount(MBuiltInMenu, {
105
+ props: { items, modelValue: undefined, outlined: true },
106
+ });
107
+ expect(wrapper.find('nav').classes()).toContain(
108
+ 'mc-built-in-menu--outlined',
109
+ );
110
+ });
111
+ });
@@ -0,0 +1,58 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import MBuiltInMenu from './MBuiltInMenu.vue';
3
+ import Less24 from '@mozaic-ds/icons-vue/src/components/Less24/Less24.vue';
4
+ import { action } from 'storybook/actions';
5
+
6
+ const meta: Meta<typeof MBuiltInMenu> = {
7
+ title: 'Navigation/Built-in menu',
8
+ component: MBuiltInMenu,
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component:
13
+ 'A built-in menu is a structured list of navigational or interactive options, typically displayed as a vertical stack. It allows users to browse categories, access settings, or navigate through different sections of an interface.',
14
+ },
15
+ },
16
+ },
17
+ args: {
18
+ items: [
19
+ { label: 'Label' },
20
+ { label: 'Label' },
21
+ { label: 'Label' },
22
+ { label: 'Label' },
23
+ ],
24
+ modelValue: 0,
25
+ },
26
+ render: (args) => ({
27
+ components: { MBuiltInMenu },
28
+ setup() {
29
+ const handleUpdate = action('update:modelValue');
30
+
31
+ return { args, handleUpdate };
32
+ },
33
+ template: `
34
+ <MBuiltInMenu v-model="args.modelValue" v-bind="args" @update:modelValue="handleUpdate"></MBuiltInMenu>
35
+ `,
36
+ }),
37
+ };
38
+ export default meta;
39
+ type Story = StoryObj<typeof MBuiltInMenu>;
40
+
41
+ export const Default: Story = {};
42
+
43
+ export const WithIcons: Story = {
44
+ args: {
45
+ items: [
46
+ { label: 'Label', icon: Less24 },
47
+ { label: 'Label', icon: Less24 },
48
+ { label: 'Label', icon: Less24 },
49
+ { label: 'Label', icon: Less24 },
50
+ ],
51
+ },
52
+ };
53
+
54
+ export const Outlined: Story = {
55
+ args: {
56
+ outlined: true,
57
+ },
58
+ };
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <nav
3
+ :class="{
4
+ 'mc-built-in-menu': true,
5
+ 'mc-built-in-menu--outlined': props.outlined,
6
+ }"
7
+ aria-label="menu"
8
+ >
9
+ <ul class="mc-built-in-menu__list">
10
+ <li
11
+ v-for="(item, index) in props.items"
12
+ :key="index"
13
+ :class="{
14
+ 'mc-built-in-menu__item': true,
15
+ 'mc-built-in-menu__item--selected': currentMenuItem === index,
16
+ }"
17
+ v-bind="currentMenuItem === index ? { 'aria-current': true } : {}"
18
+ >
19
+ <component
20
+ :is="getItemTag(item)"
21
+ :class="{
22
+ 'mc-built-in-menu__button': getItemTag(item) === 'button',
23
+ 'mc-built-in-menu__link': isLink(item),
24
+ }"
25
+ v-bind="isLink(item) ? getLinkAttrs(item) : {}"
26
+ @click="currentMenuItem = index"
27
+ >
28
+ <component
29
+ v-if="item.icon"
30
+ :is="item.icon"
31
+ class="mc-built-in-menu__icon"
32
+ />
33
+
34
+ <span class="mc-built-in-menu__label">{{ item.label }}</span>
35
+
36
+ <ChevronRight20 class="mc-built-in-menu__icon" />
37
+ </component>
38
+ </li>
39
+ </ul>
40
+ </nav>
41
+ </template>
42
+
43
+ <script setup lang="ts">
44
+ import ChevronRight20 from '@mozaic-ds/icons-vue/src/components/ChevronRight20/ChevronRight20.vue';
45
+ import { computed, type Component } from 'vue';
46
+
47
+ /**
48
+ * A built-in menu is a structured list of navigational or interactive options, typically displayed as a vertical stack. It allows users to browse categories, access settings, or navigate through different sections of an interface.
49
+ */
50
+
51
+ export type MenuItem = {
52
+ label: string;
53
+ icon?: Component;
54
+ href?: string;
55
+ to?: string;
56
+ target?: '_self' | '_blank' | '_parent' | '_top';
57
+ };
58
+
59
+ const props = defineProps<{
60
+ /**
61
+ * Specifies the key of the currently selected menu item. It allows the component to highlight or style the corresponding item to indicate it is selected or currently in use.
62
+ */
63
+ modelValue?: number;
64
+ /**
65
+ * Defines the menu items, each of which can include an icon and act as a button, link, or router-link.
66
+ */
67
+ items: MenuItem[];
68
+ /**
69
+ * When enabled, adds a visible border around the wrapper to highlight or separate its content.
70
+ */
71
+ outlined?: boolean;
72
+ }>();
73
+
74
+ const emit = defineEmits<{
75
+ /**
76
+ * Emitted when the selected item changes, providing the updated selected value.
77
+ */
78
+ (on: 'update:modelValue', value: number): void;
79
+ }>();
80
+
81
+ const currentMenuItem = computed({
82
+ get() {
83
+ return props.modelValue;
84
+ },
85
+ set(value: number) {
86
+ emit('update:modelValue', value);
87
+ },
88
+ });
89
+
90
+ function getItemTag(item: MenuItem) {
91
+ if (item.href) return 'a';
92
+ if (item.to) return 'router-link';
93
+ return 'button';
94
+ }
95
+
96
+ function isLink(item: MenuItem) {
97
+ return getItemTag(item) === 'a' || getItemTag(item) === 'router-link';
98
+ }
99
+
100
+ function getLinkAttrs(item: MenuItem) {
101
+ return {
102
+ ...(getItemTag(item) === 'a' ? { href: item.href } : { to: item.to }),
103
+ target: item.target || '_self',
104
+ };
105
+ }
106
+ </script>
107
+
108
+ <style lang="scss" scoped>
109
+ @use '@mozaic-ds/styles/components/built-in-menu';
110
+ </style>
@@ -0,0 +1,18 @@
1
+ # MBuiltInMenu
2
+
3
+ A built-in menu is a structured list of navigational or interactive options, typically displayed as a vertical stack. It allows users to browse categories, access settings, or navigate through different sections of an interface.
4
+
5
+
6
+ ## Props
7
+
8
+ | Name | Description | Type | Default |
9
+ | --- | --- | --- | --- |
10
+ | `modelValue` | Specifies the key of the currently selected menu item. It allows the component to highlight or style the corresponding item to indicate it is selected or currently in use. | `number` | - |
11
+ | `items*` | Defines the menu items, each of which can include an icon and act as a button, link, or router-link. | `MenuItem[]` | - |
12
+ | `outlined` | When enabled, adds a visible border around the wrapper to highlight or separate its content. | `boolean` | - |
13
+
14
+ ## Events
15
+
16
+ | Name | Description | Type |
17
+ | --- | --- | --- |
18
+ | `update:modelValue` | Emitted when the selected item changes, providing the updated selected value. | [value: number] |
@@ -0,0 +1,77 @@
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, it, expect } from 'vitest';
3
+ import MCheckListMenu, { type CheckListMenuItem } from './MCheckListMenu.vue';
4
+ import CheckCircleFilled24 from '@mozaic-ds/icons-vue/src/components/CheckCircleFilled24/CheckCircleFilled24.vue';
5
+ import type { MenuItem } from '../builtinmenu/MBuiltInMenu.vue';
6
+
7
+ const StubMBuiltInMenu = {
8
+ name: 'MBuiltInMenu',
9
+ props: ['modelValue', 'items', 'outlined'],
10
+ emits: ['update:modelValue'],
11
+ template: '<div />',
12
+ };
13
+
14
+ describe('MCheckListMenu', () => {
15
+ it('maps items and sets icon for checked items', () => {
16
+ const items: CheckListMenuItem[] = [
17
+ {
18
+ label: 'One',
19
+ checked: true,
20
+ href: '/one',
21
+ to: undefined,
22
+ target: undefined,
23
+ },
24
+ {
25
+ label: 'Two',
26
+ checked: false,
27
+ href: undefined,
28
+ to: '/two',
29
+ target: '_blank',
30
+ },
31
+ ];
32
+
33
+ const wrapper = mount(MCheckListMenu, {
34
+ props: { items, modelValue: undefined },
35
+ global: { components: { MBuiltInMenu: StubMBuiltInMenu } },
36
+ });
37
+
38
+ const builtIn = wrapper.findComponent(StubMBuiltInMenu);
39
+ const passedItems = builtIn.props('items') as MenuItem[];
40
+
41
+ expect(passedItems).toHaveLength(2);
42
+ expect(passedItems[0].label).toBe('One');
43
+ expect(passedItems[0].icon).toBe(CheckCircleFilled24);
44
+ expect(passedItems[0].href).toBe('/one');
45
+
46
+ expect(passedItems[1].label).toBe('Two');
47
+ expect(passedItems[1].icon).toBeUndefined();
48
+ expect(passedItems[1].to).toBe('/two');
49
+ expect(passedItems[1].target).toBe('_blank');
50
+ });
51
+
52
+ it('forwards outlined prop to MBuiltInMenu', () => {
53
+ const items = [{ label: 'A', checked: false }];
54
+ const wrapper = mount(MCheckListMenu, {
55
+ props: { items, modelValue: undefined, outlined: true },
56
+ global: { components: { MBuiltInMenu: StubMBuiltInMenu } },
57
+ });
58
+
59
+ const builtIn = wrapper.findComponent(StubMBuiltInMenu);
60
+ expect(builtIn.props('outlined')).toBe(true);
61
+ });
62
+
63
+ it('emits update:modelValue when inner menu updates modelValue', async () => {
64
+ const items = [{ label: 'X', checked: false }];
65
+ const wrapper = mount(MCheckListMenu, {
66
+ props: { items, modelValue: undefined },
67
+ global: { components: { MBuiltInMenu: StubMBuiltInMenu } },
68
+ });
69
+
70
+ const builtIn = wrapper.findComponent(StubMBuiltInMenu);
71
+ await builtIn.vm.$emit('update:modelValue', 3);
72
+
73
+ const emitted = wrapper.emitted('update:modelValue');
74
+ expect(emitted).toBeTruthy();
75
+ expect(emitted![0]).toEqual([3]);
76
+ });
77
+ });
@@ -0,0 +1,46 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import MCheckListMenu from './MCheckListMenu.vue';
3
+ import { action } from 'storybook/actions';
4
+
5
+ const meta: Meta<typeof MCheckListMenu> = {
6
+ title: 'Navigation/Check-list menu',
7
+ component: MCheckListMenu,
8
+ parameters: {
9
+ docs: {
10
+ description: {
11
+ component:
12
+ 'A check-list menu is a structured vertical list where each item represents a distinct section of content. It enables users to navigate through and validate different parts of an interface in any order. Unlike linear steppers, this component offers flexibility by allowing non-sequential completion, making it ideal for user profile setup, application settings, or flexible onboarding processes where users can choose their own path through the experience.',
13
+ },
14
+ },
15
+ },
16
+ args: {
17
+ items: [
18
+ { label: 'Label', checked: true },
19
+ { label: 'Label', checked: true },
20
+ { label: 'Label', checked: false },
21
+ { label: 'Label', checked: true },
22
+ ],
23
+ modelValue: 0,
24
+ },
25
+ render: (args) => ({
26
+ components: { MCheckListMenu },
27
+ setup() {
28
+ const handleUpdate = action('update:modelValue');
29
+
30
+ return { args, handleUpdate };
31
+ },
32
+ template: `
33
+ <MCheckListMenu v-model="args.modelValue" v-bind="args" @update:modelValue="handleUpdate"></MCheckListMenu>
34
+ `,
35
+ }),
36
+ };
37
+ export default meta;
38
+ type Story = StoryObj<typeof MCheckListMenu>;
39
+
40
+ export const Default: Story = {};
41
+
42
+ export const Outlined: Story = {
43
+ args: {
44
+ outlined: true,
45
+ },
46
+ };
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <MBuiltInMenu
3
+ v-model="currentMenuItem"
4
+ :items="menuItems"
5
+ :outlined="props.outlined"
6
+ />
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import { computed } from 'vue';
11
+ import MBuiltInMenu from '../builtinmenu/MBuiltInMenu.vue';
12
+ import type { MenuItem } from '../builtinmenu/MBuiltInMenu.vue';
13
+ import CheckCircleFilled24 from '@mozaic-ds/icons-vue/src/components/CheckCircleFilled24/CheckCircleFilled24.vue';
14
+
15
+ /**
16
+ * A check-list menu is a structured vertical list where each item represents a distinct section of content. It enables users to navigate through and validate different parts of an interface in any order. Unlike linear steppers, this component offers flexibility by allowing non-sequential completion, making it ideal for user profile setup, application settings, or flexible onboarding processes where users can choose their own path through the experience.
17
+ */
18
+
19
+ export type CheckListMenuItem = Omit<MenuItem, 'icon'> & { checked: boolean };
20
+
21
+ const props = defineProps<{
22
+ /**
23
+ * Specifies the key of the currently selected menu item. It allows the component to highlight or style the corresponding item to indicate it is selected or currently in use.
24
+ */
25
+ modelValue?: number;
26
+ /**
27
+ * Defines the menu items, each of which sets a checked state and act as a button, link, or router-link.
28
+ */
29
+ items: CheckListMenuItem[];
30
+ /**
31
+ * When enabled, adds a visible border around the wrapper to highlight or separate its content.
32
+ */
33
+ outlined?: boolean;
34
+ }>();
35
+
36
+ const emit = defineEmits<{
37
+ /**
38
+ * Emitted when the selected item changes, providing the updated selected value.
39
+ */
40
+ (on: 'update:modelValue', value: number): void;
41
+ }>();
42
+
43
+ const currentMenuItem = computed({
44
+ get() {
45
+ return props.modelValue;
46
+ },
47
+ set(value: number) {
48
+ emit('update:modelValue', value);
49
+ },
50
+ });
51
+
52
+ const menuItems = computed<MenuItem[]>(() =>
53
+ props.items.map((item) => ({
54
+ label: item.label,
55
+ icon: item.checked ? CheckCircleFilled24 : undefined,
56
+ href: item.href,
57
+ to: item.to,
58
+ target: item.target,
59
+ })),
60
+ );
61
+ </script>
@@ -0,0 +1,18 @@
1
+ # MCheckListMenu
2
+
3
+ A check-list menu is a structured vertical list where each item represents a distinct section of content. It enables users to navigate through and validate different parts of an interface in any order. Unlike linear steppers, this component offers flexibility by allowing non-sequential completion, making it ideal for user profile setup, application settings, or flexible onboarding processes where users can choose their own path through the experience.
4
+
5
+
6
+ ## Props
7
+
8
+ | Name | Description | Type | Default |
9
+ | --- | --- | --- | --- |
10
+ | `modelValue` | Specifies the key of the currently selected menu item. It allows the component to highlight or style the corresponding item to indicate it is selected or currently in use. | `number` | - |
11
+ | `items*` | Defines the menu items, each of which sets a checked state and act as a button, link, or router-link. | `CheckListMenuItem[]` | - |
12
+ | `outlined` | When enabled, adds a visible border around the wrapper to highlight or separate its content. | `boolean` | - |
13
+
14
+ ## Events
15
+
16
+ | Name | Description | Type |
17
+ | --- | --- | --- |
18
+ | `update:modelValue` | Emitted when the selected item changes, providing the updated selected value. | [value: number] |
@@ -0,0 +1,78 @@
1
+ import { mount } from '@vue/test-utils';
2
+ import MStepperInline from './MStepperInline.vue';
3
+ import { describe, it, expect } from 'vitest';
4
+
5
+ describe('MStepperInline', () => {
6
+ const defaultSteps = [
7
+ { label: 'Step 1' },
8
+ { label: 'Step 2' },
9
+ { label: 'Step 3' },
10
+ ];
11
+
12
+ it('renders correctly with default props', () => {
13
+ const wrapper = mount(MStepperInline, {
14
+ props: {
15
+ currentStep: 1,
16
+ steps: defaultSteps,
17
+ },
18
+ });
19
+
20
+ expect(wrapper.exists()).toBe(true);
21
+ expect(wrapper.findAll('.mc-stepper-inline__item').length).toBe(
22
+ defaultSteps.length,
23
+ );
24
+ expect(wrapper.find('.mc-stepper-inline__label').text()).toContain(
25
+ 'Step 1',
26
+ );
27
+ });
28
+
29
+ it('displays additional information when provided', () => {
30
+ const stepsWithInfo = [
31
+ { label: 'Step 1', additionalInfo: 'Info 1' },
32
+ { label: 'Step 2', additionalInfo: 'Info 2' },
33
+ ];
34
+ const wrapper = mount(MStepperInline, {
35
+ props: {
36
+ currentStep: 1,
37
+ steps: stepsWithInfo,
38
+ },
39
+ });
40
+
41
+ expect(wrapper.findAll('.mc-stepper-inline__additional').length).toBe(
42
+ stepsWithInfo.length,
43
+ );
44
+ expect(wrapper.find('.mc-stepper-inline__additional').text()).toBe(
45
+ 'Info 1',
46
+ );
47
+ });
48
+
49
+ it('marks the correct step as active', async () => {
50
+ const wrapper = mount(MStepperInline, {
51
+ props: {
52
+ currentStep: 2,
53
+ steps: defaultSteps,
54
+ },
55
+ });
56
+
57
+ const labels = wrapper.findAll('.mc-stepper-inline__label');
58
+ expect(labels[1].classes()).toContain('is-current');
59
+ expect(labels[0].classes()).not.toContain('is-current');
60
+
61
+ await wrapper.setProps({ currentStep: 3 });
62
+ expect(labels[2].classes()).toContain('is-current');
63
+ });
64
+
65
+ it('marks completed steps', () => {
66
+ const wrapper = mount(MStepperInline, {
67
+ props: {
68
+ currentStep: 3,
69
+ steps: defaultSteps,
70
+ },
71
+ });
72
+
73
+ const items = wrapper.findAll('.mc-stepper-inline__item');
74
+ expect(items[0].classes()).toContain('is-completed');
75
+ expect(items[1].classes()).toContain('is-completed');
76
+ expect(items[2].classes()).not.toContain('is-completed');
77
+ });
78
+ });
@@ -0,0 +1,49 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import MStepperInline from './MStepperInline.vue';
3
+
4
+ const meta: Meta<typeof MStepperInline> = {
5
+ title: 'Indicators/Stepper Inline',
6
+ component: MStepperInline,
7
+ tags: ['v2'],
8
+ parameters: {
9
+ docs: {
10
+ description: {
11
+ component:
12
+ 'A stepper is a navigation component that guides users through a sequence of steps in a structured process. It visually represents progress, completed steps, and upcoming steps, helping users understand their position within a workflow. Steppers are commonly used in multi-step forms, onboarding flows, checkout processes, and task completion sequences to improve clarity and reduce cognitive load.',
13
+ },
14
+ },
15
+ },
16
+ args: {
17
+ currentStep: 1,
18
+ steps: [
19
+ { label: 'Cart' },
20
+ { label: 'Delivery address' },
21
+ { label: 'Payment' },
22
+ { label: 'Order confirmation' },
23
+ ],
24
+ },
25
+ render: (args) => ({
26
+ components: { MStepperInline },
27
+ setup() {
28
+ return { args };
29
+ },
30
+ template: `<MStepperInline v-bind="args" />`,
31
+ }),
32
+ };
33
+
34
+ export default meta;
35
+ type Story = StoryObj<typeof MStepperInline>;
36
+
37
+ export const Default: Story = {};
38
+
39
+ export const AditionnalInfo: Story = {
40
+ args: {
41
+ currentStep: 2,
42
+ steps: [
43
+ { label: 'Cart', additionalInfo: 'Additional information' },
44
+ { label: 'Delivery address', additionalInfo: 'Additional information' },
45
+ { label: 'Payment', additionalInfo: 'Additional information' },
46
+ { label: 'Order confirmation', additionalInfo: 'Additional information' },
47
+ ],
48
+ },
49
+ };