@mozaic-ds/vue 1.0.0-rc.3 → 2.1.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 (222) hide show
  1. package/LICENSE +51 -0
  2. package/README.md +76 -77
  3. package/dist/mozaic-vue.css +1 -1
  4. package/dist/mozaic-vue.d.ts +1664 -0
  5. package/dist/mozaic-vue.js +1943 -0
  6. package/dist/mozaic-vue.js.map +1 -0
  7. package/dist/mozaic-vue.umd.cjs +2 -0
  8. package/dist/mozaic-vue.umd.cjs.map +1 -0
  9. package/env.d.ts +1 -0
  10. package/package.json +78 -51
  11. package/src/components/Contributing.mdx +118 -0
  12. package/src/components/GettingStarted.mdx +45 -0
  13. package/src/components/Introduction.mdx +100 -0
  14. package/src/components/Support.mdx +18 -0
  15. package/src/components/breadcrumb/MBreadcrumb.spec.ts +105 -0
  16. package/src/components/breadcrumb/MBreadcrumb.stories.ts +82 -0
  17. package/src/components/breadcrumb/MBreadcrumb.vue +52 -55
  18. package/src/components/button/MButton.spec.ts +191 -0
  19. package/src/components/button/MButton.stories.ts +59 -0
  20. package/src/components/button/MButton.vue +98 -154
  21. package/src/components/checkbox/MCheckbox.spec.ts +104 -0
  22. package/src/components/checkbox/MCheckbox.stories.ts +83 -0
  23. package/src/components/checkbox/MCheckbox.vue +60 -101
  24. package/src/components/checkboxgroup/MCheckboxGroup.spec.ts +78 -0
  25. package/src/components/checkboxgroup/MCheckboxGroup.stories.ts +61 -0
  26. package/src/components/checkboxgroup/MCheckboxGroup.vue +97 -0
  27. package/src/components/datepicker/MDatepicker.spec.ts +95 -0
  28. package/src/components/datepicker/MDatepicker.stories.ts +75 -0
  29. package/src/components/datepicker/MDatepicker.vue +114 -0
  30. package/src/components/divider/MDivider.spec.ts +57 -0
  31. package/src/components/divider/MDivider.stories.ts +64 -0
  32. package/src/components/divider/MDivider.vue +56 -0
  33. package/src/components/drawer/MDrawer.spec.ts +100 -0
  34. package/src/components/drawer/MDrawer.stories.ts +128 -0
  35. package/src/components/drawer/MDrawer.vue +140 -0
  36. package/src/components/field/MField.spec.ts +166 -0
  37. package/src/components/field/MField.stories.ts +369 -0
  38. package/src/components/field/MField.vue +78 -61
  39. package/src/components/fieldgroup/MFieldGroup.spec.ts +165 -0
  40. package/src/components/fieldgroup/MFieldGroup.stories.ts +416 -0
  41. package/src/components/fieldgroup/MFieldGroup.vue +79 -0
  42. package/src/components/flag/MFlag.spec.ts +46 -0
  43. package/src/components/flag/MFlag.stories.ts +46 -0
  44. package/src/components/flag/MFlag.vue +28 -39
  45. package/src/components/iconbutton/MIconButton.spec.ts +108 -0
  46. package/src/components/iconbutton/MIconButton.stories.ts +74 -0
  47. package/src/components/iconbutton/MIconButton.vue +73 -0
  48. package/src/components/link/MLink.spec.ts +154 -0
  49. package/src/components/link/MLink.stories.ts +89 -0
  50. package/src/components/link/MLink.vue +86 -120
  51. package/src/components/loader/MLoader.spec.ts +104 -0
  52. package/src/components/loader/MLoader.stories.ts +43 -0
  53. package/src/components/loader/MLoader.vue +66 -55
  54. package/src/components/loadingoverlay/MLoadingOverlay.spec.ts +37 -0
  55. package/src/components/loadingoverlay/MLoadingOverlay.stories.ts +40 -0
  56. package/src/components/loadingoverlay/MLoadingOverlay.vue +28 -0
  57. package/src/components/modal/MModal.spec.ts +103 -0
  58. package/src/components/modal/MModal.stories.ts +127 -0
  59. package/src/components/modal/MModal.vue +111 -159
  60. package/src/components/numberbadge/MNumberBadge.spec.ts +56 -0
  61. package/src/components/numberbadge/MNumberBadge.stories.ts +48 -0
  62. package/src/components/numberbadge/MNumberBadge.vue +45 -0
  63. package/src/components/overlay/MOverlay.spec.ts +51 -0
  64. package/src/components/overlay/MOverlay.stories.ts +35 -0
  65. package/src/components/overlay/MOverlay.vue +27 -19
  66. package/src/components/pagination/MPagination.spec.ts +123 -0
  67. package/src/components/pagination/MPagination.stories.ts +83 -0
  68. package/src/components/pagination/MPagination.vue +120 -140
  69. package/src/components/passwordinput/MPasswordInput.spec.ts +104 -0
  70. package/src/components/passwordinput/MPasswordInput.stories.ts +75 -0
  71. package/src/components/passwordinput/MPasswordInput.vue +126 -77
  72. package/src/components/pincode/MPincode.spec.ts +126 -0
  73. package/src/components/pincode/MPincode.stories.ts +68 -0
  74. package/src/components/pincode/MPincode.vue +148 -0
  75. package/src/components/quantityselector/MQuantitySelector.spec.ts +262 -0
  76. package/src/components/quantityselector/MQuantitySelector.stories.ts +89 -0
  77. package/src/components/quantityselector/MQuantitySelector.vue +159 -148
  78. package/src/components/radio/MRadio.spec.ts +104 -0
  79. package/src/components/radio/MRadio.stories.ts +68 -0
  80. package/src/components/radio/MRadio.vue +56 -39
  81. package/src/components/radiogroup/MRadioGroup.spec.ts +54 -0
  82. package/src/components/radiogroup/MRadioGroup.stories.ts +61 -0
  83. package/src/components/radiogroup/MRadioGroup.vue +79 -0
  84. package/src/components/select/MSelect.spec.ts +114 -0
  85. package/src/components/select/MSelect.stories.ts +101 -0
  86. package/src/components/select/MSelect.vue +77 -119
  87. package/src/components/statusbadge/MStatusBadge.stories.ts +45 -0
  88. package/src/components/statusbadge/MStatusBadge.vue +40 -0
  89. package/src/components/statusbadge/MstatusBadge.spec.ts +16 -0
  90. package/src/components/statusdot/MStatusDot.spec.ts +51 -0
  91. package/src/components/statusdot/MStatusDot.stories.ts +48 -0
  92. package/src/components/statusdot/MStatusDot.vue +36 -0
  93. package/src/components/statusnotification/MStatusNotification.spec.ts +103 -0
  94. package/src/components/statusnotification/MStatusNotification.stories.ts +89 -0
  95. package/src/components/statusnotification/MStatusNotification.vue +106 -0
  96. package/src/components/tabs/MTabs.stories.ts +104 -0
  97. package/src/components/tabs/MTabs.vue +113 -0
  98. package/src/components/tabs/Mtabs.spec.ts +149 -0
  99. package/src/components/tag/MTag.spec.ts +107 -0
  100. package/src/components/tag/MTag.stories.ts +75 -0
  101. package/src/components/tag/MTag.vue +151 -0
  102. package/src/components/textarea/MTextArea.spec.ts +112 -0
  103. package/src/components/textarea/MTextArea.stories.ts +67 -0
  104. package/src/components/textarea/MTextArea.vue +81 -43
  105. package/src/components/textinput/MTextInput.spec.ts +121 -0
  106. package/src/components/textinput/MTextInput.stories.ts +107 -0
  107. package/src/components/textinput/MTextInput.vue +127 -47
  108. package/src/components/toggle/MToggle.spec.ts +99 -0
  109. package/src/components/toggle/MToggle.stories.ts +68 -0
  110. package/src/components/toggle/MToggle.vue +63 -103
  111. package/src/components/togglegroup/MToggleGroup.spec.ts +78 -0
  112. package/src/components/togglegroup/MToggleGroup.stories.ts +61 -0
  113. package/src/components/togglegroup/MToggleGroup.vue +97 -0
  114. package/src/components/usingIcons.mdx +35 -0
  115. package/src/components/usingPresets.mdx +128 -0
  116. package/src/main.ts +32 -0
  117. package/dist/demo.html +0 -1
  118. package/dist/mozaic-vue.adeo.css +0 -47
  119. package/dist/mozaic-vue.adeo.umd.js +0 -31341
  120. package/dist/mozaic-vue.common.js +0 -31331
  121. package/dist/mozaic-vue.common.js.map +0 -1
  122. package/dist/mozaic-vue.umd.js +0 -31342
  123. package/dist/mozaic-vue.umd.js.map +0 -1
  124. package/dist/mozaic-vue.umd.min.js +0 -4
  125. package/dist/mozaic-vue.umd.min.js.map +0 -1
  126. package/postinstall.js +0 -3
  127. package/src/components/accordion/MAccordion.vue +0 -128
  128. package/src/components/accordion/index.js +0 -7
  129. package/src/components/autocomplete/MAutocomplete.vue +0 -380
  130. package/src/components/autocomplete/index.js +0 -7
  131. package/src/components/badge/MBadge.vue +0 -43
  132. package/src/components/badge/index.js +0 -7
  133. package/src/components/breadcrumb/index.js +0 -7
  134. package/src/components/button/index.js +0 -7
  135. package/src/components/card/MCard.vue +0 -78
  136. package/src/components/card/index.js +0 -7
  137. package/src/components/checkbox/MCheckboxGroup.vue +0 -163
  138. package/src/components/checkbox/index.js +0 -12
  139. package/src/components/container/MContainer.vue +0 -33
  140. package/src/components/container/index.js +0 -7
  141. package/src/components/datatable/MDataTable.vue +0 -651
  142. package/src/components/datatable/MDataTableHeader.vue +0 -55
  143. package/src/components/datatable/MDataTableTop.vue +0 -35
  144. package/src/components/datatable/helpers.js +0 -132
  145. package/src/components/datatable/index.js +0 -12
  146. package/src/components/dropdown/MDropdown.vue +0 -317
  147. package/src/components/dropdown/index.js +0 -7
  148. package/src/components/field/index.js +0 -7
  149. package/src/components/fileuploader/MFileResult.vue +0 -149
  150. package/src/components/fileuploader/MFileUploader.vue +0 -142
  151. package/src/components/fileuploader/index.js +0 -7
  152. package/src/components/flag/index.js +0 -7
  153. package/src/components/heading/MHeading.vue +0 -75
  154. package/src/components/heading/index.js +0 -7
  155. package/src/components/hero/MHero.vue +0 -93
  156. package/src/components/hero/index.js +0 -7
  157. package/src/components/icon/MIcon.vue +0 -136
  158. package/src/components/icon/index.js +0 -7
  159. package/src/components/index.js +0 -44
  160. package/src/components/layer/MLayer.vue +0 -208
  161. package/src/components/layer/index.js +0 -7
  162. package/src/components/link/index.js +0 -7
  163. package/src/components/listbox/MListBox.vue +0 -146
  164. package/src/components/listbox/MListBoxActions.vue +0 -251
  165. package/src/components/listbox/index.js +0 -12
  166. package/src/components/loader/index.js +0 -7
  167. package/src/components/modal/index.js +0 -7
  168. package/src/components/notification/MNotification.vue +0 -110
  169. package/src/components/notification/index.js +0 -7
  170. package/src/components/optionbutton/MOptionButton.vue +0 -67
  171. package/src/components/optionbutton/index.js +0 -7
  172. package/src/components/optioncard/MOptionCard.vue +0 -132
  173. package/src/components/optioncard/index.js +0 -7
  174. package/src/components/optiongroup/MOptionGroup.vue +0 -18
  175. package/src/components/optiongroup/index.js +0 -7
  176. package/src/components/overlay/MOverlayLoader.vue +0 -43
  177. package/src/components/overlay/index.js +0 -12
  178. package/src/components/pagination/index.js +0 -7
  179. package/src/components/passwordinput/index.js +0 -7
  180. package/src/components/phonenumber/MPhoneNumber.vue +0 -398
  181. package/src/components/phonenumber/index.js +0 -7
  182. package/src/components/progressbar/MProgress.vue +0 -102
  183. package/src/components/progressbar/index.js +0 -7
  184. package/src/components/quantityselector/index.js +0 -7
  185. package/src/components/radio/MRadioGroup.vue +0 -111
  186. package/src/components/radio/index.js +0 -12
  187. package/src/components/ratingstars/MStarsInput.vue +0 -119
  188. package/src/components/ratingstars/MStarsResult.vue +0 -89
  189. package/src/components/ratingstars/index.js +0 -12
  190. package/src/components/select/index.js +0 -7
  191. package/src/components/stepper/MStepper.vue +0 -111
  192. package/src/components/stepper/index.js +0 -7
  193. package/src/components/tabs/MTab.vue +0 -204
  194. package/src/components/tabs/index.js +0 -7
  195. package/src/components/tags/MTag.vue +0 -175
  196. package/src/components/tags/index.js +0 -7
  197. package/src/components/textarea/index.js +0 -7
  198. package/src/components/textinput/MTextInputField.vue +0 -105
  199. package/src/components/textinput/MTextInputIcon.vue +0 -42
  200. package/src/components/textinput/index.js +0 -7
  201. package/src/components/toggle/index.js +0 -7
  202. package/src/components/tooltip/MTooltip.vue +0 -42
  203. package/src/components/tooltip/index.js +0 -7
  204. package/src/index.js +0 -63
  205. package/src/shims-tsx.d.ts +0 -13
  206. package/src/shims.vue.d.ts +0 -4
  207. package/src/tokens/adeo/android/colors.xml +0 -452
  208. package/src/tokens/adeo/android/font_dimens.xml +0 -18
  209. package/src/tokens/adeo/css/_variables.scss +0 -446
  210. package/src/tokens/adeo/css/root.scss +0 -448
  211. package/src/tokens/adeo/ios/StyleDictionaryColor.h +0 -460
  212. package/src/tokens/adeo/ios/StyleDictionaryColor.m +0 -472
  213. package/src/tokens/adeo/ios/StyleDictionaryColor.swift +0 -455
  214. package/src/tokens/adeo/ios/StyleDictionarySize.h +0 -69
  215. package/src/tokens/adeo/ios/StyleDictionarySize.m +0 -70
  216. package/src/tokens/adeo/ios/StyleDictionarySize.swift +0 -71
  217. package/src/tokens/adeo/js/tokens.js +0 -544
  218. package/src/tokens/adeo/js/tokensObject.js +0 -11733
  219. package/src/tokens/adeo/scss/_tokens.scss +0 -1522
  220. package/src/utils/mozaicClasses.js +0 -16
  221. package/src/utils/theme.validator.js +0 -19
  222. package/types/index.d.ts +0 -104
@@ -0,0 +1,118 @@
1
+ import { Meta } from '@storybook/addon-docs/blocks';
2
+ import { Mermaid } from 'mdx-mermaid/Mermaid';
3
+
4
+ <Meta title="Contributing" />
5
+
6
+ # Be part of something bigger!
7
+
8
+ **Mozaic-Vue** is made possible by an incredible community that finds issues and creates pull requests.<br/>
9
+ It is our job to enable you to create amazing applications.
10
+
11
+ Most of the time, you find something that can be made better. You could find a bug, or you have an idea for additional functionality.<br/>
12
+ That's great! It's as easy as cloning the [Mozaic-Vue repository](https://github.com/adeo/mozaic-vue) to get started working in the development environment.
13
+
14
+ Hopefully this document makes the process for contributing clear and answers some questions that you may have.<br/>
15
+ If you have any questions, please reach out to us on our [slack channel](https://adeo-tech-community.slack.com/archives/CN4K3A99R).
16
+
17
+ ## Contribution model
18
+
19
+ The contribution process can be summarized as follows:
20
+
21
+ <Mermaid
22
+ chart={`flowchart TD;
23
+ A((I have a need <br/>fix or new feature));
24
+ A --> B{An issue already exists?};
25
+ B --> |YES| I;
26
+ I([The issue corresponds to my needs <br/>or I complete it]);
27
+ I --> D;
28
+ B --> |NO| C;
29
+ C([I create an issue <br/>]);
30
+ C --> D;
31
+ D{I can contribute?};
32
+ D --> |YES| E;
33
+ D --> |NO| J;
34
+ E([I clone the repo <br/>& create a PR associated to the issue]);
35
+ E --> F;
36
+ F([The PR is ready <br/>and I assign it to reviewers]);
37
+ F --> G;
38
+ G{The proofreading is OK <br/>and the PR is validated?};
39
+ G --> |YES| H;
40
+ G --> |NO| K;
41
+ H([The PR is merged and will be released soon]);
42
+ H;
43
+ J([In this case, I wait for the issue <br/>to be traited and delivered.]);
44
+ K([I make the requested changes]);
45
+ K --> F;
46
+ click B "https://github.com/adeo/mozaic-vue/issues" _blank;
47
+ click C "https://github.com/adeo/mozaic-vue/issues/new/choose" _blank;
48
+ `}
49
+ />
50
+
51
+ You can now discover the details of each of these steps below.
52
+
53
+ ## Reporting issues
54
+
55
+ ### Where to find known issues
56
+
57
+ We are using [GitHub Issues](https://github.com/adeo/mozaic-vue/issues) for our bugs.<br/>
58
+ We keep a close eye on this and try to make it clear when we have an internal fix in progress.<br/>
59
+
60
+ **Before filing a new task, try to make sure your problem doesn't already exist.**
61
+
62
+ ### Reporting new issue
63
+
64
+ The best way to get your bug fixed is to provide a reduced test case.
65
+
66
+ Once you've gathered all information, please fill out an issue [here](https://github.com/adeo/mozaic-vue/issues/new/choose).
67
+
68
+ ## Proposing a change
69
+
70
+ If you intend to add a new component, or make any non-trivial changes, we recommend filing an issue.
71
+
72
+ This will lets us prepare an agreement on your proposal before you put significant effort into it.
73
+
74
+ If you’re only fixing a bug, it should be fine to submit a pull request but we still recommend to submit an issue detailing what you’re looking to fix.
75
+
76
+ ## Setup Dev Environment
77
+
78
+ ### Project setup
79
+
80
+ ```bash
81
+ // Clone mozaic-vue repo
82
+ git clone git@github.com:adeo/mozaic-vue.git
83
+
84
+ // Go to the cloned directory
85
+ cd mozaic-vue
86
+
87
+ // Checkout the branch you are working on
88
+ git checkout <branch name>
89
+
90
+ // Install dependencies
91
+ npm install
92
+ ```
93
+
94
+ ## Submitting Changes/ Pull Requests
95
+
96
+ Working on your first Pull Request? You can learn how from this video series:
97
+ [How to contribute to an open source project on Github](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github).
98
+
99
+ Mozaic's team is keeping an eye on pull requests. We will check your pull request, either merge it, request changes or close it with explanation.
100
+
101
+ Before submitting please make sure to run:
102
+
103
+ ```
104
+ // Pull down the latest
105
+ $ git pull origin master
106
+
107
+ // Create your working branch
108
+ $ git branch - b type-id-description
109
+
110
+ // Resolve bugs or implement new pattern
111
+ // Add Tests and documentation
112
+
113
+ // Run linter
114
+ $ npm run lint
115
+
116
+ // Run formatter
117
+ $ npm run format
118
+ ```
@@ -0,0 +1,45 @@
1
+ import { Meta, Source } from '@storybook/addon-docs/blocks';
2
+
3
+ <Meta title="Getting Started" />
4
+
5
+ # Getting Started
6
+
7
+ **Mozaic-Vue** is the [Vue.js](https://vuejs.org/) implementation of ADEO Design system.
8
+
9
+ ## 📦 Installation
10
+
11
+ In order to use **Mozaic-Vue** in your **Vue.js** project, you must first install the [npm package](https://www.npmjs.com/package/@mozaic-ds/vue):
12
+
13
+ <Source language="bash" dark code="npm i @mozaic-ds/vue" />
14
+
15
+ Or with **Yarn**:
16
+
17
+ <Source language="bash" dark code="yarn add @mozaic-ds/vue" />
18
+
19
+ ## 📝 Usage
20
+
21
+ Import the styles
22
+
23
+ <Source
24
+ language='typescript'
25
+ dark
26
+ code={`
27
+ // main.ts
28
+
29
+ import '@mozaic-ds/vue/style.css';
30
+ `} />
31
+
32
+ To import and use a component, you can proceed as follows:
33
+
34
+ <Source
35
+ language='html'
36
+ dark
37
+ code={`
38
+ <script setup>
39
+ import { MButton } from '@mozaic-ds/vue';
40
+ </script>
41
+
42
+ <template>
43
+ <MButton>Button Label</MButton>
44
+ </template>
45
+ `} />
@@ -0,0 +1,100 @@
1
+ import { Meta, Source } from '@storybook/addon-docs/blocks';
2
+ import ads from '../../.storybook/assets/logo.svg';
3
+ import vue from '../../.storybook/assets/vue.svg';
4
+
5
+ <Meta title="Introduction" />
6
+
7
+ <p
8
+ style={{
9
+ display: 'flex',
10
+ alignItems: 'center',
11
+ justifyContent: 'center',
12
+ gap: '1rem',
13
+ }}
14
+ >
15
+ <img src={ads} alt="ADEO Design system logo" style={{ height: '80px' }} />
16
+ <span style={{ fontSize: '32px' }}>x</span>
17
+ <img src={vue} alt="Vue.js logo" style={{ height: '80px' }} />
18
+ </p>
19
+
20
+ <h1 align="center">ADEO Design system - Vue.js library</h1>
21
+
22
+ <p align="center">
23
+ A library of **Vue.js** components implementing **ADEO Design system**
24
+ guidelines.
25
+ </p>
26
+
27
+ <div
28
+ style={{
29
+ display: 'flex',
30
+ alignItems: 'center',
31
+ justifyContent: 'center',
32
+ gap: '0.5rem',
33
+ }}
34
+ >
35
+ <a href="https://www.npmjs.com/package/@mozaic-ds/vue">
36
+ <img
37
+ src="https://img.shields.io/npm/v/@mozaic-ds/vue?label=NPM&logo=npm&color=yellow"
38
+ alt="npm version"
39
+ />
40
+ </a>
41
+ <a href="https://github.com/adeo/mozaic-vue/blob/master/CONTRIBUTING.md">
42
+ <img
43
+ src="https://img.shields.io/badge/PRs-welcome-blue.svg?logo=github"
44
+ alt="PRs welcome"
45
+ />
46
+ </a>
47
+ <a href="https://app.slack.com/client/T4R6RCZFA/CN4K3A99R">
48
+ <img
49
+ src="https://img.shields.io/badge/Slack-mozaic_vue-611f69.svg?logo=slack"
50
+ alt="Slack mozaic-vue"
51
+ />
52
+ </a>
53
+ <a href="https://keys.adeo.com/keys/ls/space/2583429798460717/adeo-adeo-design-system">
54
+ <img
55
+ src="https://img.shields.io/badge/KEYS-Adeo_Design_System-4526ce.svg"
56
+ alt="KEYS ADEO Design system"
57
+ />
58
+ </a>
59
+ </div>
60
+
61
+ <br />
62
+ <br />
63
+
64
+ ## 🪄 Introduction
65
+
66
+ ADEO Design system is a global and collaborative design system
67
+ that facilitates the designer and developer experience,
68
+ enabling them to create universal interfaces
69
+ perfectly aligned with the business strategy of Adeo.
70
+
71
+ ## 🎨 Getting Started
72
+
73
+ Ready to begin using Mozaic in your project?\
74
+ Our Getting Started guide will walk you through the basics, \
75
+ from setting up the system to implementing core components in your application.
76
+
77
+ Whether you're new to Mozaic or just need a refresher, \
78
+ this guide has everything you need to hit the ground running.
79
+
80
+ Read how to **[Setup your application](/docs/getting-started--docs)**!
81
+
82
+ ## 🤝 Contributing
83
+
84
+ Be part of something bigger!
85
+
86
+ **Mozaic-Vue** is made possible by an incredible community that finds issues and creates pull requests.\
87
+ It is our job to enable you to create amazing applications.
88
+
89
+ To do so, see our **[contributing process](/docs/contributing--docs)**.
90
+
91
+ ## ℹ️ Support
92
+
93
+ If you have any questions or need assistance,\
94
+ we are here to help.
95
+
96
+ Whether you're troubleshooting, looking for documentation,\
97
+ or need to get in touch with our team,\
98
+ you'll find all the resources you need to get the most out of **Mozaic-Vue**.
99
+
100
+ Visit our **[Support page](/docs/support--docs)** for more information.
@@ -0,0 +1,18 @@
1
+ import { Meta } from '@storybook/addon-docs/blocks';
2
+
3
+ <Meta title="Support" />
4
+
5
+ # Support
6
+
7
+ Need help?
8
+
9
+ Any feedback, ideas or questions?
10
+
11
+ The **Mozaic Design System team** would welcome any feedback, ideas, or requirements that you have.<br/>
12
+ Our goal is to make your lives easier.
13
+
14
+ If you want to get more detailed information on the components or any other topic related to **Mozaic-Vue**, you can contact us through the channels below:
15
+
16
+ - Join the [#mozaic-vue](https://app.slack.com/client/T4R6RCZFA/CN4K3A99R/) channel on **Slack**
17
+ - Join the [#mozaic-support](https://app.slack.com/client/T4R6RCZFA/CKQJZL7C4/) channel on **Slack**
18
+ - Follow our [KEYS page](https://keys.adeo.com/keys/ls/space/2583429798460717/adeo-adeo-design-system)
@@ -0,0 +1,105 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { mount } from '@vue/test-utils';
3
+ import MBreadcrumb from './MBreadcrumb.vue';
4
+
5
+ const MLinkStub = {
6
+ template: '<a><slot /></a>',
7
+ props: ['href', 'appearance', 'inline', 'router', 'class', 'ariaCurrent'],
8
+ };
9
+
10
+ describe('MBreadcrumb', () => {
11
+ const defaultLinks = [
12
+ { label: 'Home', href: '/' },
13
+ { label: 'Products', href: '/products' },
14
+ { label: 'Electronics', href: '/products/electronics' },
15
+ ];
16
+
17
+ it('renders all breadcrumb links', () => {
18
+ const wrapper = mount(MBreadcrumb, {
19
+ props: {
20
+ links: defaultLinks,
21
+ },
22
+ global: {
23
+ components: { MLink: MLinkStub },
24
+ },
25
+ });
26
+
27
+ const items = wrapper.findAll('.mc-breadcrumb__item');
28
+ expect(items).toHaveLength(defaultLinks.length);
29
+ defaultLinks.forEach((link, index) => {
30
+ expect(items[index].text()).toContain(link.label);
31
+ });
32
+ });
33
+
34
+ it('adds mc-breadcrumb__current class to the last link', () => {
35
+ const wrapper = mount(MBreadcrumb, {
36
+ props: {
37
+ links: defaultLinks,
38
+ },
39
+ global: {
40
+ components: { MLink: MLinkStub },
41
+ },
42
+ });
43
+
44
+ const lastLink = wrapper.findAllComponents(MLinkStub).at(-1);
45
+ expect(lastLink?.classes()).toContain('mc-breadcrumb__current');
46
+ });
47
+
48
+ it('sets aria-current="page" on the last link', () => {
49
+ const wrapper = mount(MBreadcrumb, {
50
+ props: {
51
+ links: defaultLinks,
52
+ },
53
+ global: {
54
+ components: { MLink: MLinkStub },
55
+ },
56
+ });
57
+
58
+ const lastLink = wrapper.findAllComponents(MLinkStub).at(-1);
59
+ expect(lastLink?.attributes('aria-current')).toBe('page');
60
+ });
61
+
62
+ it('does not set aria-current on non-last links', () => {
63
+ const wrapper = mount(MBreadcrumb, {
64
+ props: {
65
+ links: defaultLinks,
66
+ },
67
+ global: {
68
+ components: { MLink: MLinkStub },
69
+ },
70
+ });
71
+
72
+ const linkComponents = wrapper.findAllComponents(MLinkStub);
73
+ for (let i = 0; i < linkComponents.length - 1; i++) {
74
+ expect(linkComponents[i].attributes('aria-current')).toBeUndefined();
75
+ }
76
+ });
77
+
78
+ it('applies appearance class modifier when not standard', () => {
79
+ const wrapper = mount(MBreadcrumb, {
80
+ props: {
81
+ appearance: 'inverse',
82
+ links: defaultLinks,
83
+ },
84
+ global: {
85
+ components: { MLink: MLinkStub },
86
+ },
87
+ });
88
+
89
+ expect(wrapper.classes()).toContain('mc-breadcrumb--inverse');
90
+ });
91
+
92
+ it('does not apply appearance modifier for standard (default)', () => {
93
+ const wrapper = mount(MBreadcrumb, {
94
+ props: {
95
+ appearance: 'standard',
96
+ links: defaultLinks,
97
+ },
98
+ global: {
99
+ components: { MLink: MLinkStub },
100
+ },
101
+ });
102
+
103
+ expect(wrapper.classes()).not.toContain('mc-breadcrumb--standard');
104
+ });
105
+ });
@@ -0,0 +1,82 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import MBreadcrumb from './MBreadcrumb.vue';
3
+
4
+ const meta: Meta<typeof MBreadcrumb> = {
5
+ title: 'Navigation/Breadcrumb',
6
+ component: MBreadcrumb,
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component:
11
+ 'A breadcrumb is a navigation help that displays the hierarchical path of the current page within a website or application. It helps users understand their location and allows them to navigate back to previous levels easily. Breadcrumbs improve usability and accessibility, especially in multi-level websites, dashboards, and e-commerce platforms.',
12
+ },
13
+ },
14
+ },
15
+ args: {
16
+ links: [
17
+ {
18
+ label: 'Home',
19
+ href: '#',
20
+ router: true,
21
+ },
22
+ {
23
+ label: 'level 01',
24
+ href: '#',
25
+ router: true,
26
+ },
27
+ {
28
+ label: 'level 02',
29
+ href: '#',
30
+ router: true,
31
+ },
32
+ {
33
+ label: 'Current Page',
34
+ href: '#',
35
+ router: true,
36
+ },
37
+ ],
38
+ },
39
+ render: (args) => ({
40
+ components: { MBreadcrumb },
41
+ setup() {
42
+ return { args };
43
+ },
44
+ template: `
45
+ <MBreadcrumb v-bind="args"></MBreadcrumb>
46
+ `,
47
+ }),
48
+ };
49
+ export default meta;
50
+ type Story = StoryObj<typeof MBreadcrumb>;
51
+
52
+ export const Default: Story = {};
53
+
54
+ export const Inverse: Story = {
55
+ globals: {
56
+ backgrounds: { value: 'inverse' },
57
+ },
58
+ args: { appearance: 'inverse' },
59
+ };
60
+
61
+ export const WithoutRouter: Story = {
62
+ args: {
63
+ links: [
64
+ {
65
+ label: 'Home',
66
+ href: '#',
67
+ },
68
+ {
69
+ label: 'level 01',
70
+ href: '#',
71
+ },
72
+ {
73
+ label: 'level 02',
74
+ href: '#',
75
+ },
76
+ {
77
+ label: 'Current Page',
78
+ href: '#',
79
+ },
80
+ ],
81
+ },
82
+ };
@@ -1,73 +1,70 @@
1
1
  <template>
2
- <nav
3
- class="mc-breadcrumb"
4
- :class="{
5
- 'mc-breadcrumb--dark': dark,
6
- 'mc-breadcrumb--responsive': responsive,
7
- }"
8
- aria-label="Breadcrumb"
9
- >
2
+ <nav class="mc-breadcrumb" :class="classObject" aria-label="Breadcrumb">
10
3
  <ul class="mc-breadcrumb__container">
11
4
  <li
12
- v-for="(item, index) in items"
13
- :key="`breadcrumb-${index}`"
14
5
  class="mc-breadcrumb__item"
15
- :class="{ 'is-active': item.isActive }"
6
+ v-for="(link, index) in links"
7
+ :key="`breadcrumb-${index}`"
16
8
  >
17
- <m-link
18
- :href="item.href"
19
- :class="[
20
- setLinkClasses,
21
- { 'mc-breadcrumb__current': index === items.length - 1 },
22
- ]"
23
- :aria-current="index != items.length - 1 ? null : 'page'"
24
- size="s"
25
- :router="item.router"
26
- @click="$emit('link-clicked', item)"
9
+ <MLink
10
+ :href="link.href"
11
+ :router="link.router"
12
+ :appearance="appearance"
13
+ inline
14
+ :class="{
15
+ 'mc-breadcrumb__current': isLastLink(index),
16
+ }"
17
+ :aria-current="isLastLink(index) ? 'page' : undefined"
27
18
  >
28
- {{ item.text }}
29
- </m-link>
19
+ {{ link.label }}
20
+ </MLink>
30
21
  </li>
31
22
  </ul>
32
23
  </nav>
33
24
  </template>
34
25
 
35
- <script>
26
+ <script setup lang="ts">
27
+ import { computed } from 'vue';
36
28
  import MLink from '../link/MLink.vue';
29
+ /**
30
+ * A breadcrumb is a navigation help that displays the hierarchical path of the current page within a website or application. It helps users understand their location and allows them to navigate back to previous levels easily. Breadcrumbs improve usability and accessibility, especially in multi-level websites, dashboards, and e-commerce platforms.
31
+ */
32
+ const props = defineProps<{
33
+ /**
34
+ * Allows to define the breadcrumb style
35
+ */
36
+ appearance?: 'standard' | 'inverse';
37
+ /**
38
+ * Links of the breadcrumb
39
+ */
40
+ links: Array<{
41
+ /**
42
+ * The label displayed for the link.
43
+ */
44
+ label: string;
45
+ /**
46
+ * URL for the link (for external links or the `to` prop for `router-link`).
47
+ */
48
+ href: string;
49
+ /**
50
+ * If `true`, the link will be rendered as a `router-link` for internal navigation (Vue Router).
51
+ */
52
+ router?: boolean;
53
+ }>;
54
+ }>();
37
55
 
38
- export default {
39
- name: 'MBreadcrumb',
40
-
41
- components: {
42
- MLink,
43
- },
44
-
45
- props: {
46
- items: {
47
- type: Array,
48
- required: true,
49
- },
50
- dark: {
51
- type: Boolean,
52
- default: false,
53
- },
54
- responsive: {
55
- type: Boolean,
56
- default: false,
57
- },
58
- },
56
+ const classObject = computed(() => {
57
+ return {
58
+ [`mc-breadcrumb--${props.appearance}`]:
59
+ props.appearance && props.appearance != 'standard',
60
+ };
61
+ });
59
62
 
60
- computed: {
61
- setLinkClasses() {
62
- return {
63
- 'mc-link--light': this.dark,
64
- };
65
- },
66
- },
63
+ const isLastLink = (index: number) => {
64
+ return index === (props.links?.length ?? 0) - 1;
67
65
  };
68
66
  </script>
69
67
 
70
- <style lang="scss">
71
- @import 'settings-tools/_all-settings';
72
- @import 'components/_c.breadcrumb';
68
+ <style lang="scss" scoped>
69
+ @use '@mozaic-ds/styles/components/breadcrumb';
73
70
  </style>