@mozaic-ds/vue 2.16.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.
- package/dist/mozaic-vue.css +2 -1
- package/dist/mozaic-vue.d.ts +134 -91
- package/dist/mozaic-vue.js +17184 -10878
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +23 -22
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +10 -5
- package/src/components/BrandPresets.mdx +2 -2
- package/src/components/ComponentsMapping.mdx +98 -0
- package/src/components/accordionlist/MAccordionList.figma.ts +43 -0
- package/src/components/accordionlistitem/MAccordionListItem.figma.ts +27 -0
- 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/button/MButton.figma.ts +41 -0
- package/src/components/callout/MCallout.figma.ts +29 -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/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 +62 -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/numberbadge/MNumberBadge.figma.ts +31 -0
- package/src/components/optionListbox/MOptionListbox.figma.ts +36 -0
- package/src/components/optionListbox/MOptionListbox.vue +18 -18
- 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/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/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/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/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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MStatusBadge
|
|
3
|
+
* Links Figma Status badge (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-21619',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
label: figma.string('Label'),
|
|
12
|
+
status: figma.enum('Status', {
|
|
13
|
+
Information: 'info',
|
|
14
|
+
Success: 'success',
|
|
15
|
+
Warning: 'warning',
|
|
16
|
+
Error: 'error',
|
|
17
|
+
Neutral: 'neutral',
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
example: ({ label, status }) =>
|
|
21
|
+
html`<script setup>
|
|
22
|
+
import { MStatusBadge } from '@mozaic-ds/vue';
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<MStatusBadge label=${label} status=${status}></MStatusBadge>`,
|
|
26
|
+
},
|
|
27
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MStatusDot
|
|
3
|
+
* Links Figma Status dot (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-21635',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
status: figma.enum('Status', {
|
|
12
|
+
Information: 'info',
|
|
13
|
+
Success: 'success',
|
|
14
|
+
Warning: 'warning',
|
|
15
|
+
Error: 'error',
|
|
16
|
+
Neutral: 'neutral',
|
|
17
|
+
}),
|
|
18
|
+
size: figma.enum('Size', {
|
|
19
|
+
'S (4px)': 's',
|
|
20
|
+
'M (8px)': 'm',
|
|
21
|
+
'L (16px)': 'l',
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
example: ({ status, size }) =>
|
|
25
|
+
html`<script setup>
|
|
26
|
+
import { MStatusDot } from '@mozaic-ds/vue';
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<MStatusDot status=${status} size=${size}></MStatusDot>`,
|
|
30
|
+
},
|
|
31
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MStatusMessage
|
|
3
|
+
* Links Figma Status message 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=20807-13948',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
label: figma.string('Status message'),
|
|
12
|
+
status: figma.enum('Status', {
|
|
13
|
+
Information: 'info',
|
|
14
|
+
Success: 'success',
|
|
15
|
+
Warning: 'warning',
|
|
16
|
+
Error: 'error',
|
|
17
|
+
Neutral: 'neutral',
|
|
18
|
+
'In progress': 'inprogress',
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
example: ({ label, status }) =>
|
|
22
|
+
html`<script setup>
|
|
23
|
+
import { MStatusMessage } from '@mozaic-ds/vue';
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<MStatusMessage label=${label} status=${status}></MStatusMessage>`,
|
|
27
|
+
},
|
|
28
|
+
);
|
|
@@ -20,6 +20,21 @@ describe('MStatusMessage.vue', () => {
|
|
|
20
20
|
);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
it('adds the accent modifier class when appearance is accent', () => {
|
|
24
|
+
const wrapper = mount(MStatusMessage, {
|
|
25
|
+
props: { label: 'Accent', appearance: 'accent' },
|
|
26
|
+
});
|
|
27
|
+
expect(wrapper.classes()).toContain('mc-status-message--accent');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('does NOT add the accent modifier class when appearance is standard', () => {
|
|
31
|
+
const wrapper = mount(MStatusMessage, {
|
|
32
|
+
props: { label: 'Standard', appearance: 'standard' },
|
|
33
|
+
});
|
|
34
|
+
expect(wrapper.classes()).not.toContain('mc-status-message--accent');
|
|
35
|
+
expect(wrapper.classes()).not.toContain('mc-status-message--standard');
|
|
36
|
+
});
|
|
37
|
+
|
|
23
38
|
it('uses the info icon by default', () => {
|
|
24
39
|
const wrapper = mount(MStatusMessage, {
|
|
25
40
|
props: { label: 'Info message' },
|
|
@@ -35,6 +35,11 @@ const props = withDefaults(
|
|
|
35
35
|
| 'error'
|
|
36
36
|
| 'neutral'
|
|
37
37
|
| 'inprogress';
|
|
38
|
+
/**
|
|
39
|
+
* Allows to define the status message appearance.
|
|
40
|
+
* The accent status is used to highlight a specific message.
|
|
41
|
+
*/
|
|
42
|
+
appearance?: 'standard' | 'accent';
|
|
38
43
|
/**
|
|
39
44
|
* Label of the status message.
|
|
40
45
|
*/
|
|
@@ -42,6 +47,7 @@ const props = withDefaults(
|
|
|
42
47
|
}>(),
|
|
43
48
|
{
|
|
44
49
|
status: 'info',
|
|
50
|
+
appearance: 'standard',
|
|
45
51
|
},
|
|
46
52
|
);
|
|
47
53
|
|
|
@@ -49,6 +55,7 @@ const classObject = computed(() => {
|
|
|
49
55
|
return {
|
|
50
56
|
[`mc-status-message--${props.status}`]:
|
|
51
57
|
props.status && props.status != 'info',
|
|
58
|
+
[`mc-status-message--${props.appearance}`]: props.appearance != 'standard',
|
|
52
59
|
};
|
|
53
60
|
});
|
|
54
61
|
|
|
@@ -8,6 +8,8 @@ A Status Message is a compact component that combines an icon and concise text t
|
|
|
8
8
|
| Name | Description | Type | Default |
|
|
9
9
|
| --- | --- | --- | --- |
|
|
10
10
|
| `status` | Allows to define the status message style. | `"info"` `"warning"` `"error"` `"success"` `"neutral"` `"inprogress"` | `"info"` |
|
|
11
|
+
| `appearance` | Allows to define the status message appearance.
|
|
12
|
+
The accent status is used to highlight a specific message. | `"standard"` `"accent"` | `"standard"` |
|
|
11
13
|
| `label*` | Label of the status message. | `string` | - |
|
|
12
14
|
|
|
13
15
|
## Dependencies
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MStatusNotification
|
|
3
|
+
* Links Figma Status notification (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-21600',
|
|
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 { MStatusNotification } from '@mozaic-ds/vue';
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<MStatusNotification
|
|
24
|
+
title="Notification title"
|
|
25
|
+
description="Notification description"
|
|
26
|
+
status=${status}
|
|
27
|
+
></MStatusNotification>`,
|
|
28
|
+
},
|
|
29
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MStepperBottomBar
|
|
3
|
+
* Links Figma Stepper 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=10726-18528',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
cancel: figma.boolean('Has cancel action'),
|
|
12
|
+
},
|
|
13
|
+
example: ({ cancel }) =>
|
|
14
|
+
html`<script setup>
|
|
15
|
+
import { MStepperBottomBar } from '@mozaic-ds/vue';
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<MStepperBottomBar cancel=${cancel} :steps="3" />`,
|
|
19
|
+
},
|
|
20
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MStepperCompact
|
|
3
|
+
* Links Figma Stepper (Compact) (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=13297-24864',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
label: figma.string('Step label'),
|
|
12
|
+
description: figma.string('Next step label'),
|
|
13
|
+
},
|
|
14
|
+
example: ({ label, description }) =>
|
|
15
|
+
html`<script setup>
|
|
16
|
+
import { MStepperCompact } from '@mozaic-ds/vue';
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<MStepperCompact label=${label} :description=${description} :value="1" :max-steps="4"></MStepperCompact>`,
|
|
20
|
+
},
|
|
21
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MStepperInline
|
|
3
|
+
* Links Figma Stepper (Inline) 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=13050-10371',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
showStep03: figma.boolean('Show Step 03'),
|
|
12
|
+
showStep04: figma.boolean('Show Step 04'),
|
|
13
|
+
showStep05: figma.boolean('Show Step 05'),
|
|
14
|
+
showStep06: figma.boolean('Show Step 06'),
|
|
15
|
+
},
|
|
16
|
+
example: () =>
|
|
17
|
+
html`<script setup>
|
|
18
|
+
import { MStepperInline } from '@mozaic-ds/vue';
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<MStepperInline :current-step="1" :steps="[{ label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }]"></MStepperInline>`,
|
|
22
|
+
},
|
|
23
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MStepperStacked
|
|
3
|
+
* Links Figma Stepper (Stacked) (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=13179-6447',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
showStep03: figma.boolean('Show Step 03'),
|
|
12
|
+
showStep04: figma.boolean('Show Step 04'),
|
|
13
|
+
showStep05: figma.boolean('Show Step 05'),
|
|
14
|
+
showStep06: figma.boolean('Show Step 06'),
|
|
15
|
+
},
|
|
16
|
+
example: () =>
|
|
17
|
+
html`<script setup>
|
|
18
|
+
import { MStepperStacked } from '@mozaic-ds/vue';
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<MStepperStacked :current-step="1" :steps="[{ label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }, { label: 'Step label', additionalInfo: 'Additional information' }]"></MStepperStacked>`,
|
|
22
|
+
},
|
|
23
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MTabs
|
|
3
|
+
* Links Figma Tabs (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-11474',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
divider: figma.boolean('Show divider'),
|
|
12
|
+
centered: figma.enum('Centered', {
|
|
13
|
+
True: true,
|
|
14
|
+
False: false,
|
|
15
|
+
}),
|
|
16
|
+
},
|
|
17
|
+
example: ({ divider, centered }) =>
|
|
18
|
+
html`<script setup>
|
|
19
|
+
import { MTabs } from '@mozaic-ds/vue';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<MTabs
|
|
23
|
+
:divider=${divider}
|
|
24
|
+
centered=${centered}
|
|
25
|
+
model-value="label1"
|
|
26
|
+
:tabs="[
|
|
27
|
+
{ id: 'label1', label: 'Label' },
|
|
28
|
+
{ id: 'label2', label: 'Label' },
|
|
29
|
+
{ id: 'label3', label: 'Label' },
|
|
30
|
+
]"
|
|
31
|
+
></MTabs>`,
|
|
32
|
+
},
|
|
33
|
+
);
|
|
@@ -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
|
+
);
|