@mozaic-ds/vue 2.1.0 → 2.3.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.
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <div class="tooltip-story-wrapper">
3
+ <div class="mc-tooltip" :class="classObject" :aria-describedby="id">
4
+ <slot />
5
+ <span :id="id" class="mc-tooltip__content" role="tooltip">
6
+ {{ text }}
7
+ </span>
8
+ </div>
9
+ </div>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ import { computed } from 'vue';
14
+ /**
15
+ * 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.
16
+ */
17
+ const props = withDefaults(
18
+ defineProps<{
19
+ /**
20
+ * A unique identifier for the tooltip, used to describe the tooltip.
21
+ */
22
+ id: string;
23
+ /**
24
+ * Content of the tooltip
25
+ */
26
+ text: string;
27
+ /**
28
+ * Determines the position of the tooltip
29
+ */
30
+ position?: 'top' | 'bottom' | 'left' | 'right';
31
+ /**
32
+ * if `true`, the tooltip display a pointer.
33
+ */
34
+ pointer?: boolean;
35
+ }>(),
36
+ {
37
+ position: 'top',
38
+ pointer: true,
39
+ },
40
+ );
41
+
42
+ defineSlots<{
43
+ /**
44
+ * The tooltip will point to the content of the slot.
45
+ */
46
+ default: string;
47
+ }>();
48
+
49
+ const classObject = computed(() => {
50
+ return {
51
+ [`mc-tooltip--${props.position}`]: props.position,
52
+ 'mc-tooltip--no-pointer': !props.pointer,
53
+ };
54
+ });
55
+ </script>
56
+
57
+ <style lang="scss" scoped>
58
+ @use '@mozaic-ds/styles/components/tooltip';
59
+ </style>
package/src/main.ts CHANGED
@@ -2,6 +2,7 @@ export { default as MBreadcrumb } from './components/breadcrumb/MBreadcrumb.vue'
2
2
  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
+ export { default as MCircularProgressbar } from './components/circularprogressbar/MCircularProgressbar.vue';
5
6
  export { default as MDatepicker } from './components/datepicker/MDatepicker.vue';
6
7
  export { default as MDivider } from './components/divider/MDivider.vue';
7
8
  export { default as MDrawer } from './components/drawer/MDrawer.vue';
@@ -18,6 +19,8 @@ export { default as MOverlay } from './components/overlay/MOverlay.vue';
18
19
  export { default as MPagination } from './components/pagination/MPagination.vue';
19
20
  export { default as MPasswordInput } from './components/passwordinput/MPasswordInput.vue';
20
21
  export { default as MPincode } from './components/pincode/MPincode.vue';
22
+ export { default as MLinearProgressbarBuffer } from './components/linearprogressbarbuffer/MLinearProgressbarBuffer.vue';
23
+ export { default as MLinearProgressbarPercentage } from './components/linearprogressbarpercentage/MLinearProgressbarPercentage.vue';
21
24
  export { default as MQuantitySelector } from './components/quantityselector/MQuantitySelector.vue';
22
25
  export { default as MRadio } from './components/radio/MRadio.vue';
23
26
  export { default as MRadioGroup } from './components/radiogroup/MRadioGroup.vue';
@@ -29,4 +32,5 @@ export { default as MTag } from './components/tag/MTag.vue';
29
32
  export { default as MTextArea } from './components/textarea/MTextArea.vue';
30
33
  export { default as MTextInput } from './components/textinput/MTextInput.vue';
31
34
  export { default as MToggle } from './components/toggle/MToggle.vue';
35
+ export { default as MTooltip } from './components/tooltip/MTooltip.vue';
32
36
  export { default as MToggleGroup } from './components/togglegroup/MToggleGroup.vue';