lecom-ui 3.4.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.
|
@@ -6,7 +6,7 @@ import { ScrollArea } from '../ScrollArea/ScrollArea.js';
|
|
|
6
6
|
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../Select/Select.js';
|
|
7
7
|
import { useIsMobile } from '../../hooks/use-mobile.js';
|
|
8
8
|
import { User } from 'lucide-react';
|
|
9
|
-
import i18n from '../../i18n/index.js';
|
|
9
|
+
import { i18n } from '../../i18n/index.js';
|
|
10
10
|
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
|
|
11
11
|
|
|
12
12
|
const UserMenu = ({
|
|
@@ -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,11 +10,10 @@ 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
|
-
return /* @__PURE__ */ React.createElement(SidebarProvider, { className: "flex-col", defaultOpen: sidebarState }, /* @__PURE__ */ React.createElement(
|
|
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(
|
|
19
17
|
SidebarMenuButton,
|
|
20
18
|
{
|
|
21
19
|
asChild: true,
|
|
@@ -35,6 +33,7 @@ const Layout = ({ children, header, sideBar }) => {
|
|
|
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 };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { I18nextProvider } from 'react-i18next';
|
|
3
2
|
import { Button } from '../Button/Button.js';
|
|
4
3
|
import { Input } from '../Input/Input.js';
|
|
5
4
|
import { Separator } from '../Separator/Separator.js';
|
|
@@ -11,7 +10,6 @@ import { cn } from '../../lib/utils.js';
|
|
|
11
10
|
import { Slot } from '@radix-ui/react-slot';
|
|
12
11
|
import { cva } from 'class-variance-authority';
|
|
13
12
|
import { X, PanelLeft } from 'lucide-react';
|
|
14
|
-
import i18n from '../../i18n/index.js';
|
|
15
13
|
|
|
16
14
|
const SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
17
15
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -256,7 +254,7 @@ const SidebarHeader = React.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
256
254
|
}
|
|
257
255
|
));
|
|
258
256
|
SidebarHeader.displayName = "SidebarHeader";
|
|
259
|
-
const SidebarFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
257
|
+
const SidebarFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
260
258
|
"div",
|
|
261
259
|
{
|
|
262
260
|
ref,
|
|
@@ -267,7 +265,7 @@ const SidebarFooter = React.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
267
265
|
),
|
|
268
266
|
...props
|
|
269
267
|
}
|
|
270
|
-
))
|
|
268
|
+
));
|
|
271
269
|
SidebarFooter.displayName = "SidebarFooter";
|
|
272
270
|
const SidebarSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
273
271
|
Separator,
|
package/dist/i18n/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,13 @@ 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';
|
|
12
14
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
15
|
+
import * as node_modules_i18next from 'node_modules/i18next';
|
|
13
16
|
|
|
14
17
|
declare const accordionVariants: (props?: ({
|
|
15
18
|
variant?: "default" | null | undefined;
|
|
@@ -384,11 +387,9 @@ interface SideBarProps {
|
|
|
384
387
|
interface LayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
385
388
|
header: HeaderProps;
|
|
386
389
|
sideBar: SideBarProps;
|
|
390
|
+
t: any;
|
|
387
391
|
}
|
|
388
|
-
declare const Layout:
|
|
389
|
-
({ children, header, sideBar }: LayoutProps): React.JSX.Element;
|
|
390
|
-
displayName: string;
|
|
391
|
-
};
|
|
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>;
|
|
392
393
|
|
|
393
394
|
declare enum TypeMessageNotification {
|
|
394
395
|
SUCCESS = "success",
|
|
@@ -608,6 +609,7 @@ declare enum Translations {
|
|
|
608
609
|
EN_US = "en_US",
|
|
609
610
|
ES_ES = "es_ES"
|
|
610
611
|
}
|
|
612
|
+
declare const i18n: node_modules_i18next.i18n;
|
|
611
613
|
|
|
612
614
|
type Fonts = 'roboto' | 'montserrat' | 'ibm';
|
|
613
615
|
declare const fonts: {
|
|
@@ -616,4 +618,4 @@ declare const fonts: {
|
|
|
616
618
|
ibm: string[];
|
|
617
619
|
};
|
|
618
620
|
|
|
619
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, type BgColor, Button, type ButtonProps, CadastroFacil, type CadastroFacilProps, type CalloutNotificationProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, type Color, type ColorToken, type CustomStyles$1 as CustomStyles, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type FillColor, type Fonts, type HeaderProps, type InlineNotificationProps, Layout, type LayoutProps, LogoLecom, LogoLecomBrand, type LogoLecomBrandProps, type LogoLecomProps, ModoTeste, type ModoTesteProps, Notification, type NotificationProps, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationIndex, PaginationItem, PaginationLast, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Rpa, type RpaProps, ScrollArea, ScrollBar, type SideBarProps, Skeleton, Spin, type SpinProps, Switch, TOAST_REMOVE_DELAY, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRowBody, TableRowHeader, Tag, type TagProps, type TextColor, type ToastNotificationProps, type ToasterToast, Tooltip, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, Translations, TypeMessageNotification, Typography, type TypographyProps, accordionVariants, buttonVariants, colors, fonts, getPositionClass, notificationVariants, reducer, tagVariants, toast, typographyVariants, useNotificationToast, useSidebar };
|
|
621
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, type BgColor, Button, type ButtonProps, CadastroFacil, type CadastroFacilProps, type CalloutNotificationProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, type Color, type ColorToken, type CustomStyles$1 as CustomStyles, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type FillColor, type Fonts, type HeaderProps, type InlineNotificationProps, Layout, type LayoutProps, LogoLecom, LogoLecomBrand, type LogoLecomBrandProps, type LogoLecomProps, ModoTeste, type ModoTesteProps, Notification, type NotificationProps, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationIndex, PaginationItem, PaginationLast, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Rpa, type RpaProps, ScrollArea, ScrollBar, type SideBarProps, Skeleton, Spin, type SpinProps, Switch, TOAST_REMOVE_DELAY, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRowBody, TableRowHeader, Tag, type TagProps, type TextColor, type ToastNotificationProps, type ToasterToast, Tooltip, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, Translations, TypeMessageNotification, Typography, type TypographyProps, accordionVariants, buttonVariants, colors, fonts, getPositionClass, i18n, notificationVariants, reducer, tagVariants, toast, typographyVariants, useNotificationToast, useSidebar };
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,6 @@ export { Typography, typographyVariants } from './components/Typography/Typograp
|
|
|
23
23
|
export { ScrollArea, ScrollBar } from './components/ScrollArea/ScrollArea.js';
|
|
24
24
|
export { Spin } from './components/Spin/Spin.js';
|
|
25
25
|
export { useSidebar } from './components/Sidebar/Sidebar.js';
|
|
26
|
-
export { Translations } from './i18n/index.js';
|
|
26
|
+
export { Translations, i18n } from './i18n/index.js';
|
|
27
27
|
export { colors } from './tokens/colors.js';
|
|
28
28
|
export { fonts } from './tokens/fonts.js';
|