@situaction/traq-ui-ste 1.2.36 → 1.2.40

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,6 +1,6 @@
1
- import { jsxs as S, jsx as c } from "react/jsx-runtime";
2
- import { useState as w, useRef as x, useCallback as L, useLayoutEffect as T } from "react";
3
- import { r as j } from "../../index-CxdrhfJv.mjs";
1
+ import { jsxs as S, jsx as L } from "react/jsx-runtime";
2
+ import { useState as w, useRef as x, useCallback as T, useLayoutEffect as c } from "react";
3
+ import { createPortal as j } from "react-dom";
4
4
  import '../../styles/Tooltip.css';const I = "_tooltip_ymexm_30", y = {
5
5
  "tooltip-container": "_tooltip-container_ymexm_30",
6
6
  tooltip: I
@@ -9,11 +9,11 @@ import '../../styles/Tooltip.css';const I = "_tooltip_ymexm_30", y = {
9
9
  "xs-3": 10,
10
10
  xs: 14,
11
11
  "m-1": 18
12
- }, r = 8, N = ({ children: v, content: k, position: u = "top", gap: M = "xs-5", padding: _ = "xs-5" }) => {
13
- const [l, g] = w(!1), [E, h] = w({ visibility: "hidden" }), n = x(null), d = x(null), o = W[M] ?? 6, f = L((t, e) => {
14
- const a = window.innerWidth, m = window.innerHeight;
12
+ }, l = 8, N = ({ children: v, content: k, position: g = "top", gap: M = "xs-5", padding: _ = "xs-5" }) => {
13
+ const [r, m] = w(!1), [C, h] = w({ visibility: "hidden" }), n = x(null), d = x(null), o = W[M] ?? 6, f = T((t, e) => {
14
+ const a = window.innerWidth, u = window.innerHeight;
15
15
  let s, i;
16
- switch (u) {
16
+ switch (g) {
17
17
  case "top":
18
18
  s = t.top - e.height - o, i = t.left + t.width / 2 - e.width / 2;
19
19
  break;
@@ -41,42 +41,42 @@ import '../../styles/Tooltip.css';const I = "_tooltip_ymexm_30", y = {
41
41
  default:
42
42
  s = t.top - e.height - o, i = t.left + t.width / 2 - e.width / 2;
43
43
  }
44
- return i = Math.max(r, Math.min(i, a - e.width - r)), s = Math.max(r, Math.min(s, m - e.height - r)), { position: "fixed", top: s, left: i, visibility: "visible" };
45
- }, [u, o]);
46
- T(() => {
44
+ return i = Math.max(l, Math.min(i, a - e.width - l)), s = Math.max(l, Math.min(s, u - e.height - l)), { position: "fixed", top: s, left: i, visibility: "visible" };
45
+ }, [g, o]);
46
+ c(() => {
47
47
  const t = [
48
48
  "--background-tooltip",
49
49
  "--general-border-window",
50
50
  "--general-text-icons",
51
51
  "--shadow-color-minimal"
52
52
  ];
53
- if (l && n.current && d.current) {
53
+ if (r && n.current && d.current) {
54
54
  const e = getComputedStyle(n.current), a = t.reduce((i, b) => {
55
55
  const p = e.getPropertyValue(b).trim();
56
56
  return p && (i[b] = p), i;
57
- }, {}), m = n.current.getBoundingClientRect(), s = d.current.getBoundingClientRect();
58
- h({ ...f(m, s), ...a });
57
+ }, {}), u = n.current.getBoundingClientRect(), s = d.current.getBoundingClientRect();
58
+ h({ ...f(u, s), ...a });
59
59
  }
60
- }, [l, f]);
61
- const C = () => {
62
- h({ visibility: "hidden" }), g(!0);
60
+ }, [r, f]);
61
+ const E = () => {
62
+ h({ visibility: "hidden" }), m(!0);
63
63
  }, V = [y.tooltip, "labelMedium", "fontWeight-600"].join(" "), P = { "--dynamic-padding": `var(--spacing-${_})` };
64
64
  return /* @__PURE__ */ S(
65
65
  "div",
66
66
  {
67
67
  ref: n,
68
68
  className: y["tooltip-container"],
69
- onMouseEnter: C,
70
- onMouseLeave: () => g(!1),
69
+ onMouseEnter: E,
70
+ onMouseLeave: () => m(!1),
71
71
  children: [
72
72
  v,
73
- l && j.createPortal(
74
- /* @__PURE__ */ c(
73
+ r && j(
74
+ /* @__PURE__ */ L(
75
75
  "div",
76
76
  {
77
77
  ref: d,
78
78
  className: V,
79
- style: { ...P, ...E },
79
+ style: { ...P, ...C },
80
80
  children: k
81
81
  }
82
82
  ),
@@ -1 +1 @@
1
- @charset "UTF-8";._accordionHeader_bor6q_7{display:flex;align-items:center;justify-content:space-between;border-radius:.375rem;gap:.375rem}._padding-s_bor6q_15{padding:var(--spacing-xs-4)}._padding-m_bor6q_19{padding:var(--spacing-xs-2)}._padding-l_bor6q_23{padding:var(--spacing-xs)}._padding-xl_bor6q_27{padding:var(--spacing-s)}._title_bor6q_31{flex-grow:1;text-align:left}._fullHeight_bor6q_36{height:100%}._block_bor6q_40{border:1px solid var(--general-border-window);box-shadow:0 4px 5px 0 var(--shadow-color-minimal);background:var(--background-primary);border-radius:.375rem}._tile_bor6q_48 ._accordionHeader_bor6q_7{border-radius:.375rem;background:var(--background-primary);margin-bottom:.375rem;border:1px solid var(--general-border-window)}._secondaryOpen_bor6q_56{background:var(--skeleton-step-empty-background)}
1
+ @charset "UTF-8";._accordionHeader_10lt2_7{display:flex;align-items:center;justify-content:space-between;border-radius:.375rem;gap:.375rem}._padding-s_10lt2_15{padding:var(--spacing-xs-4)}._padding-m_10lt2_19{padding:var(--spacing-xs-2)}._padding-l_10lt2_23{padding:var(--spacing-xs)}._padding-xl_10lt2_27{padding:var(--spacing-s)}._title_10lt2_31{flex-grow:1;text-align:left}._fullHeight_10lt2_36{height:100%}._block_10lt2_40{border:1px solid var(--general-border-window);box-shadow:0 4px 5px 0 var(--shadow-color-minimal);background:var(--background-primary);border-radius:.375rem}._tile_10lt2_48 ._accordionHeader_10lt2_7{border-radius:.375rem;background:var(--background-primary);margin-bottom:.375rem;border:1px solid var(--general-border-window)}._secondaryOpen_10lt2_56{background:var(--skeleton-step-empty-background)}._ghost_10lt2_61 ._accordionHeader_10lt2_7{padding-left:0;padding-right:0}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.2.36",
3
+ "version": "1.2.40",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",