@mozaic-ds/vue 2.15.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mozaic-vue.css +2 -1
- package/dist/mozaic-vue.d.ts +1040 -408
- package/dist/mozaic-vue.js +17183 -6742
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +26 -6
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +11 -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/actionlistbox/MActionListbox.spec.ts +14 -0
- package/src/components/actionlistbox/MActionListbox.stories.ts +15 -8
- package/src/components/actionlistbox/MActionListbox.vue +13 -1
- package/src/components/actionlistbox/README.md +2 -1
- 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/button/README.md +2 -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 +246 -0
- package/src/components/combobox/MCombobox.stories.ts +190 -0
- package/src/components/combobox/MCombobox.vue +286 -0
- package/src/components/combobox/README.md +52 -0
- 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/field/MField.stories.ts +105 -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.spec.ts +527 -0
- package/src/components/optionListbox/MOptionListbox.vue +470 -0
- package/src/components/optionListbox/README.md +63 -0
- 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/stepperstacked/MStepperStacked.spec.ts +162 -0
- package/src/components/stepperstacked/MStepperStacked.stories.ts +57 -0
- package/src/components/stepperstacked/MStepperStacked.vue +106 -0
- package/src/components/stepperstacked/README.md +15 -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/textinput/MTextInput.vue +13 -1
- package/src/components/textinput/README.md +15 -1
- 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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MPincode
|
|
3
|
+
* Links Figma Pincode input (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=12443-35984',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
disabled: figma.enum('State', {
|
|
12
|
+
Disabled: true,
|
|
13
|
+
Default: false,
|
|
14
|
+
Hovered: false,
|
|
15
|
+
'Read-only': false,
|
|
16
|
+
}),
|
|
17
|
+
readonly: figma.enum('State', {
|
|
18
|
+
'Read-only': true,
|
|
19
|
+
Default: false,
|
|
20
|
+
Disabled: false,
|
|
21
|
+
Hovered: false,
|
|
22
|
+
}),
|
|
23
|
+
isInvalid: figma.enum('Is invalid', {
|
|
24
|
+
True: true,
|
|
25
|
+
False: false,
|
|
26
|
+
}),
|
|
27
|
+
},
|
|
28
|
+
example: ({ disabled, readonly, isInvalid }) =>
|
|
29
|
+
html`<script setup>
|
|
30
|
+
import { MPincode } from '@mozaic-ds/vue';
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<MPincode
|
|
34
|
+
id="pincode-id"
|
|
35
|
+
disabled=${disabled}
|
|
36
|
+
readonly=${readonly}
|
|
37
|
+
:is-invalid=${isInvalid}
|
|
38
|
+
aria-label="Enter your code"
|
|
39
|
+
></MPincode>`,
|
|
40
|
+
},
|
|
41
|
+
);
|
|
@@ -93,10 +93,7 @@ describe('MPincode component', () => {
|
|
|
93
93
|
},
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
for (const input of inputs) {
|
|
98
|
-
expect(input.classes()).toContain('is-invalid');
|
|
99
|
-
}
|
|
96
|
+
expect(wrapper.classes()).toContain('is-invalid');
|
|
100
97
|
});
|
|
101
98
|
|
|
102
99
|
it('disables inputs when disabled is true', () => {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="mc-pincode-input"
|
|
4
|
+
:class="{
|
|
5
|
+
'mc-pincode-input': true,
|
|
6
|
+
'mc-pincode-input__disabled': disabled,
|
|
7
|
+
'mc-pincode-input__readonly': readonly,
|
|
8
|
+
'is-invalid': isInvalid,
|
|
9
|
+
}"
|
|
10
|
+
@paste="onPaste"
|
|
11
|
+
>
|
|
3
12
|
<input
|
|
4
13
|
v-for="(digit, index) in otp"
|
|
5
14
|
:key="index"
|
|
@@ -12,7 +21,6 @@
|
|
|
12
21
|
autocomplete="one-time-code"
|
|
13
22
|
:name="name || `pincode-${id}`"
|
|
14
23
|
class="mc-pincode-input__control"
|
|
15
|
-
:class="classObject"
|
|
16
24
|
:disabled="disabled"
|
|
17
25
|
:readonly="readonly"
|
|
18
26
|
:value="digit"
|
|
@@ -25,13 +33,7 @@
|
|
|
25
33
|
</template>
|
|
26
34
|
|
|
27
35
|
<script setup lang="ts">
|
|
28
|
-
import {
|
|
29
|
-
ref,
|
|
30
|
-
computed,
|
|
31
|
-
watch,
|
|
32
|
-
nextTick,
|
|
33
|
-
type ComponentPublicInstance,
|
|
34
|
-
} from 'vue';
|
|
36
|
+
import { ref, watch, nextTick, type ComponentPublicInstance } from 'vue';
|
|
35
37
|
/**
|
|
36
38
|
* A pincode input is a specialized input field used to enter short numeric codes, such as verification codes, security PINs, or authentication tokens. It typically separates each digit into individual fields to improve readability and ease of entry. This component is commonly used in two-factor authentication (2FA), password recovery, and secure access flows, ensuring a structured and user-friendly experience.<br><br> To put a label, requierement text, help text or to apply a valid or invalid message, the examples are available in the [Field section](/docs/form-elements-field--docs#input).
|
|
37
39
|
*/
|
|
@@ -71,12 +73,6 @@ const props = withDefaults(
|
|
|
71
73
|
},
|
|
72
74
|
);
|
|
73
75
|
|
|
74
|
-
const classObject = computed(() => {
|
|
75
|
-
return {
|
|
76
|
-
'is-invalid': props.isInvalid,
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
|
|
80
76
|
const emit = defineEmits<{
|
|
81
77
|
/**
|
|
82
78
|
* Emits when the pincode value changes, updating the modelValue prop.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MPopover
|
|
3
|
+
* Links Figma Popover (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=9680-7268',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
appearance: figma.enum('Appareance', {
|
|
12
|
+
Standard: 'standard',
|
|
13
|
+
Inverse: 'inverse',
|
|
14
|
+
}),
|
|
15
|
+
size: figma.enum('Size', {
|
|
16
|
+
'S (default)': 's',
|
|
17
|
+
M: 'm',
|
|
18
|
+
L: 'l',
|
|
19
|
+
}),
|
|
20
|
+
pointer: figma.boolean('Has pointer'),
|
|
21
|
+
closable: figma.boolean('Is closable'),
|
|
22
|
+
},
|
|
23
|
+
example: ({ appearance, size, pointer, closable }) =>
|
|
24
|
+
html`<script setup>
|
|
25
|
+
import { MPopover, MButton } from '@mozaic-ds/vue';
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<MPopover
|
|
29
|
+
id="popover-id"
|
|
30
|
+
title="Popover title"
|
|
31
|
+
description="Popover description"
|
|
32
|
+
:pointer=${pointer}
|
|
33
|
+
:closable=${closable}
|
|
34
|
+
appearance=${appearance}
|
|
35
|
+
size=${size}
|
|
36
|
+
>
|
|
37
|
+
<template #activator="{ id }">
|
|
38
|
+
<MButton :popovertarget="id">Open</MButton>
|
|
39
|
+
</template>
|
|
40
|
+
</MPopover>`,
|
|
41
|
+
},
|
|
42
|
+
);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MQuantitySelector
|
|
3
|
+
* Links Figma _quantity selector / 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-29697',
|
|
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
|
+
},
|
|
34
|
+
example: ({ size, disabled, readonly, isInvalid }) =>
|
|
35
|
+
html`<script setup>
|
|
36
|
+
import { MQuantitySelector } from '@mozaic-ds/vue';
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<MQuantitySelector
|
|
40
|
+
id="quantity-selector-id"
|
|
41
|
+
size=${size}
|
|
42
|
+
disabled=${disabled}
|
|
43
|
+
readonly=${readonly}
|
|
44
|
+
:is-invalid=${isInvalid}
|
|
45
|
+
:model-value="1"
|
|
46
|
+
:min="0"
|
|
47
|
+
:max="10"
|
|
48
|
+
></MQuantitySelector>`,
|
|
49
|
+
},
|
|
50
|
+
);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MRadio
|
|
3
|
+
* Links Figma Radio button (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-29235',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: figma.enum('Is checked', {
|
|
12
|
+
True: true,
|
|
13
|
+
False: false,
|
|
14
|
+
}),
|
|
15
|
+
disabled: figma.enum('State', {
|
|
16
|
+
Disabled: true,
|
|
17
|
+
Default: false,
|
|
18
|
+
Hovered: false,
|
|
19
|
+
Focused: false,
|
|
20
|
+
'Read-only': false,
|
|
21
|
+
}),
|
|
22
|
+
isInvalid: figma.enum('is invalid', {
|
|
23
|
+
True: true,
|
|
24
|
+
False: false,
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
example: ({ modelValue, disabled, isInvalid }) =>
|
|
28
|
+
html`<script setup>
|
|
29
|
+
import { MRadio } from '@mozaic-ds/vue';
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<MRadio
|
|
33
|
+
id="radio-id"
|
|
34
|
+
label="Radio button Label"
|
|
35
|
+
:model-value=${modelValue}
|
|
36
|
+
disabled=${disabled}
|
|
37
|
+
:is-invalid=${isInvalid}
|
|
38
|
+
></MRadio>`,
|
|
39
|
+
},
|
|
40
|
+
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MRadioGroup
|
|
3
|
+
* Links Figma Radio button 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-29119',
|
|
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 { MRadioGroup } from '@mozaic-ds/vue';
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<MRadioGroup
|
|
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,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MSegmentedControl
|
|
3
|
+
* Links Figma Segmented control (ADS2) to @mozaic-ds/vue
|
|
4
|
+
* Props from figma_get_component (Figma Console MCP) + MSegmentedControl.stories.ts
|
|
5
|
+
*/
|
|
6
|
+
import figma, { html } from '@figma/code-connect/html';
|
|
7
|
+
|
|
8
|
+
figma.connect(
|
|
9
|
+
'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=6-26997',
|
|
10
|
+
{
|
|
11
|
+
props: {
|
|
12
|
+
size: figma.enum('Size', {
|
|
13
|
+
S: 's',
|
|
14
|
+
M: 'm',
|
|
15
|
+
}),
|
|
16
|
+
full: figma.enum('Full width', {
|
|
17
|
+
True: true,
|
|
18
|
+
False: false,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
example: ({ size, full }) =>
|
|
22
|
+
html`<script setup>
|
|
23
|
+
import { MSegmentedControl } from '@mozaic-ds/vue';
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<MSegmentedControl
|
|
27
|
+
size=${size}
|
|
28
|
+
full=${full}
|
|
29
|
+
:segments="[{ id: 'label1', label: 'Label' }, { id: 'label2', label: 'Label' }]"
|
|
30
|
+
model-value="label1"
|
|
31
|
+
></MSegmentedControl>`,
|
|
32
|
+
},
|
|
33
|
+
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MSelect
|
|
3
|
+
* Links Figma _select / 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=4924-17972',
|
|
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
|
+
},
|
|
34
|
+
example: ({ size, disabled, readonly, isInvalid }) =>
|
|
35
|
+
html`<script setup>
|
|
36
|
+
import { MSelect } from '@mozaic-ds/vue';
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<MSelect
|
|
40
|
+
id="select-id"
|
|
41
|
+
size=${size}
|
|
42
|
+
disabled=${disabled}
|
|
43
|
+
readonly=${readonly}
|
|
44
|
+
:is-invalid=${isInvalid}
|
|
45
|
+
placeholder="Choose an option"
|
|
46
|
+
:options="[{ text: 'Option 1', value: 'option1' }, { text: 'Option 2', value: 'option2' }]"
|
|
47
|
+
></MSelect>`,
|
|
48
|
+
},
|
|
49
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MSidebar
|
|
3
|
+
* Links Figma Sidebar (desktop only) (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=11697-6444',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: figma.enum('is expanded', {
|
|
12
|
+
True: true,
|
|
13
|
+
False: false,
|
|
14
|
+
}),
|
|
15
|
+
},
|
|
16
|
+
example: ({ modelValue }) =>
|
|
17
|
+
html`<script setup>
|
|
18
|
+
import { MSidebar } from '@mozaic-ds/vue';
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<MSidebar :model-value=${modelValue}>
|
|
22
|
+
<template #header>Header</template>
|
|
23
|
+
<template #shortcuts>Shortcuts</template>
|
|
24
|
+
<template #nav>Nav items</template>
|
|
25
|
+
<template #footer>Footer</template>
|
|
26
|
+
</MSidebar>`,
|
|
27
|
+
},
|
|
28
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MSidebarExpandableItem
|
|
3
|
+
* Links Figma _sidebar / section menu item (multiple levels) 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=11697-6356',
|
|
9
|
+
{
|
|
10
|
+
example: () =>
|
|
11
|
+
html`<script setup>
|
|
12
|
+
import { MSidebarExpandableItem, MSidebarNavItem } from '@mozaic-ds/vue';
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<MSidebarExpandableItem label="Section" menu-label="Section">
|
|
16
|
+
<MSidebarNavItem label="Sub item" />
|
|
17
|
+
</MSidebarExpandableItem>`,
|
|
18
|
+
},
|
|
19
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MSidebarFooter
|
|
3
|
+
* Links Figma _sidebar / footer 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=11880-28442',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
expendable: figma.boolean('Is expandable'),
|
|
12
|
+
hasProfileInfo: figma.boolean('Has profile info'),
|
|
13
|
+
},
|
|
14
|
+
example: ({ expendable }) =>
|
|
15
|
+
html`<script setup>
|
|
16
|
+
import { MSidebarFooter } from '@mozaic-ds/vue';
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<MSidebarFooter title="User name" subtitle="user@example.com" :expendable=${expendable} />`,
|
|
20
|
+
},
|
|
21
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MSidebarHeader
|
|
3
|
+
* Links Figma _sidebar / header 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=11910-12842',
|
|
9
|
+
{
|
|
10
|
+
props: {},
|
|
11
|
+
example: () =>
|
|
12
|
+
html`<script setup>
|
|
13
|
+
import { MSidebarHeader } from '@mozaic-ds/vue';
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<MSidebarHeader title="App name" logo="/logo.png" />`,
|
|
17
|
+
},
|
|
18
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MSidebarNavItem
|
|
3
|
+
* Links Figma _sidebar / section menu item (single level) 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=18213-20397',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
active: figma.enum('Is selected', {
|
|
12
|
+
False: false,
|
|
13
|
+
True: true,
|
|
14
|
+
}),
|
|
15
|
+
},
|
|
16
|
+
example: ({ active }) =>
|
|
17
|
+
html`<script setup>
|
|
18
|
+
import { MSidebarNavItem } from '@mozaic-ds/vue';
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<MSidebarNavItem label="Menu item" active=${active} />`,
|
|
22
|
+
},
|
|
23
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MSidebarShortcutItem
|
|
3
|
+
* Links Figma _sidebar / shortcut item to @mozaic-ds/vue
|
|
4
|
+
*/
|
|
5
|
+
import figma, { html } from '@figma/code-connect/html';
|
|
6
|
+
|
|
7
|
+
figma.connect(
|
|
8
|
+
'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=11697-6376',
|
|
9
|
+
{
|
|
10
|
+
props: {
|
|
11
|
+
label: figma.string('Text'),
|
|
12
|
+
},
|
|
13
|
+
example: ({ label }) =>
|
|
14
|
+
html`<script setup>
|
|
15
|
+
import { MSidebarShortcutItem } from '@mozaic-ds/vue';
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<MSidebarShortcutItem label=${label} href="#" />`,
|
|
19
|
+
},
|
|
20
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Connect mapping for MStarRating
|
|
3
|
+
* Links Figma Star Rating to @mozaic-ds/vue
|
|
4
|
+
* Figma component (node 5:14389) exposes: Type, Size, Text only.
|
|
5
|
+
*/
|
|
6
|
+
import figma, { html } from '@figma/code-connect/html';
|
|
7
|
+
|
|
8
|
+
figma.connect(
|
|
9
|
+
'https://www.figma.com/design/Zyh9RyabNaqkjbuFWP9Aqj/%E2%9C%A8-Components--ADS2---Stable-version-?node-id=5-14389',
|
|
10
|
+
{
|
|
11
|
+
props: {
|
|
12
|
+
text: figma.string('Text'),
|
|
13
|
+
size: figma.enum('Size', {
|
|
14
|
+
'S (20px)': 's',
|
|
15
|
+
'M (24px)': 'm',
|
|
16
|
+
'L (32px)': 'l',
|
|
17
|
+
}),
|
|
18
|
+
type: figma.enum('Type', {
|
|
19
|
+
'Stars only (read-only or as input)': 'stars',
|
|
20
|
+
'Additional info': 'additionalInfo',
|
|
21
|
+
Link: 'link',
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
example: ({ text, size }) =>
|
|
25
|
+
html`<script setup>
|
|
26
|
+
import { MStarRating } from '@mozaic-ds/vue';
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<MStarRating
|
|
30
|
+
:model-value="3.5"
|
|
31
|
+
size=${size}
|
|
32
|
+
text=${text}
|
|
33
|
+
></MStarRating>`,
|
|
34
|
+
},
|
|
35
|
+
);
|
|
@@ -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
|
|