react-luminus-components 1.0.3 → 1.0.5

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/README.md CHANGED
@@ -234,7 +234,6 @@ Common layout components
234
234
  - **TopBar**\
235
235
  Renders the top bar with the application name and child items
236
236
  - appName: string
237
- - sideMenuExpanded: boolean
238
237
  ***
239
238
  - **SideContentBar**\
240
239
  Renders the side content bar on the right side, content is sent as children
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  type Props = {
3
3
  appName: string;
4
- sideMenuExpanded: boolean;
4
+ leftOffset?: number;
5
5
  children?: React.ReactNode;
6
6
  };
7
- declare const TopBar: ({ appName, sideMenuExpanded, children }: Props) => import("react").JSX.Element;
7
+ declare const TopBar: ({ appName, leftOffset, children }: Props) => import("react").JSX.Element;
8
8
  export default TopBar;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./HomeDashboard.module-BI8obEZ_.js"),d=require("react"),v=require("./SimpleTooltip-HYwwaCn4.js"),x=require("./hasClass-DABt6TfW.js");function _(...s){return s.filter(n=>n!=null).reduce((n,t)=>{if(typeof t!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return n===null?t:function(...i){n.apply(this,i),t.apply(this,i)}},null)}const L={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function D(s,n){const t=`offset${s[0].toUpperCase()}${s.slice(1)}`,o=n[t],i=L[s];return o+parseInt(x.style(n,i[0]),10)+parseInt(x.style(n,i[1]),10)}const O={[x.EXITED]:"collapse",[x.EXITING]:"collapsing",[x.ENTERING]:"collapsing",[x.ENTERED]:"collapse show"},q=d.forwardRef(({onEnter:s,onEntering:n,onEntered:t,onExit:o,onExiting:i,className:p,children:c,dimension:j="height",in:u=!1,timeout:m=300,mountOnEnter:B=!1,unmountOnExit:w=!1,appear:g=!1,getDimensionValue:f=D,...N},y)=>{const l=typeof j=="function"?j():j,I=d.useMemo(()=>_(r=>{r.style[l]="0"},s),[l,s]),S=d.useMemo(()=>_(r=>{const E=`scroll${l[0].toUpperCase()}${l.slice(1)}`;r.style[l]=`${r[E]}px`},n),[l,n]),T=d.useMemo(()=>_(r=>{r.style[l]=null},t),[l,t]),$=d.useMemo(()=>_(r=>{r.style[l]=`${f(l,r)}px`,x.triggerBrowserReflow(r)},o),[o,f,l]),k=d.useMemo(()=>_(r=>{r.style[l]=null},i),[l,i]);return e.jsxRuntimeExports.jsx(x.TransitionWrapper,{ref:y,addEndListener:x.transitionEndListener,...N,"aria-expanded":N.role?u:null,onEnter:I,onEntering:S,onEntered:T,onExit:$,onExiting:k,childRef:c.ref,in:u,timeout:m,mountOnEnter:B,unmountOnExit:w,appear:g,children:(r,E)=>d.cloneElement(c,{...E,className:e.classNames(p,c.props.className,O[r],l==="width"&&"collapse-horizontal")})})}),F=q,H="_side-menu-item_8j1cd_1",A="_nav-button_8j1cd_4",G="_child_8j1cd_11",U="_text_8j1cd_14",X="_icon_8j1cd_17",z="_collapse-icon_8j1cd_23",K="_collapsed_8j1cd_33",W="_expanded_8j1cd_40",a={"side-menu-item":"_side-menu-item_8j1cd_1",sideMenuItem:H,"nav-button":"_nav-button_8j1cd_4",navButton:A,child:G,text:U,icon:X,"collapse-icon":"_collapse-icon_8j1cd_23",collapseIcon:z,collapsed:K,expanded:W},R=({item:s,menuExpanded:n,children:t})=>s.tooltip&&!n?e.jsxRuntimeExports.jsx(v.SimpleTooltip,{text:s.tooltip,placement:"right",children:t}):t,b=({item:s,menuExpanded:n,collapsed:t,onCollapse:o})=>{var p;const{LinkComponent:i}=d.useContext(e.LuminusComponentsContext);return s.children?e.jsxRuntimeExports.jsx("li",{className:e.classNames("luminus-side-menu-item",a.sideMenuItem,{[a.expanded]:n}),children:e.jsxRuntimeExports.jsx(R,{item:s,menuExpanded:n,children:e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",a.navButton),onClick:()=>o(),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",a.icon),children:s.icon}),n&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",a.text,"text-nowrap"),children:s.title}),n&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",a.collapseIcon,{[a.collapsed]:t}),children:e.jsxRuntimeExports.jsx(v.MdOutlineKeyboardArrowDown,{})})]}),e.jsxRuntimeExports.jsx(F,{in:t,children:e.jsxRuntimeExports.jsx("div",{children:(p=s.children)==null?void 0:p.map(c=>e.jsxRuntimeExports.jsx(i,{to:c.linkTo??"/",className:e.classNames("nav-link",a.navButton,a.child),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",a.text,"text-nowrap"),children:c.title})},c.linkTo))})})]})})}):e.jsxRuntimeExports.jsx("li",{className:e.classNames("luminus-side-menu-item",a.sideMenuItem,{[a.expanded]:n}),children:e.jsxRuntimeExports.jsx(R,{item:s,menuExpanded:n,children:e.jsxRuntimeExports.jsxs(i,{to:s.linkTo??"/",className:e.classNames("nav-link",a.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",a.icon),children:s.icon}),n&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",a.text,"text-nowrap"),children:s.title})]})})})},J="_side-menu_s0700_1",P="_sidebar-header_s0700_14",Q="_side-menu-content_s0700_19",V="_expand_s0700_23",h={"side-menu":"_side-menu_s0700_1",sideMenu:J,"sidebar-header":"_sidebar-header_s0700_14",sidebarHeader:P,"side-menu-content":"_side-menu-content_s0700_19",sideMenuContent:Q,expand:V},Y=({headerItem:s,mainItems:n,secondaryItems:t,expanded:o,setExpanded:i})=>{const[p,c]=d.useState(-1),j=u=>{c(u===p?-1:u)};return d.useEffect(()=>{o||c(-1)},[o]),e.jsxRuntimeExports.jsxs("section",{className:e.classNames("luminus-side-menu",h.sideMenu,"shadow",{[h.expand]:o},{expand:o}),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",h.sidebarHeader),children:s}),e.jsxRuntimeExports.jsxs("ul",{className:h.sideMenuContent,children:[n.map((u,m)=>e.jsxRuntimeExports.jsx(b,{item:u,menuExpanded:o,collapsed:m===p,onCollapse:()=>j(m)},u.title)),e.jsxRuntimeExports.jsx("hr",{}),t.map((u,m)=>e.jsxRuntimeExports.jsx(b,{item:u,menuExpanded:o,collapsed:m===p,onCollapse:()=>j(m)},u.title))]})]})},Z="_top-bar_j4je9_1",ee="_top-bar-brand_j4je9_12",C={"top-bar":"_top-bar_j4je9_1",topBar:Z,"top-bar-brand":"_top-bar-brand_j4je9_12",topBarBrand:ee},se=({appName:s,sideMenuExpanded:n,children:t})=>{const{LinkComponent:o}=d.useContext(e.LuminusComponentsContext);return e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("shadow luminus-top-bar",C.topBar,{"topbar-expand":n}),children:[e.jsxRuntimeExports.jsx(o,{to:"/",className:e.classNames("luminus-top-bar-brand",C.topBarBrand),children:s}),e.jsxRuntimeExports.jsx("div",{className:"w-100 d-flex justify-content-end align-items-center gap-2",children:t})]})},ne="_side-content-bar_17kwd_1",te={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:ne},M=({width:s,children:n})=>e.jsxRuntimeExports.jsx("section",{className:e.classNames("shadow luminus-side-content-bar",te.sideContentBar),style:{width:`${s}px`},children:n}),oe=({children:s,sideContent:n})=>e.jsxRuntimeExports.jsxs("div",{className:"container-fluid p-3",children:[e.jsxRuntimeExports.jsx("div",{style:{paddingRight:n?"250px":void 0},children:s}),n&&e.jsxRuntimeExports.jsx(M,{width:250,children:n})]}),ae="_full-screen-container_1c9bu_1",ie={"full-screen-container":"_full-screen-container_1c9bu_1",fullScreenContainer:ae},le=({children:s})=>e.jsxRuntimeExports.jsx("div",{className:e.classNames("container-fluid p-3 overflow-hidden luminus-full-screen-container",ie.fullScreenContainer),children:s});exports.FullScreenContainer=le;exports.MainContainer=oe;exports.SideContentBar=M;exports.SideMenu=Y;exports.TopBar=se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./HomeDashboard.module-BI8obEZ_.js"),d=require("react"),C=require("./SimpleTooltip-HYwwaCn4.js"),x=require("./hasClass-DABt6TfW.js");function _(...n){return n.filter(e=>e!=null).reduce((e,t)=>{if(typeof t!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return e===null?t:function(...i){e.apply(this,i),t.apply(this,i)}},null)}const L={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function D(n,e){const t=`offset${n[0].toUpperCase()}${n.slice(1)}`,o=e[t],i=L[n];return o+parseInt(x.style(e,i[0]),10)+parseInt(x.style(e,i[1]),10)}const q={[x.EXITED]:"collapse",[x.EXITING]:"collapsing",[x.ENTERING]:"collapsing",[x.ENTERED]:"collapse show"},F=d.forwardRef(({onEnter:n,onEntering:e,onEntered:t,onExit:o,onExiting:i,className:p,children:r,dimension:j="height",in:u=!1,timeout:m=300,mountOnEnter:w=!1,unmountOnExit:B=!1,appear:y=!1,getDimensionValue:N=D,...R},g)=>{const l=typeof j=="function"?j():j,I=d.useMemo(()=>_(c=>{c.style[l]="0"},n),[l,n]),S=d.useMemo(()=>_(c=>{const E=`scroll${l[0].toUpperCase()}${l.slice(1)}`;c.style[l]=`${c[E]}px`},e),[l,e]),T=d.useMemo(()=>_(c=>{c.style[l]=null},t),[l,t]),$=d.useMemo(()=>_(c=>{c.style[l]=`${N(l,c)}px`,x.triggerBrowserReflow(c)},o),[o,N,l]),k=d.useMemo(()=>_(c=>{c.style[l]=null},i),[l,i]);return s.jsxRuntimeExports.jsx(x.TransitionWrapper,{ref:g,addEndListener:x.transitionEndListener,...R,"aria-expanded":R.role?u:null,onEnter:I,onEntering:S,onEntered:T,onExit:$,onExiting:k,childRef:r.ref,in:u,timeout:m,mountOnEnter:w,unmountOnExit:B,appear:y,children:(c,E)=>d.cloneElement(r,{...E,className:s.classNames(p,r.props.className,q[c],l==="width"&&"collapse-horizontal")})})}),H=F,A="_side-menu-item_8j1cd_1",G="_nav-button_8j1cd_4",O="_child_8j1cd_11",U="_text_8j1cd_14",X="_icon_8j1cd_17",z="_collapse-icon_8j1cd_23",K="_collapsed_8j1cd_33",W="_expanded_8j1cd_40",a={"side-menu-item":"_side-menu-item_8j1cd_1",sideMenuItem:A,"nav-button":"_nav-button_8j1cd_4",navButton:G,child:O,text:U,icon:X,"collapse-icon":"_collapse-icon_8j1cd_23",collapseIcon:z,collapsed:K,expanded:W},f=({item:n,menuExpanded:e,children:t})=>n.tooltip&&!e?s.jsxRuntimeExports.jsx(C.SimpleTooltip,{text:n.tooltip,placement:"right",children:t}):t,b=({item:n,menuExpanded:e,collapsed:t,onCollapse:o})=>{var p;const{LinkComponent:i}=d.useContext(s.LuminusComponentsContext);return n.children?s.jsxRuntimeExports.jsx("li",{className:s.classNames("luminus-side-menu-item",a.sideMenuItem,{[a.expanded]:e}),children:s.jsxRuntimeExports.jsx(f,{item:n,menuExpanded:e,children:s.jsxRuntimeExports.jsxs("div",{children:[s.jsxRuntimeExports.jsxs("button",{type:"button",className:s.classNames("nav-link",a.navButton),onClick:()=>o(),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",a.icon),children:n.icon}),e&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",a.text,"text-nowrap"),children:n.title}),e&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("collapse-icon",a.collapseIcon,{[a.collapsed]:t}),children:s.jsxRuntimeExports.jsx(C.MdOutlineKeyboardArrowDown,{})})]}),s.jsxRuntimeExports.jsx(H,{in:t,children:s.jsxRuntimeExports.jsx("div",{children:(p=n.children)==null?void 0:p.map(r=>s.jsxRuntimeExports.jsx(i,{to:r.linkTo??"/",className:s.classNames("nav-link",a.navButton,a.child),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",a.text,"text-nowrap"),children:r.title})},r.linkTo))})})]})})}):s.jsxRuntimeExports.jsx("li",{className:s.classNames("luminus-side-menu-item",a.sideMenuItem,{[a.expanded]:e}),children:s.jsxRuntimeExports.jsx(f,{item:n,menuExpanded:e,children:s.jsxRuntimeExports.jsxs(i,{to:n.linkTo??"/",className:s.classNames("nav-link",a.navButton),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("icon",a.icon),children:n.icon}),e&&s.jsxRuntimeExports.jsx("div",{className:s.classNames("text",a.text,"text-nowrap"),children:n.title})]})})})},J="_side-menu_s0700_1",P="_sidebar-header_s0700_14",Q="_side-menu-content_s0700_19",V="_expand_s0700_23",h={"side-menu":"_side-menu_s0700_1",sideMenu:J,"sidebar-header":"_sidebar-header_s0700_14",sidebarHeader:P,"side-menu-content":"_side-menu-content_s0700_19",sideMenuContent:Q,expand:V},Y=({headerItem:n,mainItems:e,secondaryItems:t,expanded:o,setExpanded:i})=>{const[p,r]=d.useState(-1),j=u=>{r(u===p?-1:u)};return d.useEffect(()=>{o||r(-1)},[o]),s.jsxRuntimeExports.jsxs("section",{className:s.classNames("luminus-side-menu",h.sideMenu,"shadow",{[h.expand]:o},{expand:o}),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("sidebar-header",h.sidebarHeader),children:n}),s.jsxRuntimeExports.jsxs("ul",{className:h.sideMenuContent,children:[e.map((u,m)=>s.jsxRuntimeExports.jsx(b,{item:u,menuExpanded:o,collapsed:m===p,onCollapse:()=>j(m)},u.title)),s.jsxRuntimeExports.jsx("hr",{}),t.map((u,m)=>s.jsxRuntimeExports.jsx(b,{item:u,menuExpanded:o,collapsed:m===p,onCollapse:()=>j(m)},u.title))]})]})},Z="_top-bar_4di1c_1",ss="_top-bar-brand_4di1c_13",v={"top-bar":"_top-bar_4di1c_1",topBar:Z,"top-bar-brand":"_top-bar-brand_4di1c_13",topBarBrand:ss},es=({appName:n,leftOffset:e,children:t})=>{const{LinkComponent:o}=d.useContext(s.LuminusComponentsContext);return s.jsxRuntimeExports.jsxs("nav",{className:s.classNames("shadow luminus-top-bar",v.topBar),style:{width:e?`calc(100% - ${e}px)`:void 0,left:e?`${e}px`:void 0},children:[s.jsxRuntimeExports.jsx(o,{to:"/",className:s.classNames("luminus-top-bar-brand",v.topBarBrand),children:n}),s.jsxRuntimeExports.jsx("div",{className:"w-100 d-flex justify-content-end align-items-center gap-2",children:t})]})},ns="_side-content-bar_17kwd_1",ts={"side-content-bar":"_side-content-bar_17kwd_1",sideContentBar:ns},M=({width:n,children:e})=>s.jsxRuntimeExports.jsx("section",{className:s.classNames("shadow luminus-side-content-bar",ts.sideContentBar),style:{width:`${n}px`},children:e}),os=({children:n,sideContent:e})=>s.jsxRuntimeExports.jsxs("div",{className:"container-fluid p-3",children:[s.jsxRuntimeExports.jsx("div",{style:{paddingRight:e?"250px":void 0},children:n}),e&&s.jsxRuntimeExports.jsx(M,{width:250,children:e})]}),as="_full-screen-container_1c9bu_1",is={"full-screen-container":"_full-screen-container_1c9bu_1",fullScreenContainer:as},ls=({children:n})=>s.jsxRuntimeExports.jsx("div",{className:s.classNames("container-fluid p-3 overflow-hidden luminus-full-screen-container",is.fullScreenContainer),children:n});exports.FullScreenContainer=ls;exports.MainContainer=os;exports.SideContentBar=M;exports.SideMenu=Y;exports.TopBar=es;
package/dist/layout.es.js CHANGED
@@ -1,13 +1,13 @@
1
- import { j as e, e as o, L as M } from "./HomeDashboard.module-CuVVnp4t.mjs";
2
- import N, { useMemo as x, useContext as g, useState as O, useEffect as A } from "react";
3
- import { M as F, S as G } from "./SimpleTooltip-C8wTRZNZ.mjs";
4
- import { T as H, t as U, s as C, E as X, a as z, b as K, c as W, d as q } from "./hasClass-D3KZs5y_.mjs";
5
- function h(...n) {
6
- return n.filter((s) => s != null).reduce((s, t) => {
1
+ import { j as n, e as o, L as M } from "./HomeDashboard.module-CuVVnp4t.mjs";
2
+ import N, { useMemo as x, useContext as g, useState as A, useEffect as F } from "react";
3
+ import { M as G, S as H } from "./SimpleTooltip-C8wTRZNZ.mjs";
4
+ import { T as U, t as X, s as C, E as z, a as K, b as O, c as W, d as q } from "./hasClass-D3KZs5y_.mjs";
5
+ function h(...s) {
6
+ return s.filter((e) => e != null).reduce((e, t) => {
7
7
  if (typeof t != "function")
8
8
  throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");
9
- return s === null ? t : function(...c) {
10
- s.apply(this, c), t.apply(this, c);
9
+ return e === null ? t : function(...c) {
10
+ e.apply(this, c), t.apply(this, c);
11
11
  };
12
12
  }, null);
13
13
  }
@@ -15,20 +15,20 @@ const J = {
15
15
  height: ["marginTop", "marginBottom"],
16
16
  width: ["marginLeft", "marginRight"]
17
17
  };
18
- function Q(n, s) {
19
- const t = `offset${n[0].toUpperCase()}${n.slice(1)}`, a = s[t], c = J[n];
18
+ function Q(s, e) {
19
+ const t = `offset${s[0].toUpperCase()}${s.slice(1)}`, a = e[t], c = J[s];
20
20
  return a + // @ts-ignore
21
- parseInt(C(s, c[0]), 10) + // @ts-ignore
22
- parseInt(C(s, c[1]), 10);
21
+ parseInt(C(e, c[0]), 10) + // @ts-ignore
22
+ parseInt(C(e, c[1]), 10);
23
23
  }
24
24
  const V = {
25
- [X]: "collapse",
26
- [z]: "collapsing",
25
+ [z]: "collapse",
27
26
  [K]: "collapsing",
27
+ [O]: "collapsing",
28
28
  [W]: "collapse show"
29
29
  }, Y = /* @__PURE__ */ N.forwardRef(({
30
- onEnter: n,
31
- onEntering: s,
30
+ onEnter: s,
31
+ onEntering: e,
32
32
  onEntered: t,
33
33
  onExit: a,
34
34
  onExiting: c,
@@ -39,27 +39,27 @@ const V = {
39
39
  timeout: _ = 300,
40
40
  mountOnEnter: y = !1,
41
41
  unmountOnExit: E = !1,
42
- appear: T = !1,
43
- getDimensionValue: b = Q,
44
- ...v
45
- }, $) => {
42
+ appear: $ = !1,
43
+ getDimensionValue: v = Q,
44
+ ...b
45
+ }, T) => {
46
46
  const i = typeof m == "function" ? m() : m, k = x(() => h((r) => {
47
47
  r.style[i] = "0";
48
- }, n), [i, n]), S = x(() => h((r) => {
48
+ }, s), [i, s]), S = x(() => h((r) => {
49
49
  const f = `scroll${i[0].toUpperCase()}${i.slice(1)}`;
50
50
  r.style[i] = `${r[f]}px`;
51
- }, s), [i, s]), R = x(() => h((r) => {
51
+ }, e), [i, e]), R = x(() => h((r) => {
52
52
  r.style[i] = null;
53
53
  }, t), [i, t]), L = x(() => h((r) => {
54
- r.style[i] = `${b(i, r)}px`, q(r);
55
- }, a), [a, b, i]), D = x(() => h((r) => {
54
+ r.style[i] = `${v(i, r)}px`, q(r);
55
+ }, a), [a, v, i]), D = x(() => h((r) => {
56
56
  r.style[i] = null;
57
57
  }, c), [i, c]);
58
- return /* @__PURE__ */ e.jsx(H, {
59
- ref: $,
60
- addEndListener: U,
61
- ...v,
62
- "aria-expanded": v.role ? u : null,
58
+ return /* @__PURE__ */ n.jsx(U, {
59
+ ref: T,
60
+ addEndListener: X,
61
+ ...b,
62
+ "aria-expanded": b.role ? u : null,
63
63
  onEnter: k,
64
64
  onEntering: S,
65
65
  onEntered: R,
@@ -70,7 +70,7 @@ const V = {
70
70
  timeout: _,
71
71
  mountOnEnter: y,
72
72
  unmountOnExit: E,
73
- appear: T,
73
+ appear: $,
74
74
  children: (r, f) => /* @__PURE__ */ N.cloneElement(d, {
75
75
  ...f,
76
76
  className: o(p, d.props.className, V[r], i === "width" && "collapse-horizontal")
@@ -88,25 +88,25 @@ const V = {
88
88
  collapseIcon: oe,
89
89
  collapsed: ae,
90
90
  expanded: le
91
- }, w = ({ item: n, menuExpanded: s, children: t }) => n.tooltip && !s ? /* @__PURE__ */ e.jsx(G, { text: n.tooltip, placement: "right", children: t }) : t, B = ({ item: n, menuExpanded: s, collapsed: t, onCollapse: a }) => {
91
+ }, w = ({ item: s, menuExpanded: e, children: t }) => s.tooltip && !e ? /* @__PURE__ */ n.jsx(H, { text: s.tooltip, placement: "right", children: t }) : t, B = ({ item: s, menuExpanded: e, collapsed: t, onCollapse: a }) => {
92
92
  var p;
93
93
  const { LinkComponent: c } = g(M);
94
- return n.children ? /* @__PURE__ */ e.jsx("li", { className: o("luminus-side-menu-item", l.sideMenuItem, {
95
- [l.expanded]: s
96
- }), children: /* @__PURE__ */ e.jsx(w, { item: n, menuExpanded: s, children: /* @__PURE__ */ e.jsxs("div", { children: [
97
- /* @__PURE__ */ e.jsxs("button", { type: "button", className: o("nav-link", l.navButton), onClick: () => a(), children: [
98
- /* @__PURE__ */ e.jsx("div", { className: o("icon", l.icon), children: n.icon }),
99
- s && /* @__PURE__ */ e.jsx("div", { className: o("text", l.text, "text-nowrap"), children: n.title }),
100
- s && /* @__PURE__ */ e.jsx("div", { className: o("collapse-icon", l.collapseIcon, {
94
+ return s.children ? /* @__PURE__ */ n.jsx("li", { className: o("luminus-side-menu-item", l.sideMenuItem, {
95
+ [l.expanded]: e
96
+ }), children: /* @__PURE__ */ n.jsx(w, { item: s, menuExpanded: e, children: /* @__PURE__ */ n.jsxs("div", { children: [
97
+ /* @__PURE__ */ n.jsxs("button", { type: "button", className: o("nav-link", l.navButton), onClick: () => a(), children: [
98
+ /* @__PURE__ */ n.jsx("div", { className: o("icon", l.icon), children: s.icon }),
99
+ e && /* @__PURE__ */ n.jsx("div", { className: o("text", l.text, "text-nowrap"), children: s.title }),
100
+ e && /* @__PURE__ */ n.jsx("div", { className: o("collapse-icon", l.collapseIcon, {
101
101
  [l.collapsed]: t
102
- }), children: /* @__PURE__ */ e.jsx(F, {}) })
102
+ }), children: /* @__PURE__ */ n.jsx(G, {}) })
103
103
  ] }),
104
- /* @__PURE__ */ e.jsx(Z, { in: t, children: /* @__PURE__ */ e.jsx("div", { children: (p = n.children) == null ? void 0 : p.map((d) => /* @__PURE__ */ e.jsx(c, { to: d.linkTo ?? "/", className: o("nav-link", l.navButton, l.child), children: /* @__PURE__ */ e.jsx("div", { className: o("text", l.text, "text-nowrap"), children: d.title }) }, d.linkTo)) }) })
105
- ] }) }) }) : /* @__PURE__ */ e.jsx("li", { className: o("luminus-side-menu-item", l.sideMenuItem, {
106
- [l.expanded]: s
107
- }), children: /* @__PURE__ */ e.jsx(w, { item: n, menuExpanded: s, children: /* @__PURE__ */ e.jsxs(c, { to: n.linkTo ?? "/", className: o("nav-link", l.navButton), children: [
108
- /* @__PURE__ */ e.jsx("div", { className: o("icon", l.icon), children: n.icon }),
109
- s && /* @__PURE__ */ e.jsx("div", { className: o("text", l.text, "text-nowrap"), children: n.title })
104
+ /* @__PURE__ */ n.jsx(Z, { in: t, children: /* @__PURE__ */ n.jsx("div", { children: (p = s.children) == null ? void 0 : p.map((d) => /* @__PURE__ */ n.jsx(c, { to: d.linkTo ?? "/", className: o("nav-link", l.navButton, l.child), children: /* @__PURE__ */ n.jsx("div", { className: o("text", l.text, "text-nowrap"), children: d.title }) }, d.linkTo)) }) })
105
+ ] }) }) }) : /* @__PURE__ */ n.jsx("li", { className: o("luminus-side-menu-item", l.sideMenuItem, {
106
+ [l.expanded]: e
107
+ }), children: /* @__PURE__ */ n.jsx(w, { item: s, menuExpanded: e, children: /* @__PURE__ */ n.jsxs(c, { to: s.linkTo ?? "/", className: o("nav-link", l.navButton), children: [
108
+ /* @__PURE__ */ n.jsx("div", { className: o("icon", l.icon), children: s.icon }),
109
+ e && /* @__PURE__ */ n.jsx("div", { className: o("text", l.text, "text-nowrap"), children: s.title })
110
110
  ] }) }) });
111
111
  }, ce = "_side-menu_s0700_1", ie = "_sidebar-header_s0700_14", re = "_side-menu-content_s0700_19", de = "_expand_s0700_23", j = {
112
112
  "side-menu": "_side-menu_s0700_1",
@@ -116,47 +116,48 @@ const V = {
116
116
  "side-menu-content": "_side-menu-content_s0700_19",
117
117
  sideMenuContent: re,
118
118
  expand: de
119
- }, Ce = ({ headerItem: n, mainItems: s, secondaryItems: t, expanded: a, setExpanded: c }) => {
120
- const [p, d] = O(-1), m = (u) => {
119
+ }, Ce = ({ headerItem: s, mainItems: e, secondaryItems: t, expanded: a, setExpanded: c }) => {
120
+ const [p, d] = A(-1), m = (u) => {
121
121
  d(u === p ? -1 : u);
122
122
  };
123
- return A(() => {
123
+ return F(() => {
124
124
  a || d(-1);
125
- }, [a]), /* @__PURE__ */ e.jsxs("section", { className: o("luminus-side-menu", j.sideMenu, "shadow", {
125
+ }, [a]), /* @__PURE__ */ n.jsxs("section", { className: o("luminus-side-menu", j.sideMenu, "shadow", {
126
126
  [j.expand]: a
127
127
  }, { expand: a }), onMouseEnter: () => c(!0), onMouseLeave: () => c(!1), children: [
128
- /* @__PURE__ */ e.jsx("div", { className: o("sidebar-header", j.sidebarHeader), children: n }),
129
- /* @__PURE__ */ e.jsxs("ul", { className: j.sideMenuContent, children: [
130
- s.map((u, _) => /* @__PURE__ */ e.jsx(B, { item: u, menuExpanded: a, collapsed: _ === p, onCollapse: () => m(_) }, u.title)),
131
- /* @__PURE__ */ e.jsx("hr", {}),
132
- t.map((u, _) => /* @__PURE__ */ e.jsx(B, { item: u, menuExpanded: a, collapsed: _ === p, onCollapse: () => m(_) }, u.title))
128
+ /* @__PURE__ */ n.jsx("div", { className: o("sidebar-header", j.sidebarHeader), children: s }),
129
+ /* @__PURE__ */ n.jsxs("ul", { className: j.sideMenuContent, children: [
130
+ e.map((u, _) => /* @__PURE__ */ n.jsx(B, { item: u, menuExpanded: a, collapsed: _ === p, onCollapse: () => m(_) }, u.title)),
131
+ /* @__PURE__ */ n.jsx("hr", {}),
132
+ t.map((u, _) => /* @__PURE__ */ n.jsx(B, { item: u, menuExpanded: a, collapsed: _ === p, onCollapse: () => m(_) }, u.title))
133
133
  ] })
134
134
  ] });
135
- }, ue = "_top-bar_j4je9_1", pe = "_top-bar-brand_j4je9_12", I = {
136
- "top-bar": "_top-bar_j4je9_1",
135
+ }, ue = "_top-bar_4di1c_1", pe = "_top-bar-brand_4di1c_13", I = {
136
+ "top-bar": "_top-bar_4di1c_1",
137
137
  topBar: ue,
138
- "top-bar-brand": "_top-bar-brand_j4je9_12",
138
+ "top-bar-brand": "_top-bar-brand_4di1c_13",
139
139
  topBarBrand: pe
140
- }, we = ({ appName: n, sideMenuExpanded: s, children: t }) => {
140
+ }, we = ({ appName: s, leftOffset: e, children: t }) => {
141
141
  const { LinkComponent: a } = g(M);
142
- return /* @__PURE__ */ e.jsxs("nav", { className: o("shadow luminus-top-bar", I.topBar, {
143
- "topbar-expand": s
144
- }), children: [
145
- /* @__PURE__ */ e.jsx(a, { to: "/", className: o("luminus-top-bar-brand", I.topBarBrand), children: n }),
146
- /* @__PURE__ */ e.jsx("div", { className: "w-100 d-flex justify-content-end align-items-center gap-2", children: t })
142
+ return /* @__PURE__ */ n.jsxs("nav", { className: o("shadow luminus-top-bar", I.topBar), style: {
143
+ width: e ? `calc(100% - ${e}px)` : void 0,
144
+ left: e ? `${e}px` : void 0
145
+ }, children: [
146
+ /* @__PURE__ */ n.jsx(a, { to: "/", className: o("luminus-top-bar-brand", I.topBarBrand), children: s }),
147
+ /* @__PURE__ */ n.jsx("div", { className: "w-100 d-flex justify-content-end align-items-center gap-2", children: t })
147
148
  ] });
148
149
  }, _e = "_side-content-bar_17kwd_1", me = {
149
150
  "side-content-bar": "_side-content-bar_17kwd_1",
150
151
  sideContentBar: _e
151
- }, xe = ({ width: n, children: s }) => /* @__PURE__ */ e.jsx("section", { className: o("shadow luminus-side-content-bar", me.sideContentBar), style: {
152
- width: `${n}px`
153
- }, children: s }), Be = ({ children: n, sideContent: s }) => /* @__PURE__ */ e.jsxs("div", { className: "container-fluid p-3", children: [
154
- /* @__PURE__ */ e.jsx("div", { style: { paddingRight: s ? "250px" : void 0 }, children: n }),
155
- s && /* @__PURE__ */ e.jsx(xe, { width: 250, children: s })
152
+ }, xe = ({ width: s, children: e }) => /* @__PURE__ */ n.jsx("section", { className: o("shadow luminus-side-content-bar", me.sideContentBar), style: {
153
+ width: `${s}px`
154
+ }, children: e }), Be = ({ children: s, sideContent: e }) => /* @__PURE__ */ n.jsxs("div", { className: "container-fluid p-3", children: [
155
+ /* @__PURE__ */ n.jsx("div", { style: { paddingRight: e ? "250px" : void 0 }, children: s }),
156
+ e && /* @__PURE__ */ n.jsx(xe, { width: 250, children: e })
156
157
  ] }), he = "_full-screen-container_1c9bu_1", je = {
157
158
  "full-screen-container": "_full-screen-container_1c9bu_1",
158
159
  fullScreenContainer: he
159
- }, Ie = ({ children: n }) => /* @__PURE__ */ e.jsx("div", { className: o("container-fluid p-3 overflow-hidden luminus-full-screen-container", je.fullScreenContainer), children: n });
160
+ }, Ie = ({ children: s }) => /* @__PURE__ */ n.jsx("div", { className: o("container-fluid p-3 overflow-hidden luminus-full-screen-container", je.fullScreenContainer), children: s });
160
161
  export {
161
162
  Ie as FullScreenContainer,
162
163
  Be as MainContainer,
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- ._loading_14qfh_1{position:fixed;display:flex;align-items:center;justify-content:center;height:100vh;width:100vw;gap:8px}._loading_14qfh_1 ._spinner-grow_14qfh_10{width:40px;height:40px}._loading_14qfh_1 ._spinner-grow_14qfh_10._second_14qfh_14{animation-delay:.1s}._loading_14qfh_1 ._spinner-grow_14qfh_10._third_14qfh_17{animation-delay:.2s}._h1_8gr7h_1{font-size:32px;font-weight:400;margin:0;padding:0}._h3_8gr7h_8{font-size:24px;font-weight:400;margin:0;padding:0}._h6_8gr7h_15{font-size:20px;font-weight:400;margin:0;padding:0}._subtitle_8gr7h_22,._body_8gr7h_29{font-size:16px;font-weight:400;margin:0;padding:0}._body2_8gr7h_36{font-size:14px;font-weight:400;margin:0;padding:0}._caption_8gr7h_43{font-size:12px;font-weight:400;margin:0;padding:0}._widget_1sdw8_1{height:320px;display:flex;justify-content:center;align-items:center}._dashboard_1ikl9_1 ._widgets-grid_1ikl9_1{display:grid;grid-template-columns:repeat(2,1fr);column-gap:16px;row-gap:16px}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7{position:relative;height:320px;width:100%}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7._full-width_1ikl9_12{grid-column:span 2}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7._widget-edit_1ikl9_15{border:2px dashed gray}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._remove-icon_1ikl9_18{z-index:2;position:absolute;right:-16px;top:-16px;background-color:#fff}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._full-width-icon_1ikl9_25{z-index:2;position:absolute;right:-16px;top:calc(50% - 15px);background-color:#fff}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._full-width-icon_1ikl9_25 svg{rotate:90deg}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._widget-edit-overlay_1ikl9_35{position:absolute;left:0;top:0;height:100%;width:100%;background-color:#80808080;opacity:.6}._side-menu-item_8j1cd_1{width:100%}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4{width:100%;display:flex;align-items:center;justify-content:center;padding:8px 16px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4._child_8j1cd_11{padding:4px 8px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4._child_8j1cd_11 ._text_8j1cd_14{font-size:14px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._icon_8j1cd_17{display:flex;justify-content:center;align-items:center;font-size:22px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._collapse-icon_8j1cd_23{width:100%;display:flex;justify-content:end;align-items:center;font-size:20px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._collapse-icon_8j1cd_23 svg{transition:.2s ease}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._collapse-icon_8j1cd_23._collapsed_8j1cd_33 svg{rotate:180deg}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._text_8j1cd_14{font-size:16px;margin-left:32px}._side-menu-item_8j1cd_1._expanded_8j1cd_40 ._nav-button_8j1cd_4,._side-menu-item_8j1cd_1._expanded_8j1cd_40 ._nav-button_8j1cd_4 ._icon_8j1cd_17{justify-content:flex-start}._side-menu_s0700_1{position:fixed;top:0;left:0;height:100%;background-color:#fff;transition:.3s ease;overflow-x:hidden;scrollbar-width:none}._side-menu_s0700_1::state(webkit-scrollbar){display:none}._side-menu_s0700_1 ._sidebar-header_s0700_14{display:flex;justify-content:center;align-items:center}._side-menu_s0700_1 ._side-menu-content_s0700_19{margin-top:8px;padding:0}._side-menu_s0700_1._expand_s0700_23 ._sidebar-header_s0700_14{padding:0 12px;justify-content:start}._top-bar_j4je9_1{padding:0 24px;border-left:16px solid transparent;display:flex;align-items:center;grid-gap:24px;position:sticky;top:0;left:0;transition:.3s ease}._top-bar_j4je9_1 ._top-bar-brand_j4je9_12{text-decoration:none;font-size:20px}._side-content-bar_17kwd_1{position:fixed;top:0;right:0;height:100%;background-color:#fff;overflow-x:hidden;scrollbar-width:none}._side-content-bar_17kwd_1::state(webkit-scrollbar){display:none}._full-screen-container_1c9bu_1{width:100%;display:flex;flex-direction:column}.luminus-input-remove-icon{position:absolute;top:0;right:16px;height:100%;display:flex;align-items:center;justify-content:center}.luminus-input-remove-icon.inset{right:40px}.luminus-input-remove-icon .icon-button{padding:0;margin:0;font-size:16px;height:20px;width:20px;display:flex;align-items:center}._avatar-icon_1axl6_1{height:36px;width:36px;display:flex;align-items:center;justify-content:center;border-radius:100%;color:#fff;font-size:16px}._modal_18hh3_1 ._modal-content_18hh3_1{height:100%;max-height:90vh}._modal_18hh3_1 ._modal-body_18hh3_5{height:100%;display:flex;flex-direction:column;overflow:hidden}._form-submit_1wjhr_1{position:fixed;width:160px;bottom:40px;left:calc(50% - 80px)}
1
+ ._loading_14qfh_1{position:fixed;display:flex;align-items:center;justify-content:center;height:100vh;width:100vw;gap:8px}._loading_14qfh_1 ._spinner-grow_14qfh_10{width:40px;height:40px}._loading_14qfh_1 ._spinner-grow_14qfh_10._second_14qfh_14{animation-delay:.1s}._loading_14qfh_1 ._spinner-grow_14qfh_10._third_14qfh_17{animation-delay:.2s}._h1_8gr7h_1{font-size:32px;font-weight:400;margin:0;padding:0}._h3_8gr7h_8{font-size:24px;font-weight:400;margin:0;padding:0}._h6_8gr7h_15{font-size:20px;font-weight:400;margin:0;padding:0}._subtitle_8gr7h_22,._body_8gr7h_29{font-size:16px;font-weight:400;margin:0;padding:0}._body2_8gr7h_36{font-size:14px;font-weight:400;margin:0;padding:0}._caption_8gr7h_43{font-size:12px;font-weight:400;margin:0;padding:0}._widget_1sdw8_1{height:320px;display:flex;justify-content:center;align-items:center}._dashboard_1ikl9_1 ._widgets-grid_1ikl9_1{display:grid;grid-template-columns:repeat(2,1fr);column-gap:16px;row-gap:16px}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7{position:relative;height:320px;width:100%}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7._full-width_1ikl9_12{grid-column:span 2}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7._widget-edit_1ikl9_15{border:2px dashed gray}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._remove-icon_1ikl9_18{z-index:2;position:absolute;right:-16px;top:-16px;background-color:#fff}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._full-width-icon_1ikl9_25{z-index:2;position:absolute;right:-16px;top:calc(50% - 15px);background-color:#fff}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._full-width-icon_1ikl9_25 svg{rotate:90deg}._dashboard_1ikl9_1 ._widget-wrapper_1ikl9_7 ._widget-edit-overlay_1ikl9_35{position:absolute;left:0;top:0;height:100%;width:100%;background-color:#80808080;opacity:.6}._side-menu-item_8j1cd_1{width:100%}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4{width:100%;display:flex;align-items:center;justify-content:center;padding:8px 16px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4._child_8j1cd_11{padding:4px 8px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4._child_8j1cd_11 ._text_8j1cd_14{font-size:14px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._icon_8j1cd_17{display:flex;justify-content:center;align-items:center;font-size:22px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._collapse-icon_8j1cd_23{width:100%;display:flex;justify-content:end;align-items:center;font-size:20px}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._collapse-icon_8j1cd_23 svg{transition:.2s ease}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._collapse-icon_8j1cd_23._collapsed_8j1cd_33 svg{rotate:180deg}._side-menu-item_8j1cd_1 ._nav-button_8j1cd_4 ._text_8j1cd_14{font-size:16px;margin-left:32px}._side-menu-item_8j1cd_1._expanded_8j1cd_40 ._nav-button_8j1cd_4,._side-menu-item_8j1cd_1._expanded_8j1cd_40 ._nav-button_8j1cd_4 ._icon_8j1cd_17{justify-content:flex-start}._side-menu_s0700_1{position:fixed;top:0;left:0;height:100%;background-color:#fff;transition:.3s ease;overflow-x:hidden;scrollbar-width:none}._side-menu_s0700_1::state(webkit-scrollbar){display:none}._side-menu_s0700_1 ._sidebar-header_s0700_14{display:flex;justify-content:center;align-items:center}._side-menu_s0700_1 ._side-menu-content_s0700_19{margin-top:8px;padding:0}._side-menu_s0700_1._expand_s0700_23 ._sidebar-header_s0700_14{padding:0 12px;justify-content:start}._top-bar_4di1c_1{padding:0 24px;border-left:16px solid transparent;display:flex;align-items:center;grid-gap:24px;position:fixed;top:0;left:0;width:100%;transition:.3s ease}._top-bar_4di1c_1 ._top-bar-brand_4di1c_13{text-decoration:none;font-size:20px}._side-content-bar_17kwd_1{position:fixed;top:0;right:0;height:100%;background-color:#fff;overflow-x:hidden;scrollbar-width:none}._side-content-bar_17kwd_1::state(webkit-scrollbar){display:none}._full-screen-container_1c9bu_1{width:100%;display:flex;flex-direction:column}.luminus-input-remove-icon{position:absolute;top:0;right:16px;height:100%;display:flex;align-items:center;justify-content:center}.luminus-input-remove-icon.inset{right:40px}.luminus-input-remove-icon .icon-button{padding:0;margin:0;font-size:16px;height:20px;width:20px;display:flex;align-items:center}._avatar-icon_1axl6_1{height:36px;width:36px;display:flex;align-items:center;justify-content:center;border-radius:100%;color:#fff;font-size:16px}._modal_18hh3_1 ._modal-content_18hh3_1{height:100%;max-height:90vh}._modal_18hh3_1 ._modal-body_18hh3_5{height:100%;display:flex;flex-direction:column;overflow:hidden}._form-submit_1wjhr_1{position:fixed;width:160px;bottom:40px;left:calc(50% - 80px)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-luminus-components",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
5
5
  "repository": {
6
6
  "type": "git",