@reportportal/ui-kit 0.0.1-alpha.176 → 0.0.1-alpha.177

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 (2) hide show
  1. package/dist/tooltip.js +59 -57
  2. package/package.json +1 -1
package/dist/tooltip.js CHANGED
@@ -1,105 +1,107 @@
1
- import { jsxs as p, Fragment as P, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as u, Fragment as P, jsx as s } from "react/jsx-runtime";
2
2
  import { useState as R, useRef as f } from "react";
3
3
  import { createPortal as G } from "react-dom";
4
4
  import { c as j } from "./bind-06a7ff84.js";
5
5
  import { useFloating as k, offset as $, flip as B, arrow as C, autoUpdate as U, FloatingArrow as Y } from "@floating-ui/react";
6
- import { T as u, g as Z, b as q, a as z } from "./floatingUi-41f8c7b5.js";
6
+ import { T as h, g as Z, b as q, a as z } from "./floatingUi-41f8c7b5.js";
7
7
  const J = {
8
8
  "tooltip-wrapper": "_tooltip-wrapper_1n6ya_16",
9
9
  "tooltip-content": "_tooltip-content_1n6ya_26"
10
- }, s = j.bind(J), K = 300, Q = 100, st = ({
11
- content: h,
10
+ }, i = j.bind(J), K = 300, Q = 100, st = ({
11
+ content: g,
12
12
  wrapperClassName: x,
13
- tooltipClassName: g,
13
+ tooltipClassName: T,
14
14
  contentClassName: w,
15
- dynamicWidth: T,
16
- width: _,
17
- minWidth: A = 120,
18
- safeZone: E = 4,
19
- zIndex: b = 9,
20
- placement: y = "bottom",
21
- arrowColor: I = "rgba(34, 34, 34, 0.91)",
22
- dataAutomationId: N,
23
- mainAxis: F = !0,
24
- children: O,
25
- portalRoot: i,
26
- isFloating: S = !0
15
+ dynamicWidth: _,
16
+ width: A,
17
+ minWidth: E = 120,
18
+ safeZone: b = 4,
19
+ zIndex: y = 9,
20
+ placement: I = "bottom",
21
+ arrowColor: N = "rgba(34, 34, 34, 0.91)",
22
+ dataAutomationId: F,
23
+ mainAxis: O = !0,
24
+ children: S,
25
+ portalRoot: r,
26
+ isFloating: W = !0
27
27
  }) => {
28
- const [a, l] = R(!1), r = f(null), t = f(), { refs: c, floatingStyles: W, context: v } = k({
28
+ const [a, l] = R(!1), c = f(null), e = f(), { refs: m, floatingStyles: v, context: L } = k({
29
29
  open: a,
30
- placement: y,
30
+ placement: I,
31
31
  middleware: [
32
- $(({ rects: D, placement: H }) => ({
33
- mainAxis: E + u,
34
- alignmentAxis: Z(D, H)
32
+ $(({ rects: t, placement: H }) => ({
33
+ mainAxis: b + h,
34
+ alignmentAxis: Z(t, H)
35
35
  })),
36
- S && B({
37
- mainAxis: F,
36
+ W && B({
37
+ mainAxis: O,
38
38
  fallbackAxisSideDirection: "start",
39
39
  fallbackPlacements: q
40
40
  }),
41
41
  C({
42
- element: r
42
+ element: c
43
43
  })
44
44
  ],
45
45
  whileElementsMounted: U
46
- }), e = T ? null : { width: `${_}px` }, L = document.documentElement.clientWidth, M = e || L - Q, o = () => {
47
- t.current && clearTimeout(t.current), l(!1);
48
- }, m = () => {
49
- t.current = setTimeout(() => l(!0), K);
50
- }, d = () => /* @__PURE__ */ p(
46
+ }), o = _ ? null : { width: `${A}px` }, M = document.documentElement.clientWidth, D = o || M - Q, n = () => {
47
+ e.current && clearTimeout(e.current), l(!1);
48
+ }, d = () => {
49
+ e.current = setTimeout(() => l(!0), K);
50
+ }, p = () => /* @__PURE__ */ u(
51
51
  "div",
52
52
  {
53
- ref: c.setFloating,
53
+ ref: m.setFloating,
54
54
  style: {
55
- ...W,
56
- ...e,
57
- minWidth: A,
58
- zIndex: b,
55
+ ...v,
56
+ ...o,
57
+ minWidth: E,
58
+ zIndex: y,
59
59
  pointerEvents: "none"
60
60
  },
61
- "data-automation-id": N,
62
- className: s(g),
61
+ "data-automation-id": F,
62
+ className: i(T),
63
63
  children: [
64
- /* @__PURE__ */ n(
64
+ /* @__PURE__ */ s(
65
65
  Y,
66
66
  {
67
- ref: r,
68
- context: v,
67
+ ref: c,
68
+ context: L,
69
69
  width: z,
70
- height: u,
71
- fill: I
70
+ height: h,
71
+ fill: N
72
72
  }
73
73
  ),
74
- /* @__PURE__ */ n(
74
+ /* @__PURE__ */ s(
75
75
  "div",
76
76
  {
77
- className: s("tooltip-content", w),
77
+ className: i("tooltip-content", w),
78
78
  style: {
79
- maxWidth: `${M}px`
79
+ maxWidth: `${D}px`
80
80
  },
81
- children: h
81
+ children: g
82
82
  }
83
83
  )
84
84
  ]
85
85
  }
86
86
  );
87
- return /* @__PURE__ */ p(P, { children: [
88
- /* @__PURE__ */ n(
87
+ return /* @__PURE__ */ u(P, { children: [
88
+ /* @__PURE__ */ s(
89
89
  "div",
90
90
  {
91
- ref: c.setReference,
92
- className: s("tooltip-wrapper", x),
93
- onMouseDown: o,
94
- onMouseEnter: m,
95
- onMouseLeave: o,
96
- onFocus: m,
97
- onBlur: o,
91
+ ref: m.setReference,
92
+ className: i("tooltip-wrapper", x),
93
+ onMouseDown: n,
94
+ onMouseEnter: d,
95
+ onMouseLeave: n,
96
+ onFocus: (t) => {
97
+ t.target === t.currentTarget && d();
98
+ },
99
+ onBlur: n,
98
100
  tabIndex: 0,
99
- children: O
101
+ children: S
100
102
  }
101
103
  ),
102
- a && (i ? G(d(), i) : d())
104
+ a && (r ? G(p(), r) : p())
103
105
  ] });
104
106
  };
105
107
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.176",
3
+ "version": "0.0.1-alpha.177",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {