@indielayer/ui 1.15.1 → 1.15.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 (34) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/docs/components/common/CodeSnippet.vue +4 -3
  4. package/lib/components/index.js +117 -116
  5. package/lib/components/popover/Popover.vue2.js +2 -3
  6. package/lib/components/popover/Popover.vue3.js +3 -2
  7. package/lib/components/select/Select.vue.js +1 -1
  8. package/lib/components/tooltip/ToggleTip.vue.js +7 -7
  9. package/lib/components/tooltip/Tooltip.vue.d.ts +29 -9
  10. package/lib/components/tooltip/Tooltip.vue.js +114 -35
  11. package/lib/components/tooltip/index.d.ts +1 -1
  12. package/lib/components/tooltip/theme/Tooltip.base.theme.d.ts +3 -0
  13. package/lib/components/tooltip/theme/Tooltip.base.theme.js +8 -0
  14. package/lib/components/tooltip/theme/Tooltip.carbon.theme.d.ts +3 -0
  15. package/lib/components/tooltip/theme/Tooltip.carbon.theme.js +5 -0
  16. package/lib/index.js +1 -1
  17. package/lib/index.umd.js +4 -4
  18. package/lib/theme.d.ts +2 -1
  19. package/lib/themes/base/components.d.ts +1 -0
  20. package/lib/themes/base/components.js +12 -10
  21. package/lib/themes/carbon/components.d.ts +1 -0
  22. package/lib/themes/carbon/components.js +12 -10
  23. package/lib/version.d.ts +1 -1
  24. package/lib/version.js +1 -1
  25. package/package.json +2 -2
  26. package/src/components/tooltip/ToggleTip.vue +1 -1
  27. package/src/components/tooltip/Tooltip.vue +185 -15
  28. package/src/components/tooltip/index.ts +1 -1
  29. package/src/components/tooltip/theme/Tooltip.base.theme.ts +9 -0
  30. package/src/components/tooltip/theme/Tooltip.carbon.theme.ts +7 -0
  31. package/src/theme.ts +2 -0
  32. package/src/themes/base/components.ts +1 -0
  33. package/src/themes/carbon/components.ts +1 -0
  34. package/src/version.ts +1 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 - Indielayer
3
+ Copyright (c) 2024-present - Indielayer
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -39,4 +39,4 @@ The documentation is located inside [/packages/ui/docs](./packages/ui/docs)
39
39
 
40
40
  [MIT](./LICENSE)
41
41
 
42
- Copyright (c) 2024, Indielayer
42
+ Copyright (c) 2024-present - Indielayer
@@ -1,10 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { onMounted, ref } from 'vue'
3
- import { getHighlighter } from 'shiki'
3
+ import { createHighlighter } from 'shiki'
4
4
  import indielayerTheme from './Indielayer-theme.json'
5
5
 
6
- const highlighter = getHighlighter({
6
+ const highlighter = createHighlighter({
7
7
  langs: ['js', 'ts', 'vue-html', 'bash', 'vue'],
8
+ themes: [indielayerTheme as any],
8
9
  })
9
10
 
10
11
  const props = defineProps({
@@ -23,7 +24,7 @@ const highlighted = ref('')
23
24
 
24
25
  onMounted(async () => {
25
26
  await (await highlighter).loadTheme(indielayerTheme as any)
26
- highlighted.value = (await highlighter).codeToHtml(props.code, { lang: props.lang, theme: 'Indielayer' })
27
+ highlighted.value = (await highlighter).codeToHtml(props.code || '', { lang: props.lang, theme: 'Indielayer' })
27
28
  })
28
29
  </script>
29
30
 
@@ -1,119 +1,120 @@
1
- import { default as a } from "./accordion/Accordion.vue.js";
2
- import { default as f } from "./accordion/AccordionItem.vue.js";
3
- import { default as d } from "./badge/Badge.vue.js";
4
- import { default as u } from "./breadcrumbs/Breadcrumbs.vue.js";
5
- import { default as s } from "./card/Card.vue.js";
6
- import { default as X } from "./carousel/Carousel.vue.js";
7
- import { default as n } from "./container/Container.vue.js";
8
- import { default as c } from "./datepicker/Datepicker.vue.js";
1
+ import { default as t } from "./accordion/Accordion.vue.js";
2
+ import { default as l } from "./accordion/AccordionItem.vue.js";
3
+ import { default as p } from "./badge/Badge.vue.js";
4
+ import { default as m } from "./breadcrumbs/Breadcrumbs.vue.js";
5
+ import { default as x } from "./card/Card.vue.js";
6
+ import { default as i } from "./carousel/Carousel.vue.js";
7
+ import { default as T } from "./container/Container.vue.js";
8
+ import { default as b } from "./datepicker/Datepicker.vue.js";
9
9
  import "./datepicker/Datepicker.vue2.js";
10
- import { default as g } from "./divider/Divider.vue.js";
11
- import { default as S } from "./drawer/Drawer.vue.js";
12
- import { default as P } from "./form/Form.vue.js";
13
- import { default as B } from "./formGroup/FormGroup.vue.js";
14
- import { default as A } from "./image/Image.vue.js";
15
- import { default as F } from "./menu/Menu.vue.js";
16
- import { default as L } from "./modal/Modal.vue.js";
17
- import { default as h } from "./notifications/Notifications.vue.js";
18
- import { default as H } from "./pagination/Pagination.vue.js";
19
- import { default as y } from "./progress/Progress.vue.js";
20
- import { default as Q } from "./qrCode/QrCode.vue.js";
21
- import { default as j } from "./select/Select.vue.js";
22
- import { default as z } from "./skeleton/Skeleton.vue.js";
23
- import { default as J } from "./stepper/Stepper.vue.js";
24
- import { default as O } from "./tab/Tab.vue.js";
25
- import { default as W } from "./tab/TabGroup.vue.js";
26
- import { default as Z } from "./table/Table.vue.js";
27
- import { default as $ } from "./textarea/Textarea.vue.js";
28
- import { default as oe } from "./themeProvider/ThemeProvider.vue.js";
29
- import { default as ae } from "./toggle/Toggle.vue.js";
30
- import { default as fe } from "./upload/Upload.vue.js";
31
- import { default as de } from "./alert/Alert.vue.js";
32
- import { default as ue } from "./avatar/Avatar.vue.js";
33
- import { default as se } from "./button/Button.vue.js";
34
- import { default as Xe } from "./button/ButtonGroup.vue.js";
35
- import { default as ne } from "./carousel/CarouselSlide.vue.js";
36
- import { default as ce } from "./checkbox/Checkbox.vue.js";
37
- import { default as ge } from "./icon/Icon.vue.js";
38
- import { default as Se } from "./input/Input.vue.js";
39
- import { default as Pe } from "./inputFooter/InputFooter.vue.js";
40
- import { default as Be } from "./label/Label.vue.js";
41
- import { default as Ae } from "./link/Link.vue.js";
42
- import { default as Fe } from "./loader/Loader.vue.js";
43
- import { default as Le } from "./menu/MenuItem.vue.js";
44
- import { default as he } from "./pagination/PaginationItem.vue.js";
45
- import { default as He } from "./popover/Popover.vue.js";
46
- import { default as ye } from "./popover/PopoverContainer.vue.js";
47
- import { default as Qe } from "./radio/Radio.vue.js";
48
- import { default as je } from "./scroll/Scroll.vue.js";
49
- import { default as ze } from "./slider/Slider.vue.js";
50
- import { default as Je } from "./spacer/Spacer.js";
51
- import { default as Oe } from "./spinner/Spinner.vue.js";
52
- import { default as We } from "./table/TableBody.js";
53
- import { default as Ze } from "./table/TableCell.vue.js";
54
- import { default as $e } from "./table/TableHead.vue.js";
55
- import { default as oo } from "./table/TableHeader.vue.js";
56
- import { default as ao } from "./table/TableRow.vue.js";
57
- import { default as fo } from "./tag/Tag.vue.js";
58
- import { default as po } from "./tooltip/Tooltip.vue.js";
59
- import { default as mo } from "./tooltip/ToggleTip.vue.js";
10
+ import { default as C } from "./divider/Divider.vue.js";
11
+ import { default as I } from "./drawer/Drawer.vue.js";
12
+ import { default as v } from "./form/Form.vue.js";
13
+ import { default as k } from "./formGroup/FormGroup.vue.js";
14
+ import { default as D } from "./image/Image.vue.js";
15
+ import { default as G } from "./menu/Menu.vue.js";
16
+ import { default as M } from "./modal/Modal.vue.js";
17
+ import { default as w } from "./notifications/Notifications.vue.js";
18
+ import { default as R } from "./pagination/Pagination.vue.js";
19
+ import { default as N } from "./popover/Popover.vue.js";
20
+ import "./popover/Popover.vue2.js";
21
+ import { default as U } from "./popover/PopoverContainer.vue.js";
22
+ import { default as q } from "./progress/Progress.vue.js";
23
+ import { default as E } from "./qrCode/QrCode.vue.js";
24
+ import { default as K } from "./select/Select.vue.js";
25
+ import { default as V } from "./skeleton/Skeleton.vue.js";
26
+ import { default as Y } from "./stepper/Stepper.vue.js";
27
+ import { default as _ } from "./tab/Tab.vue.js";
28
+ import { default as ee } from "./tab/TabGroup.vue.js";
29
+ import { default as re } from "./table/Table.vue.js";
30
+ import { default as te } from "./textarea/Textarea.vue.js";
31
+ import { default as le } from "./themeProvider/ThemeProvider.vue.js";
32
+ import { default as pe } from "./toggle/Toggle.vue.js";
33
+ import { default as me } from "./upload/Upload.vue.js";
34
+ import { default as xe } from "./alert/Alert.vue.js";
35
+ import { default as ie } from "./avatar/Avatar.vue.js";
36
+ import { default as Te } from "./button/Button.vue.js";
37
+ import { default as be } from "./button/ButtonGroup.vue.js";
38
+ import { default as Ce } from "./carousel/CarouselSlide.vue.js";
39
+ import { default as Ie } from "./checkbox/Checkbox.vue.js";
40
+ import { default as ve } from "./icon/Icon.vue.js";
41
+ import { default as ke } from "./input/Input.vue.js";
42
+ import { default as De } from "./inputFooter/InputFooter.vue.js";
43
+ import { default as Ge } from "./label/Label.vue.js";
44
+ import { default as Me } from "./link/Link.vue.js";
45
+ import { default as we } from "./loader/Loader.vue.js";
46
+ import { default as Re } from "./menu/MenuItem.vue.js";
47
+ import { default as Ne } from "./pagination/PaginationItem.vue.js";
48
+ import { default as Ue } from "./radio/Radio.vue.js";
49
+ import { default as qe } from "./scroll/Scroll.vue.js";
50
+ import { default as Ee } from "./slider/Slider.vue.js";
51
+ import { default as Ke } from "./spacer/Spacer.js";
52
+ import { default as Ve } from "./spinner/Spinner.vue.js";
53
+ import { default as Ye } from "./table/TableBody.js";
54
+ import { default as _e } from "./table/TableCell.vue.js";
55
+ import { default as eo } from "./table/TableHead.vue.js";
56
+ import { default as ro } from "./table/TableHeader.vue.js";
57
+ import { default as to } from "./table/TableRow.vue.js";
58
+ import { default as lo } from "./tag/Tag.vue.js";
59
+ import { default as uo } from "./tooltip/Tooltip.vue.js";
60
+ import { default as so } from "./tooltip/ToggleTip.vue.js";
60
61
  export {
61
- a as XAccordion,
62
- f as XAccordionItem,
63
- de as XAlert,
64
- ue as XAvatar,
65
- d as XBadge,
66
- u as XBreadcrumbs,
67
- se as XButton,
68
- Xe as XButtonGroup,
69
- s as XCard,
70
- X as XCarousel,
71
- ne as XCarouselSlide,
72
- ce as XCheckbox,
73
- n as XContainer,
74
- c as XDatepicker,
75
- g as XDivider,
76
- S as XDrawer,
77
- P as XForm,
78
- B as XFormGroup,
79
- ge as XIcon,
80
- A as XImage,
81
- Se as XInput,
82
- Pe as XInputFooter,
83
- Be as XLabel,
84
- Ae as XLink,
85
- Fe as XLoader,
86
- F as XMenu,
87
- Le as XMenuItem,
88
- L as XModal,
89
- h as XNotifications,
90
- H as XPagination,
91
- he as XPaginationItem,
92
- He as XPopover,
93
- ye as XPopoverContainer,
94
- y as XProgress,
95
- Q as XQrCode,
96
- Qe as XRadio,
97
- je as XScroll,
98
- j as XSelect,
99
- z as XSkeleton,
100
- ze as XSlider,
101
- Je as XSpacer,
102
- Oe as XSpinner,
103
- J as XStepper,
104
- O as XTab,
105
- W as XTabGroup,
106
- Z as XTable,
107
- We as XTableBody,
108
- Ze as XTableCell,
109
- $e as XTableHead,
110
- oo as XTableHeader,
111
- ao as XTableRow,
112
- fo as XTag,
113
- $ as XTextarea,
114
- oe as XThemeProvider,
115
- ae as XToggle,
116
- mo as XToggleTip,
117
- po as XTooltip,
118
- fe as XUpload
62
+ t as XAccordion,
63
+ l as XAccordionItem,
64
+ xe as XAlert,
65
+ ie as XAvatar,
66
+ p as XBadge,
67
+ m as XBreadcrumbs,
68
+ Te as XButton,
69
+ be as XButtonGroup,
70
+ x as XCard,
71
+ i as XCarousel,
72
+ Ce as XCarouselSlide,
73
+ Ie as XCheckbox,
74
+ T as XContainer,
75
+ b as XDatepicker,
76
+ C as XDivider,
77
+ I as XDrawer,
78
+ v as XForm,
79
+ k as XFormGroup,
80
+ ve as XIcon,
81
+ D as XImage,
82
+ ke as XInput,
83
+ De as XInputFooter,
84
+ Ge as XLabel,
85
+ Me as XLink,
86
+ we as XLoader,
87
+ G as XMenu,
88
+ Re as XMenuItem,
89
+ M as XModal,
90
+ w as XNotifications,
91
+ R as XPagination,
92
+ Ne as XPaginationItem,
93
+ N as XPopover,
94
+ U as XPopoverContainer,
95
+ q as XProgress,
96
+ E as XQrCode,
97
+ Ue as XRadio,
98
+ qe as XScroll,
99
+ K as XSelect,
100
+ V as XSkeleton,
101
+ Ee as XSlider,
102
+ Ke as XSpacer,
103
+ Ve as XSpinner,
104
+ Y as XStepper,
105
+ _ as XTab,
106
+ ee as XTabGroup,
107
+ re as XTable,
108
+ Ye as XTableBody,
109
+ _e as XTableCell,
110
+ eo as XTableHead,
111
+ ro as XTableHeader,
112
+ to as XTableRow,
113
+ lo as XTag,
114
+ te as XTextarea,
115
+ le as XThemeProvider,
116
+ pe as XToggle,
117
+ so as XToggleTip,
118
+ uo as XTooltip,
119
+ me as XUpload
119
120
  };
@@ -1,5 +1,4 @@
1
- import o from "./Popover.vue.js";
2
- import "./Popover.vue3.js";
1
+ const e = "";
3
2
  export {
4
- o as default
3
+ e as default
5
4
  };
@@ -1,4 +1,5 @@
1
- const e = "";
1
+ import o from "./Popover.vue.js";
2
+ import "./Popover.vue2.js";
2
3
  export {
3
- e as default
4
+ o as default
4
5
  };
@@ -13,7 +13,7 @@ import me from "../icon/Icon.vue.js";
13
13
  import ll from "../menu/MenuItem.vue.js";
14
14
  import tl from "../spinner/Spinner.vue.js";
15
15
  import ye from "../popover/Popover.vue.js";
16
- import "../popover/Popover.vue3.js";
16
+ import "../popover/Popover.vue2.js";
17
17
  import be from "../popover/PopoverContainer.vue.js";
18
18
  import al from "../inputFooter/InputFooter.vue.js";
19
19
  import il from "../input/Input.vue.js";
@@ -1,22 +1,22 @@
1
- import { defineComponent as r, computed as i, openBlock as p, createBlock as s, withCtx as o, createElementVNode as a, createVNode as m } from "vue";
1
+ import { defineComponent as r, computed as i, openBlock as s, createBlock as p, withCtx as o, createElementVNode as a, createVNode as m } from "vue";
2
2
  import l from "./Tooltip.vue.js";
3
3
  import _ from "../icon/Icon.vue.js";
4
4
  import { infoIcon as d } from "../../common/icons.js";
5
- const u = ["innerHTML"], f = {
5
+ const f = ["innerHTML"], u = {
6
6
  content: String,
7
7
  icon: String
8
8
  }, g = { name: "XToggleTip" }, y = /* @__PURE__ */ r({
9
9
  ...g,
10
- props: f,
10
+ props: u,
11
11
  setup(t) {
12
- const e = t, n = i(() => e.icon || d);
13
- return (c, T) => (p(), s(l, { placement: "auto" }, {
12
+ const n = t, e = i(() => n.icon || d);
13
+ return (c, T) => (s(), p(l, { position: "right" }, {
14
14
  tooltip: o(() => [
15
- a("div", { innerHTML: c.content }, null, 8, u)
15
+ a("div", { innerHTML: c.content }, null, 8, f)
16
16
  ]),
17
17
  default: o(() => [
18
18
  m(_, {
19
- icon: n.value,
19
+ icon: e.value,
20
20
  class: "text-secondary-500 dark:text-secondary-300 cursor-pointer"
21
21
  }, null, 8, ["icon"])
22
22
  ]),
@@ -1,28 +1,48 @@
1
1
  import type { ExtractPublicPropTypes, PropType } from 'vue';
2
- import { type Placement } from 'floating-vue';
2
+ import { type ThemeComponent } from '../../composables/useTheme';
3
3
  declare const tooltipProps: {
4
+ tag: {
5
+ type: StringConstructor;
6
+ default: string;
7
+ };
4
8
  tooltip: StringConstructor;
5
- placement: {
6
- type: PropType<Placement>;
9
+ disabled: BooleanConstructor;
10
+ position: {
11
+ type: PropType<TooltipPosition>;
7
12
  default: string;
8
13
  };
9
14
  };
10
- export type PopoverPlacement = Placement;
15
+ export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
11
16
  export type TooltipProps = ExtractPublicPropTypes<typeof tooltipProps>;
17
+ type InternalClasses = 'tooltip';
18
+ export interface TooltipTheme extends ThemeComponent<TooltipProps, InternalClasses> {
19
+ }
12
20
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
21
+ tag: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
13
25
  tooltip: StringConstructor;
14
- placement: {
15
- type: PropType<Placement>;
26
+ disabled: BooleanConstructor;
27
+ position: {
28
+ type: PropType<TooltipPosition>;
16
29
  default: string;
17
30
  };
18
31
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
32
+ tag: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
19
36
  tooltip: StringConstructor;
20
- placement: {
21
- type: PropType<Placement>;
37
+ disabled: BooleanConstructor;
38
+ position: {
39
+ type: PropType<TooltipPosition>;
22
40
  default: string;
23
41
  };
24
42
  }>> & Readonly<{}>, {
25
- placement: Placement;
43
+ disabled: boolean;
44
+ tag: string;
45
+ position: TooltipPosition;
26
46
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
27
47
  default?(_: {}): any;
28
48
  tooltip?(_: {}): any;
@@ -1,43 +1,122 @@
1
- import { defineComponent as r, openBlock as a, createBlock as l, withCtx as e, createElementVNode as s, createVNode as i, renderSlot as o, createTextVNode as n, toDisplayString as p } from "vue";
2
- import c from "../popover/Popover.vue.js";
3
- import "../popover/Popover.vue3.js";
4
- import m from "../popover/PopoverContainer.vue.js";
5
- import "../../node_modules/.pnpm/floating-vue@5.2.2_@nuxt_kit@3.10.1_rollup@3.29.4__vue@3.5.10_typescript@5.2.2_/node_modules/floating-vue/dist/floating-vue.js";
6
- const d = { class: "dark" }, f = {
1
+ import { defineComponent as M, ref as n, useSlots as W, computed as r, openBlock as p, createElementBlock as w, Fragment as F, createBlock as y, resolveDynamicComponent as O, normalizeClass as f, unref as k, withCtx as C, renderSlot as T, Teleport as X, createVNode as j, Transition as q, normalizeStyle as A, createTextVNode as G, toDisplayString as I, createElementVNode as R, createCommentVNode as S } from "vue";
2
+ import { useTheme as J } from "../../composables/useTheme.js";
3
+ const K = {
4
+ tag: {
5
+ type: String,
6
+ default: "div"
7
+ },
7
8
  tooltip: String,
8
- placement: {
9
+ disabled: Boolean,
10
+ position: {
9
11
  type: String,
10
12
  default: "bottom"
11
13
  }
12
- }, _ = { name: "XTooltip" }, $ = /* @__PURE__ */ r({
13
- ..._,
14
- props: f,
15
- setup(u) {
16
- return (t, h) => (a(), l(c, {
17
- triggers: ["hover", "click"],
18
- class: "inline-block",
19
- "hide-arrow": !1,
20
- placement: t.placement
21
- }, {
22
- content: e(() => [
23
- s("div", d, [
24
- i(m, { class: "p-2 text-white text-xs w-max max-w-xs" }, {
25
- default: e(() => [
26
- o(t.$slots, "tooltip", {}, () => [
27
- n(p(t.tooltip), 1)
28
- ])
29
- ]),
30
- _: 3
31
- })
32
- ])
33
- ]),
34
- default: e(() => [
35
- o(t.$slots, "default")
36
- ]),
37
- _: 3
38
- }, 8, ["placement"]));
14
+ }, L = { name: "XTooltip" }, Y = /* @__PURE__ */ M({
15
+ ...L,
16
+ props: K,
17
+ setup(_) {
18
+ const a = _, u = n(null), h = n(null), g = n(!1), b = n({}), c = n(a.position), B = W(), N = r(() => a.tooltip || B.tooltip), d = r(() => a.disabled || !N.value), V = r(() => ({
19
+ top: "-bottom-2.5 left-1/2 -translate-x-1/2 w-3.5",
20
+ bottom: "-top-2.5 left-1/2 -translate-x-1/2 w-3.5",
21
+ left: "-right-2.5 top-1/2 -translate-y-1/2 h-3.5",
22
+ right: "-left-2.5 top-1/2 -translate-y-1/2 h-3.5"
23
+ })[c.value]), $ = r(() => ({
24
+ top: "-rotate-45 origin-top-left",
25
+ bottom: "rotate-45 origin-bottom-left",
26
+ left: "rotate-45 origin-top-left",
27
+ right: "-rotate-45 origin-top-right"
28
+ })[c.value]), x = r(() => ({
29
+ top: "origin-bottom",
30
+ bottom: "origin-top",
31
+ left: "origin-right",
32
+ right: "origin-left"
33
+ })[c.value]), z = () => {
34
+ if (!u.value || !h.value)
35
+ return;
36
+ const t = u.value.getBoundingClientRect(), e = h.value.getBoundingClientRect(), l = 8, m = window.innerWidth, v = window.innerHeight;
37
+ let s = a.position, o = 0, i = 0;
38
+ switch (s) {
39
+ case "top":
40
+ o = t.top - e.height - l, i = t.left + t.width / 2 - e.width / 2, o < 0 && (s = "bottom", o = t.bottom + l);
41
+ break;
42
+ case "bottom":
43
+ o = t.bottom + l, i = t.left + t.width / 2 - e.width / 2, o + e.height > v && (s = "top", o = t.top - e.height - l);
44
+ break;
45
+ case "left":
46
+ o = t.top + t.height / 2 - e.height / 2, i = t.left - e.width - l, i < 0 && (s = "right", i = t.right + l);
47
+ break;
48
+ case "right":
49
+ o = t.top + t.height / 2 - e.height / 2, i = t.right + l, i + e.width > m && (s = "left", i = t.left - e.width - l);
50
+ break;
51
+ }
52
+ (s === "top" || s === "bottom") && (i < 0 && (i = l), i + e.width > m && (i = m - e.width - l)), (s === "left" || s === "right") && (o < 0 && (o = l), o + e.height > v && (o = v - e.height - l)), c.value = s, b.value = {
53
+ top: `${o}px`,
54
+ left: `${i}px`
55
+ };
56
+ }, P = () => {
57
+ d.value || (g.value = !0, setTimeout(z, 0));
58
+ }, D = () => {
59
+ d.value || (g.value = !1);
60
+ }, { classes: E, className: H } = J("Tooltip", {}, a);
61
+ return (t, e) => (p(), w(F, null, [
62
+ (p(), y(O(t.tag), {
63
+ ref_key: "triggerRef",
64
+ ref: u,
65
+ class: f([
66
+ k(H),
67
+ {
68
+ "inline-block": !t.$attrs.class
69
+ }
70
+ ]),
71
+ onMouseenter: P,
72
+ onMouseleave: D
73
+ }, {
74
+ default: C(() => [
75
+ T(t.$slots, "default")
76
+ ]),
77
+ _: 3
78
+ }, 40, ["class"])),
79
+ d.value ? S("", !0) : (p(), y(X, {
80
+ key: 0,
81
+ to: "body"
82
+ }, [
83
+ j(q, {
84
+ "enter-active-class": "transition-opacity duration-150 ease-out",
85
+ "leave-active-class": "transition-opacity duration-150 ease-in",
86
+ "enter-from-class": "opacity-0",
87
+ "enter-to-class": "opacity-100",
88
+ "leave-from-class": "opacity-100",
89
+ "leave-to-class": "opacity-0"
90
+ }, {
91
+ default: C(() => [
92
+ g.value ? (p(), w("div", {
93
+ key: 0,
94
+ ref_key: "tooltipRef",
95
+ ref: h,
96
+ style: A(b.value),
97
+ class: f(["fixed z-[9999] pointer-events-none", [
98
+ k(E).tooltip,
99
+ x.value
100
+ ]])
101
+ }, [
102
+ T(t.$slots, "tooltip", {}, () => [
103
+ G(I(t.tooltip), 1)
104
+ ]),
105
+ R("div", {
106
+ class: f(["absolute overflow-hidden shadow-lg z-10", V.value])
107
+ }, [
108
+ R("div", {
109
+ class: f(["h-2.5 w-2.5 bg-secondary-700 transform border border-secondary-800", $.value])
110
+ }, null, 2)
111
+ ], 2)
112
+ ], 6)) : S("", !0)
113
+ ]),
114
+ _: 3
115
+ })
116
+ ]))
117
+ ], 64));
39
118
  }
40
119
  });
41
120
  export {
42
- $ as default
121
+ Y as default
43
122
  };
@@ -1,4 +1,4 @@
1
1
  export { default as XTooltip } from './Tooltip.vue';
2
- export type { TooltipProps } from './Tooltip.vue';
2
+ export type { TooltipProps, TooltipTheme } from './Tooltip.vue';
3
3
  export { default as XToggleTip } from './ToggleTip.vue';
4
4
  export type { ToggleTipProps } from './ToggleTip.vue';
@@ -0,0 +1,3 @@
1
+ import type { TooltipTheme } from '../Tooltip.vue';
2
+ declare const theme: TooltipTheme;
3
+ export default theme;
@@ -0,0 +1,8 @@
1
+ const e = {
2
+ classes: {
3
+ tooltip: "bg-secondary-700 shadow-lg rounded-md border border-secondary-800 p-2 text-white text-xs w-max max-w-sm"
4
+ }
5
+ }, s = e;
6
+ export {
7
+ s as default
8
+ };
@@ -0,0 +1,3 @@
1
+ import type { TooltipTheme } from '../Tooltip.vue';
2
+ declare const theme: TooltipTheme;
3
+ export default theme;
@@ -0,0 +1,5 @@
1
+ import e from "./Tooltip.base.theme.js";
2
+ const t = e, o = t;
3
+ export {
4
+ o as default
5
+ };