@situaction/traq-ui-ste 1.2.9 → 1.2.10

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,12 +1,12 @@
1
- import { jsx as l, 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
- import { IconButton as u } from "../icon-button/IconButton.js";
5
- import { Icon as w } from "../icon/Icon.js";
1
+ import { jsx as o, jsxs as d } 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";
4
+ import { IconButton as f } from "../icon-button/IconButton.js";
5
+ import { Icon as N } from "../icon/Icon.js";
6
6
  import { Modal as W } from "../modal/Modal.js";
7
7
  import "../theme/ThemeContext.js";
8
8
  import '../../styles/Size.css';import '../../styles/Menu.css';/* empty css */
9
- const y = "_fullHeight_o2xi7_15", O = "_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 = {
9
+ const y = "_fullHeight_11eub_15", O = "_fullWidth_11eub_18", j = "_open_11eub_21", D = "_close_11eub_25", q = "_menuButton_11eub_29", A = "_closeIcon_11eub_37", F = "_label_11eub_43", G = "_textEllipsis_11eub_47", J = "_pointer_11eub_52", K = "_fullImg_11eub_55", Q = "_menuParams_11eub_61", T = "_line_11eub_67", U = "_borderRadiusM_11eub_74", X = "_menuItem_11eub_78", Y = "_longLogo_11eub_87", Z = "_flexVerticalBetweenStart_11eub_92", ee = "_flexHorizontalBetween_11eub_99", le = "_flexHorizontalCenter_11eub_106", oe = "_flexVertical_11eub_92", ne = "_flexVerticalBetweenCenter_11eub_121", e = {
10
10
  fullHeight: y,
11
11
  fullWidth: O,
12
12
  open: j,
@@ -21,100 +21,102 @@ const y = "_fullHeight_o2xi7_15", O = "_fullWidth_o2xi7_18", j = "_open_o2xi7_21
21
21
  line: T,
22
22
  borderRadiusM: U,
23
23
  menuItem: X,
24
- flexVerticalBetweenStart: Y,
25
- flexHorizontalBetween: Z,
26
- flexVertical: ee,
27
- flexVerticalBetweenCenter: oe
28
- }, de = ({ menuItems: s = [], menuParams: r = [], shortLogo: x, logo: m, isOpen: h, defaultOpen: N = !1, selectedId: d }) => {
29
- 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);
30
- $(() => {
31
- d != null && B(d);
32
- }, [d]);
33
- const v = (o, i) => {
34
- if (o.stopPropagation(), B(i), s) {
24
+ longLogo: Y,
25
+ flexVerticalBetweenStart: Z,
26
+ flexHorizontalBetween: ee,
27
+ flexHorizontalCenter: le,
28
+ flexVertical: oe,
29
+ flexVerticalBetweenCenter: ne
30
+ }, fe = ({ menuItems: s = [], menuParams: r = [], shortLogo: m, logo: h, isOpen: p, defaultOpen: w = !1, selectedId: u }) => {
31
+ const [t, b] = c(w ?? !1), [x, g] = c(u ?? (s.length > 0 ? s[0].id : null)), H = v(null), [z, _] = c(!1), [I, C] = c(!1), [V, L] = c(null), [k, E] = c({}), R = v(null);
32
+ M(() => {
33
+ u != null && g(u);
34
+ }, [u]);
35
+ const B = (l, i) => {
36
+ if (l.stopPropagation(), g(i), s) {
35
37
  const n = s.find((a) => a.id === i);
36
38
  n == null || n.onClick();
37
39
  }
38
40
  }, S = () => {
39
- p(!t), _(!1);
40
- }, P = (o) => {
41
+ b(!t), _(!1);
42
+ }, P = (l) => {
41
43
  var i;
42
44
  if (r) {
43
- const n = r.find((a) => a.id === o);
45
+ const n = r.find((a) => a.id === l);
44
46
  if (!n) return;
45
47
  if (n.content) {
46
48
  const a = t ? "200px" : "40px";
47
- E(n.content), R({ ...n.position, left: a }), C(!0);
49
+ L(n.content), E({ ...n.position, left: a }), C(!0);
48
50
  } else
49
51
  (i = n.onClick) == null || i.call(n);
50
52
  }
51
53
  };
52
- return $(() => {
53
- h && h(t);
54
- }, [t]), /* @__PURE__ */ l("nav", { ref: I, children: /* @__PURE__ */ f("div", { className: `${e.flexVerticalBetweenStart} ${e.fullHeight} ${t ? e.open : e.close}`, children: [
55
- /* @__PURE__ */ f("div", { className: e.fullWidth, children: [
56
- /* @__PURE__ */ l(
54
+ return M(() => {
55
+ p && p(t);
56
+ }, [t]), /* @__PURE__ */ o("nav", { ref: H, children: /* @__PURE__ */ d("div", { className: `${e.flexVerticalBetweenStart} ${e.fullHeight} ${t ? e.open : e.close}`, children: [
57
+ /* @__PURE__ */ d("div", { className: e.fullWidth, children: [
58
+ /* @__PURE__ */ o(
57
59
  "div",
58
60
  {
59
- className: `${e.flexHorizontalBetween} ${e.pointer} ${e.textEllipsis}`,
61
+ className: `${e.flexHorizontalCenter} ${e.pointer} ${e.textEllipsis}`,
60
62
  onClick: () => S(),
61
- children: t ? /* @__PURE__ */ f("div", { className: e.fullImg, children: [
62
- m && /* @__PURE__ */ l("img", { src: m, alt: "Logo situaction" }),
63
- /* @__PURE__ */ l(u, { mode: "ghost", size: "menu", children: /* @__PURE__ */ l(w, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
64
- ] }) : /* @__PURE__ */ l(
63
+ children: t ? /* @__PURE__ */ d("div", { className: e.fullImg, children: [
64
+ h && /* @__PURE__ */ o("img", { className: e.longLogo, src: h, alt: "Logo situaction" }),
65
+ /* @__PURE__ */ o(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ o(N, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
66
+ ] }) : /* @__PURE__ */ o(
65
67
  "div",
66
68
  {
67
69
  className: e.closeIcon,
68
70
  onMouseEnter: () => _(!0),
69
71
  onMouseLeave: () => _(!1),
70
- onClick: () => p(!t),
71
- children: V || !x ? /* @__PURE__ */ l(u, { mode: "ghost", size: "menu", children: /* @__PURE__ */ l(w, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ l("img", { src: x, alt: "Logo situaction" })
72
+ onClick: () => b(!t),
73
+ children: z || !m ? /* @__PURE__ */ o(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ o(N, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ o("img", { src: m, alt: "Logo situaction" })
72
74
  }
73
75
  )
74
76
  }
75
77
  ),
76
- /* @__PURE__ */ l("div", { className: e.menuItem, children: s && s.map((o) => t ? /* @__PURE__ */ l("div", { className: `${e.textEllipsis} ${e.menuButton}`, children: /* @__PURE__ */ l(
77
- b,
78
+ /* @__PURE__ */ o("div", { className: e.menuItem, children: s && s.map((l) => t ? /* @__PURE__ */ o("div", { className: `${e.textEllipsis} ${e.menuButton}`, children: /* @__PURE__ */ o(
79
+ $,
78
80
  {
79
- mode: g === o.id ? "secondary" : "ghost",
80
- label: o.label,
81
- onClick: (i) => v(i, o.id),
82
- childrenLeft: o.icon
81
+ mode: x === l.id ? "secondary" : "ghost",
82
+ label: l.label,
83
+ onClick: (i) => B(i, l.id),
84
+ childrenLeft: l.icon
83
85
  }
84
- ) }, `button-${o.id}`) : /* @__PURE__ */ l("div", { className: e.textEllipsis, children: /* @__PURE__ */ l(
85
- u,
86
+ ) }, `button-${l.id}`) : /* @__PURE__ */ o("div", { className: e.textEllipsis, children: /* @__PURE__ */ o(
87
+ f,
86
88
  {
87
- mode: g === o.id ? "secondary" : "ghost",
88
- children: o.icon,
89
- onClick: (i) => v(i, o.id)
89
+ mode: x === l.id ? "secondary" : "ghost",
90
+ children: l.icon,
91
+ onClick: (i) => B(i, l.id)
90
92
  }
91
- ) }, `icon-${o.id}`)) }),
92
- /* @__PURE__ */ l("div", { className: e.line })
93
+ ) }, `icon-${l.id}`)) }),
94
+ /* @__PURE__ */ o("div", { className: e.line })
93
95
  ] }),
94
- /* @__PURE__ */ f("div", { className: `${e.menuParams} ${e.flexVerticalBetweenCenter}`, children: [
95
- r && r.map((o) => /* @__PURE__ */ l(
96
+ /* @__PURE__ */ d("div", { className: `${e.menuParams} ${e.flexVerticalBetweenCenter}`, children: [
97
+ r && r.map((l) => /* @__PURE__ */ o(
96
98
  "div",
97
99
  {
98
100
  className: `${e.fullWidth} ${e.textEllipsis}`,
99
- onClick: () => P(o.id),
100
- children: t ? /* @__PURE__ */ l("div", { className: e.menuButton, children: /* @__PURE__ */ l(b, { mode: "ghost", label: o.label, childrenLeft: o.icon }, o.id) }) : /* @__PURE__ */ l(u, { mode: "ghost", children: o.icon })
101
+ onClick: () => P(l.id),
102
+ children: t ? /* @__PURE__ */ o("div", { className: e.menuButton, children: /* @__PURE__ */ o($, { mode: "ghost", label: l.label, childrenLeft: l.icon }, l.id) }) : /* @__PURE__ */ o(f, { mode: "ghost", children: l.icon })
101
103
  },
102
- `param-icon-${o.id}`
104
+ `param-icon-${l.id}`
103
105
  )),
104
- /* @__PURE__ */ l(
106
+ /* @__PURE__ */ o(
105
107
  W,
106
108
  {
107
- ref: L,
109
+ ref: R,
108
110
  className: e.borderRadiusM,
109
- open: H,
111
+ open: I,
110
112
  onClose: () => C(!1),
111
- position: z,
112
- children: k
113
+ position: k,
114
+ children: V
113
115
  }
114
116
  )
115
117
  ] })
116
118
  ] }) });
117
119
  };
118
120
  export {
119
- de as Menu
121
+ fe as Menu
120
122
  };
@@ -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_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
+ 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_11eub_15{height:100%}nav ._fullWidth_11eub_18{width:100%}nav ._open_11eub_21{width:200px;transition:all ease .3s}nav ._close_11eub_25{width:40px;transition:all ease-out .3s}nav ._menuButton_11eub_29{width:100%}nav ._menuButton_11eub_29 button{padding:var(--spacing-xs-4);width:inherit!important;justify-content:flex-start!important}nav ._closeIcon_11eub_37{height:30px;cursor:pointer;margin:.875rem 0;padding:1px 0}nav ._label_11eub_43{letter-spacing:.72px;font-weight:600}nav ._textEllipsis_11eub_47{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}nav ._pointer_11eub_52{cursor:pointer}nav ._fullImg_11eub_55{margin:.875rem 0;display:flex;justify-content:space-between;width:100%}nav ._menuParams_11eub_61{gap:.125rem;position:relative;width:100%}._line_11eub_67{height:1px;width:100%;background-color:var(--general-border-window);margin:var(--spacing-xs-3) 0}._borderRadiusM_11eub_74{border-radius:6px}._menuItem_11eub_78{gap:.25rem;width:100%;display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._longLogo_11eub_87{transition:transform .25s ease,opacity .25s ease;will-change:transform,opacity}._flexVerticalBetweenStart_11eub_92{display:flex;justify-content:space-between;align-items:start;flex-direction:column}._flexHorizontalBetween_11eub_99{display:flex;justify-content:space-between;align-items:center;flex-direction:row}._flexHorizontalCenter_11eub_106{height:60px;display:flex;justify-content:center;align-items:center;flex-direction:row}._flexVertical_11eub_92{display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._flexVerticalBetweenCenter_11eub_121{display:flex;justify-content:space-between;align-items:center;flex-direction:column}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",