@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/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +308 -211
- package/dist/mozaic-vue.js +1370 -1192
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +5 -5
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +2 -2
- package/src/components/builtinmenu/MBuiltInMenu.spec.ts +111 -0
- package/src/components/builtinmenu/MBuiltInMenu.stories.ts +58 -0
- package/src/components/builtinmenu/MBuiltInMenu.vue +110 -0
- package/src/components/builtinmenu/README.md +18 -0
- package/src/components/checklistmenu/MCheckListMenu.spec.ts +77 -0
- package/src/components/checklistmenu/MCheckListMenu.stories.ts +46 -0
- package/src/components/checklistmenu/MCheckListMenu.vue +61 -0
- package/src/components/checklistmenu/README.md +18 -0
- package/src/components/stepperinline/MStepperInline.spec.ts +78 -0
- package/src/components/stepperinline/MStepperInline.stories.ts +49 -0
- package/src/components/stepperinline/MStepperInline.vue +94 -0
- package/src/components/stepperinline/README.md +11 -0
- package/src/main.ts +3 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav class="mc-stepper-inline" aria-label="Stepper">
|
|
3
|
+
<ol class="mc-stepper-inline__container">
|
|
4
|
+
<li
|
|
5
|
+
v-for="(step, i) in steps"
|
|
6
|
+
:key="i"
|
|
7
|
+
class="mc-stepper-inline__item"
|
|
8
|
+
:class="{ 'is-completed': stepStates[i].completed }"
|
|
9
|
+
:tabindex="stepStates[i].completed ? 0 : undefined"
|
|
10
|
+
>
|
|
11
|
+
<Check24
|
|
12
|
+
class="mc-stepper-inline__icon mc-stepper-inline__icon--check"
|
|
13
|
+
v-if="stepStates[i].completed"
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
/>
|
|
16
|
+
<span
|
|
17
|
+
v-else
|
|
18
|
+
class="mc-stepper-inline__circle"
|
|
19
|
+
:class="{ 'is-current': stepStates[i].current }"
|
|
20
|
+
>
|
|
21
|
+
{{ i + 1 }}
|
|
22
|
+
</span>
|
|
23
|
+
<div class="mc-stepper-inline__content">
|
|
24
|
+
<span
|
|
25
|
+
class="mc-stepper-inline__label"
|
|
26
|
+
:class="{ 'is-current': stepStates[i].current }"
|
|
27
|
+
>
|
|
28
|
+
{{ step.label }}
|
|
29
|
+
</span>
|
|
30
|
+
<span
|
|
31
|
+
v-if="step.additionalInfo"
|
|
32
|
+
class="mc-stepper-inline__additional"
|
|
33
|
+
>
|
|
34
|
+
{{ step.additionalInfo }}
|
|
35
|
+
</span>
|
|
36
|
+
</div>
|
|
37
|
+
<ChevronRight24
|
|
38
|
+
v-if="i < steps.length - 1"
|
|
39
|
+
class="mc-stepper-inline__icon mc-stepper-inline__icon--chevron"
|
|
40
|
+
/>
|
|
41
|
+
</li>
|
|
42
|
+
</ol>
|
|
43
|
+
</nav>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
import { computed } from 'vue';
|
|
48
|
+
import Check24 from '@mozaic-ds/icons-vue/src/components/Check24/Check24.vue';
|
|
49
|
+
import ChevronRight24 from '@mozaic-ds/icons-vue/src/components/ChevronRight24/ChevronRight24.vue';
|
|
50
|
+
/**
|
|
51
|
+
* 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.
|
|
52
|
+
*/
|
|
53
|
+
const props = withDefaults(
|
|
54
|
+
defineProps<{
|
|
55
|
+
/**
|
|
56
|
+
* Current step of the stepper compact.
|
|
57
|
+
*/
|
|
58
|
+
currentStep?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Steps of the stepper inline.
|
|
61
|
+
*/
|
|
62
|
+
steps?: Array<{
|
|
63
|
+
/**
|
|
64
|
+
* Label of the step.
|
|
65
|
+
*/
|
|
66
|
+
label: string;
|
|
67
|
+
/**
|
|
68
|
+
* Optional additional information under the label.
|
|
69
|
+
*/
|
|
70
|
+
additionalInfo?: string;
|
|
71
|
+
}>;
|
|
72
|
+
}>(),
|
|
73
|
+
{
|
|
74
|
+
currentStep: 1,
|
|
75
|
+
steps: () => [],
|
|
76
|
+
},
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const safeStep = computed(() =>
|
|
80
|
+
Math.min(Math.max(props.currentStep, 1), props.steps.length),
|
|
81
|
+
);
|
|
82
|
+
const steps = props.steps;
|
|
83
|
+
|
|
84
|
+
const stepStates = computed(() =>
|
|
85
|
+
steps.map((_, i) => ({
|
|
86
|
+
completed: i + 1 < safeStep.value,
|
|
87
|
+
current: i + 1 === safeStep.value,
|
|
88
|
+
})),
|
|
89
|
+
);
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<style scoped lang="scss">
|
|
93
|
+
@use '@mozaic-ds/styles/components/stepper-inline';
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# MStepperInline
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `currentStep` | Current step of the stepper compact. | `number` | `1` |
|
|
11
|
+
| `steps` | Steps of the stepper inline. | `{ label: string; additionalInfo?: string` `undefined; }[]` | `[]` |
|
package/src/main.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { default as MAvatar } from './components/avatar/MAvatar.vue';
|
|
2
2
|
export { default as MBreadcrumb } from './components/breadcrumb/MBreadcrumb.vue';
|
|
3
|
+
export { default as MBuiltInMenu } from './components/builtinmenu/MBuiltInMenu.vue';
|
|
3
4
|
export { default as MButton } from './components/button/MButton.vue';
|
|
4
5
|
export { default as MCallout } from './components/callout/MCallout.vue';
|
|
5
6
|
export { default as MCarousel } from './components/carousel/MCarousel.vue';
|
|
6
7
|
export { default as MCheckbox } from './components/checkbox/MCheckbox.vue';
|
|
7
8
|
export { default as MCheckboxGroup } from './components/checkboxgroup/MCheckboxGroup.vue';
|
|
9
|
+
export { default as MCheckListMenu } from './components/checklistmenu/MCheckListMenu.vue';
|
|
8
10
|
export { default as MCircularProgressbar } from './components/circularprogressbar/MCircularProgressbar.vue';
|
|
9
11
|
export { default as MContainer } from './components/container/MContainer.vue';
|
|
10
12
|
export { default as MDatepicker } from './components/datepicker/MDatepicker.vue';
|
|
@@ -37,6 +39,7 @@ export { default as MStatusDot } from './components/statusdot/MStatusDot.vue';
|
|
|
37
39
|
export { default as MStatusMessage } from './components/statusmessage/MStatusMessage.vue';
|
|
38
40
|
export { default as MStatusNotification } from './components/statusnotification/MStatusNotification.vue';
|
|
39
41
|
export { default as MStepperCompact } from './components/steppercompact/MStepperCompact.vue';
|
|
42
|
+
export { default as MStepperInline } from './components/stepperinline/MStepperInline.vue';
|
|
40
43
|
export { default as MTabs } from './components/tabs/MTabs.vue';
|
|
41
44
|
export { default as MTag } from './components/tag/MTag.vue';
|
|
42
45
|
export { default as MTextArea } from './components/textarea/MTextArea.vue';
|