@situaction/traq-ui-ste 1.1.18 → 1.1.19

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,7 +1,8 @@
1
1
  import { FC } from 'react';
2
+ import { IconProps as PhosphorIconProps } from '@phosphor-icons/react';
2
3
 
3
4
  import * as PhosphorIcons from "@phosphor-icons/react";
4
- export interface IconProps {
5
+ export interface IconProps extends Omit<PhosphorIconProps, "size" | "weight" | "color"> {
5
6
  /** Name of the icon from @phosphor-icons/react */
6
7
  icon: keyof typeof PhosphorIcons;
7
8
  /** Size of the icon in pixels (default: 16) */
@@ -1,13 +1,13 @@
1
- import { jsx as l, jsxs as f } from "react/jsx-runtime";
2
- import { useState as c, useRef as v, useEffect as M } from "react";
3
- import { Button as $ } from "../button/Button.js";
1
+ import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
+ import { useState as c, useRef as M, useEffect as $ } from "react";
3
+ import { Button as b } from "../button/Button.js";
4
4
  import '../../styles/Size.css';import '../../styles/index.css';import '../../styles/Menu.css';/* empty css */
5
- import { IconButton as h } from "../icon-button/IconButton.js";
6
- import { Icon as b } from "../icon/Icon.js";
5
+ import { IconButton as u } from "../icon-button/IconButton.js";
6
+ import { Icon as w } from "../icon/Icon.js";
7
7
  import { Modal as y } from "../modal/Modal.js";
8
8
  import "../theme/ThemeContext.js";
9
9
  /* empty css */
10
- const O = "_fullHeight_ikhx4_15", S = "_fullWidth_ikhx4_18", j = "_open_ikhx4_21", D = "_close_ikhx4_25", q = "_menuButton_ikhx4_29", A = "_closeIcon_ikhx4_37", F = "_label_ikhx4_42", G = "_textEllipsis_ikhx4_46", J = "_pointer_ikhx4_51", K = "_fullImg_ikhx4_54", Q = "_menuParams_ikhx4_60", T = "_line_ikhx4_66", U = "_borderRadiusM_ikhx4_73", X = "_menuItem_ikhx4_77", Y = "_flexVerticalBetweenStart_ikhx4_86", Z = "_flexHorizontalBetween_ikhx4_93", ee = "_flexVertical_ikhx4_86", ne = "_flexVerticalBetweenCenter_ikhx4_107", e = {
10
+ const O = "_fullHeight_o2xi7_15", S = "_fullWidth_o2xi7_18", j = "_open_o2xi7_21", D = "_close_o2xi7_25", q = "_menuButton_o2xi7_29", A = "_closeIcon_o2xi7_37", F = "_label_o2xi7_42", G = "_textEllipsis_o2xi7_46", J = "_pointer_o2xi7_51", K = "_fullImg_o2xi7_54", Q = "_menuParams_o2xi7_60", T = "_line_o2xi7_66", U = "_borderRadiusM_o2xi7_73", X = "_menuItem_o2xi7_77", Y = "_flexVerticalBetweenStart_o2xi7_86", Z = "_flexHorizontalBetween_o2xi7_93", ee = "_flexVertical_o2xi7_86", oe = "_flexVerticalBetweenCenter_o2xi7_107", e = {
11
11
  fullHeight: O,
12
12
  fullWidth: S,
13
13
  open: j,
@@ -25,92 +25,92 @@ const O = "_fullHeight_ikhx4_15", S = "_fullWidth_ikhx4_18", j = "_open_ikhx4_21
25
25
  flexVerticalBetweenStart: Y,
26
26
  flexHorizontalBetween: Z,
27
27
  flexVertical: ee,
28
- flexVerticalBetweenCenter: ne
29
- }, fe = ({ menuItems: s = [], menuParams: r = [], shortLogo: _, logo: x, isOpen: m, defaultOpen: w = !1, defaultSelectedId: d }) => {
30
- const [o, p] = c(w ?? !1), [k, g] = c(d ?? (s.length > 0 ? s[0].id : null)), N = v(null), [I, u] = c(!1), [V, B] = c(!1), [H, E] = c(null), [z, R] = c({}), L = v(null);
31
- M(() => {
32
- d && g(d);
28
+ flexVerticalBetweenCenter: oe
29
+ }, fe = ({ menuItems: s = [], menuParams: r = [], shortLogo: x, logo: m, isOpen: h, defaultOpen: N = !1, defaultSelectedId: d }) => {
30
+ const [t, p] = c(N ?? !1), [g, B] = c(d ?? (s.length > 0 ? s[0].id : null)), I = M(null), [V, _] = c(!1), [H, C] = c(!1), [k, E] = c(null), [z, R] = c({}), L = M(null);
31
+ $(() => {
32
+ d && B(d);
33
33
  }, [d]);
34
- const C = (n, i) => {
35
- if (n.stopPropagation(), g(i), s) {
36
- const t = s.find((a) => a.id === i);
37
- t == null || t.onClick();
34
+ const v = (o, i) => {
35
+ if (o.stopPropagation(), B(i), s) {
36
+ const l = s.find((a) => a.id === i);
37
+ l == null || l.onClick();
38
38
  }
39
39
  }, P = () => {
40
- p(!o), u(!1);
41
- }, W = (n) => {
40
+ p(!t), _(!1);
41
+ }, W = (o) => {
42
42
  var i;
43
43
  if (r) {
44
- const t = r.find((a) => a.id === n);
45
- if (!t) return;
46
- if (t.content) {
47
- const a = o ? "200px" : "40px";
48
- E(t.content), R({ ...t.position, left: a }), B(!0);
44
+ const l = r.find((a) => a.id === o);
45
+ if (!l) return;
46
+ if (l.content) {
47
+ const a = t ? "200px" : "40px";
48
+ E(l.content), R({ ...l.position, left: a }), C(!0);
49
49
  } else
50
- (i = t.onClick) == null || i.call(t);
50
+ (i = l.onClick) == null || i.call(l);
51
51
  }
52
52
  };
53
- return M(() => {
54
- m && m(o);
55
- }, [o]), /* @__PURE__ */ l("nav", { ref: N, children: /* @__PURE__ */ f("div", { className: `${e.flexVerticalBetweenStart} ${e.fullHeight} ${o ? e.open : e.close}`, children: [
53
+ return $(() => {
54
+ h && h(t);
55
+ }, [t]), /* @__PURE__ */ n("nav", { ref: I, children: /* @__PURE__ */ f("div", { className: `${e.flexVerticalBetweenStart} ${e.fullHeight} ${t ? e.open : e.close}`, children: [
56
56
  /* @__PURE__ */ f("div", { className: e.fullWidth, children: [
57
- /* @__PURE__ */ l(
57
+ /* @__PURE__ */ n(
58
58
  "div",
59
59
  {
60
60
  className: `${e.flexHorizontalBetween} ${e.pointer} ${e.textEllipsis}`,
61
61
  onClick: () => P(),
62
- children: o ? /* @__PURE__ */ f("div", { className: e.fullImg, children: [
63
- x && /* @__PURE__ */ l("img", { src: x, alt: "Logo situaction" }),
64
- /* @__PURE__ */ l(h, { mode: "ghost", size: "menu", children: /* @__PURE__ */ l(b, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
65
- ] }) : /* @__PURE__ */ l(
62
+ children: t ? /* @__PURE__ */ f("div", { className: e.fullImg, children: [
63
+ m && /* @__PURE__ */ n("img", { src: m, alt: "Logo situaction" }),
64
+ /* @__PURE__ */ n(u, { mode: "ghost", size: "menu", children: /* @__PURE__ */ n(w, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
65
+ ] }) : /* @__PURE__ */ n(
66
66
  "div",
67
67
  {
68
68
  className: e.closeIcon,
69
- onMouseEnter: () => u(!0),
70
- onMouseLeave: () => u(!1),
71
- onClick: () => p(!o),
72
- children: I || !_ ? /* @__PURE__ */ l(h, { mode: "ghost", size: "menu", children: /* @__PURE__ */ l(b, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ l("img", { src: _, alt: "Logo situaction" })
69
+ onMouseEnter: () => _(!0),
70
+ onMouseLeave: () => _(!1),
71
+ onClick: () => p(!t),
72
+ children: V || !x ? /* @__PURE__ */ n(u, { mode: "ghost", size: "menu", children: /* @__PURE__ */ n(w, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ n("img", { src: x, alt: "Logo situaction" })
73
73
  }
74
74
  )
75
75
  }
76
76
  ),
77
- /* @__PURE__ */ l("div", { className: e.menuItem, children: s && s.map((n) => o ? /* @__PURE__ */ l("div", { className: `${e.textEllipsis} ${e.menuButton}`, children: /* @__PURE__ */ l(
78
- $,
77
+ /* @__PURE__ */ n("div", { className: e.menuItem, children: s && s.map((o) => t ? /* @__PURE__ */ n("div", { className: `${e.textEllipsis} ${e.menuButton}`, children: /* @__PURE__ */ n(
78
+ b,
79
79
  {
80
- mode: k === n.id ? "secondary" : "ghost",
81
- label: n.label,
82
- onClick: (i) => C(i, n.id),
83
- childrenLeft: n.icon
80
+ mode: g === o.id ? "secondary" : "ghost",
81
+ label: o.label,
82
+ onClick: (i) => v(i, o.id),
83
+ childrenLeft: o.icon
84
84
  }
85
- ) }, `button-${n.id}`) : /* @__PURE__ */ l("div", { className: e.textEllipsis, children: /* @__PURE__ */ l(
86
- h,
85
+ ) }, `button-${o.id}`) : /* @__PURE__ */ n("div", { className: e.textEllipsis, children: /* @__PURE__ */ n(
86
+ u,
87
87
  {
88
- mode: k === n.id ? "secondary" : "ghost",
89
- children: n.icon,
90
- onClick: (i) => C(i, n.id)
88
+ mode: g === o.id ? "secondary" : "ghost",
89
+ children: o.icon,
90
+ onClick: (i) => v(i, o.id)
91
91
  }
92
- ) }, `icon-${n.id}`)) }),
93
- /* @__PURE__ */ l("div", { className: e.line })
92
+ ) }, `icon-${o.id}`)) }),
93
+ /* @__PURE__ */ n("div", { className: e.line })
94
94
  ] }),
95
95
  /* @__PURE__ */ f("div", { className: `${e.menuParams} ${e.flexVerticalBetweenCenter}`, children: [
96
- r && r.map((n) => /* @__PURE__ */ l(
96
+ r && r.map((o) => /* @__PURE__ */ n(
97
97
  "div",
98
98
  {
99
99
  className: `${e.fullWidth} ${e.textEllipsis}`,
100
- onClick: () => W(n.id),
101
- children: o ? /* @__PURE__ */ l("div", { className: e.menuButton, children: /* @__PURE__ */ l($, { mode: "ghost", label: n.label, childrenLeft: n.icon }, n.id) }) : /* @__PURE__ */ l(h, { mode: "ghost", children: n.icon })
100
+ onClick: () => W(o.id),
101
+ children: t ? /* @__PURE__ */ n("div", { className: e.menuButton, children: /* @__PURE__ */ n(b, { mode: "ghost", label: o.label, childrenLeft: o.icon }, o.id) }) : /* @__PURE__ */ n(u, { mode: "ghost", children: o.icon })
102
102
  },
103
- `param-icon-${n.id}`
103
+ `param-icon-${o.id}`
104
104
  )),
105
- /* @__PURE__ */ l(
105
+ /* @__PURE__ */ n(
106
106
  y,
107
107
  {
108
108
  ref: L,
109
109
  className: e.borderRadiusM,
110
- open: V,
111
- onClose: () => B(!1),
110
+ open: H,
111
+ onClose: () => C(!1),
112
112
  position: z,
113
- children: H
113
+ children: k
114
114
  }
115
115
  )
116
116
  ] })
@@ -1,46 +1,46 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { useState as _, useRef as y, useEffect as f } from "react";
3
- import '../../../styles/SidePanel.css';const x = "_panel_1d46d_1", v = "_openPanelBtn_1d46d_9", b = "_box_1d46d_18", B = "_panelLeft_1d46d_26", C = "_panelRight_1d46d_33", H = "_panelOpenedLeft_1d46d_40", S = "_panelOpenedRight_1d46d_44", E = "_panelHidden_1d46d_48", N = "_displayPanel_1d46d_52", g = "_hidePanel_1d46d_56", e = {
4
- panel: x,
5
- openPanelBtn: v,
6
- box: b,
7
- panelLeft: B,
8
- panelRight: C,
9
- panelOpenedLeft: H,
10
- panelOpenedRight: S,
11
- panelHidden: E,
12
- displayPanel: N,
13
- hidePanel: g
2
+ import { useState as _, useRef as R, useEffect as y } from "react";
3
+ import '../../../styles/SidePanel.css';const L = "_panel_lk5yy_1", x = "_openPanelBtn_lk5yy_9", v = "_box_lk5yy_18", b = "_panelLeft_lk5yy_29", B = "_panelRight_lk5yy_36", C = "_panelOpenedLeft_lk5yy_43", H = "_panelOpenedRight_lk5yy_47", S = "_panelHidden_lk5yy_51", E = "_displayPanel_lk5yy_55", N = "_hidePanel_lk5yy_59", e = {
4
+ panel: L,
5
+ openPanelBtn: x,
6
+ box: v,
7
+ panelLeft: b,
8
+ panelRight: B,
9
+ panelOpenedLeft: C,
10
+ panelOpenedRight: H,
11
+ panelHidden: S,
12
+ displayPanel: E,
13
+ hidePanel: N
14
14
  }, $ = ({
15
- children: u,
16
- width: s,
17
- left: p = !0,
15
+ children: f,
16
+ width: a,
17
+ left: o = !0,
18
18
  opened: n = !1,
19
19
  onToggle: t
20
20
  }) => {
21
- const [a, l] = _(n), [m, d] = _(n), i = y(null), h = {
22
- "--dynamic-left": `-${s}`,
23
- "--dynamic-right": `-${s}`,
24
- width: s
25
- }, P = p ? e.panelLeft : e.panelRight, O = p ? e.panelOpenedLeft : e.panelOpenedRight, R = [
21
+ const [l, s] = _(n), [u, i] = _(n), p = R(null), m = {
22
+ "--dynamic-left": `-${a}`,
23
+ "--dynamic-right": `-${a}`,
24
+ width: a
25
+ }, h = o ? e.panelLeft : e.panelRight, P = o ? e.panelOpenedLeft : e.panelOpenedRight, k = [
26
26
  e.panel,
27
- P,
28
- !a && e.panelHidden,
29
- a && O,
30
- m ? e.displayPanel : e.hidePanel
27
+ h,
28
+ !l && e.panelHidden,
29
+ l && P,
30
+ u ? e.displayPanel : e.hidePanel
31
31
  ].filter(Boolean).join(" ");
32
- return f(() => {
33
- n ? (d(!0), setTimeout(() => l(!0), 10)) : (l(!1), setTimeout(() => d(!1), 300));
34
- }, [n]), f(() => {
35
- const o = (L) => {
36
- const c = L.target;
37
- c.closest("[data-ignore-outside-click]") || i.current && !i.current.contains(c) && (l(!1), t == null || t(!1), setTimeout(() => d(!1), 300));
32
+ return y(() => {
33
+ n ? (i(!0), setTimeout(() => s(!0), 10)) : (s(!1), setTimeout(() => i(!1), 300));
34
+ }, [n]), y(() => {
35
+ const d = (O) => {
36
+ const c = O.target;
37
+ c.closest("[data-ignore-outside-click]") || p.current && !p.current.contains(c) && (s(!1), t == null || t(!1), setTimeout(() => i(!1), 300));
38
38
  };
39
- if (a)
40
- return document.addEventListener("mousedown", o), () => {
41
- document.removeEventListener("mousedown", o);
39
+ if (l)
40
+ return document.addEventListener("mousedown", d), () => {
41
+ document.removeEventListener("mousedown", d);
42
42
  };
43
- }, [a, t]), /* @__PURE__ */ r("div", { style: h, className: R, children: /* @__PURE__ */ r("div", { ref: i, className: e.box, children: u }) });
43
+ }, [l, t]), /* @__PURE__ */ r("div", { style: m, className: k, children: /* @__PURE__ */ r("div", { ref: p, className: e.box, children: f }) });
44
44
  };
45
45
  export {
46
46
  $ as SidePanel
@@ -1,53 +1,53 @@
1
1
  import { jsxs as u, jsx as l } from "react/jsx-runtime";
2
- import { useState as f, useRef as N, useEffect as C } from "react";
3
- import { Button as _ } from "../button/Button.js";
2
+ import { useState as p, useRef as w, useEffect as C } from "react";
3
+ import { Button as f } from "../button/Button.js";
4
4
  import '../../styles/Size.css';import '../../styles/index.css';import '../../styles/Select.css';/* empty css */
5
- import { IconButton as S } from "../icon-button/IconButton.js";
6
- import { Icon as a } from "../icon/Icon.js";
7
- import { Modal as g } from "../modal/Modal.js";
5
+ import { IconButton as k } from "../icon-button/IconButton.js";
6
+ import { Icon as i } from "../icon/Icon.js";
7
+ import { Modal as x } from "../modal/Modal.js";
8
8
  import "../theme/ThemeContext.js";
9
9
  /* empty css */
10
- const R = "_selectContainer_ak06l_40", y = "_selected_ak06l_43", z = "_children_ak06l_47", B = "_active_ak06l_62", F = "_selectList_ak06l_66", j = "_modal_ak06l_75", U = "_dropdownFadeIn_ak06l_1", $ = "_itemLabel_ak06l_81", c = {
11
- selectContainer: R,
12
- selected: y,
13
- children: z,
14
- active: B,
15
- selectList: F,
16
- modal: j,
17
- dropdownFadeIn: U,
18
- itemLabel: $
19
- }, K = ({ selected: i, size: s = "m", listItem: h, modeDisplay: r = "all", onSelect: p, positionOverride: d }) => {
20
- const [n, o] = f(!1), k = N(null), [L, v] = f({ top: "calc(100% + 6px)" }), I = i ?? h[0], [t, b] = f(I);
10
+ const N = "_selectContainer_glqzp_40", S = "_selected_glqzp_43", R = "_children_glqzp_47", y = "_active_glqzp_64", B = "_selectList_glqzp_68", F = "_modal_glqzp_77", j = "_dropdownFadeIn_glqzp_1", U = "_itemLabel_glqzp_84", c = {
11
+ selectContainer: N,
12
+ selected: S,
13
+ children: R,
14
+ active: y,
15
+ selectList: B,
16
+ modal: F,
17
+ dropdownFadeIn: j,
18
+ itemLabel: U
19
+ }, K = ({ selected: a, size: s = "m", listItem: _, modeDisplay: r = "all", onSelect: h, positionOverride: d }) => {
20
+ const [n, o] = p(!1), g = w(null), [z, L] = p({ top: "calc(100% + 6px)" }), v = a ?? _[0], [t, b] = p(v);
21
21
  C(() => {
22
- i && b(i);
23
- }, [i]), C(() => {
24
- d && v(d);
22
+ a && b(a);
23
+ }, [a]), C(() => {
24
+ d && L(d);
25
25
  }, [d]);
26
- const w = (e) => {
27
- b(e), o(!1), p && p(e);
28
- }, x = () => {
26
+ const q = (e) => {
27
+ b(e), o(!1), h && h(e);
28
+ }, I = () => {
29
29
  const e = !!t.icon, m = !!t.label;
30
- return t.icon && r === "icon" && e ? /* @__PURE__ */ l(S, { mode: "tertiary", size: s ?? "m", onClick: () => o(!n), children: /* @__PURE__ */ l(a, { icon: t.icon }) }) : t.label && r === "text" && m ? /* @__PURE__ */ l(
31
- _,
30
+ return t.icon && r === "icon" && e ? /* @__PURE__ */ l(k, { mode: "tertiary", size: s ?? "m", onClick: () => o(!n), children: /* @__PURE__ */ l(i, { icon: t.icon }) }) : t.label && r === "text" && m ? /* @__PURE__ */ l(
31
+ f,
32
32
  {
33
33
  mode: "tertiary",
34
34
  label: t.label,
35
- childrenRight: /* @__PURE__ */ l(a, { icon: n ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
35
+ childrenRight: /* @__PURE__ */ l(i, { icon: n ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
36
36
  size: s ?? "m",
37
37
  onClick: () => o(!n)
38
38
  }
39
39
  ) : t.label && t.icon && r === "all" && (e || m) ? /* @__PURE__ */ l(
40
- _,
40
+ f,
41
41
  {
42
42
  mode: "tertiary",
43
43
  label: m ? t.label : "",
44
44
  size: s ?? "m",
45
- childrenLeft: e && /* @__PURE__ */ l(a, { icon: t.icon }),
46
- childrenRight: /* @__PURE__ */ l(a, { icon: n ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
45
+ childrenLeft: e && /* @__PURE__ */ l(i, { icon: t.icon }),
46
+ childrenRight: /* @__PURE__ */ l(i, { icon: n ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
47
47
  onClick: () => o(!n)
48
48
  }
49
49
  ) : /* @__PURE__ */ l(
50
- _,
50
+ f,
51
51
  {
52
52
  mode: "tertiary",
53
53
  label: "Sélectionner",
@@ -57,22 +57,22 @@ const R = "_selectContainer_ak06l_40", y = "_selected_ak06l_43", z = "_children_
57
57
  );
58
58
  };
59
59
  return /* @__PURE__ */ u("div", { className: c.selectContainer, children: [
60
- x(),
60
+ I(),
61
61
  /* @__PURE__ */ l(
62
- g,
62
+ x,
63
63
  {
64
- ref: k,
64
+ ref: g,
65
65
  open: n,
66
66
  onClose: () => o(!1),
67
67
  className: c.modal,
68
- position: L,
69
- children: /* @__PURE__ */ l("div", { className: c.selectList, children: h.map((e) => /* @__PURE__ */ u(
68
+ position: z,
69
+ children: /* @__PURE__ */ l("div", { className: c.selectList, children: _.map((e) => /* @__PURE__ */ u(
70
70
  "div",
71
71
  {
72
72
  className: `${c.children} ${e.value === t.value ? c.active : ""}`,
73
- onClick: () => w(e),
73
+ onClick: () => q(e),
74
74
  children: [
75
- e.icon && /* @__PURE__ */ l(a, { icon: e.icon }),
75
+ e.icon && /* @__PURE__ */ l(i, { icon: e.icon }),
76
76
  e.label && /* @__PURE__ */ l("div", { className: c.itemLabel, children: e.label })
77
77
  ]
78
78
  },
@@ -1,69 +1,74 @@
1
- import { jsxs as H, jsx as r } from "react/jsx-runtime";
2
- import { useState as f, useRef as u, useLayoutEffect as C, useEffect as $ } from "react";
1
+ import { jsxs as v, jsx as c } from "react/jsx-runtime";
2
+ import { useState as m, useRef as _, useEffect as d, useLayoutEffect as C } from "react";
3
3
  import '../../styles/index.css';import '../../styles/Tabs.css';/* empty css */
4
- import { Button as p } from "../button/Button.js";
5
- import { IconButton as B } from "../icon-button/IconButton.js";
6
- const N = "_underline_udv7v_50", n = {
7
- "tab-container": "_tab-container_udv7v_23",
8
- "tab-container-button": "_tab-container-button_udv7v_27",
9
- "tab-container-icon": "_tab-container-icon_udv7v_32",
10
- "tab-container-text": "_tab-container-text_udv7v_32",
11
- "tab-items": "_tab-items_udv7v_35",
12
- "tab-items-button": "_tab-items-button_udv7v_39",
13
- "selected-button": "_selected-button_udv7v_44",
14
- underline: N,
15
- "flexHorizontal-center": "_flexHorizontal-center_udv7v_58",
16
- "flexHorizontal-left": "_flexHorizontal-left_udv7v_64",
17
- "flexHorizontal-right": "_flexHorizontal-right_udv7v_70"
18
- }, E = ({ listItems: c, type: o, onTabSelect: v, defaultActiveTab: i = 0, position: m = "left" }) => {
19
- const [l, b] = f(i), [x, h] = f({}), a = u(null), g = u(null), _ = u(new Array(c.length).fill(null)), d = (t) => {
20
- b(t), v(c[t]);
21
- }, z = (t) => {
22
- if (a.current && t) {
23
- const e = t.getBoundingClientRect(), s = a.current.getBoundingClientRect();
24
- h({
25
- left: `${e.left - s.left}px`,
4
+ import { Button as N } from "../button/Button.js";
5
+ import { IconButton as $ } from "../icon-button/IconButton.js";
6
+ const p = "_underline_12jm7_57", n = {
7
+ "tab-container": "_tab-container_12jm7_23",
8
+ "tab-container-button": "_tab-container-button_12jm7_27",
9
+ "tab-container-icon": "_tab-container-icon_12jm7_32",
10
+ "tab-container-text": "_tab-container-text_12jm7_32",
11
+ "tab-items": "_tab-items_12jm7_35",
12
+ "tab-items-button": "_tab-items-button_12jm7_39",
13
+ "selected-button": "_selected-button_12jm7_44",
14
+ "selected-text": "_selected-text_12jm7_50",
15
+ underline: p,
16
+ "flexHorizontal-center": "_flexHorizontal-center_12jm7_65",
17
+ "flexHorizontal-left": "_flexHorizontal-left_12jm7_71",
18
+ "flexHorizontal-right": "_flexHorizontal-right_12jm7_77"
19
+ }, E = ({ listItems: o, type: l, onTabSelect: x, defaultActiveTab: a = 0, position: h = "left" }) => {
20
+ const [r, b] = m(a), [j, g] = m({}), i = _(null), z = _(null), s = _(new Array(o.length).fill(null));
21
+ d(() => {
22
+ s.current = new Array(o.length).fill(null);
23
+ }, [o.length]);
24
+ const f = (t) => {
25
+ b(t), x(o[t]);
26
+ }, R = (t) => {
27
+ if (i.current && t) {
28
+ const e = t.getBoundingClientRect(), u = i.current.getBoundingClientRect();
29
+ g({
30
+ left: `${e.left - u.left}px`,
26
31
  width: `${e.width}px`
27
32
  });
28
33
  }
29
- }, R = [
30
- n[`flexHorizontal-${m}`],
31
- o === "button" ? n["tab-items-button"] : n["tab-items"]
34
+ }, H = [
35
+ n[`flexHorizontal-${h}`],
36
+ l === "button" ? n["tab-items-button"] : n["tab-items"]
32
37
  ].filter(Boolean).join(" ");
33
38
  return C(() => {
34
- const t = _.current[l];
35
- t && z(t);
36
- }, [l]), $(() => {
37
- b(i);
38
- }, [i]), /* @__PURE__ */ H("div", { className: `tab ${n["tab-container"]} ${n[`tab-container-${o}`]}`, ref: a, children: [
39
- /* @__PURE__ */ r("div", { className: R, children: c.map((t, e) => /* @__PURE__ */ r(
39
+ const t = s.current[r];
40
+ t && R(t);
41
+ }, [r, o.length]), d(() => {
42
+ b(a);
43
+ }, [a]), /* @__PURE__ */ v("div", { className: `tab ${n["tab-container"]} ${n[`tab-container-${l}`]}`, ref: i, children: [
44
+ /* @__PURE__ */ c("div", { className: H, children: o.map((t, e) => /* @__PURE__ */ c(
40
45
  "div",
41
46
  {
42
- ref: (s) => _.current[e] = s,
43
- className: o === "button" && e === l ? n["selected-button"] : "",
44
- children: o === "icon" ? /* @__PURE__ */ r(
45
- B,
47
+ ref: (u) => s.current[e] = u,
48
+ className: l === "button" && e === r ? n["selected-button"] : "",
49
+ children: l === "icon" ? /* @__PURE__ */ c(
50
+ $,
46
51
  {
47
52
  mode: "icon",
48
53
  size: "s",
49
- selected: e === l,
50
- onClick: () => d(e),
54
+ selected: e === r,
55
+ onClick: () => f(e),
51
56
  children: t
52
57
  }
53
- ) : /* @__PURE__ */ r(
54
- p,
58
+ ) : /* @__PURE__ */ c("div", { className: e === r ? n["selected-text"] : void 0, children: /* @__PURE__ */ c(
59
+ N,
55
60
  {
56
61
  size: "s",
57
62
  label: t,
58
- mode: o === "text" ? "text" : "ghost",
59
- selected: e === l,
60
- onClick: () => d(e)
63
+ mode: l === "text" ? "text" : "ghost",
64
+ selected: e === r,
65
+ onClick: () => f(e)
61
66
  }
62
- )
67
+ ) })
63
68
  },
64
69
  e
65
70
  )) }),
66
- o !== "button" && /* @__PURE__ */ r("div", { ref: g, className: n.underline, style: x })
71
+ l !== "button" && /* @__PURE__ */ c("div", { ref: z, className: n.underline, style: j })
67
72
  ] });
68
73
  };
69
74
  export {
@@ -1 +1 @@
1
- nav{height:100vh;width:fit-content;padding:0 var(--spacing-xs-3) var(--spacing-xs-3);flex-shrink:1;transition:.3s;box-sizing:border-box;z-index:5}nav ._fullHeight_ikhx4_15{height:100%}nav ._fullWidth_ikhx4_18{width:100%}nav ._open_ikhx4_21{width:200px;transition:all ease .3s}nav ._close_ikhx4_25{width:40px;transition:all ease-out .3s}nav ._menuButton_ikhx4_29{width:100%}nav ._menuButton_ikhx4_29 button{padding:var(--spacing-xs-4);width:inherit!important;justify-content:flex-start!important}nav ._closeIcon_ikhx4_37{height:30px;cursor:pointer;margin:.875rem 0}nav ._label_ikhx4_42{letter-spacing:.72px;font-weight:600}nav ._textEllipsis_ikhx4_46{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}nav ._pointer_ikhx4_51{cursor:pointer}nav ._fullImg_ikhx4_54{margin:.875rem 0;display:flex;justify-content:space-between;width:100%}nav ._menuParams_ikhx4_60{gap:.125rem;position:relative;width:100%}._line_ikhx4_66{height:1px;width:100%;background-color:var(--general-border-window);margin:var(--spacing-xs-3) 0}._borderRadiusM_ikhx4_73{border-radius:4px}._menuItem_ikhx4_77{gap:.25rem;width:100%;display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._flexVerticalBetweenStart_ikhx4_86{display:flex;justify-content:space-between;align-items:start;flex-direction:column}._flexHorizontalBetween_ikhx4_93{display:flex;justify-content:space-between;align-items:center;flex-direction:row}._flexVertical_ikhx4_86{display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._flexVerticalBetweenCenter_ikhx4_107{display:flex;justify-content:space-between;align-items:center;flex-direction:column}
1
+ nav{height:100vh;width:fit-content;padding:0 var(--spacing-xs-3) var(--spacing-xs-3);flex-shrink:1;transition:.3s;box-sizing:border-box;z-index:5}nav ._fullHeight_o2xi7_15{height:100%}nav ._fullWidth_o2xi7_18{width:100%}nav ._open_o2xi7_21{width:200px;transition:all ease .3s}nav ._close_o2xi7_25{width:40px;transition:all ease-out .3s}nav ._menuButton_o2xi7_29{width:100%}nav ._menuButton_o2xi7_29 button{padding:var(--spacing-xs-4);width:inherit!important;justify-content:flex-start!important}nav ._closeIcon_o2xi7_37{height:30px;cursor:pointer;margin:.875rem 0}nav ._label_o2xi7_42{letter-spacing:.72px;font-weight:600}nav ._textEllipsis_o2xi7_46{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}nav ._pointer_o2xi7_51{cursor:pointer}nav ._fullImg_o2xi7_54{margin:.875rem 0;display:flex;justify-content:space-between;width:100%}nav ._menuParams_o2xi7_60{gap:.125rem;position:relative;width:100%}._line_o2xi7_66{height:1px;width:100%;background-color:var(--general-border-window);margin:var(--spacing-xs-3) 0}._borderRadiusM_o2xi7_73{border-radius:6px}._menuItem_o2xi7_77{gap:.25rem;width:100%;display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._flexVerticalBetweenStart_o2xi7_86{display:flex;justify-content:space-between;align-items:start;flex-direction:column}._flexHorizontalBetween_o2xi7_93{display:flex;justify-content:space-between;align-items:center;flex-direction:row}._flexVertical_o2xi7_86{display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._flexVerticalBetweenCenter_o2xi7_107{display:flex;justify-content:space-between;align-items:center;flex-direction:column}
@@ -1 +1 @@
1
- ._selectContainer_ak06l_40{position:relative}._selectContainer_ak06l_40 ._selected_ak06l_43{background:var(--button-tertiary-pressed-background);border-radius:var(--spacing-xs-6)}._selectContainer_ak06l_40 ._children_ak06l_47{padding:var(--spacing-xs-6) var(--spacing-xs-5);box-sizing:border-box;width:100%;gap:.5rem;cursor:pointer;display:flex;justify-content:flex-start;align-items:start;flex-direction:row}._selectContainer_ak06l_40 ._children_ak06l_47:hover{background:var(--dropdown-line-background-hover);border-radius:var(--spacing-xs-6)}._selectContainer_ak06l_40 ._children_ak06l_47._active_ak06l_62{background:var(--button-tertiary-pressed-background);border-radius:var(--spacing-xs-6)}._selectContainer_ak06l_40 ._selectList_ak06l_66{max-height:200px;overflow-y:auto;gap:.25rem;display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._selectContainer_ak06l_40 ._modal_ak06l_75{border-radius:4px;padding:.5rem;animation:_dropdownFadeIn_ak06l_1 .2s ease-out;transform-origin:top left}._selectContainer_ak06l_40 ._itemLabel_ak06l_81{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes _dropdownFadeIn_ak06l_1{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
1
+ ._selectContainer_glqzp_40{position:relative}._selectContainer_glqzp_40 ._selected_glqzp_43{background:var(--button-tertiary-pressed-background);border-radius:var(--spacing-xs-6)}._selectContainer_glqzp_40 ._children_glqzp_47{padding:var(--spacing-xs-6) var(--spacing-xs-5);box-sizing:border-box;width:100%;gap:.5rem;cursor:pointer;font-style:normal;line-height:1.25rem;display:flex;justify-content:flex-start;align-items:center;flex-direction:row}._selectContainer_glqzp_40 ._children_glqzp_47:hover{background:var(--dropdown-line-background-hover);border-radius:var(--spacing-xs-6)}._selectContainer_glqzp_40 ._children_glqzp_47._active_glqzp_64{background:var(--button-tertiary-pressed-background);border-radius:var(--spacing-xs-6)}._selectContainer_glqzp_40 ._selectList_glqzp_68{max-height:200px;overflow-y:auto;gap:.125rem;display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._selectContainer_glqzp_40 ._modal_glqzp_77{box-shadow:0 4px 4px 0 var(--shadow-color-lowest);border-radius:4px;padding:.25rem;animation:_dropdownFadeIn_glqzp_1 .2s ease-out;transform-origin:top left}._selectContainer_glqzp_40 ._itemLabel_glqzp_84{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes _dropdownFadeIn_glqzp_1{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
@@ -1 +1 @@
1
- ._panel_1d46d_1{position:absolute;z-index:10;top:0;transition:.3s;height:100%;box-sizing:border-box}._panel_1d46d_1 ._openPanelBtn_1d46d_9{width:40px;height:70px;background-color:var(--background-secondary);color:#fff;cursor:pointer;top:50%;transform:translateY(-50%)}._panel_1d46d_1 ._box_1d46d_18{box-shadow:0 10px 10px #0003;height:100%;box-sizing:border-box;position:relative;background-color:var(--background-primary)}._panelLeft_1d46d_26{left:var(--dynamic-left)}._panelLeft_1d46d_26>div{border-radius:0 var(--spacing-xs) var(--spacing-xs) 0}._panelRight_1d46d_33{right:var(--dynamic-right)}._panelRight_1d46d_33>div{border-radius:var(--spacing-xs) 0 0 var(--spacing-xs)}._panelOpenedLeft_1d46d_40{left:0}._panelOpenedRight_1d46d_44{right:0}._panelHidden_1d46d_48{visibility:hidden}._displayPanel_1d46d_52{display:block}._hidePanel_1d46d_56{display:none}
1
+ ._panel_lk5yy_1{position:absolute;z-index:10;top:0;transition:.3s;height:100%;box-sizing:border-box}._panel_lk5yy_1 ._openPanelBtn_lk5yy_9{width:40px;height:70px;background-color:var(--background-secondary);color:#fff;cursor:pointer;top:50%;transform:translateY(-50%)}._panel_lk5yy_1 ._box_lk5yy_18{box-shadow:0 10px 10px #0003;height:100%;box-sizing:border-box;position:relative;background-color:var(--background-primary);border-top:1px solid var(--general-border-window);border-left:1px solid var(--general-border-window);border-bottom:1px solid var(--general-border-window)}._panelLeft_lk5yy_29{left:var(--dynamic-left)}._panelLeft_lk5yy_29>div{border-radius:0 var(--spacing-xs) var(--spacing-xs) 0}._panelRight_lk5yy_36{right:var(--dynamic-right)}._panelRight_lk5yy_36>div{border-radius:var(--spacing-xs) 0 0 var(--spacing-xs)}._panelOpenedLeft_lk5yy_43{left:0}._panelOpenedRight_lk5yy_47{right:0}._panelHidden_lk5yy_51{visibility:hidden}._displayPanel_lk5yy_55{display:block}._hidePanel_lk5yy_59{display:none}
@@ -1 +1 @@
1
- ._tab-container_udv7v_23{position:relative;line-height:1.25rem}._tab-container-button_udv7v_27{border-radius:.375rem;border:1px solid var(--tabs-button-border);background:var(--tabs-button-background)}._tab-container-icon_udv7v_32,._tab-container-text_udv7v_32{border-bottom:1px solid var(--tabs-line-border)}._tab-items_udv7v_35{gap:2.25rem;padding:.625rem .125rem}._tab-items-button_udv7v_39{gap:.25rem;padding:.125rem}._selected-button_udv7v_44{border:1px solid var(--button-tertiary-default-border);background:var(--tabs-button-background-button);border-radius:.25rem}._underline_udv7v_50{position:absolute;bottom:0;height:2px;background-color:var(--tabs-cell-active-border);transition:all .3s ease}._flexHorizontal-center_udv7v_58{display:flex;justify-content:center;align-items:center;flex-direction:row}._flexHorizontal-left_udv7v_64{display:flex;justify-content:flex-start;align-items:center;flex-direction:row}._flexHorizontal-right_udv7v_70{display:flex;justify-content:flex-end;align-items:center;flex-direction:row}
1
+ ._tab-container_12jm7_23{position:relative;line-height:1.25rem}._tab-container-button_12jm7_27{border-radius:.375rem;border:1px solid var(--tabs-button-border);background:var(--tabs-button-background)}._tab-container-icon_12jm7_32,._tab-container-text_12jm7_32{border-bottom:1px solid var(--tabs-line-border)}._tab-items_12jm7_35{gap:2.25rem;padding:.625rem .125rem}._tab-items-button_12jm7_39{gap:.25rem;padding:.125rem}._selected-button_12jm7_44{border:1px solid var(--button-tertiary-default-border);background:var(--tabs-button-background-button);border-radius:.25rem}._selected-text_12jm7_50>button{font-weight:600!important}._selected-text_12jm7_50>button:hover{background-color:transparent!important}._underline_12jm7_57{position:absolute;bottom:0;height:2px;background-color:var(--tabs-cell-active-border);transition:all .3s ease}._flexHorizontal-center_12jm7_65{display:flex;justify-content:center;align-items:center;flex-direction:row}._flexHorizontal-left_12jm7_71{display:flex;justify-content:flex-start;align-items:center;flex-direction:row}._flexHorizontal-right_12jm7_77{display:flex;justify-content:flex-end;align-items:center;flex-direction:row}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",