@situaction/traq-ui-ste 1.2.13 → 1.2.16

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.
Files changed (40) hide show
  1. package/dist/X.es-BEJ-zMPl.mjs +146 -0
  2. package/dist/components/button/Button.js +36 -36
  3. package/dist/components/calendar/Calendar.js +210 -214
  4. package/dist/components/carousel/Carousel.d.ts +33 -0
  5. package/dist/components/carousel/Carousel.js +328 -0
  6. package/dist/components/drag-and-drop/DragAndDrop.d.ts +31 -0
  7. package/dist/components/drag-and-drop/DragAndDrop.js +143 -0
  8. package/dist/components/icon/Icon.js +23729 -46405
  9. package/dist/components/icon-button/IconButton.js +27 -27
  10. package/dist/components/input/Input.js +49 -49
  11. package/dist/components/list/list-controls/ListControls.js +9 -8
  12. package/dist/components/list/nested-list/NestedList.js +6 -5
  13. package/dist/components/list/nested-list/item/NestedListItem.js +3 -2
  14. package/dist/components/loading/Loading.d.ts +38 -0
  15. package/dist/components/loading/Loading.js +87 -0
  16. package/dist/components/menu/Menu.js +61 -63
  17. package/dist/components/panel/side-panel/SidePanel.js +18 -19
  18. package/dist/components/panel/side-panel-header/SidePanelHeader.js +3 -2
  19. package/dist/components/select/Select.js +68 -69
  20. package/dist/components/select-filter-input-tags/SelectFilterInputTags.js +11 -11
  21. package/dist/components/select-multi-items/SelectMultiItems.js +19 -18
  22. package/dist/components/switch/Switch.js +11 -10
  23. package/dist/components/tag/Tag.js +25 -25
  24. package/dist/components/theme/variables_dark.d.ts +11 -0
  25. package/dist/components/theme/variables_dark.js +12 -1
  26. package/dist/components/theme/variables_light.d.ts +11 -0
  27. package/dist/components/theme/variables_light.js +12 -1
  28. package/dist/components/toast/Toast.js +38 -38
  29. package/dist/main.d.ts +3 -0
  30. package/dist/main.js +33 -27
  31. package/dist/styles/Button.css +1 -1
  32. package/dist/styles/Carousel.css +1 -0
  33. package/dist/styles/DragAndDrop.css +1 -0
  34. package/dist/styles/IconButton.css +1 -1
  35. package/dist/styles/Input.css +1 -1
  36. package/dist/styles/Loading.css +1 -0
  37. package/dist/styles/Tag.css +1 -1
  38. package/dist/styles/Toast.css +1 -1
  39. package/package.json +1 -1
  40. package/dist/X-Bd1VjKAF.mjs +0 -190
@@ -1,50 +1,50 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { forwardRef as w } from "react";
3
- import '../../styles/IconButton.css';const z = "_button_wxoc4_30", m = "_flexHorizontalCenter_wxoc4_185", t = {
3
+ import '../../styles/IconButton.css';const z = "_button_olxwb_30", m = "_flexHorizontalCenter_olxwb_187", t = {
4
4
  button: z,
5
- "button-round": "_button-round_wxoc4_58",
6
- "button-primary": "_button-primary_wxoc4_61",
7
- "button-secondary": "_button-secondary_wxoc4_75",
8
- "button-tertiary": "_button-tertiary_wxoc4_91",
9
- "button-ghost": "_button-ghost_wxoc4_107",
10
- "button-icon": "_button-icon_wxoc4_124",
11
- "button-icon-selected": "_button-icon-selected_wxoc4_136",
12
- "button-error": "_button-error_wxoc4_145",
13
- "button-size-xl": "_button-size-xl_wxoc4_158",
14
- "button-size-l": "_button-size-l_wxoc4_163",
15
- "button-size-m": "_button-size-m_wxoc4_168",
16
- "button-size-s": "_button-size-s_wxoc4_173",
17
- "button-size-menu": "_button-size-menu_wxoc4_178",
5
+ "button-round": "_button-round_olxwb_57",
6
+ "button-primary": "_button-primary_olxwb_60",
7
+ "button-secondary": "_button-secondary_olxwb_74",
8
+ "button-tertiary": "_button-tertiary_olxwb_90",
9
+ "button-ghost": "_button-ghost_olxwb_106",
10
+ "button-icon": "_button-icon_olxwb_123",
11
+ "button-icon-selected": "_button-icon-selected_olxwb_135",
12
+ "button-error": "_button-error_olxwb_144",
13
+ "button-size-xl": "_button-size-xl_olxwb_160",
14
+ "button-size-l": "_button-size-l_olxwb_165",
15
+ "button-size-m": "_button-size-m_olxwb_170",
16
+ "button-size-s": "_button-size-s_olxwb_175",
17
+ "button-size-menu": "_button-size-menu_olxwb_180",
18
18
  flexHorizontalCenter: m
19
19
  }, d = w(
20
20
  ({
21
21
  mode: o = "primary",
22
22
  size: n = "m",
23
- error: e,
24
- selected: _,
25
- round: u,
26
- disabled: r,
27
- children: b,
28
- onClick: c,
23
+ error: b,
24
+ selected: e,
25
+ round: _,
26
+ disabled: u,
27
+ children: r,
28
+ onClick: l,
29
29
  ...s
30
30
  }, i) => {
31
- const x = () => e ? "error" : o, l = [
31
+ const x = () => b ? "error" : o, c = [
32
32
  t.button,
33
33
  t[`button-${x()}`],
34
- u && t["button-round"],
34
+ _ && t["button-round"],
35
35
  t[`button-size-${n}`],
36
- _ && o === "icon" && t["button-icon-selected"],
36
+ e && o === "icon" && t["button-icon-selected"],
37
37
  t.flexHorizontalCenter
38
38
  ].filter(Boolean).join(" ");
39
39
  return /* @__PURE__ */ a(
40
40
  "button",
41
41
  {
42
42
  ref: i,
43
- className: l,
44
- onClick: c,
45
- disabled: r,
43
+ className: c,
44
+ onClick: l,
45
+ disabled: u,
46
46
  ...s,
47
- children: b
47
+ children: r
48
48
  }
49
49
  );
50
50
  }
@@ -1,85 +1,85 @@
1
- import { jsxs as p, jsx as e, Fragment as a } from "react/jsx-runtime";
2
- import { useState as c, useRef as _ } from "react";
3
- import '../../styles/Input.css';const j = "_fullWidth_1pmuq_141", N = "_flexHorizontalBetween_1pmuq_145", W = "_flexHorizontal_1pmuq_145", t = {
4
- "input-style": "_input-style_1pmuq_30",
5
- "input-style-disabled": "_input-style-disabled_1pmuq_60",
6
- "input-style-focused": "_input-style-focused_1pmuq_71",
7
- "input-style-secondary": "_input-style-secondary_1pmuq_78",
8
- "input-style-ghost": "_input-style-ghost_1pmuq_92",
9
- "input-style-error": "_input-style-error_1pmuq_95",
10
- "input-container": "_input-container_1pmuq_105",
11
- "input-style-size-xl": "_input-style-size-xl_1pmuq_109",
12
- "input-style-size-l": "_input-style-size-l_1pmuq_116",
13
- "input-style-size-m": "_input-style-size-m_1pmuq_123",
14
- "input-style-size-s": "_input-style-size-s_1pmuq_130",
15
- "input-style-radius": "_input-style-radius_1pmuq_137",
16
- fullWidth: j,
17
- flexHorizontalBetween: N,
18
- flexHorizontal: W
19
- }, R = ({
1
+ import { jsxs as r, jsx as e, Fragment as a } from "react/jsx-runtime";
2
+ import { useState as _, useRef as p } from "react";
3
+ import '../../styles/Input.css';const N = "_fullWidth_1ch0x_143", W = "_flexHorizontalBetween_1ch0x_147", I = "_flexHorizontal_1ch0x_147", t = {
4
+ "input-style": "_input-style_1ch0x_30",
5
+ "input-style-disabled": "_input-style-disabled_1ch0x_59",
6
+ "input-style-focused": "_input-style-focused_1ch0x_70",
7
+ "input-style-secondary": "_input-style-secondary_1ch0x_77",
8
+ "input-style-ghost": "_input-style-ghost_1ch0x_91",
9
+ "input-style-error": "_input-style-error_1ch0x_94",
10
+ "input-container": "_input-container_1ch0x_104",
11
+ "input-style-size-xl": "_input-style-size-xl_1ch0x_111",
12
+ "input-style-size-l": "_input-style-size-l_1ch0x_118",
13
+ "input-style-size-m": "_input-style-size-m_1ch0x_125",
14
+ "input-style-size-s": "_input-style-size-s_1ch0x_132",
15
+ "input-style-radius": "_input-style-radius_1ch0x_139",
16
+ fullWidth: N,
17
+ flexHorizontalBetween: W,
18
+ flexHorizontal: I
19
+ }, V = ({
20
20
  sizeStyle: y = "m",
21
21
  labelUnit: l,
22
22
  status: n = "default",
23
- childrenLeft: u,
24
- childrenRight: i,
25
- round: d,
26
- disabled: o,
27
- defaultValue: f,
28
- fullWidth: m = !1,
29
- ...h
23
+ childrenLeft: i,
24
+ childrenRight: o,
25
+ round: h,
26
+ disabled: u,
27
+ defaultValue: d,
28
+ fullWidth: f = !1,
29
+ ...x
30
30
  }) => {
31
- const [z, r] = c(!1), [q, x] = c(f || ""), g = _(null), s = _(null), B = () => r(!0), C = () => r(!1), H = (F) => {
32
- x(F.target.value);
33
- }, S = () => {
31
+ const [z, c] = _(!1), [m, g] = _(d || ""), B = p(null), s = p(null), C = () => c(!0), H = () => c(!1), S = (j) => {
32
+ g(j.target.value);
33
+ }, v = () => {
34
34
  s.current && s.current.focus();
35
- }, v = [
35
+ }, w = [
36
36
  t["input-style"],
37
37
  t[`input-style-size-${y}`],
38
- d && t["input-style-radius"],
38
+ h && t["input-style-radius"],
39
39
  t.flexHorizontalBetween,
40
- m && t.fullWidth
41
- ].filter(Boolean).join(" "), w = [
40
+ f && t.fullWidth
41
+ ].filter(Boolean).join(" "), F = [
42
42
  z && t["input-style-focused"],
43
- o && t["input-style-disabled"],
43
+ u && t["input-style-disabled"],
44
44
  n === "secondary" && t["input-style-secondary"],
45
45
  n === "ghost" && t["input-style-ghost"]
46
46
  ].filter(Boolean).join(" ");
47
- return /* @__PURE__ */ p(
47
+ return /* @__PURE__ */ r(
48
48
  "div",
49
49
  {
50
- ref: g,
51
- className: `${v} ${(() => {
50
+ ref: B,
51
+ className: `${w} ${(() => {
52
52
  switch (n) {
53
53
  case "error":
54
54
  return t["input-style-error"];
55
55
  default:
56
- return w;
56
+ return F;
57
57
  }
58
58
  })()}`,
59
- onFocus: B,
60
- onBlur: C,
61
- onClick: S,
59
+ onFocus: C,
60
+ onBlur: H,
61
+ onClick: v,
62
62
  children: [
63
- u && /* @__PURE__ */ e(a, { children: u }),
63
+ i && /* @__PURE__ */ e(a, { children: i }),
64
64
  /* @__PURE__ */ e("div", { className: t["input-container"], children: /* @__PURE__ */ e(
65
65
  "input",
66
66
  {
67
67
  autoCorrect: "off",
68
- disabled: o,
69
- value: q,
70
- onChange: H,
68
+ disabled: u,
69
+ value: m,
70
+ onChange: S,
71
71
  ref: s,
72
- ...h
72
+ ...x
73
73
  }
74
74
  ) }),
75
- /* @__PURE__ */ p(a, { children: [
75
+ /* @__PURE__ */ r(a, { children: [
76
76
  l && /* @__PURE__ */ e("div", { children: l }),
77
- i && /* @__PURE__ */ e("span", { className: t.flexHorizontal, children: i })
77
+ o && /* @__PURE__ */ e("span", { className: t.flexHorizontal, children: o })
78
78
  ] })
79
79
  ]
80
80
  }
81
81
  );
82
82
  };
83
83
  export {
84
- R as Input
84
+ V as Input
85
85
  };
@@ -5,6 +5,7 @@ import "../../icon-button/IconButton.js";
5
5
  import { Checkbox as _ } from "../../checkbox/Checkbox.js";
6
6
  import { Icon as a } from "../../icon/Icon.js";
7
7
  import "../../modal/Modal.js";
8
+ import "../../carousel/Carousel.js";
8
9
  import "../../theme/ThemeContext.js";
9
10
  import '../../../styles/Size.css';import '../../../styles/ListControls.css';/* empty css */
10
11
  const u = "_list_1nihg_6", f = "_children_1nihg_29", g = "_selected_1nihg_43", k = "_reset_1nihg_47", i = {
@@ -12,10 +13,10 @@ const u = "_list_1nihg_6", f = "_children_1nihg_29", g = "_selected_1nihg_43", k
12
13
  children: f,
13
14
  selected: g,
14
15
  reset: k
15
- }, F = ({ listChildren: o, handleItemClick: d, selectedItems: h, onReset: t, labelButtonReset: r }) => /* @__PURE__ */ l("div", { className: i.list, children: [
16
- /* @__PURE__ */ e("div", { children: o.map((n, m) => {
17
- if (n.key == null) return null;
18
- const s = n.key, c = h.includes(s);
16
+ }, I = ({ listChildren: o, handleItemClick: d, selectedItems: h, onReset: n, labelButtonReset: r }) => /* @__PURE__ */ l("div", { className: i.list, children: [
17
+ /* @__PURE__ */ e("div", { children: o.map((t, m) => {
18
+ if (t.key == null) return null;
19
+ const s = t.key, c = h.includes(s);
19
20
  return /* @__PURE__ */ l(
20
21
  "div",
21
22
  {
@@ -28,22 +29,22 @@ const u = "_list_1nihg_6", f = "_children_1nihg_29", g = "_selected_1nihg_43", k
28
29
  onChange: () => d(s)
29
30
  }
30
31
  ),
31
- /* @__PURE__ */ e("span", { children: n })
32
+ /* @__PURE__ */ e("span", { children: t })
32
33
  ]
33
34
  },
34
35
  m
35
36
  );
36
37
  }) }),
37
- t && r && /* @__PURE__ */ e("div", { className: i.reset, children: /* @__PURE__ */ e(
38
+ n && r && /* @__PURE__ */ e("div", { className: i.reset, children: /* @__PURE__ */ e(
38
39
  p,
39
40
  {
40
41
  mode: "ghost",
41
42
  label: r,
42
- onClick: t,
43
+ onClick: n,
43
44
  childrenLeft: /* @__PURE__ */ e(a, { icon: "FunnelX" })
44
45
  }
45
46
  ) })
46
47
  ] });
47
48
  export {
48
- F as ListControls
49
+ I as ListControls
49
50
  };
@@ -5,15 +5,16 @@ import "react";
5
5
  import "../../icon-button/IconButton.js";
6
6
  import { Icon as a } from "../../icon/Icon.js";
7
7
  import "../../modal/Modal.js";
8
+ import "../../carousel/Carousel.js";
8
9
  import "../../theme/ThemeContext.js";
9
10
  import '../../../styles/Size.css';import '../../../styles/NestedList.css';/* empty css */
10
- const h = "_nestedlist_7rnd3_6", _ = "_reset_7rnd3_18", r = {
11
+ const h = "_nestedlist_7rnd3_6", _ = "_reset_7rnd3_18", s = {
11
12
  nestedlist: h,
12
13
  reset: _
13
- }, k = ({ items: i, align: o = "right", onReset: e, children: n, labelButtonReset: s }) => /* @__PURE__ */ l("div", { className: r.nestedlist, children: [
14
- i.map((m, d) => /* @__PURE__ */ t(c, { ...m, align: o ?? "right", children: n }, d)),
15
- e && s && /* @__PURE__ */ t("div", { className: r.reset, children: /* @__PURE__ */ t(p, { mode: "ghost", label: s, onClick: e, childrenLeft: /* @__PURE__ */ t(a, { icon: "FunnelX" }) }) })
14
+ }, y = ({ items: i, align: o = "right", onReset: e, children: m, labelButtonReset: r }) => /* @__PURE__ */ l("div", { className: s.nestedlist, children: [
15
+ i.map((n, d) => /* @__PURE__ */ t(c, { ...n, align: o ?? "right", children: m }, d)),
16
+ e && r && /* @__PURE__ */ t("div", { className: s.reset, children: /* @__PURE__ */ t(p, { mode: "ghost", label: r, onClick: e, childrenLeft: /* @__PURE__ */ t(a, { icon: "FunnelX" }) }) })
16
17
  ] });
17
18
  export {
18
- k as NestedList
19
+ y as NestedList
19
20
  };
@@ -5,6 +5,7 @@ import "../../../icon-button/IconButton.js";
5
5
  import { TagCounter as B } from "../../../tag-counter/TagCounter.js";
6
6
  import { Icon as l } from "../../../icon/Icon.js";
7
7
  import { Modal as L } from "../../../modal/Modal.js";
8
+ import "../../../carousel/Carousel.js";
8
9
  import "../../../theme/ThemeContext.js";
9
10
  import '../../../../styles/Size.css';import '../../../../styles/NestedListItem.css';/* empty css */
10
11
  const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28", v = "_modal_2r2ga_34", s = {
@@ -12,7 +13,7 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
12
13
  items: $,
13
14
  textSmall: j,
14
15
  modal: v
15
- }, W = ({
16
+ }, q = ({
16
17
  icon: a,
17
18
  title: h,
18
19
  numberSelect: i,
@@ -68,5 +69,5 @@ const S = "_nestedlist_2r2ga_6", $ = "_items_2r2ga_21", j = "_textSmall_2r2ga_28
68
69
  ] });
69
70
  };
70
71
  export {
71
- W as NestedListItem
72
+ q as NestedListItem
72
73
  };
@@ -0,0 +1,38 @@
1
+ export type LoadingSize = "s" | "m" | "l" | "xl";
2
+ export type LoadingStatus = "idle" | "loading" | "complete";
3
+ export interface LoadingHoverMeta {
4
+ status: LoadingStatus;
5
+ isHovering: boolean;
6
+ }
7
+ export interface LoadingClickMeta {
8
+ /** "clear" when complete is clearable */
9
+ intent: "clear";
10
+ /** true when the clear UI (X) is visible via hover/focus */
11
+ isHovering: boolean;
12
+ }
13
+ export interface LoadingProps {
14
+ /** Visual state */
15
+ status: LoadingStatus;
16
+ /** Size variant */
17
+ size?: LoadingSize;
18
+ /** Disable hover visuals + events */
19
+ disableHover?: boolean;
20
+ /**
21
+ * If provided, the "complete" state becomes clearable:
22
+ * - on hover/focus: shows an "X"
23
+ * - on click: calls onClear
24
+ */
25
+ onClear?: () => void;
26
+ /** Optional click event when status === "complete" AND clearable */
27
+ onClick?: (meta: LoadingClickMeta) => void;
28
+ /** Hover change event for ALL statuses (idle/loading/complete) */
29
+ onHoverChange?: (meta: LoadingHoverMeta) => void;
30
+ /** Optional className for layout integration */
31
+ className?: string;
32
+ /** Accessibility labels */
33
+ ariaLabelIdle?: string;
34
+ ariaLabelLoading?: string;
35
+ ariaLabelComplete?: string;
36
+ ariaLabelClear?: string;
37
+ }
38
+ export declare const Loading: ({ status, size, disableHover, onClear, onClick, onHoverChange, className, ariaLabelIdle, ariaLabelLoading, ariaLabelComplete, ariaLabelClear }: LoadingProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,87 @@
1
+ import { jsxs as X, jsx as n } from "react/jsx-runtime";
2
+ import { useState as C, useMemo as y } from "react";
3
+ import { Icon as r } from "../icon/Icon.js";
4
+ import '../../styles/Loading.css';const B = "_size_s_ljbi5_30", F = "_size_m_ljbi5_35", P = "_size_l_ljbi5_40", v = "_size_xl_ljbi5_45", S = "_root_ljbi5_50", E = "_idle_ljbi5_72", M = "_spinner_ljbi5_76", q = "_spin_ljbi5_76", A = "_complete_ljbi5_82", D = "_iconCheck_ljbi5_86", G = "_iconX_ljbi5_87", J = "_hovered_ljbi5_108", K = "_clearable_ljbi5_129", O = "_flexHorizontalCenter_ljbi5_146", i = {
5
+ size_s: B,
6
+ size_m: F,
7
+ size_l: P,
8
+ size_xl: v,
9
+ root: S,
10
+ idle: E,
11
+ spinner: M,
12
+ spin: q,
13
+ complete: A,
14
+ iconCheck: D,
15
+ iconX: G,
16
+ hovered: J,
17
+ clearable: K,
18
+ flexHorizontalCenter: O
19
+ }, k = (...e) => e.filter(Boolean).join(" "), Q = {
20
+ s: 10,
21
+ m: 14,
22
+ l: 18,
23
+ xl: 24
24
+ }, V = ({
25
+ status: e,
26
+ size: d = "m",
27
+ disableHover: o = !1,
28
+ onClear: l,
29
+ onClick: _,
30
+ onHoverChange: a,
31
+ className: H,
32
+ ariaLabelIdle: z = "Idle",
33
+ ariaLabelLoading: p = "Loading",
34
+ ariaLabelComplete: f = "Complete",
35
+ ariaLabelClear: h = "Clear"
36
+ }) => {
37
+ const m = e === "complete" && typeof l == "function", c = Q[d], [I, $] = C(!1), [u, s] = C(!1), t = o ? u : I || u, b = y(() => e === "idle" ? z : e === "loading" ? p : m && t ? h : f, [h, f, z, p, m, t, e]), j = k(
38
+ i.root,
39
+ i[`size_${d}`],
40
+ e === "idle" && i.idle,
41
+ e === "loading" && i.spinner,
42
+ e === "complete" && i.complete,
43
+ !o && t && i.hovered,
44
+ H
45
+ ), x = (N) => {
46
+ o || ($(N), a == null || a({ status: e, isHovering: N }));
47
+ }, g = o ? {} : {
48
+ onPointerEnter: () => x(!0),
49
+ onPointerLeave: () => x(!1)
50
+ }, w = () => {
51
+ _ == null || _({ intent: "clear", isHovering: t }), l == null || l();
52
+ };
53
+ return m ? /* @__PURE__ */ X(
54
+ "button",
55
+ {
56
+ type: "button",
57
+ className: k(j, i.clearable),
58
+ onClick: w,
59
+ onFocus: () => s(!0),
60
+ onBlur: () => s(!1),
61
+ "aria-label": b,
62
+ ...g,
63
+ children: [
64
+ /* @__PURE__ */ n("span", { className: `flexHorizontalCenter ${i.iconCheck}`, "aria-hidden": "true", children: /* @__PURE__ */ n(r, { icon: "Check", weight: "regular", size: c }) }),
65
+ /* @__PURE__ */ n("span", { className: `flexHorizontalCenter ${i.iconX}`, "aria-hidden": "true", children: /* @__PURE__ */ n(r, { icon: "X", weight: "regular", size: c }) })
66
+ ]
67
+ }
68
+ ) : /* @__PURE__ */ X(
69
+ "div",
70
+ {
71
+ className: j,
72
+ role: "img",
73
+ "aria-label": b,
74
+ ...g,
75
+ onFocus: () => s(!0),
76
+ onBlur: () => s(!1),
77
+ tabIndex: o ? -1 : 0,
78
+ children: [
79
+ e === "complete" ? /* @__PURE__ */ n("span", { className: `flexHorizontalCenter ${i.iconCheck}`, "aria-hidden": "true", children: /* @__PURE__ */ n(r, { icon: "Check", weight: "regular", size: c }) }) : null,
80
+ /* @__PURE__ */ n("span", { className: `flexHorizontalCenter ${i.iconX}`, "aria-hidden": "true", children: /* @__PURE__ */ n(r, { icon: "X", weight: "regular", size: c }) })
81
+ ]
82
+ }
83
+ );
84
+ };
85
+ export {
86
+ V as Loading
87
+ };
@@ -1,122 +1,120 @@
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";
1
+ import { jsx as n, jsxs as d } from "react/jsx-runtime";
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
5
  import { Icon as N } from "../icon/Icon.js";
6
6
  import { Modal as W } from "../modal/Modal.js";
7
+ import "../carousel/Carousel.js";
7
8
  import "../theme/ThemeContext.js";
8
9
  import '../../styles/Size.css';import '../../styles/Menu.css';/* empty css */
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
+ 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", e = {
10
11
  fullHeight: y,
11
12
  fullWidth: O,
12
13
  open: j,
13
14
  close: D,
14
15
  menuButton: q,
15
16
  closeIcon: A,
16
- label: F,
17
- textEllipsis: G,
18
- pointer: J,
19
- fullImg: K,
20
- menuParams: Q,
21
- line: T,
22
- borderRadiusM: U,
23
- menuItem: X,
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);
17
+ textEllipsis: F,
18
+ pointer: G,
19
+ fullImg: J,
20
+ menuParams: K,
21
+ line: Q,
22
+ borderRadiusM: T,
23
+ menuItem: U,
24
+ longLogo: X,
25
+ flexVerticalBetweenStart: Y,
26
+ flexHorizontalCenter: Z,
27
+ flexVerticalBetweenCenter: ee
28
+ }, ue = ({ menuItems: s = [], menuParams: a = [], shortLogo: m, logo: h, isOpen: p, defaultOpen: I = !1, selectedId: u }) => {
29
+ const [t, 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);
30
+ B(() => {
31
+ u != null && x(u);
34
32
  }, [u]);
35
- const B = (l, i) => {
36
- if (l.stopPropagation(), g(i), s) {
37
- const n = s.find((a) => a.id === i);
38
- n == null || n.onClick();
33
+ const v = (o, i) => {
34
+ if (o.stopPropagation(), x(i), s) {
35
+ const l = s.find((r) => r.id === i);
36
+ l == null || l.onClick();
39
37
  }
40
38
  }, S = () => {
41
- b(!t), _(!1);
42
- }, P = (l) => {
39
+ g(!t), _(!1);
40
+ }, P = (o) => {
43
41
  var i;
44
- if (r) {
45
- const n = r.find((a) => a.id === l);
46
- if (!n) return;
47
- if (n.content) {
48
- const a = t ? "200px" : "40px";
49
- L(n.content), E({ ...n.position, left: a }), C(!0);
42
+ if (a) {
43
+ const l = a.find((r) => r.id === o);
44
+ if (!l) return;
45
+ if (l.content) {
46
+ const r = t ? "200px" : "40px";
47
+ E(l.content), R({ ...l.position, left: r }), C(!0);
50
48
  } else
51
- (i = n.onClick) == null || i.call(n);
49
+ (i = l.onClick) == null || i.call(l);
52
50
  }
53
51
  };
54
- return M(() => {
52
+ return B(() => {
55
53
  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: [
54
+ }, [t]), /* @__PURE__ */ n("nav", { ref: w, children: /* @__PURE__ */ d("div", { className: `${e.flexVerticalBetweenStart} ${e.fullHeight} ${t ? e.open : e.close}`, children: [
57
55
  /* @__PURE__ */ d("div", { className: e.fullWidth, children: [
58
- /* @__PURE__ */ o(
56
+ /* @__PURE__ */ n(
59
57
  "div",
60
58
  {
61
59
  className: `${e.flexHorizontalCenter} ${e.pointer} ${e.textEllipsis}`,
62
60
  onClick: () => S(),
63
61
  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(
62
+ h && /* @__PURE__ */ n("img", { className: e.longLogo, src: h, alt: "Logo situaction" }),
63
+ /* @__PURE__ */ n(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ n(N, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
64
+ ] }) : /* @__PURE__ */ n(
67
65
  "div",
68
66
  {
69
67
  className: e.closeIcon,
70
68
  onMouseEnter: () => _(!0),
71
69
  onMouseLeave: () => _(!1),
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" })
70
+ onClick: () => g(!t),
71
+ children: H || !m ? /* @__PURE__ */ n(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ n(N, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ n("img", { src: m, alt: "Logo situaction" })
74
72
  }
75
73
  )
76
74
  }
77
75
  ),
78
- /* @__PURE__ */ o("div", { className: e.menuItem, children: s && s.map((l) => t ? /* @__PURE__ */ o("div", { className: `${e.textEllipsis} ${e.menuButton}`, children: /* @__PURE__ */ o(
76
+ /* @__PURE__ */ n("div", { className: e.menuItem, children: s && s.map((o) => t ? /* @__PURE__ */ n("div", { className: `${e.textEllipsis} ${e.menuButton}`, children: /* @__PURE__ */ n(
79
77
  $,
80
78
  {
81
- mode: x === l.id ? "secondary" : "ghost",
82
- label: l.label,
83
- onClick: (i) => B(i, l.id),
84
- childrenLeft: l.icon
79
+ mode: b === o.id ? "secondary" : "ghost",
80
+ label: o.label,
81
+ onClick: (i) => v(i, o.id),
82
+ childrenLeft: o.icon
85
83
  }
86
- ) }, `button-${l.id}`) : /* @__PURE__ */ o("div", { className: e.textEllipsis, children: /* @__PURE__ */ o(
84
+ ) }, `button-${o.id}`) : /* @__PURE__ */ n("div", { className: e.textEllipsis, children: /* @__PURE__ */ n(
87
85
  f,
88
86
  {
89
- mode: x === l.id ? "secondary" : "ghost",
90
- children: l.icon,
91
- onClick: (i) => B(i, l.id)
87
+ mode: b === o.id ? "secondary" : "ghost",
88
+ children: o.icon,
89
+ onClick: (i) => v(i, o.id)
92
90
  }
93
- ) }, `icon-${l.id}`)) }),
94
- /* @__PURE__ */ o("div", { className: e.line })
91
+ ) }, `icon-${o.id}`)) }),
92
+ /* @__PURE__ */ n("div", { className: e.line })
95
93
  ] }),
96
94
  /* @__PURE__ */ d("div", { className: `${e.menuParams} ${e.flexVerticalBetweenCenter}`, children: [
97
- r && r.map((l) => /* @__PURE__ */ o(
95
+ a && a.map((o) => /* @__PURE__ */ n(
98
96
  "div",
99
97
  {
100
98
  className: `${e.fullWidth} ${e.textEllipsis}`,
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 })
99
+ onClick: () => P(o.id),
100
+ children: t ? /* @__PURE__ */ n("div", { className: e.menuButton, children: /* @__PURE__ */ n($, { mode: "ghost", label: o.label, childrenLeft: o.icon }, o.id) }) : /* @__PURE__ */ n(f, { mode: "ghost", children: o.icon })
103
101
  },
104
- `param-icon-${l.id}`
102
+ `param-icon-${o.id}`
105
103
  )),
106
- /* @__PURE__ */ o(
104
+ /* @__PURE__ */ n(
107
105
  W,
108
106
  {
109
- ref: R,
107
+ ref: V,
110
108
  className: e.borderRadiusM,
111
- open: I,
109
+ open: L,
112
110
  onClose: () => C(!1),
113
- position: k,
114
- children: V
111
+ position: z,
112
+ children: k
115
113
  }
116
114
  )
117
115
  ] })
118
116
  ] }) });
119
117
  };
120
118
  export {
121
- fe as Menu
119
+ ue as Menu
122
120
  };