@mozaic-ds/vue 2.3.0 → 2.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozaic-ds/vue",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "type": "module",
5
5
  "description": "Mozaic-Vue is the Vue.js implementation of ADEO Design system",
6
6
  "author": "ADEO - ADEO Design system",
@@ -40,7 +40,7 @@
40
40
  "*.d.ts"
41
41
  ],
42
42
  "dependencies": {
43
- "@mozaic-ds/styles": "2.0.0-beta.0",
43
+ "@mozaic-ds/styles": "2.0.0-beta.3",
44
44
  "@mozaic-ds/web-fonts": "1.65.0",
45
45
  "postcss-scss": "^4.0.9",
46
46
  "vue": "^3.5.13"
@@ -0,0 +1,44 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { mount } from '@vue/test-utils';
3
+ import MlContainer from './MContainer.vue';
4
+
5
+ describe('MlContainer.vue', () => {
6
+ it('renders default container without fluid class', () => {
7
+ const wrapper = mount(MlContainer);
8
+ const container = wrapper.get('.ml-container');
9
+
10
+ expect(container.classes()).not.toContain('ml-container--fluid');
11
+ });
12
+
13
+ it('adds fluid class when fluid prop is true', () => {
14
+ const wrapper = mount(MlContainer, {
15
+ props: {
16
+ fluid: true,
17
+ },
18
+ });
19
+
20
+ const container = wrapper.get('.ml-container');
21
+ expect(container.classes()).toContain('ml-container--fluid');
22
+ });
23
+
24
+ it('does not add fluid class when fluid prop is false', () => {
25
+ const wrapper = mount(MlContainer, {
26
+ props: {
27
+ fluid: false,
28
+ },
29
+ });
30
+
31
+ const container = wrapper.get('.ml-container');
32
+ expect(container.classes()).not.toContain('ml-container--fluid');
33
+ });
34
+
35
+ it('renders slot content', () => {
36
+ const wrapper = mount(MlContainer, {
37
+ slots: {
38
+ default: '<p>Test content</p>',
39
+ },
40
+ });
41
+
42
+ expect(wrapper.html()).toContain('Test content');
43
+ });
44
+ });
@@ -0,0 +1,32 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import MContainer from './MContainer.vue';
3
+
4
+ const meta: Meta<typeof MContainer> = {
5
+ title: 'Foundations/Container',
6
+ component: MContainer,
7
+ args: {
8
+ default: `<h1>Container</h1>`
9
+ },
10
+ render: (args) => ({
11
+ components: { MContainer },
12
+ setup() {
13
+ return { args };
14
+ },
15
+ template: `
16
+ <MContainer v-bind="args">
17
+ <template v-if="${'default' in args}" v-slot>${args.default}</template>
18
+ </MContainer>
19
+ `,
20
+ }),
21
+ };
22
+ export default meta;
23
+ type Story = StoryObj<typeof MContainer>;
24
+
25
+ export const Standard: Story = {};
26
+
27
+ export const Fluid: Story = {
28
+ args: {
29
+ fluid: true,
30
+ default: `<h1>Fluid Container</h1>`
31
+ },
32
+ };
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <div class="ml-container" :class="classObject">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { computed } from 'vue';
9
+ /**
10
+ * A Divider serves as a visual divider to separate content, providing a clear distinction between sections.
11
+ */
12
+ const props = defineProps<{
13
+ /**
14
+ * Determines the orientation of the divider
15
+ */
16
+ fluid?: boolean;
17
+ }>();
18
+
19
+ const classObject = computed(() => {
20
+ return {
21
+ 'ml-container--fluid': props.fluid,
22
+ };
23
+ });
24
+ </script>
25
+
26
+ <style lang="scss" scoped>
27
+ @use '@mozaic-ds/styles/layouts/container';
28
+ </style>
@@ -7,7 +7,7 @@
7
7
  <input
8
8
  :id="id"
9
9
  class="mc-text-input__control"
10
- :value="modelValue"
10
+ v-model="modelValue"
11
11
  :type="inputType"
12
12
  :name="name"
13
13
  :placeholder="placeholder"
package/src/main.ts CHANGED
@@ -3,6 +3,7 @@ export { default as MButton } from './components/button/MButton.vue';
3
3
  export { default as MCheckbox } from './components/checkbox/MCheckbox.vue';
4
4
  export { default as MCheckboxGroup } from './components/checkboxgroup/MCheckboxGroup.vue';
5
5
  export { default as MCircularProgressbar } from './components/circularprogressbar/MCircularProgressbar.vue';
6
+ export { default as MContainer } from './components/container/MContainer.vue';
6
7
  export { default as MDatepicker } from './components/datepicker/MDatepicker.vue';
7
8
  export { default as MDivider } from './components/divider/MDivider.vue';
8
9
  export { default as MDrawer } from './components/drawer/MDrawer.vue';