lecom-ui 4.0.0 → 4.0.1

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,9 +6,8 @@ import { ScrollArea } from '../ScrollArea/ScrollArea.js';
6
6
  import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../Select/Select.js';
7
7
  import { useIsMobile } from '../../hooks/useIsMobile.js';
8
8
  import { User } from 'lucide-react';
9
- import '../../i18n/index.js';
10
- import { Tooltip, TooltipTrigger, TooltipPortal, TooltipContent } from '../Tooltip/Tooltip.js';
11
9
  import i18n from 'i18next';
10
+ import { Tooltip, TooltipTrigger, TooltipPortal, TooltipContent } from '../Tooltip/Tooltip.js';
12
11
 
13
12
  const UserMenu = ({
14
13
  customStyles,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { I18nextProvider } from 'react-i18next';
3
- import '../../i18n/index.js';
3
+ import i18n from 'i18next';
4
4
  import { getCookie } from '../../utils/cookie.js';
5
5
  import '../CustomIcon/Icons/CadastroFacil.js';
6
6
  import '../CustomIcon/Icons/LogoLecom.js';
@@ -10,7 +10,6 @@ import { LogoLecomBrand } from '../CustomIcon/Icons/LogoLecomBrand.js';
10
10
  import { Header } from '../Header/Header.js';
11
11
  import { SidebarProvider, Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarFooter } from '../Sidebar/Sidebar.js';
12
12
  import { Typography } from '../Typography/Typography.js';
13
- import i18n from 'i18next';
14
13
 
15
14
  const Layout = ({ children, header, sideBar }) => {
16
15
  const { items, info } = sideBar;
@@ -3,10 +3,11 @@ import { useTranslation } from 'react-i18next';
3
3
  import { Button } from '../Button/Button.js';
4
4
  import { cn } from '../../lib/utils.js';
5
5
  import { ChevronFirst, ChevronLast, ChevronLeft, ChevronRight, MoreHorizontal, ChevronDown } from 'lucide-react';
6
- import '../../i18n/index.js';
6
+ import { initializeI18n } from '../../i18n/index.js';
7
7
  import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '../DropdownMenu/DropdownMenu.js';
8
8
  import { Typography } from '../Typography/Typography.js';
9
9
 
10
+ initializeI18n();
10
11
  const PaginationContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
11
12
  "ul",
12
13
  {
@@ -19,13 +19,8 @@ const i18nConfig = {
19
19
  escapeValue: false
20
20
  }
21
21
  };
22
- if (!i18n.isInitialized) {
23
- i18n.use(initReactI18next).init(i18nConfig);
24
- }
25
- const initializeI18n = ({
26
- resources,
27
- lng = "pt_BR" /* PT_BR */
28
- }) => {
22
+ const initializeI18n = (options) => {
23
+ const { resources, lng } = options || {};
29
24
  const mappedResources = {
30
25
  resources: {
31
26
  ["pt_BR" /* PT_BR */]: {
@@ -48,7 +43,7 @@ const initializeI18n = ({
48
43
  }
49
44
  }
50
45
  };
51
- console.log(i18nConfig, mappedResources, resources);
46
+ console.log("i18n.isInitialized", i18n.isInitialized);
52
47
  i18n.use(initReactI18next).init({ ...i18nConfig, ...mappedResources, lng });
53
48
  };
54
49
 
package/dist/index.d.ts CHANGED
@@ -270,19 +270,6 @@ declare const usePagination: ({ count, defaultPage, boundaryCount, siblingCount,
270
270
  items: UsePaginationItem[];
271
271
  };
272
272
 
273
- declare enum Translations {
274
- PT_BR = "pt_BR",
275
- EN_US = "en_US",
276
- ES_ES = "es_ES"
277
- }
278
- interface InitializeI18n {
279
- resources?: {
280
- [key in Translations]: InitOptions['resources'];
281
- };
282
- lng?: Translations;
283
- }
284
- declare const initializeI18n: ({ resources, lng, }: InitializeI18n) => void;
285
-
286
273
  type PaginationButtonProps = {
287
274
  className?: string;
288
275
  disabled?: boolean;
@@ -668,6 +655,19 @@ declare function useSidebar(): SidebarContext;
668
655
 
669
656
  declare function useIsMobile(): boolean;
670
657
 
658
+ declare enum Translations {
659
+ PT_BR = "pt_BR",
660
+ EN_US = "en_US",
661
+ ES_ES = "es_ES"
662
+ }
663
+ interface InitializeI18n {
664
+ resources?: {
665
+ [key in Translations]: InitOptions['resources'];
666
+ };
667
+ lng?: Translations;
668
+ }
669
+ declare const initializeI18n: (options?: InitializeI18n) => void;
670
+
671
671
  type Fonts = 'roboto' | 'montserrat' | 'ibm';
672
672
  declare const fonts: {
673
673
  roboto: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",