react-luminus-components 1.1.25 → 1.1.27

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.
package/dist/layout.es.js CHANGED
@@ -1,107 +1,108 @@
1
- import { L as b, j as e, c as o, M as f } from "./UserAvatarToggle-xT1i6nSz.js";
2
- import { useContext as N, useState as C, useEffect as k } from "react";
3
- import { S as w } from "./SimpleTooltip-DnZSi_qT.js";
4
- import { T as I } from "./Typography-CsdF39gW.js";
5
- const g = "_side-menu-item_9ejxx_1", y = "_nav-button_9ejxx_5", T = "_child_9ejxx_13", S = "_text_9ejxx_16", $ = "_icon_9ejxx_19", L = "_collapse-icon_9ejxx_25", H = "_collapsed_9ejxx_35", F = "_expanded_9ejxx_42", R = "_children-container_9ejxx_48", A = "_visible_9ejxx_57", i = {
6
- "side-menu-item": "_side-menu-item_9ejxx_1",
7
- sideMenuItem: g,
8
- "nav-button": "_nav-button_9ejxx_5",
9
- navButton: y,
10
- child: T,
11
- text: S,
12
- icon: $,
13
- "collapse-icon": "_collapse-icon_9ejxx_25",
14
- collapseIcon: L,
15
- collapsed: H,
16
- expanded: F,
17
- "children-container": "_children-container_9ejxx_48",
18
- childrenContainer: R,
19
- visible: A
20
- }, E = ({ item: n, menuExpanded: s, children: t }) => n.tooltip && !s ? /* @__PURE__ */ e.jsx(w, { text: n.tooltip, placement: "right", children: t }) : t, v = ({ item: n, menuExpanded: s, collapsed: t, onCollapse: a, currentPath: r }) => {
21
- var l, h;
22
- const { LinkComponent: _ } = N(b), [x, d] = C(!1), [u] = r.split("?"), c = n.linkTo === u || ((l = n.children) == null ? void 0 : l.some((m) => m.linkTo === u));
23
- return /* @__PURE__ */ e.jsx("li", { className: o("luminus-side-menu-item", i.sideMenuItem, {
1
+ import { L as b, j as n, c as a, M } from "./UserAvatarToggle-CsMWlplC.js";
2
+ import { useContext as w, useState as N, useEffect as f } from "react";
3
+ import { S as k } from "./SimpleTooltip-Bclp93h0.js";
4
+ import { T as q } from "./Typography-CmC4x8yQ.js";
5
+ const I = "_side-menu-item_ra7qw_1", g = "_nav-button_ra7qw_5", y = "_child_ra7qw_13", T = "_text_ra7qw_17", S = "_icon_ra7qw_20", $ = "_collapse-icon_ra7qw_26", L = "_collapsed_ra7qw_36", H = "_expanded_ra7qw_43", F = "_children-container_ra7qw_49", R = "_visible_ra7qw_57", A = "_children_ra7qw_49", i = {
6
+ "side-menu-item": "_side-menu-item_ra7qw_1",
7
+ sideMenuItem: I,
8
+ "nav-button": "_nav-button_ra7qw_5",
9
+ navButton: g,
10
+ child: y,
11
+ text: T,
12
+ icon: S,
13
+ "collapse-icon": "_collapse-icon_ra7qw_26",
14
+ collapseIcon: $,
15
+ collapsed: L,
16
+ expanded: H,
17
+ "children-container": "_children-container_ra7qw_49",
18
+ childrenContainer: F,
19
+ visible: R,
20
+ children: A
21
+ }, E = ({ item: e, menuExpanded: s, children: t }) => e.tooltip && !s ? /* @__PURE__ */ n.jsx(k, { text: e.tooltip, placement: "right", children: t }) : t, v = ({ item: e, menuExpanded: s, collapsed: t, onCollapse: o, currentPath: l }) => {
22
+ var c, x;
23
+ const { LinkComponent: _ } = w(b), [u, d] = N(!1), [h] = l.split("?"), r = e.linkTo === h || ((c = e.children) == null ? void 0 : c.some((m) => m.linkTo === h));
24
+ return /* @__PURE__ */ n.jsxs("li", { className: a("luminus-side-menu-item", i.sideMenuItem, {
24
25
  [i.expanded]: s
25
- }, { active: x || c }, { open: t && n.children }), onMouseEnter: () => d(!0), onMouseLeave: () => d(!1), children: /* @__PURE__ */ e.jsx(E, { item: n, menuExpanded: s, children: n.children ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
26
- /* @__PURE__ */ e.jsxs("button", { type: "button", className: o("nav-link", i.navButton), onClick: () => a(), children: [
27
- /* @__PURE__ */ e.jsx("div", { className: o("icon", i.icon), children: n.icon }),
28
- s && /* @__PURE__ */ e.jsx("div", { className: o("text", i.text, "text-nowrap"), children: n.title }),
29
- s && /* @__PURE__ */ e.jsx("div", { className: o("collapse-icon", i.collapseIcon, {
26
+ }, { active: u || r }, { open: t && e.children }), onMouseEnter: () => d(!0), onMouseLeave: () => d(!1), children: [
27
+ /* @__PURE__ */ n.jsx(E, { item: e, menuExpanded: s, children: e.children ? /* @__PURE__ */ n.jsx(n.Fragment, { children: /* @__PURE__ */ n.jsxs("button", { type: "button", className: a("nav-link", i.navButton), onClick: () => o(), children: [
28
+ /* @__PURE__ */ n.jsx("div", { className: a("icon", i.icon), children: e.icon }),
29
+ s && /* @__PURE__ */ n.jsx("div", { className: a("text", i.text, "text-nowrap"), children: e.title }),
30
+ s && /* @__PURE__ */ n.jsx("div", { className: a("collapse-icon", i.collapseIcon, {
30
31
  [i.collapsed]: t
31
- }), children: /* @__PURE__ */ e.jsx(f, {}) })
32
- ] }),
33
- /* @__PURE__ */ e.jsx("div", { className: o("children-container shadow rounded", i.childrenContainer, {
32
+ }), children: /* @__PURE__ */ n.jsx(M, {}) })
33
+ ] }) }) : /* @__PURE__ */ n.jsxs(_, { to: e.linkTo ?? "/", className: a("nav-link", i.navButton), children: [
34
+ /* @__PURE__ */ n.jsx("div", { className: a("icon", i.icon), children: e.icon }),
35
+ s && /* @__PURE__ */ n.jsx("div", { className: a("text", i.text, "text-nowrap"), children: e.title })
36
+ ] }) }),
37
+ /* @__PURE__ */ n.jsx("div", { className: a("children-container", i.childrenContainer, {
34
38
  [i.visible]: t
35
- }), children: (h = n.children) == null ? void 0 : h.map((m) => /* @__PURE__ */ e.jsx(_, { to: m.linkTo ?? "/", className: o("nav-link child rounded", i.navButton, i.child), children: /* @__PURE__ */ e.jsx("div", { className: o("text", i.text, "text-nowrap"), children: m.title }) }, m.linkTo)) })
36
- ] }) : /* @__PURE__ */ e.jsxs(_, { to: n.linkTo ?? "/", className: o("nav-link", i.navButton), children: [
37
- /* @__PURE__ */ e.jsx("div", { className: o("icon", i.icon), children: n.icon }),
38
- s && /* @__PURE__ */ e.jsx("div", { className: o("text", i.text, "text-nowrap"), children: n.title })
39
- ] }) }) });
40
- }, K = "_side-menu_n1hvm_1", q = "_sidebar-header_n1hvm_13", z = "_side-menu-content_n1hvm_18", D = "_expand_n1hvm_22", G = "_divider_n1hvm_26", p = {
39
+ }), children: /* @__PURE__ */ n.jsx("div", { className: a("shadow rounded children", i.children), children: (x = e.children) == null ? void 0 : x.map((m) => /* @__PURE__ */ n.jsx(_, { to: m.linkTo ?? "/", className: a("nav-link child rounded", i.navButton, i.child), children: /* @__PURE__ */ n.jsx("div", { className: a("text", i.text, "text-nowrap"), children: m.title }) }, m.linkTo)) }) })
40
+ ] });
41
+ }, K = "_side-menu_n1hvm_1", z = "_sidebar-header_n1hvm_13", D = "_side-menu-content_n1hvm_18", G = "_expand_n1hvm_22", J = "_divider_n1hvm_26", p = {
41
42
  "side-menu": "_side-menu_n1hvm_1",
42
43
  sideMenu: K,
43
44
  "sidebar-header": "_sidebar-header_n1hvm_13",
44
- sidebarHeader: q,
45
+ sidebarHeader: z,
45
46
  "side-menu-content": "_side-menu-content_n1hvm_18",
46
- sideMenuContent: z,
47
- expand: D,
48
- divider: G
49
- }, ee = ({ headerItem: n, mainItems: s, secondaryItems: t, expanded: a, setExpanded: r, currentPath: _ }) => {
50
- const [x, d] = C(-1), u = (c) => {
51
- d(c === x ? -1 : c);
47
+ sideMenuContent: D,
48
+ expand: G,
49
+ divider: J
50
+ }, en = ({ headerItem: e, mainItems: s, secondaryItems: t, expanded: o, setExpanded: l, currentPath: _ }) => {
51
+ const [u, d] = N(-1), h = (r) => {
52
+ d(r === u ? -1 : r);
52
53
  };
53
- return k(() => {
54
- a || d(-1);
55
- }, [a]), /* @__PURE__ */ e.jsxs("section", { className: o("luminus-side-menu", p.sideMenu, {
56
- [p.expand]: a
57
- }, { expand: a }), onMouseEnter: () => r(!0), onMouseLeave: () => r(!1), children: [
58
- /* @__PURE__ */ e.jsx("div", { className: o("sidebar-header", p.sidebarHeader), children: n }),
59
- /* @__PURE__ */ e.jsxs("ul", { className: p.sideMenuContent, children: [
60
- s.map((c, l) => /* @__PURE__ */ e.jsx(v, { item: c, menuExpanded: a, collapsed: l === x, onCollapse: () => u(l), currentPath: _ }, c.title)),
61
- /* @__PURE__ */ e.jsx("hr", { className: o("divider", p.divider) }),
62
- t.map((c, l) => /* @__PURE__ */ e.jsx(v, { item: c, menuExpanded: a, collapsed: l === x, onCollapse: () => u(l), currentPath: _ }, c.title))
54
+ return f(() => {
55
+ o || d(-1);
56
+ }, [o]), /* @__PURE__ */ n.jsxs("section", { className: a("luminus-side-menu", p.sideMenu, {
57
+ [p.expand]: o
58
+ }, { expand: o }), onMouseEnter: () => l(!0), onMouseLeave: () => l(!1), children: [
59
+ /* @__PURE__ */ n.jsx("div", { className: a("sidebar-header", p.sidebarHeader), children: e }),
60
+ /* @__PURE__ */ n.jsxs("ul", { className: p.sideMenuContent, children: [
61
+ s.map((r, c) => /* @__PURE__ */ n.jsx(v, { item: r, menuExpanded: o, collapsed: c === u, onCollapse: () => h(c), currentPath: _ }, r.title)),
62
+ /* @__PURE__ */ n.jsx("hr", { className: a("divider", p.divider) }),
63
+ t.map((r, c) => /* @__PURE__ */ n.jsx(v, { item: r, menuExpanded: o, collapsed: c === u, onCollapse: () => h(c), currentPath: _ }, r.title))
63
64
  ] })
64
65
  ] });
65
- }, J = "_top-bar_1lk80_1", P = "_top-bar-brand_1lk80_14", j = {
66
+ }, P = "_top-bar_1lk80_1", Q = "_top-bar-brand_1lk80_14", j = {
66
67
  "top-bar": "_top-bar_1lk80_1",
67
- topBar: J,
68
+ topBar: P,
68
69
  "top-bar-brand": "_top-bar-brand_1lk80_14",
69
- topBarBrand: P
70
- }, ne = ({ appName: n, leftOffset: s, centerContent: t, rightContent: a }) => {
71
- const { LinkComponent: r } = N(b);
72
- return /* @__PURE__ */ e.jsxs("nav", { className: o("luminus-top-bar", j.topBar), style: {
70
+ topBarBrand: Q
71
+ }, sn = ({ appName: e, leftOffset: s, centerContent: t, rightContent: o }) => {
72
+ const { LinkComponent: l } = w(b);
73
+ return /* @__PURE__ */ n.jsxs("nav", { className: a("luminus-top-bar", j.topBar), style: {
73
74
  width: s ? `calc(100% - ${s}px)` : void 0,
74
75
  left: s ? `${s}px` : void 0
75
76
  }, children: [
76
- /* @__PURE__ */ e.jsx(r, { to: "/", className: o("luminus-top-bar-brand", j.topBarBrand), children: n }),
77
- t && /* @__PURE__ */ e.jsx("div", { children: t }),
78
- /* @__PURE__ */ e.jsx("div", { className: "d-flex justify-content-end align-items-center gap-2", children: a ?? null })
77
+ /* @__PURE__ */ n.jsx(l, { to: "/", className: a("luminus-top-bar-brand", j.topBarBrand), children: e }),
78
+ t && /* @__PURE__ */ n.jsx("div", { children: t }),
79
+ /* @__PURE__ */ n.jsx("div", { className: "d-flex justify-content-end align-items-center gap-2", children: o ?? null })
79
80
  ] });
80
- }, Q = "_side-content-bar_17kwd_1", U = {
81
+ }, U = "_side-content-bar_17kwd_1", V = {
81
82
  "side-content-bar": "_side-content-bar_17kwd_1",
82
- sideContentBar: Q
83
- }, B = ({ width: n, children: s }) => /* @__PURE__ */ e.jsx("section", { className: o("luminus-side-content-bar", U.sideContentBar), style: {
84
- width: `${n}px`
85
- }, children: s }), M = ({ title: n }) => /* @__PURE__ */ e.jsx("div", { className: "mb-3", children: typeof n == "string" ? /* @__PURE__ */ e.jsx(I, { variant: "h3", children: n }) : n }), se = ({ title: n, children: s, sideContent: t }) => /* @__PURE__ */ e.jsxs("div", { className: "container-fluid p-3", children: [
86
- /* @__PURE__ */ e.jsxs("div", { style: { paddingRight: t ? "250px" : void 0 }, children: [
87
- n ? /* @__PURE__ */ e.jsx(M, { title: n }) : null,
83
+ sideContentBar: U
84
+ }, C = ({ width: e, children: s }) => /* @__PURE__ */ n.jsx("section", { className: a("luminus-side-content-bar", V.sideContentBar), style: {
85
+ width: `${e}px`
86
+ }, children: s }), B = ({ title: e }) => /* @__PURE__ */ n.jsx("div", { className: "mb-3", children: typeof e == "string" ? /* @__PURE__ */ n.jsx(q, { variant: "h3", children: e }) : e }), tn = ({ title: e, children: s, sideContent: t }) => /* @__PURE__ */ n.jsxs("div", { className: "container-fluid p-3", children: [
87
+ /* @__PURE__ */ n.jsxs("div", { style: { paddingRight: t ? "250px" : void 0 }, children: [
88
+ e ? /* @__PURE__ */ n.jsx(B, { title: e }) : null,
88
89
  s
89
90
  ] }),
90
- t && /* @__PURE__ */ e.jsx(B, { width: 250, children: t })
91
- ] }), V = "_full-screen-container_1rm4r_1", W = {
91
+ t && /* @__PURE__ */ n.jsx(C, { width: 250, children: t })
92
+ ] }), W = "_full-screen-container_1rm4r_1", X = {
92
93
  "full-screen-container": "_full-screen-container_1rm4r_1",
93
- fullScreenContainer: V
94
- }, te = ({ title: n, children: s, sideContent: t }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
95
- /* @__PURE__ */ e.jsxs("div", { className: o("ontainer-fluid p-3 overflow-hidden luminus-full-screen-container", W.fullScreenContainer), style: { width: t ? "calc(100% - 250px)" : "100%" }, children: [
96
- n ? /* @__PURE__ */ e.jsx(M, { title: n }) : null,
94
+ fullScreenContainer: W
95
+ }, an = ({ title: e, children: s, sideContent: t }) => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
96
+ /* @__PURE__ */ n.jsxs("div", { className: a("ontainer-fluid p-3 overflow-hidden luminus-full-screen-container", X.fullScreenContainer), style: { width: t ? "calc(100% - 250px)" : "100%" }, children: [
97
+ e ? /* @__PURE__ */ n.jsx(B, { title: e }) : null,
97
98
  s
98
99
  ] }),
99
- t && /* @__PURE__ */ e.jsx(B, { width: 250, children: t })
100
+ t && /* @__PURE__ */ n.jsx(C, { width: 250, children: t })
100
101
  ] });
101
102
  export {
102
- te as FullScreenContainer,
103
- se as MainContainer,
104
- B as SideContentBar,
105
- ee as SideMenu,
106
- ne as TopBar
103
+ an as FullScreenContainer,
104
+ tn as MainContainer,
105
+ C as SideContentBar,
106
+ en as SideMenu,
107
+ sn as TopBar
107
108
  };