@volverjs/ui-vue 0.0.2 → 0.0.3-beta.3
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/auto-imports.d.ts +289 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +63 -131
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
- package/dist/components/VvAccordion/index.d.ts +2 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +97 -176
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +4 -4
- package/dist/components/VvAccordionGroup/index.d.ts +2 -2
- package/dist/components/VvBadge/VvBadge.es.js +16 -50
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +38 -45
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +170 -306
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
- package/dist/components/VvButton/index.d.ts +3 -3
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +39 -84
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +26 -60
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +2 -2
- package/dist/components/VvCard/index.d.ts +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +144 -282
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +6 -6
- package/dist/components/VvCheckbox/index.d.ts +10 -4
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -346
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
- package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
- package/dist/components/VvCombobox/VvCombobox.es.js +330 -487
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -8
- package/dist/components/VvCombobox/index.d.ts +4 -4
- package/dist/components/VvDialog/VvDialog.es.js +66 -102
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +61 -185
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +2 -2
- package/dist/components/VvDropdown/index.d.ts +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +30 -65
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +304 -407
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +10 -10
- package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
- package/dist/components/VvInputText/index.d.ts +5 -5
- package/dist/components/VvProgress/VvProgress.es.js +17 -51
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +110 -249
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +6 -6
- package/dist/components/VvRadio/index.d.ts +3 -3
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +161 -318
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
- package/dist/components/VvRadioGroup/index.d.ts +3 -3
- package/dist/components/VvSelect/VvSelect.es.js +200 -292
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +8 -8
- package/dist/components/VvSelect/index.d.ts +4 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +196 -299
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +6 -6
- package/dist/components/VvTextarea/index.d.ts +3 -3
- package/dist/components/VvTooltip/VvTooltip.es.js +28 -0
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -0
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +23 -0
- package/dist/components/VvTooltip/index.d.ts +18 -0
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.es.js +1179 -1371
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/group/useInjectedGroupState.d.ts +1 -1
- package/dist/composables/useComponentFocus.d.ts +1 -1
- package/dist/composables/useComponentIcons.d.ts +1 -1
- package/dist/composables/useDebouncedInput.d.ts +1 -1
- package/dist/composables/useModifiers.d.ts +1 -1
- package/dist/composables/useTextCount.d.ts +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1211 -1404
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +12 -12
- package/dist/stories/Tooltip/Tooltip.settings.d.ts +42 -0
- package/dist/stories/Tooltip/Tooltip.test.d.ts +2 -0
- package/dist/utils/ObjectUtilities.d.ts +1 -1
- package/package.json +27 -20
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +0 -3
- package/src/components/VvAccordion/index.ts +1 -2
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +1 -3
- package/src/components/VvBadge/VvBadge.vue +0 -1
- package/src/components/VvButton/VvButton.vue +0 -3
- package/src/components/VvButton/index.ts +2 -10
- package/src/components/VvButtonGroup/VvButtonGroup.vue +0 -3
- package/src/components/VvCard/VvCard.vue +0 -1
- package/src/components/VvCheckbox/VvCheckbox.vue +0 -3
- package/src/components/VvCheckbox/index.ts +1 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +0 -5
- package/src/components/VvCombobox/VvCombobox.vue +0 -7
- package/src/components/VvDialog/VvDialog.vue +1 -2
- package/src/components/VvDropdown/VvDropdown.vue +0 -4
- package/src/components/VvIcon/VvIcon.vue +0 -2
- package/src/components/VvInputText/VvInputClearAction.ts +0 -1
- package/src/components/VvInputText/VvInputPasswordAction.ts +0 -1
- package/src/components/VvInputText/VvInputStepAction.ts +0 -1
- package/src/components/VvInputText/VvInputText.vue +1 -16
- package/src/components/VvInputText/VvInputTextActions.ts +1 -1
- package/src/components/VvProgress/VvProgress.vue +0 -2
- package/src/components/VvRadio/VvRadio.vue +0 -3
- package/src/components/VvRadio/index.ts +0 -1
- package/src/components/VvRadioGroup/VvRadioGroup.vue +0 -5
- package/src/components/VvSelect/VvSelect.vue +1 -14
- package/src/components/VvTextarea/VvTextarea.vue +1 -15
- package/src/components/VvTooltip/VvTooltip.vue +17 -0
- package/src/components/VvTooltip/index.ts +21 -0
- package/src/components/common/HintSlot.ts +1 -11
- package/src/composables/group/types/IAccordionGroupState.ts +0 -1
- package/src/composables/group/types/IButtonGroupState.ts +0 -1
- package/src/composables/group/types/IInputGroup.ts +0 -1
- package/src/composables/group/useInjectedGroupState.ts +1 -2
- package/src/composables/group/useProvideGroupState.ts +0 -1
- package/src/composables/useComponentFocus.ts +1 -2
- package/src/composables/useComponentIcons.ts +1 -1
- package/src/composables/useDebouncedInput.ts +1 -1
- package/src/composables/useModifiers.ts +1 -2
- package/src/composables/useOptions.ts +0 -1
- package/src/composables/useTextCount.ts +1 -1
- package/src/stories/Accordion/Accordion.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +1 -1
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
- package/src/stories/Badge/Badge.stories.mdx +1 -1
- package/src/stories/Breadcrumb/Breadcrumb.settings.ts +0 -1
- package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +1 -1
- package/src/stories/Breadcrumb/BreadcrumbSlots.stories.mdx +1 -1
- package/src/stories/Button/Button.stories.mdx +1 -1
- package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
- package/src/stories/Button/ButtonSlots.stories.mdx +3 -3
- package/src/stories/ButtonGroup/ButtonGroup.settings.ts +0 -1
- package/src/stories/ButtonGroup/ButtonGroup.stories.mdx +1 -1
- package/src/stories/ButtonGroup/ButtonGroupSlots.stories.mdx +1 -1
- package/src/stories/Card/Card.stories.mdx +1 -1
- package/src/stories/Card/CardSlots.stories.mdx +1 -1
- package/src/stories/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +1 -1
- package/src/stories/Combobox/Combobox.settings.ts +0 -1
- package/src/stories/Combobox/Combobox.stories.mdx +1 -1
- package/src/stories/Dialog/Dialog.stories.mdx +1 -1
- package/src/stories/Dropdown/Dropdown.settings.ts +0 -1
- package/src/stories/Dropdown/Dropdown.stories.mdx +1 -1
- package/src/stories/Icon/Icon.settings.ts +0 -1
- package/src/stories/Icon/Icon.stories.mdx +1 -1
- package/src/stories/Icon/IconsCollection.stories.mdx +1 -1
- package/src/stories/InputText/InputText.settings.ts +0 -1
- package/src/stories/InputText/InputText.stories.mdx +1 -1
- package/src/stories/Progress/Progress.stories.mdx +1 -1
- package/src/stories/Radio/Radio.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroup.stories.mdx +1 -1
- package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +1 -1
- package/src/stories/Select/Select.settings.ts +0 -1
- package/src/stories/Select/Select.stories.mdx +1 -1
- package/src/stories/Textarea/Textarea.settings.ts +0 -1
- package/src/stories/Textarea/Textarea.stories.mdx +1 -1
- package/src/stories/Tooltip/Tooltip.settings.ts +25 -0
- package/src/stories/Tooltip/Tooltip.stories.mdx +98 -0
- package/src/stories/Tooltip/Tooltip.test.ts +49 -0
- package/src/utils/ObjectUtilities.ts +1 -1
|
@@ -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
|
`,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { InputTextareaArgTypes } from '@/stories/argTypes'
|
|
2
2
|
import { VvInputTextProps } from '@/components/VvInputText'
|
|
3
3
|
import normal from '@/assets/icons/normal.json'
|
|
4
|
-
import { propsToObject } from '@/utils/ObjectUtilities'
|
|
5
4
|
|
|
6
5
|
export const defaultArgs = {
|
|
7
6
|
...propsToObject(VvInputTextProps),
|
|
@@ -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>
|
|
@@ -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,25 @@
|
|
|
1
|
+
import { VvTooltipProps } from '@/components/VvTooltip'
|
|
2
|
+
import { DefaultSlotArgTypes, ModifiersArgTypes } from '@/stories/argTypes'
|
|
3
|
+
|
|
4
|
+
export const defaultArgs = {
|
|
5
|
+
...propsToObject(VvTooltipProps),
|
|
6
|
+
default: "I'm a tooltip"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const argTypes = {
|
|
10
|
+
...ModifiersArgTypes,
|
|
11
|
+
...DefaultSlotArgTypes,
|
|
12
|
+
position: {
|
|
13
|
+
type: {
|
|
14
|
+
summary: 'string',
|
|
15
|
+
},
|
|
16
|
+
control: {
|
|
17
|
+
type: 'select',
|
|
18
|
+
},
|
|
19
|
+
table: {
|
|
20
|
+
defaultValue: { summary: 'bottom' },
|
|
21
|
+
},
|
|
22
|
+
description: 'Indicates where to place the tooltip',
|
|
23
|
+
options: [undefined, 'left', 'right', 'bottom', 'top']
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -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
|
+
}
|