@mozaic-ds/vue 2.18.0 → 2.19.1

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.
Files changed (132) hide show
  1. package/dist/mozaic-vue.css +1 -1
  2. package/dist/mozaic-vue.d.ts +961 -2085
  3. package/dist/mozaic-vue.js +1253 -1143
  4. package/dist/mozaic-vue.js.map +1 -1
  5. package/dist/mozaic-vue.umd.cjs +6 -6
  6. package/dist/mozaic-vue.umd.cjs.map +1 -1
  7. package/package.json +8 -6
  8. package/src/components/BrandPresets.mdx +20 -2
  9. package/src/components/accordionlist/MAccordionList.figma.ts +16 -16
  10. package/src/components/accordionlist/MAccordionList.stories.ts +1 -1
  11. package/src/components/accordionlistitem/MAccordionListItem.figma.ts +9 -5
  12. package/src/components/accordionlistitem/MAccordionListItem.vue +4 -1
  13. package/src/components/accordionlistitem/README.md +2 -0
  14. package/src/components/actionbottombar/MActionBottomBar.figma.ts +7 -7
  15. package/src/components/actionlistbox/MActionListbox.figma.ts +11 -11
  16. package/src/components/actionlistbox/MActionListbox.spec.ts +113 -0
  17. package/src/components/actionlistbox/MActionListbox.vue +63 -5
  18. package/src/components/avatar/MAvatar.figma.ts +5 -5
  19. package/src/components/breadcrumb/MBreadcrumb.figma.ts +7 -7
  20. package/src/components/breadcrumb/MBreadcrumb.vue +1 -1
  21. package/src/components/builtinmenu/MBuiltInMenu.figma.ts +8 -5
  22. package/src/components/builtinmenu/MBuiltInMenu.spec.ts +3 -1
  23. package/src/components/button/MButton.figma.ts +21 -6
  24. package/src/components/button/MButton.spec.ts +26 -0
  25. package/src/components/button/MButton.vue +2 -0
  26. package/src/components/callout/MCallout.figma.ts +7 -7
  27. package/src/components/callout/MCallout.stories.ts +0 -3
  28. package/src/components/callout/MCallout.vue +4 -3
  29. package/src/components/callout/README.md +2 -2
  30. package/src/components/carousel/MCarousel.figma.ts +10 -10
  31. package/src/components/carousel/MCarousel.spec.ts +26 -2
  32. package/src/components/carousel/MCarousel.vue +10 -4
  33. package/src/components/checkbox/MCheckbox.figma.ts +10 -10
  34. package/src/components/checkboxgroup/MCheckboxGroup.figma.ts +7 -7
  35. package/src/components/checklistmenu/MCheckListMenu.figma.ts +8 -8
  36. package/src/components/circularprogressbar/MCircularProgressbar.figma.ts +7 -3
  37. package/src/components/combobox/MCombobox.figma.ts +10 -10
  38. package/src/components/combobox/MCombobox.vue +7 -0
  39. package/src/components/container/MContainer.figma.ts +5 -5
  40. package/src/components/datatable/DataTable.stories.ts +33 -7
  41. package/src/components/datatable/DataTableCells.stories.ts +2 -2
  42. package/src/components/datatable/DataTableEmpty.stories.ts +2 -2
  43. package/src/components/datatable/DataTableExpandable.stories.ts +2 -2
  44. package/src/components/datatable/DataTableNested.stories.ts +1 -1
  45. package/src/components/datatable/DataTableSelectable.stories.ts +2 -3
  46. package/src/components/datatable/DataTableSortable.stories.ts +1 -1
  47. package/src/components/datepicker/MDatepicker.figma.ts +3 -3
  48. package/src/components/divider/MDivider.figma.ts +3 -3
  49. package/src/components/drawer/MDrawer.figma.ts +13 -13
  50. package/src/components/drawer/MDrawer.spec.ts +102 -3
  51. package/src/components/drawer/MDrawer.vue +73 -14
  52. package/src/components/field/MField.figma.ts +9 -5
  53. package/src/components/field/MField.vue +1 -0
  54. package/src/components/fileuploader/MFileUploader.figma.ts +3 -3
  55. package/src/components/fileuploader/MFileUploader.vue +2 -2
  56. package/src/components/fileuploaderitem/MFileUploaderItem.figma.ts +7 -3
  57. package/src/components/fileuploaderitem/MFileUploaderItem.vue +2 -7
  58. package/src/components/flag/MFlag.figma.ts +3 -3
  59. package/src/components/iconbutton/MIconButton.figma.ts +16 -16
  60. package/src/components/iconbutton/MIconButton.spec.ts +15 -0
  61. package/src/components/iconbutton/MIconButton.vue +1 -0
  62. package/src/components/kpiitem/MKpiItem.figma.ts +8 -3
  63. package/src/components/kpiitem/MKpiItem.spec.ts +12 -0
  64. package/src/components/kpiitem/MKpiItem.vue +7 -1
  65. package/src/components/linearprogressbarbuffer/MLinearProgressbarBuffer.figma.ts +6 -3
  66. package/src/components/linearprogressbarpercentage/MLinearProgressbarPercentage.figma.ts +5 -3
  67. package/src/components/link/MLink.figma.ts +5 -5
  68. package/src/components/loader/MLoader.figma.ts +3 -3
  69. package/src/components/loadingoverlay/MLoadingOverlay.figma.ts +3 -3
  70. package/src/components/modal/MModal.figma.ts +12 -12
  71. package/src/components/modal/MModal.spec.ts +115 -3
  72. package/src/components/modal/MModal.vue +91 -11
  73. package/src/components/modal/README.md +1 -1
  74. package/src/components/navigationindicator/MNavigationIndicator.figma.ts +7 -3
  75. package/src/components/numberbadge/MNumberBadge.figma.ts +7 -3
  76. package/src/components/optionListbox/MOptionListbox.figma.ts +10 -10
  77. package/src/components/overlay/MOverlay.figma.ts +5 -5
  78. package/src/components/overlay/MOverlay.spec.ts +1 -1
  79. package/src/components/overlay/MOverlay.vue +1 -1
  80. package/src/components/pageheader/MPageHeader.figma.ts +3 -3
  81. package/src/components/pagination/MPagination.figma.ts +10 -10
  82. package/src/components/passwordinput/MPasswordInput.figma.ts +9 -9
  83. package/src/components/phonenumber/MPhoneNumber.figma.ts +9 -9
  84. package/src/components/phonenumber/MPhoneNumber.spec.ts +6 -2
  85. package/src/components/phonenumber/MPhoneNumber.vue +21 -15
  86. package/src/components/pincode/MPincode.figma.ts +9 -9
  87. package/src/components/popover/MPopover.figma.ts +15 -15
  88. package/src/components/quantityselector/MQuantitySelector.figma.ts +12 -12
  89. package/src/components/radio/MRadio.figma.ts +9 -9
  90. package/src/components/radiogroup/MRadioGroup.figma.ts +7 -7
  91. package/src/components/segmentedcontrol/MSegmentedControl.figma.ts +8 -8
  92. package/src/components/select/MSelect.figma.ts +11 -11
  93. package/src/components/sidebar/MSidebar.figma.ts +8 -8
  94. package/src/components/sidebar/MSidebar.vue +1 -0
  95. package/src/components/sidebarexpandableitem/MSidebarExpandableItem.figma.ts +8 -5
  96. package/src/components/sidebarexpandableitem/MSidebarExpandableItem.spec.ts +12 -0
  97. package/src/components/sidebarexpandableitem/MSidebarExpandableItem.vue +1 -0
  98. package/src/components/sidebarfooter/MSidebarFooter.figma.ts +7 -3
  99. package/src/components/sidebarheader/MSidebarHeader.figma.ts +3 -3
  100. package/src/components/sidebarnavitem/MSidebarNavItem.figma.ts +3 -3
  101. package/src/components/sidebarshortcutitem/MSidebarShortcutItem.figma.ts +3 -3
  102. package/src/components/starrating/MStarRating.figma.ts +7 -7
  103. package/src/components/statusbadge/MStatusBadge.figma.ts +3 -3
  104. package/src/components/statusdot/MStatusDot.figma.ts +3 -3
  105. package/src/components/statusmessage/MStatusMessage.figma.ts +3 -3
  106. package/src/components/statusnotification/MStatusNotification.figma.ts +7 -7
  107. package/src/components/stepperbottombar/MStepperBottomBar.figma.ts +3 -3
  108. package/src/components/steppercompact/MStepperCompact.figma.ts +8 -3
  109. package/src/components/steppercompact/MStepperCompact.spec.ts +9 -0
  110. package/src/components/steppercompact/MStepperCompact.vue +1 -1
  111. package/src/components/stepperinline/MStepperInline.figma.ts +6 -3
  112. package/src/components/stepperinline/MStepperInline.spec.ts +11 -0
  113. package/src/components/stepperinline/MStepperInline.stories.ts +5 -1
  114. package/src/components/stepperinline/MStepperInline.vue +1 -1
  115. package/src/components/stepperstacked/MStepperStacked.figma.ts +6 -3
  116. package/src/components/stepperstacked/MStepperStacked.spec.ts +13 -0
  117. package/src/components/stepperstacked/MStepperStacked.vue +1 -0
  118. package/src/components/tabs/MTabs.figma.ts +8 -8
  119. package/src/components/tag/MTag.figma.ts +3 -3
  120. package/src/components/textarea/MTextArea.figma.ts +8 -8
  121. package/src/components/textinput/MTextInput.figma.ts +12 -12
  122. package/src/components/textinput/MTextInput.vue +2 -2
  123. package/src/components/textinput/README.md +1 -1
  124. package/src/components/tile/MTile.figma.ts +5 -5
  125. package/src/components/tileclickable/MTileClickable.figma.ts +6 -6
  126. package/src/components/tileexpandable/MTileExpandable.figma.ts +6 -6
  127. package/src/components/tileselectable/MTileSelectable.figma.ts +9 -5
  128. package/src/components/toaster/MToaster.figma.ts +3 -3
  129. package/src/components/toggle/MToggle.figma.ts +9 -9
  130. package/src/components/toggle/MToggle.vue +1 -1
  131. package/src/components/togglegroup/MToggleGroup.figma.ts +7 -7
  132. package/src/components/tooltip/MTooltip.figma.ts +10 -5
@@ -33,18 +33,18 @@ figma.connect(
33
33
  },
34
34
  example: ({ size, disabled, readonly, isInvalid }) =>
35
35
  html`<script setup>
36
- import { MQuantitySelector } from '@mozaic-ds/vue';
37
- </script>
36
+ import { MQuantitySelector } from '@mozaic-ds/vue';
37
+ </script>
38
38
 
39
- <MQuantitySelector
40
- id="quantity-selector-id"
41
- size=${size}
42
- disabled=${disabled}
43
- readonly=${readonly}
44
- :is-invalid=${isInvalid}
45
- :model-value="1"
46
- :min="0"
47
- :max="10"
48
- ></MQuantitySelector>`,
39
+ <MQuantitySelector
40
+ id="quantity-selector-id"
41
+ size=${size}
42
+ disabled=${disabled}
43
+ readonly=${readonly}
44
+ :is-invalid=${isInvalid}
45
+ :model-value="1"
46
+ :min="0"
47
+ :max="10"
48
+ ></MQuantitySelector>`,
49
49
  },
50
50
  );
@@ -26,15 +26,15 @@ figma.connect(
26
26
  },
27
27
  example: ({ modelValue, disabled, isInvalid }) =>
28
28
  html`<script setup>
29
- import { MRadio } from '@mozaic-ds/vue';
30
- </script>
29
+ import { MRadio } from '@mozaic-ds/vue';
30
+ </script>
31
31
 
32
- <MRadio
33
- id="radio-id"
34
- label="Radio button Label"
35
- :model-value=${modelValue}
36
- disabled=${disabled}
37
- :is-invalid=${isInvalid}
38
- ></MRadio>`,
32
+ <MRadio
33
+ id="radio-id"
34
+ label="Radio button Label"
35
+ :model-value=${modelValue}
36
+ disabled=${disabled}
37
+ :is-invalid=${isInvalid}
38
+ ></MRadio>`,
39
39
  },
40
40
  );
@@ -15,16 +15,16 @@ figma.connect(
15
15
  },
16
16
  example: ({ inline }) =>
17
17
  html`<script setup>
18
- import { MRadioGroup } from '@mozaic-ds/vue';
19
- </script>
18
+ import { MRadioGroup } from '@mozaic-ds/vue';
19
+ </script>
20
20
 
21
- <MRadioGroup
22
- name="group"
23
- :options="[
21
+ <MRadioGroup
22
+ name="group"
23
+ :options="[
24
24
  { id: '1', label: 'Option 1', value: '1' },
25
25
  { id: '2', label: 'Option 2', value: '2' },
26
26
  ]"
27
- inline=${inline}
28
- />`,
27
+ inline=${inline}
28
+ />`,
29
29
  },
30
30
  );
@@ -20,14 +20,14 @@ figma.connect(
20
20
  },
21
21
  example: ({ size, full }) =>
22
22
  html`<script setup>
23
- import { MSegmentedControl } from '@mozaic-ds/vue';
24
- </script>
23
+ import { MSegmentedControl } from '@mozaic-ds/vue';
24
+ </script>
25
25
 
26
- <MSegmentedControl
27
- size=${size}
28
- full=${full}
29
- :segments="[{ id: 'label1', label: 'Label' }, { id: 'label2', label: 'Label' }]"
30
- model-value="label1"
31
- ></MSegmentedControl>`,
26
+ <MSegmentedControl
27
+ size=${size}
28
+ full=${full}
29
+ :segments="[{ id: 'label1', label: 'Label' }, { id: 'label2', label: 'Label' }]"
30
+ model-value="label1"
31
+ ></MSegmentedControl>`,
32
32
  },
33
33
  );
@@ -33,17 +33,17 @@ figma.connect(
33
33
  },
34
34
  example: ({ size, disabled, readonly, isInvalid }) =>
35
35
  html`<script setup>
36
- import { MSelect } from '@mozaic-ds/vue';
37
- </script>
36
+ import { MSelect } from '@mozaic-ds/vue';
37
+ </script>
38
38
 
39
- <MSelect
40
- id="select-id"
41
- size=${size}
42
- disabled=${disabled}
43
- readonly=${readonly}
44
- :is-invalid=${isInvalid}
45
- placeholder="Choose an option"
46
- :options="[{ text: 'Option 1', value: 'option1' }, { text: 'Option 2', value: 'option2' }]"
47
- ></MSelect>`,
39
+ <MSelect
40
+ id="select-id"
41
+ size=${size}
42
+ disabled=${disabled}
43
+ readonly=${readonly}
44
+ :is-invalid=${isInvalid}
45
+ placeholder="Choose an option"
46
+ :options="[{ text: 'Option 1', value: 'option1' }, { text: 'Option 2', value: 'option2' }]"
47
+ ></MSelect>`,
48
48
  },
49
49
  );
@@ -15,14 +15,14 @@ figma.connect(
15
15
  },
16
16
  example: ({ modelValue }) =>
17
17
  html`<script setup>
18
- import { MSidebar } from '@mozaic-ds/vue';
19
- </script>
18
+ import { MSidebar } from '@mozaic-ds/vue';
19
+ </script>
20
20
 
21
- <MSidebar :model-value=${modelValue}>
22
- <template #header>Header</template>
23
- <template #shortcuts>Shortcuts</template>
24
- <template #nav>Nav items</template>
25
- <template #footer>Footer</template>
26
- </MSidebar>`,
21
+ <MSidebar :model-value=${modelValue}>
22
+ <template #header>Header</template>
23
+ <template #shortcuts>Shortcuts</template>
24
+ <template #nav>Nav items</template>
25
+ <template #footer>Footer</template>
26
+ </MSidebar>`,
27
27
  },
28
28
  );
@@ -28,6 +28,7 @@
28
28
  <MIconButton
29
29
  class="mc-sidebar__close-button"
30
30
  ghost
31
+ appearance="inverse"
31
32
  aria-label="Sidebar close button"
32
33
  @click="emit('close')"
33
34
  >
@@ -9,11 +9,14 @@ figma.connect(
9
9
  {
10
10
  example: () =>
11
11
  html`<script setup>
12
- import { MSidebarExpandableItem, MSidebarNavItem } from '@mozaic-ds/vue';
13
- </script>
12
+ import {
13
+ MSidebarExpandableItem,
14
+ MSidebarNavItem,
15
+ } from '@mozaic-ds/vue';
16
+ </script>
14
17
 
15
- <MSidebarExpandableItem label="Section" menu-label="Section">
16
- <MSidebarNavItem label="Sub item" />
17
- </MSidebarExpandableItem>`,
18
+ <MSidebarExpandableItem label="Section" menu-label="Section">
19
+ <MSidebarNavItem label="Sub item" />
20
+ </MSidebarExpandableItem>`,
18
21
  },
19
22
  );
@@ -131,6 +131,18 @@ describe('MSidebarExpandableItem', () => {
131
131
  expect(onListboxKeydown).toHaveBeenCalled();
132
132
  });
133
133
 
134
+ it('collapsed trigger button has aria-label equal to label prop', () => {
135
+ const wrapper = mount(MSidebarExpandableItem, {
136
+ props: { label: 'Products', menuLabel: 'Products menu' },
137
+ global: {
138
+ provide: { [EXPANDED_SIDEBAR_KEY]: false },
139
+ },
140
+ });
141
+
142
+ const button = wrapper.find('button.mc-sidebar__trigger');
143
+ expect(button.attributes('aria-label')).toBe('Products');
144
+ });
145
+
134
146
  it('calls hideFloatingItem on mouseleave and blur on the listbox', async () => {
135
147
  const wrapper = mount(MSidebarExpandableItem, {
136
148
  props: { label: 'Item', menuLabel: 'Menu' },
@@ -24,6 +24,7 @@
24
24
  aria-haspopup="listbox"
25
25
  :aria-expanded="floatingItemIsDisplayed"
26
26
  :aria-controls="`listbox-${id}`"
27
+ :aria-label="props.label"
27
28
  @mouseenter="showFloatingItem"
28
29
  @focus="showFloatingItem"
29
30
  @keydown="onTriggerKeydown"
@@ -13,9 +13,13 @@ figma.connect(
13
13
  },
14
14
  example: ({ expendable }) =>
15
15
  html`<script setup>
16
- import { MSidebarFooter } from '@mozaic-ds/vue';
17
- </script>
16
+ import { MSidebarFooter } from '@mozaic-ds/vue';
17
+ </script>
18
18
 
19
- <MSidebarFooter title="User name" subtitle="user@example.com" :expendable=${expendable} />`,
19
+ <MSidebarFooter
20
+ title="User name"
21
+ subtitle="user@example.com"
22
+ :expendable=${expendable}
23
+ />`,
20
24
  },
21
25
  );
@@ -10,9 +10,9 @@ figma.connect(
10
10
  props: {},
11
11
  example: () =>
12
12
  html`<script setup>
13
- import { MSidebarHeader } from '@mozaic-ds/vue';
14
- </script>
13
+ import { MSidebarHeader } from '@mozaic-ds/vue';
14
+ </script>
15
15
 
16
- <MSidebarHeader title="App name" logo="/logo.png" />`,
16
+ <MSidebarHeader title="App name" logo="/logo.png" />`,
17
17
  },
18
18
  );
@@ -15,9 +15,9 @@ figma.connect(
15
15
  },
16
16
  example: ({ active }) =>
17
17
  html`<script setup>
18
- import { MSidebarNavItem } from '@mozaic-ds/vue';
19
- </script>
18
+ import { MSidebarNavItem } from '@mozaic-ds/vue';
19
+ </script>
20
20
 
21
- <MSidebarNavItem label="Menu item" active=${active} />`,
21
+ <MSidebarNavItem label="Menu item" active=${active} />`,
22
22
  },
23
23
  );
@@ -12,9 +12,9 @@ figma.connect(
12
12
  },
13
13
  example: ({ label }) =>
14
14
  html`<script setup>
15
- import { MSidebarShortcutItem } from '@mozaic-ds/vue';
16
- </script>
15
+ import { MSidebarShortcutItem } from '@mozaic-ds/vue';
16
+ </script>
17
17
 
18
- <MSidebarShortcutItem label=${label} href="#" />`,
18
+ <MSidebarShortcutItem label=${label} href="#" />`,
19
19
  },
20
20
  );
@@ -23,13 +23,13 @@ figma.connect(
23
23
  },
24
24
  example: ({ text, size }) =>
25
25
  html`<script setup>
26
- import { MStarRating } from '@mozaic-ds/vue';
27
- </script>
26
+ import { MStarRating } from '@mozaic-ds/vue';
27
+ </script>
28
28
 
29
- <MStarRating
30
- :model-value="3.5"
31
- size=${size}
32
- text=${text}
33
- ></MStarRating>`,
29
+ <MStarRating
30
+ :model-value="3.5"
31
+ size=${size}
32
+ text=${text}
33
+ ></MStarRating>`,
34
34
  },
35
35
  );
@@ -19,9 +19,9 @@ figma.connect(
19
19
  },
20
20
  example: ({ label, status }) =>
21
21
  html`<script setup>
22
- import { MStatusBadge } from '@mozaic-ds/vue';
23
- </script>
22
+ import { MStatusBadge } from '@mozaic-ds/vue';
23
+ </script>
24
24
 
25
- <MStatusBadge label=${label} status=${status}></MStatusBadge>`,
25
+ <MStatusBadge label=${label} status=${status}></MStatusBadge>`,
26
26
  },
27
27
  );
@@ -23,9 +23,9 @@ figma.connect(
23
23
  },
24
24
  example: ({ status, size }) =>
25
25
  html`<script setup>
26
- import { MStatusDot } from '@mozaic-ds/vue';
27
- </script>
26
+ import { MStatusDot } from '@mozaic-ds/vue';
27
+ </script>
28
28
 
29
- <MStatusDot status=${status} size=${size}></MStatusDot>`,
29
+ <MStatusDot status=${status} size=${size}></MStatusDot>`,
30
30
  },
31
31
  );
@@ -20,9 +20,9 @@ figma.connect(
20
20
  },
21
21
  example: ({ label, status }) =>
22
22
  html`<script setup>
23
- import { MStatusMessage } from '@mozaic-ds/vue';
24
- </script>
23
+ import { MStatusMessage } from '@mozaic-ds/vue';
24
+ </script>
25
25
 
26
- <MStatusMessage label=${label} status=${status}></MStatusMessage>`,
26
+ <MStatusMessage label=${label} status=${status}></MStatusMessage>`,
27
27
  },
28
28
  );
@@ -17,13 +17,13 @@ figma.connect(
17
17
  },
18
18
  example: ({ status }) =>
19
19
  html`<script setup>
20
- import { MStatusNotification } from '@mozaic-ds/vue';
21
- </script>
20
+ import { MStatusNotification } from '@mozaic-ds/vue';
21
+ </script>
22
22
 
23
- <MStatusNotification
24
- title="Notification title"
25
- description="Notification description"
26
- status=${status}
27
- ></MStatusNotification>`,
23
+ <MStatusNotification
24
+ title="Notification title"
25
+ description="Notification description"
26
+ status=${status}
27
+ ></MStatusNotification>`,
28
28
  },
29
29
  );
@@ -12,9 +12,9 @@ figma.connect(
12
12
  },
13
13
  example: ({ cancel }) =>
14
14
  html`<script setup>
15
- import { MStepperBottomBar } from '@mozaic-ds/vue';
16
- </script>
15
+ import { MStepperBottomBar } from '@mozaic-ds/vue';
16
+ </script>
17
17
 
18
- <MStepperBottomBar cancel=${cancel} :steps="3" />`,
18
+ <MStepperBottomBar cancel=${cancel} :steps="3" />`,
19
19
  },
20
20
  );
@@ -13,9 +13,14 @@ figma.connect(
13
13
  },
14
14
  example: ({ label, description }) =>
15
15
  html`<script setup>
16
- import { MStepperCompact } from '@mozaic-ds/vue';
17
- </script>
16
+ import { MStepperCompact } from '@mozaic-ds/vue';
17
+ </script>
18
18
 
19
- <MStepperCompact label=${label} :description=${description} :value="1" :max-steps="4"></MStepperCompact>`,
19
+ <MStepperCompact
20
+ label=${label}
21
+ :description=${description}
22
+ :value="1"
23
+ :max-steps="4"
24
+ ></MStepperCompact>`,
20
25
  },
21
26
  );
@@ -50,6 +50,15 @@ describe('MStepperCompact component', () => {
50
50
  expect(progressbar.props('contentValue')).toBe('3 / 7');
51
51
  });
52
52
 
53
+ it('passes a dynamic aria-label reflecting current step to MCircularProgressbar', () => {
54
+ const wrapper = mount(MStepperCompact, {
55
+ props: { label: 'Step', value: 2, maxSteps: 5 },
56
+ });
57
+
58
+ const progressbar = wrapper.findComponent({ name: 'MCircularProgressbar' });
59
+ expect(progressbar.attributes('aria-label')).toBe('Step 2 / 5');
60
+ });
61
+
53
62
  it('passes correct props to MCircularProgressbar', () => {
54
63
  const wrapper = mount(MStepperCompact, {
55
64
  props: {
@@ -2,7 +2,7 @@
2
2
  <div class="mc-stepper-compact">
3
3
  <div class="mc-circular-progressbar mc-stepper-compact__progress">
4
4
  <MCircularProgressbar
5
- aria-label="Progress bar"
5
+ :aria-label="`Step ${props.value} / ${props.maxSteps}`"
6
6
  type="content"
7
7
  size="m"
8
8
  :value="progressValue"
@@ -15,9 +15,12 @@ figma.connect(
15
15
  },
16
16
  example: () =>
17
17
  html`<script setup>
18
- import { MStepperInline } from '@mozaic-ds/vue';
19
- </script>
18
+ import { MStepperInline } from '@mozaic-ds/vue';
19
+ </script>
20
20
 
21
- <MStepperInline :current-step="1" :steps="[{ label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }]"></MStepperInline>`,
21
+ <MStepperInline
22
+ :current-step="1"
23
+ :steps="[{ label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }]"
24
+ ></MStepperInline>`,
22
25
  },
23
26
  );
@@ -9,6 +9,17 @@ describe('MStepperInline', () => {
9
9
  { id: '3', label: 'Step 3' },
10
10
  ];
11
11
 
12
+ it('sets aria-current="step" on the current step item', () => {
13
+ const wrapper = mount(MStepperInline, {
14
+ props: { currentStep: '2', steps: defaultSteps },
15
+ });
16
+
17
+ const items = wrapper.findAll('.mc-stepper-inline__item');
18
+ expect(items[1].attributes('aria-current')).toBe('step');
19
+ expect(items[0].attributes('aria-current')).toBeUndefined();
20
+ expect(items[2].attributes('aria-current')).toBeUndefined();
21
+ });
22
+
12
23
  it('renders correctly with default props', () => {
13
24
  const wrapper = mount(MStepperInline, {
14
25
  props: {
@@ -46,7 +46,11 @@ export const AditionnalInfo: Story = {
46
46
  label: 'Delivery address',
47
47
  additionalInfo: 'Additional information',
48
48
  },
49
- { id: 'step3', label: 'Payment', additionalInfo: 'Additional information' },
49
+ {
50
+ id: 'step3',
51
+ label: 'Payment',
52
+ additionalInfo: 'Additional information',
53
+ },
50
54
  {
51
55
  id: 'step4',
52
56
  label: 'Order confirmation',
@@ -7,11 +7,11 @@
7
7
  class="mc-stepper-inline__item"
8
8
  :class="{ 'is-completed': stepStates[i].completed }"
9
9
  :tabindex="stepStates[i].completed ? 0 : undefined"
10
+ :aria-current="stepStates[i].current ? 'step' : undefined"
10
11
  >
11
12
  <Check24
12
13
  class="mc-stepper-inline__icon mc-stepper-inline__icon--check"
13
14
  v-if="stepStates[i].completed"
14
- aria-hidden="true"
15
15
  />
16
16
  <span
17
17
  v-else
@@ -15,9 +15,12 @@ figma.connect(
15
15
  },
16
16
  example: () =>
17
17
  html`<script setup>
18
- import { MStepperStacked } from '@mozaic-ds/vue';
19
- </script>
18
+ import { MStepperStacked } from '@mozaic-ds/vue';
19
+ </script>
20
20
 
21
- <MStepperStacked :current-step="1" :steps="[{ label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }]"></MStepperStacked>`,
21
+ <MStepperStacked
22
+ :current-step="1"
23
+ :steps="[{ label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }]"
24
+ ></MStepperStacked>`,
22
25
  },
23
26
  );
@@ -9,6 +9,19 @@ const defaultSteps = [
9
9
  ];
10
10
 
11
11
  describe('MStepperStacked', () => {
12
+ describe('Accessibility', () => {
13
+ it('sets aria-current="step" on the current step item', () => {
14
+ const wrapper = mount(MStepperStacked, {
15
+ props: { steps: defaultSteps, currentStep: '2' },
16
+ });
17
+
18
+ const items = wrapper.findAll('.mc-stepper-stacked__item');
19
+ expect(items[1].attributes('aria-current')).toBe('step');
20
+ expect(items[0].attributes('aria-current')).toBeUndefined();
21
+ expect(items[2].attributes('aria-current')).toBeUndefined();
22
+ });
23
+ });
24
+
12
25
  describe('Basic rendering', () => {
13
26
  it('renders as many li elements as there are steps', () => {
14
27
  const wrapper = mount(MStepperStacked, {
@@ -8,6 +8,7 @@
8
8
  'mc-stepper-stacked__item': true,
9
9
  'has-additional': step.additionalInfo,
10
10
  }"
11
+ :aria-current="stepStates[index].current ? 'step' : undefined"
11
12
  >
12
13
  <div class="mc-stepper-stacked__indicator">
13
14
  <Check24
@@ -16,18 +16,18 @@ figma.connect(
16
16
  },
17
17
  example: ({ divider, centered }) =>
18
18
  html`<script setup>
19
- import { MTabs } from '@mozaic-ds/vue';
20
- </script>
19
+ import { MTabs } from '@mozaic-ds/vue';
20
+ </script>
21
21
 
22
- <MTabs
23
- :divider=${divider}
24
- centered=${centered}
25
- model-value="label1"
26
- :tabs="[
22
+ <MTabs
23
+ :divider=${divider}
24
+ centered=${centered}
25
+ model-value="label1"
26
+ :tabs="[
27
27
  { id: 'label1', label: 'Label' },
28
28
  { id: 'label2', label: 'Label' },
29
29
  { id: 'label3', label: 'Label' },
30
30
  ]"
31
- ></MTabs>`,
31
+ ></MTabs>`,
32
32
  },
33
33
  );
@@ -18,9 +18,9 @@ figma.connect(
18
18
  },
19
19
  example: ({ type }) =>
20
20
  html`<script setup>
21
- import { MTag } from '@mozaic-ds/vue';
22
- </script>
21
+ import { MTag } from '@mozaic-ds/vue';
22
+ </script>
23
23
 
24
- <MTag type=${type} label="Tag label"></MTag>`,
24
+ <MTag type=${type} label="Tag label"></MTag>`,
25
25
  },
26
26
  );
@@ -15,14 +15,14 @@ figma.connect(
15
15
  },
16
16
  example: ({ isInvalid }) =>
17
17
  html`<script setup>
18
- import { MTextArea } from '@mozaic-ds/vue';
19
- </script>
18
+ import { MTextArea } from '@mozaic-ds/vue';
19
+ </script>
20
20
 
21
- <MTextArea
22
- id="textarea-id"
23
- :is-invalid=${isInvalid}
24
- placeholder="Placeholder"
25
- model-value=""
26
- ></MTextArea>`,
21
+ <MTextArea
22
+ id="textarea-id"
23
+ :is-invalid=${isInvalid}
24
+ placeholder="Placeholder"
25
+ model-value=""
26
+ ></MTextArea>`,
27
27
  },
28
28
  );
@@ -34,18 +34,18 @@ figma.connect(
34
34
  },
35
35
  example: ({ size, disabled, readonly, isInvalid, isClearable }) =>
36
36
  html`<script setup>
37
- import { MTextInput } from '@mozaic-ds/vue';
38
- </script>
37
+ import { MTextInput } from '@mozaic-ds/vue';
38
+ </script>
39
39
 
40
- <MTextInput
41
- id="text-input-id"
42
- size=${size}
43
- disabled=${disabled}
44
- readonly=${readonly}
45
- :is-invalid=${isInvalid}
46
- :is-clearable=${isClearable}
47
- placeholder="Placeholder"
48
- model-value=""
49
- ></MTextInput>`,
40
+ <MTextInput
41
+ id="text-input-id"
42
+ size=${size}
43
+ disabled=${disabled}
44
+ readonly=${readonly}
45
+ :is-invalid=${isInvalid}
46
+ :is-clearable=${isClearable}
47
+ placeholder="Placeholder"
48
+ model-value=""
49
+ ></MTextInput>`,
50
50
  },
51
51
  );