@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.
- package/dist/mozaic-vue.css +2 -1
- package/dist/mozaic-vue.d.ts +258 -137
- package/dist/mozaic-vue.js +14054 -10878
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +7 -25
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +22 -11
- package/src/components/BrandPresets.mdx +2 -2
- package/src/components/Migration.mdx +651 -0
- package/src/components/accordionlist/MAccordionList.figma.ts +43 -0
- package/src/components/accordionlistitem/MAccordionListItem.figma.ts +27 -0
- package/src/components/accordionlistitem/MAccordionListItem.spec.ts +22 -3
- package/src/components/accordionlistitem/MAccordionListItem.vue +38 -28
- package/src/components/actionbottombar/MActionBottomBar.figma.ts +24 -0
- package/src/components/actionlistbox/MActionListbox.figma.ts +30 -0
- package/src/components/avatar/MAvatar.figma.ts +31 -0
- package/src/components/breadcrumb/MBreadcrumb.figma.ts +31 -0
- package/src/components/builtinmenu/MBuiltInMenu.figma.ts +23 -0
- package/src/components/builtinmenu/MBuiltInMenu.spec.ts +30 -1
- package/src/components/builtinmenu/MBuiltInMenu.vue +26 -17
- package/src/components/builtinmenu/README.md +2 -0
- package/src/components/button/MButton.figma.ts +41 -0
- package/src/components/callout/MCallout.figma.ts +29 -0
- package/src/components/callout/MCallout.spec.ts +35 -0
- package/src/components/callout/MCallout.vue +22 -4
- package/src/components/callout/README.md +2 -0
- package/src/components/carousel/MCarousel.figma.ts +32 -0
- package/src/components/checkbox/MCheckbox.figma.ts +45 -0
- package/src/components/checkboxgroup/MCheckboxGroup.figma.ts +30 -0
- package/src/components/checklistmenu/MCheckListMenu.figma.ts +29 -0
- package/src/components/checklistmenu/MCheckListMenu.spec.ts +12 -1
- package/src/components/checklistmenu/MCheckListMenu.vue +6 -0
- package/src/components/checklistmenu/README.md +2 -0
- package/src/components/circularprogressbar/MCircularProgressbar.figma.ts +31 -0
- package/src/components/combobox/MCombobox.figma.ts +48 -0
- package/src/components/combobox/MCombobox.spec.ts +1 -1
- package/src/components/combobox/MCombobox.vue +18 -9
- package/src/components/combobox/README.md +2 -2
- package/src/components/container/MContainer.figma.ts +30 -0
- package/src/components/datatable/DataTable.stories.ts +277 -0
- package/src/components/datatable/DataTableCells.stories.ts +251 -0
- package/src/components/datatable/DataTableEmpty.stories.ts +102 -0
- package/src/components/datatable/DataTableExpandable.stories.ts +95 -0
- package/src/components/datatable/DataTableNested.stories.ts +96 -0
- package/src/components/datatable/DataTableSelectable.stories.ts +124 -0
- package/src/components/datatable/DataTableSortable.stories.ts +164 -0
- package/src/components/datatable/MDataTable.types.ts +54 -0
- package/src/components/datatable/assets/styles.scss +10 -0
- package/src/components/datatable/datatable.mdx +63 -0
- package/src/components/datatable/tools/data.js +8 -0
- package/src/components/datatable/tools/data.json +2018 -0
- package/src/components/datatable/utils.js +19 -0
- package/src/components/datepicker/MDatepicker.figma.ts +20 -0
- package/src/components/divider/MDivider.figma.ts +30 -0
- package/src/components/drawer/MDrawer.figma.ts +37 -0
- package/src/components/drawer/README.md +1 -1
- package/src/components/field/MField.figma.ts +30 -0
- package/src/components/fileuploader/MFileUploader.figma.ts +23 -0
- package/src/components/fileuploaderitem/MFileUploaderItem.figma.ts +27 -0
- package/src/components/flag/MFlag.figma.ts +26 -0
- package/src/components/iconbutton/MIconButton.figma.ts +54 -0
- package/src/components/kpiitem/MKpiItem.figma.ts +33 -0
- package/src/components/linearprogressbarbuffer/MLinearProgressbarBuffer.figma.ts +31 -0
- package/src/components/linearprogressbarpercentage/MLinearProgressbarPercentage.figma.ts +26 -0
- package/src/components/link/MLink.figma.ts +32 -0
- package/src/components/loader/MLoader.figma.ts +30 -0
- package/src/components/loadingoverlay/MLoadingOverlay.figma.ts +18 -0
- package/src/components/modal/MModal.figma.ts +27 -0
- package/src/components/navigationindicator/MNavigationIndicator.figma.ts +24 -0
- package/src/components/navigationindicator/MNavigationIndicator.spec.ts +75 -18
- package/src/components/navigationindicator/MNavigationIndicator.vue +10 -12
- package/src/components/numberbadge/MNumberBadge.figma.ts +31 -0
- package/src/components/optionListbox/MOptionListbox.figma.ts +36 -0
- package/src/components/optionListbox/MOptionListbox.vue +34 -19
- package/src/components/optionListbox/README.md +1 -1
- package/src/components/overlay/MOverlay.figma.ts +20 -0
- package/src/components/pageheader/MPageHeader.figma.ts +21 -0
- package/src/components/pagination/MPagination.figma.ts +34 -0
- package/src/components/passwordinput/MPasswordInput.figma.ts +30 -0
- package/src/components/phonenumber/MPhoneNumber.figma.ts +47 -0
- package/src/components/pincode/MPincode.figma.ts +41 -0
- package/src/components/pincode/MPincode.spec.ts +1 -4
- package/src/components/pincode/MPincode.vue +11 -15
- package/src/components/popover/MPopover.figma.ts +42 -0
- package/src/components/popover/MPopover.spec.ts +126 -0
- package/src/components/popover/MPopover.vue +36 -1
- package/src/components/quantityselector/MQuantitySelector.figma.ts +50 -0
- package/src/components/radio/MRadio.figma.ts +40 -0
- package/src/components/radiogroup/MRadioGroup.figma.ts +30 -0
- package/src/components/segmentedcontrol/MSegmentedControl.figma.ts +33 -0
- package/src/components/segmentedcontrol/MSegmentedControl.spec.ts +92 -0
- package/src/components/segmentedcontrol/MSegmentedControl.vue +61 -2
- package/src/components/select/MSelect.figma.ts +49 -0
- package/src/components/sidebar/MSidebar.figma.ts +28 -0
- package/src/components/sidebarexpandableitem/MSidebarExpandableItem.figma.ts +19 -0
- package/src/components/sidebarfooter/MSidebarFooter.figma.ts +21 -0
- package/src/components/sidebarheader/MSidebarHeader.figma.ts +18 -0
- package/src/components/sidebarnavitem/MSidebarNavItem.figma.ts +23 -0
- package/src/components/sidebarshortcutitem/MSidebarShortcutItem.figma.ts +20 -0
- package/src/components/starrating/MStarRating.figma.ts +35 -0
- package/src/components/starrating/MStarRating.spec.ts +19 -22
- package/src/components/starrating/MStarRating.vue +3 -2
- package/src/components/statusbadge/MStatusBadge.figma.ts +27 -0
- package/src/components/statusdot/MStatusDot.figma.ts +31 -0
- package/src/components/statusmessage/MStatusMessage.figma.ts +28 -0
- package/src/components/statusmessage/MStatusMessage.spec.ts +15 -0
- package/src/components/statusmessage/MStatusMessage.stories.ts +4 -0
- package/src/components/statusmessage/MStatusMessage.vue +7 -0
- package/src/components/statusmessage/README.md +2 -0
- package/src/components/statusnotification/MStatusNotification.figma.ts +29 -0
- package/src/components/stepperbottombar/MStepperBottomBar.figma.ts +20 -0
- package/src/components/steppercompact/MStepperCompact.figma.ts +21 -0
- package/src/components/stepperinline/MStepperInline.figma.ts +23 -0
- package/src/components/stepperstacked/MStepperStacked.figma.ts +23 -0
- package/src/components/tabs/MTabs.figma.ts +33 -0
- package/src/components/tabs/MTabs.vue +90 -4
- package/src/components/tabs/Mtabs.spec.ts +162 -0
- package/src/components/tag/MTag.figma.ts +26 -0
- package/src/components/tag/MTag.stories.ts +13 -3
- package/src/components/tag/MTag.vue +11 -1
- package/src/components/tag/README.md +6 -0
- package/src/components/textarea/MTextArea.figma.ts +28 -0
- package/src/components/textinput/MTextInput.figma.ts +51 -0
- package/src/components/tile/MTile.figma.ts +31 -0
- package/src/components/tileclickable/MTileClickable.figma.ts +31 -0
- package/src/components/tileexpandable/MTileExpandable.figma.ts +31 -0
- package/src/components/tileselectable/MTileSelectable.figma.ts +29 -0
- package/src/components/toaster/MToaster.figma.ts +25 -0
- package/src/components/toggle/MToggle.figma.ts +39 -0
- package/src/components/togglegroup/MToggleGroup.figma.ts +30 -0
- package/src/components/tooltip/MTooltip.figma.ts +29 -0
- package/src/main.ts +1 -0
|
@@ -161,6 +161,168 @@ describe('MTabs.vue', () => {
|
|
|
161
161
|
expect(wrapper.emitted('update:modelValue')!.length).toBe(1);
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
+
it('selected tab has tabindex="0", others have tabindex="-1"', () => {
|
|
165
|
+
const wrapper = mount(MTabs, {
|
|
166
|
+
props: { tabs, modelValue: '2' },
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
170
|
+
expect(buttons[0].attributes('tabindex')).toBe('-1');
|
|
171
|
+
expect(buttons[1].attributes('tabindex')).toBe('0');
|
|
172
|
+
expect(buttons[2].attributes('tabindex')).toBe('-1');
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('falls back to first enabled tab for tabindex when selected tab is disabled', () => {
|
|
176
|
+
const wrapper = mount(MTabs, {
|
|
177
|
+
props: {
|
|
178
|
+
tabs: [
|
|
179
|
+
{ id: '1', label: 'Tab 1', disabled: true },
|
|
180
|
+
{ id: '2', label: 'Tab 2' },
|
|
181
|
+
{ id: '3', label: 'Tab 3' },
|
|
182
|
+
],
|
|
183
|
+
modelValue: '1',
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
188
|
+
expect(buttons[0].attributes('tabindex')).toBe('-1');
|
|
189
|
+
expect(buttons[1].attributes('tabindex')).toBe('0');
|
|
190
|
+
expect(buttons[2].attributes('tabindex')).toBe('-1');
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('falls back to first enabled tab for tabindex when modelValue is invalid', () => {
|
|
194
|
+
const wrapper = mount(MTabs, {
|
|
195
|
+
props: {
|
|
196
|
+
tabs,
|
|
197
|
+
modelValue: 'unknown-id',
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
202
|
+
expect(buttons[0].attributes('tabindex')).toBe('0');
|
|
203
|
+
expect(buttons[1].attributes('tabindex')).toBe('-1');
|
|
204
|
+
expect(buttons[2].attributes('tabindex')).toBe('-1');
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('sets disabled and aria-disabled attributes on disabled tabs', () => {
|
|
208
|
+
const wrapper = mount(MTabs, {
|
|
209
|
+
props: {
|
|
210
|
+
tabs: [
|
|
211
|
+
{ id: '1', label: 'Tab 1' },
|
|
212
|
+
{ id: '2', label: 'Tab 2', disabled: true },
|
|
213
|
+
],
|
|
214
|
+
modelValue: '1',
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
219
|
+
expect(buttons[0].attributes('aria-disabled')).toBeUndefined();
|
|
220
|
+
expect(buttons[1].attributes('aria-disabled')).toBe('true');
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('ArrowRight moves selection to the next tab', async () => {
|
|
224
|
+
const wrapper = mount(MTabs, {
|
|
225
|
+
props: { tabs, modelValue: '1' },
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
229
|
+
await buttons[0].trigger('keydown', { key: 'ArrowRight' });
|
|
230
|
+
|
|
231
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['2']);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('ArrowLeft moves selection to the previous tab', async () => {
|
|
235
|
+
const wrapper = mount(MTabs, {
|
|
236
|
+
props: { tabs, modelValue: '2' },
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
240
|
+
await buttons[1].trigger('keydown', { key: 'ArrowLeft' });
|
|
241
|
+
|
|
242
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['1']);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('ArrowRight wraps from last to first tab', async () => {
|
|
246
|
+
const wrapper = mount(MTabs, {
|
|
247
|
+
props: { tabs, modelValue: '3' },
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
251
|
+
await buttons[2].trigger('keydown', { key: 'ArrowRight' });
|
|
252
|
+
|
|
253
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['1']);
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('Home moves selection to the first tab', async () => {
|
|
257
|
+
const wrapper = mount(MTabs, {
|
|
258
|
+
props: { tabs, modelValue: '3' },
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
262
|
+
await buttons[2].trigger('keydown', { key: 'Home' });
|
|
263
|
+
|
|
264
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['1']);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('End moves selection to the last tab', async () => {
|
|
268
|
+
const wrapper = mount(MTabs, {
|
|
269
|
+
props: { tabs, modelValue: '1' },
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
273
|
+
await buttons[0].trigger('keydown', { key: 'End' });
|
|
274
|
+
|
|
275
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['3']);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
it('does not react to ArrowUp and ArrowDown keys', async () => {
|
|
279
|
+
const wrapper = mount(MTabs, {
|
|
280
|
+
props: { tabs, modelValue: '1' },
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
284
|
+
await buttons[0].trigger('keydown', { key: 'ArrowDown' });
|
|
285
|
+
await buttons[0].trigger('keydown', { key: 'ArrowUp' });
|
|
286
|
+
|
|
287
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it('ArrowRight skips disabled tabs', async () => {
|
|
291
|
+
const wrapper = mount(MTabs, {
|
|
292
|
+
props: {
|
|
293
|
+
tabs: [
|
|
294
|
+
{ id: '1', label: 'Tab 1' },
|
|
295
|
+
{ id: '2', label: 'Tab 2', disabled: true },
|
|
296
|
+
{ id: '3', label: 'Tab 3' },
|
|
297
|
+
],
|
|
298
|
+
modelValue: '1',
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
303
|
+
await buttons[0].trigger('keydown', { key: 'ArrowRight' });
|
|
304
|
+
|
|
305
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['3']);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
it('does not emit on keydown when all tabs are disabled', async () => {
|
|
309
|
+
const wrapper = mount(MTabs, {
|
|
310
|
+
props: {
|
|
311
|
+
tabs: [
|
|
312
|
+
{ id: '1', label: 'Tab 1', disabled: true },
|
|
313
|
+
{ id: '2', label: 'Tab 2', disabled: true },
|
|
314
|
+
],
|
|
315
|
+
modelValue: '1',
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
320
|
+
await buttons[0].trigger('keydown', { key: 'ArrowRight' });
|
|
321
|
+
await buttons[0].trigger('keydown', { key: 'Home' });
|
|
322
|
+
|
|
323
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
324
|
+
});
|
|
325
|
+
|
|
164
326
|
it('renders icon component when icon prop is provided', () => {
|
|
165
327
|
const DummyIcon = markRaw(
|
|
166
328
|
defineComponent({
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MTag
|
|
3
|
+
* Links Figma Tag 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=5730-15694',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
type: figma.enum('Type', {
|
|
12
|
+
'Informative (Read-only)': 'informative',
|
|
13
|
+
'Interactive (as link or button)': 'interactive',
|
|
14
|
+
Contextualised: 'contextualised',
|
|
15
|
+
Removable: 'removable',
|
|
16
|
+
Selectable: 'selectable',
|
|
17
|
+
}),
|
|
18
|
+
},
|
|
19
|
+
example: ({ type }) =>
|
|
20
|
+
html`<script setup>
|
|
21
|
+
import { MTag } from '@mozaic-ds/vue';
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<MTag type=${type} label="Tag label"></MTag>`,
|
|
25
|
+
},
|
|
26
|
+
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
2
|
import { action } from 'storybook/actions';
|
|
3
|
+
import { FeelingSatisfied20 } from '@mozaic-ds/icons-vue';
|
|
3
4
|
import MTag from './MTag.vue';
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof MTag> = {
|
|
@@ -17,7 +18,7 @@ const meta: Meta<typeof MTag> = {
|
|
|
17
18
|
label: 'Tag label',
|
|
18
19
|
},
|
|
19
20
|
render: (args) => ({
|
|
20
|
-
components: { MTag },
|
|
21
|
+
components: { MTag, FeelingSatisfied20 },
|
|
21
22
|
setup() {
|
|
22
23
|
const handleUpdate = action('update:modelValue');
|
|
23
24
|
const handleRemoveTag = action('remove-tag');
|
|
@@ -25,11 +26,14 @@ const meta: Meta<typeof MTag> = {
|
|
|
25
26
|
return { args, handleUpdate, handleRemoveTag };
|
|
26
27
|
},
|
|
27
28
|
template: `
|
|
28
|
-
<MTag
|
|
29
|
+
<MTag
|
|
29
30
|
v-bind="args"
|
|
30
31
|
@update:modelValue="handleUpdate"
|
|
31
32
|
@remove-tag="handleRemoveTag"
|
|
32
|
-
|
|
33
|
+
v-model="args.modelValue"
|
|
34
|
+
>
|
|
35
|
+
<template v-if="${'icon' in args}" v-slot:icon>${args.icon}</template>
|
|
36
|
+
</MTag>
|
|
33
37
|
`,
|
|
34
38
|
}),
|
|
35
39
|
};
|
|
@@ -42,6 +46,12 @@ export const Size: Story = {
|
|
|
42
46
|
args: { size: 's' },
|
|
43
47
|
};
|
|
44
48
|
|
|
49
|
+
export const Icon: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
icon: '<FeelingSatisfied20/>',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
45
55
|
export const Interactive: Story = {
|
|
46
56
|
args: { type: 'interactive' },
|
|
47
57
|
};
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"
|
|
18
18
|
v-bind="$attrs"
|
|
19
19
|
/>
|
|
20
|
+
<slot v-if="!modelValue" name="icon" />
|
|
20
21
|
<span class="mc-tag__label">{{ label }}</span>
|
|
21
22
|
</label>
|
|
22
23
|
|
|
@@ -28,6 +29,7 @@
|
|
|
28
29
|
:disabled="disabled"
|
|
29
30
|
v-bind="$attrs"
|
|
30
31
|
>
|
|
32
|
+
<slot name="icon" />
|
|
31
33
|
<span class="mc-tag__label">{{ label }}</span>
|
|
32
34
|
</button>
|
|
33
35
|
|
|
@@ -66,12 +68,13 @@
|
|
|
66
68
|
|
|
67
69
|
<!-- informative -->
|
|
68
70
|
<span v-else class="mc-tag" :class="classObject" v-bind="$attrs">
|
|
71
|
+
<slot name="icon" />
|
|
69
72
|
<span class="mc-tag__label">{{ label }}</span>
|
|
70
73
|
</span>
|
|
71
74
|
</template>
|
|
72
75
|
|
|
73
76
|
<script setup lang="ts">
|
|
74
|
-
import { computed } from 'vue';
|
|
77
|
+
import { computed, type VNode } from 'vue';
|
|
75
78
|
import { CrossCircleFilled24 } from '@mozaic-ds/icons-vue';
|
|
76
79
|
import MNumberBadge from '../numberbadge/MNumberBadge.vue';
|
|
77
80
|
/**
|
|
@@ -128,6 +131,13 @@ const props = withDefaults(
|
|
|
128
131
|
},
|
|
129
132
|
);
|
|
130
133
|
|
|
134
|
+
defineSlots<{
|
|
135
|
+
/**
|
|
136
|
+
* Use this slot to insert an icon in the tag.
|
|
137
|
+
*/
|
|
138
|
+
icon?: VNode;
|
|
139
|
+
}>();
|
|
140
|
+
|
|
131
141
|
const classObject = computed(() => {
|
|
132
142
|
return {
|
|
133
143
|
[`mc-tag-${props.type}`]: props.type && props.type != 'informative',
|
|
@@ -17,6 +17,12 @@ A Tag is a UI element used to filter data, categorize, select or deselect an opt
|
|
|
17
17
|
| `contextualisedNumber` | A number displayed in the badge when the tag is contextualised. | `number` | `99` |
|
|
18
18
|
| `removableLabel` | Accessible label text for the remove button in removable tags. | `string` | `"Remove"` |
|
|
19
19
|
|
|
20
|
+
## Slots
|
|
21
|
+
|
|
22
|
+
| Name | Description |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `icon` | Use this slot to insert an icon in the tag. |
|
|
25
|
+
|
|
20
26
|
## Events
|
|
21
27
|
|
|
22
28
|
| Name | Description | Type |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MTextArea
|
|
3
|
+
* Links Figma _text area / base 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=4544-28487',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
isInvalid: figma.enum('Is invalid', {
|
|
12
|
+
True: true,
|
|
13
|
+
False: false,
|
|
14
|
+
}),
|
|
15
|
+
},
|
|
16
|
+
example: ({ isInvalid }) =>
|
|
17
|
+
html`<script setup>
|
|
18
|
+
import { MTextArea } from '@mozaic-ds/vue';
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<MTextArea
|
|
22
|
+
id="textarea-id"
|
|
23
|
+
:is-invalid=${isInvalid}
|
|
24
|
+
placeholder="Placeholder"
|
|
25
|
+
model-value=""
|
|
26
|
+
></MTextArea>`,
|
|
27
|
+
},
|
|
28
|
+
);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MTextInput
|
|
3
|
+
* Links Figma _text input / base 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-29794',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
size: figma.enum('Size', {
|
|
12
|
+
S: 's',
|
|
13
|
+
'M (default)': 'm',
|
|
14
|
+
}),
|
|
15
|
+
disabled: figma.enum('State', {
|
|
16
|
+
Disabled: true,
|
|
17
|
+
Default: false,
|
|
18
|
+
Hovered: false,
|
|
19
|
+
Focused: false,
|
|
20
|
+
'Read-only': false,
|
|
21
|
+
}),
|
|
22
|
+
readonly: figma.enum('State', {
|
|
23
|
+
'Read-only': true,
|
|
24
|
+
Default: false,
|
|
25
|
+
Hovered: false,
|
|
26
|
+
Focused: false,
|
|
27
|
+
Disabled: false,
|
|
28
|
+
}),
|
|
29
|
+
isInvalid: figma.enum('Is invalid', {
|
|
30
|
+
True: true,
|
|
31
|
+
False: false,
|
|
32
|
+
}),
|
|
33
|
+
isClearable: figma.boolean('Is clearable'),
|
|
34
|
+
},
|
|
35
|
+
example: ({ size, disabled, readonly, isInvalid, isClearable }) =>
|
|
36
|
+
html`<script setup>
|
|
37
|
+
import { MTextInput } from '@mozaic-ds/vue';
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<MTextInput
|
|
41
|
+
id="text-input-id"
|
|
42
|
+
size=${size}
|
|
43
|
+
disabled=${disabled}
|
|
44
|
+
readonly=${readonly}
|
|
45
|
+
:is-invalid=${isInvalid}
|
|
46
|
+
:is-clearable=${isClearable}
|
|
47
|
+
placeholder="Placeholder"
|
|
48
|
+
model-value=""
|
|
49
|
+
></MTextInput>`,
|
|
50
|
+
},
|
|
51
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MTile
|
|
3
|
+
* Links Figma Tile (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=156-18755',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
type: figma.enum('Type', {
|
|
12
|
+
'Base (as container)': 'base',
|
|
13
|
+
'Clickable (as navigation)': 'clickable',
|
|
14
|
+
'Expandable (as accordion)': 'expandable',
|
|
15
|
+
'Selectable (as option)': 'selectable',
|
|
16
|
+
}),
|
|
17
|
+
bordered: figma.enum('Is bordered', {
|
|
18
|
+
True: true,
|
|
19
|
+
False: false,
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
example: ({ bordered }) =>
|
|
23
|
+
html`<script setup>
|
|
24
|
+
import { MTile } from '@mozaic-ds/vue';
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<MTile bordered=${bordered}>
|
|
28
|
+
<p>Tile content</p>
|
|
29
|
+
</MTile>`,
|
|
30
|
+
},
|
|
31
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MTileClickable
|
|
3
|
+
* Links Figma clickable tile (as navigation) 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=156-18803',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
appearance: figma.enum('Appearance', {
|
|
12
|
+
Primary: 'primary',
|
|
13
|
+
Secondary: 'secondary',
|
|
14
|
+
Inverse: 'inverse',
|
|
15
|
+
}),
|
|
16
|
+
iconPosition: figma.enum('Icon position', {
|
|
17
|
+
Bottom: 'bottom',
|
|
18
|
+
Right: 'right',
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
example: ({ appearance, iconPosition }) =>
|
|
22
|
+
html`<script setup>
|
|
23
|
+
import { MTileClickable } from '@mozaic-ds/vue';
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<MTileClickable appearance=${appearance} icon-position=${iconPosition}>
|
|
27
|
+
<p>Tile content</p>
|
|
28
|
+
<template #icon>Action</template>
|
|
29
|
+
</MTileClickable>`,
|
|
30
|
+
},
|
|
31
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MTileExpandable
|
|
3
|
+
* Links Figma expandable tile (as accordion) 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=156-18764',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
appearance: figma.enum('Appearance', {
|
|
12
|
+
Primary: 'primary',
|
|
13
|
+
Secondary: 'secondary',
|
|
14
|
+
}),
|
|
15
|
+
trigger: figma.enum('Triggering event', {
|
|
16
|
+
Container: 'container',
|
|
17
|
+
Icon: 'icon',
|
|
18
|
+
Button: 'button',
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
example: ({ appearance, trigger }) =>
|
|
22
|
+
html`<script setup>
|
|
23
|
+
import { MTileExpandable } from '@mozaic-ds/vue';
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<MTileExpandable appearance=${appearance} trigger=${trigger}>
|
|
27
|
+
<p>Tile content</p>
|
|
28
|
+
<template #details>Expandable details</template>
|
|
29
|
+
</MTileExpandable>`,
|
|
30
|
+
},
|
|
31
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MTileSelectable
|
|
3
|
+
* Links Figma selectable tile (as option) 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=156-18948',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
inputPosition: figma.enum('Input on the left', {
|
|
12
|
+
False: 'right',
|
|
13
|
+
True: 'left',
|
|
14
|
+
}),
|
|
15
|
+
centered: figma.enum('Centered input', {
|
|
16
|
+
False: false,
|
|
17
|
+
True: true,
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
example: ({ inputPosition, centered }) =>
|
|
21
|
+
html`<script setup>
|
|
22
|
+
import { MTileSelectable } from '@mozaic-ds/vue';
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<MTileSelectable v-model="selected" input-position=${inputPosition} :centered=${centered}>
|
|
26
|
+
<p>Tile content</p>
|
|
27
|
+
</MTileSelectable>`,
|
|
28
|
+
},
|
|
29
|
+
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MToaster
|
|
3
|
+
* Links Figma Toaster (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=12131-26443',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
status: figma.enum('Status', {
|
|
12
|
+
Information: 'info',
|
|
13
|
+
Success: 'success',
|
|
14
|
+
Warning: 'warning',
|
|
15
|
+
Error: 'error',
|
|
16
|
+
}),
|
|
17
|
+
},
|
|
18
|
+
example: ({ status }) =>
|
|
19
|
+
html`<script setup>
|
|
20
|
+
import { MToaster } from '@mozaic-ds/vue';
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<MToaster description="Notification message" status=${status} />`,
|
|
24
|
+
},
|
|
25
|
+
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MToggle
|
|
3
|
+
* Links Figma Toggle (stand-alone) (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-29289',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: figma.enum('Is checked', {
|
|
12
|
+
True: true,
|
|
13
|
+
False: false,
|
|
14
|
+
}),
|
|
15
|
+
size: figma.enum('Size', {
|
|
16
|
+
'S (default)': 's',
|
|
17
|
+
M: 'm',
|
|
18
|
+
}),
|
|
19
|
+
disabled: figma.enum('State', {
|
|
20
|
+
Disabled: true,
|
|
21
|
+
Default: false,
|
|
22
|
+
Hovered: false,
|
|
23
|
+
Focused: false,
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
example: ({ modelValue, size, disabled }) =>
|
|
27
|
+
html`<script setup>
|
|
28
|
+
import { MToggle } from '@mozaic-ds/vue';
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<MToggle
|
|
32
|
+
id="toggle-id"
|
|
33
|
+
label="Toggle Label"
|
|
34
|
+
:model-value=${modelValue}
|
|
35
|
+
size=${size}
|
|
36
|
+
disabled=${disabled}
|
|
37
|
+
></MToggle>`,
|
|
38
|
+
},
|
|
39
|
+
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MToggleGroup
|
|
3
|
+
* Links Figma Toggle group (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-29266',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
inline: figma.enum('Layout', {
|
|
12
|
+
'Stacked (default)': false,
|
|
13
|
+
Inline: true,
|
|
14
|
+
}),
|
|
15
|
+
},
|
|
16
|
+
example: ({ inline }) =>
|
|
17
|
+
html`<script setup>
|
|
18
|
+
import { MToggleGroup } from '@mozaic-ds/vue';
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<MToggleGroup
|
|
22
|
+
name="group"
|
|
23
|
+
:options="[
|
|
24
|
+
{ id: '1', label: 'Option 1', value: '1' },
|
|
25
|
+
{ id: '2', label: 'Option 2', value: '2' },
|
|
26
|
+
]"
|
|
27
|
+
inline=${inline}
|
|
28
|
+
/>`,
|
|
29
|
+
},
|
|
30
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MTooltip
|
|
3
|
+
* Links Figma Tooltip (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-6487',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
text: figma.string('Text'),
|
|
12
|
+
position: figma.enum('Position', {
|
|
13
|
+
Top: 'top',
|
|
14
|
+
Bottom: 'bottom',
|
|
15
|
+
Left: 'left',
|
|
16
|
+
Right: 'right',
|
|
17
|
+
}),
|
|
18
|
+
pointer: figma.boolean('Pointer'),
|
|
19
|
+
},
|
|
20
|
+
example: ({ text, position, pointer }) =>
|
|
21
|
+
html`<script setup>
|
|
22
|
+
import { MTooltip } from '@mozaic-ds/vue';
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<MTooltip id="tooltip-id" text=${text} position=${position} :pointer=${pointer}>
|
|
26
|
+
<span>Hover me</span>
|
|
27
|
+
</MTooltip>`,
|
|
28
|
+
},
|
|
29
|
+
);
|
package/src/main.ts
CHANGED
|
@@ -59,6 +59,7 @@ export { default as MStatusNotification } from './components/statusnotification/
|
|
|
59
59
|
export { default as MStepperBottomBar } from './components/stepperbottombar/MStepperBottomBar.vue';
|
|
60
60
|
export { default as MStepperCompact } from './components/steppercompact/MStepperCompact.vue';
|
|
61
61
|
export { default as MStepperInline } from './components/stepperinline/MStepperInline.vue';
|
|
62
|
+
export { default as MStepperStacked } from './components/stepperstacked/MStepperStacked.vue';
|
|
62
63
|
export { default as MTabs } from './components/tabs/MTabs.vue';
|
|
63
64
|
export { default as MTag } from './components/tag/MTag.vue';
|
|
64
65
|
export { default as MTextArea } from './components/textarea/MTextArea.vue';
|