@mozaic-ds/vue 2.15.0 → 2.17.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 (125) hide show
  1. package/dist/mozaic-vue.css +2 -1
  2. package/dist/mozaic-vue.d.ts +1040 -408
  3. package/dist/mozaic-vue.js +17183 -6742
  4. package/dist/mozaic-vue.js.map +1 -1
  5. package/dist/mozaic-vue.umd.cjs +26 -6
  6. package/dist/mozaic-vue.umd.cjs.map +1 -1
  7. package/package.json +11 -5
  8. package/src/components/BrandPresets.mdx +2 -2
  9. package/src/components/ComponentsMapping.mdx +98 -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/actionbottombar/MActionBottomBar.figma.ts +24 -0
  13. package/src/components/actionlistbox/MActionListbox.figma.ts +30 -0
  14. package/src/components/actionlistbox/MActionListbox.spec.ts +14 -0
  15. package/src/components/actionlistbox/MActionListbox.stories.ts +15 -8
  16. package/src/components/actionlistbox/MActionListbox.vue +13 -1
  17. package/src/components/actionlistbox/README.md +2 -1
  18. package/src/components/avatar/MAvatar.figma.ts +31 -0
  19. package/src/components/breadcrumb/MBreadcrumb.figma.ts +31 -0
  20. package/src/components/builtinmenu/MBuiltInMenu.figma.ts +23 -0
  21. package/src/components/button/MButton.figma.ts +41 -0
  22. package/src/components/button/README.md +2 -0
  23. package/src/components/callout/MCallout.figma.ts +29 -0
  24. package/src/components/carousel/MCarousel.figma.ts +32 -0
  25. package/src/components/checkbox/MCheckbox.figma.ts +45 -0
  26. package/src/components/checkboxgroup/MCheckboxGroup.figma.ts +30 -0
  27. package/src/components/checklistmenu/MCheckListMenu.figma.ts +29 -0
  28. package/src/components/circularprogressbar/MCircularProgressbar.figma.ts +31 -0
  29. package/src/components/combobox/MCombobox.figma.ts +48 -0
  30. package/src/components/combobox/MCombobox.spec.ts +246 -0
  31. package/src/components/combobox/MCombobox.stories.ts +190 -0
  32. package/src/components/combobox/MCombobox.vue +286 -0
  33. package/src/components/combobox/README.md +52 -0
  34. package/src/components/container/MContainer.figma.ts +30 -0
  35. package/src/components/datatable/DataTable.stories.ts +277 -0
  36. package/src/components/datatable/DataTableCells.stories.ts +251 -0
  37. package/src/components/datatable/DataTableEmpty.stories.ts +102 -0
  38. package/src/components/datatable/DataTableExpandable.stories.ts +95 -0
  39. package/src/components/datatable/DataTableNested.stories.ts +96 -0
  40. package/src/components/datatable/DataTableSelectable.stories.ts +124 -0
  41. package/src/components/datatable/DataTableSortable.stories.ts +164 -0
  42. package/src/components/datatable/MDataTable.types.ts +54 -0
  43. package/src/components/datatable/assets/styles.scss +10 -0
  44. package/src/components/datatable/datatable.mdx +62 -0
  45. package/src/components/datatable/tools/data.js +8 -0
  46. package/src/components/datatable/tools/data.json +2018 -0
  47. package/src/components/datatable/utils.js +19 -0
  48. package/src/components/datepicker/MDatepicker.figma.ts +20 -0
  49. package/src/components/divider/MDivider.figma.ts +30 -0
  50. package/src/components/drawer/MDrawer.figma.ts +37 -0
  51. package/src/components/drawer/README.md +1 -1
  52. package/src/components/field/MField.figma.ts +30 -0
  53. package/src/components/field/MField.stories.ts +105 -0
  54. package/src/components/fileuploader/MFileUploader.figma.ts +23 -0
  55. package/src/components/fileuploaderitem/MFileUploaderItem.figma.ts +27 -0
  56. package/src/components/flag/MFlag.figma.ts +26 -0
  57. package/src/components/iconbutton/MIconButton.figma.ts +54 -0
  58. package/src/components/kpiitem/MKpiItem.figma.ts +33 -0
  59. package/src/components/linearprogressbarbuffer/MLinearProgressbarBuffer.figma.ts +31 -0
  60. package/src/components/linearprogressbarpercentage/MLinearProgressbarPercentage.figma.ts +26 -0
  61. package/src/components/link/MLink.figma.ts +32 -0
  62. package/src/components/loader/MLoader.figma.ts +30 -0
  63. package/src/components/loadingoverlay/MLoadingOverlay.figma.ts +18 -0
  64. package/src/components/modal/MModal.figma.ts +27 -0
  65. package/src/components/navigationindicator/MNavigationIndicator.figma.ts +24 -0
  66. package/src/components/numberbadge/MNumberBadge.figma.ts +31 -0
  67. package/src/components/optionListbox/MOptionListbox.figma.ts +36 -0
  68. package/src/components/optionListbox/MOptionListbox.spec.ts +527 -0
  69. package/src/components/optionListbox/MOptionListbox.vue +470 -0
  70. package/src/components/optionListbox/README.md +63 -0
  71. package/src/components/overlay/MOverlay.figma.ts +20 -0
  72. package/src/components/pageheader/MPageHeader.figma.ts +21 -0
  73. package/src/components/pagination/MPagination.figma.ts +34 -0
  74. package/src/components/passwordinput/MPasswordInput.figma.ts +30 -0
  75. package/src/components/phonenumber/MPhoneNumber.figma.ts +47 -0
  76. package/src/components/pincode/MPincode.figma.ts +41 -0
  77. package/src/components/pincode/MPincode.spec.ts +1 -4
  78. package/src/components/pincode/MPincode.vue +11 -15
  79. package/src/components/popover/MPopover.figma.ts +42 -0
  80. package/src/components/quantityselector/MQuantitySelector.figma.ts +50 -0
  81. package/src/components/radio/MRadio.figma.ts +40 -0
  82. package/src/components/radiogroup/MRadioGroup.figma.ts +30 -0
  83. package/src/components/segmentedcontrol/MSegmentedControl.figma.ts +33 -0
  84. package/src/components/select/MSelect.figma.ts +49 -0
  85. package/src/components/sidebar/MSidebar.figma.ts +28 -0
  86. package/src/components/sidebarexpandableitem/MSidebarExpandableItem.figma.ts +19 -0
  87. package/src/components/sidebarfooter/MSidebarFooter.figma.ts +21 -0
  88. package/src/components/sidebarheader/MSidebarHeader.figma.ts +18 -0
  89. package/src/components/sidebarnavitem/MSidebarNavItem.figma.ts +23 -0
  90. package/src/components/sidebarshortcutitem/MSidebarShortcutItem.figma.ts +20 -0
  91. package/src/components/starrating/MStarRating.figma.ts +35 -0
  92. package/src/components/statusbadge/MStatusBadge.figma.ts +27 -0
  93. package/src/components/statusdot/MStatusDot.figma.ts +31 -0
  94. package/src/components/statusmessage/MStatusMessage.figma.ts +28 -0
  95. package/src/components/statusmessage/MStatusMessage.spec.ts +15 -0
  96. package/src/components/statusmessage/MStatusMessage.stories.ts +4 -0
  97. package/src/components/statusmessage/MStatusMessage.vue +7 -0
  98. package/src/components/statusmessage/README.md +2 -0
  99. package/src/components/statusnotification/MStatusNotification.figma.ts +29 -0
  100. package/src/components/stepperbottombar/MStepperBottomBar.figma.ts +20 -0
  101. package/src/components/steppercompact/MStepperCompact.figma.ts +21 -0
  102. package/src/components/stepperinline/MStepperInline.figma.ts +23 -0
  103. package/src/components/stepperstacked/MStepperStacked.figma.ts +23 -0
  104. package/src/components/stepperstacked/MStepperStacked.spec.ts +162 -0
  105. package/src/components/stepperstacked/MStepperStacked.stories.ts +57 -0
  106. package/src/components/stepperstacked/MStepperStacked.vue +106 -0
  107. package/src/components/stepperstacked/README.md +15 -0
  108. package/src/components/tabs/MTabs.figma.ts +33 -0
  109. package/src/components/tag/MTag.figma.ts +26 -0
  110. package/src/components/tag/MTag.stories.ts +13 -3
  111. package/src/components/tag/MTag.vue +11 -1
  112. package/src/components/tag/README.md +6 -0
  113. package/src/components/textarea/MTextArea.figma.ts +28 -0
  114. package/src/components/textinput/MTextInput.figma.ts +51 -0
  115. package/src/components/textinput/MTextInput.vue +13 -1
  116. package/src/components/textinput/README.md +15 -1
  117. package/src/components/tile/MTile.figma.ts +31 -0
  118. package/src/components/tileclickable/MTileClickable.figma.ts +31 -0
  119. package/src/components/tileexpandable/MTileExpandable.figma.ts +31 -0
  120. package/src/components/tileselectable/MTileSelectable.figma.ts +29 -0
  121. package/src/components/toaster/MToaster.figma.ts +25 -0
  122. package/src/components/toggle/MToggle.figma.ts +39 -0
  123. package/src/components/togglegroup/MToggleGroup.figma.ts +30 -0
  124. package/src/components/tooltip/MTooltip.figma.ts +29 -0
  125. package/src/main.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozaic-ds/vue",
3
- "version": "2.15.0",
3
+ "version": "2.17.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",
@@ -32,7 +32,9 @@
32
32
  "release:beta": "release-it --preRelease=beta",
33
33
  "prepublishOnly": "npm run build",
34
34
  "npm:publish": "npm publish --access public",
35
- "npm:publish:beta": "npm publish --access public --tag beta"
35
+ "npm:publish:beta": "npm publish --access public --tag beta",
36
+ "figma:connect": "figma connect parse",
37
+ "figma:connect:publish": "dotenv -e .env -- figma connect publish"
36
38
  },
37
39
  "files": [
38
40
  "dist/*",
@@ -41,7 +43,7 @@
41
43
  "*.d.ts"
42
44
  ],
43
45
  "dependencies": {
44
- "@mozaic-ds/styles": "^2.11.0",
46
+ "@mozaic-ds/styles": "^2.15.0",
45
47
  "@mozaic-ds/web-fonts": "^1.65.0",
46
48
  "postcss-scss": "^4.0.9",
47
49
  "vue": "^3.5.13"
@@ -49,7 +51,9 @@
49
51
  "devDependencies": {
50
52
  "@commitlint/cli": "^20.1.0",
51
53
  "@commitlint/config-conventional": "^20.0.0",
54
+ "@figma/code-connect": "^1.4.1",
52
55
  "@mozaic-ds/css-dev-tools": "1.75.0",
56
+ "@mozaic-ds/datatable-vue": "^1.0.0",
53
57
  "@mozaic-ds/icons-vue": "^2.5.0",
54
58
  "@release-it/conventional-changelog": "^10.0.1",
55
59
  "@storybook/addon-a11y": "^10.0.4",
@@ -57,19 +61,21 @@
57
61
  "@storybook/addon-themes": "^10.0.4",
58
62
  "@storybook/vue3-vite": "^10.0.4",
59
63
  "@types/jsdom": "^28.0.0",
64
+ "@types/lodash": "^4.17.23",
60
65
  "@vitejs/plugin-vue": "^6.0.1",
61
66
  "@vitest/coverage-v8": "^4.0.7",
62
67
  "@vitest/eslint-plugin": "^1.1.38",
63
68
  "@vue/eslint-config-prettier": "^10.2.0",
64
69
  "@vue/eslint-config-typescript": "^14.5.0",
65
70
  "@vue/test-utils": "^2.4.6",
71
+ "dotenv-cli": "^11.0.0",
66
72
  "eslint": "^10.0.2",
67
73
  "eslint-plugin-storybook": "^10.0.5",
68
74
  "eslint-plugin-vue": "^10.0.0",
69
75
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
70
76
  "globals": "^17.3.0",
71
77
  "husky": "^9.1.7",
72
- "jsdom": "^28.0.0",
78
+ "jsdom": "^29.0.0",
73
79
  "libphonenumber-js": "^1.12.23",
74
80
  "lint-staged": "^16.1.5",
75
81
  "mdx-mermaid": "^2.0.3",
@@ -81,7 +87,7 @@
81
87
  "storybook": "^10.0.4",
82
88
  "storybook-addon-tag-badges": "^3.0.2",
83
89
  "typescript": "^5.7.2",
84
- "vite": "^7.1.1",
90
+ "vite": "^8.0.0",
85
91
  "vite-plugin-dts": "^4.5.3",
86
92
  "vitest": "^4.0.7",
87
93
  "vue-component-meta": "^3.0.8",
@@ -34,7 +34,7 @@ All it has to do is insert the following code into its main Sass file (entrypoin
34
34
  dark
35
35
  code={`
36
36
  // Entrypoint stylesheet
37
- @use "@mozaic-ds/tokens/<presetName>" as *;
37
+ @use "@mozaic-ds/tokens/<presetName>/theme" as *;
38
38
  `}
39
39
  />
40
40
 
@@ -49,7 +49,7 @@ For example, for ADEO
49
49
  dark
50
50
  code={`
51
51
  // Entrypoint stylesheet
52
- @use "@mozaic-ds/tokens/adeo" as *;
52
+ @use "@mozaic-ds/tokens/adeo/theme" as *;
53
53
  `}
54
54
  />
55
55
 
@@ -0,0 +1,98 @@
1
+ import { Meta } from '@storybook/addon-docs/blocks';
2
+
3
+ <Meta title="Components v1 → v2" />
4
+
5
+ # Components mapping v1 → v2
6
+
7
+ ## Introduction
8
+
9
+ This document summarizes all component changes between the ADS Vue V1 and V2 design system libraries — including renames, splits, merges, removals, and new additions.
10
+
11
+
12
+ ### Mapping Table
13
+
14
+ <table>
15
+ <thead>
16
+ <tr>
17
+ <th>V1 Component</th>
18
+ <th>V2 Component</th>
19
+ <th>Status</th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr><td><code>MAccordion</code></td><td><code>MAccordionList</code> + <code>MAccordionListItem</code></td><td>🔀 Split</td></tr>
24
+ <tr><td><code>MActionBar</code> + <code>MBottomBar</code></td><td><code>MActionBottomBar</code></td><td>🔗 Merged</td></tr>
25
+ <tr><td><code>MListBoxActions</code></td><td><code>MActionListBox</code></td><td>🔄 Renamed</td></tr>
26
+ <tr><td>—</td><td><code>MAvatar</code></td><td>✨ New</td></tr>
27
+ <tr><td><code>MBreadcrumb</code></td><td><code>MBreadcrumb</code></td><td>✅ Same name</td></tr>
28
+ <tr><td><code>MMenu</code></td><td><code>MBuiltInMenu</code></td><td>🔄 Renamed</td></tr>
29
+ <tr><td><code>MButton</code></td><td><code>MButton</code></td><td>✅ Same name</td></tr>
30
+ <tr><td>—</td><td><code>MCallout</code></td><td>✨ New</td></tr>
31
+ <tr><td>—</td><td><code>MCarousel</code></td><td>✨ New</td></tr>
32
+ <tr><td><code>MCheckbox</code></td><td><code>MCheckbox</code></td><td>✅ Same name</td></tr>
33
+ <tr><td><code>MCheckboxGroup</code></td><td><code>MCheckboxGroup</code></td><td>✅ Same name</td></tr>
34
+ <tr><td>—</td><td><code>MChecklistMenu</code></td><td>✨ New</td></tr>
35
+ <tr><td>—</td><td><code>MCircularProgressBar</code></td><td>✨ New</td></tr>
36
+ <tr><td><code>MAutocomplete</code> + <code>MDropdown</code></td><td><code>MCombobox</code></td><td>🔗 Merged</td></tr>
37
+ <tr><td><code>MContainer</code></td><td><code>MContainer</code></td><td>✅ Same name</td></tr>
38
+ <tr><td>—</td><td><code>MDatePicker</code></td><td>✨ New</td></tr>
39
+ <tr><td>—</td><td><code>MDivider</code></td><td>✨ New</td></tr>
40
+ <tr><td><code>MLayer</code></td><td><code>MDrawer</code></td><td>🔄 Renamed</td></tr>
41
+ <tr><td><code>MField</code></td><td><code>MField</code></td><td>✅ Same name</td></tr>
42
+ <tr><td>—</td><td><code>MFieldGroup</code></td><td>✨ New</td></tr>
43
+ <tr><td><code>MFileUploader</code></td><td><code>MFileUploader</code></td><td>✅ Same name</td></tr>
44
+ <tr><td>—</td><td><code>MFileUploaderItem</code></td><td>✨ New</td></tr>
45
+ <tr><td><code>MFlag</code></td><td><code>MFlag</code></td><td>✅ Same name</td></tr>
46
+ <tr><td><code>MIcon</code></td><td><em>removed</em></td><td>🗑️ Removed</td></tr>
47
+ <tr><td>—</td><td><code>MIconButton</code></td><td>✨ New</td></tr>
48
+ <tr><td>—</td><td><code>MKpiItem</code></td><td>✨ New</td></tr>
49
+ <tr><td><code>MProgress</code></td><td><code>MLinearProgressBarBuffer</code> + <code>MLinearProgressBarPercentage</code></td><td>🔀 Split</td></tr>
50
+ <tr><td><code>MLink</code></td><td><code>MLink</code></td><td>✅ Same name</td></tr>
51
+ <tr><td><code>MLoader</code></td><td><code>MLoader</code></td><td>✅ Same name</td></tr>
52
+ <tr><td>—</td><td><code>MLoadingOverlay</code></td><td>✨ New</td></tr>
53
+ <tr><td><code>MModal</code></td><td><code>MModal</code></td><td>✅ Same name</td></tr>
54
+ <tr><td>—</td><td><code>MNavigationIndicator</code></td><td>✨ New</td></tr>
55
+ <tr><td><code>MNotification</code></td><td><code>MStatusNotification</code></td><td>🔄 Renamed</td></tr>
56
+ <tr><td>—</td><td><code>MNumberBadge</code></td><td>✨ New</td></tr>
57
+ <tr><td><code>MListbox</code></td><td><code>MOptionListBox</code></td><td>🔄 Renamed</td></tr>
58
+ <tr><td><code>MOverlay</code></td><td><code>MOverlay</code></td><td>✅ Same name</td></tr>
59
+ <tr><td>—</td><td><code>MPageHeader</code></td><td>✨ New</td></tr>
60
+ <tr><td><code>MPagination</code></td><td><code>MPagination</code></td><td>✅ Same name</td></tr>
61
+ <tr><td><code>MPasswordInput</code></td><td><code>MPasswordInput</code></td><td>✅ Same name</td></tr>
62
+ <tr><td><code>MPhoneNumber</code></td><td><code>MPhoneNumber</code></td><td>✅ Same name</td></tr>
63
+ <tr><td>—</td><td><code>MPinCode</code></td><td>✨ New</td></tr>
64
+ <tr><td>—</td><td><code>MPopover</code></td><td>✨ New</td></tr>
65
+ <tr><td><code>MQuantitySelector</code></td><td><code>MQuantitySelector</code></td><td>✅ Same name</td></tr>
66
+ <tr><td><code>MRadio</code></td><td><code>MRadio</code></td><td>✅ Same name</td></tr>
67
+ <tr><td><code>MRadioGroup</code></td><td><code>MRadioGroup</code></td><td>✅ Same name</td></tr>
68
+ <tr><td><code>MSegmentedControl</code></td><td><code>MSegmentedControl</code></td><td>✅ Same name</td></tr>
69
+ <tr><td><code>MSelect</code></td><td><code>MSelect</code></td><td>✅ Same name</td></tr>
70
+ <tr><td><code>MSidebar</code></td><td><code>MSidebar</code> + 6 sub-components</td><td>🔀 Split</td></tr>
71
+ <tr><td>—</td><td><code>MSidebarExpandableItem</code></td><td>✨ New</td></tr>
72
+ <tr><td>—</td><td><code>MSidebarFooter</code></td><td>✨ New</td></tr>
73
+ <tr><td>—</td><td><code>MSidebarHeader</code></td><td>✨ New</td></tr>
74
+ <tr><td>—</td><td><code>MSidebarNavItem</code></td><td>✨ New</td></tr>
75
+ <tr><td>—</td><td><code>MSidebarShortcutItem</code></td><td>✨ New</td></tr>
76
+ <tr><td>—</td><td><code>MSidebarShortcuts</code></td><td>✨ New</td></tr>
77
+ <tr><td>—</td><td><code>MStarRating</code></td><td>✨ New</td></tr>
78
+ <tr><td><code>MBadge</code></td><td><code>MStatusBadge</code></td><td>🔄 Renamed</td></tr>
79
+ <tr><td>—</td><td><code>MStatusDot</code></td><td>✨ New</td></tr>
80
+ <tr><td>—</td><td><code>MStatusMessage</code></td><td>✨ New</td></tr>
81
+ <tr><td><code>MStepper</code> (<code>compact: false</code>)</td><td><code>MStepperInline</code></td><td>🔄 Renamed</td></tr>
82
+ <tr><td><code>MStepper</code> (<code>compact: true</code>)</td><td><code>MStepperCompact</code></td><td>🔄 Renamed</td></tr>
83
+ <tr><td>—</td><td><code>MStepperBottomBar</code></td><td>✨ New</td></tr>
84
+ <tr><td>—</td><td><code>MStepperStacked</code></td><td>✨ New</td></tr>
85
+ <tr><td><code>MTab</code> / <code>MTabsV2</code></td><td><code>MTabs</code></td><td>🔄 Renamed</td></tr>
86
+ <tr><td><code>MTag</code></td><td><code>MTag</code></td><td>✅ Same name</td></tr>
87
+ <tr><td><code>MTextArea</code></td><td><code>MTextArea</code></td><td>✅ Same name</td></tr>
88
+ <tr><td><code>MTextInput</code></td><td><code>MTextInput</code></td><td>✅ Same name</td></tr>
89
+ <tr><td>—</td><td><code>MTile</code></td><td>✨ New</td></tr>
90
+ <tr><td>—</td><td><code>MTileClickable</code></td><td>✨ New</td></tr>
91
+ <tr><td>—</td><td><code>MTileExpandable</code></td><td>✨ New</td></tr>
92
+ <tr><td><code>MOptionCard</code></td><td><code>MTileSelectable</code></td><td>🔄 Renamed</td></tr>
93
+ <tr><td>—</td><td><code>MToaster</code></td><td>✨ New</td></tr>
94
+ <tr><td><code>MToggle</code></td><td><code>MToggle</code></td><td>✅ Same name</td></tr>
95
+ <tr><td>—</td><td><code>MToggleGroup</code></td><td>✨ New</td></tr>
96
+ <tr><td>—</td><td><code>MTooltip</code></td><td>✨ New</td></tr>
97
+ </tbody>
98
+ </table>
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Code Connect mapping for MAccordionList
3
+ * Links Figma Accordion List 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=1647%3A16440',
9
+ {
10
+ props: {
11
+ appearance: figma.enum('Appareance', {
12
+ Standard: 'standard',
13
+ Ghost: 'ghost',
14
+ }),
15
+ showItem02: figma.boolean('Show Item 02'),
16
+ showItem03: figma.boolean('Show Item 03'),
17
+ showItem04: figma.boolean('Show Item 04'),
18
+ showItem05: figma.boolean('Show Item 05'),
19
+ showItem06: figma.boolean('Show Item 06'),
20
+ showItem07: figma.boolean('Show Item 07'),
21
+ showItem08: figma.boolean('Show Item 08'),
22
+ },
23
+ example: ({ appearance }) =>
24
+ html`<script setup>
25
+ import { MAccordionList, MAccordionListItem } from '@mozaic-ds/vue';
26
+ </script>
27
+
28
+ <MAccordionList appearance=${appearance}>
29
+ <MAccordionListItem id="1" title="Content title">
30
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
31
+ </MAccordionListItem>
32
+ <MAccordionListItem id="2" title="Content title">
33
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
34
+ </MAccordionListItem>
35
+ <MAccordionListItem id="3" title="Content title">
36
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
37
+ </MAccordionListItem>
38
+ <MAccordionListItem id="4" title="Content title">
39
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
40
+ </MAccordionListItem>
41
+ </MAccordionList>`,
42
+ },
43
+ );
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Code Connect mapping for MAccordionListItem
3
+ * Links Figma Accordion List 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/branch/tOAc8mV1PF5g0tjBfSbUXA/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=1647%3A16442',
9
+ {
10
+ props: {
11
+ title: figma.string('Title'),
12
+ subtitle: figma.boolean('Has subtitle', {
13
+ true: figma.string('Subtitle'),
14
+ false: undefined,
15
+ }),
16
+ },
17
+ example: ({ title, subtitle }) =>
18
+ html`<script setup>
19
+ import { MAccordionListItem } from '@mozaic-ds/vue';
20
+ </script>
21
+
22
+ <MAccordionListItem id="accordion-1" title=${title} subtitle=${subtitle}>
23
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
24
+ </MAccordionListItem>`,
25
+ imports: ["import { MAccordionListItem } from '@mozaic-ds/vue'"],
26
+ },
27
+ );
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Code Connect mapping for MActionBottomBar
3
+ * Links Figma Action bottom bar (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=10709-6937',
9
+ {
10
+ props: {
11
+ shadow: figma.boolean('Has shadow'),
12
+ },
13
+ example: ({ shadow }) =>
14
+ html`<script setup>
15
+ import { MActionBottomBar, MButton } from '@mozaic-ds/vue';
16
+ </script>
17
+
18
+ <MActionBottomBar shadow=${shadow}>
19
+ <template #right>
20
+ <MButton size="s" appearance="accent">Save</MButton>
21
+ </template>
22
+ </MActionBottomBar>`,
23
+ },
24
+ );
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Code Connect mapping for MActionListbox
3
+ * Links Figma Action listbox (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-29046',
9
+ {
10
+ props: {},
11
+ example: () =>
12
+ html`<script setup>
13
+ import { MActionListbox, MButton } from '@mozaic-ds/vue';
14
+ import { Copy20, Download20, Trash20 } from '@mozaic-ds/icons-vue';
15
+ </script>
16
+
17
+ <MActionListbox
18
+ title="Listbox title"
19
+ :items="[
20
+ { id: '1', label: 'Duplicate', icon: Copy20 },
21
+ { id: '2', label: 'Download', icon: Download20 },
22
+ { id: '3', label: 'Delete', icon: Trash20, appearance: 'danger', divider: true },
23
+ ]"
24
+ >
25
+ <template #activator="{ id }">
26
+ <MButton :popovertarget="id">Open menu</MButton>
27
+ </template>
28
+ </MActionListbox>`,
29
+ },
30
+ );
@@ -24,6 +24,7 @@ const items = [
24
24
  icon: DummyIcon,
25
25
  },
26
26
  {
27
+ id: 'move',
27
28
  label: 'Move to...',
28
29
  icon: DummyIcon,
29
30
  },
@@ -121,4 +122,17 @@ describe('MActionListbox', () => {
121
122
  expect(wrapper.emitted('close')).toBeTruthy();
122
123
  expect(wrapper.emitted('close')?.length).toBe(1);
123
124
  });
125
+
126
+ it('emits "action" when an item is clicked', async () => {
127
+ const wrapper = mountComponent({ title: 'Action List' });
128
+
129
+ const actions = wrapper.findAll('.mc-action-list__button');
130
+ await actions[0].trigger('click');
131
+
132
+ expect(wrapper.emitted('action')).toBeTruthy();
133
+ expect(wrapper.emitted('action')?.[0][0]).toBe(0);
134
+
135
+ await actions[1].trigger('click');
136
+ expect(wrapper.emitted('action')?.[1][0]).toBe('move');
137
+ });
124
138
  });
@@ -1,4 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { action } from 'storybook/actions';
2
3
 
3
4
  import MActionListbox from './MActionListbox.vue';
4
5
  import MButton from '../button/MButton.vue';
@@ -25,10 +26,10 @@ const meta: Meta<typeof MActionListbox> = {
25
26
  <template>
26
27
  <MActionListbox
27
28
  :items="[
28
- { label: 'Duplicate', icon: Copy20, disabled: true },
29
- { label: 'Move to...', icon: ArrowTopRight20 },
30
- { label: 'Download', icon: Download20 },
31
- { label: 'Delete', icon: Trash20, appearance: 'danger', divider: true }
29
+ { id: 'item-1', label: 'Duplicate', icon: Copy20, disabled: true },
30
+ { id: 'item-2', label: 'Move to...', icon: ArrowTopRight20 },
31
+ { id: 'item-3', label: 'Download', icon: Download20 },
32
+ { id: 'item-4', label: 'Delete', icon: Trash20, appearance: 'danger', divider: true }
32
33
  ]"
33
34
  title="Listbox title (optional)"
34
35
  />
@@ -41,19 +42,23 @@ const meta: Meta<typeof MActionListbox> = {
41
42
  title: 'Listbox title (optional)',
42
43
  items: [
43
44
  {
45
+ id: 'item-1',
44
46
  label: 'Duplicate',
45
47
  icon: Copy20,
46
48
  disabled: true,
47
49
  },
48
50
  {
51
+ id: 'item-2',
49
52
  label: 'Move to...',
50
53
  icon: ArrowTopRight20,
51
54
  },
52
55
  {
56
+ id: 'item-3',
53
57
  label: 'Download',
54
58
  icon: Download20,
55
59
  },
56
60
  {
61
+ id: 'item-4',
57
62
  label: 'Delete',
58
63
  icon: Trash20,
59
64
  appearance: 'danger',
@@ -64,10 +69,11 @@ const meta: Meta<typeof MActionListbox> = {
64
69
  render: (args) => ({
65
70
  components: { MActionListbox },
66
71
  setup() {
67
- return { args };
72
+ const handleAction = action('action');
73
+ return { args, handleAction };
68
74
  },
69
75
  template: `
70
- <MActionListbox v-bind="args" />
76
+ <MActionListbox v-bind="args" @action="handleAction" />
71
77
  `,
72
78
  }),
73
79
  };
@@ -80,11 +86,12 @@ export const Activator: Story = {
80
86
  render: (args) => ({
81
87
  components: { MActionListbox, MButton },
82
88
  setup() {
83
- return { args };
89
+ const handleAction = action('action');
90
+ return { args, handleAction };
84
91
  },
85
92
  template: `
86
93
  <div>
87
- <MActionListbox v-bind="args">
94
+ <MActionListbox v-bind="args" @action="handleAction">
88
95
  <template #activator="{id}">
89
96
  <MButton :popovertarget="id">Activator</MButton>
90
97
  </template>
@@ -42,7 +42,11 @@
42
42
  ]"
43
43
  role="menuitem"
44
44
  >
45
- <button type="button" class="mc-action-list__button">
45
+ <button
46
+ type="button"
47
+ class="mc-action-list__button"
48
+ @click="emit('action', item?.id || index)"
49
+ >
46
50
  <component
47
51
  v-if="item.icon"
48
52
  class="mc-action-list__icon"
@@ -85,6 +89,10 @@ const props = withDefaults(
85
89
  */
86
90
 
87
91
  items: Array<{
92
+ /**
93
+ * Unique identifier for the item.
94
+ */
95
+ id?: string;
88
96
  /**
89
97
  * The icon displayed for the item from Mozaic-icon-vue.
90
98
  */
@@ -115,6 +123,10 @@ const emit = defineEmits<{
115
123
  * Emits when the close button is clicked.
116
124
  */
117
125
  (on: 'close'): void;
126
+ /**
127
+ * Emits when an item is clicked, providing its id or index.
128
+ */
129
+ (on: 'action', value: string | number): void;
118
130
  }>();
119
131
 
120
132
  const slots = defineSlots<{
@@ -9,7 +9,7 @@ An action list is a contextual menu that presents a list of available actions re
9
9
  | --- | --- | --- | --- |
10
10
  | `title` | title displayed in mobile version. | `string` | - |
11
11
  | `position` | Defines the position of the listbox relative to its trigger or container. | `"bottom"` `"top"` `"left"` `"right"` | `"bottom"` |
12
- | `items*` | An array of objects that allows you to provide all the data needed to generate the content for each item. | `{ icon?: Component` `undefined; label: string; disabled?: boolean` `undefined; appearance?: "standard"` `"danger"` `undefined; divider?: boolean` `undefined; }[]` | - |
12
+ | `items*` | An array of objects that allows you to provide all the data needed to generate the content for each item. | `{ id?: string` `undefined; icon?: Component` `undefined; label: string; disabled?: boolean` `undefined; appearance?: "standard"` `"danger"` `undefined; divider?: boolean` `undefined; }[]` | - |
13
13
 
14
14
  ## Slots
15
15
 
@@ -22,6 +22,7 @@ An action list is a contextual menu that presents a list of available actions re
22
22
  | Name | Description | Type |
23
23
  | --- | --- | --- |
24
24
  | `close` | Emits when the close button is clicked. | [] |
25
+ | `action` | Emits when an item is clicked, providing its id or index. | [value: string | number] |
25
26
 
26
27
  ## Dependencies
27
28
 
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Code Connect mapping for MAvatar
3
+ * Links Figma Avatar (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-6412',
9
+ {
10
+ props: {
11
+ size: figma.enum('Size', {
12
+ 'S (32px)': 's',
13
+ 'M (48px)': 'm',
14
+ 'L (64px)': 'l',
15
+ }),
16
+ type: figma.enum('Type', {
17
+ Picture: 'picture',
18
+ Initials: 'initials',
19
+ Icon: 'icon',
20
+ }),
21
+ },
22
+ example: ({ size }) =>
23
+ html`<script setup>
24
+ import { MAvatar } from '@mozaic-ds/vue';
25
+ </script>
26
+
27
+ <MAvatar size=${size}>
28
+ <img src="/placeholder.png" alt="Avatar" />
29
+ </MAvatar>`,
30
+ },
31
+ );
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Code Connect mapping for MBreadcrumb
3
+ * Links Figma Breadcrumb (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-11237',
9
+ {
10
+ props: {
11
+ appearance: figma.enum('Appearance', {
12
+ Standard: 'standard',
13
+ 'Inverse (only on dark background)': 'inverse',
14
+ }),
15
+ },
16
+ example: ({ appearance }) =>
17
+ html`<script setup>
18
+ import { MBreadcrumb } from '@mozaic-ds/vue';
19
+ </script>
20
+
21
+ <MBreadcrumb
22
+ appearance=${appearance}
23
+ :links="[
24
+ { label: 'Home', href: '#' },
25
+ { label: 'Level 01', href: '#' },
26
+ { label: 'Current Page', href: '#' },
27
+ ]"
28
+ aria-label="breadcrumb"
29
+ ></MBreadcrumb>`,
30
+ },
31
+ );
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Code Connect mapping for MBuiltInMenu
3
+ * Links Figma Built-in menu (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-11260',
9
+ {
10
+ props: {
11
+ outlined: figma.enum('is outlined', {
12
+ 'true': true,
13
+ 'false': false,
14
+ }),
15
+ },
16
+ example: ({ outlined }) =>
17
+ html`<script setup>
18
+ import { MBuiltInMenu } from '@mozaic-ds/vue';
19
+ </script>
20
+
21
+ <MBuiltInMenu :items="[{ label: 'Label' }, { label: 'Label' }]" outlined=${outlined} />`,
22
+ },
23
+ );
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Code Connect mapping for MButton
3
+ * Links Figma Button to @mozaic-ds/vue
4
+ * Props discovered via Figma MCP get_code_connect_suggestions
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%3A609',
10
+ {
11
+ props: {
12
+ label: figma.string('Label'),
13
+ appearance: figma.enum('Appearance', {
14
+ Standard: 'standard',
15
+ Accent: 'accent',
16
+ Danger: 'danger',
17
+ 'Inverse (only on dark background)': 'inverse',
18
+ }),
19
+ size: figma.enum('Size', {
20
+ S: 's',
21
+ 'M (default)': 'm',
22
+ L: 'l',
23
+ }),
24
+ iconLeft: figma.boolean('Icon left'),
25
+ iconRight: figma.boolean('Icon right'),
26
+ iconOnly: figma.boolean('Icon only'),
27
+ disabled: figma.boolean('Is disabled'),
28
+ isLoading: figma.boolean('Is loading'),
29
+ outlined: figma.enum('Type', { Outlined: true }),
30
+ ghost: figma.enum('Type', { Ghost: true }),
31
+ },
32
+ example: ({ label, appearance, size, disabled, isLoading, outlined, ghost }) =>
33
+ html`<script setup>
34
+ import { MButton } from '@mozaic-ds/vue';
35
+ </script>
36
+
37
+ <MButton appearance=${appearance} size=${size} disabled=${disabled} :is-loading=${isLoading} outlined=${outlined} ghost=${ghost}>
38
+ ${label}
39
+ </MButton>`,
40
+ },
41
+ );
@@ -41,6 +41,7 @@ style MButton fill:#008240,stroke:#333,stroke-width:4px
41
41
 
42
42
  - [MFileUploaderItem](../fileuploaderitem)
43
43
  - [MNavigationIndicator](../navigationindicator)
44
+ - [MOptionListbox](../optionListbox)
44
45
  - [MPagination](../pagination)
45
46
  - [MPasswordInput](../passwordinput)
46
47
  - [MStepperBottomBar](../stepperbottombar)
@@ -52,6 +53,7 @@ style MButton fill:#008240,stroke:#333,stroke-width:4px
52
53
  graph TD;
53
54
  MFileUploaderItem --> MButton
54
55
  MNavigationIndicator --> MButton
56
+ MOptionListbox --> MButton
55
57
  MPagination --> MButton
56
58
  MPasswordInput --> MButton
57
59
  MStepperBottomBar --> MButton
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Code Connect mapping for MCallout
3
+ * Links Figma Callout (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-6504',
9
+ {
10
+ props: {
11
+ appearance: figma.enum('Appearance', {
12
+ Standard: 'standard',
13
+ Accent: 'accent',
14
+ Tips: 'tips',
15
+ Inverse: 'inverse',
16
+ }),
17
+ },
18
+ example: ({ appearance }) =>
19
+ html`<script setup>
20
+ import { MCallout } from '@mozaic-ds/vue';
21
+ </script>
22
+
23
+ <MCallout
24
+ title="This is a title, be concise and use the description message to give details."
25
+ description="Description message."
26
+ appearance=${appearance}
27
+ ></MCallout>`,
28
+ },
29
+ );