@mozaic-ds/vue 1.0.0-beta.7 → 1.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +1 -1
  2. package/dist/mozaic-vue.css +1 -1
  3. package/dist/mozaic-vue.d.ts +605 -210
  4. package/dist/mozaic-vue.js +1281 -629
  5. package/dist/mozaic-vue.js.map +1 -1
  6. package/dist/mozaic-vue.umd.cjs +1 -1
  7. package/dist/mozaic-vue.umd.cjs.map +1 -1
  8. package/package.json +8 -11
  9. package/src/components/Contributing.mdx +1 -1
  10. package/src/components/GettingStarted.mdx +2 -7
  11. package/src/components/Introduction.mdx +41 -21
  12. package/src/components/Support.mdx +1 -1
  13. package/src/components/breadcrumb/MBreadcrumb.stories.ts +11 -13
  14. package/src/components/breadcrumb/MBreadcrumb.vue +1 -1
  15. package/src/components/button/MButton.stories.ts +1 -8
  16. package/src/components/checkbox/MCheckbox.stories.ts +2 -2
  17. package/src/components/checkboxgroup/MCheckboxGroup.stories.ts +2 -2
  18. package/src/components/divider/MDivider.spec.ts +57 -0
  19. package/src/components/divider/MDivider.stories.ts +64 -0
  20. package/src/components/divider/MDivider.vue +56 -0
  21. package/src/components/drawer/MDrawer.spec.ts +100 -0
  22. package/src/components/drawer/MDrawer.stories.ts +128 -0
  23. package/src/components/drawer/MDrawer.vue +140 -0
  24. package/src/components/field/MField.stories.ts +2 -9
  25. package/src/components/fieldgroup/MFieldGroup.stories.ts +2 -9
  26. package/src/components/iconbutton/MIconButton.stories.ts +12 -4
  27. package/src/components/link/MLink.stories.ts +3 -12
  28. package/src/components/loader/MLoader.stories.ts +3 -5
  29. package/src/components/loader/MLoader.vue +1 -0
  30. package/src/components/loadingoverlay/MLoadingOverlay.spec.ts +37 -0
  31. package/src/components/loadingoverlay/MLoadingOverlay.stories.ts +40 -0
  32. package/src/components/loadingoverlay/MLoadingOverlay.vue +28 -0
  33. package/src/components/modal/MModal.spec.ts +103 -0
  34. package/src/components/modal/MModal.stories.ts +127 -0
  35. package/src/components/modal/MModal.vue +131 -0
  36. package/src/components/numberbadge/MNumberBadge.stories.ts +3 -5
  37. package/src/components/overlay/MOverlay.stories.ts +3 -8
  38. package/src/components/pagination/MPagination.spec.ts +123 -0
  39. package/src/components/pagination/MPagination.stories.ts +83 -0
  40. package/src/components/pagination/MPagination.vue +142 -0
  41. package/src/components/passwordinput/MPasswordInput.stories.ts +2 -2
  42. package/src/components/passwordinput/MPasswordInput.vue +2 -5
  43. package/src/components/pincode/MPincode.spec.ts +126 -0
  44. package/src/components/pincode/MPincode.stories.ts +68 -0
  45. package/src/components/pincode/MPincode.vue +139 -0
  46. package/src/components/quantityselector/MQuantitySelector.stories.ts +2 -2
  47. package/src/components/radio/MRadio.stories.ts +2 -2
  48. package/src/components/radiogroup/MRadioGroup.stories.ts +2 -2
  49. package/src/components/select/MSelect.stories.ts +2 -2
  50. package/src/components/statusbadge/MStatusBadge.stories.ts +1 -1
  51. package/src/components/statusdot/MStatusDot.stories.ts +1 -1
  52. package/src/components/statusnotification/MStatusNotification.spec.ts +12 -8
  53. package/src/components/statusnotification/MStatusNotification.stories.ts +2 -9
  54. package/src/components/statusnotification/MStatusNotification.vue +8 -8
  55. package/src/components/tabs/MTabs.stories.ts +104 -0
  56. package/src/components/tabs/MTabs.vue +113 -0
  57. package/src/components/tabs/Mtabs.spec.ts +149 -0
  58. package/src/components/tag/MTag.spec.ts +107 -0
  59. package/src/components/tag/MTag.stories.ts +75 -0
  60. package/src/components/tag/MTag.vue +151 -0
  61. package/src/components/textarea/MTextArea.stories.ts +2 -2
  62. package/src/components/textinput/MTextInput.stories.ts +2 -9
  63. package/src/components/toggle/MToggle.stories.ts +2 -2
  64. package/src/components/togglegroup/MToggleGroup.stories.ts +2 -2
  65. package/src/components/usingIcons.mdx +5 -13
  66. package/src/components/usingPresets.mdx +12 -9
  67. package/src/main.ts +8 -0
@@ -0,0 +1,113 @@
1
+ <template>
2
+ <nav class="mc-tabs" :class="classObject">
3
+ <ul role="tablist" class="mc-tabs__list" :aria-label="description">
4
+ <li
5
+ v-for="(tab, index) in tabs"
6
+ :key="`tab-${index}`"
7
+ role="presentation"
8
+ class="mc-tabs__item"
9
+ >
10
+ <button
11
+ ref="tab"
12
+ role="tab"
13
+ class="mc-tabs__tab"
14
+ :class="{
15
+ 'mc-tabs__tab--selected': isTabSelected(index),
16
+ 'mc-tabs__tab--disabled': tab.disabled,
17
+ }"
18
+ :aria-selected="isTabSelected(index)"
19
+ type="button"
20
+ @click="onClickTab(index)"
21
+ >
22
+ <span v-if="tab.icon" class="mc-tabs__icon">
23
+ <component :is="tab.icon" />
24
+ </span>
25
+ <div class="mc-tabs__label">
26
+ <span>{{ tab.label }}</span>
27
+ </div>
28
+ </button>
29
+ </li>
30
+ </ul>
31
+ <MDivider v-if="divider"></MDivider>
32
+ </nav>
33
+ </template>
34
+
35
+ <script setup lang="ts">
36
+ import { computed, ref, type Component } from 'vue';
37
+ import MDivider from '../divider/MDivider.vue';
38
+ /**
39
+ * Tabs are a navigation component that allows users to switch between different sections within the same context. They help organize content efficiently by displaying only one section at a time, reducing clutter and improving accessibility. Tabs can include icons, labels, and notification badges to provide additional context. They are commonly used in dashboards, product management, and settings interfaces.
40
+ */
41
+ const props = withDefaults(
42
+ defineProps<{
43
+ /**
44
+ * A description indicating the purpose of the set of tabs. Useful for improving the accessibility of the component.
45
+ */
46
+ description?: string;
47
+ /**
48
+ * If `true`, the divider will appear.
49
+ */
50
+ divider?: boolean;
51
+ /**
52
+ * If `true`, the tabs of the component will be centered.
53
+ */
54
+ centered?: boolean;
55
+ /**
56
+ * The selected tab index, bound via v-model.
57
+ */
58
+ modelValue?: number;
59
+ /**
60
+ * An array of objects that allows you to provide all the data needed to generate the content for each tab.
61
+ */
62
+ tabs: Array<{
63
+ /**
64
+ * The icon displayed for the tab from Mozaic-icon-vue.
65
+ */
66
+ icon?: Component;
67
+ /**
68
+ * The label displayed for the tab.
69
+ */
70
+ label: string;
71
+ /**
72
+ * If `true`, the tab will be disabled.
73
+ */
74
+ disabled?: boolean;
75
+ }>;
76
+ }>(),
77
+ {
78
+ modelValue: 0,
79
+ divider: true,
80
+ },
81
+ );
82
+
83
+ const classObject = computed(() => {
84
+ return {
85
+ 'mc-tabs--centered': props.centered,
86
+ };
87
+ });
88
+
89
+ const modelValue = ref(props.modelValue);
90
+
91
+ const onClickTab = (index: number) => {
92
+ if (props.tabs[index].disabled) return;
93
+ if (index !== modelValue.value) {
94
+ modelValue.value = index;
95
+ emit('update:modelValue', index);
96
+ }
97
+ };
98
+
99
+ const isTabSelected = (index: number) => {
100
+ return modelValue.value === index;
101
+ };
102
+
103
+ const emit = defineEmits<{
104
+ /**
105
+ * Emits when the selected tab changes, updating the modelValue prop.
106
+ */
107
+ (on: 'update:modelValue', value: number): void;
108
+ }>();
109
+ </script>
110
+
111
+ <style lang="scss" scoped>
112
+ @use '@mozaic-ds/styles/components/tabs';
113
+ </style>
@@ -0,0 +1,149 @@
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, it, expect } from 'vitest';
3
+ import MTabs from './MTabs.vue';
4
+ import { defineComponent, h } from 'vue';
5
+
6
+ describe('MTabs.vue', () => {
7
+ const tabs = [{ label: 'Tab 1' }, { label: 'Tab 2' }, { label: 'Tab 3' }];
8
+
9
+ it('renders tabs with correct labels', () => {
10
+ const wrapper = mount(MTabs, {
11
+ props: {
12
+ tabs,
13
+ },
14
+ });
15
+
16
+ const tabElements = wrapper.findAll('li.mc-tabs__item');
17
+ expect(tabElements.length).toBe(tabs.length);
18
+
19
+ tabs.forEach((tab, i) => {
20
+ expect(tabElements[i].text()).toContain(tab.label);
21
+ });
22
+ });
23
+
24
+ it('applies selected class and aria-selected attribute based on modelValue and updates on tab click', async () => {
25
+ const wrapper = mount(MTabs, {
26
+ props: {
27
+ tabs,
28
+ modelValue: 0,
29
+ },
30
+ });
31
+
32
+ const buttons = wrapper.findAll('button.mc-tabs__tab');
33
+
34
+ buttons.forEach((button, i) => {
35
+ if (i === 0) {
36
+ expect(button.classes()).toContain('mc-tabs__tab--selected');
37
+ expect(button.attributes('aria-selected')).toBe('true');
38
+ } else {
39
+ expect(button.classes()).not.toContain('mc-tabs__tab--selected');
40
+ expect(button.attributes('aria-selected')).toBe('false');
41
+ }
42
+ });
43
+
44
+ await buttons[1].trigger('click');
45
+
46
+ expect(wrapper.emitted('update:modelValue')).toBeTruthy();
47
+ expect(wrapper.emitted('update:modelValue')![0]).toEqual([1]);
48
+
49
+ await wrapper.setProps({ modelValue: 1 });
50
+
51
+ const updatedButtons = wrapper.findAll('button.mc-tabs__tab');
52
+ updatedButtons.forEach((button, i) => {
53
+ if (i === 1) {
54
+ expect(button.classes()).toContain('mc-tabs__tab--selected');
55
+ expect(button.attributes('aria-selected')).toBe('true');
56
+ } else {
57
+ expect(button.classes()).not.toContain('mc-tabs__tab--selected');
58
+ expect(button.attributes('aria-selected')).toBe('false');
59
+ }
60
+ });
61
+ });
62
+
63
+ it('adds divider and centered classes based on props', async () => {
64
+ const wrapper = mount(MTabs, {
65
+ props: {
66
+ tabs,
67
+ divider: true,
68
+ centered: true,
69
+ },
70
+ });
71
+
72
+ expect(wrapper.classes()).toContain('mc-tabs--centered');
73
+ expect(wrapper.findComponent({ name: 'MDivider' }).exists()).toBe(true);
74
+
75
+ await wrapper.setProps({ divider: false, centered: false });
76
+
77
+ expect(wrapper.classes()).not.toContain('mc-tabs--centered');
78
+ expect(wrapper.findComponent({ name: 'MDivider' }).exists()).toBe(false);
79
+ });
80
+
81
+ it('sets aria-label on tablist based on description prop', () => {
82
+ const description = 'Main tabs navigation';
83
+ const wrapper = mount(MTabs, {
84
+ props: {
85
+ tabs,
86
+ description,
87
+ },
88
+ });
89
+
90
+ const ul = wrapper.find('ul[role="tablist"]');
91
+ expect(ul.attributes('aria-label')).toBe(description);
92
+ });
93
+
94
+ it('renders no tabs if tabs prop is empty', () => {
95
+ const wrapper = mount(MTabs, { props: { tabs: [] } });
96
+ expect(wrapper.findAll('li.mc-tabs__item').length).toBe(0);
97
+ });
98
+
99
+ it('emits update:modelValue on tab click if tab is not disabled', async () => {
100
+ const wrapper = mount(MTabs, {
101
+ props: {
102
+ tabs: [
103
+ { label: 'Tab 1' },
104
+ { label: 'Tab 2', disabled: true },
105
+ { label: 'Tab 3' },
106
+ ],
107
+ modelValue: 0,
108
+ },
109
+ });
110
+
111
+ const buttons = wrapper.findAll('button.mc-tabs__tab');
112
+
113
+ await buttons[2].trigger('click');
114
+ expect(wrapper.emitted('update:modelValue')).toBeTruthy();
115
+ expect(wrapper.emitted('update:modelValue')![0]).toEqual([2]);
116
+
117
+ await buttons[1].trigger('click');
118
+ expect(wrapper.emitted('update:modelValue')!.length).toBe(1);
119
+ });
120
+
121
+ it('renders icon component when icon prop is provided', () => {
122
+ const DummyIcon = defineComponent({
123
+ name: 'DummyIcon',
124
+ render() {
125
+ return h('svg', { class: 'dummy-icon' }, [
126
+ h('circle', { cx: 10, cy: 10, r: 10 }),
127
+ ]);
128
+ },
129
+ });
130
+
131
+ const tabsWithIcon = [
132
+ { label: 'Tab 1', icon: DummyIcon },
133
+ { label: 'Tab 2' },
134
+ ];
135
+
136
+ const wrapper = mount(MTabs, {
137
+ props: {
138
+ tabs: tabsWithIcon,
139
+ },
140
+ });
141
+
142
+ const firstTabButton = wrapper.findAll('button.mc-tabs__tab')[0];
143
+ expect(firstTabButton.findComponent(DummyIcon).exists()).toBe(true);
144
+ expect(firstTabButton.find('svg.dummy-icon').exists()).toBe(true);
145
+
146
+ const secondTabButton = wrapper.findAll('button.mc-tabs__tab')[1];
147
+ expect(secondTabButton.findComponent(DummyIcon).exists()).toBe(false);
148
+ });
149
+ });
@@ -0,0 +1,107 @@
1
+ import { mount } from '@vue/test-utils';
2
+ import MTag from './MTag.vue';
3
+ import { describe, it, expect, vi } from 'vitest';
4
+
5
+ describe('MTag.vue', () => {
6
+ it('renders a selectable tag with a checkbox and label', async () => {
7
+ const wrapper = mount(MTag, {
8
+ props: {
9
+ type: 'selectable',
10
+ label: 'Test Tag',
11
+ modelValue: false,
12
+ id: 'test-tag-id',
13
+ name: 'test-tag',
14
+ },
15
+ });
16
+
17
+ const checkbox = wrapper.find('input');
18
+ const label = wrapper.find('.mc-tag__label');
19
+
20
+ expect(checkbox.exists()).toBe(true);
21
+ expect(label.text()).toBe('Test Tag');
22
+ expect(checkbox.element.checked).toBe(false);
23
+
24
+ await checkbox.setChecked();
25
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual([true]);
26
+ });
27
+
28
+ it('renders an interactive tag as a button with label', () => {
29
+ const wrapper = mount(MTag, {
30
+ props: {
31
+ type: 'interactive',
32
+ label: 'Interactive Tag',
33
+ },
34
+ });
35
+
36
+ const button = wrapper.find('button');
37
+ const label = wrapper.find('.mc-tag__label');
38
+
39
+ expect(button.exists()).toBe(true);
40
+ expect(label.text()).toBe('Interactive Tag');
41
+ });
42
+
43
+ it('renders a contextualised tag with badge number', () => {
44
+ const wrapper = mount(MTag, {
45
+ props: {
46
+ type: 'contextualised',
47
+ label: 'Contextualised Tag',
48
+ contextualisedNumber: 42,
49
+ },
50
+ });
51
+
52
+ const badge = wrapper.findComponent({ name: 'MNumberBadge' });
53
+ const label = wrapper.find('.mc-tag__label');
54
+
55
+ expect(badge.exists()).toBe(true);
56
+ expect(badge.props('label')).toBe(42);
57
+ expect(label.text()).toBe('Contextualised Tag');
58
+ });
59
+
60
+ it('renders a removable tag with a delete button and emits remove event', async () => {
61
+ const removeTag = vi.fn();
62
+ const wrapper = mount(MTag, {
63
+ props: {
64
+ type: 'removable',
65
+ label: 'Removable Tag',
66
+ id: 'removable-tag-id',
67
+ },
68
+ global: {
69
+ mocks: {
70
+ emit: removeTag,
71
+ },
72
+ },
73
+ });
74
+
75
+ const removeButton = wrapper.find('button.mc-tag-removable__remove');
76
+ expect(removeButton.exists()).toBe(true);
77
+
78
+ await removeButton.trigger('click');
79
+ expect(removeTag).toHaveBeenCalledWith('remove-tag', 'removable-tag-id');
80
+ });
81
+
82
+ it('renders with the correct size classes based on the size prop', () => {
83
+ const wrapper = mount(MTag, {
84
+ props: {
85
+ type: 'informative',
86
+ label: 'Informative Tag',
87
+ size: 'l',
88
+ },
89
+ });
90
+
91
+ const element = wrapper.find('span.mc-tag');
92
+ expect(element.classes()).toContain('mc-tag--l');
93
+ });
94
+
95
+ it('should disable the tag when the disabled prop is true', () => {
96
+ const wrapper = mount(MTag, {
97
+ props: {
98
+ type: 'selectable',
99
+ label: 'Disabled Tag',
100
+ disabled: true,
101
+ },
102
+ });
103
+
104
+ const checkbox = wrapper.find('input');
105
+ expect(checkbox.element.disabled).toBe(true);
106
+ });
107
+ });
@@ -0,0 +1,75 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { action } from 'storybook/actions';
3
+ import MTag from './MTag.vue';
4
+
5
+ const meta: Meta<typeof MTag> = {
6
+ title: 'Indicators/Tag',
7
+ component: MTag,
8
+ parameters: {
9
+ docs: {
10
+ description: {
11
+ component:
12
+ 'A Status dot is a small visual indicator used to represent the state or condition of an element. It is often color-coded to convey different statuses at a glance, such as availability, activity, or urgency. Status Dots are commonly found in user presence indicators, system statuses, or process tracking to provide quick, unobtrusive feedback.',
13
+ },
14
+ },
15
+ },
16
+ args: {
17
+ label: 'Tag label',
18
+ },
19
+ render: (args) => ({
20
+ components: { MTag },
21
+ setup() {
22
+ const handleUpdate = action('update:modelValue');
23
+ const handleRemoveTag = action('remove-tag');
24
+
25
+ return { args, handleUpdate, handleRemoveTag };
26
+ },
27
+ template: `
28
+ <MTag
29
+ v-bind="args"
30
+ @update:modelValue="handleUpdate"
31
+ @remove-tag="handleRemoveTag"
32
+ ></MTag>
33
+ `,
34
+ }),
35
+ };
36
+ export default meta;
37
+ type Story = StoryObj<typeof MTag>;
38
+
39
+ export const Default: Story = {};
40
+
41
+ export const Size: Story = {
42
+ args: { size: 's' },
43
+ };
44
+
45
+ export const Interactive: Story = {
46
+ args: { type: 'interactive' },
47
+ };
48
+
49
+ export const Disabled: Story = {
50
+ args: {
51
+ type: 'interactive',
52
+ disabled: true,
53
+ },
54
+ };
55
+
56
+ export const Contextualised: Story = {
57
+ args: {
58
+ type: 'contextualised',
59
+ contextualisedNumber: 99,
60
+ },
61
+ };
62
+
63
+ export const Removable: Story = {
64
+ args: {
65
+ type: 'removable',
66
+ id: 'tagId',
67
+ },
68
+ };
69
+
70
+ export const Selectable: Story = {
71
+ args: {
72
+ type: 'selectable',
73
+ modelValue: true,
74
+ },
75
+ };
@@ -0,0 +1,151 @@
1
+ <template>
2
+ <label
3
+ v-if="type === 'selectable'"
4
+ :for="id"
5
+ class="mc-tag"
6
+ :class="classObject"
7
+ >
8
+ <input
9
+ type="checkbox"
10
+ class="mc-tag__input"
11
+ :id="id"
12
+ :name="name"
13
+ :checked="modelValue"
14
+ :disabled="disabled"
15
+ @change="
16
+ emit('update:modelValue', ($event.target as HTMLInputElement).checked)
17
+ "
18
+ v-bind="$attrs"
19
+ />
20
+ <span class="mc-tag__label">{{ label }}</span>
21
+ </label>
22
+
23
+ <button
24
+ v-else-if="type === 'interactive'"
25
+ class="mc-tag"
26
+ type="button"
27
+ :class="classObject"
28
+ :disabled="disabled"
29
+ v-bind="$attrs"
30
+ >
31
+ <span class="mc-tag__label">{{ label }}</span>
32
+ </button>
33
+
34
+ <button
35
+ v-else-if="type === 'contextualised'"
36
+ class="mc-tag"
37
+ type="button"
38
+ :class="classObject"
39
+ :disabled="disabled"
40
+ v-bind="$attrs"
41
+ >
42
+ <MNumberBadge
43
+ appearance="inverse"
44
+ :label="contextualisedNumber"
45
+ :size="size === 'l' ? 'm' : undefined"
46
+ />
47
+ <span class="mc-tag__label">{{ label }}</span>
48
+ </button>
49
+
50
+ <span
51
+ v-else-if="type === 'removable'"
52
+ class="mc-tag"
53
+ :class="classObject"
54
+ v-bind="$attrs"
55
+ >
56
+ <span class="mc-tag__label">{{ label }}</span>
57
+ <button
58
+ class="mc-tag-removable__remove"
59
+ type="button"
60
+ @click="id && emit('remove-tag', id)"
61
+ >
62
+ <CrossCircleFilled24 class="mc-tag-removable__icon" aria-hidden="true" />
63
+ <span class="mc-tag-removable__text">removableLabel</span>
64
+ </button>
65
+ </span>
66
+
67
+ <!-- informative -->
68
+ <span v-else class="mc-tag" :class="classObject" v-bind="$attrs">
69
+ <span class="mc-tag__label">{{ label }}</span>
70
+ </span>
71
+ </template>
72
+
73
+ <script setup lang="ts">
74
+ import { computed } from 'vue';
75
+ import CrossCircleFilled24 from '@mozaic-ds/icons-vue/src/components/CrossCircleFilled24/CrossCircleFilled24.vue';
76
+ import MNumberBadge from '../numberbadge/MNumberBadge.vue';
77
+ /**
78
+ * A Tag is a UI element used to filter data, categorize, select or deselect an option. It can appear standalone, in a group, or embedded within other components. Depending on its use, a tag can be interactive (clickable, removable, selectable) or static (serving as a visual indicator).
79
+ */
80
+ const props = withDefaults(
81
+ defineProps<{
82
+ /**
83
+ * Defines the behavior and layout of the tag.
84
+ */
85
+ type?:
86
+ | 'informative'
87
+ | 'interactive'
88
+ | 'contextualised'
89
+ | 'removable'
90
+ | 'selectable';
91
+ /**
92
+ * Determines the size of the tag.
93
+ */
94
+ size?: 's' | 'm' | 'l';
95
+ /**
96
+ * A unique identifier for the tag, used to associate the label with the form element. **Required** when type is 'selectable' or 'removable'.
97
+ */
98
+ id?: string;
99
+ /**
100
+ * The name attribute for the tag element, typically used for form submission. (only relevant for type: 'selectable').
101
+ */
102
+ name?: string;
103
+ /**
104
+ * The text label displayed next to the tag.
105
+ */
106
+ label: string;
107
+ /**
108
+ * The tag's checked state, bound via v-model. Used only for type: 'selectable'.
109
+ */
110
+ modelValue?: boolean;
111
+ /**
112
+ * If `true`, disables the tag, making it non-interactive. Applicable to selectable, interactive, and contextualised types.
113
+ */
114
+ disabled?: boolean;
115
+ /**
116
+ * A number displayed in the badge when the tag is contextualised.
117
+ */
118
+ contextualisedNumber?: number;
119
+ /**
120
+ * Accessible label text for the remove button in removable tags.
121
+ */
122
+ removableLabel?: string;
123
+ }>(),
124
+ {
125
+ type: 'informative',
126
+ contextualisedNumber: 99,
127
+ },
128
+ );
129
+
130
+ const classObject = computed(() => {
131
+ return {
132
+ [`mc-tag-${props.type}`]: props.type && props.type != 'informative',
133
+ [`mc-tag--${props.size}`]: props.size && props.size != 'm',
134
+ };
135
+ });
136
+
137
+ const emit = defineEmits<{
138
+ /**
139
+ * Emits when the tag value changes, updating the modelValue prop.
140
+ */
141
+ (on: 'update:modelValue', value: boolean): void;
142
+ /**
143
+ * Emits when the remove button of a tag is clicked, passing the tag's ID.
144
+ */
145
+ (on: 'remove-tag', id: string): void;
146
+ }>();
147
+ </script>
148
+
149
+ <style lang="scss" scoped>
150
+ @use '@mozaic-ds/styles/components/tag';
151
+ </style>
@@ -1,5 +1,5 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3';
2
- import { action } from '@storybook/addon-actions';
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { action } from 'storybook/actions';
3
3
 
4
4
  import MTextArea from './MTextArea.vue';
5
5
 
@@ -1,5 +1,5 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3';
2
- import { action } from '@storybook/addon-actions';
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { action } from 'storybook/actions';
3
3
 
4
4
  import MTextInput from './MTextInput.vue';
5
5
  import Search24 from '@mozaic-ds/icons-vue/src/components/Search24/Search24.vue';
@@ -19,13 +19,6 @@ const meta: Meta<typeof MTextInput> = {
19
19
  id: 'textInputId',
20
20
  placeholder: 'Placeholder',
21
21
  },
22
- argTypes: {
23
- $slots: {
24
- table: {
25
- disable: true,
26
- },
27
- },
28
- },
29
22
  render: (args) => ({
30
23
  components: { MTextInput, Search24 },
31
24
  setup() {
@@ -1,5 +1,5 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3';
2
- import { action } from '@storybook/addon-actions';
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { action } from 'storybook/actions';
3
3
 
4
4
  import MToggle from './MToggle.vue';
5
5
 
@@ -1,5 +1,5 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3';
2
- import { action } from '@storybook/addon-actions';
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import { action } from 'storybook/actions';
3
3
 
4
4
  import MToggleGroup from './MToggleGroup.vue';
5
5
 
@@ -1,5 +1,4 @@
1
- import { Meta } from '@storybook/blocks';
2
- import { Source } from '@storybook/addon-docs';
1
+ import { Meta, Source } from '@storybook/addon-docs/blocks';
3
2
 
4
3
  <Meta title="Using Icons" />
5
4
 
@@ -9,19 +8,11 @@ To use icons in Vue applications, you need to install a dedicated package.
9
8
 
10
9
  You must first install the [npm package](https://www.npmjs.com/package/@mozaic-ds/icons-vue):
11
10
 
12
- <Source
13
- language="bash"
14
- dark
15
- code="npm install @mozaic-ds/icons-vue"
16
- />
11
+ <Source language="bash" dark code="npm install @mozaic-ds/icons-vue" />
17
12
 
18
13
  Or with **Yarn**:
19
14
 
20
- <Source
21
- language="bash"
22
- dark
23
- code="yarn add @mozaic-ds/icons-vue"
24
- />
15
+ <Source language="bash" dark code="yarn add @mozaic-ds/icons-vue" />
25
16
 
26
17
  You can then start importing the icon of your choice into your Vue component:
27
18
 
@@ -36,8 +27,9 @@ You can then start importing the icon of your choice into your Vue component:
36
27
  </template>
37
28
 
38
29
  <script setup>
39
- import A11y20 from '@mozaic-ds/icons-vue/src/components/A11y20/A11y20.vue';
30
+ import A11y20 from '@mozaic-ds/icons-vue/src/components/A11y20/A11y20.vue';
40
31
  </script>
32
+
41
33
  `} />
42
34
 
43
35
  [The full list of icons is available here](https://github.com/adeo/mozaic-icons-vue/tree/main/src/components).