@cnc-ti/layout-basic 5.0.0 → 6.0.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.
- package/.turbo/turbo-build.log +22 -0
- package/CHANGELOG.md +6 -0
- package/dist/index.css +1 -998
- package/dist/index.d.mts +139 -24
- package/dist/index.d.ts +139 -24
- package/dist/index.js +322 -37040
- package/dist/index.mjs +322 -37030
- package/package.json +1 -1
- package/postcss.config.js +6 -6
- package/src/components/Button/index.tsx +100 -100
- package/src/components/Command/index.tsx +156 -156
- package/src/components/Dialog/index.tsx +114 -114
- package/src/components/DropDownMenu/index.tsx +190 -190
- package/src/components/Header/index.tsx +88 -88
- package/src/components/Modal/ModalMudancaEntidade/index.tsx +42 -42
- package/src/components/Modal/index.tsx +44 -44
- package/src/components/Popover/index.tsx +32 -32
- package/src/components/Sidebar/index.tsx +195 -195
- package/src/components/assets/logotipo-default.tsx +26 -26
- package/src/components/utils.ts +6 -6
- package/src/index.ts +8 -9
- package/src/tailwindcss/tailwind.css +13 -13
- package/tailwind.config.js +65 -65
- package/tsconfig.json +3 -3
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../DropDownMenu";
|
|
2
|
-
|
|
3
|
-
export type HeaderProps = {
|
|
4
|
-
userName: string;
|
|
5
|
-
imageUrl?: string;
|
|
6
|
-
entityName?: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
function getInitials(fullName: string): string {
|
|
10
|
-
if (!fullName) {
|
|
11
|
-
return '';
|
|
12
|
-
}
|
|
13
|
-
const nameParts = fullName.trim().split(' ');
|
|
14
|
-
|
|
15
|
-
if (nameParts.length < 2) {
|
|
16
|
-
return nameParts[0][0].toUpperCase();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const firstNameInitial = nameParts[0][0].toUpperCase();
|
|
20
|
-
const lastNameInitial = nameParts[nameParts.length - 1][0].toUpperCase();
|
|
21
|
-
|
|
22
|
-
return `${firstNameInitial}${lastNameInitial}`;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const Header = ({
|
|
26
|
-
userName,
|
|
27
|
-
entityName
|
|
28
|
-
}: HeaderProps) => {
|
|
29
|
-
const initials = getInitials(userName);
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<header className="h-[60px] flex items-center justify-end gap-4 px-4 w-full shadow-custom">
|
|
33
|
-
<div className="flex lg:flex-1 lg:justify-end">
|
|
34
|
-
{/* User */}
|
|
35
|
-
<DropdownMenu>
|
|
36
|
-
<DropdownMenuTrigger asChild>
|
|
37
|
-
<div id="border-lateral" className="border-solid border-l-2 border-brand-blue-60">
|
|
38
|
-
|
|
39
|
-
<div className="flex flex-row gap-2 items-center justify-center hover:bg-gray-100 transition duration-300 ease-in-out cursor-pointer px-4 py-2 rounded-lg ml-8">
|
|
40
|
-
<div className="flex flex-col justify-end text-end">
|
|
41
|
-
<p className="text-xs font-extrabold text-brand-blue-900">{entityName}</p>
|
|
42
|
-
<p className="text-xs font-normal text-brand-gray-700">{userName}</p>
|
|
43
|
-
</div>
|
|
44
|
-
<div>
|
|
45
|
-
<div className="flex items-center justify-center w-10 h-10 rounded-full bg-brand-white text-white text-sm font-normal border-solid border-2">
|
|
46
|
-
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</DropdownMenuTrigger>
|
|
52
|
-
<DropdownMenuContent>
|
|
53
|
-
|
|
54
|
-
<DropdownMenuItem onClick={() => alert('Trocar Entidade')}>
|
|
55
|
-
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 120l48 48-48 48"></path><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M352 168H144a80.24 80.24 0 00-80 80v16m128 128l-48-48 48-48"></path><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 344h208a80.24 80.24 0 0080-80v-16"></path></svg>
|
|
56
|
-
Trocar Entidade
|
|
57
|
-
</DropdownMenuItem>
|
|
58
|
-
|
|
59
|
-
<DropdownMenuItem onClick={() => alert('Sair')}>
|
|
60
|
-
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M304 336v40a40 40 0 01-40 40H104a40 40 0 01-40-40V136a40 40 0 0140-40h152c22.09 0 48 17.91 48 40v40m64 160l80-80-80-80m-192 80h256"></path></svg>
|
|
61
|
-
Sair
|
|
62
|
-
</DropdownMenuItem>
|
|
63
|
-
</DropdownMenuContent>
|
|
64
|
-
</DropdownMenu>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{/* Aplications */}
|
|
69
|
-
<div className="flex flex-row items-center justify-center hover:bg-gray-100 transition duration-300 ease-in-out cursor-pointer p-2 rounded-lg">
|
|
70
|
-
<div className="flex flex-row items-center justify-center rounded-full w-10 h-10 text-sm font-normal">
|
|
71
|
-
<svg
|
|
72
|
-
width="18"
|
|
73
|
-
height="18"
|
|
74
|
-
viewBox="0 0 16 16"
|
|
75
|
-
fill="none"
|
|
76
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
77
|
-
>
|
|
78
|
-
<path
|
|
79
|
-
d="M2 4C3.1 4 4 3.1 4 2C4 0.9 3.1 0 2 0C0.9 0 0 0.9 0 2C0 3.1 0.9 4 2 4ZM8 16C9.1 16 10 15.1 10 14C10 12.9 9.1 12 8 12C6.9 12 6 12.9 6 14C6 15.1 6.9 16 8 16ZM2 16C3.1 16 4 15.1 4 14C4 12.9 3.1 12 2 12C0.9 12 0 12.9 0 14C0 15.1 0.9 16 2 16ZM2 10C3.1 10 4 9.1 4 8C4 6.9 3.1 6 2 6C0.9 6 0 6.9 0 8C0 9.1 0.9 10 2 10ZM8 10C9.1 10 10 9.1 10 8C10 6.9 9.1 6 8 6C6.9 6 6 6.9 6 8C6 9.1 6.9 10 8 10ZM12 2C12 3.1 12.9 4 14 4C15.1 4 16 3.1 16 2C16 0.9 15.1 0 14 0C12.9 0 12 0.9 12 2ZM8 4C9.1 4 10 3.1 10 2C10 0.9 9.1 0 8 0C6.9 0 6 0.9 6 2C6 3.1 6.9 4 8 4ZM14 10C15.1 10 16 9.1 16 8C16 6.9 15.1 6 14 6C12.9 6 12 6.9 12 8C12 9.1 12.9 10 14 10ZM14 16C15.1 16 16 15.1 16 14C16 12.9 15.1 12 14 12C12.9 12 12 12.9 12 14C12 15.1 12.9 16 14 16Z"
|
|
80
|
-
fill="black"
|
|
81
|
-
/>
|
|
82
|
-
</svg>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
</header>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
1
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../DropDownMenu";
|
|
2
|
+
|
|
3
|
+
export type HeaderProps = {
|
|
4
|
+
userName: string;
|
|
5
|
+
imageUrl?: string;
|
|
6
|
+
entityName?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function getInitials(fullName: string): string {
|
|
10
|
+
if (!fullName) {
|
|
11
|
+
return '';
|
|
12
|
+
}
|
|
13
|
+
const nameParts = fullName.trim().split(' ');
|
|
14
|
+
|
|
15
|
+
if (nameParts.length < 2) {
|
|
16
|
+
return nameParts[0][0].toUpperCase();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const firstNameInitial = nameParts[0][0].toUpperCase();
|
|
20
|
+
const lastNameInitial = nameParts[nameParts.length - 1][0].toUpperCase();
|
|
21
|
+
|
|
22
|
+
return `${firstNameInitial}${lastNameInitial}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Header = ({
|
|
26
|
+
userName,
|
|
27
|
+
entityName
|
|
28
|
+
}: HeaderProps) => {
|
|
29
|
+
const initials = getInitials(userName);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<header className="h-[60px] flex items-center justify-end gap-4 px-4 w-full shadow-custom">
|
|
33
|
+
<div className="flex lg:flex-1 lg:justify-end">
|
|
34
|
+
{/* User */}
|
|
35
|
+
<DropdownMenu>
|
|
36
|
+
<DropdownMenuTrigger asChild>
|
|
37
|
+
<div id="border-lateral" className="border-solid border-l-2 border-brand-blue-60">
|
|
38
|
+
|
|
39
|
+
<div className="flex flex-row gap-2 items-center justify-center hover:bg-gray-100 transition duration-300 ease-in-out cursor-pointer px-4 py-2 rounded-lg ml-8">
|
|
40
|
+
<div className="flex flex-col justify-end text-end">
|
|
41
|
+
<p className="text-xs font-extrabold text-brand-blue-900">{entityName}</p>
|
|
42
|
+
<p className="text-xs font-normal text-brand-gray-700">{userName}</p>
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
<div className="flex items-center justify-center w-10 h-10 rounded-full bg-brand-white text-white text-sm font-normal border-solid border-2">
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</DropdownMenuTrigger>
|
|
52
|
+
<DropdownMenuContent>
|
|
53
|
+
|
|
54
|
+
<DropdownMenuItem onClick={() => alert('Trocar Entidade')}>
|
|
55
|
+
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M320 120l48 48-48 48"></path><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M352 168H144a80.24 80.24 0 00-80 80v16m128 128l-48-48 48-48"></path><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 344h208a80.24 80.24 0 0080-80v-16"></path></svg>
|
|
56
|
+
Trocar Entidade
|
|
57
|
+
</DropdownMenuItem>
|
|
58
|
+
|
|
59
|
+
<DropdownMenuItem onClick={() => alert('Sair')}>
|
|
60
|
+
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M304 336v40a40 40 0 01-40 40H104a40 40 0 01-40-40V136a40 40 0 0140-40h152c22.09 0 48 17.91 48 40v40m64 160l80-80-80-80m-192 80h256"></path></svg>
|
|
61
|
+
Sair
|
|
62
|
+
</DropdownMenuItem>
|
|
63
|
+
</DropdownMenuContent>
|
|
64
|
+
</DropdownMenu>
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
{/* Aplications */}
|
|
69
|
+
<div className="flex flex-row items-center justify-center hover:bg-gray-100 transition duration-300 ease-in-out cursor-pointer p-2 rounded-lg">
|
|
70
|
+
<div className="flex flex-row items-center justify-center rounded-full w-10 h-10 text-sm font-normal">
|
|
71
|
+
<svg
|
|
72
|
+
width="18"
|
|
73
|
+
height="18"
|
|
74
|
+
viewBox="0 0 16 16"
|
|
75
|
+
fill="none"
|
|
76
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
77
|
+
>
|
|
78
|
+
<path
|
|
79
|
+
d="M2 4C3.1 4 4 3.1 4 2C4 0.9 3.1 0 2 0C0.9 0 0 0.9 0 2C0 3.1 0.9 4 2 4ZM8 16C9.1 16 10 15.1 10 14C10 12.9 9.1 12 8 12C6.9 12 6 12.9 6 14C6 15.1 6.9 16 8 16ZM2 16C3.1 16 4 15.1 4 14C4 12.9 3.1 12 2 12C0.9 12 0 12.9 0 14C0 15.1 0.9 16 2 16ZM2 10C3.1 10 4 9.1 4 8C4 6.9 3.1 6 2 6C0.9 6 0 6.9 0 8C0 9.1 0.9 10 2 10ZM8 10C9.1 10 10 9.1 10 8C10 6.9 9.1 6 8 6C6.9 6 6 6.9 6 8C6 9.1 6.9 10 8 10ZM12 2C12 3.1 12.9 4 14 4C15.1 4 16 3.1 16 2C16 0.9 15.1 0 14 0C12.9 0 12 0.9 12 2ZM8 4C9.1 4 10 3.1 10 2C10 0.9 9.1 0 8 0C6.9 0 6 0.9 6 2C6 3.1 6.9 4 8 4ZM14 10C15.1 10 16 9.1 16 8C16 6.9 15.1 6 14 6C12.9 6 12 6.9 12 8C12 9.1 12.9 10 14 10ZM14 16C15.1 16 16 15.1 16 14C16 12.9 15.1 12 14 12C12.9 12 12 12.9 12 14C12 15.1 12.9 16 14 16Z"
|
|
80
|
+
fill="black"
|
|
81
|
+
/>
|
|
82
|
+
</svg>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</header>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
// import { Button } from "../Button";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Modal } from "..";
|
|
4
|
-
import { Button } from "../../Button";
|
|
5
|
-
import { DialogTitle } from "../../Dialog";
|
|
6
|
-
|
|
7
|
-
type ModalMudancaEnntidadeProps = {
|
|
8
|
-
title?: string;
|
|
9
|
-
onClose?: any;
|
|
10
|
-
visibleModal?: boolean;
|
|
11
|
-
SelectComponent?: any;
|
|
12
|
-
buttonAction: React.MouseEventHandler<HTMLButtonElement>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const ModalMudancaEntidade = ({
|
|
16
|
-
title,
|
|
17
|
-
onClose,
|
|
18
|
-
visibleModal,
|
|
19
|
-
SelectComponent,
|
|
20
|
-
buttonAction,
|
|
21
|
-
}: ModalMudancaEnntidadeProps) => {
|
|
22
|
-
return (
|
|
23
|
-
<Modal
|
|
24
|
-
title={title}
|
|
25
|
-
onClose={onClose}
|
|
26
|
-
visibleModal={visibleModal}
|
|
27
|
-
content={
|
|
28
|
-
<>
|
|
29
|
-
<DialogTitle className="DialogTitle mt-10 mb-4 ">
|
|
30
|
-
Selecionar a entidade
|
|
31
|
-
</DialogTitle>
|
|
32
|
-
<div className="flex mb-5 ">
|
|
33
|
-
<SelectComponent />
|
|
34
|
-
<Button className="text-white ml-5" onClick={buttonAction}>
|
|
35
|
-
Trocar entidade
|
|
36
|
-
</Button>
|
|
37
|
-
</div>
|
|
38
|
-
</>
|
|
39
|
-
}
|
|
40
|
-
></Modal>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
1
|
+
// import { Button } from "../Button";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Modal } from "..";
|
|
4
|
+
import { Button } from "../../Button";
|
|
5
|
+
import { DialogTitle } from "../../Dialog";
|
|
6
|
+
|
|
7
|
+
type ModalMudancaEnntidadeProps = {
|
|
8
|
+
title?: string;
|
|
9
|
+
onClose?: any;
|
|
10
|
+
visibleModal?: boolean;
|
|
11
|
+
SelectComponent?: any;
|
|
12
|
+
buttonAction: React.MouseEventHandler<HTMLButtonElement>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const ModalMudancaEntidade = ({
|
|
16
|
+
title,
|
|
17
|
+
onClose,
|
|
18
|
+
visibleModal,
|
|
19
|
+
SelectComponent,
|
|
20
|
+
buttonAction,
|
|
21
|
+
}: ModalMudancaEnntidadeProps) => {
|
|
22
|
+
return (
|
|
23
|
+
<Modal
|
|
24
|
+
title={title}
|
|
25
|
+
onClose={onClose}
|
|
26
|
+
visibleModal={visibleModal}
|
|
27
|
+
content={
|
|
28
|
+
<>
|
|
29
|
+
<DialogTitle className="DialogTitle mt-10 mb-4 ">
|
|
30
|
+
Selecionar a entidade
|
|
31
|
+
</DialogTitle>
|
|
32
|
+
<div className="flex mb-5 ">
|
|
33
|
+
<SelectComponent />
|
|
34
|
+
<Button className="text-white ml-5" onClick={buttonAction}>
|
|
35
|
+
Trocar entidade
|
|
36
|
+
</Button>
|
|
37
|
+
</div>
|
|
38
|
+
</>
|
|
39
|
+
}
|
|
40
|
+
></Modal>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
// import { Button } from "../Button";
|
|
2
|
-
import {
|
|
3
|
-
Dialog,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogHeader,
|
|
6
|
-
DialogOverlay,
|
|
7
|
-
DialogTrigger,
|
|
8
|
-
} from "../Dialog";
|
|
9
|
-
|
|
10
|
-
type entidadeOptionsType = {
|
|
11
|
-
name: string;
|
|
12
|
-
value: string;
|
|
13
|
-
};
|
|
14
|
-
export type ModalProps = {
|
|
15
|
-
title?: string;
|
|
16
|
-
content?: React.ReactElement;
|
|
17
|
-
onClose?: any;
|
|
18
|
-
// entidadesOptions?: entidadeOptionsType[];
|
|
19
|
-
// entityName?: string;
|
|
20
|
-
visibleModal?: boolean;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Modal = ({
|
|
24
|
-
title,
|
|
25
|
-
content,
|
|
26
|
-
visibleModal,
|
|
27
|
-
onClose,
|
|
28
|
-
}: ModalProps) => {
|
|
29
|
-
return (
|
|
30
|
-
<Dialog open={visibleModal} onOpenChange={onClose}>
|
|
31
|
-
<DialogOverlay className="inset-0 bg-blackA6= data-[state=open]:animate-overlayShow" />
|
|
32
|
-
<DialogContent className=" max-h-[85vh] w-[90vw] max-w-[40.625rem] p-0 rounded-sm bg-white focus:outline-none data-[state=open]:animate-contentShow">
|
|
33
|
-
{title && (
|
|
34
|
-
<DialogHeader className="text-sm h-14 text-gray-500 font-thin border-b w-full px-6 py-3 leading-10">
|
|
35
|
-
{title}
|
|
36
|
-
</DialogHeader>
|
|
37
|
-
)}
|
|
38
|
-
<div className="flex flex-col mb-10 ml-20 align-middle items-left justify-center">
|
|
39
|
-
{content}
|
|
40
|
-
</div>
|
|
41
|
-
</DialogContent>
|
|
42
|
-
</Dialog>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
1
|
+
// import { Button } from "../Button";
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogContent,
|
|
5
|
+
DialogHeader,
|
|
6
|
+
DialogOverlay,
|
|
7
|
+
DialogTrigger,
|
|
8
|
+
} from "../Dialog";
|
|
9
|
+
|
|
10
|
+
type entidadeOptionsType = {
|
|
11
|
+
name: string;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
export type ModalProps = {
|
|
15
|
+
title?: string;
|
|
16
|
+
content?: React.ReactElement;
|
|
17
|
+
onClose?: any;
|
|
18
|
+
// entidadesOptions?: entidadeOptionsType[];
|
|
19
|
+
// entityName?: string;
|
|
20
|
+
visibleModal?: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Modal = ({
|
|
24
|
+
title,
|
|
25
|
+
content,
|
|
26
|
+
visibleModal,
|
|
27
|
+
onClose,
|
|
28
|
+
}: ModalProps) => {
|
|
29
|
+
return (
|
|
30
|
+
<Dialog open={visibleModal} onOpenChange={onClose}>
|
|
31
|
+
<DialogOverlay className="inset-0 bg-blackA6= data-[state=open]:animate-overlayShow" />
|
|
32
|
+
<DialogContent className=" max-h-[85vh] w-[90vw] max-w-[40.625rem] p-0 rounded-sm bg-white focus:outline-none data-[state=open]:animate-contentShow">
|
|
33
|
+
{title && (
|
|
34
|
+
<DialogHeader className="text-sm h-14 text-gray-500 font-thin border-b w-full px-6 py-3 leading-10">
|
|
35
|
+
{title}
|
|
36
|
+
</DialogHeader>
|
|
37
|
+
)}
|
|
38
|
+
<div className="flex flex-col mb-10 ml-20 align-middle items-left justify-center">
|
|
39
|
+
{content}
|
|
40
|
+
</div>
|
|
41
|
+
</DialogContent>
|
|
42
|
+
</Dialog>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
|
4
|
-
import * as React from "react"
|
|
5
|
-
|
|
6
|
-
import { cn } from "../utils"
|
|
7
|
-
|
|
8
|
-
const Popover = PopoverPrimitive.Root
|
|
9
|
-
|
|
10
|
-
const PopoverTrigger = PopoverPrimitive.Trigger
|
|
11
|
-
|
|
12
|
-
const PopoverContent = React.forwardRef<
|
|
13
|
-
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
14
|
-
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
15
|
-
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
16
|
-
<PopoverPrimitive.Portal>
|
|
17
|
-
<PopoverPrimitive.Content
|
|
18
|
-
ref={ref}
|
|
19
|
-
align={align}
|
|
20
|
-
sideOffset={sideOffset}
|
|
21
|
-
className={cn(
|
|
22
|
-
"z-50 w-72 rounded-md border 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",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
</PopoverPrimitive.Portal>
|
|
28
|
-
))
|
|
29
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
|
30
|
-
|
|
31
|
-
export { Popover, PopoverContent, PopoverTrigger }
|
|
32
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../utils"
|
|
7
|
+
|
|
8
|
+
const Popover = PopoverPrimitive.Root
|
|
9
|
+
|
|
10
|
+
const PopoverTrigger = PopoverPrimitive.Trigger
|
|
11
|
+
|
|
12
|
+
const PopoverContent = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
15
|
+
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
16
|
+
<PopoverPrimitive.Portal>
|
|
17
|
+
<PopoverPrimitive.Content
|
|
18
|
+
ref={ref}
|
|
19
|
+
align={align}
|
|
20
|
+
sideOffset={sideOffset}
|
|
21
|
+
className={cn(
|
|
22
|
+
"z-50 w-72 rounded-md border 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",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
</PopoverPrimitive.Portal>
|
|
28
|
+
))
|
|
29
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
|
30
|
+
|
|
31
|
+
export { Popover, PopoverContent, PopoverTrigger }
|
|
32
|
+
|