@meistrari/tela-build 1.0.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 +75 -0
- package/app.config.ts +73 -0
- package/components/tela/animated/animated-calculating-number.vue +16 -0
- package/components/tela/animated/animated-number.mdx +248 -0
- package/components/tela/animated/animated-number.stories.ts +52 -0
- package/components/tela/animated/animated-number.vue +23 -0
- package/components/tela/animated/animated-text.vue +124 -0
- package/components/tela/animated/animated-value.vue +68 -0
- package/components/tela/avatar/avatar.mdx +117 -0
- package/components/tela/avatar/avatar.stories.ts +62 -0
- package/components/tela/avatar/avatar.vue +71 -0
- package/components/tela/avatar/group/avatar-group.stories.ts +78 -0
- package/components/tela/avatar/group/avatar-group.vue +46 -0
- package/components/tela/badge/badge.mdx +154 -0
- package/components/tela/badge/badge.stories.ts +82 -0
- package/components/tela/badge/badge.vue +41 -0
- package/components/tela/button/button.mdx +155 -0
- package/components/tela/button/button.stories.ts +202 -0
- package/components/tela/button/button.vue +107 -0
- package/components/tela/card.vue +30 -0
- package/components/tela/chart/chart-bar.vue +58 -0
- package/components/tela/chat/chat.mdx +268 -0
- package/components/tela/chat/chat.stories.ts +253 -0
- package/components/tela/chat/command/index.vue +41 -0
- package/components/tela/chat/command/mention/index.vue +138 -0
- package/components/tela/chat/index.vue +112 -0
- package/components/tela/chat/pure-text-input/chat-text-input.vue +190 -0
- package/components/tela/chat/text-input/chat-text-input.stories.ts +128 -0
- package/components/tela/chat/text-input/index.vue +217 -0
- package/components/tela/chat/text-message/chat-text-message.stories.ts +138 -0
- package/components/tela/chat/text-message/index.vue +355 -0
- package/components/tela/chat/types.ts +19 -0
- package/components/tela/checkbox/checkbox-card.vue +30 -0
- package/components/tela/checkbox/checkbox.mdx +164 -0
- package/components/tela/checkbox/checkbox.stories.ts +104 -0
- package/components/tela/checkbox/checkbox.vue +43 -0
- package/components/tela/collapsible/Collapsible.vue +15 -0
- package/components/tela/collapsible/CollapsibleContent.vue +59 -0
- package/components/tela/collapsible/CollapsibleTrigger.vue +12 -0
- package/components/tela/collapsible/collapsible.mdx +157 -0
- package/components/tela/collapsible-section/collapsible-section.mdx +180 -0
- package/components/tela/collapsible-section/collapsible-section.stories.ts +53 -0
- package/components/tela/collapsible-section/collapsible-section.vue +51 -0
- package/components/tela/collapsible-section-with-actions.vue +98 -0
- package/components/tela/combobox/combobox-anchor.vue +24 -0
- package/components/tela/combobox/combobox-empty.vue +19 -0
- package/components/tela/combobox/combobox-group.vue +24 -0
- package/components/tela/combobox/combobox-indicator.vue +22 -0
- package/components/tela/combobox/combobox-input.vue +31 -0
- package/components/tela/combobox/combobox-item.vue +28 -0
- package/components/tela/combobox/combobox-label.vue +24 -0
- package/components/tela/combobox/combobox-list.vue +90 -0
- package/components/tela/combobox/combobox-module-selector.vue +366 -0
- package/components/tela/combobox/combobox-root.vue +15 -0
- package/components/tela/combobox/combobox-trigger.vue +12 -0
- package/components/tela/combobox/combobox.mdx +285 -0
- package/components/tela/combobox/combobox.stories.ts +232 -0
- package/components/tela/combobox/combobox.vue +497 -0
- package/components/tela/command/command-dialog.vue +22 -0
- package/components/tela/command/command-empty.vue +25 -0
- package/components/tela/command/command-group.vue +46 -0
- package/components/tela/command/command-input.vue +38 -0
- package/components/tela/command/command-item.vue +78 -0
- package/components/tela/command/command-list.vue +78 -0
- package/components/tela/command/command-separator.vue +23 -0
- package/components/tela/command/command-shortcut.vue +13 -0
- package/components/tela/command/command.vue +88 -0
- package/components/tela/command/dialog-base.vue +15 -0
- package/components/tela/command/dialog-content.vue +50 -0
- package/components/tela/command/utils.ts +15 -0
- package/components/tela/complex-table/complex-table-cell.stories.ts +145 -0
- package/components/tela/complex-table/complex-table-cell.vue +45 -0
- package/components/tela/complex-table/complex-table-header-cell.stories.ts +103 -0
- package/components/tela/complex-table/complex-table-header-cell.vue +48 -0
- package/components/tela/complex-table/complex-table-header.stories.ts +89 -0
- package/components/tela/complex-table/complex-table-header.vue +70 -0
- package/components/tela/complex-table/complex-table-row.vue +199 -0
- package/components/tela/complex-table/complex-table-virtualized.vue +326 -0
- package/components/tela/complex-table/complex-table.stories.ts +358 -0
- package/components/tela/complex-table/complex-table.vue +237 -0
- package/components/tela/complex-table/composables/table-common.ts +93 -0
- package/components/tela/complex-table/composables/table-selection.ts +87 -0
- package/components/tela/complex-table/composables/virtual-scroll.ts +252 -0
- package/components/tela/complex-table/styles/table-shared.css +170 -0
- package/components/tela/complex-table/types.ts +63 -0
- package/components/tela/complex-table/utils.ts +35 -0
- package/components/tela/confirm-button/confirm-button.vue +137 -0
- package/components/tela/confirmation-modal/confirmation-modal.vue +72 -0
- package/components/tela/copy-button.vue +86 -0
- package/components/tela/date-range-picker.vue +221 -0
- package/components/tela/dialog/dialog.mdx +170 -0
- package/components/tela/dialog/dialog.vue +182 -0
- package/components/tela/disabled-area.vue +16 -0
- package/components/tela/disclaimer/disclaimer.mdx +238 -0
- package/components/tela/disclaimer/disclaimer.stories.ts +196 -0
- package/components/tela/disclaimer/disclaimer.vue +125 -0
- package/components/tela/dropdown-menu/DropdownMenu.vue +121 -0
- package/components/tela/dropdown-menu/DropdownMenuCheckboxItem.vue +40 -0
- package/components/tela/dropdown-menu/DropdownMenuContent.vue +75 -0
- package/components/tela/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/components/tela/dropdown-menu/DropdownMenuItem.vue +137 -0
- package/components/tela/dropdown-menu/DropdownMenuLabel.vue +26 -0
- package/components/tela/dropdown-menu/DropdownMenuRadioGroup.vue +18 -0
- package/components/tela/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/components/tela/dropdown-menu/DropdownMenuRoot.vue +15 -0
- package/components/tela/dropdown-menu/DropdownMenuSeparator.vue +21 -0
- package/components/tela/dropdown-menu/DropdownMenuShortcut.vue +14 -0
- package/components/tela/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/components/tela/dropdown-menu/DropdownMenuSubContent.vue +30 -0
- package/components/tela/dropdown-menu/DropdownMenuSubTrigger.vue +35 -0
- package/components/tela/dropdown-menu/DropdownMenuTrigger.vue +14 -0
- package/components/tela/dropdown-menu/dropdown-menu.mdx +265 -0
- package/components/tela/dropdown-menu/dropdown-menu.stories.ts +156 -0
- package/components/tela/expandable-input.vue +96 -0
- package/components/tela/file-drop.vue +37 -0
- package/components/tela/file-upload/file-upload.mdx +189 -0
- package/components/tela/file-upload/file-upload.stories.ts +48 -0
- package/components/tela/file-upload/file-upload.vue +205 -0
- package/components/tela/filters/checkbox-filter.stories.ts +218 -0
- package/components/tela/filters/checkbox-filter.vue +165 -0
- package/components/tela/filters/date-filter.stories.ts +258 -0
- package/components/tela/filters/date-filter.vue +200 -0
- package/components/tela/filters/user-filter.stories.ts +344 -0
- package/components/tela/filters/user-filter.vue +271 -0
- package/components/tela/hover-card/hover-card.mdx +221 -0
- package/components/tela/hover-card/hover-card.stories.ts +87 -0
- package/components/tela/hover-card/hover-card.vue +61 -0
- package/components/tela/icon/custom.vue +319 -0
- package/components/tela/icon/spinner.vue +12 -0
- package/components/tela/icon-button/icon-button.vue +114 -0
- package/components/tela/icon.vue +37 -0
- package/components/tela/initials.vue +28 -0
- package/components/tela/inline-input.vue +77 -0
- package/components/tela/input/input.mdx +182 -0
- package/components/tela/input/input.stories.ts +153 -0
- package/components/tela/input/tela-input.vue +240 -0
- package/components/tela/kbd/kbd-return.vue +6 -0
- package/components/tela/kbd/kbd.mdx +238 -0
- package/components/tela/kbd/kbd.vue +18 -0
- package/components/tela/label/label.mdx +121 -0
- package/components/tela/label/label.stories.ts +37 -0
- package/components/tela/label/label.vue +25 -0
- package/components/tela/link-decoration/link-decoration.vue +19 -0
- package/components/tela/live-label.vue +32 -0
- package/components/tela/long-press-button.vue +98 -0
- package/components/tela/menubar/menubar-content.vue +77 -0
- package/components/tela/menubar/menubar-item.vue +32 -0
- package/components/tela/menubar/menubar-label.vue +14 -0
- package/components/tela/menubar/menubar-menu.vue +12 -0
- package/components/tela/menubar/menubar-root.vue +30 -0
- package/components/tela/menubar/menubar-separator.vue +17 -0
- package/components/tela/menubar/menubar-shortcut.vue +14 -0
- package/components/tela/menubar/menubar-sub-content.vue +36 -0
- package/components/tela/menubar/menubar-sub-trigger.vue +28 -0
- package/components/tela/menubar/menubar-sub.vue +20 -0
- package/components/tela/menubar/menubar-trigger.vue +27 -0
- package/components/tela/menubar/menubar.vue +298 -0
- package/components/tela/modal/modal.mdx +145 -0
- package/components/tela/modal/modal.vue +242 -0
- package/components/tela/multiple-select/multiple-select.mdx +274 -0
- package/components/tela/multiple-select/multiple-select.stories.ts +325 -0
- package/components/tela/multiple-select/multiple-select.vue +666 -0
- package/components/tela/pane.vue +110 -0
- package/components/tela/popover/popover-content.vue +48 -0
- package/components/tela/popover/popover-trigger.vue +12 -0
- package/components/tela/popover/popover.mdx +239 -0
- package/components/tela/popover/popover.stories.ts +150 -0
- package/components/tela/popover/popover.vue +15 -0
- package/components/tela/popover-list/popover-list-nested.vue +104 -0
- package/components/tela/popover-list/popover-list.stories.ts +330 -0
- package/components/tela/popover-list/popover-list.vue +191 -0
- package/components/tela/radio-button.vue +66 -0
- package/components/tela/radio-group/radio-group-item.vue +40 -0
- package/components/tela/radio-group/radio-group-root.vue +26 -0
- package/components/tela/radio-group/radio-group.mdx +78 -0
- package/components/tela/radio-group/radio-group.stories.ts +106 -0
- package/components/tela/radio-group/radio-group.vue +23 -0
- package/components/tela/range-calendar.stories.ts +110 -0
- package/components/tela/range-calendar.vue +109 -0
- package/components/tela/scroll-area/scroll-area.mdx +183 -0
- package/components/tela/scroll-area/scroll-area.vue +30 -0
- package/components/tela/scroll-area/scroll-bar.vue +31 -0
- package/components/tela/segment-toggle.stories.ts +114 -0
- package/components/tela/segment-toggle.vue +66 -0
- package/components/tela/select-menu/select-menu-content.vue +106 -0
- package/components/tela/select-menu/select-menu-down-button.vue +20 -0
- package/components/tela/select-menu/select-menu-group.vue +16 -0
- package/components/tela/select-menu/select-menu-item.vue +40 -0
- package/components/tela/select-menu/select-menu-root.vue +15 -0
- package/components/tela/select-menu/select-menu-trigger.vue +34 -0
- package/components/tela/select-menu/select-menu-up-button.vue +20 -0
- package/components/tela/select-menu/select-menu-value.vue +12 -0
- package/components/tela/select-menu/select-menu.mdx +221 -0
- package/components/tela/select-menu/select-menu.stories.ts +91 -0
- package/components/tela/select-menu/select-menu.vue +165 -0
- package/components/tela/selector/selector.vue +47 -0
- package/components/tela/sheet/sheet-close.vue +12 -0
- package/components/tela/sheet/sheet-content.vue +57 -0
- package/components/tela/sheet/sheet-description.vue +23 -0
- package/components/tela/sheet/sheet-footer.vue +18 -0
- package/components/tela/sheet/sheet-header.vue +15 -0
- package/components/tela/sheet/sheet-root.vue +18 -0
- package/components/tela/sheet/sheet-title.vue +23 -0
- package/components/tela/sheet/sheet-trigger.vue +12 -0
- package/components/tela/sheet/sheet.client.vue +150 -0
- package/components/tela/sheet/sheet.mdx +176 -0
- package/components/tela/sheet/sheet.stories.ts +201 -0
- package/components/tela/sheet/variants.ts +22 -0
- package/components/tela/side-sheet/side-sheet.mdx +131 -0
- package/components/tela/side-sheet/side-sheet.stories.ts +134 -0
- package/components/tela/side-sheet/side-sheet.vue +106 -0
- package/components/tela/skeleton/skeleton.mdx +165 -0
- package/components/tela/skeleton/skeleton.stories.ts +35 -0
- package/components/tela/skeleton/skeleton.vue +45 -0
- package/components/tela/skeleton-icon.vue +24 -0
- package/components/tela/span.vue +24 -0
- package/components/tela/star-button.vue +70 -0
- package/components/tela/status/status-lean.vue +30 -0
- package/components/tela/status/status.mdx +187 -0
- package/components/tela/status/status.stories.ts +160 -0
- package/components/tela/status/status.vue +420 -0
- package/components/tela/status-bar/status-bar.mdx +178 -0
- package/components/tela/status-bar/status-bar.stories.ts +64 -0
- package/components/tela/status-bar/status-bar.vue +56 -0
- package/components/tela/status-bar/types.ts +5 -0
- package/components/tela/switch/switch.mdx +118 -0
- package/components/tela/switch/switch.stories.ts +80 -0
- package/components/tela/switch/switch.vue +56 -0
- package/components/tela/table/table-body.vue +13 -0
- package/components/tela/table/table-caption.vue +13 -0
- package/components/tela/table/table-cell.vue +20 -0
- package/components/tela/table/table-empty.vue +37 -0
- package/components/tela/table/table-footer.vue +13 -0
- package/components/tela/table/table-head.vue +13 -0
- package/components/tela/table/table-header.vue +13 -0
- package/components/tela/table/table-row.vue +13 -0
- package/components/tela/table/table.mdx +230 -0
- package/components/tela/table/table.stories.ts +384 -0
- package/components/tela/table/table.vue +15 -0
- package/components/tela/tabs/tabs-content.vue +20 -0
- package/components/tela/tabs/tabs-indicator.vue +22 -0
- package/components/tela/tabs/tabs-list.vue +23 -0
- package/components/tela/tabs/tabs-root.vue +15 -0
- package/components/tela/tabs/tabs-trigger.vue +27 -0
- package/components/tela/tabs/tabs.mdx +138 -0
- package/components/tela/tabs/tabs.stories.ts +72 -0
- package/components/tela/tabs/tabs.vue +61 -0
- package/components/tela/tags/tags-select.mdx +318 -0
- package/components/tela/tags/tags-select.stories.ts +47 -0
- package/components/tela/tags/tags-select.vue +637 -0
- package/components/tela/tags/tags.mdx +151 -0
- package/components/tela/tags/tags.stories.ts +118 -0
- package/components/tela/tags/tags.vue +112 -0
- package/components/tela/textarea/textarea.mdx +102 -0
- package/components/tela/textarea/textarea.stories.ts +50 -0
- package/components/tela/textarea/textarea.vue +34 -0
- package/components/tela/toggle-group.vue +91 -0
- package/components/tela/tooltip/tooltip-content.vue +45 -0
- package/components/tela/tooltip/tooltip-provider.vue +12 -0
- package/components/tela/tooltip/tooltip-root.vue +15 -0
- package/components/tela/tooltip/tooltip-trigger.vue +12 -0
- package/components/tela/tooltip/tooltip.mdx +196 -0
- package/components/tela/tooltip/tooltip.stories.ts +200 -0
- package/components/tela/tooltip/tooltip.vue +91 -0
- package/components/tela/tooltip-group/tooltip-group-trigger.vue +92 -0
- package/components/tela/tooltip-group/tooltip-group.mdx +236 -0
- package/components/tela/tooltip-group/tooltip-group.stories.ts +465 -0
- package/components/tela/tooltip-group/tooltip-group.vue +35 -0
- package/components/tela/transparent-input.vue +151 -0
- package/components/tela/variable-icon.vue +28 -0
- package/components/tela/variable-input.vue +77 -0
- package/components/tela/wide-button/wide-button.vue +40 -0
- package/components.json +18 -0
- package/composables/status-toast.ts +67 -0
- package/css/reset.css +386 -0
- package/css/text.css +22 -0
- package/lib/doc-generator.ts +903 -0
- package/lib/extractors/volar-extract.ts +186 -0
- package/lib/type-resolver.ts +402 -0
- package/lib/utils.ts +6 -0
- package/modules/tela-build-docs/index.ts +139 -0
- package/nuxt.config.ts +80 -0
- package/package.json +84 -0
- package/plugins/test-id.ts +7 -0
- package/tsconfig.json +7 -0
- package/types/custom-icon.ts +1 -0
- package/types/index.ts +2 -0
- package/types/status.ts +1 -0
- package/unocss.config.ts +89 -0
- package/utils/component-utils.ts +30 -0
- package/utils/design-tokens.ts +431 -0
- package/utils/fold.ts +8 -0
- package/utils/select-menu.ts +10 -0
- package/utils/status.ts +1 -0
- package/utils/without-keys.ts +34 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipContent, TooltipPortal, useForwardPropsEmits } from 'reka-ui'
|
|
3
|
+
import type { TooltipContentEmits, TooltipContentProps } from 'reka-ui'
|
|
4
|
+
import { computed } from 'vue'
|
|
5
|
+
import type { HTMLAttributes } from 'vue'
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<TooltipContentProps & { class?: HTMLAttributes['class'] }>(), {
|
|
12
|
+
sideOffset: 4,
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const emits = defineEmits<TooltipContentEmits & {
|
|
16
|
+
click: [event: Event]
|
|
17
|
+
}>()
|
|
18
|
+
|
|
19
|
+
const delegatedProps = computed(() => {
|
|
20
|
+
const { class: _, ...delegated } = props
|
|
21
|
+
|
|
22
|
+
return delegated
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<TooltipPortal>
|
|
30
|
+
<!-- Using z-1000 here because tela select menu is using z-999 -->
|
|
31
|
+
<TooltipContent
|
|
32
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
33
|
+
:style="{ pointerEvents: 'auto' }"
|
|
34
|
+
z-1000 overflow-hidden rounded-12px
|
|
35
|
+
py-7px px-12px
|
|
36
|
+
body-12-semibold text-white
|
|
37
|
+
shadow-flying
|
|
38
|
+
class="bg-[#030C16F0]"
|
|
39
|
+
:class="props.class"
|
|
40
|
+
@click="$emit('click', $event)"
|
|
41
|
+
>
|
|
42
|
+
<slot />
|
|
43
|
+
</TooltipContent>
|
|
44
|
+
</TooltipPortal>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipProvider } from 'reka-ui'
|
|
3
|
+
import type { TooltipProviderProps } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TooltipProviderProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<TooltipProvider v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</TooltipProvider>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipRoot, useForwardPropsEmits } from 'reka-ui'
|
|
3
|
+
import type { TooltipRootEmits, TooltipRootProps } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TooltipRootProps>()
|
|
6
|
+
const emits = defineEmits<TooltipRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<TooltipRoot v-bind="forwarded">
|
|
13
|
+
<slot />
|
|
14
|
+
</TooltipRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipTrigger } from 'reka-ui'
|
|
3
|
+
import type { TooltipTriggerProps } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TooltipTriggerProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<TooltipTrigger v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</TooltipTrigger>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { Meta, Canvas, ArgTypes } from '@storybook/blocks';
|
|
2
|
+
import * as TooltipStories from './tooltip.stories.ts';
|
|
3
|
+
|
|
4
|
+
<Meta of={TooltipStories} />
|
|
5
|
+
|
|
6
|
+
# TelaTooltip
|
|
7
|
+
|
|
8
|
+
A tooltip component that displays helpful information when hovering over elements. Supports single-line and multiline variants, custom positioning on all sides, and custom content via slots. Useful for providing contextual information without cluttering the UI.
|
|
9
|
+
|
|
10
|
+
## Examples
|
|
11
|
+
|
|
12
|
+
### Simple Tooltip
|
|
13
|
+
|
|
14
|
+
<Canvas of={TooltipStories.Simple} />
|
|
15
|
+
|
|
16
|
+
### Multiline Tooltip
|
|
17
|
+
|
|
18
|
+
<Canvas of={TooltipStories.Multiline} />
|
|
19
|
+
|
|
20
|
+
### Different Positions
|
|
21
|
+
|
|
22
|
+
<Canvas of={TooltipStories.AllSides} />
|
|
23
|
+
|
|
24
|
+
### With Custom Content
|
|
25
|
+
|
|
26
|
+
<Canvas of={TooltipStories.WithCustomContent} />
|
|
27
|
+
|
|
28
|
+
### With Positioning
|
|
29
|
+
|
|
30
|
+
<Canvas of={TooltipStories.WithPositioning} />
|
|
31
|
+
|
|
32
|
+
### Simple Tooltip Code
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<TelaTooltip content="Helpful information">
|
|
36
|
+
<TelaButton>Hover me</TelaButton>
|
|
37
|
+
</TelaTooltip>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Multiline Tooltip Code
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<TelaTooltip
|
|
44
|
+
variant="multiline"
|
|
45
|
+
title="Important Notice"
|
|
46
|
+
description="This action requires approval before proceeding"
|
|
47
|
+
side="top"
|
|
48
|
+
>
|
|
49
|
+
<TelaButton disabled variant="danger">
|
|
50
|
+
Disabled Action
|
|
51
|
+
</TelaButton>
|
|
52
|
+
</TelaTooltip>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Different Positions Code
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<!-- Top -->
|
|
59
|
+
<TelaTooltip content="Top tooltip" side="top">
|
|
60
|
+
<TelaButton>Top</TelaButton>
|
|
61
|
+
</TelaTooltip>
|
|
62
|
+
|
|
63
|
+
<!-- Right -->
|
|
64
|
+
<TelaTooltip content="Right tooltip" side="right">
|
|
65
|
+
<TelaButton>Right</TelaButton>
|
|
66
|
+
</TelaTooltip>
|
|
67
|
+
|
|
68
|
+
<!-- Bottom -->
|
|
69
|
+
<TelaTooltip content="Bottom tooltip" side="bottom">
|
|
70
|
+
<TelaButton>Bottom</TelaButton>
|
|
71
|
+
</TelaTooltip>
|
|
72
|
+
|
|
73
|
+
<!-- Left -->
|
|
74
|
+
<TelaTooltip content="Left tooltip" side="left">
|
|
75
|
+
<TelaButton>Left</TelaButton>
|
|
76
|
+
</TelaTooltip>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### With Custom Content Code
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<TelaTooltip variant="multiline">
|
|
83
|
+
<TelaButton>Custom Content</TelaButton>
|
|
84
|
+
<template #content>
|
|
85
|
+
<div class="flex items-center gap-2">
|
|
86
|
+
<TelaIcon name="i-ph-info" />
|
|
87
|
+
<span>Custom tooltip with icon</span>
|
|
88
|
+
</div>
|
|
89
|
+
</template>
|
|
90
|
+
</TelaTooltip>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```vue
|
|
94
|
+
<TelaTooltip
|
|
95
|
+
variant="multiline"
|
|
96
|
+
title="Custom Position"
|
|
97
|
+
description="Tooltip with custom align and arrow offsets"
|
|
98
|
+
side="top"
|
|
99
|
+
align="start"
|
|
100
|
+
:align-offset="-32"
|
|
101
|
+
:arrow-offset="-38"
|
|
102
|
+
>
|
|
103
|
+
<TelaButton>Positioned</TelaButton>
|
|
104
|
+
</TelaTooltip>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### With Delay
|
|
108
|
+
|
|
109
|
+
```vue
|
|
110
|
+
<TelaTooltip
|
|
111
|
+
content="Appears after 500ms"
|
|
112
|
+
:delay-duration="500"
|
|
113
|
+
>
|
|
114
|
+
<TelaButton>Hover (with delay)</TelaButton>
|
|
115
|
+
</TelaTooltip>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Disabled Tooltip
|
|
119
|
+
|
|
120
|
+
```vue
|
|
121
|
+
<TelaTooltip
|
|
122
|
+
content="This won't show"
|
|
123
|
+
disabled
|
|
124
|
+
>
|
|
125
|
+
<TelaButton>No Tooltip</TelaButton>
|
|
126
|
+
</TelaTooltip>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Props
|
|
130
|
+
|
|
131
|
+
<ArgTypes />
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
type TooltipVariant = 'single' | 'multiline'
|
|
135
|
+
type TooltipSide = 'top' | 'right' | 'bottom' | 'left'
|
|
136
|
+
type TooltipAlign = 'start' | 'center' | 'end'
|
|
137
|
+
|
|
138
|
+
type TooltipProps = {
|
|
139
|
+
content?: string
|
|
140
|
+
align?: TooltipAlign
|
|
141
|
+
side?: TooltipSide
|
|
142
|
+
variant?: TooltipVariant
|
|
143
|
+
title?: string
|
|
144
|
+
description?: string
|
|
145
|
+
alignOffset?: number
|
|
146
|
+
arrowOffset?: number
|
|
147
|
+
delayDuration?: number
|
|
148
|
+
disabled?: boolean
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Slots
|
|
153
|
+
|
|
154
|
+
- `default` - Trigger element that shows tooltip on hover
|
|
155
|
+
- `content` - Custom tooltip content (for multiline variant)
|
|
156
|
+
|
|
157
|
+
## Features
|
|
158
|
+
|
|
159
|
+
- **Two Variants**: Single-line for brief text, multiline for title + description
|
|
160
|
+
- **Flexible Positioning**: All sides (top, right, bottom, left)
|
|
161
|
+
- **Custom Alignment**: Start, center, or end alignment
|
|
162
|
+
- **Delay Control**: Configurable delay before showing
|
|
163
|
+
- **Custom Content**: Use slots for rich content
|
|
164
|
+
- **Arrow Indicator**: Visual arrow pointing to trigger
|
|
165
|
+
- **Offset Control**: Fine-tune position and arrow placement
|
|
166
|
+
- **Accessible**: Built on reka-ui with proper ARIA
|
|
167
|
+
|
|
168
|
+
## Variants
|
|
169
|
+
|
|
170
|
+
### Single
|
|
171
|
+
|
|
172
|
+
- One line of text
|
|
173
|
+
- Simple and compact
|
|
174
|
+
- For brief hints and labels
|
|
175
|
+
|
|
176
|
+
### Multiline
|
|
177
|
+
|
|
178
|
+
- Title and description
|
|
179
|
+
- More detailed information
|
|
180
|
+
- For complex explanations
|
|
181
|
+
|
|
182
|
+
## Best Practices
|
|
183
|
+
|
|
184
|
+
1. **Keep Content Brief**: Tooltips should be concise
|
|
185
|
+
2. **Don't Repeat**: Avoid duplicating visible text
|
|
186
|
+
3. **Use for Context**: Provide helpful, additional information
|
|
187
|
+
4. **Consider Touch Devices**: Tooltips don't work well on touch
|
|
188
|
+
5. **Position Wisely**: Ensure tooltip doesn't cover important content
|
|
189
|
+
|
|
190
|
+
## Accessibility
|
|
191
|
+
|
|
192
|
+
- Built on reka-ui primitives
|
|
193
|
+
- Proper ARIA attributes (role="tooltip")
|
|
194
|
+
- Keyboard navigation support (focus trigger shows tooltip)
|
|
195
|
+
- Delay helps prevent accidental triggers
|
|
196
|
+
- Screen reader friendly
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook-vue/vue3'
|
|
2
|
+
import { h } from 'vue'
|
|
3
|
+
|
|
4
|
+
import Tooltip from './tooltip.vue'
|
|
5
|
+
import Button from '../button/button.vue'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Tooltip> = {
|
|
8
|
+
title: 'Core/Tooltip',
|
|
9
|
+
component: Tooltip,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component: 'A tooltip component that displays helpful information when hovering over elements. Supports single-line and multiline variants, custom positioning on all sides, and custom content via slots. Useful for providing contextual information without cluttering the UI.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
content: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
description: 'Text content to display in the tooltip. Used for single-line tooltips. For multiline tooltips, use title and description props instead.',
|
|
22
|
+
},
|
|
23
|
+
align: {
|
|
24
|
+
control: 'select',
|
|
25
|
+
options: ['start', 'center', 'end'],
|
|
26
|
+
description: 'Alignment of the tooltip relative to the trigger element.',
|
|
27
|
+
},
|
|
28
|
+
side: {
|
|
29
|
+
control: 'select',
|
|
30
|
+
options: ['top', 'right', 'bottom', 'left'],
|
|
31
|
+
description: 'Side of the trigger element where the tooltip should appear.',
|
|
32
|
+
},
|
|
33
|
+
variant: {
|
|
34
|
+
control: 'select',
|
|
35
|
+
options: ['single', 'multiline'],
|
|
36
|
+
description: 'Visual variant of the tooltip. Single displays one line of text, multiline supports title and description.',
|
|
37
|
+
},
|
|
38
|
+
title: {
|
|
39
|
+
control: 'text',
|
|
40
|
+
description: 'Title text for multiline tooltips. Displayed prominently at the top.',
|
|
41
|
+
},
|
|
42
|
+
description: {
|
|
43
|
+
control: 'text',
|
|
44
|
+
description: 'Description text for multiline tooltips. Displayed below the title.',
|
|
45
|
+
},
|
|
46
|
+
alignOffset: {
|
|
47
|
+
control: 'number',
|
|
48
|
+
description: 'Offset in pixels to adjust the tooltip alignment position.',
|
|
49
|
+
},
|
|
50
|
+
arrowOffset: {
|
|
51
|
+
control: 'number',
|
|
52
|
+
description: 'Offset in pixels to adjust the tooltip arrow position.',
|
|
53
|
+
},
|
|
54
|
+
delayDuration: {
|
|
55
|
+
control: 'number',
|
|
56
|
+
description: 'Delay in milliseconds before showing the tooltip after hover.',
|
|
57
|
+
},
|
|
58
|
+
disabled: {
|
|
59
|
+
control: 'boolean',
|
|
60
|
+
description: 'Disable the tooltip, preventing it from showing.',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
args: {
|
|
64
|
+
content: 'Text when hovered',
|
|
65
|
+
align: 'center',
|
|
66
|
+
side: 'bottom',
|
|
67
|
+
variant: 'single',
|
|
68
|
+
} as any,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default meta
|
|
72
|
+
|
|
73
|
+
type Story = StoryObj<typeof meta>
|
|
74
|
+
|
|
75
|
+
export const Simple: Story = {
|
|
76
|
+
render: args => ({
|
|
77
|
+
components: { Tooltip, Button },
|
|
78
|
+
setup() {
|
|
79
|
+
return { args }
|
|
80
|
+
},
|
|
81
|
+
template: `
|
|
82
|
+
<div style="width: 100%; height: 300px; display: flex; align-items: center; justify-content: center;">
|
|
83
|
+
<Tooltip v-bind="args">
|
|
84
|
+
<Button>
|
|
85
|
+
Hover me
|
|
86
|
+
</Button>
|
|
87
|
+
</Tooltip>
|
|
88
|
+
</div>`,
|
|
89
|
+
}),
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const Multiline: Story = {
|
|
93
|
+
args: {
|
|
94
|
+
variant: 'multiline',
|
|
95
|
+
title: 'Some tasks are pending review',
|
|
96
|
+
description: 'You need to approve all selected tasks before downloading them',
|
|
97
|
+
side: 'top',
|
|
98
|
+
align: 'start',
|
|
99
|
+
},
|
|
100
|
+
render: args => ({
|
|
101
|
+
components: { Tooltip },
|
|
102
|
+
setup() {
|
|
103
|
+
return { args }
|
|
104
|
+
},
|
|
105
|
+
template: `
|
|
106
|
+
<div style="width: 100%; height: 300px; display: flex; align-items: center; justify-content: center;">
|
|
107
|
+
<Tooltip v-bind="args">
|
|
108
|
+
<button style="padding: 8px 16px; background: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">
|
|
109
|
+
Download (Disabled)
|
|
110
|
+
</button>
|
|
111
|
+
</Tooltip>
|
|
112
|
+
</div>`,
|
|
113
|
+
}),
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const WithPositioning: Story = {
|
|
117
|
+
args: {
|
|
118
|
+
variant: 'multiline',
|
|
119
|
+
title: 'Positioned Tooltip',
|
|
120
|
+
description: 'This tooltip has custom positioning with arrow offset',
|
|
121
|
+
side: 'top',
|
|
122
|
+
align: 'start',
|
|
123
|
+
alignOffset: -32,
|
|
124
|
+
arrowOffset: -38,
|
|
125
|
+
},
|
|
126
|
+
render: args => ({
|
|
127
|
+
components: { Tooltip },
|
|
128
|
+
setup() {
|
|
129
|
+
return { args }
|
|
130
|
+
},
|
|
131
|
+
template: `
|
|
132
|
+
<div style="width: 100%; height: 300px; display: flex; align-items: center; justify-content: center;">
|
|
133
|
+
<Tooltip v-bind="args">
|
|
134
|
+
<button style="padding: 8px 16px; background: #6c757d; color: white; border: none; border-radius: 4px; cursor: pointer;">
|
|
135
|
+
Positioned Tooltip
|
|
136
|
+
</button>
|
|
137
|
+
</Tooltip>
|
|
138
|
+
</div>`,
|
|
139
|
+
}),
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export const AllSides: Story = {
|
|
143
|
+
render: () => ({
|
|
144
|
+
components: { Tooltip },
|
|
145
|
+
template: `
|
|
146
|
+
<div style="width: 100%; height: 400px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; justify-items: center;">
|
|
147
|
+
<Tooltip content="Top tooltip" side="top">
|
|
148
|
+
<button style="padding: 8px 16px; background: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer;">
|
|
149
|
+
Top
|
|
150
|
+
</button>
|
|
151
|
+
</Tooltip>
|
|
152
|
+
|
|
153
|
+
<Tooltip content="Right tooltip" side="right">
|
|
154
|
+
<button style="padding: 8px 16px; background: #ffc107; color: black; border: none; border-radius: 4px; cursor: pointer;">
|
|
155
|
+
Right
|
|
156
|
+
</button>
|
|
157
|
+
</Tooltip>
|
|
158
|
+
|
|
159
|
+
<Tooltip content="Bottom tooltip" side="bottom">
|
|
160
|
+
<button style="padding: 8px 16px; background: #17a2b8; color: white; border: none; border-radius: 4px; cursor: pointer;">
|
|
161
|
+
Bottom
|
|
162
|
+
</button>
|
|
163
|
+
</Tooltip>
|
|
164
|
+
|
|
165
|
+
<Tooltip content="Left tooltip" side="left">
|
|
166
|
+
<button style="padding: 8px 16px; background: #6f42c1; color: white; border: none; border-radius: 4px; cursor: pointer;">
|
|
167
|
+
Left
|
|
168
|
+
</button>
|
|
169
|
+
</Tooltip>
|
|
170
|
+
</div>`,
|
|
171
|
+
}),
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export const WithCustomContent: Story = {
|
|
175
|
+
render: () => ({
|
|
176
|
+
components: { Tooltip },
|
|
177
|
+
setup() {
|
|
178
|
+
return { h }
|
|
179
|
+
},
|
|
180
|
+
template: `
|
|
181
|
+
<div style="width: 100%; height: 300px; display: flex; align-items: center; justify-content: center;">
|
|
182
|
+
<Tooltip variant="multiline" side="top">
|
|
183
|
+
<button style="padding: 8px 16px; background: #fd7e14; color: white; border: none; border-radius: 4px; cursor: pointer;">
|
|
184
|
+
Custom Content
|
|
185
|
+
</button>
|
|
186
|
+
<template #content>
|
|
187
|
+
<div>
|
|
188
|
+
<div style="font-weight: 600; color: #fff; margin-bottom: 4px;">
|
|
189
|
+
🚀 Custom Tooltip
|
|
190
|
+
</div>
|
|
191
|
+
<div style="color: #DFE3E7; font-size: 12px;">
|
|
192
|
+
This tooltip has <strong>custom</strong> content with
|
|
193
|
+
<span style="color: #ffc107;">colored text</span> and emojis! ✨
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</template>
|
|
197
|
+
</Tooltip>
|
|
198
|
+
</div>`,
|
|
199
|
+
}),
|
|
200
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipArrow } from 'reka-ui'
|
|
3
|
+
import TelaTooltipProvider from './tooltip-provider.vue'
|
|
4
|
+
import TelaTooltipRoot from './tooltip-root.vue'
|
|
5
|
+
import TelaTooltipTrigger from './tooltip-trigger.vue'
|
|
6
|
+
import TelaTooltipContent from './tooltip-content.vue'
|
|
7
|
+
import { computed } from 'vue'
|
|
8
|
+
import { cn } from '@/lib/utils'
|
|
9
|
+
|
|
10
|
+
export type TooltipProps = {
|
|
11
|
+
content?: string
|
|
12
|
+
align?: 'start' | 'center' | 'end'
|
|
13
|
+
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
14
|
+
contentClass?: string
|
|
15
|
+
disabled?: boolean
|
|
16
|
+
delayDuration?: number
|
|
17
|
+
open?: boolean
|
|
18
|
+
alignOffset?: number
|
|
19
|
+
arrowOffset?: number
|
|
20
|
+
variant?: 'single' | 'multiline'
|
|
21
|
+
title?: string
|
|
22
|
+
description?: string
|
|
23
|
+
triggerClass?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const props = withDefaults(defineProps<TooltipProps>(), {
|
|
27
|
+
open: undefined,
|
|
28
|
+
variant: 'single',
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
defineEmits<{
|
|
32
|
+
(e: 'clickContent', event: Event): void
|
|
33
|
+
}>()
|
|
34
|
+
|
|
35
|
+
const tooltipRootProps = computed(() => {
|
|
36
|
+
const rootProps: any = {}
|
|
37
|
+
|
|
38
|
+
if (props.open !== undefined) {
|
|
39
|
+
rootProps.open = props.open
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return rootProps
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const variantClasses = computed(() => {
|
|
46
|
+
if (props.variant === 'multiline') {
|
|
47
|
+
return 'w-full min-w-255px max-w-320px pt-12px pb-16px px-16px gap-12px flex flex-col text-left max-h-96 overflow-y-auto'
|
|
48
|
+
}
|
|
49
|
+
return ''
|
|
50
|
+
})
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<TelaTooltipProvider :disabled="disabled" :delay-duration="delayDuration">
|
|
55
|
+
<TelaTooltipRoot v-bind="tooltipRootProps">
|
|
56
|
+
<TelaTooltipTrigger :class="triggerClass" :tabindex="-1">
|
|
57
|
+
<slot />
|
|
58
|
+
</TelaTooltipTrigger>
|
|
59
|
+
<TelaTooltipContent
|
|
60
|
+
:align="align"
|
|
61
|
+
:side="side"
|
|
62
|
+
:align-offset="props.alignOffset"
|
|
63
|
+
:class="cn(contentClass, variantClasses)"
|
|
64
|
+
@click="$emit('clickContent', $event)"
|
|
65
|
+
>
|
|
66
|
+
<slot name="content">
|
|
67
|
+
<div v-if="variant === 'multiline' && (title || description)">
|
|
68
|
+
<div
|
|
69
|
+
v-if="title"
|
|
70
|
+
class="text-white font-inter text-14px leading-16px not-italic font-580 tracking--0.14px"
|
|
71
|
+
>
|
|
72
|
+
{{ title }}
|
|
73
|
+
</div>
|
|
74
|
+
<div
|
|
75
|
+
v-if="description"
|
|
76
|
+
class="body-12-regular text-gray-200 mt-[4px] break-words whitespace-pre-line w-full"
|
|
77
|
+
>
|
|
78
|
+
{{ description }}
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<template v-else>
|
|
82
|
+
{{ content }}
|
|
83
|
+
</template>
|
|
84
|
+
</slot>
|
|
85
|
+
<TooltipArrow
|
|
86
|
+
:style="props.arrowOffset ? { transform: `translateX(${props.arrowOffset}px)` } : {}"
|
|
87
|
+
/>
|
|
88
|
+
</TelaTooltipContent>
|
|
89
|
+
</TelaTooltipRoot>
|
|
90
|
+
</TelaTooltipProvider>
|
|
91
|
+
</template>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { TooltipArrow } from 'reka-ui'
|
|
3
|
+
import TelaTooltipRoot from '../tooltip/tooltip-root.vue'
|
|
4
|
+
import TelaTooltipTrigger from '../tooltip/tooltip-trigger.vue'
|
|
5
|
+
import TelaTooltipContent from '../tooltip/tooltip-content.vue'
|
|
6
|
+
import { computed } from 'vue'
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
|
+
|
|
9
|
+
export type TooltipProps = {
|
|
10
|
+
content?: string
|
|
11
|
+
align?: 'start' | 'center' | 'end'
|
|
12
|
+
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
13
|
+
contentClass?: string
|
|
14
|
+
disabled?: boolean
|
|
15
|
+
delayDuration?: number
|
|
16
|
+
open?: boolean
|
|
17
|
+
alignOffset?: number
|
|
18
|
+
arrowOffset?: number
|
|
19
|
+
variant?: 'single' | 'multiline'
|
|
20
|
+
title?: string
|
|
21
|
+
description?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(defineProps<TooltipProps>(), {
|
|
25
|
+
open: undefined,
|
|
26
|
+
variant: 'single',
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
defineEmits<{
|
|
30
|
+
(e: 'clickContent', event: Event): void
|
|
31
|
+
}>()
|
|
32
|
+
|
|
33
|
+
const tooltipRootProps = computed(() => {
|
|
34
|
+
const rootProps: any = {}
|
|
35
|
+
|
|
36
|
+
if (props.open !== undefined) {
|
|
37
|
+
rootProps.open = props.open
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return rootProps
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const variantClasses = computed(() => {
|
|
44
|
+
if (props.variant === 'multiline') {
|
|
45
|
+
return 'max-w-280px text-left'
|
|
46
|
+
}
|
|
47
|
+
return ''
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<TelaTooltipRoot v-bind="tooltipRootProps">
|
|
53
|
+
<TelaTooltipTrigger>
|
|
54
|
+
<slot />
|
|
55
|
+
</TelaTooltipTrigger>
|
|
56
|
+
<TelaTooltipContent
|
|
57
|
+
:align="align"
|
|
58
|
+
:side="side"
|
|
59
|
+
:align-offset="props.alignOffset"
|
|
60
|
+
:class="cn(contentClass, variantClasses)"
|
|
61
|
+
@click="$emit('clickContent', $event)"
|
|
62
|
+
>
|
|
63
|
+
<slot name="content">
|
|
64
|
+
<div v-if="variant === 'multiline' && (title || description)">
|
|
65
|
+
<div v-if="title" class="body-14-semibold text-white">
|
|
66
|
+
{{ title }}
|
|
67
|
+
</div>
|
|
68
|
+
<div
|
|
69
|
+
v-if="description"
|
|
70
|
+
class="text-[#DFE3E7] mt-[2px]"
|
|
71
|
+
:style="{
|
|
72
|
+
fontFamily: 'Inter, sans-serif',
|
|
73
|
+
fontWeight: 400,
|
|
74
|
+
fontStyle: 'normal',
|
|
75
|
+
fontSize: '12px',
|
|
76
|
+
lineHeight: '16px',
|
|
77
|
+
letterSpacing: '0%',
|
|
78
|
+
}"
|
|
79
|
+
>
|
|
80
|
+
{{ description }}
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
<template v-else>
|
|
84
|
+
{{ content }}
|
|
85
|
+
</template>
|
|
86
|
+
</slot>
|
|
87
|
+
<TooltipArrow
|
|
88
|
+
:style="props.arrowOffset ? { transform: `translateX(${props.arrowOffset}px)` } : {}"
|
|
89
|
+
/>
|
|
90
|
+
</TelaTooltipContent>
|
|
91
|
+
</TelaTooltipRoot>
|
|
92
|
+
</template>
|