lizaui 11.0.1 → 11.0.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/chunks/{tooltip-YmWFUKFk.js → tooltip-CkpPQC4G.js} +32 -268
- package/dist/chunks/{tooltip-YmWFUKFk.js.map → tooltip-CkpPQC4G.js.map} +1 -1
- package/dist/chunks/{tooltip-DSaon5An.js → tooltip-vXmBLUoo.js} +33 -269
- package/dist/chunks/{tooltip-DSaon5An.js.map → tooltip-vXmBLUoo.js.map} +1 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/lizaui.css +0 -41
- package/dist/table/index.cjs.js +1 -1
- package/dist/table/index.es.js +1 -1
- package/dist/tooltip/index.cjs.js +1 -1
- package/dist/tooltip/index.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
-
const compilerRuntime = require("react/compiler-runtime");
|
|
4
3
|
const React = require("react");
|
|
5
4
|
const floatingUi_dom = require("./floating-ui.dom-CtdbsjAo.js");
|
|
6
5
|
const ReactDOM = require("react-dom");
|
|
@@ -1927,282 +1926,47 @@ function useRole(context, props) {
|
|
|
1927
1926
|
item
|
|
1928
1927
|
} : {}, [enabled, reference, floating, item]);
|
|
1929
1928
|
}
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
return () => clearTimeout(timeout);
|
|
1939
|
-
}
|
|
1940
|
-
}, [open, isMounted, durationMs]);
|
|
1941
|
-
return isMounted;
|
|
1942
|
-
}
|
|
1943
|
-
function useTransitionStatus(context, props) {
|
|
1944
|
-
if (props === void 0) {
|
|
1945
|
-
props = {};
|
|
1946
|
-
}
|
|
1947
|
-
const {
|
|
1948
|
-
open,
|
|
1949
|
-
elements: {
|
|
1950
|
-
floating
|
|
1951
|
-
}
|
|
1952
|
-
} = context;
|
|
1953
|
-
const {
|
|
1954
|
-
duration = 250
|
|
1955
|
-
} = props;
|
|
1956
|
-
const isNumberDuration = typeof duration === "number";
|
|
1957
|
-
const closeDuration = (isNumberDuration ? duration : duration.close) || 0;
|
|
1958
|
-
const [status, setStatus] = React__namespace.useState("unmounted");
|
|
1959
|
-
const isMounted = useDelayUnmount(open, closeDuration);
|
|
1960
|
-
if (!isMounted && status === "close") {
|
|
1961
|
-
setStatus("unmounted");
|
|
1962
|
-
}
|
|
1963
|
-
index(() => {
|
|
1964
|
-
if (!floating) return;
|
|
1965
|
-
if (open) {
|
|
1966
|
-
setStatus("initial");
|
|
1967
|
-
const frame = requestAnimationFrame(() => {
|
|
1968
|
-
ReactDOM__namespace.flushSync(() => {
|
|
1969
|
-
setStatus("open");
|
|
1970
|
-
});
|
|
1971
|
-
});
|
|
1972
|
-
return () => {
|
|
1973
|
-
cancelAnimationFrame(frame);
|
|
1974
|
-
};
|
|
1975
|
-
}
|
|
1976
|
-
setStatus("close");
|
|
1977
|
-
}, [open, floating]);
|
|
1978
|
-
return {
|
|
1979
|
-
isMounted,
|
|
1980
|
-
status
|
|
1981
|
-
};
|
|
1982
|
-
}
|
|
1983
|
-
const TOOLTIP_ARROW_WIDTH = 14;
|
|
1984
|
-
const TOOLTIP_ARROW_HEIGHT = 7;
|
|
1985
|
-
const getTooltipTransformOrigin = (side, arrowCoordinates, showArrow) => {
|
|
1986
|
-
const arrowInset = showArrow ? TOOLTIP_ARROW_HEIGHT : 0;
|
|
1987
|
-
const arrowCenterX = arrowCoordinates?.x === void 0 ? "50%" : `${arrowCoordinates.x + TOOLTIP_ARROW_WIDTH / 2}px`;
|
|
1988
|
-
const arrowCenterY = arrowCoordinates?.y === void 0 ? "50%" : `${arrowCoordinates.y + TOOLTIP_ARROW_WIDTH / 2}px`;
|
|
1989
|
-
const origins = {
|
|
1990
|
-
top: `${arrowCenterX} calc(100% + ${arrowInset}px)`,
|
|
1991
|
-
bottom: `${arrowCenterX} -${arrowInset}px`,
|
|
1992
|
-
left: `calc(100% + ${arrowInset}px) ${arrowCenterY}`,
|
|
1993
|
-
right: `-${arrowInset}px ${arrowCenterY}`
|
|
1994
|
-
};
|
|
1995
|
-
return origins[side];
|
|
1996
|
-
};
|
|
1997
|
-
const Tooltip = (t0) => {
|
|
1998
|
-
const $ = compilerRuntime.c(52);
|
|
1999
|
-
const {
|
|
2000
|
-
children,
|
|
2001
|
-
content,
|
|
2002
|
-
className,
|
|
2003
|
-
placement: t1,
|
|
2004
|
-
showArrow: t2,
|
|
2005
|
-
classNameWrapper: t3
|
|
2006
|
-
} = t0;
|
|
2007
|
-
const placement = t1 === void 0 ? "top" : t1;
|
|
2008
|
-
const showArrow = t2 === void 0 ? true : t2;
|
|
2009
|
-
const classNameWrapper = t3 === void 0 ? "" : t3;
|
|
1929
|
+
const Tooltip = ({
|
|
1930
|
+
children,
|
|
1931
|
+
content,
|
|
1932
|
+
className,
|
|
1933
|
+
placement = "top",
|
|
1934
|
+
showArrow = true,
|
|
1935
|
+
classNameWrapper = ""
|
|
1936
|
+
}) => {
|
|
2010
1937
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
2011
|
-
const
|
|
2012
|
-
const [arrowElement, setArrowElement] = React.useState(null);
|
|
2013
|
-
let t4;
|
|
2014
|
-
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2015
|
-
t4 = (open, _event, reason) => {
|
|
2016
|
-
if (open) {
|
|
2017
|
-
setAnimateTransition(reason !== "focus");
|
|
2018
|
-
}
|
|
2019
|
-
setIsOpen(open);
|
|
2020
|
-
};
|
|
2021
|
-
$[0] = t4;
|
|
2022
|
-
} else {
|
|
2023
|
-
t4 = $[0];
|
|
2024
|
-
}
|
|
2025
|
-
let t5;
|
|
2026
|
-
let t6;
|
|
2027
|
-
let t7;
|
|
2028
|
-
if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2029
|
-
t5 = floatingUi_reactDom.offset(8);
|
|
2030
|
-
t6 = floatingUi_reactDom.flip();
|
|
2031
|
-
t7 = floatingUi_reactDom.shift();
|
|
2032
|
-
$[1] = t5;
|
|
2033
|
-
$[2] = t6;
|
|
2034
|
-
$[3] = t7;
|
|
2035
|
-
} else {
|
|
2036
|
-
t5 = $[1];
|
|
2037
|
-
t6 = $[2];
|
|
2038
|
-
t7 = $[3];
|
|
2039
|
-
}
|
|
2040
|
-
let t8;
|
|
2041
|
-
if ($[4] !== arrowElement) {
|
|
2042
|
-
t8 = floatingUi_reactDom.arrow({
|
|
2043
|
-
element: arrowElement
|
|
2044
|
-
});
|
|
2045
|
-
$[4] = arrowElement;
|
|
2046
|
-
$[5] = t8;
|
|
2047
|
-
} else {
|
|
2048
|
-
t8 = $[5];
|
|
2049
|
-
}
|
|
2050
|
-
let t9;
|
|
2051
|
-
if ($[6] !== t8) {
|
|
2052
|
-
t9 = [t5, t6, t7, t8];
|
|
2053
|
-
$[6] = t8;
|
|
2054
|
-
$[7] = t9;
|
|
2055
|
-
} else {
|
|
2056
|
-
t9 = $[7];
|
|
2057
|
-
}
|
|
2058
|
-
let t10;
|
|
2059
|
-
if ($[8] !== isOpen || $[9] !== placement || $[10] !== t9) {
|
|
2060
|
-
t10 = {
|
|
2061
|
-
open: isOpen,
|
|
2062
|
-
onOpenChange: t4,
|
|
2063
|
-
placement,
|
|
2064
|
-
strategy: "fixed",
|
|
2065
|
-
middleware: t9,
|
|
2066
|
-
whileElementsMounted: floatingUi_dom.autoUpdate
|
|
2067
|
-
};
|
|
2068
|
-
$[8] = isOpen;
|
|
2069
|
-
$[9] = placement;
|
|
2070
|
-
$[10] = t9;
|
|
2071
|
-
$[11] = t10;
|
|
2072
|
-
} else {
|
|
2073
|
-
t10 = $[11];
|
|
2074
|
-
}
|
|
1938
|
+
const arrowRef = React.useRef(null);
|
|
2075
1939
|
const {
|
|
2076
|
-
refs
|
|
1940
|
+
refs,
|
|
2077
1941
|
floatingStyles,
|
|
2078
|
-
context
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
open: 160,
|
|
2090
|
-
close: 100
|
|
2091
|
-
} : 0;
|
|
2092
|
-
$[12] = animateTransition;
|
|
2093
|
-
$[13] = t12;
|
|
2094
|
-
} else {
|
|
2095
|
-
t12 = $[13];
|
|
2096
|
-
}
|
|
2097
|
-
let t13;
|
|
2098
|
-
if ($[14] !== t12) {
|
|
2099
|
-
t13 = {
|
|
2100
|
-
duration: t12
|
|
2101
|
-
};
|
|
2102
|
-
$[14] = t12;
|
|
2103
|
-
$[15] = t13;
|
|
2104
|
-
} else {
|
|
2105
|
-
t13 = $[15];
|
|
2106
|
-
}
|
|
2107
|
-
const {
|
|
2108
|
-
isMounted,
|
|
2109
|
-
status
|
|
2110
|
-
} = useTransitionStatus(context, t13);
|
|
2111
|
-
let resolvedSide;
|
|
2112
|
-
let t14;
|
|
2113
|
-
if ($[16] !== middlewareData.arrow || $[17] !== resolvedPlacement || $[18] !== showArrow) {
|
|
2114
|
-
resolvedSide = resolvedPlacement.split("-")[0];
|
|
2115
|
-
t14 = getTooltipTransformOrigin(resolvedSide, middlewareData.arrow, showArrow);
|
|
2116
|
-
$[16] = middlewareData.arrow;
|
|
2117
|
-
$[17] = resolvedPlacement;
|
|
2118
|
-
$[18] = showArrow;
|
|
2119
|
-
$[19] = resolvedSide;
|
|
2120
|
-
$[20] = t14;
|
|
2121
|
-
} else {
|
|
2122
|
-
resolvedSide = $[19];
|
|
2123
|
-
t14 = $[20];
|
|
2124
|
-
}
|
|
2125
|
-
const transformOrigin = t14;
|
|
1942
|
+
context
|
|
1943
|
+
} = useFloating({
|
|
1944
|
+
open: isOpen,
|
|
1945
|
+
onOpenChange: setIsOpen,
|
|
1946
|
+
placement,
|
|
1947
|
+
strategy: "fixed",
|
|
1948
|
+
middleware: [floatingUi_reactDom.offset(8), floatingUi_reactDom.flip(), floatingUi_reactDom.shift(), floatingUi_reactDom.arrow({
|
|
1949
|
+
element: arrowRef
|
|
1950
|
+
})],
|
|
1951
|
+
whileElementsMounted: floatingUi_dom.autoUpdate
|
|
1952
|
+
});
|
|
2126
1953
|
const hover = useHover(context);
|
|
2127
1954
|
const focus = useFocus(context);
|
|
2128
1955
|
const dismiss = useDismiss(context);
|
|
2129
1956
|
const role = useRole(context);
|
|
2130
|
-
let t15;
|
|
2131
|
-
if ($[21] !== dismiss || $[22] !== focus || $[23] !== hover || $[24] !== role) {
|
|
2132
|
-
t15 = [hover, focus, dismiss, role];
|
|
2133
|
-
$[21] = dismiss;
|
|
2134
|
-
$[22] = focus;
|
|
2135
|
-
$[23] = hover;
|
|
2136
|
-
$[24] = role;
|
|
2137
|
-
$[25] = t15;
|
|
2138
|
-
} else {
|
|
2139
|
-
t15 = $[25];
|
|
2140
|
-
}
|
|
2141
1957
|
const {
|
|
2142
1958
|
getReferenceProps,
|
|
2143
1959
|
getFloatingProps
|
|
2144
|
-
} = useInteractions(
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
t17 = $[44];
|
|
2155
|
-
}
|
|
2156
|
-
const mergedClassWrapper = t17;
|
|
2157
|
-
let t18;
|
|
2158
|
-
if ($[45] !== getReferenceProps) {
|
|
2159
|
-
t18 = getReferenceProps();
|
|
2160
|
-
$[45] = getReferenceProps;
|
|
2161
|
-
$[46] = t18;
|
|
2162
|
-
} else {
|
|
2163
|
-
t18 = $[46];
|
|
2164
|
-
}
|
|
2165
|
-
let t19;
|
|
2166
|
-
if ($[47] !== children || $[48] !== mergedClassWrapper || $[49] !== setReference || $[50] !== t18) {
|
|
2167
|
-
t19 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: setReference, ...t18, className: mergedClassWrapper, children });
|
|
2168
|
-
$[47] = children;
|
|
2169
|
-
$[48] = mergedClassWrapper;
|
|
2170
|
-
$[49] = setReference;
|
|
2171
|
-
$[50] = t18;
|
|
2172
|
-
$[51] = t19;
|
|
2173
|
-
} else {
|
|
2174
|
-
t19 = $[51];
|
|
2175
|
-
}
|
|
2176
|
-
t16 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2177
|
-
t19,
|
|
2178
|
-
isMounted && /* @__PURE__ */ jsxRuntime.jsx(FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: setFloating, style: floatingStyles, ...getFloatingProps(), "data-slot": "tooltip-positioner", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx("tooltip__content", mergedClass), "data-animate": animateTransition ? "true" : "false", "data-side": resolvedSide, "data-slot": "tooltip-content", "data-status": status, style: {
|
|
2179
|
-
transformOrigin
|
|
2180
|
-
}, children: [
|
|
2181
|
-
content,
|
|
2182
|
-
showArrow && /* @__PURE__ */ jsxRuntime.jsx(FloatingArrow, { ref: setArrowElement, context, className: "text-content1", fill: "currentColor" })
|
|
2183
|
-
] }) }) })
|
|
2184
|
-
] });
|
|
2185
|
-
$[26] = animateTransition;
|
|
2186
|
-
$[27] = children;
|
|
2187
|
-
$[28] = className;
|
|
2188
|
-
$[29] = classNameWrapper;
|
|
2189
|
-
$[30] = content;
|
|
2190
|
-
$[31] = context;
|
|
2191
|
-
$[32] = floatingStyles;
|
|
2192
|
-
$[33] = getFloatingProps;
|
|
2193
|
-
$[34] = getReferenceProps;
|
|
2194
|
-
$[35] = isMounted;
|
|
2195
|
-
$[36] = resolvedSide;
|
|
2196
|
-
$[37] = setFloating;
|
|
2197
|
-
$[38] = setReference;
|
|
2198
|
-
$[39] = showArrow;
|
|
2199
|
-
$[40] = status;
|
|
2200
|
-
$[41] = transformOrigin;
|
|
2201
|
-
$[42] = t16;
|
|
2202
|
-
} else {
|
|
2203
|
-
t16 = $[42];
|
|
2204
|
-
}
|
|
2205
|
-
return t16;
|
|
1960
|
+
} = useInteractions([hover, focus, dismiss, role]);
|
|
1961
|
+
const mergedClass = tailwindMerge.twMerge(clsx("bg-content1 font-normal text-sm rounded-md filter-(--filter-drop-shadow-small) flex justify-center items-center z-99 px-2.5 py-1 outline-none box-border subpixel-antialiased normal-case", className));
|
|
1962
|
+
const mergedClassWrapper = tailwindMerge.twMerge(clsx("w-fit", classNameWrapper));
|
|
1963
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1964
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: refs.setReference, ...getReferenceProps(), className: mergedClassWrapper, children }),
|
|
1965
|
+
isOpen && /* @__PURE__ */ jsxRuntime.jsx(FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: refs.setFloating, style: floatingStyles, ...getFloatingProps(), className: mergedClass, children: [
|
|
1966
|
+
content,
|
|
1967
|
+
showArrow && /* @__PURE__ */ jsxRuntime.jsx(FloatingArrow, { ref: arrowRef, context, className: "text-content1", fill: "currentColor" })
|
|
1968
|
+
] }) })
|
|
1969
|
+
] });
|
|
2206
1970
|
};
|
|
2207
1971
|
exports.Tooltip = Tooltip;
|
|
2208
|
-
//# sourceMappingURL=tooltip-
|
|
1972
|
+
//# sourceMappingURL=tooltip-CkpPQC4G.js.map
|