pukaad-ui-lib 1.15.1 → 1.16.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/dist/module.json +1 -1
- package/dist/runtime/components/input/input-autocomplete.d.vue.ts +1 -1
- package/dist/runtime/components/input/input-autocomplete.vue.d.ts +1 -1
- package/dist/runtime/components/tooltip.d.vue.ts +9 -6
- package/dist/runtime/components/tooltip.vue +13 -54
- package/dist/runtime/components/tooltip.vue.d.ts +9 -6
- package/dist/runtime/components/ui/tooltip/Tooltip.vue +7 -7
- package/dist/runtime/components/ui/tooltip/TooltipContent.vue +24 -12
- package/dist/runtime/components/ui/tooltip/TooltipProvider.vue +3 -3
- package/dist/runtime/components/ui/tooltip/TooltipTrigger.vue +6 -6
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -36,8 +36,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
36
36
|
id: string;
|
|
37
37
|
name: string;
|
|
38
38
|
description: string;
|
|
39
|
-
options: AutocompleteOption[] | string[] | number[];
|
|
40
39
|
placeholder: string;
|
|
40
|
+
options: AutocompleteOption[] | string[] | number[];
|
|
41
41
|
limit: number;
|
|
42
42
|
disabledErrorMessage: boolean;
|
|
43
43
|
disabledBorder: boolean;
|
|
@@ -36,8 +36,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
36
36
|
id: string;
|
|
37
37
|
name: string;
|
|
38
38
|
description: string;
|
|
39
|
-
options: AutocompleteOption[] | string[] | number[];
|
|
40
39
|
placeholder: string;
|
|
40
|
+
options: AutocompleteOption[] | string[] | number[];
|
|
41
41
|
limit: number;
|
|
42
42
|
disabledErrorMessage: boolean;
|
|
43
43
|
disabledBorder: boolean;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface TooltipProps {
|
|
2
|
+
text?: string;
|
|
3
|
+
delay?: number;
|
|
4
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
5
|
+
}
|
|
6
|
+
declare var __VLS_17: {}, __VLS_24: {};
|
|
3
7
|
type __VLS_Slots = {} & {
|
|
4
|
-
default?: (props: typeof
|
|
8
|
+
default?: (props: typeof __VLS_17) => any;
|
|
5
9
|
} & {
|
|
6
|
-
text?: (props: typeof
|
|
10
|
+
text?: (props: typeof __VLS_24) => any;
|
|
7
11
|
};
|
|
8
12
|
declare const __VLS_base: import("vue").DefineComponent<TooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TooltipProps> & Readonly<{}>, {
|
|
9
13
|
delay: number;
|
|
10
|
-
position:
|
|
11
|
-
arrow: boolean;
|
|
14
|
+
position: "top" | "bottom" | "left" | "right";
|
|
12
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
17
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,63 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
v-if="isShowTooltip"
|
|
11
|
-
:class="['tooltip', positionClass, { 'has-arrow': props.arrow }]"
|
|
12
|
-
>
|
|
13
|
-
<slot v-if="$slots.text || props.text" name="text">
|
|
14
|
-
<div class="font-body-small">
|
|
15
|
-
{{ props.text }}
|
|
16
|
-
</div>
|
|
2
|
+
<ShadTooltipProvider :delay-duration="props.delay">
|
|
3
|
+
<ShadTooltip>
|
|
4
|
+
<ShadTooltipTrigger as-child>
|
|
5
|
+
<slot />
|
|
6
|
+
</ShadTooltipTrigger>
|
|
7
|
+
<ShadTooltipContent :side="props.position">
|
|
8
|
+
<slot name="text">
|
|
9
|
+
<p>{{ props.text }}</p>
|
|
17
10
|
</slot>
|
|
18
|
-
</
|
|
19
|
-
</
|
|
20
|
-
</
|
|
11
|
+
</ShadTooltipContent>
|
|
12
|
+
</ShadTooltip>
|
|
13
|
+
</ShadTooltipProvider>
|
|
21
14
|
</template>
|
|
22
15
|
|
|
23
16
|
<script setup>
|
|
24
|
-
import { ref, computed } from "vue";
|
|
25
17
|
const props = defineProps({
|
|
18
|
+
text: { type: String, required: false },
|
|
26
19
|
delay: { type: Number, required: false, default: 500 },
|
|
27
|
-
position: { type: String, required: false, default: "top" }
|
|
28
|
-
arrow: { type: Boolean, required: false, default: false },
|
|
29
|
-
text: { type: String, required: false }
|
|
20
|
+
position: { type: String, required: false, default: "top" }
|
|
30
21
|
});
|
|
31
|
-
const isShowTooltip = ref(false);
|
|
32
|
-
let timer = null;
|
|
33
|
-
const positionClass = computed(() => {
|
|
34
|
-
switch (props.position) {
|
|
35
|
-
case "bottom":
|
|
36
|
-
return "tooltip-bottom";
|
|
37
|
-
case "left":
|
|
38
|
-
return "tooltip-left";
|
|
39
|
-
case "right":
|
|
40
|
-
return "tooltip-right";
|
|
41
|
-
default:
|
|
42
|
-
return "tooltip-top";
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const onMouseEnter = () => {
|
|
46
|
-
if (timer) clearTimeout(timer);
|
|
47
|
-
timer = setTimeout(() => {
|
|
48
|
-
isShowTooltip.value = true;
|
|
49
|
-
timer = null;
|
|
50
|
-
}, props.delay);
|
|
51
|
-
};
|
|
52
|
-
const onMouseLeave = () => {
|
|
53
|
-
if (timer) {
|
|
54
|
-
clearTimeout(timer);
|
|
55
|
-
timer = null;
|
|
56
|
-
}
|
|
57
|
-
isShowTooltip.value = false;
|
|
58
|
-
};
|
|
59
22
|
</script>
|
|
60
|
-
|
|
61
|
-
<style scoped>
|
|
62
|
-
.tooltip{background-color:#fff;border-radius:4px;box-shadow:0 2px 6px rgba(0,0,0,.2);color:#000;font-size:14px;padding:6px 10px;position:absolute;white-space:nowrap;z-index:10}.tooltip-top{bottom:100%;left:50%;margin-bottom:8px;transform:translateX(-50%)}.tooltip-top.has-arrow:after{border:6px solid transparent;border-top-color:#fff;content:"";left:50%;position:absolute;top:100%;transform:translateX(-50%)}.tooltip-bottom{left:50%;margin-top:8px;top:100%;transform:translateX(-50%)}.tooltip-bottom.has-arrow:after{border:6px solid transparent;border-bottom-color:#fff;bottom:100%;content:"";left:50%;position:absolute;transform:translateX(-50%)}.tooltip-left{margin-right:8px;right:100%;top:50%;transform:translateY(-50%)}.tooltip-left.has-arrow:after{border:6px solid transparent;border-left-color:#fff;content:"";left:100%;position:absolute;top:50%;transform:translateY(-50%)}.tooltip-right{left:100%;margin-left:8px;top:50%;transform:translateY(-50%)}.tooltip-right.has-arrow:after{border:6px solid transparent;border-right-color:#fff;content:"";position:absolute;right:100%;top:50%;transform:translateY(-50%)}.fade-enter-active,.fade-leave-active{transition:opacity .2s ease}.fade-enter-from,.fade-leave-to{opacity:0}
|
|
63
|
-
</style>
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface TooltipProps {
|
|
2
|
+
text?: string;
|
|
3
|
+
delay?: number;
|
|
4
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
5
|
+
}
|
|
6
|
+
declare var __VLS_17: {}, __VLS_24: {};
|
|
3
7
|
type __VLS_Slots = {} & {
|
|
4
|
-
default?: (props: typeof
|
|
8
|
+
default?: (props: typeof __VLS_17) => any;
|
|
5
9
|
} & {
|
|
6
|
-
text?: (props: typeof
|
|
10
|
+
text?: (props: typeof __VLS_24) => any;
|
|
7
11
|
};
|
|
8
12
|
declare const __VLS_base: import("vue").DefineComponent<TooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TooltipProps> & Readonly<{}>, {
|
|
9
13
|
delay: number;
|
|
10
|
-
position:
|
|
11
|
-
arrow: boolean;
|
|
14
|
+
position: "top" | "bottom" | "left" | "right";
|
|
12
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
17
|
declare const _default: typeof __VLS_export;
|
|
@@ -14,11 +14,11 @@ const forwarded = useForwardPropsEmits(props, emits);
|
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<template>
|
|
17
|
-
<TooltipRoot
|
|
18
|
-
v-slot="slotProps"
|
|
19
|
-
data-slot="tooltip"
|
|
20
|
-
v-bind="forwarded"
|
|
21
|
-
>
|
|
22
|
-
<slot v-bind="slotProps" />
|
|
23
|
-
</TooltipRoot>
|
|
17
|
+
<TooltipRoot
|
|
18
|
+
v-slot="slotProps"
|
|
19
|
+
data-slot="tooltip"
|
|
20
|
+
v-bind="forwarded"
|
|
21
|
+
>
|
|
22
|
+
<slot v-bind="slotProps" />
|
|
23
|
+
</TooltipRoot>
|
|
24
24
|
</template>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
TooltipArrow,
|
|
5
|
+
TooltipContent,
|
|
6
|
+
TooltipPortal,
|
|
7
|
+
useForwardPropsEmits
|
|
8
|
+
} from "reka-ui";
|
|
4
9
|
import { cn } from "@/runtime/plugins/shadcn";
|
|
5
10
|
defineOptions({
|
|
6
11
|
inheritAttrs: false
|
|
@@ -30,15 +35,22 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
30
35
|
</script>
|
|
31
36
|
|
|
32
37
|
<template>
|
|
33
|
-
<TooltipPortal>
|
|
34
|
-
<TooltipContent
|
|
35
|
-
data-slot="tooltip-content"
|
|
36
|
-
v-bind="{ ...forwarded, ...$attrs }"
|
|
37
|
-
:class="
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
<TooltipPortal>
|
|
39
|
+
<TooltipContent
|
|
40
|
+
data-slot="tooltip-content"
|
|
41
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
42
|
+
:class="
|
|
43
|
+
cn(
|
|
44
|
+
'bg-white text-black animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-body-medium border border-silver shadow-md',
|
|
45
|
+
props.class
|
|
46
|
+
)
|
|
47
|
+
"
|
|
48
|
+
>
|
|
49
|
+
<slot />
|
|
50
|
+
|
|
51
|
+
<TooltipArrow
|
|
52
|
+
class="bg-white fill-white z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] border-b border-silver shadow-md"
|
|
53
|
+
/>
|
|
54
|
+
</TooltipContent>
|
|
55
|
+
</TooltipPortal>
|
|
44
56
|
</template>
|
|
@@ -8,10 +8,10 @@ const props = defineProps({
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<template>
|
|
11
|
-
<TooltipTrigger
|
|
12
|
-
data-slot="tooltip-trigger"
|
|
13
|
-
v-bind="props"
|
|
14
|
-
>
|
|
15
|
-
<slot />
|
|
16
|
-
</TooltipTrigger>
|
|
11
|
+
<TooltipTrigger
|
|
12
|
+
data-slot="tooltip-trigger"
|
|
13
|
+
v-bind="props"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</TooltipTrigger>
|
|
17
17
|
</template>
|