@mozaic-ds/vue 2.6.1 → 2.7.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/README.md +3 -3
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +105 -63
- package/dist/mozaic-vue.js +1137 -1082
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +1 -1
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +8 -6
- package/src/components/Contributing.mdx +1 -1
- package/src/components/GettingStarted.mdx +1 -1
- package/src/components/Introduction.mdx +1 -1
- package/src/components/Support.mdx +1 -1
- package/src/components/avatar/MAvatar.stories.ts +1 -0
- package/src/components/avatar/README.md +16 -0
- package/src/components/breadcrumb/README.md +11 -0
- package/src/components/button/MButton.stories.ts +1 -2
- package/src/components/button/MButton.vue +6 -1
- package/src/components/button/README.md +24 -0
- package/src/components/callout/MCallout.stories.ts +1 -0
- package/src/components/callout/README.md +19 -0
- package/src/components/checkbox/README.md +23 -0
- package/src/components/checkboxgroup/README.md +20 -0
- package/src/components/circularprogressbar/MCircularProgressbar.stories.ts +1 -0
- package/src/components/circularprogressbar/README.md +14 -0
- package/src/components/container/MContainer.stories.ts +8 -0
- package/src/components/container/MContainer.vue +1 -1
- package/src/components/container/README.md +16 -0
- package/src/components/datepicker/MDatepicker.stories.ts +1 -0
- package/src/components/datepicker/README.md +24 -0
- package/src/components/divider/MDivider.stories.ts +1 -0
- package/src/components/divider/README.md +18 -0
- package/src/components/drawer/MDrawer.spec.ts +28 -0
- package/src/components/drawer/MDrawer.stories.ts +1 -0
- package/src/components/drawer/MDrawer.vue +9 -2
- package/src/components/drawer/README.md +29 -0
- package/src/components/field/MField.vue +1 -1
- package/src/components/field/README.md +24 -0
- package/src/components/fieldgroup/README.md +22 -0
- package/src/components/flag/README.md +11 -0
- package/src/components/iconbutton/MIconButton.stories.ts +1 -0
- package/src/components/iconbutton/MIconButton.vue +1 -1
- package/src/components/iconbutton/README.md +21 -0
- package/src/components/linearprogressbarbuffer/MLinearProgressbarBuffer.stories.ts +1 -0
- package/src/components/linearprogressbarbuffer/README.md +11 -0
- package/src/components/linearprogressbarpercentage/MLinearProgressbarPercentage.stories.ts +1 -0
- package/src/components/linearprogressbarpercentage/README.md +10 -0
- package/src/components/link/MLink.vue +0 -2
- package/src/components/link/README.md +23 -0
- package/src/components/loader/MLoader.vue +1 -1
- package/src/components/loader/README.md +12 -0
- package/src/components/loadingoverlay/README.md +11 -0
- package/src/components/modal/README.md +28 -0
- package/src/components/numberbadge/README.md +12 -0
- package/src/components/overlay/README.md +17 -0
- package/src/components/pagination/README.md +20 -0
- package/src/components/passwordinput/README.md +25 -0
- package/src/components/pincode/MPincode.spec.ts +4 -1
- package/src/components/pincode/MPincode.stories.ts +1 -0
- package/src/components/pincode/MPincode.vue +5 -1
- package/src/components/pincode/README.md +22 -0
- package/src/components/quantityselector/README.md +27 -0
- package/src/components/radio/README.md +21 -0
- package/src/components/radiogroup/README.md +21 -0
- package/src/components/segmentedcontrol/MSegmentedControl.spec.ts +116 -0
- package/src/components/segmentedcontrol/MSegmentedControl.stories.ts +78 -0
- package/src/components/segmentedcontrol/MSegmentedControl.vue +92 -0
- package/src/components/segmentedcontrol/README.md +19 -0
- package/src/components/select/README.md +24 -0
- package/src/components/statusbadge/README.md +11 -0
- package/src/components/statusdot/MStatusDot.stories.ts +1 -0
- package/src/components/statusdot/README.md +11 -0
- package/src/components/statusnotification/README.md +25 -0
- package/src/components/tabs/MTabs.stories.ts +23 -1
- package/src/components/tabs/MTabs.vue +8 -0
- package/src/components/tabs/Mtabs.spec.ts +29 -8
- package/src/components/tabs/README.md +20 -0
- package/src/components/tag/README.md +25 -0
- package/src/components/textarea/README.md +25 -0
- package/src/components/textinput/README.md +32 -0
- package/src/components/toaster/MToaster.stories.ts +1 -0
- package/src/components/toaster/README.md +28 -0
- package/src/components/toggle/README.md +21 -0
- package/src/components/togglegroup/MToggleGroup.vue +1 -1
- package/src/components/togglegroup/README.md +20 -0
- package/src/components/tooltip/README.md +19 -0
- package/src/components/usingIcons.mdx +1 -1
- package/src/components/usingPresets.mdx +1 -1
- package/src/main.ts +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# MSegmentedControl
|
|
2
|
+
|
|
3
|
+
A Segmented Control allows users to switch between multiple options or views within a single container. It provides a compact and efficient way to toggle between sections without requiring a dropdown or separate navigation. Segmented Controls are commonly used in filters, tabbed navigation, and content selection to enhance user interaction and accessibility.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `modelValue` | The selected segment index, bound via v-model. | `number` | `0` |
|
|
11
|
+
| `full` | if `true`, the segmented control take the full width. | `boolean` | - |
|
|
12
|
+
| `size` | Determines the size of the segmented control. | `"s"` `"m"` | `"s"` |
|
|
13
|
+
| `segments*` | An array of objects that allows you to provide all the data needed to generate the content for each segment. | `{ label: string; }[]` | - |
|
|
14
|
+
|
|
15
|
+
## Events
|
|
16
|
+
|
|
17
|
+
| Name | Description | Type |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `update:modelValue` | Emits when the selected segment changes, updating the modelValue prop. | [value: number] |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# MSelect
|
|
2
|
+
|
|
3
|
+
A select component allows users to choose a single option from a predefined list within a native dropdown menu. It helps simplify input by displaying only relevant choices, reducing the need for manual text entry. Select components are commonly used in forms, settings, and filters where structured selection is required.<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#select).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the select, used to associate the label with the form element. | `string` | - |
|
|
11
|
+
| `name` | The name attribute for the select element, used for form submission. | `string` | - |
|
|
12
|
+
| `options*` | Define the available choices for the select element. | `{ id?: string` `undefined; text: string; value: string` `number; attributes?: Record<string` `string` `number` `boolean>` `undefined; disabled?: boolean` `undefined; }[]` | - |
|
|
13
|
+
| `modelValue` | The current value of the select. | `string` `number` | - |
|
|
14
|
+
| `placeholder` | Text displayed when the select has no selected value. | `string` | - |
|
|
15
|
+
| `isInvalid` | If `true`, the select is marked as invalid. | `boolean` | - |
|
|
16
|
+
| `disabled` | If `true`, the select is disabled and non-interactive. | `boolean` | - |
|
|
17
|
+
| `size` | Determines the size of the select. | `"s"` `"m"` | `"m"` |
|
|
18
|
+
| `readonly` | If `true`, the select is read-only (cannot be edited). | `boolean` | - |
|
|
19
|
+
|
|
20
|
+
## Events
|
|
21
|
+
|
|
22
|
+
| Name | Description | Type |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `update:modelValue` | Emits when the select value changes, updating the modelValue prop. | [value: string | number] |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# MStatusBadge
|
|
2
|
+
|
|
3
|
+
A Status Badge is used to indicate the current status of an element, providing a clear and concise visual cue. The status can change dynamically based on updates, events, or conditions within the system. Status Badges help users quickly identify the state of an item, such as an order status, system health, or process completion. They are often color-coded to enhance readability and recognition.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `label*` | Content of the status badge | `string` | - |
|
|
11
|
+
| `status` | Allows to define the status badge type | `"info"` `"success"` `"warning"` `"error"` `"neutral"` | `"info"` |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# MStatusDot
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `status` | Allows to define the status dot type. | `"info"` `"success"` `"warning"` `"error"` `"neutral"` | `"info"` |
|
|
11
|
+
| `size` | Determines the size of the status dot. | `"s"` `"m"` `"l"` | - |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# MStatusNotification
|
|
2
|
+
|
|
3
|
+
A Status Notification is used to draw the user’s attention to important information that needs to be acknowledged. It often provides feedback on a process, highlights a status update, or alerts users about an issue. Notifications are typically triggered by user actions or system events and are designed to be easily noticeable while maintaining a non-intrusive experience.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `title*` | Title of the status notification. | `string` | - |
|
|
11
|
+
| `description*` | Description of the status notification. | `string` | - |
|
|
12
|
+
| `status` | Allows to define the status notification type. | `"info"` `"success"` `"warning"` `"error"` | `"info"` |
|
|
13
|
+
| `closable` | if `true`, display the close button. | `boolean` | - |
|
|
14
|
+
|
|
15
|
+
## Slots
|
|
16
|
+
|
|
17
|
+
| Name | Description |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `footer` | Use this slot to insert a button or a link in the footer |
|
|
20
|
+
|
|
21
|
+
## Events
|
|
22
|
+
|
|
23
|
+
| Name | Description | Type |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `close` | Emits when closing the notification. | [] |
|
|
@@ -39,7 +39,7 @@ const meta: Meta<typeof Mtabs> = {
|
|
|
39
39
|
return { args, handleUpdate };
|
|
40
40
|
},
|
|
41
41
|
template: `
|
|
42
|
-
<Mtabs
|
|
42
|
+
<Mtabs
|
|
43
43
|
v-bind="args"
|
|
44
44
|
@update:modelValue="handleUpdate"
|
|
45
45
|
></Mtabs>
|
|
@@ -102,3 +102,25 @@ export const Disabled: Story = {
|
|
|
102
102
|
],
|
|
103
103
|
},
|
|
104
104
|
};
|
|
105
|
+
|
|
106
|
+
export const WithBadges: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
tabs: [
|
|
109
|
+
{
|
|
110
|
+
label: 'Label',
|
|
111
|
+
badge: 3,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
label: 'Label',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
label: 'Label',
|
|
118
|
+
badge: 99,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: 'Label',
|
|
122
|
+
badge: 100,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
};
|
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
<div class="mc-tabs__label">
|
|
26
26
|
<span>{{ tab.label }}</span>
|
|
27
27
|
</div>
|
|
28
|
+
<span v-if="tab.badge" class="mc-tabs__badge">
|
|
29
|
+
<MNumberBadge :label="tab.badge" />
|
|
30
|
+
</span>
|
|
28
31
|
</button>
|
|
29
32
|
</li>
|
|
30
33
|
</ul>
|
|
@@ -35,6 +38,7 @@
|
|
|
35
38
|
<script setup lang="ts">
|
|
36
39
|
import { computed, ref, type Component } from 'vue';
|
|
37
40
|
import MDivider from '../divider/MDivider.vue';
|
|
41
|
+
import MNumberBadge from '../numberbadge/MNumberBadge.vue';
|
|
38
42
|
/**
|
|
39
43
|
* 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
44
|
*/
|
|
@@ -64,6 +68,10 @@ const props = withDefaults(
|
|
|
64
68
|
* The icon displayed for the tab from Mozaic-icon-vue.
|
|
65
69
|
*/
|
|
66
70
|
icon?: Component;
|
|
71
|
+
/**
|
|
72
|
+
* The number badge displayed for the tab.
|
|
73
|
+
*/
|
|
74
|
+
badge?: number;
|
|
67
75
|
/**
|
|
68
76
|
* The label displayed for the tab.
|
|
69
77
|
*/
|
|
@@ -119,14 +119,16 @@ describe('MTabs.vue', () => {
|
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
it('renders icon component when icon prop is provided', () => {
|
|
122
|
-
const DummyIcon = markRaw(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
h('
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
122
|
+
const DummyIcon = markRaw(
|
|
123
|
+
defineComponent({
|
|
124
|
+
name: 'DummyIcon',
|
|
125
|
+
render() {
|
|
126
|
+
return h('svg', { class: 'dummy-icon' }, [
|
|
127
|
+
h('circle', { cx: 10, cy: 10, r: 10 }),
|
|
128
|
+
]);
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
131
|
+
);
|
|
130
132
|
|
|
131
133
|
const tabsWithIcon = [
|
|
132
134
|
{ label: 'Tab 1', icon: DummyIcon },
|
|
@@ -146,4 +148,23 @@ describe('MTabs.vue', () => {
|
|
|
146
148
|
const secondTabButton = wrapper.findAll('button.mc-tabs__tab')[1];
|
|
147
149
|
expect(secondTabButton.findComponent(DummyIcon).exists()).toBe(false);
|
|
148
150
|
});
|
|
151
|
+
|
|
152
|
+
it('renders badge when badge prop is provided', () => {
|
|
153
|
+
const tabsWithBadges = [{ label: 'Tab 1', badge: 5 }, { label: 'Tab 2' }];
|
|
154
|
+
|
|
155
|
+
const wrapper = mount(MTabs, {
|
|
156
|
+
props: {
|
|
157
|
+
tabs: tabsWithBadges,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const firstTabButton = wrapper.findAll('button.mc-tabs__tab')[0];
|
|
162
|
+
expect(firstTabButton.find('span.mc-tabs__badge').exists()).toBe(true);
|
|
163
|
+
expect(
|
|
164
|
+
firstTabButton.find('span.mc-tabs__badge .mc-number-badge').text(),
|
|
165
|
+
).toBe('5');
|
|
166
|
+
|
|
167
|
+
const secondTabButton = wrapper.findAll('button.mc-tabs__tab')[1];
|
|
168
|
+
expect(secondTabButton.find('span.mc-tabs__badge').exists()).toBe(false);
|
|
169
|
+
});
|
|
149
170
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MTabs
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `description` | A description indicating the purpose of the set of tabs. Useful for improving the accessibility of the component. | `string` | - |
|
|
11
|
+
| `divider` | If `true`, the divider will appear. | `boolean` | `true` |
|
|
12
|
+
| `centered` | If `true`, the tabs of the component will be centered. | `boolean` | - |
|
|
13
|
+
| `modelValue` | The selected tab index, bound via v-model. | `number` | `0` |
|
|
14
|
+
| `tabs*` | An array of objects that allows you to provide all the data needed to generate the content for each tab. | `{ icon?: Component` `undefined; badge?: number` `undefined; label: string; disabled?: boolean` `undefined; }[]` | - |
|
|
15
|
+
|
|
16
|
+
## Events
|
|
17
|
+
|
|
18
|
+
| Name | Description | Type |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| `update:modelValue` | Emits when the selected tab changes, updating the modelValue prop. | [value: number] |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# MTag
|
|
2
|
+
|
|
3
|
+
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).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `type` | Defines the behavior and layout of the tag. | `"informative"` `"interactive"` `"contextualised"` `"removable"` `"selectable"` | `"informative"` |
|
|
11
|
+
| `size` | Determines the size of the tag. | `"s"` `"m"` `"l"` | - |
|
|
12
|
+
| `id` | A unique identifier for the tag, used to associate the label with the form element. **Required** when type is 'selectable' or 'removable'. | `string` | - |
|
|
13
|
+
| `name` | The name attribute for the tag element, typically used for form submission. (only relevant for type: 'selectable'). | `string` | - |
|
|
14
|
+
| `label*` | The text label displayed next to the tag. | `string` | - |
|
|
15
|
+
| `modelValue` | The tag's checked state, bound via v-model. Used only for type: 'selectable'. | `boolean` | - |
|
|
16
|
+
| `disabled` | If `true`, disables the tag, making it non-interactive. Applicable to selectable, interactive, and contextualised types. | `boolean` | - |
|
|
17
|
+
| `contextualisedNumber` | A number displayed in the badge when the tag is contextualised. | `number` | `99` |
|
|
18
|
+
| `removableLabel` | Accessible label text for the remove button in removable tags. | `string` | - |
|
|
19
|
+
|
|
20
|
+
## Events
|
|
21
|
+
|
|
22
|
+
| Name | Description | Type |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `update:modelValue` | Emits when the tag value changes, updating the modelValue prop. | [value: boolean] |
|
|
25
|
+
| `remove-tag` | Emits when the remove button of a tag is clicked, passing the tag's ID. | [id: string] |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# MTextArea
|
|
2
|
+
|
|
3
|
+
A text area is an input designed for multi-line text entry, allowing users to input longer content compared to a standard text input. It is commonly used for comments, feedback, descriptions, and messaging. Text areas can be resizable or fixed in height, depending on the context, and often include placeholder text, character limits, and validation messages to guide users.<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#textarea).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the textarea, used to associate the label with the form element. | `string` | - |
|
|
11
|
+
| `name` | The name attribute for the textarea element, used for form submission. | `string` | - |
|
|
12
|
+
| `modelValue` | The current value of the textarea field. | `string` `number` | - |
|
|
13
|
+
| `placeholder` | Text displayed when the textarea is empty. | `string` | - |
|
|
14
|
+
| `isInvalid` | If `true`, the textarea is marked as invalid. | `boolean` | - |
|
|
15
|
+
| `disabled` | If `true`, the textarea is disabled and non-interactive. | `boolean` | - |
|
|
16
|
+
| `rows` | The number of visible text lines in the textarea. | `number` | `2` |
|
|
17
|
+
| `minLength` | Minimum number of characters required for the textarea. | `number` | - |
|
|
18
|
+
| `maxLength` | Maximum number of characters allowed in the textarea. | `number` | - |
|
|
19
|
+
| `readonly` | If `true`, the textarea is read-only (cannot be edited). | `boolean` | - |
|
|
20
|
+
|
|
21
|
+
## Events
|
|
22
|
+
|
|
23
|
+
| Name | Description | Type |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `update:modelValue` | Emits when the textarea value changes, updating the modelValue prop. | [value: string | number] |
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# MTextInput
|
|
2
|
+
|
|
3
|
+
A text input is a single-line input that allows users to enter and edit short text-based content. It is commonly used for names, email addresses, search queries, and form entries. Text Inputs often include placeholders, validation rules, and assistive text to guide users and ensure accurate data entry.<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).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the input element, used to associate the label with the form element. | `string` | - |
|
|
11
|
+
| `name` | The name attribute for the input element, typically used for form submission. | `string` | - |
|
|
12
|
+
| `modelValue` | The current value of the input field. | `string` `number` | - |
|
|
13
|
+
| `placeholder` | A placeholder text to show in the input when it is empty. | `string` | - |
|
|
14
|
+
| `inputType` | Defines the type of input. | `"number"` `"text"` `"date"` `"email"` `"password"` `"search"` `"tel"` | `"text"` |
|
|
15
|
+
| `isInvalid` | If `true`, applies an invalid state to the input. | `boolean` | - |
|
|
16
|
+
| `disabled` | If `true`, disables the input, making it non-interactive. | `boolean` | - |
|
|
17
|
+
| `size` | Determines the size of the input. | `"s"` `"m"` | `"m"` |
|
|
18
|
+
| `readonly` | If `true`, the input is read-only (cannot be edited). | `boolean` | - |
|
|
19
|
+
| `isClearable` | If `true`, a clear button will appear when the input has a value. | `boolean` | - |
|
|
20
|
+
| `clearLabel` | The label text for the clear button. | `string` | `"clear content"` |
|
|
21
|
+
|
|
22
|
+
## Slots
|
|
23
|
+
|
|
24
|
+
| Name | Description |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| `icon` | Use this slot to insert an icon in the input. |
|
|
27
|
+
|
|
28
|
+
## Events
|
|
29
|
+
|
|
30
|
+
| Name | Description | Type |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| `update:modelValue` | Emits when the input value changes, updating the `modelValue` prop. | [value: string | number] |
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# MToaster
|
|
2
|
+
|
|
3
|
+
A toaster is a temporary notification that appears briefly on the screen to provide feedback or updates without interrupting the user’s workflow. It is commonly used for success messages, warnings, errors, or informational updates. Toasters can disappear automatically after a few seconds, be dismissed manually via a close button, or be removed when the user performs a relevant action. They typically include an icon, a short message, and an optional close button for better usability.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `open` | If `true`, display the Toaster. | `boolean` | - |
|
|
11
|
+
| `position` | Position of the toaster. | `"top"` `"bottom"` `"top-center"` `"bottom-center"` | - |
|
|
12
|
+
| `description*` | Description of the toaster. | `string` | - |
|
|
13
|
+
| `status` | Allows to define the toaster style. | `"info"` `"success"` `"warning"` `"error"` | `"info"` |
|
|
14
|
+
| `closable` | If `true`, display the close button. | `boolean` | `true` |
|
|
15
|
+
| `progress` | If `true`, display the progress bar of the duration. | `boolean` | - |
|
|
16
|
+
| `timeout` | Duration of the toaster | `number` | - |
|
|
17
|
+
|
|
18
|
+
## Slots
|
|
19
|
+
|
|
20
|
+
| Name | Description |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `action` | Use this slot to insert a button or a link in the toaster |
|
|
23
|
+
|
|
24
|
+
## Events
|
|
25
|
+
|
|
26
|
+
| Name | Description | Type |
|
|
27
|
+
| --- | --- | --- |
|
|
28
|
+
| `update:open` | Emits when the checkbox value changes, updating the modelValue prop. | [value: boolean] |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MToggle
|
|
2
|
+
|
|
3
|
+
A toggle is a switch component that allows users to enable or disable a setting, representing a binary state such as on/off or active/inactive. It provides a quick and intuitive way to control preferences or system settings. Toggles are commonly used in settings menus, dark mode switches, and feature activations, offering an alternative to checkboxes for immediate visual feedback.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the toggle, used to associate the label with the form element. | `string` | - |
|
|
11
|
+
| `name` | The name attribute for the toggle element, typically used for form submission. | `string` | - |
|
|
12
|
+
| `label` | The text label displayed next to the toggle. | `string` | - |
|
|
13
|
+
| `modelValue` | The toggle's checked state, bound via v-model. | `boolean` | - |
|
|
14
|
+
| `size` | Determines the size of the toggle. | `"s"` `"m"` | `"s"` |
|
|
15
|
+
| `disabled` | If `true`, disables the toggle, making it non-interactive. | `boolean` | - |
|
|
16
|
+
|
|
17
|
+
## Events
|
|
18
|
+
|
|
19
|
+
| Name | Description | Type |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| `update:modelValue` | Emits when the toggle value changes, updating the modelValue prop. | [value: boolean] |
|
|
@@ -20,7 +20,7 @@ import { computed, ref, watch } from 'vue';
|
|
|
20
20
|
import MToggle from '../toggle/MToggle.vue';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* A toggle is a switch component that allows users to enable or disable a setting, representing a binary state such as on/off or active/inactive. It provides a quick and intuitive way to control preferences or system settings. Toggles are commonly used in settings menus, dark mode switches, and feature activations, offering an alternative to checkboxes for immediate visual feedback.<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 Group section](/docs/form-elements-field-group--docs#toggle-group).
|
|
23
|
+
* A toggle is a switch component that allows users to enable or disable a setting, representing a binary state such as on/off or active/inactive. It provides a quick and intuitive way to control preferences or system settings. Toggles are commonly used in settings menus, dark mode switches, and feature activations, offering an alternative to checkboxes for immediate visual feedback.<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 Group section](/docs/form-elements-field-group--docs#toggle-group).
|
|
24
24
|
*/
|
|
25
25
|
const props = defineProps<{
|
|
26
26
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MToggleGroup
|
|
2
|
+
|
|
3
|
+
A toggle is a switch component that allows users to enable or disable a setting, representing a binary state such as on/off or active/inactive. It provides a quick and intuitive way to control preferences or system settings. Toggles are commonly used in settings menus, dark mode switches, and feature activations, offering an alternative to checkboxes for immediate visual feedback.<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 Group section](/docs/form-elements-field-group--docs#toggle-group).
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `name*` | The name attribute for the toggle element, typically used for form submission. | `string` | - |
|
|
11
|
+
| `modelValue` | Property used to manage the values checked by v-model
|
|
12
|
+
(Do not use directly) | `string[]` | - |
|
|
13
|
+
| `options*` | List of properties of each toggle of the toggle group. | `{ id: string; label: string; value: string; disabled?: boolean` `undefined; isInvalid?: boolean` `undefined; size?: "s"` `"m"` `undefined; }[]` | - |
|
|
14
|
+
| `inline` | If `true`, make the form element of the group inline. | `boolean` | - |
|
|
15
|
+
|
|
16
|
+
## Events
|
|
17
|
+
|
|
18
|
+
| Name | Description | Type |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| `update:modelValue` | Emits when the toggle group value changes, updating the modelValue prop. | [value: Array<string>] |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# MTooltip
|
|
2
|
+
|
|
3
|
+
A tooltip is a small, contextual message that appears when users hover over, focus on, or tap an element, providing additional information or guidance without cluttering the interface. Tooltips are commonly used to explain icons, abbreviations, or complex actions. They typically disappear automatically when the user moves away from the trigger element.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the tooltip, used to describe the tooltip. | `string` | - |
|
|
11
|
+
| `text*` | Content of the tooltip. | `string` | - |
|
|
12
|
+
| `position` | Determines the position of the tooltip. | `"left"` `"right"` `"top"` `"bottom"` | `"top"` |
|
|
13
|
+
| `pointer` | If `true`, the tooltip display a pointer. | `boolean` | `true` |
|
|
14
|
+
|
|
15
|
+
## Slots
|
|
16
|
+
|
|
17
|
+
| Name | Description |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `default` | The tooltip will point to the content of the slot. |
|
package/src/main.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { default as MPincode } from './components/pincode/MPincode.vue';
|
|
|
27
27
|
export { default as MQuantitySelector } from './components/quantityselector/MQuantitySelector.vue';
|
|
28
28
|
export { default as MRadio } from './components/radio/MRadio.vue';
|
|
29
29
|
export { default as MRadioGroup } from './components/radiogroup/MRadioGroup.vue';
|
|
30
|
+
export { default as MSegmentedControl } from './components/segmentedcontrol/MSegmentedControl.vue';
|
|
30
31
|
export { default as MSelect } from './components/select/MSelect.vue';
|
|
31
32
|
export { default as MStatusBadge } from './components/statusbadge/MStatusBadge.vue';
|
|
32
33
|
export { default as MStatusDot } from './components/statusdot/MStatusDot.vue';
|