@mozaic-ds/vue 2.16.0 → 2.18.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.
Files changed (132) hide show
  1. package/dist/mozaic-vue.css +2 -1
  2. package/dist/mozaic-vue.d.ts +258 -137
  3. package/dist/mozaic-vue.js +14054 -10878
  4. package/dist/mozaic-vue.js.map +1 -1
  5. package/dist/mozaic-vue.umd.cjs +7 -25
  6. package/dist/mozaic-vue.umd.cjs.map +1 -1
  7. package/package.json +22 -11
  8. package/src/components/BrandPresets.mdx +2 -2
  9. package/src/components/Migration.mdx +651 -0
  10. package/src/components/accordionlist/MAccordionList.figma.ts +43 -0
  11. package/src/components/accordionlistitem/MAccordionListItem.figma.ts +27 -0
  12. package/src/components/accordionlistitem/MAccordionListItem.spec.ts +22 -3
  13. package/src/components/accordionlistitem/MAccordionListItem.vue +38 -28
  14. package/src/components/actionbottombar/MActionBottomBar.figma.ts +24 -0
  15. package/src/components/actionlistbox/MActionListbox.figma.ts +30 -0
  16. package/src/components/avatar/MAvatar.figma.ts +31 -0
  17. package/src/components/breadcrumb/MBreadcrumb.figma.ts +31 -0
  18. package/src/components/builtinmenu/MBuiltInMenu.figma.ts +23 -0
  19. package/src/components/builtinmenu/MBuiltInMenu.spec.ts +30 -1
  20. package/src/components/builtinmenu/MBuiltInMenu.vue +26 -17
  21. package/src/components/builtinmenu/README.md +2 -0
  22. package/src/components/button/MButton.figma.ts +41 -0
  23. package/src/components/callout/MCallout.figma.ts +29 -0
  24. package/src/components/callout/MCallout.spec.ts +35 -0
  25. package/src/components/callout/MCallout.vue +22 -4
  26. package/src/components/callout/README.md +2 -0
  27. package/src/components/carousel/MCarousel.figma.ts +32 -0
  28. package/src/components/checkbox/MCheckbox.figma.ts +45 -0
  29. package/src/components/checkboxgroup/MCheckboxGroup.figma.ts +30 -0
  30. package/src/components/checklistmenu/MCheckListMenu.figma.ts +29 -0
  31. package/src/components/checklistmenu/MCheckListMenu.spec.ts +12 -1
  32. package/src/components/checklistmenu/MCheckListMenu.vue +6 -0
  33. package/src/components/checklistmenu/README.md +2 -0
  34. package/src/components/circularprogressbar/MCircularProgressbar.figma.ts +31 -0
  35. package/src/components/combobox/MCombobox.figma.ts +48 -0
  36. package/src/components/combobox/MCombobox.spec.ts +1 -1
  37. package/src/components/combobox/MCombobox.vue +18 -9
  38. package/src/components/combobox/README.md +2 -2
  39. package/src/components/container/MContainer.figma.ts +30 -0
  40. package/src/components/datatable/DataTable.stories.ts +277 -0
  41. package/src/components/datatable/DataTableCells.stories.ts +251 -0
  42. package/src/components/datatable/DataTableEmpty.stories.ts +102 -0
  43. package/src/components/datatable/DataTableExpandable.stories.ts +95 -0
  44. package/src/components/datatable/DataTableNested.stories.ts +96 -0
  45. package/src/components/datatable/DataTableSelectable.stories.ts +124 -0
  46. package/src/components/datatable/DataTableSortable.stories.ts +164 -0
  47. package/src/components/datatable/MDataTable.types.ts +54 -0
  48. package/src/components/datatable/assets/styles.scss +10 -0
  49. package/src/components/datatable/datatable.mdx +63 -0
  50. package/src/components/datatable/tools/data.js +8 -0
  51. package/src/components/datatable/tools/data.json +2018 -0
  52. package/src/components/datatable/utils.js +19 -0
  53. package/src/components/datepicker/MDatepicker.figma.ts +20 -0
  54. package/src/components/divider/MDivider.figma.ts +30 -0
  55. package/src/components/drawer/MDrawer.figma.ts +37 -0
  56. package/src/components/drawer/README.md +1 -1
  57. package/src/components/field/MField.figma.ts +30 -0
  58. package/src/components/fileuploader/MFileUploader.figma.ts +23 -0
  59. package/src/components/fileuploaderitem/MFileUploaderItem.figma.ts +27 -0
  60. package/src/components/flag/MFlag.figma.ts +26 -0
  61. package/src/components/iconbutton/MIconButton.figma.ts +54 -0
  62. package/src/components/kpiitem/MKpiItem.figma.ts +33 -0
  63. package/src/components/linearprogressbarbuffer/MLinearProgressbarBuffer.figma.ts +31 -0
  64. package/src/components/linearprogressbarpercentage/MLinearProgressbarPercentage.figma.ts +26 -0
  65. package/src/components/link/MLink.figma.ts +32 -0
  66. package/src/components/loader/MLoader.figma.ts +30 -0
  67. package/src/components/loadingoverlay/MLoadingOverlay.figma.ts +18 -0
  68. package/src/components/modal/MModal.figma.ts +27 -0
  69. package/src/components/navigationindicator/MNavigationIndicator.figma.ts +24 -0
  70. package/src/components/navigationindicator/MNavigationIndicator.spec.ts +75 -18
  71. package/src/components/navigationindicator/MNavigationIndicator.vue +10 -12
  72. package/src/components/numberbadge/MNumberBadge.figma.ts +31 -0
  73. package/src/components/optionListbox/MOptionListbox.figma.ts +36 -0
  74. package/src/components/optionListbox/MOptionListbox.vue +34 -19
  75. package/src/components/optionListbox/README.md +1 -1
  76. package/src/components/overlay/MOverlay.figma.ts +20 -0
  77. package/src/components/pageheader/MPageHeader.figma.ts +21 -0
  78. package/src/components/pagination/MPagination.figma.ts +34 -0
  79. package/src/components/passwordinput/MPasswordInput.figma.ts +30 -0
  80. package/src/components/phonenumber/MPhoneNumber.figma.ts +47 -0
  81. package/src/components/pincode/MPincode.figma.ts +41 -0
  82. package/src/components/pincode/MPincode.spec.ts +1 -4
  83. package/src/components/pincode/MPincode.vue +11 -15
  84. package/src/components/popover/MPopover.figma.ts +42 -0
  85. package/src/components/popover/MPopover.spec.ts +126 -0
  86. package/src/components/popover/MPopover.vue +36 -1
  87. package/src/components/quantityselector/MQuantitySelector.figma.ts +50 -0
  88. package/src/components/radio/MRadio.figma.ts +40 -0
  89. package/src/components/radiogroup/MRadioGroup.figma.ts +30 -0
  90. package/src/components/segmentedcontrol/MSegmentedControl.figma.ts +33 -0
  91. package/src/components/segmentedcontrol/MSegmentedControl.spec.ts +92 -0
  92. package/src/components/segmentedcontrol/MSegmentedControl.vue +61 -2
  93. package/src/components/select/MSelect.figma.ts +49 -0
  94. package/src/components/sidebar/MSidebar.figma.ts +28 -0
  95. package/src/components/sidebarexpandableitem/MSidebarExpandableItem.figma.ts +19 -0
  96. package/src/components/sidebarfooter/MSidebarFooter.figma.ts +21 -0
  97. package/src/components/sidebarheader/MSidebarHeader.figma.ts +18 -0
  98. package/src/components/sidebarnavitem/MSidebarNavItem.figma.ts +23 -0
  99. package/src/components/sidebarshortcutitem/MSidebarShortcutItem.figma.ts +20 -0
  100. package/src/components/starrating/MStarRating.figma.ts +35 -0
  101. package/src/components/starrating/MStarRating.spec.ts +19 -22
  102. package/src/components/starrating/MStarRating.vue +3 -2
  103. package/src/components/statusbadge/MStatusBadge.figma.ts +27 -0
  104. package/src/components/statusdot/MStatusDot.figma.ts +31 -0
  105. package/src/components/statusmessage/MStatusMessage.figma.ts +28 -0
  106. package/src/components/statusmessage/MStatusMessage.spec.ts +15 -0
  107. package/src/components/statusmessage/MStatusMessage.stories.ts +4 -0
  108. package/src/components/statusmessage/MStatusMessage.vue +7 -0
  109. package/src/components/statusmessage/README.md +2 -0
  110. package/src/components/statusnotification/MStatusNotification.figma.ts +29 -0
  111. package/src/components/stepperbottombar/MStepperBottomBar.figma.ts +20 -0
  112. package/src/components/steppercompact/MStepperCompact.figma.ts +21 -0
  113. package/src/components/stepperinline/MStepperInline.figma.ts +23 -0
  114. package/src/components/stepperstacked/MStepperStacked.figma.ts +23 -0
  115. package/src/components/tabs/MTabs.figma.ts +33 -0
  116. package/src/components/tabs/MTabs.vue +90 -4
  117. package/src/components/tabs/Mtabs.spec.ts +162 -0
  118. package/src/components/tag/MTag.figma.ts +26 -0
  119. package/src/components/tag/MTag.stories.ts +13 -3
  120. package/src/components/tag/MTag.vue +11 -1
  121. package/src/components/tag/README.md +6 -0
  122. package/src/components/textarea/MTextArea.figma.ts +28 -0
  123. package/src/components/textinput/MTextInput.figma.ts +51 -0
  124. package/src/components/tile/MTile.figma.ts +31 -0
  125. package/src/components/tileclickable/MTileClickable.figma.ts +31 -0
  126. package/src/components/tileexpandable/MTileExpandable.figma.ts +31 -0
  127. package/src/components/tileselectable/MTileSelectable.figma.ts +29 -0
  128. package/src/components/toaster/MToaster.figma.ts +25 -0
  129. package/src/components/toggle/MToggle.figma.ts +39 -0
  130. package/src/components/togglegroup/MToggleGroup.figma.ts +30 -0
  131. package/src/components/tooltip/MTooltip.figma.ts +29 -0
  132. package/src/main.ts +1 -0
@@ -0,0 +1,19 @@
1
+ import { deals } from './tools/data';
2
+
3
+ export const addlDeals = deals;
4
+ export const deals10 = [...deals.slice(0, 10)];
5
+ export const deals25 = [...deals.slice(0, 25)];
6
+ export const deals50 = [...deals.slice(0, 50)];
7
+ export const deals75 = [...deals.slice(0, 75)];
8
+ export const deals100 = [...deals.slice(0, 100)];
9
+
10
+ export const args = {
11
+ items: deals10,
12
+ };
13
+
14
+ export const backgrounds = {
15
+ default: 'datatable',
16
+ values: [{ name: 'datatable', value: '#EAEDEF' }],
17
+ };
18
+
19
+ export const formatDate = (date) => new Date(date).toLocaleString();
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Code Connect mapping for MDatepicker
3
+ * Links Figma Date picker (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=6-29074',
9
+ {
10
+ props: {
11
+ showFieldLabel: figma.boolean('Show Field label'),
12
+ },
13
+ example: () =>
14
+ html`<script setup>
15
+ import { MDatepicker } from '@mozaic-ds/vue';
16
+ </script>
17
+
18
+ <MDatepicker id="datepicker" />`,
19
+ },
20
+ );
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Code Connect mapping for MDivider
3
+ * Links Figma Divider (Horizontal) (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=6-26971',
9
+ {
10
+ props: {
11
+ appearance: figma.enum('Style', {
12
+ Primary: 'primary',
13
+ Secondary: 'secondary',
14
+ Tertiary: 'tertiary',
15
+ Inverse: 'inverse',
16
+ }),
17
+ size: figma.enum('Size', {
18
+ 'S (1px)': 's',
19
+ 'M (4px)': 'm',
20
+ 'L (8px)': 'l',
21
+ }),
22
+ },
23
+ example: ({ appearance, size }) =>
24
+ html`<script setup>
25
+ import { MDivider } from '@mozaic-ds/vue';
26
+ </script>
27
+
28
+ <MDivider appearance=${appearance} size=${size} />`,
29
+ },
30
+ );
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Code Connect mapping for MDrawer
3
+ * Links Figma Drawer (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=5-6717',
9
+ {
10
+ props: {
11
+ position: figma.enum('Left alignment', {
12
+ True: 'left',
13
+ False: 'right',
14
+ }),
15
+ extended: figma.enum('Is extended (only from M)', {
16
+ True: true,
17
+ False: false,
18
+ }),
19
+ },
20
+ example: ({ position, extended }) =>
21
+ html`<script setup>
22
+ import { MDrawer, MButton } from '@mozaic-ds/vue';
23
+ </script>
24
+
25
+ <MDrawer
26
+ open
27
+ title="Drawer title"
28
+ :position=${position}
29
+ :extended=${extended}
30
+ >
31
+ <p>Drawer content</p>
32
+ <template #footer>
33
+ <MButton>Confirm</MButton>
34
+ </template>
35
+ </MDrawer>`,
36
+ },
37
+ );
@@ -27,8 +27,8 @@ A drawer is a sliding panel that appears from the side of the screen, providing
27
27
 
28
28
  | Name | Description | Type |
29
29
  | --- | --- | --- |
30
- | `back` | Emits when click back button of the drawer. | [] |
31
30
  | `update:open` | Emits when the drawer open state changes, updating the modelValue prop. | [value: boolean] |
31
+ | `back` | Emits when click back button of the drawer. | [] |
32
32
 
33
33
  ## Dependencies
34
34
 
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Code Connect mapping for MField
3
+ * Links Figma _Field label to @mozaic-ds/vue
4
+ *
5
+ * MField is a wrapper that encompasses form inputs. The default slot accepts any
6
+ * form component: MTextInput, MTextArea, MSelect, MCombobox, MPasswordInput,
7
+ * MPhoneNumber, MPincode, MQuantitySelector, etc.
8
+ */
9
+ import figma, { html } from '@figma/code-connect/html';
10
+
11
+ figma.connect(
12
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=6-29469',
13
+ {
14
+ props: {
15
+ label: figma.string('Label'),
16
+ requirementText: figma.enum('Necessity indicator', {
17
+ True: 'required',
18
+ False: '',
19
+ }),
20
+ },
21
+ example: ({ label, requirementText }) =>
22
+ html`<script setup>
23
+ import { MField, MTextInput } from '@mozaic-ds/vue';
24
+ </script>
25
+
26
+ <MField id="field-id" label=${label} requirement-text=${requirementText}>
27
+ <MTextInput id="field-id" placeholder="Placeholder"></MTextInput>
28
+ </MField>`,
29
+ },
30
+ );
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Code Connect mapping for MFileUploader
3
+ * Links Figma File uploader (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=11973-12085',
9
+ {
10
+ props: {
11
+ hasDragDrop: figma.enum('Has drag & drop', {
12
+ False: false,
13
+ True: true,
14
+ }),
15
+ },
16
+ example: ({ hasDragDrop }) =>
17
+ html`<script setup>
18
+ import { MFileUploader } from '@mozaic-ds/vue';
19
+ </script>
20
+
21
+ <MFileUploader :model-value="[]" :has-drag-drop=${hasDragDrop} />`,
22
+ },
23
+ );
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Code Connect mapping for MFileUploaderItem
3
+ * Links Figma _file uploader / file item to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=11975-12550',
9
+ {
10
+ props: {
11
+ format: figma.enum('🚫 Format', {
12
+ 'Inline (default)': 'inline',
13
+ Stacked: 'stacked',
14
+ }),
15
+ valid: figma.enum('Is invalid', {
16
+ False: true,
17
+ True: false,
18
+ }),
19
+ },
20
+ example: ({ format, valid }) =>
21
+ html`<script setup>
22
+ import { MFileUploaderItem } from '@mozaic-ds/vue';
23
+ </script>
24
+
25
+ <MFileUploaderItem :file="{ name: 'document.pdf' }" format=${format} :valid=${valid} />`,
26
+ },
27
+ );
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Code Connect mapping for MFlag
3
+ * Links Figma Flag to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=5462-8542',
9
+ {
10
+ props: {
11
+ label: figma.string('Flag label'),
12
+ appearance: figma.enum('Appearance', {
13
+ Standard: 'standard',
14
+ Accent: 'accent',
15
+ Danger: 'danger',
16
+ Inverse: 'inverse',
17
+ }),
18
+ },
19
+ example: ({ label, appearance }) =>
20
+ html`<script setup>
21
+ import { MFlag } from '@mozaic-ds/vue';
22
+ </script>
23
+
24
+ <MFlag label=${label} appearance=${appearance}></MFlag>`,
25
+ },
26
+ );
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Code Connect mapping for MIconButton
3
+ * Links Figma Icon Button (ADS2) to @mozaic-ds/vue
4
+ * Props from figma_get_component (Figma Console MCP) + MIconButton.stories.ts
5
+ */
6
+ import figma, { html } from '@figma/code-connect/html';
7
+
8
+ figma.connect(
9
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=1-1978',
10
+ {
11
+ props: {
12
+ appearance: figma.enum('Appearance', {
13
+ Standard: 'standard',
14
+ Accent: 'accent',
15
+ Danger: 'danger',
16
+ 'Inverse (only on dark background)': 'inverse',
17
+ }),
18
+ size: figma.enum('Size', {
19
+ S: 's',
20
+ 'M (default)': 'm',
21
+ L: 'l',
22
+ }),
23
+ disabled: figma.enum('is disabled', {
24
+ False: false,
25
+ True: true,
26
+ }),
27
+ isLoading: figma.enum('Is loading', {
28
+ False: false,
29
+ True: true,
30
+ }),
31
+ outlined: figma.enum('Type', { Outlined: true }),
32
+ ghost: figma.enum('Type', { Ghost: true }),
33
+ },
34
+ example: ({ appearance, size, disabled, isLoading, outlined, ghost }) =>
35
+ html`<script setup>
36
+ import { MIconButton } from '@mozaic-ds/vue';
37
+ import { ChevronRight24 } from '@mozaic-ds/icons-vue';
38
+ </script>
39
+
40
+ <MIconButton
41
+ appearance=${appearance}
42
+ size=${size}
43
+ disabled=${disabled}
44
+ :is-loading=${isLoading}
45
+ outlined=${outlined}
46
+ ghost=${ghost}
47
+ aria-label="Action"
48
+ >
49
+ <template #icon>
50
+ <ChevronRight24 />
51
+ </template>
52
+ </MIconButton>`,
53
+ },
54
+ );
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Code Connect mapping for MKpiItem
3
+ * Links Figma KPI item (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=6-21651',
9
+ {
10
+ props: {
11
+ value: figma.string('Value'),
12
+ label: figma.string('KPI label'),
13
+ size: figma.enum('Size', {
14
+ 'S (Badge)': 's',
15
+ 'M (Inline)': 'm',
16
+ 'L (Card)': 'l',
17
+ }),
18
+ status: figma.enum('Status', {
19
+ Information: 'info',
20
+ Success: 'success',
21
+ Warning: 'warning',
22
+ Error: 'error',
23
+ Neutral: 'neutral',
24
+ }),
25
+ },
26
+ example: ({ value, label, size, status }) =>
27
+ html`<script setup>
28
+ import { MKpiItem } from '@mozaic-ds/vue';
29
+ </script>
30
+
31
+ <MKpiItem value=${value} label=${label} size=${size} status=${status} />`,
32
+ },
33
+ );
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Code Connect mapping for MLinearProgressbarBuffer
3
+ * Links Figma Linear progress bar (Buffer) (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=5-13925',
9
+ {
10
+ props: {
11
+ size: figma.enum('Size', {
12
+ S: 's',
13
+ M: 'm',
14
+ L: 'l',
15
+ }),
16
+ value: figma.enum('Completion', {
17
+ '0%': 0,
18
+ '25%': 25,
19
+ '50%': 50,
20
+ '75%': 75,
21
+ '100%': 100,
22
+ }),
23
+ },
24
+ example: ({ size, value }) =>
25
+ html`<script setup>
26
+ import { MLinearProgressbarBuffer } from '@mozaic-ds/vue';
27
+ </script>
28
+
29
+ <MLinearProgressbarBuffer size=${size} :value=${value}></MLinearProgressbarBuffer>`,
30
+ },
31
+ );
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Code Connect mapping for MLinearProgressbarPercentage
3
+ * Links Figma Linear progress bar (Percentage) (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=5-13902',
9
+ {
10
+ props: {
11
+ value: figma.enum('Completion', {
12
+ '0%': 0,
13
+ '25%': 25,
14
+ '50%': 50,
15
+ '75%': 75,
16
+ '100%': 100,
17
+ }),
18
+ },
19
+ example: ({ value }) =>
20
+ html`<script setup>
21
+ import { MLinearProgressbarPercentage } from '@mozaic-ds/vue';
22
+ </script>
23
+
24
+ <MLinearProgressbarPercentage :value=${value}></MLinearProgressbarPercentage>`,
25
+ },
26
+ );
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Code Connect mapping for MLink
3
+ * Links Figma Link (Standalone) (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=6-11290',
9
+ {
10
+ props: {
11
+ label: figma.string('Label'),
12
+ size: figma.enum('Size', {
13
+ S: 's',
14
+ M: 'm',
15
+ }),
16
+ appearance: figma.enum('Appearance', {
17
+ Primary: 'standard',
18
+ Secondary: 'secondary',
19
+ Accent: 'accent',
20
+ Inverse: 'inverse',
21
+ }),
22
+ },
23
+ example: ({ label, size, appearance }) =>
24
+ html`<script setup>
25
+ import { MLink } from '@mozaic-ds/vue';
26
+ </script>
27
+
28
+ <MLink href="#" size=${size} appearance=${appearance}>
29
+ ${label}
30
+ </MLink>`,
31
+ },
32
+ );
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Code Connect mapping for MLoader
3
+ * Links Figma Loader to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=5-14423',
9
+ {
10
+ props: {
11
+ appearance: figma.enum('Appearance', {
12
+ Standard: 'standard',
13
+ Accent: 'accent',
14
+ Inverse: 'inverse',
15
+ }),
16
+ size: figma.enum('Size', {
17
+ 'XS (20px)': 'xs',
18
+ 'S (24px)': 's',
19
+ 'M (32px)': 'm',
20
+ 'L (64px)': 'l',
21
+ }),
22
+ },
23
+ example: ({ appearance, size }) =>
24
+ html`<script setup>
25
+ import { MLoader } from '@mozaic-ds/vue';
26
+ </script>
27
+
28
+ <MLoader appearance=${appearance} size=${size}></MLoader>`,
29
+ },
30
+ );
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Code Connect mapping for MLoadingOverlay
3
+ * Links Figma Loading overlay (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=5-14550',
9
+ {
10
+ props: {},
11
+ example: () =>
12
+ html`<script setup>
13
+ import { MLoadingOverlay } from '@mozaic-ds/vue';
14
+ </script>
15
+
16
+ <MLoadingOverlay is-visible text="Loading..."></MLoadingOverlay>`,
17
+ },
18
+ );
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Code Connect mapping for MModal
3
+ * Links Figma Modal (ADS2) to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=5-6700',
9
+ {
10
+ props: {},
11
+ example: () =>
12
+ html`<script setup>
13
+ import { MModal, MButton } from '@mozaic-ds/vue';
14
+ </script>
15
+
16
+ <MModal
17
+ open
18
+ title="Modal title"
19
+ description="A modal is a dialog window allowing you to focus the user's attention."
20
+ closable
21
+ >
22
+ <template #footer>
23
+ <MButton>Confirm</MButton>
24
+ </template>
25
+ </MModal>`,
26
+ },
27
+ );
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Code Connect mapping for MNavigationIndicator
3
+ * Links Figma Navigation indicator to @mozaic-ds/vue
4
+ */
5
+ import figma, { html } from '@figma/code-connect/html';
6
+
7
+ figma.connect(
8
+ 'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=5-14643',
9
+ {
10
+ props: {
11
+ player: figma.boolean('Show player'),
12
+ showIndicator03: figma.boolean('Show Indicator 03'),
13
+ showIndicator04: figma.boolean('Show Indicator 04'),
14
+ showIndicator05: figma.boolean('Show Indicator 05'),
15
+ showIndicator06: figma.boolean('Show Indicator 06'),
16
+ },
17
+ example: ({ player }) =>
18
+ html`<script setup>
19
+ import { MNavigationIndicator } from '@mozaic-ds/vue';
20
+ </script>
21
+
22
+ <MNavigationIndicator :steps="6" :model-value="0" player=${player}></MNavigationIndicator>`,
23
+ },
24
+ );
@@ -77,24 +77,6 @@ describe('MNavigationIndicator.vue', () => {
77
77
  expect(emitted![0][0]).toBe(1);
78
78
  });
79
79
 
80
- it('emits update:modelValue when Enter is pressed on a step', async () => {
81
- const wrapper = mount(MNavigationIndicator, {
82
- props: { steps: 3, modelValue: 0 },
83
- global: {
84
- stubs: { MButton, MIconButton, PauseCircle24, PlayCircle24 },
85
- },
86
- });
87
-
88
- const stepButtons = wrapper.findAll(
89
- '.mc-navigation-indicator__list .mc-navigation-indicator__button',
90
- );
91
- await stepButtons[2].trigger('keydown', { key: 'Enter' });
92
-
93
- const emitted = wrapper.emitted('update:modelValue');
94
- expect(emitted).toBeTruthy();
95
- expect(emitted![0][0]).toBe(2);
96
- });
97
-
98
80
  it('does not emit update:modelValue when a wrong key is pressed', async () => {
99
81
  const wrapper = mount(MNavigationIndicator, {
100
82
  props: { steps: 3, modelValue: 0 },
@@ -149,4 +131,79 @@ describe('MNavigationIndicator.vue', () => {
149
131
  expect(button.text()).toContain('Pause');
150
132
  expect(wrapper.find('[data-testid="pause-icon"]').exists()).toBe(true);
151
133
  });
134
+
135
+ it('renders a navigation landmark with an aria-label', () => {
136
+ const wrapper = mount(MNavigationIndicator, {
137
+ props: { steps: 3, modelValue: 0 },
138
+ global: {
139
+ stubs: { MButton, MIconButton, PauseCircle24, PlayCircle24 },
140
+ },
141
+ });
142
+
143
+ const navigation = wrapper.find('nav[aria-label="Navigation steps"]');
144
+ expect(navigation.exists()).toBe(true);
145
+ expect(navigation.attributes('aria-label')).toBe('Navigation steps');
146
+ });
147
+
148
+ it('player icon button has aria-label reflecting action state', () => {
149
+ const wrapperPause = mount(MNavigationIndicator, {
150
+ props: { steps: 2, modelValue: 0, action: 'pause' },
151
+ global: { stubs: { MButton, MIconButton, PauseCircle24, PlayCircle24 } },
152
+ });
153
+ expect(
154
+ wrapperPause
155
+ .find('[data-testid="m-icon-button"]')
156
+ .attributes('aria-label'),
157
+ ).toBe('Pause');
158
+
159
+ const wrapperResume = mount(MNavigationIndicator, {
160
+ props: { steps: 2, modelValue: 0, action: 'resume' },
161
+ global: { stubs: { MButton, MIconButton, PauseCircle24, PlayCircle24 } },
162
+ });
163
+ expect(
164
+ wrapperResume
165
+ .find('[data-testid="m-icon-button"]')
166
+ .attributes('aria-label'),
167
+ ).toBe('Resume');
168
+ });
169
+
170
+ it('gives each step button an action-oriented aria-label', () => {
171
+ const wrapper = mount(MNavigationIndicator, {
172
+ props: { steps: 3, modelValue: 1 },
173
+ global: {
174
+ stubs: { MButton, MIconButton, PauseCircle24, PlayCircle24 },
175
+ },
176
+ });
177
+
178
+ const buttons = wrapper.findAll('.mc-navigation-indicator__button');
179
+ expect(buttons[0].attributes('aria-label')).toBe('Go to step 1 of 3');
180
+ expect(buttons[1].attributes('aria-label')).toBe('Current step, 2 of 3');
181
+ expect(buttons[2].attributes('aria-label')).toBe('Go to step 3 of 3');
182
+ });
183
+
184
+ it('sets aria-current="step" only on the active step button', () => {
185
+ const wrapper = mount(MNavigationIndicator, {
186
+ props: { steps: 3, modelValue: 1 },
187
+ global: {
188
+ stubs: { MButton, MIconButton, PauseCircle24, PlayCircle24 },
189
+ },
190
+ });
191
+
192
+ const buttons = wrapper.findAll('.mc-navigation-indicator__button');
193
+ expect(buttons[1].attributes('aria-current')).toBe('step');
194
+ expect(buttons[0].attributes('aria-current')).not.toBe('step');
195
+ expect(buttons[2].attributes('aria-current')).not.toBe('step');
196
+ });
197
+
198
+ it('emits "action" when the player button is clicked', async () => {
199
+ const wrapper = mount(MNavigationIndicator, {
200
+ props: { steps: 2, modelValue: 0, action: 'resume' },
201
+ global: {
202
+ stubs: { MButton, MIconButton, PauseCircle24, PlayCircle24 },
203
+ },
204
+ });
205
+
206
+ await wrapper.find('[data-testid="m-icon-button"]').trigger('click');
207
+ expect(wrapper.emitted('action')).toBeTruthy();
208
+ });
152
209
  });