kitzo 2.3.37 → 2.3.38

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.
@@ -1,59 +1,57 @@
1
- import { jsxs as d, jsx as h } from "react/jsx-runtime";
2
- import y from "./helpers/addTooltipStyles.js";
3
- import D from "./helpers/getPositionClass.js";
4
- import b from "./partials/TooltipWrapper.js";
5
- import T from "./helpers/getAnimationProperties.js";
6
- const x = () => window.matchMedia("(prefers-color-scheme: dark)").matches;
7
- function H(n) {
1
+ import { jsx as i, Fragment as u, jsxs as b } from "react/jsx-runtime";
2
+ import x from "./helpers/addTooltipStyles.js";
3
+ import T from "./helpers/getPositionClass.js";
4
+ import v from "./partials/TooltipWrapper.js";
5
+ import w from "./helpers/getAnimationProperties.js";
6
+ function H(c) {
8
7
  const {
9
8
  content: r,
10
9
  children: t,
11
- position: c = "top",
12
- animation: i = !0,
13
- isHidden: s = !1,
14
- offset: m = 8,
15
- smartHover: l = !0,
16
- hideOnTouch: f = !0
17
- } = n;
18
- let { isDark: o } = n;
19
- if (typeof s == "boolean" && s || r == null)
20
- return t;
21
- const e = {
22
- offset: isNaN(Number(m)) ? 8 : Number(m),
23
- // arrow: typeof arrow === 'boolean' ? arrow : false,
24
- smartHover: typeof l == "boolean" ? l : !0,
25
- hideOnTouch: typeof f == "boolean" ? f : !0
10
+ position: h = "top",
11
+ animation: a = !0,
12
+ isHidden: n = !1,
13
+ offset: s = 8,
14
+ smartHover: m = !0,
15
+ hideOnTouch: l = !0,
16
+ isDark: f
17
+ } = c;
18
+ if (typeof n == "boolean" && n) return /* @__PURE__ */ i(u, { children: t });
19
+ if (r == null)
20
+ return /* @__PURE__ */ i(u, { children: t });
21
+ const o = {
22
+ offset: isNaN(Number(s)) ? 8 : Number(s),
23
+ smartHover: typeof m == "boolean" ? m : !0,
24
+ hideOnTouch: typeof l == "boolean" ? l : !0
26
25
  };
27
- if (window.matchMedia("(pointer: coarse)").matches && e.hideOnTouch) return t;
28
- const p = D(c), u = !!i, a = T(
29
- i === !0 ? {} : i
26
+ let p = !1, d = !1;
27
+ if (typeof window < "u" && (d = window.matchMedia("(pointer: coarse)").matches || navigator.maxTouchPoints > 0, p = typeof f == "boolean" ? f : window.matchMedia("(prefers-color-scheme: dark)").matches), d && o.hideOnTouch) return t;
28
+ const y = T(h), D = !!a, e = w(
29
+ a === !0 ? {} : a
30
30
  );
31
- return o = typeof o == "boolean" ? o : x(), y(), /* @__PURE__ */ d(
31
+ return x(), /* @__PURE__ */ b(
32
32
  "div",
33
33
  {
34
34
  style: {
35
35
  position: "relative",
36
36
  width: "fit-content",
37
- "--offset": Math.max(0, e.offset),
37
+ "--offset": Math.max(0, o.offset),
38
38
  "--startDuration": Math.max(
39
39
  0,
40
- a.startDuration
40
+ e.startDuration
41
41
  ),
42
- "--endDuration": Math.max(0, a.endDuration),
43
- "--startDelay": Math.max(0, a.startDelay),
44
- "--endDelay": Math.max(0, a.endDelay)
45
- // '--arrow-color': arrowStyle?.['--arrow-color'],
46
- // '--arrow-size': arrowStyle?.['--arrow-size'],
42
+ "--endDuration": Math.max(0, e.endDuration),
43
+ "--startDelay": Math.max(0, e.startDelay),
44
+ "--endDelay": Math.max(0, e.endDelay)
47
45
  },
48
- className: `kitzo-tooltip-root ${o ? "tooltip-theme-dark" : ""} ${e.smartHover ? "smart-hover" : ""} ${u ? "animate-tooltip" : ""}`,
46
+ className: `kitzo-tooltip-root ${p ? "tooltip-theme-dark" : ""} ${o.smartHover ? "smart-hover" : ""} ${D ? "animate-tooltip" : ""}`,
49
47
  children: [
50
48
  t,
51
- /* @__PURE__ */ h(
52
- b,
49
+ /* @__PURE__ */ i(
50
+ v,
53
51
  {
54
52
  content: r,
55
- positionClass: p,
56
- finalOptions: e
53
+ positionClass: y,
54
+ finalOptions: o
57
55
  }
58
56
  )
59
57
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "2.3.37",
3
+ "version": "2.3.38",
4
4
  "description": "A lightweight React micro-utility.",
5
5
  "type": "module",
6
6
  "files": [