lecom-ui 5.4.56 → 5.4.57

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
@@ -1 +1 @@
1
- lecom-ui
1
+ lecom-ui
@@ -63,16 +63,24 @@ const Header = ({
63
63
  ...props
64
64
  },
65
65
  /* @__PURE__ */ React.createElement(Tooltip, { delayDuration: 0 }, /* @__PURE__ */ React.createElement(TooltipTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(
66
- Menu,
66
+ "button",
67
67
  {
68
- className: "text-white transition-all duration-300 hover:cursor-pointer hover:opacity-70 shrink-0",
69
- size: 32,
68
+ type: "button",
69
+ className: "appearance-none border-none bg-transparent p-0 transition-all duration-300 hover:cursor-pointer hover:opacity-70 focus-visible:opacity-70 shrink-0",
70
70
  onClick: () => {
71
71
  onOpenMenuChange?.();
72
72
  toggleSidebar();
73
73
  },
74
- style: { color: customStyles.textColor }
75
- }
74
+ "aria-label": open ? t("header.collapseMenu") : t("header.expandMenu")
75
+ },
76
+ /* @__PURE__ */ React.createElement(
77
+ Menu,
78
+ {
79
+ className: "text-white",
80
+ size: 32,
81
+ style: { color: customStyles.textColor }
82
+ }
83
+ )
76
84
  )), /* @__PURE__ */ React.createElement(TooltipContent, { color: "black", align: "start", side: "bottom" }, open ? t("header.collapseMenu") : t("header.expandMenu"))),
77
85
  /* @__PURE__ */ React.createElement("div", { className: "flex items-center grow gap-[100px]" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-12" }, /* @__PURE__ */ React.createElement(ImgBrand, { src: customImgSrc }), module && /* @__PURE__ */ React.createElement(
78
86
  Typography,
@@ -24,11 +24,13 @@ const Item = ({
24
24
  onClick?.();
25
25
  };
26
26
  return /* @__PURE__ */ React.createElement(
27
- "div",
27
+ "button",
28
28
  {
29
+ type: "button",
29
30
  onClick: handleClickItem,
31
+ disabled,
30
32
  className: cn(
31
- "flex gap-4 items-center justify-center p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300",
33
+ "flex gap-4 items-center justify-center p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300 w-full text-left appearance-none border-none bg-transparent focus:outline-none focus-visible:bg-grey-200/70",
32
34
  !!disabled && "opacity-50 hover:cursor-not-allowed"
33
35
  )
34
36
  },
@@ -72,14 +74,11 @@ const HelpMenu = ({
72
74
  {
73
75
  side: "bottom",
74
76
  align: "end",
75
- className: "w-[200x] p-2",
76
- sideOffset: 16,
77
- onOpenAutoFocus: (e) => {
78
- e.preventDefault();
79
- }
77
+ className: "w-[200x] pl-2 pt-2 pb-2 pr-0",
78
+ sideOffset: 16
80
79
  },
81
80
  title && /* @__PURE__ */ React.createElement("span", { className: "body-large-400 p-2 block" }, title),
82
- /* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight } }, items?.map((item, i) => /* @__PURE__ */ React.createElement(Item, { key: i, ...item })))
81
+ /* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight }, className: "pr-2" }, items?.map((item, i) => /* @__PURE__ */ React.createElement(Item, { key: i, ...item })))
83
82
  ));
84
83
  };
85
84
  HelpMenu.displayName = "HelpMenu";
@@ -1,6 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Button } from '../Button/Button.js';
4
+ import { Popover, PopoverContent, PopoverTrigger } from '../Popover/Popover.js';
5
+ import { ScrollArea } from '../ScrollArea/ScrollArea.js';
4
6
  import { LogoLecom } from '../../icons/Brand/LogoLecom.js';
5
7
  import '../../icons/Brand/LogoLecomBrand.js';
6
8
  import '../../icons/Brand/FooterInfo.js';
@@ -9,8 +11,6 @@ import '../../icons/Features/CadastroFacil.js';
9
11
  import '../../icons/Features/Rpa.js';
10
12
  import '../../icons/Features/ModoTeste.js';
11
13
  import '../../icons/UI/NewUpdate.js';
12
- import { Popover, PopoverContent, PopoverTrigger } from '../Popover/Popover.js';
13
- import { ScrollArea } from '../ScrollArea/ScrollArea.js';
14
14
  import { cn } from '../../lib/utils.js';
15
15
  import { Tooltip, TooltipTrigger, TooltipPortal, TooltipContent } from '../Tooltip/Tooltip.js';
16
16
 
@@ -23,7 +23,7 @@ const Icon = ({
23
23
  if (!icon) {
24
24
  return null;
25
25
  }
26
- const containerIconStyles = !containerIconBgColor ? { style: { backgroundColor: bgColor, color: textColor } } : {};
26
+ const containerIconStyles = containerIconBgColor ? {} : { style: { backgroundColor: bgColor, color: textColor } };
27
27
  return /* @__PURE__ */ React.createElement(
28
28
  "div",
29
29
  {
@@ -66,11 +66,13 @@ const Item = ({
66
66
  return highlight;
67
67
  };
68
68
  return /* @__PURE__ */ React.createElement(
69
- "div",
69
+ "button",
70
70
  {
71
+ type: "button",
71
72
  onClick: handleClickItem,
73
+ disabled,
72
74
  className: cn(
73
- "flex gap-4 items-center p-2 rounded-md transition-all duration-300",
75
+ "flex gap-4 items-center p-2 rounded-md transition-all duration-300 w-full text-left appearance-none border-none bg-transparent focus:outline-none focus-visible:bg-grey-200/70",
74
76
  !disabled && !noHover && "hover:bg-grey-200/70 hover:cursor-pointer",
75
77
  (disabled || noHover) && "cursor-default",
76
78
  disabled && "opacity-50 cursor-not-allowed"
@@ -116,14 +118,11 @@ const ModulesMenu = ({
116
118
  {
117
119
  side: "bottom",
118
120
  align: "end",
119
- className: "w-[424px] p-2 max-md:w-full",
120
- sideOffset: 16,
121
- onOpenAutoFocus: (e) => {
122
- e.preventDefault();
123
- }
121
+ className: "w-[424px] pl-2 pt-2 pb-2 pr-0 max-md:w-full",
122
+ sideOffset: 16
124
123
  },
125
124
  title && /* @__PURE__ */ React.createElement("span", { className: "body-large-400 p-2 block" }, title),
126
- /* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight } }, items?.map((item, i) => /* @__PURE__ */ React.createElement(
125
+ /* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight }, className: "pr-2" }, items?.map((item, i) => /* @__PURE__ */ React.createElement(
127
126
  Item,
128
127
  {
129
128
  key: i,
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Button } from '../Button/Button.js';
4
+ import { Combobox } from '../Combobox/Combobox.js';
4
5
  import { Popover, PopoverContent, PopoverTrigger } from '../Popover/Popover.js';
5
6
  import { ScrollArea } from '../ScrollArea/ScrollArea.js';
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
9
  import i18n from 'i18next';
@@ -27,17 +27,25 @@ const UserMenu = ({
27
27
  return language.render;
28
28
  }
29
29
  const handleValueChange = (value) => {
30
- i18n.changeLanguage(value);
31
- language.select?.onChange?.(value);
30
+ if (value) {
31
+ i18n.changeLanguage(value);
32
+ language.select?.onChange?.(value);
33
+ }
32
34
  };
33
- return /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4 p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-center gap-2 body-large-400 [&>svg]:!w-5 [&>svg]:!h-5" }, language.icon, language.label), /* @__PURE__ */ React.createElement(
34
- Select,
35
+ const comboboxOptions = language.select?.options.map((option) => ({
36
+ label: option.name,
37
+ value: option.id
38
+ })) ?? [];
39
+ return /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4 p-2 rounded-md transition-all duration-300" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-center gap-2 body-large-400 [&>svg]:!w-5 [&>svg]:!h-5" }, language.icon, language.label), /* @__PURE__ */ React.createElement(
40
+ Combobox,
35
41
  {
36
- value: language.select?.value,
37
- onValueChange: handleValueChange
38
- },
39
- /* @__PURE__ */ React.createElement(SelectTrigger, { className: "h-7" }, /* @__PURE__ */ React.createElement(SelectValue, null)),
40
- /* @__PURE__ */ React.createElement(SelectContent, null, language.select?.options.map((option) => /* @__PURE__ */ React.createElement(SelectItem, { key: option.id, value: option.id }, option.name)))
42
+ options: comboboxOptions,
43
+ value: language.select?.value ?? null,
44
+ onChange: handleValueChange,
45
+ showSearch: false,
46
+ size: "small",
47
+ dynamicHeight: false
48
+ }
41
49
  ));
42
50
  };
43
51
  const renderLogout = () => {
@@ -48,9 +56,10 @@ const UserMenu = ({
48
56
  return logout.render;
49
57
  }
50
58
  return /* @__PURE__ */ React.createElement(
51
- "div",
59
+ "button",
52
60
  {
53
- className: "flex items-center gap-2 body-large-400 p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300 [&>svg]:!w-5 [&>svg]:!h-5",
61
+ type: "button",
62
+ className: "flex items-center gap-2 body-large-400 p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300 [&>svg]:!w-5 [&>svg]:!h-5 w-full text-left appearance-none border-none bg-transparent focus:outline-none focus-visible:bg-grey-200/70",
54
63
  onClick: logout.onClick
55
64
  },
56
65
  logout.icon,
@@ -81,13 +90,10 @@ const UserMenu = ({
81
90
  {
82
91
  side: "bottom",
83
92
  align: "end",
84
- className: "w-[274px] p-2",
85
- sideOffset: 16,
86
- onOpenAutoFocus: (e) => {
87
- e.preventDefault();
88
- }
93
+ className: "w-[274px] pl-2 pt-2 pb-2 pr-0",
94
+ sideOffset: 16
89
95
  },
90
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 p-2" }, /* @__PURE__ */ React.createElement("div", { className: "bg-grey-400/30 rounded-full w-9 h-9 flex items-center justify-center [&>svg]:!w-6 [&>svg]:!h-6 shrink-0" }, /* @__PURE__ */ React.createElement(User, { className: "text-grey-600" })), /* @__PURE__ */ React.createElement("div", { className: "grow" }, /* @__PURE__ */ React.createElement("span", { className: "block body-large-400 break-words" }, user?.name), /* @__PURE__ */ React.createElement("span", { className: "block body-medium-400 break-all" }, user?.email))), /* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight } }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center" }, renderLanguage(), renderLogout())))
96
+ /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center pr-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 p-2" }, /* @__PURE__ */ React.createElement("div", { className: "bg-grey-400/30 rounded-full w-9 h-9 flex items-center justify-center [&>svg]:!w-6 [&>svg]:!h-6 shrink-0" }, /* @__PURE__ */ React.createElement(User, { className: "text-grey-600" })), /* @__PURE__ */ React.createElement("div", { className: "grow" }, /* @__PURE__ */ React.createElement("span", { className: "block body-large-400 break-words" }, user?.name), /* @__PURE__ */ React.createElement("span", { className: "block body-medium-400 break-all" }, user?.email))), /* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight }, className: "pr-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center" }, renderLanguage(), renderLogout())))
91
97
  ));
92
98
  };
93
99
  UserMenu.displayName = "UserMenu";
package/dist/index.d.ts CHANGED
@@ -1009,7 +1009,7 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
1009
1009
  declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
1010
1010
 
1011
1011
  declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
1012
- declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLHeadingElement | HTMLParagraphElement | HTMLLabelElement | HTMLInputElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
1012
+ declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLLabelElement | HTMLHeadingElement | HTMLParagraphElement | HTMLInputElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
1013
1013
  className?: string;
1014
1014
  collapsedSize?: number | undefined;
1015
1015
  collapsible?: boolean | undefined;
@@ -1,79 +1,79 @@
1
- const extend = {
2
- colors: {
3
- background: 'hsl(var(--background))',
4
- foreground: 'hsl(var(--foreground))',
5
- card: {
6
- DEFAULT: 'hsl(var(--card))',
7
- foreground: 'hsl(var(--card-foreground))',
8
- },
9
- popover: {
10
- DEFAULT: 'hsl(var(--popover))',
11
- foreground: 'hsl(var(--popover-foreground))',
12
- },
13
- primary: {
14
- DEFAULT: 'hsl(var(--primary))',
15
- foreground: 'hsl(var(--primary-foreground))',
16
- },
17
- secondary: {
18
- DEFAULT: 'hsl(var(--secondary))',
19
- foreground: 'hsl(var(--secondary-foreground))',
20
- },
21
- muted: {
22
- DEFAULT: 'hsl(var(--muted))',
23
- foreground: 'hsl(var(--muted-foreground))',
24
- },
25
- accent: {
26
- DEFAULT: 'hsl(var(--accent))',
27
- foreground: 'hsl(var(--accent-foreground))',
28
- },
29
- destructive: {
30
- DEFAULT: 'hsl(var(--destructive))',
31
- foreground: 'hsl(var(--destructive-foreground))',
32
- },
33
- border: 'hsl(var(--border))',
34
- input: 'hsl(var(--input))',
35
- ring: 'hsl(var(--ring))',
36
- chart: {
37
- 1: 'hsl(var(--chart-1))',
38
- 2: 'hsl(var(--chart-2))',
39
- 3: 'hsl(var(--chart-3))',
40
- 4: 'hsl(var(--chart-4))',
41
- 5: 'hsl(var(--chart-5))',
42
- 6: 'hsl(var(--chart-6))',
43
- 7: 'hsl(var(--chart-7))',
44
- 8: 'hsl(var(--chart-8))',
45
- },
46
- sidebar: {
47
- DEFAULT: 'hsl(var(--sidebar-background))',
48
- foreground: 'hsl(var(--sidebar-foreground))',
49
- primary: 'hsl(var(--sidebar-primary))',
50
- 'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
51
- accent: 'hsl(var(--sidebar-accent))',
52
- 'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
53
- border: 'hsl(var(--sidebar-border))',
54
- ring: 'hsl(var(--sidebar-ring))',
55
- },
56
- },
57
- borderRadius: {
58
- lg: 'var(--radius)',
59
- md: 'calc(var(--radius) - 2px)',
60
- sm: 'calc(var(--radius) - 4px)',
61
- },
62
- keyframes: {
63
- 'accordion-down': {
64
- from: { height: '0' },
65
- to: { height: 'var(--radix-accordion-content-height)' },
66
- },
67
- 'accordion-up': {
68
- from: { height: 'var(--radix-accordion-content-height)' },
69
- to: { height: '0' },
70
- },
71
- },
72
- animation: {
73
- 'accordion-down': 'accordion-down 0.2s ease-out',
74
- 'accordion-up': 'accordion-up 0.2s ease-out',
75
- 'spin-slow': 'spin 2s linear infinite',
76
- },
77
- };
78
-
79
- export { extend };
1
+ const extend = {
2
+ colors: {
3
+ background: 'hsl(var(--background))',
4
+ foreground: 'hsl(var(--foreground))',
5
+ card: {
6
+ DEFAULT: 'hsl(var(--card))',
7
+ foreground: 'hsl(var(--card-foreground))',
8
+ },
9
+ popover: {
10
+ DEFAULT: 'hsl(var(--popover))',
11
+ foreground: 'hsl(var(--popover-foreground))',
12
+ },
13
+ primary: {
14
+ DEFAULT: 'hsl(var(--primary))',
15
+ foreground: 'hsl(var(--primary-foreground))',
16
+ },
17
+ secondary: {
18
+ DEFAULT: 'hsl(var(--secondary))',
19
+ foreground: 'hsl(var(--secondary-foreground))',
20
+ },
21
+ muted: {
22
+ DEFAULT: 'hsl(var(--muted))',
23
+ foreground: 'hsl(var(--muted-foreground))',
24
+ },
25
+ accent: {
26
+ DEFAULT: 'hsl(var(--accent))',
27
+ foreground: 'hsl(var(--accent-foreground))',
28
+ },
29
+ destructive: {
30
+ DEFAULT: 'hsl(var(--destructive))',
31
+ foreground: 'hsl(var(--destructive-foreground))',
32
+ },
33
+ border: 'hsl(var(--border))',
34
+ input: 'hsl(var(--input))',
35
+ ring: 'hsl(var(--ring))',
36
+ chart: {
37
+ 1: 'hsl(var(--chart-1))',
38
+ 2: 'hsl(var(--chart-2))',
39
+ 3: 'hsl(var(--chart-3))',
40
+ 4: 'hsl(var(--chart-4))',
41
+ 5: 'hsl(var(--chart-5))',
42
+ 6: 'hsl(var(--chart-6))',
43
+ 7: 'hsl(var(--chart-7))',
44
+ 8: 'hsl(var(--chart-8))',
45
+ },
46
+ sidebar: {
47
+ DEFAULT: 'hsl(var(--sidebar-background))',
48
+ foreground: 'hsl(var(--sidebar-foreground))',
49
+ primary: 'hsl(var(--sidebar-primary))',
50
+ 'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
51
+ accent: 'hsl(var(--sidebar-accent))',
52
+ 'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
53
+ border: 'hsl(var(--sidebar-border))',
54
+ ring: 'hsl(var(--sidebar-ring))',
55
+ },
56
+ },
57
+ borderRadius: {
58
+ lg: 'var(--radius)',
59
+ md: 'calc(var(--radius) - 2px)',
60
+ sm: 'calc(var(--radius) - 4px)',
61
+ },
62
+ keyframes: {
63
+ 'accordion-down': {
64
+ from: { height: '0' },
65
+ to: { height: 'var(--radix-accordion-content-height)' },
66
+ },
67
+ 'accordion-up': {
68
+ from: { height: 'var(--radix-accordion-content-height)' },
69
+ to: { height: '0' },
70
+ },
71
+ },
72
+ animation: {
73
+ 'accordion-down': 'accordion-down 0.2s ease-out',
74
+ 'accordion-up': 'accordion-up 0.2s ease-out',
75
+ 'spin-slow': 'spin 2s linear infinite',
76
+ },
77
+ };
78
+
79
+ export { extend };