@weni/unnnic-system 2.18.0 → 2.18.1

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": "@weni/unnnic-system",
3
- "version": "2.18.0",
3
+ "version": "2.18.1",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -87,4 +87,4 @@
87
87
  "vitest": "^1.6.0",
88
88
  "vue-eslint-parser": "^9.4.2"
89
89
  }
90
- }
90
+ }
@@ -15,8 +15,13 @@
15
15
  :style="{ maxWidth: maxWidth, left: leftPos, top: topPos }"
16
16
  data-testid="tooltip-label"
17
17
  >
18
+ <template v-if="enableHtml">
19
+ <!-- eslint-disable-next-line vue/no-v-html -->
20
+ <section v-html="text"></section>
21
+ </template>
18
22
  <template
19
23
  v-for="(line, index) in text.split('\n')"
24
+ v-else
20
25
  :key="index"
21
26
  >
22
27
  {{ line }}
@@ -60,11 +65,16 @@ export default {
60
65
  },
61
66
  maxWidth: {
62
67
  type: String,
68
+ default: '',
63
69
  },
64
70
  shortcutText: {
65
71
  type: String,
66
72
  default: null,
67
73
  },
74
+ enableHtml: {
75
+ type: Boolean,
76
+ default: false,
77
+ },
68
78
  },
69
79
  data() {
70
80
  return {
@@ -92,4 +92,13 @@ describe('ToolTip', () => {
92
92
  await wrapper.trigger('mouseover');
93
93
  expect(handlResizeSpy).toHaveBeenCalled();
94
94
  });
95
+
96
+ it('should render html link variation', async () => {
97
+ await wrapper.setProps({
98
+ enableHtml: true,
99
+ text: 'tooltip with <a data-testid="weni-link" href="https://weni.ai/" target="_blank" style="color: white;">weni</a> link',
100
+ });
101
+ const link = wrapper.find('a[data-testid="weni-link"]');
102
+ expect(link.exists()).toBeTruthy();
103
+ });
95
104
  });
@@ -11,6 +11,7 @@ export default {
11
11
  },
12
12
  maxWidth: { control: { type: 'text' } },
13
13
  forceOpen: { control: { type: 'boolean' } },
14
+ enableHtml: { control: { type: 'boolean' } },
14
15
  },
15
16
  render: (args) => ({
16
17
  components: {
@@ -33,3 +34,13 @@ export const Normal = {
33
34
  side: 'bottom',
34
35
  },
35
36
  };
37
+
38
+ export const withLink = {
39
+ args: {
40
+ text: 'tooltip with <a href="https://weni.ai/" target="_blank" style="color: white;">weni</a> link',
41
+ enabled: true,
42
+ maxWidth: `${15 * unnnicFontSize}px`,
43
+ side: 'right',
44
+ enableHtml: true,
45
+ },
46
+ };