lecom-ui 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useTranslation
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Typography } from '../Typography/Typography.js';
|
|
4
4
|
import { cn } from '../../lib/utils.js';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
import { Menu } from 'lucide-react';
|
|
7
7
|
import { colorLuminance } from 'use-color-luminance';
|
|
8
|
-
import i18n from '../../i18n/index.js';
|
|
9
8
|
import { useSidebar } from '../Sidebar/Sidebar.js';
|
|
10
9
|
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
|
|
11
10
|
import { HelpMenu } from './HelpMenu.js';
|
|
@@ -55,7 +54,7 @@ const Header = ({
|
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
56
|
};
|
|
58
|
-
return /* @__PURE__ */ React.createElement(
|
|
57
|
+
return /* @__PURE__ */ React.createElement(
|
|
59
58
|
"header",
|
|
60
59
|
{
|
|
61
60
|
className: cn(headerVariants({ className }), ""),
|
|
@@ -88,7 +87,7 @@ const Header = ({
|
|
|
88
87
|
module
|
|
89
88
|
)), /* @__PURE__ */ React.createElement("div", { className: "max-md:hidden" }, extraContent && extraContent)),
|
|
90
89
|
/* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React.createElement(SocialMenu, { customStyles: getCustomStyles(), ...socialMenu }), /* @__PURE__ */ React.createElement(UserMenu, { customStyles: getCustomStyles(), ...userMenu }), /* @__PURE__ */ React.createElement(HelpMenu, { customStyles: getCustomStyles(), ...helpMenu }), /* @__PURE__ */ React.createElement(ModulesMenu, { customStyles: getCustomStyles(), ...modulesMenu }))
|
|
91
|
-
)
|
|
90
|
+
);
|
|
92
91
|
};
|
|
93
92
|
Header.displayName = "Header";
|
|
94
93
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
+
import { useTranslation, I18nextProvider } from 'react-i18next';
|
|
3
|
+
import i18n from '../../i18n/index.js';
|
|
3
4
|
import { getCookie } from '../../utils/cookie.js';
|
|
4
5
|
import '../CustomIcon/Icons/CadastroFacil.js';
|
|
5
6
|
import '../CustomIcon/Icons/LogoLecom.js';
|
|
@@ -14,7 +15,7 @@ const Layout = ({ children, header, sideBar }) => {
|
|
|
14
15
|
const { t } = useTranslation();
|
|
15
16
|
const { items, info } = sideBar;
|
|
16
17
|
const sidebarState = getCookie("sidebar:state") === "true";
|
|
17
|
-
return /* @__PURE__ */ React.createElement(SidebarProvider, { className: "flex-col", defaultOpen: sidebarState }, /* @__PURE__ */ React.createElement(Header, { ...header }), /* @__PURE__ */ React.createElement("div", { className: "flex grow" }, /* @__PURE__ */ React.createElement(Sidebar, { collapsible: "icon", variant: "sidebar" }, /* @__PURE__ */ React.createElement(SidebarContent, null, /* @__PURE__ */ React.createElement(SidebarGroup, null, /* @__PURE__ */ React.createElement(SidebarGroupContent, null, /* @__PURE__ */ React.createElement(SidebarMenu, null, items.map((item) => /* @__PURE__ */ React.createElement(SidebarMenuItem, { key: item.title }, /* @__PURE__ */ React.createElement(
|
|
18
|
+
return /* @__PURE__ */ React.createElement(SidebarProvider, { className: "flex-col", defaultOpen: sidebarState }, /* @__PURE__ */ React.createElement(I18nextProvider, { i18n }, /* @__PURE__ */ React.createElement(Header, { ...header })), /* @__PURE__ */ React.createElement("div", { className: "flex grow" }, /* @__PURE__ */ React.createElement(I18nextProvider, { i18n }, /* @__PURE__ */ React.createElement(Sidebar, { collapsible: "icon", variant: "sidebar" }, /* @__PURE__ */ React.createElement(SidebarContent, null, /* @__PURE__ */ React.createElement(SidebarGroup, null, /* @__PURE__ */ React.createElement(SidebarGroupContent, null, /* @__PURE__ */ React.createElement(SidebarMenu, null, items.map((item) => /* @__PURE__ */ React.createElement(SidebarMenuItem, { key: item.title }, /* @__PURE__ */ React.createElement(
|
|
18
19
|
SidebarMenuButton,
|
|
19
20
|
{
|
|
20
21
|
asChild: true,
|
|
@@ -32,7 +33,7 @@ const Layout = ({ children, header, sideBar }) => {
|
|
|
32
33
|
t("sidebar.platform"),
|
|
33
34
|
" ",
|
|
34
35
|
/* @__PURE__ */ React.createElement(LogoLecomBrand, { className: "w-16 shrink-0" })
|
|
35
|
-
), /* @__PURE__ */ React.createElement(Typography, { variant: "body-medium-400", textColor: "text-grey-800" }, t("sidebar.version"), " ", info.version, " - ", info.cycle, " ", info.build), /* @__PURE__ */ React.createElement(Typography, { variant: "body-medium-400", textColor: "text-grey-800" }, t("sidebar.authorizedFor"), " ", info.authorizedFor))), /* @__PURE__ */ React.createElement("main", { className: "grow w-full" }, children)));
|
|
36
|
+
), /* @__PURE__ */ React.createElement(Typography, { variant: "body-medium-400", textColor: "text-grey-800" }, t("sidebar.version"), " ", info.version, " - ", info.cycle, " ", info.build), /* @__PURE__ */ React.createElement(Typography, { variant: "body-medium-400", textColor: "text-grey-800" }, t("sidebar.authorizedFor"), " ", info.authorizedFor)))), /* @__PURE__ */ React.createElement("main", { className: "grow w-full" }, children)));
|
|
36
37
|
};
|
|
37
38
|
Layout.displayName = "Layout";
|
|
38
39
|
|