@volverjs/ui-vue 0.0.2 → 0.0.3-beta.2

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 (53) hide show
  1. package/auto-imports.d.ts +289 -0
  2. package/dist/components/VvTextarea/VvTextarea.es.js +231 -275
  3. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  4. package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
  5. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
  6. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
  7. package/dist/components/VvTooltip/index.d.ts +18 -0
  8. package/dist/components/index.es.js +874 -874
  9. package/dist/components/index.umd.js +1 -1
  10. package/dist/icons.es.js +3 -3
  11. package/dist/icons.umd.js +1 -1
  12. package/dist/index.es.js +554 -554
  13. package/dist/index.umd.js +1 -1
  14. package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
  15. package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
  16. package/package.json +27 -20
  17. package/src/assets/icons/detailed.json +1 -1
  18. package/src/assets/icons/normal.json +1 -1
  19. package/src/assets/icons/simple.json +1 -1
  20. package/src/components/VvTextarea/VvTextarea.vue +1 -15
  21. package/src/components/VvTooltip/VvTooltip.vue +17 -0
  22. package/src/components/VvTooltip/index.ts +21 -0
  23. package/src/stories/Accordion/Accordion.stories.mdx +1 -1
  24. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
  25. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  26. package/src/stories/Badge/Badge.stories.mdx +1 -1
  27. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
  28. package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
  29. package/src/stories/Button/Button.stories.mdx +1 -1
  30. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  31. package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
  32. package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
  33. package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
  34. package/src/stories/Card/Card.stories.mdx +1 -1
  35. package/src/stories/Card/CardSlots.stories.mdx +1 -1
  36. package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
  37. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
  38. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
  39. package/src/stories/Combobox/Combobox.stories.mdx +1 -1
  40. package/src/stories/Dialog/Dialog.stories.mdx +1 -1
  41. package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
  42. package/src/stories/Icon/Icon.stories.mdx +1 -1
  43. package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
  44. package/src/stories/InputText/InputText.stories.mdx +1 -1
  45. package/src/stories/Progress/Progress.stories.mdx +1 -1
  46. package/src/stories/Radio/Radio.stories.mdx +1 -1
  47. package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
  48. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
  49. package/src/stories/Select/Select.stories.mdx +1 -1
  50. package/src/stories/Textarea/Textarea.stories.mdx +1 -1
  51. package/src/stories/Tooltip/Tooltip.settings.ts +26 -0
  52. package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
  53. package/src/stories/Tooltip/Tooltip.test.ts +49 -0
@@ -5,25 +5,11 @@
5
5
  </script>
6
6
 
7
7
  <script setup lang="ts">
8
- import {
9
- computed,
10
- useSlots,
11
- ref,
12
- toRefs,
13
- watch,
14
- type TextareaHTMLAttributes,
15
- } from 'vue'
8
+ import type { TextareaHTMLAttributes } from 'vue'
16
9
  import { nanoid } from 'nanoid'
17
- import { isEmpty } from '@/utils/ObjectUtilities'
18
10
  import HintSlotFactory from '@/components/common/HintSlot'
19
- import { useComponentIcon } from '@/composables/useComponentIcons'
20
- import { useComponentFocus } from '@/composables/useComponentFocus'
21
- import { useDebouncedInput } from '@/composables/useDebouncedInput'
22
- import { useTextCount } from '@/composables/useTextCount'
23
- import { useBemModifiers } from '@/composables/useModifiers'
24
11
  import VvIcon from '@/components/VvIcon/VvIcon.vue'
25
12
  import { VvTextareaProps, VvTextareaEvents } from '@/components/VvTextarea'
26
- import { useElementVisibility } from '@vueuse/core'
27
13
 
28
14
  // props, emit and slots
29
15
  const props = defineProps(VvTextareaProps)
@@ -0,0 +1,17 @@
1
+ <script setup lang="ts">
2
+ import { VvTooltipProps } from '@/components/VvTooltip'
3
+
4
+ const props = defineProps(VvTooltipProps)
5
+ const { modifiers } = toRefs(props)
6
+
7
+ // styles
8
+ const { bemCssClasses: tooltipClass } = useBemModifiers('vv-tooltip', {
9
+ modifiers
10
+ })
11
+ </script>
12
+
13
+ <template>
14
+ <span :class="[tooltipClass, `vv-tooltip--${props.position}`]" role="tooltip" inert>
15
+ <slot />
16
+ </span>
17
+ </template>
@@ -0,0 +1,21 @@
1
+ import { ModifiersProps } from '@/props'
2
+ import type { PropType } from 'vue'
3
+
4
+ export enum TooltipPosition {
5
+ left = 'left',
6
+ right = 'right',
7
+ top = 'top',
8
+ bottom = 'bottom'
9
+ }
10
+
11
+ export const VvTooltipProps = {
12
+ ...ModifiersProps,
13
+ /**
14
+ * Define the tooltip position
15
+ * @default TooltipPosition.bottom
16
+ */
17
+ position: {
18
+ type: String as PropType<TooltipPosition>,
19
+ default: TooltipPosition.bottom
20
+ }
21
+ }
@@ -21,7 +21,7 @@ export const Template = (args, { argTypes }) => ({
21
21
  setup() {
22
22
  return { args }
23
23
  },
24
- template: `<vv-accordion data-testId="element" v-bind="args" v-model="open">
24
+ template: /*html*/`<vv-accordion data-testId="element" v-bind="args" v-model="open">
25
25
  <template #summary v-if="args.summary"><div v-html="args.summary"></div></template>
26
26
  <template #details v-if="args.details"><div v-html="args.details"></div></template>
27
27
  </vv-accordion>
@@ -21,7 +21,7 @@ export const Template = (args, { argTypes }) => ({
21
21
  selected: null,
22
22
  }
23
23
  },
24
- template: `<vv-accordion-group data-testId="element" v-bind="args" v-model="selected" />
24
+ template: /*html*/`<vv-accordion-group data-testId="element" v-bind="args" v-model="selected" />
25
25
  <div class="mt-24">
26
26
  Selected: <span data-testId="value">{{ selected }}</span>
27
27
  </div>`,
@@ -42,7 +42,7 @@ import { defaultArgs, argTypes } from './AccordionGroup.settings'
42
42
  'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean turpis diam, tempor non sem ut, suscipit gravida mi.',
43
43
  }
44
44
  },
45
- template: `<vv-accordion-group data-testId="element" v-bind="args" v-model="selected">
45
+ template: /*html*/`<vv-accordion-group data-testId="element" v-bind="args" v-model="selected">
46
46
  <vv-accordion name="a-1" data-testId="a-1" title="Details 1" :content="content" />
47
47
  <vv-accordion name="a-2" title="Details 2" :content="content" />
48
48
  <vv-accordion name="a-3" title="Details 3" :content="content" />
@@ -16,7 +16,7 @@ export const Template = (args, { argTypes }) => ({
16
16
  setup() {
17
17
  return { args }
18
18
  },
19
- template: `<vv-badge v-bind="args">
19
+ template: /*html*/`<vv-badge v-bind="args">
20
20
  <template #default v-if="args.default"><span v-html="args.default"></span></template>
21
21
  </vv-badge>`,
22
22
  })
@@ -15,7 +15,7 @@ export const Template = (args) => ({
15
15
  setup() {
16
16
  return { args }
17
17
  },
18
- template: `<div class="bg-surface p-lg">
18
+ template: /*html*/`<div class="bg-surface p-lg">
19
19
  <vv-breadcrumb v-bind="args" />
20
20
  </div>`,
21
21
  })
@@ -29,7 +29,7 @@ import { defaultArgs, argTypes } from './Breadcrumb.settings'
29
29
  return { args }
30
30
  },
31
31
  components: { VvBreadcrumb, VvIcon },
32
- template: `
32
+ template: /*html*/`
33
33
  <VvBreadcrumb v-bind="args">
34
34
  <template #label="{route, index}">
35
35
  <VvIcon v-if="index === 0" name="home" :aria-label="route.label" />
@@ -18,7 +18,7 @@ export const Template = (args) => ({
18
18
  setup() {
19
19
  return { args }
20
20
  },
21
- template: `<vv-button v-bind="args" v-model="value" name="my-button">
21
+ template: /*html*/`<vv-button v-bind="args" v-model="value" name="my-button">
22
22
  <template #before v-if="args.before"><div v-html="args.before"></div></template>
23
23
  <template #default v-if="args.default"><div v-html="args.default"></div></template>
24
24
  <template #after v-if="args.after"><div v-html="args.after"></div></template>
@@ -123,7 +123,7 @@ import { argTypes, defaultArgs } from './Button.settings'
123
123
  setup() {
124
124
  return { args }
125
125
  },
126
- template: `
126
+ template: /*html*/`
127
127
  <div class="bg-black p-md">
128
128
  <vv-button v-bind="args" />
129
129
  </div>
@@ -156,7 +156,7 @@ import { argTypes, defaultArgs } from './Button.settings'
156
156
  setup() {
157
157
  return { args }
158
158
  },
159
- template: `
159
+ template: /*html*/`
160
160
  <div class="bg-white p-md">
161
161
  <vv-button v-bind="args" />
162
162
  </div>
@@ -46,7 +46,7 @@ import { argTypes, defaultArgs } from './Button.settings'
46
46
  return { args }
47
47
  },
48
48
  components: { VvButton, VvBadge },
49
- template: `<vv-button v-bind="args">
49
+ template: /*html*/`<vv-button v-bind="args">
50
50
  <template #before>
51
51
  <vv-badge value="12" modifiers="danger" />
52
52
  </template>
@@ -77,7 +77,7 @@ import { argTypes, defaultArgs } from './Button.settings'
77
77
  return { args }
78
78
  },
79
79
  components: { VvButton, VvBadge },
80
- template: `<vv-button v-bind="args">
80
+ template: /*html*/`<vv-button v-bind="args">
81
81
  <template #after>
82
82
  <vv-badge value="12" modifiers="danger" />
83
83
  </template>
@@ -100,7 +100,7 @@ import { argTypes, defaultArgs } from './Button.settings'
100
100
  setup() {
101
101
  return { args }
102
102
  },
103
- template: `<vv-button v-bind="args">
103
+ template: /*html*/`<vv-button v-bind="args">
104
104
  <template #label>
105
105
  Label <em class="italic">slot!</em>
106
106
  </template>
@@ -20,7 +20,7 @@ export const Template = (args, { argTypes }) => ({
20
20
  setup() {
21
21
  return { args }
22
22
  },
23
- template: `
23
+ template: /*html*/`
24
24
  <vv-button-group v-bind="args" v-model="value" data-testId="button-group">
25
25
  <vv-button name="1a" data-testId="first-button">Button 1</vv-button>
26
26
  <vv-button name="2b">Button 2</vv-button>
@@ -20,7 +20,7 @@ export const Template = (args, { argTypes }) => ({
20
20
  setup() {
21
21
  return { args }
22
22
  },
23
- template: `
23
+ template: /*html*/`
24
24
  <vv-button-group v-bind="args" v-model="value" data-testId="button-group">
25
25
  <vv-button modifiers="primary" name="1a" data-testId="first-button">Button 1</vv-button>
26
26
  <vv-button modifiers="secondary" name="2b">Button 2</vv-button>
@@ -15,7 +15,7 @@ export const Template = (args) => ({
15
15
  setup() {
16
16
  return { args }
17
17
  },
18
- template: `
18
+ template: /*html*/`
19
19
  <vv-card v-bind="args" data-testId="card">
20
20
  <template #default v-if="args.default"><div v-html="args.default"></div></template>
21
21
  <template #header v-if="args.header"><div v-html="args.header"></div></template>
@@ -31,7 +31,7 @@ import { Template } from './Card.stories.mdx'
31
31
  args,
32
32
  }
33
33
  },
34
- template: `
34
+ template: /*html*/`
35
35
  <vv-card v-bind="args" class="max-w-max" data-testId="card">
36
36
  <picture>
37
37
  <img class="aspect-photo h-300" src="https://unsplash.it/300" alt="Card picture"/>
@@ -16,7 +16,7 @@ export const Template = (args) => ({
16
16
  return { args }
17
17
  },
18
18
  data: () => ({ inputValue: args.uncheckedValue }),
19
- template: `
19
+ template: /*html*/`
20
20
  <vv-checkbox v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
21
21
  <template #default v-if="args.default"><span v-html="args.default"></span></template>
22
22
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
@@ -16,7 +16,7 @@ export const Template = (args) => ({
16
16
  return { args }
17
17
  },
18
18
  data: () => ({ inputValue: undefined }),
19
- template: `
19
+ template: /*html*/`
20
20
  <vv-checkbox-group v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
21
21
  <template #default v-if="args.default"><span v-html="args.default"></span></template>
22
22
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
@@ -17,7 +17,7 @@ export const Template = (args) => ({
17
17
  return { args }
18
18
  },
19
19
  data: () => ({ inputValue: undefined }),
20
- template: `
20
+ template: /*html*/`
21
21
  <vv-checkbox-group v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
22
22
  <vv-checkbox id="o1" name="opts" value="1">Option 1</vv-checkbox>
23
23
  <vv-checkbox id="o2" name="opts" value="2">Option 2</vv-checkbox>
@@ -21,7 +21,7 @@ export const Template = (args) => ({
21
21
  inputValue: undefined,
22
22
  }
23
23
  },
24
- template: `
24
+ template: /*html*/`
25
25
  <vv-combobox v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
26
26
  <template #before v-if="args.before"><div class="pr-sm flex" v-html="args.before"></div></template>
27
27
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
@@ -21,7 +21,7 @@ export const Template = (args) => ({
21
21
  this.open = !this.open
22
22
  },
23
23
  },
24
- template: `
24
+ template: /*html*/`
25
25
  <vv-dialog v-bind="args" v-model="open" data-testId="element">
26
26
  <template #header v-if="args.header"><div v-html="args.header"></div></template>
27
27
  <template #default v-if="args.default"><div v-html="args.default"></div></template>
@@ -20,7 +20,7 @@ export const Template = (args) => ({
20
20
  value: undefined,
21
21
  }
22
22
  },
23
- template: `
23
+ template: /*html*/`
24
24
  <vv-dropdown v-bind="args" v-model="value" class="max-w-224 relative" data-testId="element" />
25
25
  <div class="mt-24">Value: <span data-testId="value">{{ value }}</span></div>
26
26
  `,
@@ -15,7 +15,7 @@ export const Template = (args) => ({
15
15
  setup() {
16
16
  return { args }
17
17
  },
18
- template: `<vv-icon v-bind="args" />`,
18
+ template: /*html*/`<vv-icon v-bind="args" />`,
19
19
  })
20
20
 
21
21
  <Canvas>
@@ -22,7 +22,7 @@ export const Template = (args) => ({
22
22
  })
23
23
  return { args, search, icons }
24
24
  },
25
- template: `
25
+ template: /*html*/`
26
26
  <div class="absolute inset-0 overflow-y-auto p-16">
27
27
  <div class="vv-input-text">
28
28
  <div class="vv-input-text__wrapper">
@@ -16,7 +16,7 @@ export const Template = (args) => ({
16
16
  return { args }
17
17
  },
18
18
  data: () => ({ inputValue: undefined }),
19
- template: `
19
+ template: /*html*/`
20
20
  <vv-input-text v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
21
21
  <template #before v-if="args.before"><div class="pl-sm flex" v-html="args.before"></div></template>
22
22
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
@@ -15,7 +15,7 @@ export const Template = (args) => ({
15
15
  setup() {
16
16
  return { args }
17
17
  },
18
- template: `<vv-progress v-bind="args" />`,
18
+ template: /*html*/`<vv-progress v-bind="args" />`,
19
19
  })
20
20
 
21
21
  <Story name="Default" play={defaultTest}>
@@ -16,7 +16,7 @@ export const Template = (args) => ({
16
16
  return { args }
17
17
  },
18
18
  data: () => ({ inputValue: undefined }),
19
- template: `
19
+ template: /*html*/`
20
20
  <vv-radio v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
21
21
  <template #default v-if="args.default"><span v-html="args.default"></span></template>
22
22
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
@@ -16,7 +16,7 @@ export const Template = (args) => ({
16
16
  return { args }
17
17
  },
18
18
  data: () => ({ inputValue: undefined }),
19
- template: `
19
+ template: /*html*/`
20
20
  <vv-radio-group v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
21
21
  <template #default v-if="args.default"><span v-html="args.default"></span></template>
22
22
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
@@ -17,7 +17,7 @@ export const Template = (args) => ({
17
17
  return { args }
18
18
  },
19
19
  data: () => ({ inputValue: undefined }),
20
- template: `
20
+ template: /*html*/`
21
21
  <vv-radio-group v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
22
22
  <vv-radio id="o1" name="opts" value="1">Option 1</vv-radio>
23
23
  <vv-radio id="o2" name="opts" value="2">Option 2</vv-radio>
@@ -20,7 +20,7 @@ export const Template = (args) => ({
20
20
  inputValue: undefined,
21
21
  }
22
22
  },
23
- template: `
23
+ template: /*html*/`
24
24
  <vv-select v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
25
25
  <template #before v-if="args.before"><div class="pl-sm flex" v-html="args.before"></div></template>
26
26
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
@@ -16,7 +16,7 @@ export const Template = (args) => ({
16
16
  return { args }
17
17
  },
18
18
  data: () => ({ inputValue: undefined }),
19
- template: `
19
+ template: /*html*/`
20
20
  <vv-textarea v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
21
21
  <template #before v-if="args.before"><div class="pt-sm pl-sm flex" v-html="args.before"></div></template>
22
22
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
@@ -0,0 +1,26 @@
1
+ import { propsToObject } from '@/utils/ObjectUtilities'
2
+ import { VvTooltipProps } from '@/components/VvTooltip'
3
+ import { DefaultSlotArgTypes, ModifiersArgTypes } from '@/stories/argTypes'
4
+
5
+ export const defaultArgs = {
6
+ ...propsToObject(VvTooltipProps),
7
+ default: "I'm a tooltip"
8
+ }
9
+
10
+ export const argTypes = {
11
+ ...ModifiersArgTypes,
12
+ ...DefaultSlotArgTypes,
13
+ position: {
14
+ type: {
15
+ summary: 'string',
16
+ },
17
+ control: {
18
+ type: 'select',
19
+ },
20
+ table: {
21
+ defaultValue: { summary: 'bottom' },
22
+ },
23
+ description: 'Indicates where to place the tooltip',
24
+ options: [undefined, 'left', 'right', 'bottom', 'top']
25
+ }
26
+ }
@@ -0,0 +1,98 @@
1
+ import { Meta, Story, Canvas } from '@storybook/addon-docs'
2
+ import VvTooltip from '@/components/VvTooltip/VvTooltip.vue'
3
+ import VvButton from '@/components/VvButton/VvButton.vue'
4
+ import { defaultArgs, argTypes } from './Tooltip.settings'
5
+ import { defaultTest } from './Tooltip.test'
6
+
7
+ <Meta
8
+ title="Components/Tooltip"
9
+ component={ VvTooltip }
10
+ args={ defaultArgs }
11
+ argTypes={ argTypes }
12
+ />
13
+
14
+ export const Template = (args) => ({
15
+ components: { VvTooltip, VvButton },
16
+ setup() {
17
+ return { args }
18
+ },
19
+ template:
20
+ /* html */`
21
+ <div class="max-w-full flex justify-center m-xl">
22
+ <vv-button >Hover me
23
+ <vv-tooltip v-bind="args" data-testId="element">
24
+ <template #default v-if="args.default"><div v-html="args.default"></div></template>
25
+ </vv-tooltip>
26
+ </vv-button>
27
+ </div>`
28
+ })
29
+
30
+ <Canvas>
31
+ <Story name="Default" play={defaultTest}>
32
+ {Template.bind()}
33
+ </Story>
34
+ </Canvas>
35
+
36
+ <Canvas>
37
+ <Story
38
+ name="Top"
39
+ play={defaultTest}
40
+ args={{ position: 'top' }}
41
+ argTypes={{
42
+ position: {
43
+ control: {
44
+ disable: true,
45
+ }
46
+ },
47
+ }}>
48
+ {Template.bind({})}
49
+ </Story>
50
+ </Canvas>
51
+
52
+ <Canvas>
53
+ <Story
54
+ name="Bottom"
55
+ play={defaultTest}
56
+ args={{ position: 'bottom' }}
57
+ argTypes={{
58
+ position: {
59
+ control: {
60
+ disable: true,
61
+ }
62
+ },
63
+ }}>
64
+ {Template.bind({})}
65
+ </Story>
66
+ </Canvas>
67
+
68
+ <Canvas>
69
+ <Story
70
+ name="Right"
71
+ play={defaultTest}
72
+ args={{ position: 'right' }}
73
+ argTypes={{
74
+ position: {
75
+ control: {
76
+ disable: true,
77
+ }
78
+ },
79
+ }}>
80
+ {Template.bind({})}
81
+ </Story>
82
+ </Canvas>
83
+
84
+ <Canvas>
85
+ <Story
86
+ name="Left"
87
+ play={defaultTest}
88
+ args={{ position: 'left' }}
89
+ argTypes={{
90
+ position: {
91
+ control: {
92
+ disable: true,
93
+ }
94
+ },
95
+ }}>
96
+ {Template.bind({})}
97
+ </Story>
98
+ </Canvas>
@@ -0,0 +1,49 @@
1
+ import type { PlayAttributes } from '@/test/types'
2
+ import { expect } from '@/test/expect'
3
+ import { sleep } from '@/test/sleep'
4
+ import { within } from '@storybook/testing-library'
5
+
6
+ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
7
+ const element = (await within(canvasElement).findByTestId(
8
+ 'element',
9
+ )) as HTMLElement
10
+ const parentElement = element.parentElement as HTMLElement
11
+
12
+ // slot default
13
+ if (!args.default) {
14
+ throw new Error('Default slot is required!')
15
+ }
16
+
17
+ // check if tooltip is visible after focus
18
+ await parentElement.focus()
19
+ await sleep(800)
20
+ await expect(window.getComputedStyle(element)).toHaveProperty('opacity', "1")
21
+
22
+ // check accessibility
23
+ await expect(element).toHaveNoViolations()
24
+
25
+ // check if tooltip is not visible after blur
26
+ await parentElement.blur()
27
+ await sleep(800)
28
+ await expect(window.getComputedStyle(element)).toHaveProperty('opacity', "0")
29
+
30
+ // position right
31
+ if (args.position === 'right') {
32
+ await expect(element).toHaveClass('vv-tooltip--right')
33
+ }
34
+
35
+ // position left
36
+ if (args.position === 'left') {
37
+ await expect(element).toHaveClass('vv-tooltip--left')
38
+ }
39
+
40
+ // position top
41
+ if (args.position === 'top') {
42
+ await expect(element).toHaveClass('vv-tooltip--top')
43
+ }
44
+
45
+ // position bottom
46
+ if (args.position === 'bottom') {
47
+ await expect(element).toHaveClass('vv-tooltip--bottom')
48
+ }
49
+ }