lecom-ui 3.5.0 → 3.6.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,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { i18n } from '../../i18n/index.js';
|
|
2
|
+
import { withTranslation } from 'react-i18next';
|
|
4
3
|
import { getCookie } from '../../utils/cookie.js';
|
|
5
4
|
import '../CustomIcon/Icons/CadastroFacil.js';
|
|
6
5
|
import '../CustomIcon/Icons/LogoLecom.js';
|
|
@@ -11,8 +10,7 @@ import { Header } from '../Header/Header.js';
|
|
|
11
10
|
import { SidebarProvider, Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarFooter } from '../Sidebar/Sidebar.js';
|
|
12
11
|
import { Typography } from '../Typography/Typography.js';
|
|
13
12
|
|
|
14
|
-
const
|
|
15
|
-
const { t } = useTranslation();
|
|
13
|
+
const LayoutTeste = ({ children, header, sideBar, t }) => {
|
|
16
14
|
const { items, info } = sideBar;
|
|
17
15
|
const sidebarState = getCookie("sidebar:state") === "true";
|
|
18
16
|
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(
|
|
@@ -23,7 +21,7 @@ const Layout = ({ children, header, sideBar }) => {
|
|
|
23
21
|
isActive: !!item.isActive
|
|
24
22
|
},
|
|
25
23
|
item.url ? /* @__PURE__ */ React.createElement("a", { href: item.url }, item.icon, /* @__PURE__ */ React.createElement("span", null, item.title)) : /* @__PURE__ */ React.createElement("div", { onClick: item.onClick }, item.icon, /* @__PURE__ */ React.createElement("span", null, item.title))
|
|
26
|
-
))))))), /* @__PURE__ */ React.createElement(SidebarFooter, { className: "p-6 pt-0 gap-1" }, /* @__PURE__ */ React.createElement(
|
|
24
|
+
))))))), /* @__PURE__ */ React.createElement(SidebarFooter, { className: "p-6 pt-0 gap-1" }, /* @__PURE__ */ React.createElement(
|
|
27
25
|
Typography,
|
|
28
26
|
{
|
|
29
27
|
variant: "heading-xsmall-600",
|
|
@@ -33,8 +31,9 @@ const Layout = ({ children, header, sideBar }) => {
|
|
|
33
31
|
t("sidebar.platform"),
|
|
34
32
|
" ",
|
|
35
33
|
/* @__PURE__ */ React.createElement(LogoLecomBrand, { className: "w-16 shrink-0" })
|
|
36
|
-
)
|
|
34
|
+
), /* @__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)));
|
|
37
35
|
};
|
|
38
|
-
|
|
36
|
+
LayoutTeste.displayName = "Layout";
|
|
37
|
+
const Layout = withTranslation()(LayoutTeste);
|
|
39
38
|
|
|
40
39
|
export { Layout };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
|
6
6
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
7
7
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
8
8
|
import { CustomStyles as CustomStyles$2 } from '@/components/Button';
|
|
9
|
+
import * as node_modules_react_i18next_helpers from 'node_modules/react-i18next/helpers';
|
|
10
|
+
import * as react_i18next from 'react-i18next';
|
|
9
11
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
10
12
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
11
13
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
@@ -385,11 +387,9 @@ interface SideBarProps {
|
|
|
385
387
|
interface LayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
386
388
|
header: HeaderProps;
|
|
387
389
|
sideBar: SideBarProps;
|
|
390
|
+
t: any;
|
|
388
391
|
}
|
|
389
|
-
declare const Layout:
|
|
390
|
-
({ children, header, sideBar }: LayoutProps): React.JSX.Element;
|
|
391
|
-
displayName: string;
|
|
392
|
-
};
|
|
392
|
+
declare const Layout: React.ComponentType<Omit<node_modules_react_i18next_helpers.$Subtract<LayoutProps, react_i18next.WithTranslationProps>, keyof react_i18next.WithTranslation<Ns, undefined>> & react_i18next.WithTranslationProps>;
|
|
393
393
|
|
|
394
394
|
declare enum TypeMessageNotification {
|
|
395
395
|
SUCCESS = "success",
|