@situaction/traq-ui-ste 1.2.40 → 1.2.41

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.
@@ -55,6 +55,8 @@ export interface MenuProps {
55
55
  defaultOpen?: boolean;
56
56
  /** ID of the menu item selected by default */
57
57
  selectedId?: string;
58
+ /** Layout mode: 'left' for vertical sidebar (default), 'bottom' for horizontal bottom bar */
59
+ mode?: 'left' | 'bottom';
58
60
  }
59
61
  /**
60
62
  * Menu component renders a vertical navigation bar with collapsible state,
@@ -1,125 +1,153 @@
1
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
2
- import { useState as c, useRef as M, useEffect as B } from "react";
3
- import { Button as $ } from "../button/Button.js";
4
- import { IconButton as f } from "../icon-button/IconButton.js";
1
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
+ import { useState as r, useRef as w, useEffect as H } from "react";
3
+ import { Button as L } from "../button/Button.js";
4
+ import { IconButton as a } from "../icon-button/IconButton.js";
5
5
  import "react-dom";
6
6
  import "../accordion/Accordion.js";
7
- import { Icon as N } from "../icon/Icon.js";
8
- import { Modal as W } from "../modal/Modal.js";
7
+ import { Icon as E } from "../icon/Icon.js";
8
+ import { Modal as R } from "../modal/Modal.js";
9
9
  import "../carousel/Carousel.js";
10
10
  import "../carousel/FadeCarousel.js";
11
11
  import "../theme/ThemeContext.js";
12
12
  import '../../styles/Size.css';import '../../styles/Menu.css';/* empty css */
13
- 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 = "_textEllipsis_11eub_47", G = "_pointer_11eub_52", J = "_fullImg_11eub_55", K = "_menuParams_11eub_61", Q = "_line_11eub_67", T = "_borderRadiusM_11eub_74", U = "_menuItem_11eub_78", X = "_longLogo_11eub_87", Y = "_flexVerticalBetweenStart_11eub_92", Z = "_flexHorizontalCenter_11eub_106", ee = "_flexVerticalBetweenCenter_11eub_121", o = {
14
- fullHeight: y,
15
- fullWidth: O,
16
- open: j,
17
- close: D,
18
- menuButton: q,
19
- closeIcon: A,
20
- textEllipsis: F,
21
- pointer: G,
22
- fullImg: J,
23
- menuParams: K,
24
- line: Q,
25
- borderRadiusM: T,
26
- menuItem: U,
27
- longLogo: X,
28
- flexVerticalBetweenStart: Y,
29
- flexHorizontalCenter: Z,
30
- flexVerticalBetweenCenter: ee
31
- }, _e = ({ menuItems: i = [], menuParams: d = [], shortLogo: m, logo: p, isOpen: h, defaultOpen: I = !1, selectedId: r }) => {
32
- const [t, b] = c(I ?? !1), [g, x] = c(r ?? (i.length > 0 ? i[0].id : null)), w = M(null), [H, _] = c(!1), [L, C] = c(!1), [k, E] = c(null), [z, R] = c({}), V = M(null);
33
- B(() => {
34
- r != null && x(r);
35
- }, [r]);
36
- const v = (e, s) => {
37
- if (e.stopPropagation(), x(s), i) {
38
- const n = i.find((a) => a.id === s);
39
- n == null || n.onClick();
13
+ const O = "_fullHeight_rmd17_15", j = "_fullWidth_rmd17_18", D = "_open_rmd17_21", q = "_close_rmd17_25", A = "_menuButton_rmd17_29", F = "_closeIcon_rmd17_37", G = "_textEllipsis_rmd17_47", J = "_pointer_rmd17_52", K = "_fullImg_rmd17_55", Q = "_menuParams_rmd17_61", T = "_line_rmd17_67", U = "_borderRadiusM_rmd17_74", X = "_menuItem_rmd17_78", Y = "_longLogo_rmd17_87", Z = "_bottomNav_rmd17_92", ee = "_bottomInner_rmd17_101", oe = "_bottomItems_rmd17_109", ne = "_bottomParams_rmd17_117", te = "_flexVerticalBetweenStart_rmd17_126", le = "_flexHorizontalCenter_rmd17_140", se = "_flexVerticalBetweenCenter_rmd17_155", n = {
14
+ fullHeight: O,
15
+ fullWidth: j,
16
+ open: D,
17
+ close: q,
18
+ menuButton: A,
19
+ closeIcon: F,
20
+ textEllipsis: G,
21
+ pointer: J,
22
+ fullImg: K,
23
+ menuParams: Q,
24
+ line: T,
25
+ borderRadiusM: U,
26
+ menuItem: X,
27
+ longLogo: Y,
28
+ bottomNav: Z,
29
+ bottomInner: ee,
30
+ bottomItems: oe,
31
+ bottomParams: ne,
32
+ flexVerticalBetweenStart: te,
33
+ flexHorizontalCenter: le,
34
+ flexVerticalBetweenCenter: se
35
+ }, ge = ({ menuItems: i = [], menuParams: d = [], shortLogo: b, logo: g, isOpen: v, defaultOpen: z = !1, selectedId: f, mode: V = "left" }) => {
36
+ const [s, C] = r(z ?? !1), [_, x] = r(f ?? (i.length > 0 ? i[0].id : null)), N = w(null), [P, u] = r(!1), [I, h] = r(!1), [M, S] = r(null), [$, W] = r({}), B = w(null);
37
+ H(() => {
38
+ f != null && x(f);
39
+ }, [f]);
40
+ const p = (e, t) => {
41
+ if (e.stopPropagation(), x(t), i) {
42
+ const l = i.find((m) => m.id === t);
43
+ l == null || l.onClick();
40
44
  }
41
- }, S = () => {
42
- b(!t), _(!1);
43
- }, P = (e) => {
44
- var s;
45
+ }, y = () => {
46
+ C(!s), u(!1);
47
+ }, k = (e) => {
48
+ var t;
45
49
  if (d) {
46
- const n = d.find((a) => a.id === e);
47
- if (!n) return;
48
- if (n.content) {
49
- const a = t ? "200px" : "40px";
50
- E(n.content), R({ ...n.position, left: a }), C(!0);
50
+ const l = d.find((m) => m.id === e);
51
+ if (!l) return;
52
+ if (l.content) {
53
+ const m = s ? "200px" : "40px";
54
+ S(l.content), W({ ...l.position, left: m }), h(!0);
51
55
  } else
52
- (s = n.onClick) == null || s.call(n);
56
+ (t = l.onClick) == null || t.call(l);
53
57
  }
54
58
  };
55
- return B(() => {
56
- h && h(t);
57
- }, [t]), /* @__PURE__ */ l("nav", { ref: w, children: /* @__PURE__ */ u("div", { className: `${o.flexVerticalBetweenStart} ${o.fullHeight} ${t ? o.open : o.close}`, children: [
58
- /* @__PURE__ */ u("div", { className: o.fullWidth, children: [
59
- /* @__PURE__ */ l(
59
+ return H(() => {
60
+ v && v(s);
61
+ }, [s]), V === "bottom" ? /* @__PURE__ */ o("nav", { ref: N, className: n.bottomNav, children: /* @__PURE__ */ c("div", { className: n.bottomInner, children: [
62
+ /* @__PURE__ */ o("div", { className: n.bottomItems, children: i && i.map((e) => /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
63
+ a,
64
+ {
65
+ mode: e.disabled ? "ghost" : _ === e.id ? "secondary" : "ghost",
66
+ children: e.icon,
67
+ disabled: e.disabled,
68
+ onClick: (t) => p(t, e.id)
69
+ }
70
+ ) }, `icon-${e.id}`)) }),
71
+ /* @__PURE__ */ c("div", { className: n.bottomParams, children: [
72
+ d && d.map((e) => /* @__PURE__ */ o("div", { onClick: () => k(e.id), children: /* @__PURE__ */ o(a, { mode: "ghost", children: e.icon, disabled: e.disabled }) }, `param-icon-${e.id}`)),
73
+ /* @__PURE__ */ o(
74
+ R,
75
+ {
76
+ ref: B,
77
+ className: n.borderRadiusM,
78
+ open: I,
79
+ onClose: () => h(!1),
80
+ position: $,
81
+ children: M
82
+ }
83
+ )
84
+ ] })
85
+ ] }) }) : /* @__PURE__ */ o("nav", { ref: N, children: /* @__PURE__ */ c("div", { className: `${n.flexVerticalBetweenStart} ${n.fullHeight} ${s ? n.open : n.close}`, children: [
86
+ /* @__PURE__ */ c("div", { className: n.fullWidth, children: [
87
+ /* @__PURE__ */ o(
60
88
  "div",
61
89
  {
62
- className: `${o.flexHorizontalCenter} ${o.pointer} ${o.textEllipsis}`,
63
- onClick: () => S(),
64
- children: t ? /* @__PURE__ */ u("div", { className: o.fullImg, children: [
65
- p && /* @__PURE__ */ l("img", { className: o.longLogo, src: p, alt: "Logo situaction" }),
66
- /* @__PURE__ */ l(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ l(N, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
67
- ] }) : /* @__PURE__ */ l(
90
+ className: `${n.flexHorizontalCenter} ${n.pointer} ${n.textEllipsis}`,
91
+ onClick: () => y(),
92
+ children: s ? /* @__PURE__ */ c("div", { className: n.fullImg, children: [
93
+ g && /* @__PURE__ */ o("img", { className: n.longLogo, src: g, alt: "Logo situaction" }),
94
+ /* @__PURE__ */ o(a, { mode: "ghost", size: "menu", children: /* @__PURE__ */ o(E, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
95
+ ] }) : /* @__PURE__ */ o(
68
96
  "div",
69
97
  {
70
- className: o.closeIcon,
71
- onMouseEnter: () => _(!0),
72
- onMouseLeave: () => _(!1),
73
- onClick: () => b(!t),
74
- children: H || !m ? /* @__PURE__ */ l(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ l(N, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ l("img", { src: m, alt: "Logo situaction" })
98
+ className: n.closeIcon,
99
+ onMouseEnter: () => u(!0),
100
+ onMouseLeave: () => u(!1),
101
+ onClick: () => C(!s),
102
+ children: P || !b ? /* @__PURE__ */ o(a, { mode: "ghost", size: "menu", children: /* @__PURE__ */ o(E, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ o("img", { src: b, alt: "Logo situaction" })
75
103
  }
76
104
  )
77
105
  }
78
106
  ),
79
- /* @__PURE__ */ l("div", { className: o.menuItem, children: i && i.map((e) => t ? /* @__PURE__ */ l("div", { className: `${o.textEllipsis} ${o.menuButton}`, children: /* @__PURE__ */ l(
80
- $,
107
+ /* @__PURE__ */ o("div", { className: n.menuItem, children: i && i.map((e) => s ? /* @__PURE__ */ o("div", { className: `${n.textEllipsis} ${n.menuButton}`, children: /* @__PURE__ */ o(
108
+ L,
81
109
  {
82
- mode: e.disabled ? "ghost" : g === e.id ? "secondary" : "ghost",
110
+ mode: e.disabled ? "ghost" : _ === e.id ? "secondary" : "ghost",
83
111
  label: e.label,
84
112
  disabled: e.disabled,
85
- onClick: (s) => v(s, e.id),
113
+ onClick: (t) => p(t, e.id),
86
114
  childrenLeft: e.icon
87
115
  }
88
- ) }, `button-${e.id}`) : /* @__PURE__ */ l("div", { className: o.textEllipsis, children: /* @__PURE__ */ l(
89
- f,
116
+ ) }, `button-${e.id}`) : /* @__PURE__ */ o("div", { className: n.textEllipsis, children: /* @__PURE__ */ o(
117
+ a,
90
118
  {
91
- mode: e.disabled ? "ghost" : g === e.id ? "secondary" : "ghost",
119
+ mode: e.disabled ? "ghost" : _ === e.id ? "secondary" : "ghost",
92
120
  children: e.icon,
93
121
  disabled: e.disabled,
94
- onClick: (s) => v(s, e.id)
122
+ onClick: (t) => p(t, e.id)
95
123
  }
96
124
  ) }, `icon-${e.id}`)) }),
97
- /* @__PURE__ */ l("div", { className: o.line })
125
+ /* @__PURE__ */ o("div", { className: n.line })
98
126
  ] }),
99
- /* @__PURE__ */ u("div", { className: `${o.menuParams} ${o.flexVerticalBetweenCenter}`, children: [
100
- d && d.map((e) => /* @__PURE__ */ l(
127
+ /* @__PURE__ */ c("div", { className: `${n.menuParams} ${n.flexVerticalBetweenCenter}`, children: [
128
+ d && d.map((e) => /* @__PURE__ */ o(
101
129
  "div",
102
130
  {
103
- className: `${o.fullWidth} ${o.textEllipsis}`,
104
- onClick: () => P(e.id),
105
- children: t ? /* @__PURE__ */ l("div", { className: o.menuButton, children: /* @__PURE__ */ l($, { mode: "ghost", label: e.label, disabled: e.disabled, childrenLeft: e.icon }, e.id) }) : /* @__PURE__ */ l(f, { mode: "ghost", children: e.icon, disabled: e.disabled })
131
+ className: `${n.fullWidth} ${n.textEllipsis}`,
132
+ onClick: () => k(e.id),
133
+ children: s ? /* @__PURE__ */ o("div", { className: n.menuButton, children: /* @__PURE__ */ o(L, { mode: "ghost", label: e.label, disabled: e.disabled, childrenLeft: e.icon }, e.id) }) : /* @__PURE__ */ o(a, { mode: "ghost", children: e.icon, disabled: e.disabled })
106
134
  },
107
135
  `param-icon-${e.id}`
108
136
  )),
109
- /* @__PURE__ */ l(
110
- W,
137
+ /* @__PURE__ */ o(
138
+ R,
111
139
  {
112
- ref: V,
113
- className: o.borderRadiusM,
114
- open: L,
115
- onClose: () => C(!1),
116
- position: z,
117
- children: k
140
+ ref: B,
141
+ className: n.borderRadiusM,
142
+ open: I,
143
+ onClose: () => h(!1),
144
+ position: $,
145
+ children: M
118
146
  }
119
147
  )
120
148
  ] })
121
149
  ] }) });
122
150
  };
123
151
  export {
124
- _e as Menu
152
+ ge as Menu
125
153
  };
@@ -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_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}
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_rmd17_15{height:100%}nav ._fullWidth_rmd17_18{width:100%}nav ._open_rmd17_21{width:200px;transition:all ease .3s}nav ._close_rmd17_25{width:40px;transition:all ease-out .3s}nav ._menuButton_rmd17_29{width:100%}nav ._menuButton_rmd17_29 button{padding:var(--spacing-xs-4);width:inherit!important;justify-content:flex-start!important}nav ._closeIcon_rmd17_37{height:30px;cursor:pointer;margin:.875rem 0;padding:1px 0}nav ._label_rmd17_43{letter-spacing:.72px;font-weight:600}nav ._textEllipsis_rmd17_47{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}nav ._pointer_rmd17_52{cursor:pointer}nav ._fullImg_rmd17_55{margin:.875rem 0;display:flex;justify-content:space-between;width:100%}nav ._menuParams_rmd17_61{gap:.125rem;position:relative;width:100%}._line_rmd17_67{height:1px;width:100%;background-color:var(--general-border-window);margin:var(--spacing-xs-3) 0}._borderRadiusM_rmd17_74{border-radius:6px}._menuItem_rmd17_78{gap:.25rem;width:100%;display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._longLogo_rmd17_87{transition:transform .25s ease,opacity .25s ease;will-change:transform,opacity}._bottomNav_rmd17_92{width:100%;height:fit-content;padding:var(--spacing-xs-3);box-sizing:border-box;z-index:5;flex-shrink:0}._bottomInner_rmd17_101{display:flex;justify-content:space-between;align-items:center;flex-direction:row;width:100%}._bottomItems_rmd17_109{display:flex;justify-content:flex-start;align-items:center;flex-direction:row;gap:var(--spacing-xs-6)}._bottomParams_rmd17_117{display:flex;justify-content:flex-end;align-items:center;flex-direction:row;gap:var(--spacing-xs-6);position:relative}._flexVerticalBetweenStart_rmd17_126{display:flex;justify-content:space-between;align-items:start;flex-direction:column}._flexHorizontalBetween_rmd17_133{display:flex;justify-content:space-between;align-items:center;flex-direction:row}._flexHorizontalCenter_rmd17_140{height:60px;display:flex;justify-content:center;align-items:center;flex-direction:row}._flexVertical_rmd17_126{display:flex;justify-content:flex-start;align-items:stretch;flex-direction:column}._flexVerticalBetweenCenter_rmd17_155{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.40",
3
+ "version": "1.2.41",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",