@leaflink/stash 51.5.1 → 51.5.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.
- package/dist/Carousel.js +9 -9
- package/dist/Carousel.js.map +1 -1
- package/dist/DataViewToolbar.js +9 -9
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/ObfuscateText.js +5 -5
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/SelectStatus.js +13 -13
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Switch.js +8 -8
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +5 -5
- package/dist/Tab.js.map +1 -1
- package/dist/Toast.js +189 -184
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.vue.d.ts +4 -0
- package/dist/Toasts.js +13 -12
- package/dist/Toasts.js.map +1 -1
- package/dist/Tooltip.js +8 -8
- package/dist/Tooltip.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/useToasts.d.ts +6 -0
- package/dist/useToasts.js +28 -23
- package/dist/useToasts.js.map +1 -1
- package/package.json +5 -4
package/dist/Tooltip.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as g, ref as n, computed as r, createElementBlock as S, openBlock as d, createElementVNode as i, createBlock as T, renderSlot as l, Teleport as E, normalizeStyle as f, unref as $, createTextVNode as k, toDisplayString as B } from "vue";
|
|
2
|
-
import { u as D, a as O, f as
|
|
3
|
-
import { a as
|
|
4
|
-
const
|
|
2
|
+
import { u as D, a as O, f as z, o as A, b as F } from "./floating-ui.vue-pzUuloyX.js";
|
|
3
|
+
import { a as I } from "./index-ConQ3o31.js";
|
|
4
|
+
const P = {
|
|
5
5
|
ref: "wrapper",
|
|
6
|
-
class: "stash-tooltip__wrapper tw-relative tw-inline-flex tw-
|
|
6
|
+
class: "stash-tooltip__wrapper tw-relative tw-inline-flex tw-size-fit"
|
|
7
7
|
}, M = 6, N = 12, X = /* @__PURE__ */ g({
|
|
8
8
|
__name: "Tooltip",
|
|
9
9
|
props: {
|
|
@@ -20,10 +20,10 @@ const z = {
|
|
|
20
20
|
right: "left",
|
|
21
21
|
bottom: "top",
|
|
22
22
|
left: "right"
|
|
23
|
-
}, t = u, a = n(null), p = n(null), c = n(null), { isOutside: h } =
|
|
23
|
+
}, t = u, a = n(null), p = n(null), c = n(null), { isOutside: h } = I(a), y = r(() => !t.isDisabled && (!h.value || t.isOpen)), _ = r(() => t.side), { floatingStyles: x, middlewareData: o, placement: b } = D(a, c, {
|
|
24
24
|
whileElementsMounted: O,
|
|
25
25
|
placement: _,
|
|
26
|
-
middleware: [
|
|
26
|
+
middleware: [z(), A(N), F({ element: p })]
|
|
27
27
|
}), v = r(() => {
|
|
28
28
|
var s, w;
|
|
29
29
|
const e = m[b.value];
|
|
@@ -33,7 +33,7 @@ const z = {
|
|
|
33
33
|
[e]: `-${M}px`
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
|
-
return (e, s) => (d(), S("div",
|
|
36
|
+
return (e, s) => (d(), S("div", P, [
|
|
37
37
|
i("span", {
|
|
38
38
|
ref_key: "anchor",
|
|
39
39
|
ref: a,
|
|
@@ -65,7 +65,7 @@ const z = {
|
|
|
65
65
|
i("div", {
|
|
66
66
|
ref_key: "floatingArrow",
|
|
67
67
|
ref: p,
|
|
68
|
-
class: "stash-tooltip__arrow tw-absolute tw-z-behind tw-
|
|
68
|
+
class: "stash-tooltip__arrow tw-absolute tw-z-behind tw-size-[12px] tw-rotate-45 tw-bg-ice-900",
|
|
69
69
|
style: f(v.value)
|
|
70
70
|
}, null, 4)
|
|
71
71
|
], 4)
|
package/dist/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../src/components/Tooltip/Tooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { arrow, autoUpdate, flip, offset, type Side, useFloating } from '@floating-ui/vue';\n import { useMouseInElement } from '@vueuse/core';\n import { computed, ref } from 'vue';\n\n export type TooltipSide = Side;\n\n const ARROW_OFFSET_PX = 6;\n const OFFSET_DISTANCE_PX = 12;\n\n const SIDE_MAP: Record<TooltipSide, TooltipSide> = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n };\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n export interface TooltipSlots {\n /**\n * The content to display in the tooltip. This may be text node, an element, or a component.\n */\n content: any;\n /**\n * The default slot is the element or component to which the tooltip will be anchored.\n */\n default: any;\n /**\n * A slot for the primary icon. This icon will be displayed before the text or content.\n */\n icon: any;\n /**\n * A slot for the secondary icon. This icon will be displayed after the text or content.\n */\n secondaryIcon: any;\n }\n /* eslint-enable @typescript-eslint/no-explicit-any */\n\n defineSlots<TooltipSlots>();\n\n export interface TooltipProps {\n /**\n * Disables teleporting the popover menu to an external element\n * @default false\n */\n disableTeleport?: boolean;\n /**\n * Sets the placement of the menu\n * @default 'top'\n */\n side?: TooltipSide;\n /**\n * Disables the tooltip\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Sets if the menu is open. If not set from the parent context, the menu will be controlled internally.\n * @default false\n */\n isOpen?: boolean;\n /**\n * The query selector where the tooltip should be teleported\n * @default '#stash-menus-mount-node'\n */\n teleportTo?: string | HTMLElement;\n /**\n * String content to display within the tooltip\n * @default ''\n */\n text?: string;\n }\n\n const props = withDefaults(defineProps<TooltipProps>(), {\n disableTeleport: false,\n isDisabled: false,\n isOpen: false,\n side: 'top',\n teleportTo: '#stash-menus-mount-node',\n text: '',\n });\n\n const anchor = ref<HTMLElement | null>(null);\n const floatingArrow = ref<HTMLElement | null>(null);\n const tooltip = ref<HTMLElement | null>(null);\n\n const { isOutside } = useMouseInElement(anchor);\n\n const open = computed(() => !props.isDisabled && (!isOutside.value || props.isOpen));\n const placementSetting = computed(() => props.side);\n\n const { floatingStyles, middlewareData, placement } = useFloating(anchor, tooltip, {\n whileElementsMounted: autoUpdate,\n placement: placementSetting,\n middleware: [flip(), offset(OFFSET_DISTANCE_PX), arrow({ element: floatingArrow })],\n });\n\n const arrowStyles = computed(() => {\n const arrowPosition = SIDE_MAP[placement.value];\n\n return {\n left: middlewareData.value.arrow?.x != null ? `${middlewareData.value.arrow.x}px` : '',\n top: middlewareData.value.arrow?.y != null ? `${middlewareData.value.arrow.y}px` : '',\n [arrowPosition]: `-${ARROW_OFFSET_PX}px`,\n };\n });\n</script>\n\n<template>\n <div ref=\"wrapper\" class=\"stash-tooltip__wrapper tw-relative tw-inline-flex tw-
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../src/components/Tooltip/Tooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { arrow, autoUpdate, flip, offset, type Side, useFloating } from '@floating-ui/vue';\n import { useMouseInElement } from '@vueuse/core';\n import { computed, ref } from 'vue';\n\n export type TooltipSide = Side;\n\n const ARROW_OFFSET_PX = 6;\n const OFFSET_DISTANCE_PX = 12;\n\n const SIDE_MAP: Record<TooltipSide, TooltipSide> = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n };\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n export interface TooltipSlots {\n /**\n * The content to display in the tooltip. This may be text node, an element, or a component.\n */\n content: any;\n /**\n * The default slot is the element or component to which the tooltip will be anchored.\n */\n default: any;\n /**\n * A slot for the primary icon. This icon will be displayed before the text or content.\n */\n icon: any;\n /**\n * A slot for the secondary icon. This icon will be displayed after the text or content.\n */\n secondaryIcon: any;\n }\n /* eslint-enable @typescript-eslint/no-explicit-any */\n\n defineSlots<TooltipSlots>();\n\n export interface TooltipProps {\n /**\n * Disables teleporting the popover menu to an external element\n * @default false\n */\n disableTeleport?: boolean;\n /**\n * Sets the placement of the menu\n * @default 'top'\n */\n side?: TooltipSide;\n /**\n * Disables the tooltip\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Sets if the menu is open. If not set from the parent context, the menu will be controlled internally.\n * @default false\n */\n isOpen?: boolean;\n /**\n * The query selector where the tooltip should be teleported\n * @default '#stash-menus-mount-node'\n */\n teleportTo?: string | HTMLElement;\n /**\n * String content to display within the tooltip\n * @default ''\n */\n text?: string;\n }\n\n const props = withDefaults(defineProps<TooltipProps>(), {\n disableTeleport: false,\n isDisabled: false,\n isOpen: false,\n side: 'top',\n teleportTo: '#stash-menus-mount-node',\n text: '',\n });\n\n const anchor = ref<HTMLElement | null>(null);\n const floatingArrow = ref<HTMLElement | null>(null);\n const tooltip = ref<HTMLElement | null>(null);\n\n const { isOutside } = useMouseInElement(anchor);\n\n const open = computed(() => !props.isDisabled && (!isOutside.value || props.isOpen));\n const placementSetting = computed(() => props.side);\n\n const { floatingStyles, middlewareData, placement } = useFloating(anchor, tooltip, {\n whileElementsMounted: autoUpdate,\n placement: placementSetting,\n middleware: [flip(), offset(OFFSET_DISTANCE_PX), arrow({ element: floatingArrow })],\n });\n\n const arrowStyles = computed(() => {\n const arrowPosition = SIDE_MAP[placement.value];\n\n return {\n left: middlewareData.value.arrow?.x != null ? `${middlewareData.value.arrow.x}px` : '',\n top: middlewareData.value.arrow?.y != null ? `${middlewareData.value.arrow.y}px` : '',\n [arrowPosition]: `-${ARROW_OFFSET_PX}px`,\n };\n });\n</script>\n\n<template>\n <div ref=\"wrapper\" class=\"stash-tooltip__wrapper tw-relative tw-inline-flex tw-size-fit\">\n <span ref=\"anchor\" data-test=\"stash-tooltip|anchor\" class=\"stash-tooltip__anchor\">\n <slot></slot>\n </span>\n <Teleport :to=\"props.teleportTo\" :disabled=\"props.disableTeleport\">\n <div\n ref=\"tooltip\"\n data-test=\"stash-tooltip\"\n class=\"stash-tooltip tw-pointer-events-none tw-z-screen tw-flex tw-w-[148px] tw-flex-col tw-items-center tw-whitespace-normal tw-rounded tw-bg-ice-900 tw-p-3 tw-text-center tw-text-xs tw-text-white tw-opacity-0 tw-shadow tw-transition-opacity\"\n role=\"tooltip\"\n :style=\"{\n ...floatingStyles,\n opacity: open ? 0.95 : 0,\n }\"\n >\n <slot name=\"icon\"></slot>\n <slot name=\"content\">{{ props.text }}</slot>\n <slot name=\"secondaryIcon\"></slot>\n <div\n ref=\"floatingArrow\"\n class=\"stash-tooltip__arrow tw-absolute tw-z-behind tw-size-[12px] tw-rotate-45 tw-bg-ice-900\"\n :style=\"arrowStyles\"\n ></div>\n </div>\n </Teleport>\n </div>\n</template>\n"],"names":["ARROW_OFFSET_PX","OFFSET_DISTANCE_PX","SIDE_MAP","props","__props","anchor","ref","floatingArrow","tooltip","isOutside","useMouseInElement","open","computed","placementSetting","floatingStyles","middlewareData","placement","useFloating","autoUpdate","flip","offset","arrow","arrowStyles","arrowPosition","_a","_b"],"mappings":";;;;;;GAOQA,IAAkB,GAClBC,IAAqB;;;;;;;;;;;AAE3B,UAAMC,IAA6C;AAAA,MACjD,KAAK;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,MAAM;AAAA,IACR,GA0DMC,IAAQC,GASRC,IAASC,EAAwB,IAAI,GACrCC,IAAgBD,EAAwB,IAAI,GAC5CE,IAAUF,EAAwB,IAAI,GAEtC,EAAE,WAAAG,EAAA,IAAcC,EAAkBL,CAAM,GAExCM,IAAOC,EAAS,MAAM,CAACT,EAAM,eAAe,CAACM,EAAU,SAASN,EAAM,OAAO,GAC7EU,IAAmBD,EAAS,MAAMT,EAAM,IAAI,GAE5C,EAAE,gBAAAW,GAAgB,gBAAAC,GAAgB,WAAAC,EAAc,IAAAC,EAAYZ,GAAQG,GAAS;AAAA,MACjF,sBAAsBU;AAAA,MACtB,WAAWL;AAAA,MACX,YAAY,CAACM,EAAK,GAAGC,EAAOnB,CAAkB,GAAGoB,EAAM,EAAE,SAASd,GAAe,CAAC;AAAA,IAAA,CACnF,GAEKe,IAAcV,EAAS,MAAM;;AAC3B,YAAAW,IAAgBrB,EAASc,EAAU,KAAK;AAEvC,aAAA;AAAA,QACL,QAAMQ,IAAAT,EAAe,MAAM,UAArB,gBAAAS,EAA4B,MAAK,OAAO,GAAGT,EAAe,MAAM,MAAM,CAAC,OAAO;AAAA,QACpF,OAAKU,IAAAV,EAAe,MAAM,UAArB,gBAAAU,EAA4B,MAAK,OAAO,GAAGV,EAAe,MAAM,MAAM,CAAC,OAAO;AAAA,QACnF,CAACQ,CAAa,GAAG,IAAIvB,CAAe;AAAA,MACtC;AAAA,IAAA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|