woby-tooltip 1.0.5 → 1.0.10

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/index.es.js CHANGED
@@ -1,409 +1,231 @@
1
- import { jsxs, jsx as jsx$1 } from "woby/jsx-runtime";
2
- import { $$, $, store, useMemo, jsx, useEffect, isObservable } from "woby";
3
- const isSide = (side, str) => $$(side) === str;
4
- const isAlign = (align, str) => $$(align) === str;
5
- const isAlignA = (position, str) => $$(position) === str;
6
- const TextBox = (props) => {
7
- const hoverIndex = $(null);
8
- const firstH = $(null);
9
- const lastH = $(null);
10
- const totH = $(null);
11
- const spanHeightsRef = store({});
12
- store.on(spanHeightsRef, () => {
13
- const heights = Object.keys(spanHeightsRef).map((key) => spanHeightsRef[key].clientHeight);
14
- const firsth = heights[0];
15
- const lasth = heights[heights.length - 1];
16
- const toth = heights.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
17
- totH(toth);
18
- firstH(firsth);
19
- lastH(lasth);
1
+ import { jsx, jsxs } from "woby/jsx-runtime";
2
+ import { useEffect, $$, createContext, $, useMemo } from "woby";
3
+ let nanoid = (size = 21) => crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
4
+ byte &= 63;
5
+ if (byte < 36) {
6
+ id += byte.toString(36);
7
+ } else if (byte < 62) {
8
+ id += (byte - 26).toString(36).toUpperCase();
9
+ } else if (byte > 62) {
10
+ id += "-";
11
+ } else {
12
+ id += "_";
13
+ }
14
+ return id;
15
+ }, "");
16
+ const isTemp = (s) => !!s.raw;
17
+ const extract = (C, props, classNames) => {
18
+ const { className, ...p } = props;
19
+ const cls = p.class;
20
+ delete p.class;
21
+ return /* @__PURE__ */ jsx(C, { class: [classNames, cls, className], ...p });
22
+ };
23
+ const append = (child, parent) => {
24
+ return useEffect(() => {
25
+ const [c, p] = [$$($$(child)), $$($$(parent))];
26
+ p.appendChild(c);
27
+ const um = () => p.removeChild(c);
28
+ return um;
20
29
  });
21
- const unsetHover = () => {
22
- hoverIndex(null);
23
- props.hoverArrow(false);
24
- };
25
- const onSpanHover = (index, lastIndex2, numChildren) => {
26
- hoverIndex(index);
27
- const { static: rctStatic, arw: arrow2, pos: position2, hoverArrow } = props;
28
- if (!rctStatic && (index === 0 && (isSide(position2.side, "bottom") || isAlignA(arrow2, "v-start")) || index === lastIndex2 && (isSide(position2.side, "top") || isAlignA(arrow2, "v-end")) || numChildren === 1)) {
29
- return hoverArrow(true);
30
+ };
31
+ function Styled(comp) {
32
+ function styled2(strings, ...values) {
33
+ if (isTemp(strings)) {
34
+ const C = comp;
35
+ const N = "_" + nanoid(10);
36
+ useEffect(() => {
37
+ const r = `.${N} {
38
+ ${strings.map((str, i) => i < values.length ? str + $$(values[i]) : str).join("")}
39
+ }`;
40
+ return append(/* @__PURE__ */ jsx("style", { id: N, children: r }), document.head);
41
+ });
42
+ return C ? (props) => extract(C, props, N) : N;
30
43
  }
31
- return hoverArrow(false);
32
- };
33
- const {
34
- arw: arrow,
35
- pos: position,
36
- lines: lineSeparated,
37
- static: tpStatic,
38
- textboxWidth: width,
39
- shadowColor: shCol,
40
- shadowShape: shShape,
41
- move,
42
- backgroundColor,
43
- padding,
44
- borderRadius,
45
- hoverBackground,
46
- hoverColor,
47
- color,
48
- alert,
49
- flat,
50
- children,
51
- class: cls,
52
- className
53
- } = props;
54
- const numberChildren = Array.isArray(children) ? children.length : 1;
55
- const lastIndex = numberChildren - 1;
56
- const adjChildren = [children].flat().map((child, index) => {
57
- const hover = useMemo(() => !tpStatic && $$(hoverIndex) === index);
58
- const nhover = useMemo(() => !$$(hover));
59
- const childProps = {
60
- // ...child.props,
61
- ref: (span) => spanHeightsRef[`span${index + 1}`] = span,
62
- class: [padding, {
63
- "whitespace-nowrap": () => $$(width) === "auto",
64
- [$$(hoverColor)]: hover,
65
- [$$(hoverBackground)]: hover,
66
- [$$(color)]: nhover,
67
- [$$(backgroundColor)]: nhover,
68
- [$$(lineSeparated)]: () => $$(lineSeparated) && lastIndex !== index
69
- }],
70
- // style,
71
- onMouseOver: () => onSpanHover(index, lastIndex, numberChildren)
44
+ return Styled(strings).styled;
45
+ }
46
+ return { comp, styled: styled2 };
47
+ }
48
+ const styled = Styled().styled;
49
+ createContext();
50
+ function useComputedStyle(target, patterns = []) {
51
+ const styles = $({});
52
+ useEffect(() => {
53
+ if (!$$(target)) return () => {
54
+ };
55
+ const getMatchingStyles = () => {
56
+ const computedStyle = window.getComputedStyle($$(target));
57
+ const matchedStyles = {};
58
+ for (const property of computedStyle) {
59
+ if (patterns.some(
60
+ (pattern) => typeof pattern === "string" ? property === pattern : pattern.test(property)
61
+ )) {
62
+ matchedStyles[property] = computedStyle.getPropertyValue(property);
63
+ }
64
+ }
65
+ return matchedStyles;
72
66
  };
73
- return jsx(child, { ...childProps });
67
+ styles(getMatchingStyles());
68
+ const observer = new MutationObserver(() => {
69
+ const updatedStyles = getMatchingStyles();
70
+ styles((prevStyles) => {
71
+ const hasChanges = Object.keys(updatedStyles).some(
72
+ (key) => updatedStyles[key] !== prevStyles[key]
73
+ );
74
+ return hasChanges ? updatedStyles : prevStyles;
75
+ });
76
+ });
77
+ observer.observe($$(target), {
78
+ attributes: true,
79
+ attributeFilter: ["style", "class"],
80
+ subtree: false
81
+ });
82
+ return () => observer.disconnect();
74
83
  });
75
- const calcHPos = (align, left2, center, right2) => {
76
- return isAlign(align, "center") ? center : isAlign(align, "left") ? left2 : right2;
77
- };
78
- const calcVPos = (perc, elHeight, divider, adjMove, totHeight) => {
79
- return `calc(${perc}% - ${totHeight || 0}px - ${elHeight}px/${divider} + ${adjMove || 0}px)`;
80
- };
81
- const calcTopPos = (align, elHeight, totHeight) => {
82
- if ($$(align) === "center") {
83
- return calcVPos(50, elHeight, 2, null, totHeight);
84
- }
85
- if ($$(align) === "bottom") {
86
- return calcVPos(100, elHeight, 2, -12, totHeight);
87
- }
88
- return calcVPos(0, elHeight, 2, 12, totHeight);
84
+ return styles;
85
+ }
86
+ const tooltipDef = `text-left border-b-[#666] border-b border-dotted
87
+ [&:hover_.tpcontents]:visible [&:hover_.tpcontents]:opacity-100
88
+ `;
89
+ const tooltip = `inline-block relative
90
+ [&:hover_.tpcontents]:visible [&:hover_.tpcontents]:opacity-100
91
+ `;
92
+ const topDef = `bg-[#eeeeee] min-w-max box-border border shadow-[0_1px_8px_#000000] transition-opacity duration-[0.8s] px-5 py-2.5 rounded-lg border-solid border-[#000000] `;
93
+ const top = `absolute z-[99999999] left-2/4 -top-5 `;
94
+ const top_i = `absolute overflow-hidden top-full after:content-[''] after:absolute after:-translate-x-2/4 after:-translate-y-2/4 after:rotate-45 after:left-2/4 `;
95
+ const rightDef = `bg-[#eeeeee] min-w-max box-border border shadow-[0_1px_8px_#000000] transition-opacity duration-[0.8s] px-5 py-2.5 rounded-lg border-solid border-[#000000] `;
96
+ const right = `absolute z-[99999999] ml-5 left-full top-2/4 `;
97
+ const right_i = `absolute overflow-hidden right-full after:content-[''] after:absolute after:translate-x-2/4 after:-translate-y-2/4 after:-rotate-45 after:left-0 after:top-2/4 `;
98
+ const bottomDef = `bg-[#eeeeee] min-w-max box-border border shadow-[0_1px_8px_#000000] transition-opacity duration-[0.8s] px-5 py-2.5 rounded-lg border-solid border-[#000000] `;
99
+ const bottom = `absolute z-[99999999] left-2/4 top-10 `;
100
+ const bottom_i = `absolute overflow-hidden bottom-full after:content-[''] after:absolute after:-translate-x-2/4 after:translate-y-2/4 after:rotate-45 after:left-2/4 `;
101
+ const leftDef = `bg-[#eeeeee] min-w-max box-border border shadow-[0_1px_8px_#000000] transition-opacity duration-[0.8s] px-5 py-2.5 rounded-lg border-solid border-[#000000] `;
102
+ const left = `absolute z-[99999999] mr-5 right-full top-2/4 `;
103
+ const left_i = `absolute overflow-hidden left-full after:content-[''] after:absolute after:-translate-x-2/4 after:-translate-y-2/4 after:-rotate-45 after:left-0 after:top-2/4 `;
104
+ const Tooltip = ({ children, class: cls = tooltipDef, className, ...props }) => {
105
+ return /* @__PURE__ */ jsx("div", { class: [tooltip, cls, className], children });
106
+ };
107
+ function cssMultiply(value, multiplier) {
108
+ const match = ($$(value) + "").match(/^(-?\d*\.?\d+)([a-z%]*)$/);
109
+ if (!match)
110
+ throw new Error(`Invalid CSS unit: ${$$(value)}`);
111
+ const [, numericValue, unit] = match;
112
+ const result = +numericValue * multiplier;
113
+ return `${result}${unit}`;
114
+ }
115
+ const x2 = (value) => cssMultiply(value, 2);
116
+ const translate = (x, y) => `translate(${$$(x)}, ${$$(y)})`;
117
+ const TooltipContent = ({ children, style, class: cls = $(), className, static: st, position = "top", arrowLocation = "50%", arrowSize = "12px", ...props }) => {
118
+ const setDef = () => {
119
+ if (!$$(cls))
120
+ switch ($$(position)) {
121
+ case "top":
122
+ cls(topDef);
123
+ case "left":
124
+ cls(leftDef);
125
+ case "right":
126
+ cls(rightDef);
127
+ case "bottom":
128
+ cls(bottomDef);
129
+ }
89
130
  };
90
- let left = $("");
91
- let right = $("");
92
- let top = $("8px");
93
- const hLeftPos = useMemo(() => calcHPos(position.align, "100% - 50px", "50% - 40px", "0% - 30px"));
94
- const hRightPos = useMemo(() => calcHPos(position.align, "0% - 30px", "50% - 40px", "100% - 50px"));
95
- useEffect(() => {
96
- const { align } = position;
97
- switch ($$(arrow)) {
98
- case "h-start":
99
- left(`calc(${$$(hRightPos)})`);
100
- break;
101
- case "h-end":
102
- right(`calc(${$$(hLeftPos)})`);
103
- break;
104
- case "v-start":
105
- top(calcTopPos(align, $$(firstH), null));
106
- break;
107
- case "v-end":
108
- top(calcTopPos(align, $$(lineSeparated) ? -$$(lastH) + 1 : -$$(lastH), $$(totH)));
109
- break;
110
- case "v-center":
111
- top(`calc(0% - ${$$(totH)}px/2 + 11px)`);
112
- if (isAlign(align, "center")) {
113
- top(`calc(50% - ${$$(totH)}px/2)`);
114
- }
115
- if (isAlign(align, "bottom")) {
116
- top(`calc(100% - ${$$(totH)}px/2 - 11px)`);
117
- }
118
- break;
131
+ useEffect(setDef);
132
+ setDef();
133
+ const pos = useMemo(() => {
134
+ switch ($$(position)) {
135
+ case "top":
136
+ return top;
137
+ case "right":
138
+ return right;
139
+ case "bottom":
140
+ return bottom;
141
+ case "left":
142
+ return left;
119
143
  }
120
- switch ($$(position.side)) {
144
+ });
145
+ const transform = useMemo(() => {
146
+ switch ($$(position)) {
121
147
  case "top":
122
- top(calcVPos(0, $$(totH), 1, 13));
123
- break;
148
+ return translate("-" + $$(arrowLocation), "-100%");
124
149
  case "left":
125
- right("8px");
126
- break;
127
150
  case "right":
128
- left("8px");
129
- break;
151
+ return translate("0", "-" + $$(arrowLocation));
152
+ case "bottom":
153
+ return translate("-" + $$(arrowLocation), "0");
130
154
  }
131
155
  });
132
- const textBoxWidthValue = useMemo(() => {
133
- let textBoxWidthValue2 = $$(width);
134
- if (textBoxWidthValue2 !== "auto") {
135
- textBoxWidthValue2 = Number($$(width).slice(0, -2));
136
- if (move.left > 0)
137
- textBoxWidthValue2 += move.left;
138
- if (move.right > 0)
139
- textBoxWidthValue2 += move.right;
156
+ const ali = useMemo(() => {
157
+ switch ($$(position)) {
158
+ case "bottom":
159
+ case "top":
160
+ return { left: arrowLocation };
161
+ case "left":
162
+ case "right":
163
+ return { top: arrowLocation };
140
164
  }
141
- return textBoxWidthValue2;
142
165
  });
143
- const boxStyle = {
144
- left,
145
- right,
146
- top,
147
- width: textBoxWidthValue,
148
- borderRadius
149
- };
150
- const shColAdj = useMemo(() => $$(shCol).substr(0, $$(shCol).lastIndexOf(",")).replace(/[)]/g, ","));
151
- const shadow = useMemo(() => `${$$(shShape)} ${$$(shCol)}, 0 0 3px ${$$(shColAdj)}, 0.1), 0 0 0 1px ${$$(shColAdj)}, 0.15)`);
152
- const boxShadow = useMemo(() => $$(flat) ? null : $$(shadow));
153
- const alertStyle = useMemo(() => $$(alert) ? "rpt-alert" : "");
154
- const rgb = useMemo(() => $$(alert) || "rgb(248, 109, 109)");
155
- const alertShadow = useMemo(() => $$(alert) ? `0 0 0 ${$$(rgb).slice(0, $$(rgb).length - 1)}, 0.4)` : null);
156
- const noNeg = (number) => number > 0 ? number : 0;
157
- return /* @__PURE__ */ jsxs(
158
- "div",
159
- {
160
- class: [`absolute animation-none`, alertStyle, cls ?? className],
161
- style: {
162
- ...boxStyle,
163
- boxShadow: alertShadow,
164
- padding: `${move.down}px ${move.left}px ${move.up}px ${move.right}px`
165
- },
166
- children: [
167
- /* @__PURE__ */ jsx$1(
168
- "div",
169
- {
170
- class: [`absolute animation-none w-full h-full z-0`, borderRadius],
171
- style: {
172
- boxShadow,
173
- height: () => `calc(100% - ${noNeg(move.down) + noNeg(move.up)}px)`,
174
- width: () => `calc(100% - ${noNeg(move.left) + noNeg(move.right)}px)`
175
- }
176
- }
177
- ),
178
- /* @__PURE__ */ jsx$1(
179
- "div",
180
- {
181
- class: [`relative z-[2] w-full`, backgroundColor, borderRadius],
182
- onMouseLeave: unsetHover,
183
- children: /* @__PURE__ */ jsx$1(
184
- "div",
185
- {
186
- class: [!tpStatic ? "[&_span]:cursor-pointer w-full" : null, borderRadius, "overflow-hidden"],
187
- children: adjChildren
188
- }
189
- )
190
- }
191
- )
192
- ]
166
+ const ii = useMemo(() => {
167
+ switch ($$(position)) {
168
+ case "top":
169
+ return top_i + styled`
170
+ margin-left:-${$$(arrowSize)};
171
+ width:${x2(arrowSize)};
172
+ height:${$$(arrowSize)};
173
+
174
+ &::after{
175
+ width:${$$(arrowSize)};
176
+ height:${$$(arrowSize)};
177
+ }
178
+ `;
179
+ case "right":
180
+ return right_i + styled`
181
+ margin-top:-${$$(arrowSize)};
182
+ width:${$$(arrowSize)};
183
+ height:${x2(arrowSize)};
184
+
185
+ &::after{
186
+ width:${$$(arrowSize)};
187
+ height:${$$(arrowSize)};
188
+ }
189
+ `;
190
+ case "bottom":
191
+ return bottom_i + styled`
192
+ margin-left:-${$$(arrowSize)};
193
+ width:${x2(arrowSize)};
194
+ height:${$$(arrowSize)};
195
+
196
+ &::after{
197
+ width:${$$(arrowSize)};
198
+ height:${$$(arrowSize)};
199
+ }
200
+ `;
201
+ case "left":
202
+ return left_i + styled`
203
+ margin-top:-${$$(arrowSize)};
204
+ width:${$$(arrowSize)};
205
+ height:${x2(arrowSize)};
206
+
207
+ &::after{
208
+ width:${$$(arrowSize)};
209
+ height:${$$(arrowSize)};
210
+ }
211
+ `;
193
212
  }
194
- );
195
- };
196
- const Arrow = ({ isHovered, hovBkg, bkgCol, flat }) => {
197
- const backgroundColor = useMemo(() => $$(isHovered) ? $$(hovBkg) : $$(bkgCol));
198
- const boxShadow = useMemo(() => $$(flat) ? null : "[box-shadow:rgba(0,0,0,0.18)0px_0px_0px_1px]");
199
- return /* @__PURE__ */ jsx$1("div", { class: [`rotate-45 w-[14px] h-[14px] m-[3px] z-[1]`, backgroundColor, boxShadow] });
200
- };
201
- const Tooltip = (properties = {}) => {
202
- const props = {
203
- /** tailwind */
204
- hoverBackground: "bg-[#ececec]",
205
- /** tailwind */
206
- hoverColor: "text-[black]",
207
- /** tailwind */
208
- backgroundColor: "bg-[white]",
209
- /** not tailwind */
210
- textboxWidth: "150px",
211
- /** tailwind */
212
- fontSize: "[font-size:inherit]",
213
- /** tailwind */
214
- color: "text-inherit",
215
- borderRadius: "rounded-[5px]",
216
- shadowColor: "rgba(0,0,0,0.251)",
217
- shadowShape: "0 8px 15px",
218
- moveDown: "0px",
219
- moveRight: "0px",
220
- moveLeft: "0px",
221
- moveUp: "0px",
222
- position: "bottom center",
223
- arrowAlign: $("start"),
224
- textAlign: "left",
225
- fontFamily: "inherit",
226
- fontWeight: "bold",
227
- zIndex: "100",
228
- animation: "",
229
- show: false,
230
- ...properties
231
- };
232
- const {
233
- position: pos,
234
- lineSeparated: lines,
235
- arrowAlign: arwAlign,
236
- hoverBackground,
237
- backgroundColor,
238
- moveDown,
239
- moveRight,
240
- moveLeft,
241
- moveUp,
242
- textAlign,
243
- fontFamily,
244
- fontWeight,
245
- fontSize,
246
- color,
247
- zIndex,
248
- animation,
249
- flat,
250
- parentRef: pf,
251
- parent: Parent,
252
- // shadowColor, shadowShape, textboxWidth, padding, borderRadius, hoverColor,
253
- containerClass
254
- } = props;
255
- const show = (
256
- /* $$(parent) ? props.show : */
257
- isObservable(props.show) ? props.show : $(props.show)
258
- );
259
- const parentRef = isObservable(pf) ? pf : $(pf);
260
- useEffect(() => {
261
- const p = $$(parentRef);
262
- if (!p)
263
- return;
264
- const on = () => show(true);
265
- const off = () => show(false);
266
- p.addEventListener("mouseenter", on);
267
- p.addEventListener("mouseleave", off);
268
- return () => {
269
- p.removeEventListener("mouseenter", on);
270
- p.removeEventListener("mouseleave", off);
271
- };
272
- });
273
- const hoverArrow = $(false);
274
- const mount = $(true);
275
- useEffect(() => {
276
- if ($$(show))
277
- mount(true);
278
- if (!$$(animation))
279
- mount(false);
280
213
  });
281
- const lineSeparated = typeof $$(lines) === "boolean" ? $("border-b border-b-[#ececec]") : isObservable(lines) ? lines : $(lines);
282
- const position = {
283
- side: $$(pos).split(" ")[0],
284
- align: $$(pos).split(" ")[1]
285
- };
286
- const arrow = $($$(arwAlign));
287
- const { side, align } = position;
288
- const classes = ["absolute flex"];
289
- let tooltipStyle = {};
290
- let bottom;
291
- switch (side) {
292
- case "bottom":
293
- classes.push("top-full left-0 w-full justify-center");
294
- break;
295
- case "top":
296
- classes.push("left-0 w-full justify-center");
297
- bottom = "100%";
298
- break;
299
- case "right":
300
- classes.push("top-0 left-full h-full justify-start");
301
- break;
302
- default:
303
- classes.push("top-0 right-full h-full justify-end");
304
- break;
305
- }
306
- const onAxis = {
307
- y: isSide(position.side, "top") || isSide(position.side, "bottom"),
308
- x: isSide(position.side, "left") || isSide(position.side, "right")
309
- };
310
- arrow(onAxis.y ? `h-${$$(arrow)}` : `v-${$$(arrow)}`);
311
- const num = (str) => Number(str.slice(0, -2));
312
- const move = {
313
- down: num(moveDown),
314
- up: num(moveUp),
315
- left: num(moveLeft),
316
- right: num(moveRight)
317
- };
318
- const oneMovePropIsNeg = move.down < 0 || move.up < 0 || move.left < 0 || move.right < 0;
319
- switch (align) {
320
- case "left":
321
- if (onAxis.y)
322
- classes.push("!justify-start");
323
- break;
324
- case "right":
325
- if (onAxis.y)
326
- classes.push("!justify-end");
327
- break;
328
- case "bottom":
329
- if (onAxis.x)
330
- classes.push("items-end");
331
- break;
332
- case "top":
333
- break;
334
- default:
335
- if (onAxis.x) {
336
- classes.push("items-center");
337
- if (!oneMovePropIsNeg) {
338
- move.down *= 2;
339
- move.up *= 2;
340
- }
341
- }
342
- if (onAxis.y && !oneMovePropIsNeg) {
343
- move.right *= 2;
344
- move.left *= 2;
345
- }
346
- break;
347
- }
348
- const adjustment = `${move.down}px ${move.left}px ${move.up}px ${move.right}px`;
349
- tooltipStyle = {
350
- ...tooltipStyle,
351
- zIndex,
352
- color,
353
- bottom,
354
- fontSize,
355
- textAlign,
356
- fontFamily,
357
- fontWeight,
358
- padding: oneMovePropIsNeg ? null : adjustment,
359
- margin: oneMovePropIsNeg ? adjustment : null,
360
- animation: () => $$(show) ? `rpt-${$$(animation)} 0.2s` : `rpt-${$$(animation)}-out 0.15s`
361
- };
362
- const e = useMemo(
363
- () => !$$(animation) && $$(show) && $$(props.children) || $$(show) && $$(mount) && $$(props.children) ? /* @__PURE__ */ jsx$1(
364
- "div",
365
- {
366
- className: classes,
367
- style: tooltipStyle,
368
- onAnimationEnd: () => {
369
- if (!$$(show) && $$(animation))
370
- mount(false);
371
- },
372
- children: /* @__PURE__ */ jsxs("div", { class: "flex justify-center", children: [
373
- /* @__PURE__ */ jsx$1(
374
- Arrow,
375
- {
376
- isHovered: hoverArrow,
377
- hovBkg: hoverBackground,
378
- bkgCol: backgroundColor,
379
- flat
380
- }
381
- ),
382
- /* @__PURE__ */ jsx$1(
383
- TextBox,
384
- {
385
- ...props,
386
- hoverArrow,
387
- lines: lineSeparated,
388
- pos: position,
389
- arw: arrow,
390
- move
391
- }
392
- )
393
- ] })
394
- }
395
- ) : null
396
- );
397
- return useMemo(() => $$(Parent) ? /* @__PURE__ */ jsxs("div", { class: [containerClass ?? "relative"], ref: parentRef, children: [
398
- Parent,
399
- e
400
- ] }) : e);
214
+ const tp = $();
215
+ const ir = $();
216
+ const sty = useComputedStyle(tp, ["background-color", /^border-(?!.*-radius$)/, "box-shadow"]);
217
+ return /* @__PURE__ */ jsxs("div", { ref: tp, class: [pos, cls, () => $$(st) ? "" : "invisible opacity-0", className, "tpcontents"], style: [style, { transform }], ...props, children: [
218
+ children,
219
+ () => /* @__PURE__ */ jsx("i", { ref: ir, class: [ii, styled`
220
+ &::after{
221
+ ${Object.keys($$(sty)).map((k) => `${k}:${$$(sty)[k]};
222
+ `).join("")}
223
+ }
224
+ `], style: ali })
225
+ ] });
401
226
  };
402
227
  export {
403
- TextBox,
404
228
  Tooltip,
405
- isAlign,
406
- isAlignA,
407
- isSide
229
+ TooltipContent
408
230
  };
409
231
  //# sourceMappingURL=index.es.js.map