@situaction/traq-ui-ste 1.2.34 → 1.2.35

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,8 +1,9 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import { Button as p } from "../../button/Button.js";
3
3
  import "react";
4
4
  import "../../icon-button/IconButton.js";
5
5
  import { Checkbox as _ } from "../../checkbox/Checkbox.js";
6
+ import "../../../index-CxdrhfJv.mjs";
6
7
  import "../../accordion/Accordion.js";
7
8
  import { Icon as a } from "../../icon/Icon.js";
8
9
  import "../../modal/Modal.js";
@@ -15,19 +16,19 @@ const u = "_list_1nihg_6", f = "_children_1nihg_29", g = "_selected_1nihg_43", k
15
16
  children: f,
16
17
  selected: g,
17
18
  reset: k
18
- }, S = ({ listChildren: l, handleItemClick: d, selectedItems: m, onReset: r, labelButtonReset: n }) => /* @__PURE__ */ o("div", { className: i.list, children: [
19
+ }, X = ({ listChildren: l, handleItemClick: d, selectedItems: m, onReset: r, labelButtonReset: n }) => /* @__PURE__ */ c("div", { className: i.list, children: [
19
20
  /* @__PURE__ */ e("div", { children: l.map((t, h) => {
20
21
  if (t.key == null) return null;
21
- const s = t.key, c = m.includes(s);
22
- return /* @__PURE__ */ o(
22
+ const s = t.key, o = m.includes(s);
23
+ return /* @__PURE__ */ c(
23
24
  "div",
24
25
  {
25
- className: `${c ? i.selected : ""} ${i.children}`,
26
+ className: `${o ? i.selected : ""} ${i.children}`,
26
27
  children: [
27
28
  /* @__PURE__ */ e(
28
29
  _,
29
30
  {
30
- checked: c,
31
+ checked: o,
31
32
  onChange: () => d(s)
32
33
  }
33
34
  ),
@@ -48,5 +49,5 @@ const u = "_list_1nihg_6", f = "_children_1nihg_29", g = "_selected_1nihg_43", k
48
49
  ) })
49
50
  ] });
50
51
  export {
51
- S as ListControls
52
+ X as ListControls
52
53
  };
@@ -1,8 +1,9 @@
1
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
2
  import { NestedListItem as l } from "./item/NestedListItem.js";
3
3
  import { Button as c } from "../../button/Button.js";
4
4
  import "react";
5
5
  import "../../icon-button/IconButton.js";
6
+ import "../../../index-CxdrhfJv.mjs";
6
7
  import "../../accordion/Accordion.js";
7
8
  import { Icon as a } from "../../icon/Icon.js";
8
9
  import "../../modal/Modal.js";
@@ -10,13 +11,13 @@ import "../../carousel/Carousel.js";
10
11
  import "../../carousel/FadeCarousel.js";
11
12
  import "../../theme/ThemeContext.js";
12
13
  import '../../../styles/Size.css';import '../../../styles/NestedList.css';/* empty css */
13
- const h = "_nestedlist_7rnd3_6", _ = "_reset_7rnd3_18", i = {
14
+ const h = "_nestedlist_7rnd3_6", _ = "_reset_7rnd3_18", e = {
14
15
  nestedlist: h,
15
16
  reset: _
16
- }, F = ({ items: s, align: o = "right", onReset: r, children: m, labelButtonReset: e }) => /* @__PURE__ */ p("div", { className: i.nestedlist, children: [
17
- s.map((n, d) => /* @__PURE__ */ t(l, { ...n, align: o ?? "right", children: m }, d)),
18
- r && e && /* @__PURE__ */ t("div", { className: i.reset, children: /* @__PURE__ */ t(c, { mode: "ghost", label: e, onClick: r, childrenLeft: /* @__PURE__ */ t(a, { icon: "FunnelX" }) }) })
17
+ }, X = ({ items: s, align: o = "right", onReset: r, children: m, labelButtonReset: i }) => /* @__PURE__ */ d("div", { className: e.nestedlist, children: [
18
+ s.map((n, p) => /* @__PURE__ */ t(l, { ...n, align: o ?? "right", children: m }, p)),
19
+ r && i && /* @__PURE__ */ t("div", { className: e.reset, children: /* @__PURE__ */ t(c, { mode: "ghost", label: i, onClick: r, childrenLeft: /* @__PURE__ */ t(a, { icon: "FunnelX" }) }) })
19
20
  ] });
20
21
  export {
21
- F as NestedList
22
+ X as NestedList
22
23
  };
@@ -3,6 +3,7 @@ import { useState as g, useRef as u, useLayoutEffect as z } from "react";
3
3
  import "../../../button/Button.js";
4
4
  import "../../../icon-button/IconButton.js";
5
5
  import { TagCounter as B } from "../../../tag-counter/TagCounter.js";
6
+ import "../../../../index-CxdrhfJv.mjs";
6
7
  import "../../../accordion/Accordion.js";
7
8
  import { Icon as l } from "../../../icon/Icon.js";
8
9
  import { Modal as L } from "../../../modal/Modal.js";
@@ -15,7 +16,7 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
15
16
  items: $,
16
17
  textSmall: j,
17
18
  modal: v
18
- }, D = ({
19
+ }, G = ({
19
20
  icon: a,
20
21
  title: h,
21
22
  numberSelect: i,
@@ -23,13 +24,13 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
23
24
  onClick: m,
24
25
  align: e = "right"
25
26
  }) => {
26
- const [c, d] = g(!1), r = u(null), o = u(null), [x, C] = g({
27
+ const [c, p] = g(!1), r = u(null), o = u(null), [x, C] = g({
27
28
  top: "0px"
28
29
  });
29
30
  z(() => {
30
- var p;
31
+ var d;
31
32
  if (r.current && o.current) {
32
- const N = o.current.getBoundingClientRect(), f = r.current.getBoundingClientRect().width, M = ((p = o.current.parentElement) == null ? void 0 : p.getBoundingClientRect().top) || 0;
33
+ const N = o.current.getBoundingClientRect(), f = r.current.getBoundingClientRect().width, M = ((d = o.current.parentElement) == null ? void 0 : d.getBoundingClientRect().top) || 0;
33
34
  C({
34
35
  top: `${N.top - M}px`,
35
36
  ...e === "right" ? { right: `-${f + 6}px` } : { left: `-${f + 6}px` }
@@ -37,7 +38,7 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
37
38
  }
38
39
  }, [c, e]);
39
40
  const R = () => {
40
- d(!0), m && m();
41
+ p(!0), m && m();
41
42
  };
42
43
  return /* @__PURE__ */ n(w, { children: [
43
44
  /* @__PURE__ */ n(
@@ -63,7 +64,7 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
63
64
  ref: r,
64
65
  className: s.modal,
65
66
  open: c,
66
- onClose: () => d(!1),
67
+ onClose: () => p(!1),
67
68
  position: x,
68
69
  children: _
69
70
  }
@@ -71,5 +72,5 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
71
72
  ] });
72
73
  };
73
74
  export {
74
- D as NestedListItem
75
+ G as NestedListItem
75
76
  };
@@ -2,6 +2,7 @@ import { jsx as n, jsxs as d } from "react/jsx-runtime";
2
2
  import { useState as c, useRef as M, useEffect as B } from "react";
3
3
  import { Button as $ } from "../button/Button.js";
4
4
  import { IconButton as f } from "../icon-button/IconButton.js";
5
+ import "../../index-CxdrhfJv.mjs";
5
6
  import "../accordion/Accordion.js";
6
7
  import { Icon as N } from "../icon/Icon.js";
7
8
  import { Modal as W } from "../modal/Modal.js";
@@ -27,7 +28,7 @@ const y = "_fullHeight_11eub_15", O = "_fullWidth_11eub_18", j = "_open_11eub_21
27
28
  flexVerticalBetweenStart: Y,
28
29
  flexHorizontalCenter: Z,
29
30
  flexVerticalBetweenCenter: ee
30
- }, fe = ({ menuItems: s = [], menuParams: a = [], shortLogo: m, logo: p, isOpen: h, defaultOpen: I = !1, selectedId: u }) => {
31
+ }, _e = ({ menuItems: s = [], menuParams: a = [], shortLogo: m, logo: p, isOpen: h, defaultOpen: I = !1, selectedId: u }) => {
31
32
  const [l, g] = c(I ?? !1), [b, x] = c(u ?? (s.length > 0 ? s[0].id : null)), w = M(null), [H, _] = c(!1), [L, C] = c(!1), [k, E] = c(null), [z, R] = c({}), V = M(null);
32
33
  B(() => {
33
34
  u != null && x(u);
@@ -118,5 +119,5 @@ const y = "_fullHeight_11eub_15", O = "_fullWidth_11eub_18", j = "_open_11eub_21
118
119
  ] }) });
119
120
  };
120
121
  export {
121
- fe as Menu
122
+ _e as Menu
122
123
  };
@@ -2,6 +2,7 @@ import { jsxs as C, jsx as e } from "react/jsx-runtime";
2
2
  import "../../button/Button.js";
3
3
  import "react";
4
4
  import { IconButton as i } from "../../icon-button/IconButton.js";
5
+ import "../../../index-CxdrhfJv.mjs";
5
6
  import "../../accordion/Accordion.js";
6
7
  import { Icon as t } from "../../icon/Icon.js";
7
8
  import "../../modal/Modal.js";
@@ -9,11 +10,11 @@ import "../../carousel/Carousel.js";
9
10
  import "../../carousel/FadeCarousel.js";
10
11
  import "../../theme/ThemeContext.js";
11
12
  import '../../../styles/Size.css';import '../../../styles/SidePanelHeader.css';/* empty css */
12
- const c = "_sidePanelHeader_72g7b_6", m = "_buttonArrow_72g7b_13", h = "_title_72g7b_20", r = {
13
+ const c = "_sidePanelHeader_72g7b_6", m = "_buttonArrow_72g7b_13", p = "_title_72g7b_20", r = {
13
14
  sidePanelHeader: c,
14
15
  buttonArrow: m,
15
- title: h
16
- }, y = ({
16
+ title: p
17
+ }, H = ({
17
18
  title: s,
18
19
  icon: o,
19
20
  onClickBack: L,
@@ -75,5 +76,5 @@ const c = "_sidePanelHeader_72g7b_6", m = "_buttonArrow_72g7b_13", h = "_title_7
75
76
  )
76
77
  ] });
77
78
  export {
78
- y as SidePanelHeader
79
+ H as SidePanelHeader
79
80
  };
@@ -3,6 +3,7 @@ import { useState as y, useRef as v, useEffect as d } from "react";
3
3
  import { Button as W } from "../button/Button.js";
4
4
  import { Input as H } from "../input/Input.js";
5
5
  import { IconButton as J } from "../icon-button/IconButton.js";
6
+ import "../../index-CxdrhfJv.mjs";
6
7
  import "../accordion/Accordion.js";
7
8
  import { Icon as _ } from "../icon/Icon.js";
8
9
  import { Modal as Q } from "../modal/Modal.js";
@@ -19,7 +20,7 @@ const X = "_selectContainer_133eb_54", Y = "_children_133eb_61", Z = "_active_13
19
20
  itemLabel: ee,
20
21
  searchWrapper: te,
21
22
  noResults: ne
22
- }, pe = ({
23
+ }, ve = ({
23
24
  selected: k,
24
25
  size: g = "m",
25
26
  listItem: h,
@@ -215,5 +216,5 @@ const X = "_selectContainer_133eb_54", Y = "_children_133eb_61", Z = "_active_13
215
216
  ] });
216
217
  };
217
218
  export {
218
- pe as Select
219
+ ve as Select
219
220
  };
@@ -3,15 +3,16 @@ import "../button/Button.js";
3
3
  import "react";
4
4
  import { Input as p } from "../input/Input.js";
5
5
  import "../icon-button/IconButton.js";
6
+ import "../../index-CxdrhfJv.mjs";
6
7
  import "../accordion/Accordion.js";
7
8
  import "../modal/Modal.js";
8
9
  import "../carousel/Carousel.js";
9
10
  import "../carousel/FadeCarousel.js";
10
11
  import "../theme/ThemeContext.js";
11
12
  import '../../styles/Size.css';import '../../styles/SelectFilterInputTags.css';/* empty css */
12
- const a = "_listTagSelect_2v3fb_6", c = {
13
- listTagSelect: a
14
- }, y = ({ children: o, inputValue: r, handleInputChange: s, handleKeyDown: i }) => /* @__PURE__ */ e("div", { className: c.listTagSelect, children: /* @__PURE__ */ l("div", { children: [
13
+ const m = "_listTagSelect_2v3fb_6", a = {
14
+ listTagSelect: m
15
+ }, _ = ({ children: o, inputValue: r, handleInputChange: s, handleKeyDown: i }) => /* @__PURE__ */ e("div", { className: a.listTagSelect, children: /* @__PURE__ */ l("div", { children: [
15
16
  o,
16
17
  /* @__PURE__ */ e("div", { className: "flexAutoSize", children: /* @__PURE__ */ e(
17
18
  p,
@@ -30,5 +31,5 @@ const a = "_listTagSelect_2v3fb_6", c = {
30
31
  ) })
31
32
  ] }) });
32
33
  export {
33
- y as SelectFilterInputTags
34
+ _ as SelectFilterInputTags
34
35
  };
@@ -4,6 +4,7 @@ import { n as v, s as C, a as x } from "../../X.es-BEJ-zMPl.mjs";
4
4
  import { Button as M } from "../button/Button.js";
5
5
  import "../icon-button/IconButton.js";
6
6
  import { TagCounter as w } from "../tag-counter/TagCounter.js";
7
+ import "../../index-CxdrhfJv.mjs";
7
8
  import "../accordion/Accordion.js";
8
9
  import { Modal as y } from "../modal/Modal.js";
9
10
  import "../carousel/Carousel.js";
@@ -14,16 +15,16 @@ const N = "_relative_w7e9a_6", R = "_tagCounter_w7e9a_10", b = "_modal_w7e9a_18"
14
15
  relative: N,
15
16
  tagCounter: R,
16
17
  modal: b
17
- }, D = ({
18
+ }, E = ({
18
19
  label: a,
19
20
  iconButton: l,
20
21
  selectedCount: t = 0,
21
- onClearSelection: n,
22
- children: m,
22
+ onClearSelection: m,
23
+ children: n,
23
24
  size: c = "m",
24
25
  align: p = "right"
25
26
  }) => {
26
- const [e, i] = _(!1), d = h(null), f = () => i(!1), g = t > 0 ? /* @__PURE__ */ o(v, { onClick: n }) : e ? /* @__PURE__ */ o(C, {}) : /* @__PURE__ */ o(x, {}), u = t > 0 ? "secondary" : "tertiary";
27
+ const [e, i] = _(!1), d = h(null), f = () => i(!1), g = t > 0 ? /* @__PURE__ */ o(v, { onClick: m }) : e ? /* @__PURE__ */ o(C, {}) : /* @__PURE__ */ o(x, {}), u = t > 0 ? "secondary" : "tertiary";
27
28
  return /* @__PURE__ */ s("div", { className: r.relative, children: [
28
29
  /* @__PURE__ */ o(
29
30
  M,
@@ -39,9 +40,9 @@ const N = "_relative_w7e9a_6", R = "_tagCounter_w7e9a_10", b = "_modal_w7e9a_18"
39
40
  onClick: () => i(!e)
40
41
  }
41
42
  ),
42
- /* @__PURE__ */ o(y, { ref: d, open: e, onClose: f, className: r.modal, position: { top: "calc(100% + 6px)", ...p === "right" ? { left: "0" } : { right: "0" } }, children: m })
43
+ /* @__PURE__ */ o(y, { ref: d, open: e, onClose: f, className: r.modal, position: { top: "calc(100% + 6px)", ...p === "right" ? { left: "0" } : { right: "0" } }, children: n })
43
44
  ] });
44
45
  };
45
46
  export {
46
- D as SelectMultiItems
47
+ E as SelectMultiItems
47
48
  };
@@ -2,6 +2,7 @@ import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
2
  import { useState as $, useEffect as b } from "react";
3
3
  import "../button/Button.js";
4
4
  import { IconButton as k } from "../icon-button/IconButton.js";
5
+ import "../../index-CxdrhfJv.mjs";
5
6
  import "../accordion/Accordion.js";
6
7
  import { Icon as g } from "../icon/Icon.js";
7
8
  import "../modal/Modal.js";
@@ -20,7 +21,7 @@ const y = "_slider_1mxgk_21", I = "_s_1mxgk_6", N = "_m_1mxgk_58", S = "_l_1mxgk
20
21
  wrapper: E,
21
22
  button: R,
22
23
  active: T
23
- }, O = ({
24
+ }, P = ({
24
25
  size: i = "m",
25
26
  variant: w = "classic",
26
27
  checked: l,
@@ -92,5 +93,5 @@ const y = "_slider_1mxgk_21", I = "_s_1mxgk_6", N = "_m_1mxgk_58", S = "_l_1mxgk
92
93
  ] });
93
94
  };
94
95
  export {
95
- O as Switch
96
+ P as Switch
96
97
  };
@@ -15,8 +15,8 @@ export type TooltipProps = {
15
15
  };
16
16
  /**
17
17
  * Tooltip component that shows additional information when hovering over an element.
18
- * The tooltip can be positioned in various ways relative to the element, and its content
19
- * can be customized. It also allows control over the gap and padding around the tooltip.
18
+ * Renders via a portal to escape overflow/scroll containers, and automatically
19
+ * adjusts position to stay within the viewport.
20
20
  */
21
21
  export declare const Tooltip: FC<TooltipProps>;
22
22
  export default Tooltip;
@@ -1,44 +1,92 @@
1
- import { jsxs as g, jsx as b } from "react/jsx-runtime";
2
- import { useState as d } from "react";
3
- import '../../styles/Tooltip.css';const y = "_tooltip_19b26_30", s = {
4
- "tooltip-container": "_tooltip-container_19b26_30",
5
- tooltip: y
6
- }, _ = ({ children: l, content: a, position: i = "top", gap: n = "xs-5", padding: r = "xs-5" }) => {
7
- const [p, o] = d(!1), c = [
8
- s.tooltip,
9
- "labelMedium",
10
- "fontWeight-600"
11
- ].filter(Boolean).join(" "), m = {
12
- "--dynamic-gap": `var(--spacing-${n})`,
13
- "--dynamic-padding": `var(--spacing-${r})`
14
- }, f = () => {
15
- const t = "calc(100% + var(--dynamic-gap))", e = {
16
- top: { bottom: t, left: "50%", transform: "translateX(-50%)" },
17
- topLeft: { bottom: t, right: "100%" },
18
- topRight: { bottom: t, left: "100%" },
19
- bottom: { top: t, left: "50%", transform: "translateX(-50%)" },
20
- bottomLeft: { top: t, right: "100%" },
21
- bottomRight: { top: t, left: "100%" },
22
- left: { top: "50%", right: t, transform: "translateY(-50%)" },
23
- right: { top: "50%", left: t, transform: "translateY(-50%)" }
24
- };
25
- return { ...e[i] || e.top };
26
- };
27
- return /* @__PURE__ */ g(
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";
4
+ import '../../styles/Tooltip.css';const I = "_tooltip_ymexm_30", y = {
5
+ "tooltip-container": "_tooltip-container_ymexm_30",
6
+ tooltip: I
7
+ }, W = {
8
+ "xs-5": 6,
9
+ "xs-3": 10,
10
+ xs: 14,
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;
15
+ let s, i;
16
+ switch (u) {
17
+ case "top":
18
+ s = t.top - e.height - o, i = t.left + t.width / 2 - e.width / 2;
19
+ break;
20
+ case "topLeft":
21
+ s = t.top - e.height - o, i = t.right - e.width;
22
+ break;
23
+ case "topRight":
24
+ s = t.top - e.height - o, i = t.left;
25
+ break;
26
+ case "bottom":
27
+ s = t.bottom + o, i = t.left + t.width / 2 - e.width / 2;
28
+ break;
29
+ case "bottomLeft":
30
+ s = t.bottom + o, i = t.right - e.width;
31
+ break;
32
+ case "bottomRight":
33
+ s = t.bottom + o, i = t.left;
34
+ break;
35
+ case "left":
36
+ s = t.top + t.height / 2 - e.height / 2, i = t.left - e.width - o;
37
+ break;
38
+ case "right":
39
+ s = t.top + t.height / 2 - e.height / 2, i = t.right + o;
40
+ break;
41
+ default:
42
+ s = t.top - e.height - o, i = t.left + t.width / 2 - e.width / 2;
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(() => {
47
+ const t = [
48
+ "--background-tooltip",
49
+ "--general-border-window",
50
+ "--general-text-icons",
51
+ "--shadow-color-minimal"
52
+ ];
53
+ if (l && n.current && d.current) {
54
+ const e = getComputedStyle(n.current), a = t.reduce((i, b) => {
55
+ const p = e.getPropertyValue(b).trim();
56
+ return p && (i[b] = p), i;
57
+ }, {}), m = n.current.getBoundingClientRect(), s = d.current.getBoundingClientRect();
58
+ h({ ...f(m, s), ...a });
59
+ }
60
+ }, [l, f]);
61
+ const C = () => {
62
+ h({ visibility: "hidden" }), g(!0);
63
+ }, V = [y.tooltip, "labelMedium", "fontWeight-600"].join(" "), P = { "--dynamic-padding": `var(--spacing-${_})` };
64
+ return /* @__PURE__ */ S(
28
65
  "div",
29
66
  {
30
- className: s["tooltip-container"],
31
- style: m,
32
- onMouseEnter: () => o(!0),
33
- onMouseLeave: () => o(!1),
67
+ ref: n,
68
+ className: y["tooltip-container"],
69
+ onMouseEnter: C,
70
+ onMouseLeave: () => g(!1),
34
71
  children: [
35
- l,
36
- p && /* @__PURE__ */ b("div", { className: c, style: f(), children: a })
72
+ v,
73
+ l && j.createPortal(
74
+ /* @__PURE__ */ c(
75
+ "div",
76
+ {
77
+ ref: d,
78
+ className: V,
79
+ style: { ...P, ...E },
80
+ children: k
81
+ }
82
+ ),
83
+ document.body
84
+ )
37
85
  ]
38
86
  }
39
87
  );
40
88
  };
41
89
  export {
42
- _ as Tooltip,
43
- _ as default
90
+ N as Tooltip,
91
+ N as default
44
92
  };