lecom-ui 2.0.5 → 2.0.6
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/dist/components/CustomIcon/Icons/CadastroFacil.js +1 -1
- package/dist/components/CustomIcon/Icons/LogoLecom.js +2 -2
- package/dist/components/CustomIcon/Icons/ModoTeste.js +1 -1
- package/dist/components/CustomIcon/Icons/Rpa.js +1 -1
- package/dist/components/Header/Header.js +24 -12
- package/dist/components/Header/ImgBrand.js +17 -0
- package/dist/components/Header/ModulesMenu.js +5 -3
- package/dist/components/Header/SocialMenu.js +25 -0
- package/dist/components/Input/Input.js +79 -0
- package/dist/components/Layout/Layout.js +11 -0
- package/dist/components/Separator/Separator.js +23 -0
- package/dist/components/Sheet/Sheet.js +67 -0
- package/dist/components/Sidebar/Sidebar.js +554 -0
- package/dist/components/Tooltip/Tooltip.js +64 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/index.d.ts +24 -3
- package/dist/index.js +1 -1
- package/dist/plugin/extend.ts +61 -51
- package/dist/plugin/varsTheme.ts +73 -57
- package/dist/style.min.css +1 -1
- package/package.json +2 -2
|
@@ -14,7 +14,7 @@ const CadastroFacil = React.forwardRef(
|
|
|
14
14
|
className: cn("custom-icon", className, fillColor),
|
|
15
15
|
...props
|
|
16
16
|
},
|
|
17
|
-
/* @__PURE__ */ React.createElement("g", {
|
|
17
|
+
/* @__PURE__ */ React.createElement("g", { clipPath: "url(#clip0_583_2576)" }, /* @__PURE__ */ React.createElement("g", { clipPath: "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
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
19
|
)
|
|
20
20
|
);
|
|
@@ -17,8 +17,8 @@ const LogoLecom = React.forwardRef(
|
|
|
17
17
|
/* @__PURE__ */ React.createElement(
|
|
18
18
|
"path",
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
clipRule: "evenodd",
|
|
22
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
23
|
}
|
|
24
24
|
),
|
|
@@ -14,7 +14,7 @@ const ModoTeste = React.forwardRef(
|
|
|
14
14
|
className: cn("custom-icon", className, fillColor),
|
|
15
15
|
...props
|
|
16
16
|
},
|
|
17
|
-
/* @__PURE__ */ React.createElement("g", {
|
|
17
|
+
/* @__PURE__ */ React.createElement("g", { clipPath: "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
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
19
|
)
|
|
20
20
|
);
|
|
@@ -14,7 +14,7 @@ const Rpa = React.forwardRef(
|
|
|
14
14
|
className: cn("custom-icon", className, fillColor),
|
|
15
15
|
...props
|
|
16
16
|
},
|
|
17
|
-
/* @__PURE__ */ React.createElement("g", {
|
|
17
|
+
/* @__PURE__ */ React.createElement("g", { clipPath: "url(#clip0_583_2574)" }, /* @__PURE__ */ React.createElement("g", { clipPath: "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
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
19
|
)
|
|
20
20
|
);
|
|
@@ -3,14 +3,16 @@ import { Typography } from '../Typography/Typography.js';
|
|
|
3
3
|
import { cn } from '../../lib/utils.js';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import { Menu } from 'lucide-react';
|
|
6
|
-
import Image from 'next/image';
|
|
7
6
|
import { colorLuminance } from 'use-color-luminance';
|
|
7
|
+
import { useSidebar } from '../Sidebar/Sidebar.js';
|
|
8
8
|
import { HelpMenu } from './HelpMenu.js';
|
|
9
|
+
import { ImgBrand } from './ImgBrand.js';
|
|
9
10
|
import { ModulesMenu } from './ModulesMenu.js';
|
|
11
|
+
import { SocialMenu } from './SocialMenu.js';
|
|
10
12
|
import { UserMenu } from './UserMenu.js';
|
|
11
13
|
|
|
12
14
|
const headerVariants = cva(
|
|
13
|
-
"w-
|
|
15
|
+
"w-full h-16 bg-blue-800 flex items-center justify-center gap-4 px-4",
|
|
14
16
|
{
|
|
15
17
|
variants: {},
|
|
16
18
|
defaultVariants: {}
|
|
@@ -19,22 +21,29 @@ const headerVariants = cva(
|
|
|
19
21
|
const Header = ({
|
|
20
22
|
customStyles,
|
|
21
23
|
module,
|
|
24
|
+
customImgSrc,
|
|
25
|
+
socialMenu,
|
|
22
26
|
userMenu,
|
|
23
27
|
helpMenu,
|
|
24
28
|
modulesMenu,
|
|
29
|
+
extraContent,
|
|
25
30
|
onOpenMenuChange,
|
|
26
31
|
className,
|
|
27
32
|
...props
|
|
28
33
|
}) => {
|
|
34
|
+
const { toggleSidebar } = useSidebar();
|
|
29
35
|
const geColorByLuminance = (color) => Number(colorLuminance(color).toFixed(1)) < 0.5 ? "#ffffff" : "#000000";
|
|
30
36
|
const getCustomStyles = () => {
|
|
31
37
|
const bgColor = geColorByLuminance(customStyles.bgColor);
|
|
32
38
|
const textColor = customStyles.textColor;
|
|
39
|
+
const isBgWhite = bgColor === "#ffffff";
|
|
33
40
|
return {
|
|
34
|
-
normal: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
normal: {
|
|
42
|
+
bgColor,
|
|
43
|
+
textColor,
|
|
44
|
+
opacity: isBgWhite ? 0.2 : 0.1
|
|
45
|
+
},
|
|
46
|
+
hover: { bgColor, textColor, opacity: isBgWhite ? 0.3 : 0.2 },
|
|
38
47
|
focus: {
|
|
39
48
|
bgColor: textColor,
|
|
40
49
|
textColor: customStyles.bgColor,
|
|
@@ -49,16 +58,19 @@ const Header = ({
|
|
|
49
58
|
style: { backgroundColor: customStyles.bgColor },
|
|
50
59
|
...props
|
|
51
60
|
},
|
|
52
|
-
|
|
61
|
+
/* @__PURE__ */ React.createElement(
|
|
53
62
|
Menu,
|
|
54
63
|
{
|
|
55
|
-
className: "text-white transition-all duration-300 hover:cursor-pointer hover:opacity-70",
|
|
64
|
+
className: "text-white transition-all duration-300 hover:cursor-pointer hover:opacity-70 shrink-0",
|
|
56
65
|
size: 32,
|
|
57
|
-
onClick:
|
|
66
|
+
onClick: () => {
|
|
67
|
+
onOpenMenuChange?.();
|
|
68
|
+
toggleSidebar();
|
|
69
|
+
},
|
|
58
70
|
style: { color: customStyles.textColor }
|
|
59
71
|
}
|
|
60
72
|
),
|
|
61
|
-
/* @__PURE__ */ React.createElement("div", { className: "flex items-center
|
|
73
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex items-center grow gap-24" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-12" }, /* @__PURE__ */ React.createElement(ImgBrand, { src: customImgSrc }), module && /* @__PURE__ */ React.createElement(
|
|
62
74
|
Typography,
|
|
63
75
|
{
|
|
64
76
|
variant: "heading-medium-500",
|
|
@@ -70,8 +82,8 @@ const Header = ({
|
|
|
70
82
|
}
|
|
71
83
|
},
|
|
72
84
|
module
|
|
73
|
-
)),
|
|
74
|
-
/* @__PURE__ */ React.createElement("div", { className: "flex items-center
|
|
85
|
+
)), extraContent && extraContent),
|
|
86
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React.createElement(SocialMenu, { customStyles: getCustomStyles(), ...socialMenu }), /* @__PURE__ */ React.createElement(UserMenu, { customStyles: getCustomStyles(), ...userMenu }), /* @__PURE__ */ React.createElement(HelpMenu, { customStyles: getCustomStyles(), ...helpMenu }), /* @__PURE__ */ React.createElement(ModulesMenu, { customStyles: getCustomStyles(), ...modulesMenu }))
|
|
75
87
|
);
|
|
76
88
|
};
|
|
77
89
|
Header.displayName = "Header";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
|
|
4
|
+
const ImgBrand = ({ src = "/img/logo-lecom.png" }) => /* @__PURE__ */ React.createElement(
|
|
5
|
+
Image,
|
|
6
|
+
{
|
|
7
|
+
unoptimized: true,
|
|
8
|
+
src,
|
|
9
|
+
width: 0,
|
|
10
|
+
height: 0,
|
|
11
|
+
alt: "Logo",
|
|
12
|
+
className: "w-full h-8"
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
ImgBrand.displayName = "ImgBrand";
|
|
16
|
+
|
|
17
|
+
export { ImgBrand };
|
|
@@ -17,14 +17,16 @@ const Icon = ({
|
|
|
17
17
|
if (!icon) {
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
+
const containerIconStyles = !containerIconBgColor ? { style: { backgroundColor: bgColor, color: textColor } } : {};
|
|
20
21
|
return /* @__PURE__ */ React.createElement(
|
|
21
22
|
"div",
|
|
22
23
|
{
|
|
23
24
|
className: cn(
|
|
24
|
-
"
|
|
25
|
-
containerIconBgColor
|
|
25
|
+
"w-14 h-14 bg-blue-800 rounded-full flex items-center justify-center [&>svg]:!w-8 [&>svg]:!h-8",
|
|
26
|
+
containerIconBgColor,
|
|
27
|
+
containerIconBgColor && "text-white"
|
|
26
28
|
),
|
|
27
|
-
|
|
29
|
+
...containerIconStyles
|
|
28
30
|
},
|
|
29
31
|
icon
|
|
30
32
|
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from '../Button/Button.js';
|
|
3
|
+
import { MessageSquare } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
const SocialMenu = ({
|
|
6
|
+
customStyles,
|
|
7
|
+
onOpenSocialMenuChange
|
|
8
|
+
}) => {
|
|
9
|
+
if (!onOpenSocialMenuChange) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ React.createElement(
|
|
13
|
+
Button,
|
|
14
|
+
{
|
|
15
|
+
size: "small",
|
|
16
|
+
iconButton: true,
|
|
17
|
+
customStyles,
|
|
18
|
+
onClick: onOpenSocialMenuChange
|
|
19
|
+
},
|
|
20
|
+
/* @__PURE__ */ React.createElement(MessageSquare, null)
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
SocialMenu.displayName = "SocialMenu";
|
|
24
|
+
|
|
25
|
+
export { SocialMenu };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cn } from '../../lib/utils.js';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
const inputVariants = cva(
|
|
6
|
+
`flex h-8 w-full rounded-md border border-input bg-background px-3 py-2
|
|
7
|
+
placeholder:text-muted-foreground outline-none
|
|
8
|
+
hover:border-blue-600 focus:bg-background focus:border-blue-600 focus:ring-blue-600 focus:ring-opacity-20 focus:ring-2
|
|
9
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
10
|
+
transition-all duration-300`,
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "disabled:border-input",
|
|
15
|
+
filled: "bg-grey-100 border-grey-100 hover:border-grey-200 hover:bg-grey-200 disabled:bg-grey-200 disabled:border-grey-200",
|
|
16
|
+
borderless: "border-none bg-transparent focus:bg-transparent focus:ring-0"
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
small: "h-6 body-medium-400 px-3 py-0",
|
|
20
|
+
default: "h-8 body-large-400 px-3 py-2",
|
|
21
|
+
large: "h-10 body-large-400 px-3 py-2"
|
|
22
|
+
},
|
|
23
|
+
radius: {
|
|
24
|
+
small: "rounded-sm",
|
|
25
|
+
default: "rounded-md",
|
|
26
|
+
large: "rounded-3xl"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
size: "default",
|
|
31
|
+
variant: "default",
|
|
32
|
+
radius: "default"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
const Icon = ({ icon }) => {
|
|
37
|
+
if (!icon) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return icon;
|
|
41
|
+
};
|
|
42
|
+
const Input = React.forwardRef(
|
|
43
|
+
({
|
|
44
|
+
className,
|
|
45
|
+
size,
|
|
46
|
+
variant,
|
|
47
|
+
sufix,
|
|
48
|
+
prefix,
|
|
49
|
+
radius,
|
|
50
|
+
iconBefore,
|
|
51
|
+
iconAfter,
|
|
52
|
+
type,
|
|
53
|
+
...props
|
|
54
|
+
}, ref) => {
|
|
55
|
+
const inputStyles = () => cn(
|
|
56
|
+
inputVariants({ size, variant, radius, className }),
|
|
57
|
+
prefix && "rounded-l-none",
|
|
58
|
+
sufix && "rounded-r-none",
|
|
59
|
+
iconBefore && "pl-10",
|
|
60
|
+
iconAfter && "pr-10"
|
|
61
|
+
);
|
|
62
|
+
const renderPrefix = () => {
|
|
63
|
+
if (!prefix) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return prefix;
|
|
67
|
+
};
|
|
68
|
+
const renderSufix = () => {
|
|
69
|
+
if (!sufix) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return sufix;
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ React.createElement("div", { className: "flex justify-center" }, renderPrefix(), /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-center relative" }, /* @__PURE__ */ React.createElement("div", { className: "shrink-0 absolute left-3" }, /* @__PURE__ */ React.createElement(Icon, { icon: iconBefore })), /* @__PURE__ */ React.createElement("input", { type, className: inputStyles(), ref, ...props }), /* @__PURE__ */ React.createElement("div", { className: "shrink-0 absolute right-3" }, /* @__PURE__ */ React.createElement(Icon, { icon: iconAfter }))), renderSufix());
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
Input.displayName = "Input";
|
|
78
|
+
|
|
79
|
+
export { Input, inputVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Header } from '../Header/Header.js';
|
|
3
|
+
import { SidebarProvider, Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuButton } from '../Sidebar/Sidebar.js';
|
|
4
|
+
|
|
5
|
+
const Layout = ({ children, header, sideBar }) => {
|
|
6
|
+
const { items } = sideBar;
|
|
7
|
+
return /* @__PURE__ */ React.createElement(SidebarProvider, { className: "flex-col" }, /* @__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(SidebarMenuButton, { asChild: true, tooltip: item.title }, 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)))))))))), /* @__PURE__ */ React.createElement("main", { className: "grow" }, children)));
|
|
8
|
+
};
|
|
9
|
+
Layout.displayName = "Layout";
|
|
10
|
+
|
|
11
|
+
export { Layout };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cn } from '../../lib/utils.js';
|
|
3
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
4
|
+
|
|
5
|
+
const Separator = React.forwardRef(
|
|
6
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
7
|
+
SeparatorPrimitive.Root,
|
|
8
|
+
{
|
|
9
|
+
ref,
|
|
10
|
+
decorative,
|
|
11
|
+
orientation,
|
|
12
|
+
className: cn(
|
|
13
|
+
"shrink-0 bg-border",
|
|
14
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
22
|
+
|
|
23
|
+
export { Separator };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cn } from '../../lib/utils.js';
|
|
3
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { X } from 'lucide-react';
|
|
6
|
+
|
|
7
|
+
const Sheet = SheetPrimitive.Root;
|
|
8
|
+
const SheetPortal = SheetPrimitive.Portal;
|
|
9
|
+
const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
10
|
+
SheetPrimitive.Overlay,
|
|
11
|
+
{
|
|
12
|
+
className: cn(
|
|
13
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
...props,
|
|
17
|
+
ref
|
|
18
|
+
}
|
|
19
|
+
));
|
|
20
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
21
|
+
const sheetVariants = cva(
|
|
22
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
side: {
|
|
26
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
27
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
28
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
29
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
side: "right"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
const SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ React.createElement(SheetPortal, null, /* @__PURE__ */ React.createElement(SheetOverlay, null), /* @__PURE__ */ React.createElement(
|
|
38
|
+
SheetPrimitive.Content,
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
className: cn(sheetVariants({ side }), className),
|
|
42
|
+
...props
|
|
43
|
+
},
|
|
44
|
+
children,
|
|
45
|
+
/* @__PURE__ */ React.createElement(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary" }, /* @__PURE__ */ React.createElement(X, { className: "h-4 w-4" }), /* @__PURE__ */ React.createElement("span", { className: "sr-only" }, "Close"))
|
|
46
|
+
)));
|
|
47
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
48
|
+
const SheetTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
49
|
+
SheetPrimitive.Title,
|
|
50
|
+
{
|
|
51
|
+
ref,
|
|
52
|
+
className: cn("text-lg font-semibold text-foreground", className),
|
|
53
|
+
...props
|
|
54
|
+
}
|
|
55
|
+
));
|
|
56
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
57
|
+
const SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
58
|
+
SheetPrimitive.Description,
|
|
59
|
+
{
|
|
60
|
+
ref,
|
|
61
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
));
|
|
65
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
66
|
+
|
|
67
|
+
export { Sheet, SheetContent, SheetDescription, SheetOverlay, SheetPortal, SheetTitle };
|