lecom-ui 2.0.0 → 2.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.
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { cn } from '../../lib/utils.js';
3
3
  import { cva } from 'class-variance-authority';
4
+ import { CustomButton } from './CustomButton.js';
4
5
 
5
6
  const buttonVariants = cva(
6
7
  "flex items-center justify-center gap-2 rounded-full font-roboto font-medium shadow-sm outline-none transition-all duration-300",
@@ -119,7 +120,30 @@ const buttonVariants = cva(
119
120
  }
120
121
  );
121
122
  const Button = React.forwardRef(
122
- ({ className, variant, size, color, iconButton, children, ...props }, ref) => {
123
+ ({
124
+ className,
125
+ variant,
126
+ size,
127
+ color,
128
+ iconButton,
129
+ customStyles,
130
+ children,
131
+ ...props
132
+ }, ref) => {
133
+ if (customStyles) {
134
+ return /* @__PURE__ */ React.createElement(
135
+ CustomButton,
136
+ {
137
+ className,
138
+ customStyles,
139
+ size,
140
+ iconButton,
141
+ ref,
142
+ ...props
143
+ },
144
+ children
145
+ );
146
+ }
123
147
  const Comp = "button";
124
148
  return /* @__PURE__ */ React.createElement(
125
149
  Comp,
@@ -0,0 +1,58 @@
1
+ import * as React from 'react';
2
+ import opacity from 'hex-color-opacity';
3
+ import { Button } from './Button.js';
4
+
5
+ const CustomButton = React.forwardRef(
6
+ ({ customStyles, children, ...props }, ref) => {
7
+ const { normal, hover, focus } = customStyles;
8
+ const [backgroundColor, setBackgroundColor] = React.useState(
9
+ opacity(normal.bgColor, normal.opacity)
10
+ );
11
+ const [color, setColor] = React.useState(normal.textColor);
12
+ const [active, setActive] = React.useState(false);
13
+ const handleOver = () => {
14
+ if (!active) {
15
+ setBackgroundColor(opacity(hover.bgColor, hover.opacity));
16
+ setColor(hover.textColor);
17
+ }
18
+ };
19
+ const handleOut = () => {
20
+ if (!active) {
21
+ setBackgroundColor(opacity(normal.bgColor, normal.opacity));
22
+ setColor(normal.textColor);
23
+ }
24
+ };
25
+ const handleFocus = () => {
26
+ setActive(true);
27
+ setBackgroundColor(opacity(focus.bgColor, focus.opacity));
28
+ setColor(focus.textColor);
29
+ };
30
+ const handleBlur = () => {
31
+ setActive(false);
32
+ setBackgroundColor(opacity(normal.bgColor, normal.opacity));
33
+ setColor(normal.textColor);
34
+ };
35
+ const shadowSmTailwind = "0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgb(0, 0, 0, 0.05)";
36
+ const mappedCustomStyles = {
37
+ backgroundColor,
38
+ color,
39
+ boxShadow: shadowSmTailwind
40
+ };
41
+ return /* @__PURE__ */ React.createElement(
42
+ Button,
43
+ {
44
+ onMouseOver: handleOver,
45
+ onMouseOut: handleOut,
46
+ onFocus: handleFocus,
47
+ onBlur: handleBlur,
48
+ style: mappedCustomStyles,
49
+ ref,
50
+ ...props
51
+ },
52
+ children
53
+ );
54
+ }
55
+ );
56
+ CustomButton.displayName = "CustomButton";
57
+
58
+ export { CustomButton };
@@ -0,0 +1,58 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../lib/utils.js';
3
+
4
+ const Card = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
5
+ "div",
6
+ {
7
+ ref,
8
+ className: cn(
9
+ "rounded-lg bg-card text-card-foreground shadow-lg ",
10
+ className
11
+ ),
12
+ ...props
13
+ }
14
+ ));
15
+ Card.displayName = "Card";
16
+ const CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
17
+ "div",
18
+ {
19
+ ref,
20
+ className: cn("flex flex-col space-y-1.5 p-6", className),
21
+ ...props
22
+ }
23
+ ));
24
+ CardHeader.displayName = "CardHeader";
25
+ const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
26
+ "div",
27
+ {
28
+ ref,
29
+ className: cn(
30
+ "text-2xl font-semibold leading-none tracking-tight",
31
+ className
32
+ ),
33
+ ...props
34
+ }
35
+ ));
36
+ CardTitle.displayName = "CardTitle";
37
+ const CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
38
+ "div",
39
+ {
40
+ ref,
41
+ className: cn("text-sm text-muted-foreground", className),
42
+ ...props
43
+ }
44
+ ));
45
+ CardDescription.displayName = "CardDescription";
46
+ const CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement("div", { ref, className: cn("p-6 pt-0", className), ...props }));
47
+ CardContent.displayName = "CardContent";
48
+ const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
49
+ "div",
50
+ {
51
+ ref,
52
+ className: cn("flex items-center p-6 pt-0", className),
53
+ ...props
54
+ }
55
+ ));
56
+ CardFooter.displayName = "CardFooter";
57
+
58
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../../lib/utils.js';
3
+
4
+ const CadastroFacil = React.forwardRef(
5
+ ({ fillColor, size = 24, className, ...props }, ref) => /* @__PURE__ */ React.createElement(
6
+ "svg",
7
+ {
8
+ width: size,
9
+ height: size,
10
+ viewBox: "0 0 24 24",
11
+ fill: "currentColor",
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ ref,
14
+ className: cn("custom-icon", className, fillColor),
15
+ ...props
16
+ },
17
+ /* @__PURE__ */ React.createElement("g", { "clip-path": "url(#clip0_583_2576)" }, /* @__PURE__ */ React.createElement("g", { "clip-path": "url(#clip1_583_2576)" }, /* @__PURE__ */ React.createElement("path", { d: "M14.5 2.79999V4.39999C15.9 4.39999 17 5.49999 17 6.89999H18.6C18.6 4.59999 16.8 2.79999 14.5 2.79999Z" }), /* @__PURE__ */ React.createElement("path", { d: "M1.6 16.1H0C0 18.4 1.8 20.2 4.1 20.2V18.6C2.7 18.6 1.6 17.5 1.6 16.1Z" }), /* @__PURE__ */ React.createElement("path", { d: "M23.2001 17.6V7.9H13.1V5.8C13.1 4.7 12.4 3.7 11.2 3C10.1 2.4 8.70005 2 7.20005 2C5.70005 2 4.30005 2.3 3.20005 3C2.00005 3.7 1.30005 4.7 1.30005 5.8V13.1C1.30005 14.2 2.00005 15.2 3.20005 15.9C4.10005 16.4 5.10005 16.7 6.30005 16.8V17.6H5.50005V19.7C5.50005 20.9 6.50005 21.9 7.70005 21.9H21.9C23.1 21.9 24.1 20.9 24.1 19.7V17.6H23.3H23.2001ZM21.6 9.6V17.6H7.90005V9.6H21.6ZM6.30005 15.2C5.40005 15.1 4.60005 14.9 4.00005 14.5C3.30005 14.1 2.90005 13.6 2.90005 13.2V12.2C2.90005 12.2 3.10005 12.3 3.20005 12.4C4.10005 12.9 5.10005 13.2 6.30005 13.3V15.3V15.2ZM6.30005 11.6C5.40005 11.5 4.60005 11.3 4.00005 10.9C3.30005 10.5 2.90005 10 2.90005 9.6V8.6C2.90005 8.6 3.10005 8.7 3.20005 8.8C4.10005 9.3 5.10005 9.6 6.30005 9.7V11.7V11.6ZM4.00005 7.2C3.30005 6.8 2.90005 6.3 2.90005 5.9C2.90005 5.5 3.30005 4.9 4.00005 4.6C4.80005 4.1 6.00005 3.9 7.20005 3.9C8.40005 3.9 9.60005 4.2 10.4 4.6C11.1 5 11.5 5.5 11.5 5.9C11.5 6.3 11.1 6.9 10.4 7.2C9.70005 7.6 8.90005 7.8 8.00005 7.9H6.50005C5.60005 7.9 4.70005 7.6 4.10005 7.2H4.00005ZM22.4 19.7C22.4 20 22.2 20.2 21.9 20.2H7.60005C7.30005 20.2 7.10005 20 7.10005 19.7V19.3H22.4V19.7Z" }))),
18
+ /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", { id: "clip0_583_2576" }, /* @__PURE__ */ React.createElement("rect", { width: "24", height: "24", fill: "white" })), /* @__PURE__ */ React.createElement("clipPath", { id: "clip1_583_2576" }, /* @__PURE__ */ React.createElement("rect", { width: "24", height: "24", fill: "white" })))
19
+ )
20
+ );
21
+ CadastroFacil.displayName = "CadastroFacil";
22
+
23
+ export { CadastroFacil };
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../../lib/utils.js';
3
+
4
+ const LogoLecom = React.forwardRef(
5
+ ({ fillColor, size = 24, className, ...props }, ref) => /* @__PURE__ */ React.createElement(
6
+ "svg",
7
+ {
8
+ width: size,
9
+ height: size,
10
+ viewBox: "0 0 24 24",
11
+ fill: "currentColor",
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ ref,
14
+ className: cn("custom-icon", className, fillColor),
15
+ ...props
16
+ },
17
+ /* @__PURE__ */ React.createElement(
18
+ "path",
19
+ {
20
+ "fill-rule": "evenodd",
21
+ "clip-rule": "evenodd",
22
+ d: "M10.7088 13.8353C12.4594 14.5129 13.0241 16.1506 13.1371 17.1106C13.1935 17.6188 12.7983 17.9012 12.7983 17.9012L4.04531 24C3.81943 19.4823 4.49707 18.2965 4.77943 17.5059C6.19119 14.0047 9.01472 13.1576 10.7088 13.8353Z"
23
+ }
24
+ ),
25
+ /* @__PURE__ */ React.createElement("path", { d: "M8.56301 10.6729C3.87595 7.62353 3.87595 4.91294 4.10184 0L21.2124 11.9718L14.2101 16.8847C14.323 14.7388 12.7418 13.6094 11.8948 12.9318C11.3865 12.5365 10.7089 12.1412 10.1442 11.6894C9.29713 11.1812 8.56301 10.6729 8.56301 10.6729Z" })
26
+ )
27
+ );
28
+ LogoLecom.displayName = "LogoLecom";
29
+
30
+ export { LogoLecom };
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../../lib/utils.js';
3
+
4
+ const ModoTeste = React.forwardRef(
5
+ ({ fillColor, size = 24, className, ...props }, ref) => /* @__PURE__ */ React.createElement(
6
+ "svg",
7
+ {
8
+ width: size,
9
+ height: size,
10
+ viewBox: "0 0 24 24",
11
+ fill: "currentColor",
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ ref,
14
+ className: cn("custom-icon", className, fillColor),
15
+ ...props
16
+ },
17
+ /* @__PURE__ */ React.createElement("g", { "clip-path": "url(#clip0_583_2575)" }, /* @__PURE__ */ React.createElement("path", { d: "M13.6 9.60001H8.30002C8.10002 9.60001 7.80002 9.60001 7.70002 9.90001C7.50002 10.1 7.40002 10.3 7.40002 10.5C7.40002 10.7 7.40002 11 7.70002 11.1C7.90002 11.3 8.10002 11.4 8.30002 11.4H11.7C11.7 11.4 11.8 11.3 11.9 11.2C12.2 10.9 12.7 10.8 13.1 10.8H14.4C14.4 10.8 14.4 10.6 14.4 10.5C14.4 10.3 14.4 10 14.1 9.90001C13.9 9.70001 13.7 9.60001 13.5 9.60001H13.6Z" }), /* @__PURE__ */ React.createElement("path", { d: "M12.1 16.9H5.7V2.3H11V6.9C11 7.1 11 7.4 11.3 7.5C11.5 7.7 11.7 7.8 11.9 7.8H16.3V10.8H18.1V5.9C18.1 5.7 18.1 5.4 17.8 5.3L13.3 0.8C13.1 0.6 12.9 0.5 12.7 0.5H5.7C5.2 0.5 4.8 0.7 4.5 1C4.2 1.3 4 1.8 4 2.3V16.9C4 17.4 4.2 17.8 4.5 18.2C4.8 18.5 5.3 18.7 5.7 18.7H12.1V16.9ZM12.7 2.7L15.9 6H12.7V2.7Z" }), /* @__PURE__ */ React.createElement("path", { d: "M7.70002 14.8C7.90002 15 8.10002 15.1 8.30002 15.1H12V13.9C12 13.9 11.9 13.9 11.9 13.8C11.7 13.6 11.6 13.5 11.5 13.2H8.30002C8.10002 13.2 7.80002 13.2 7.70002 13.5C7.50002 13.7 7.40002 13.9 7.40002 14.1C7.40002 14.3 7.40002 14.6 7.70002 14.7V14.8Z" }), /* @__PURE__ */ React.createElement("path", { d: "M18.4 23.8C19 23.3 19.3 22.7 19.3 22V13.3H19.6C19.6 13.1 19.7 13.1 19.8 13C19.9 12.9 20 12.7 20 12.6C20 12.5 20 12.3 19.8 12.2C19.7 12.1 19.5 12 19.3 12H13.1C12.9 12 12.7 12 12.6 12.2C12.5 12.3 12.4 12.5 12.4 12.6C12.4 12.7 12.5 13 12.6 13C12.6 13 12.7 13 12.8 13.1H13.1V22C13.1 22.7 13.4 23.3 14 23.8C14.6 24.3 15.4 24.5 16.2 24.5C17 24.5 17.8 24.2 18.4 23.8ZM14.7 22V13.2H17.8V15.1H17C16.8 15.1 16.6 15.1 16.5 15.3C16.4 15.4 16.3 15.6 16.3 15.7C16.3 15.8 16.4 16.1 16.5 16.1C16.6 16.2 16.8 16.3 17 16.3H17.8V17.6H17C16.8 17.6 16.6 17.6 16.5 17.8C16.4 17.9 16.3 18.1 16.3 18.2C16.3 18.3 16.4 18.6 16.5 18.6C16.6 18.7 16.8 18.8 17 18.8H17.8V20.1H17C16.8 20.1 16.6 20.1 16.5 20.3C16.4 20.4 16.3 20.6 16.3 20.7C16.3 20.8 16.4 21.1 16.5 21.1C16.6 21.2 16.8 21.3 17 21.3H17.8V21.9C17.8 22.2 17.6 22.6 17.3 22.8C17 23 16.6 23.2 16.2 23.2C15.8 23.2 15.4 23.1 15.1 22.8C14.8 22.6 14.6 22.2 14.6 21.9L14.7 22Z" })),
18
+ /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", { id: "clip0_583_2575" }, /* @__PURE__ */ React.createElement("rect", { width: "24", height: "24", fill: "white" })))
19
+ )
20
+ );
21
+ ModoTeste.displayName = "ModoTeste";
22
+
23
+ export { ModoTeste };
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../../lib/utils.js';
3
+
4
+ const Rpa = React.forwardRef(
5
+ ({ fillColor, size = 24, className, ...props }, ref) => /* @__PURE__ */ React.createElement(
6
+ "svg",
7
+ {
8
+ width: size,
9
+ height: size,
10
+ viewBox: "0 0 24 24",
11
+ fill: "currentColor",
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ ref,
14
+ className: cn("custom-icon", className, fillColor),
15
+ ...props
16
+ },
17
+ /* @__PURE__ */ React.createElement("g", { "clip-path": "url(#clip0_583_2574)" }, /* @__PURE__ */ React.createElement("g", { "clip-path": "url(#clip1_583_2574)" }, /* @__PURE__ */ React.createElement("path", { d: "M23.8 10.6C23.1 7.8 20.9 7.4 20.7 7.4C20.6 7.6 20.3 8.1 20.1 8.3H9.60001C9.60001 8.3 9.10001 7.5 8.20001 7.2C7.40001 6.9 6.30001 7.1 4.60001 7H3.00001C3.00001 7 2.40001 7.1 1.90001 7.4C0.300008 8.5 8.15466e-06 11.7 8.15466e-06 11.7C8.15466e-06 11.7 -0.299992 13.9 0.900008 16.5C1.50001 17.5 2.10001 18.2 2.70001 18.5C3.50001 18.9 4.20001 18.8 4.20001 18.8C4.20001 18.8 19.3 16.2 20.6 16C21.8 15.8 22.4 15.3 22.4 15.3C22.4 15.3 24.5 13.5 23.8 10.5V10.6ZM3.70001 17.7C2.10001 18 0.500008 16.2 0.200008 13.5C-0.0999919 10.9 0.900008 8.4 2.50001 8.1C4.10001 7.8 5.70001 9.6 6.00001 12.3C6.30001 15 5.30001 17.4 3.70001 17.7ZM21.9 14.7L9.20001 16.5C9.20001 16.5 8.30001 16.7 8.00001 16C8.00001 15.7 8.00001 15.3 8.00001 14.6C8.00001 11.9 7.70001 9.7 7.70001 9.7C7.70001 9.7 7.70001 9.1 8.20001 8.9H21.7C21.7 8.8 23.3 8.9 23.6 11.6C23.6 14.4 21.9 14.6 21.9 14.6V14.7Z" }), /* @__PURE__ */ React.createElement("path", { d: "M13.8 10.4C13.8 10.1 13.5 9.79999 13.1 9.79999C12.7 9.79999 12.5 10.1 12.5 10.5L12.7 14.4C12.7 14.7 13 15 13.4 15C13.8 15 14 14.7 14 14.3L13.8 10.4Z" }), /* @__PURE__ */ React.createElement("path", { d: "M20.7 10.1C20.7 9.80001 20.4 9.60001 20.1 9.60001C19.8 9.60001 19.6 9.90001 19.6 10.2L19.8 13.6C19.8 13.9 20.1 14.1 20.4 14.1C20.7 14.1 20.9 13.8 20.9 13.5L20.7 10.1Z" }), /* @__PURE__ */ React.createElement("path", { d: "M2.49996 8.90001C1.29996 9.20001 0.49996 11.2 0.79996 13.5C1.09996 15.8 2.29996 17.4 3.59996 17.2C4.79996 16.9 5.59996 14.9 5.29996 12.6C4.99996 10.3 3.79996 8.70001 2.49996 8.90001Z" }), /* @__PURE__ */ React.createElement("path", { d: "M5.10002 6.59999C5.10002 6.59999 6.60002 4.89999 9.00002 5.19999C11.6 5.29999 17.7 5.69999 17.7 5.69999C18.5 5.79999 18.8 5.79999 19.7 6.29999C20.1 6.49999 20.4 6.79999 20.5 6.89999C20.5 6.99999 20.5 7.19999 20.5 7.19999C20.5 7.19999 20.1 7.69999 19.9 7.99999H10.1C10.1 7.99999 9.50002 7.29999 8.70002 7.09999C8.00002 6.89999 6.30002 6.79999 4.90002 6.89999L5.20002 6.59999H5.10002Z" }))),
18
+ /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", { id: "clip0_583_2574" }, /* @__PURE__ */ React.createElement("rect", { width: "24", height: "24", fill: "white" })), /* @__PURE__ */ React.createElement("clipPath", { id: "clip1_583_2574" }, /* @__PURE__ */ React.createElement("rect", { width: "24", height: "24", fill: "white" })))
19
+ )
20
+ );
21
+ Rpa.displayName = "Rpa";
22
+
23
+ export { Rpa };
@@ -0,0 +1,79 @@
1
+ import * as React from 'react';
2
+ import { Typography } from '../Typography/Typography.js';
3
+ import { cn } from '../../lib/utils.js';
4
+ import { cva } from 'class-variance-authority';
5
+ import { Menu } from 'lucide-react';
6
+ import Image from 'next/image';
7
+ import { colorLuminance } from 'use-color-luminance';
8
+ import { HelpMenu } from './HelpMenu.js';
9
+ import { ModulesMenu } from './ModulesMenu.js';
10
+ import { UserMenu } from './UserMenu.js';
11
+
12
+ const headerVariants = cva(
13
+ "w-[800px] h-16 bg-blue-800 flex items-center justify-center gap-4 px-4",
14
+ {
15
+ variants: {},
16
+ defaultVariants: {}
17
+ }
18
+ );
19
+ const Header = ({
20
+ customStyles,
21
+ module,
22
+ userMenu,
23
+ helpMenu,
24
+ modulesMenu,
25
+ onOpenMenuChange,
26
+ className,
27
+ ...props
28
+ }) => {
29
+ const geColorByLuminance = (color) => Number(colorLuminance(color).toFixed(1)) < 0.5 ? "#ffffff" : "#000000";
30
+ const getCustomStyles = () => {
31
+ const bgColor = geColorByLuminance(customStyles.bgColor);
32
+ const textColor = customStyles.textColor;
33
+ return {
34
+ normal: { bgColor, textColor, opacity: 0.2 },
35
+ // TODO black 0.1, white 0.2
36
+ hover: { bgColor, textColor, opacity: 0.3 },
37
+ // TODO black 0.1, white 0.2
38
+ focus: {
39
+ bgColor: textColor,
40
+ textColor: customStyles.bgColor,
41
+ opacity: 1
42
+ }
43
+ };
44
+ };
45
+ return /* @__PURE__ */ React.createElement(
46
+ "header",
47
+ {
48
+ className: cn(headerVariants({ className }), ""),
49
+ style: { backgroundColor: customStyles.bgColor },
50
+ ...props
51
+ },
52
+ onOpenMenuChange && /* @__PURE__ */ React.createElement(
53
+ Menu,
54
+ {
55
+ className: "text-white transition-all duration-300 hover:cursor-pointer hover:opacity-70",
56
+ size: 32,
57
+ onClick: onOpenMenuChange,
58
+ style: { color: customStyles.textColor }
59
+ }
60
+ ),
61
+ /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-start gap-12 grow" }, /* @__PURE__ */ React.createElement(Image, { src: "/img/logo-lecom.png", width: 133, height: 32, alt: "Lecom" }), module && /* @__PURE__ */ React.createElement(
62
+ Typography,
63
+ {
64
+ variant: "heading-medium-500",
65
+ textColor: "text-white",
66
+ className: "border-l-2 border-white pl-2",
67
+ style: {
68
+ color: customStyles.textColor,
69
+ borderColor: customStyles.textColor
70
+ }
71
+ },
72
+ module
73
+ )),
74
+ /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-end gap-4" }, /* @__PURE__ */ React.createElement(UserMenu, { customStyles: getCustomStyles(), ...userMenu }), /* @__PURE__ */ React.createElement(HelpMenu, { customStyles: getCustomStyles(), ...helpMenu }), /* @__PURE__ */ React.createElement(ModulesMenu, { customStyles: getCustomStyles(), ...modulesMenu }))
75
+ );
76
+ };
77
+ Header.displayName = "Header";
78
+
79
+ export { Header, headerVariants };
@@ -0,0 +1,63 @@
1
+ import * as React from 'react';
2
+ import { Button } from '../Button/Button.js';
3
+ import { Popover, PopoverTrigger, PopoverContent } from '../Popover/Popover.js';
4
+ import { ScrollArea } from '../ScrollArea/ScrollArea.js';
5
+ import { cn } from '../../lib/utils.js';
6
+ import { HelpCircle } from 'lucide-react';
7
+
8
+ const Item = ({
9
+ description,
10
+ disabled,
11
+ icon,
12
+ render,
13
+ onClick
14
+ }) => {
15
+ if (render) {
16
+ return render;
17
+ }
18
+ const handleClickItem = () => {
19
+ if (disabled) {
20
+ return null;
21
+ }
22
+ onClick?.();
23
+ };
24
+ return /* @__PURE__ */ React.createElement(
25
+ "div",
26
+ {
27
+ onClick: handleClickItem,
28
+ className: cn(
29
+ "flex gap-4 items-center justify-center p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300",
30
+ !!disabled && "opacity-50 hover:cursor-not-allowed"
31
+ )
32
+ },
33
+ icon && /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-center [&>svg]:!w-5 [&>svg]:!h-5" }, icon),
34
+ description && /* @__PURE__ */ React.createElement("div", { className: "grow" }, /* @__PURE__ */ React.createElement("span", { className: "body-large-400" }, description))
35
+ );
36
+ };
37
+ const HelpMenu = ({
38
+ customStyles,
39
+ scrollAreaHeight,
40
+ title,
41
+ items
42
+ }) => {
43
+ if (!title && !items) {
44
+ return null;
45
+ }
46
+ return /* @__PURE__ */ React.createElement(Popover, null, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(Button, { size: "small", iconButton: true, customStyles }, /* @__PURE__ */ React.createElement(HelpCircle, null))), /* @__PURE__ */ React.createElement(
47
+ PopoverContent,
48
+ {
49
+ side: "bottom",
50
+ align: "end",
51
+ className: "w-[200x] p-2",
52
+ sideOffset: 24,
53
+ onOpenAutoFocus: (e) => {
54
+ e.preventDefault();
55
+ }
56
+ },
57
+ title && /* @__PURE__ */ React.createElement("span", { className: "body-large-400 p-2 block" }, title),
58
+ /* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight } }, items?.map((item, i) => /* @__PURE__ */ React.createElement(Item, { key: i, ...item })))
59
+ ));
60
+ };
61
+ HelpMenu.displayName = "HelpMenu";
62
+
63
+ export { HelpMenu };
@@ -0,0 +1,106 @@
1
+ import * as React from 'react';
2
+ import { Button } from '../Button/Button.js';
3
+ import '../CustomIcon/Icons/CadastroFacil.js';
4
+ import { LogoLecom } from '../CustomIcon/Icons/LogoLecom.js';
5
+ import '../CustomIcon/Icons/ModoTeste.js';
6
+ import '../CustomIcon/Icons/Rpa.js';
7
+ import { Popover, PopoverTrigger, PopoverContent } from '../Popover/Popover.js';
8
+ import { ScrollArea } from '../ScrollArea/ScrollArea.js';
9
+ import { cn } from '../../lib/utils.js';
10
+
11
+ const Icon = ({
12
+ icon,
13
+ containerIconBgColor,
14
+ bgColor,
15
+ textColor
16
+ }) => {
17
+ if (!icon) {
18
+ return null;
19
+ }
20
+ return /* @__PURE__ */ React.createElement(
21
+ "div",
22
+ {
23
+ className: cn(
24
+ "container-icon w-14 h-14 bg-blue-800 rounded-full flex items-center justify-center [&>svg]:!w-8 [&>svg]:!h-8",
25
+ containerIconBgColor
26
+ ),
27
+ style: { backgroundColor: bgColor, color: textColor }
28
+ },
29
+ icon
30
+ );
31
+ };
32
+ const Item = ({
33
+ render,
34
+ disabled,
35
+ icon,
36
+ containerIconBgColor,
37
+ description,
38
+ title,
39
+ bgColor,
40
+ textColor,
41
+ onClick
42
+ }) => {
43
+ if (render) {
44
+ return render;
45
+ }
46
+ const handleClickItem = () => {
47
+ if (disabled) {
48
+ return null;
49
+ }
50
+ onClick?.();
51
+ };
52
+ return /* @__PURE__ */ React.createElement(
53
+ "div",
54
+ {
55
+ onClick: handleClickItem,
56
+ className: cn(
57
+ "flex gap-4 items-center p-2 rounded-md hover:bg-grey-200/70 hover:cursor-pointer transition-all duration-300",
58
+ !!disabled && "opacity-50 hover:cursor-not-allowed"
59
+ )
60
+ },
61
+ /* @__PURE__ */ React.createElement("div", { className: "flex gap-4 items-center justify-center" }, /* @__PURE__ */ React.createElement(
62
+ Icon,
63
+ {
64
+ icon,
65
+ containerIconBgColor,
66
+ bgColor,
67
+ textColor
68
+ }
69
+ ), /* @__PURE__ */ React.createElement("div", { className: "grow" }, title && /* @__PURE__ */ React.createElement("span", { className: "body-large-500 block" }, title), description && /* @__PURE__ */ React.createElement("span", { className: "body-medium-400 block" }, description)))
70
+ );
71
+ };
72
+ const ModulesMenu = ({
73
+ customStyles,
74
+ scrollAreaHeight,
75
+ title,
76
+ items
77
+ }) => {
78
+ if (!title && !items) {
79
+ return null;
80
+ }
81
+ return /* @__PURE__ */ React.createElement(Popover, null, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(Button, { size: "small", iconButton: true, customStyles }, /* @__PURE__ */ React.createElement(LogoLecom, null))), /* @__PURE__ */ React.createElement(
82
+ PopoverContent,
83
+ {
84
+ side: "bottom",
85
+ align: "end",
86
+ className: "w-[200x] p-2",
87
+ sideOffset: 24,
88
+ onOpenAutoFocus: (e) => {
89
+ e.preventDefault();
90
+ }
91
+ },
92
+ title && /* @__PURE__ */ React.createElement("span", { className: "body-large-400 p-2 block" }, title),
93
+ /* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight } }, items?.map((item, i) => /* @__PURE__ */ React.createElement(
94
+ Item,
95
+ {
96
+ key: i,
97
+ bgColor: customStyles.focus.textColor,
98
+ textColor: customStyles.normal.textColor,
99
+ ...item
100
+ }
101
+ )))
102
+ ));
103
+ };
104
+ ModulesMenu.displayName = "ModulesMenu";
105
+
106
+ export { ModulesMenu };
@@ -0,0 +1,65 @@
1
+ import * as React from 'react';
2
+ import { Button } from '../Button/Button.js';
3
+ import { Popover, PopoverTrigger, PopoverContent } from '../Popover/Popover.js';
4
+ import { ScrollArea } from '../ScrollArea/ScrollArea.js';
5
+ import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../Select/Select.js';
6
+ import { User } from 'lucide-react';
7
+
8
+ const UserMenu = ({
9
+ customStyles,
10
+ scrollAreaHeight,
11
+ user,
12
+ language,
13
+ logout
14
+ }) => {
15
+ const renderLanguage = () => {
16
+ if (!language) {
17
+ return null;
18
+ }
19
+ if (language.render) {
20
+ return language.render;
21
+ }
22
+ 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(
23
+ Select,
24
+ {
25
+ value: language.select?.value,
26
+ onValueChange: (value) => language.select?.onChange?.(value)
27
+ },
28
+ /* @__PURE__ */ React.createElement(SelectTrigger, { className: "h-7" }, /* @__PURE__ */ React.createElement(SelectValue, null)),
29
+ /* @__PURE__ */ React.createElement(SelectContent, null, language.select?.options.map((option) => /* @__PURE__ */ React.createElement(SelectItem, { key: option.id, value: option.id }, option.name)))
30
+ ));
31
+ };
32
+ const renderLogout = () => {
33
+ if (!logout) {
34
+ return null;
35
+ }
36
+ if (logout.render) {
37
+ return logout.render;
38
+ }
39
+ return /* @__PURE__ */ React.createElement(
40
+ "div",
41
+ {
42
+ 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",
43
+ onClick: logout.onClick
44
+ },
45
+ logout.icon,
46
+ logout.label
47
+ );
48
+ };
49
+ return /* @__PURE__ */ React.createElement(Popover, null, /* @__PURE__ */ React.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React.createElement(Button, { size: "small", customStyles }, user?.name)), /* @__PURE__ */ React.createElement(
50
+ PopoverContent,
51
+ {
52
+ side: "bottom",
53
+ align: "end",
54
+ className: "w-[274px] p-2",
55
+ sideOffset: 24,
56
+ onOpenAutoFocus: (e) => {
57
+ e.preventDefault();
58
+ }
59
+ },
60
+ /* @__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" }, /* @__PURE__ */ React.createElement(User, { className: "text-grey-600" })), /* @__PURE__ */ React.createElement("div", { className: "grow" }, /* @__PURE__ */ React.createElement("span", { className: "block body-large-400" }, user?.name), /* @__PURE__ */ React.createElement("span", { className: "block body-medium-400" }, user?.email))), /* @__PURE__ */ React.createElement(ScrollArea, { style: { height: scrollAreaHeight } }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-center" }, renderLanguage(), renderLogout())))
61
+ ));
62
+ };
63
+ UserMenu.displayName = "UserMenu";
64
+
65
+ export { UserMenu };
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../lib/utils.js';
3
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
4
+
5
+ const Popover = PopoverPrimitive.Root;
6
+ const PopoverTrigger = PopoverPrimitive.Trigger;
7
+ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React.createElement(
8
+ PopoverPrimitive.Content,
9
+ {
10
+ ref,
11
+ align,
12
+ sideOffset,
13
+ className: cn(
14
+ "z-50 w-72 rounded-md bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
15
+ className
16
+ ),
17
+ ...props
18
+ }
19
+ )));
20
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
21
+
22
+ export { Popover, PopoverContent, PopoverTrigger };
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+ import { cn } from '../../lib/utils.js';
3
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
4
+
5
+ const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
6
+ ScrollAreaPrimitive.Root,
7
+ {
8
+ ref,
9
+ className: cn("relative overflow-hidden", className),
10
+ ...props
11
+ },
12
+ /* @__PURE__ */ React.createElement(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]" }, children),
13
+ /* @__PURE__ */ React.createElement(ScrollBar, null),
14
+ /* @__PURE__ */ React.createElement(ScrollAreaPrimitive.Corner, null)
15
+ ));
16
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
17
+ const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React.createElement(
18
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
19
+ {
20
+ ref,
21
+ orientation,
22
+ className: cn(
23
+ "flex touch-none select-none transition-colors",
24
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
25
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
26
+ className
27
+ ),
28
+ ...props
29
+ },
30
+ /* @__PURE__ */ React.createElement(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
31
+ ));
32
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
33
+
34
+ export { ScrollArea, ScrollBar };