@betterinternship/components 2.4.0 → 2.4.2
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/ui/accordion.js +5 -5
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/app-header.js +72 -0
- package/dist/components/ui/app-header.js.map +1 -0
- package/dist/components/ui/avatar.js +4 -4
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.js +3 -3
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/card.js +8 -8
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.js +2 -2
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/dialog.js +12 -12
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js +61 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/icons.js +12 -12
- package/dist/components/ui/icons.js.map +1 -1
- package/dist/components/ui/input.js +3 -3
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.js +2 -2
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/page-header.js +17 -0
- package/dist/components/ui/page-header.js.map +1 -0
- package/dist/components/ui/popover.js +5 -5
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/separator.js +2 -2
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/skeleton.js +2 -2
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/status-notice.js +27 -0
- package/dist/components/ui/status-notice.js.map +1 -0
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.js +9 -9
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/tooltip.js +5 -5
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/hooks/useClientProcess.js +2 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/_virtual/jsx-runtime.js +0 -6
- package/dist/_virtual/jsx-runtime.js.map +0 -1
- package/dist/_virtual/jsx-runtime2.js +0 -4
- package/dist/_virtual/jsx-runtime2.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.development.js +0 -4
- package/dist/_virtual/react-jsx-runtime.development.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.production.js +0 -4
- package/dist/_virtual/react-jsx-runtime.production.js.map +0 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -364
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +0 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -45
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.js.map +0 -1
- package/dist/node_modules/react/jsx-runtime.js +0 -20
- package/dist/node_modules/react/jsx-runtime.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
3
|
import { ChevronDownIcon } from 'lucide-react';
|
|
4
4
|
import { cn } from '../../utils.js';
|
|
5
5
|
|
|
6
6
|
function Accordion({ ...props }) {
|
|
7
|
-
return
|
|
7
|
+
return jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
|
|
8
8
|
}
|
|
9
9
|
function AccordionItem({ className, ...props }) {
|
|
10
|
-
return (
|
|
10
|
+
return (jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn('border-b last:border-b-0', className), ...props }));
|
|
11
11
|
}
|
|
12
12
|
function AccordionTrigger({ className, children, ...props }) {
|
|
13
|
-
return (
|
|
13
|
+
return (jsx(AccordionPrimitive.Header, { className: "flex", children: jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })] }) }));
|
|
14
14
|
}
|
|
15
15
|
function AccordionContent({ className, children, ...props }) {
|
|
16
|
-
return (
|
|
16
|
+
return (jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm", ...props, children: jsx("div", { className: cn('pt-0 pb-4', className), children: children }) }));
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sources":["../../../src/components/ui/accordion.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { ChevronDownIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nfunction Accordion({\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Root>) {\n return <AccordionPrimitive.Root data-slot=\"accordion\" {...props} />;\n}\n\nfunction AccordionItem({\n className,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Item>) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn('border-b last:border-b-0', className)}\n {...props}\n />\n );\n}\n\nfunction AccordionTrigger({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\n 'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n}\n\nfunction AccordionContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Content>) {\n return (\n <AccordionPrimitive.Content\n data-slot=\"accordion-content\"\n className=\"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm\"\n {...props}\n >\n <div className={cn('pt-0 pb-4', className)}>{children}</div>\n </AccordionPrimitive.Content>\n );\n}\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAMA,SAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EAC6C,EAAA;IACrD,OAAOA,
|
|
1
|
+
{"version":3,"file":"accordion.js","sources":["../../../src/components/ui/accordion.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { ChevronDownIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nfunction Accordion({\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Root>) {\n return <AccordionPrimitive.Root data-slot=\"accordion\" {...props} />;\n}\n\nfunction AccordionItem({\n className,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Item>) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn('border-b last:border-b-0', className)}\n {...props}\n />\n );\n}\n\nfunction AccordionTrigger({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\n 'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n}\n\nfunction AccordionContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Content>) {\n return (\n <AccordionPrimitive.Content\n data-slot=\"accordion-content\"\n className=\"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm\"\n {...props}\n >\n <div className={cn('pt-0 pb-4', className)}>{children}</div>\n </AccordionPrimitive.Content>\n );\n}\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAMA,SAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EAC6C,EAAA;IACrD,OAAOA,GAAA,CAAC,kBAAkB,CAAC,IAAI,iBAAW,WAAW,EAAA,GAAK,KAAK,EAAA,CAAI;AACrE;AAEA,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EAC6C,EAAA;IACrD,QACEA,IAAC,kBAAkB,CAAC,IAAI,EAAA,EAAA,WAAA,EACZ,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACgD,EAAA;AACxD,IAAA,QACEA,GAAA,CAAC,kBAAkB,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,MAAM,EAAA,QAAA,EACzCC,IAAA,CAAC,kBAAkB,CAAC,OAAO,iBACf,mBAAmB,EAC7B,SAAS,EAAE,EAAE,CACX,4SAA4S,EAC5S,SAAS,CACV,KACG,KAAK,EAAA,QAAA,EAAA,CAER,QAAQ,EACTD,GAAA,CAAC,eAAe,EAAA,EAAC,SAAS,EAAC,6GAA6G,GAAG,CAAA,EAAA,CAChH,EAAA,CACH;AAEhC;AAEA,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACgD,EAAA;AACxD,IAAA,QACEA,GAAA,CAAC,kBAAkB,CAAC,OAAO,EAAA,EAAA,WAAA,EACf,mBAAmB,EAC7B,SAAS,EAAC,2GAA2G,EAAA,GACjH,KAAK,EAAA,QAAA,EAETA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO,EAAA,CACjC;AAEjC;;;;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { usePathname, useRouter } from 'next/navigation';
|
|
5
|
+
import { useQueryClient, useMutation } from '@tanstack/react-query';
|
|
6
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuItem } from './dropdown-menu.js';
|
|
7
|
+
import { Button } from './button.js';
|
|
8
|
+
import { Separator } from './separator.js';
|
|
9
|
+
import { cn } from '../../utils.js';
|
|
10
|
+
import { UserRound, ChevronDown, LogOut, X, Menu, ChevronRight, LayoutDashboard, FileSignature, SearchCheck, Building2, GraduationCap, FileText, History, Users, Mail, Handshake } from 'lucide-react';
|
|
11
|
+
import { useState, useEffect } from 'react';
|
|
12
|
+
|
|
13
|
+
function labelIcon(label) {
|
|
14
|
+
const map = {
|
|
15
|
+
Partners: Handshake,
|
|
16
|
+
Invites: Mail,
|
|
17
|
+
Invitations: Mail,
|
|
18
|
+
Accounts: Users,
|
|
19
|
+
'Activity Log': History,
|
|
20
|
+
'MOA Templates': FileText,
|
|
21
|
+
Universities: GraduationCap,
|
|
22
|
+
Companies: Building2,
|
|
23
|
+
'Company Reviews': SearchCheck,
|
|
24
|
+
'Request MOA': FileSignature,
|
|
25
|
+
Dashboard: LayoutDashboard,
|
|
26
|
+
};
|
|
27
|
+
return map[label] ?? Handshake;
|
|
28
|
+
}
|
|
29
|
+
function AppHeader({ portal, homeHref, nav, userPrimary, logout: logoutFn, postLogoutPath, profileHref, userAvatarUrl, accountNav = [], }) {
|
|
30
|
+
const pathname = usePathname() ?? '';
|
|
31
|
+
const router = useRouter();
|
|
32
|
+
const queryClient = useQueryClient();
|
|
33
|
+
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
setIsDrawerOpen(false);
|
|
36
|
+
}, [pathname]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
document.body.style.overflow = isDrawerOpen ? 'hidden' : '';
|
|
39
|
+
return () => {
|
|
40
|
+
document.body.style.overflow = '';
|
|
41
|
+
};
|
|
42
|
+
}, [isDrawerOpen]);
|
|
43
|
+
const logout = useMutation({
|
|
44
|
+
mutationFn: logoutFn,
|
|
45
|
+
onSettled: () => {
|
|
46
|
+
queryClient.clear();
|
|
47
|
+
router.replace(postLogoutPath);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const isActive = (href) => pathname === href || pathname.startsWith(`${href}/`);
|
|
51
|
+
return (jsxs("header", { className: "bg-background/70 sticky top-0 z-40 border-b py-2 backdrop-blur", children: [jsxs("div", { className: "mx-auto flex h-16 items-center justify-between gap-2 px-4 sm:px-6 lg:px-8", children: [jsx(Link, { href: homeHref, className: "block flex-shrink-0 border-none text-black! outline-none focus:outline-none", children: jsxs("div", { className: "flex items-center gap-2", children: [jsx(Image, { src: "/betterinternship-logo.png", alt: "", width: 25, height: 25, className: "flex-none" }), jsxs("div", { className: "flex items-center", children: [jsx("h1", { className: "font-display text-lg font-bold text-gray-900", children: "Partners" }), jsx("span", { className: "mx-2.5 text-gray-300", "aria-hidden": "true", children: "|" }), jsx("span", { className: "font-display text-gray-500", children: portal === 'Platform Admin' ? portal : `${portal} Portal` })] })] }) }), jsxs("div", { className: "hidden flex-1 items-center justify-end gap-2 md:flex", children: [nav.map((item) => {
|
|
52
|
+
const Icon = item.icon ?? labelIcon(item.label);
|
|
53
|
+
return (jsxs(Button, { variant: "ghost", className: cn('relative h-auto min-w-0 flex-col items-center justify-center gap-1 rounded-[0.33em] px-3 py-1', isActive(item.href)
|
|
54
|
+
? 'text-primary'
|
|
55
|
+
: 'opacity-80 hover:bg-gray-100 hover:opacity-100'), onClick: () => router.push(item.href), children: [jsx(Icon, { className: "!h-6 !w-6", strokeWidth: 1.7 }), jsx("span", { className: "text-xs", children: item.label }), !!item.badge && (jsx("span", { className: "absolute -top-0.5 right-5.5 inline-flex h-4 w-4 items-center justify-center rounded-full bg-amber-400 text-[10px] font-bold leading-none text-amber-900", children: item.badge }))] }, item.href));
|
|
56
|
+
}), jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button, { variant: "ghost", className: cn('group h-auto w-20 flex-col items-center justify-center gap-1 rounded-[0.33em] px-2 py-1', (profileHref && isActive(profileHref)) ||
|
|
57
|
+
accountNav.some((item) => isActive(item.href))
|
|
58
|
+
? 'text-primary'
|
|
59
|
+
: 'opacity-80 hover:bg-gray-100 hover:opacity-100'), children: [jsx("div", { className: "flex h-6 w-6 items-center justify-center overflow-hidden rounded-full bg-gray-100", children: userAvatarUrl ? (jsx("img", { src: userAvatarUrl, alt: "", className: "h-full w-full object-contain" })) : (jsx(UserRound, { className: "h-5 w-5 text-gray-500" })) }), jsxs("div", { className: "flex items-center gap-0.5", children: [jsx("span", { className: "text-xs", children: "Account" }), jsx(ChevronDown, { className: "!h-3 !w-3 transition-transform group-data-[state=open]:rotate-180" })] })] }) }), jsxs(DropdownMenuContent, { align: "end", className: "w-max min-w-44", children: [userPrimary && (jsx("div", { className: "px-2 py-1.5", children: jsx("div", { className: "text-center text-sm font-medium", children: userPrimary }) })), jsx(DropdownMenuSeparator, {}), profileHref && (jsx(DropdownMenuItem, { asChild: true, children: jsxs(Link, { href: profileHref, children: [jsx(UserRound, { className: "h-4 w-4" }), "Profile"] }) })), accountNav.map((item) => {
|
|
60
|
+
const Icon = item.icon ?? labelIcon(item.label);
|
|
61
|
+
return (jsx(DropdownMenuItem, { asChild: true, children: jsxs(Link, { href: item.href, children: [jsx(Icon, { className: "h-4 w-4" }), item.label] }) }, item.href));
|
|
62
|
+
}), (profileHref || accountNav.length > 0) && (jsx(DropdownMenuSeparator, {})), jsxs(DropdownMenuItem, { variant: "destructive", disabled: logout.isPending, onClick: () => logout.mutate(), children: [jsx(LogOut, { className: "h-4 w-4" }), logout.isPending ? 'Logging out...' : 'Sign Out'] })] })] })] }), jsx("button", { type: "button", "aria-label": isDrawerOpen ? 'Close menu' : 'Open menu', className: "inline-flex h-10 w-10 items-center justify-center rounded-md border border-gray-300 hover:bg-gray-50 md:hidden", onClick: () => setIsDrawerOpen(!isDrawerOpen), children: isDrawerOpen ? (jsx(X, { className: "h-5 w-5" })) : (jsx(Menu, { className: "h-5 w-5" })) })] }), isDrawerOpen && (jsx("div", { className: "fixed inset-0 z-[30] duration-200 md:hidden", onClick: () => setIsDrawerOpen(false) })), jsx("div", { className: cn('fixed top-0 right-0 z-[31] h-[100svh] w-full max-w-[92%] border-l border-gray-200 bg-white shadow-xl sm:max-w-[420px] md:hidden', 'transition-transform duration-250 ease-out', isDrawerOpen ? 'translate-x-0' : 'translate-x-full'), role: "dialog", "aria-modal": "true", "aria-label": "Mobile menu", children: jsxs("div", { className: "flex h-full flex-col", children: [jsxs("div", { className: "mt-1 flex items-center justify-between border-b px-4 py-3", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx(Image, { src: "/betterinternship-logo.png", alt: "", width: 25, height: 25, className: "h-6 w-6 rounded object-contain" }), jsx("span", { className: "text-sm font-semibold", children: "Partners" }), jsx("span", { className: "rounded border border-gray-200 bg-gray-50 px-1 py-0 text-[10px] font-medium text-gray-400 leading-none", children: portal })] }), jsx("button", { type: "button", "aria-label": "Close menu", className: "inline-flex h-9 w-9 items-center justify-center rounded-md transition-colors hover:bg-gray-100", onClick: () => setIsDrawerOpen(false), children: jsx(X, { className: "h-5 w-5" }) })] }), jsxs("div", { className: "flex-1 overflow-y-auto p-4", children: [userPrimary && (jsxs("div", { className: "flex items-center gap-2 pb-2", children: [jsx(UserRound, { className: "h-5 w-5 text-gray-500" }), jsx("span", { className: "text-sm font-semibold text-gray-900", children: userPrimary })] })), jsx(Separator, { className: "my-4" }), jsx("nav", { className: "space-y-1", children: nav.map((item) => {
|
|
63
|
+
const Icon = item.icon ?? labelIcon(item.label);
|
|
64
|
+
return (jsx(Link, { href: item.href, className: "block w-full", children: jsxs("button", { className: "flex w-full items-center justify-between rounded-md border border-transparent px-3 py-2 text-sm transition-colors hover:border-gray-200 hover:bg-gray-50", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx(Icon, { className: "h-4 w-4 text-gray-500" }), jsx("span", { children: item.label }), !!item.badge && (jsx("span", { className: "inline-flex h-4 w-4 items-center justify-center rounded-full bg-amber-400 text-[10px] font-bold leading-none text-amber-900", children: "!" }))] }), jsx(ChevronRight, { className: "h-4 w-4 text-gray-300" })] }) }, item.href));
|
|
65
|
+
}) })] }), jsxs("div", { className: "mt-auto border-t px-4 py-3 space-y-1", children: [profileHref && (jsx(Link, { href: profileHref, className: "block w-full", children: jsxs("button", { className: "flex w-full items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors hover:bg-gray-50", children: [jsx(UserRound, { className: "h-4 w-4" }), "Profile"] }) })), accountNav.map((item) => {
|
|
66
|
+
const Icon = item.icon ?? labelIcon(item.label);
|
|
67
|
+
return (jsx(Link, { href: item.href, className: "block w-full", children: jsxs("button", { className: "flex w-full items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors hover:bg-gray-50", children: [jsx(Icon, { className: "h-4 w-4" }), item.label] }) }, item.href));
|
|
68
|
+
}), jsxs("button", { onClick: () => logout.mutate(), disabled: logout.isPending, className: "flex w-full items-center justify-center gap-2 rounded-md py-2 font-medium text-red-600 transition-colors hover:bg-red-50", children: [jsx(LogOut, { className: "h-4 w-4" }), logout.isPending ? 'Logging out...' : 'Sign Out'] })] })] }) })] }));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { AppHeader };
|
|
72
|
+
//# sourceMappingURL=app-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-header.js","sources":["../../../src/components/ui/app-header.tsx"],"sourcesContent":["import Link from 'next/link';\nimport Image from 'next/image';\nimport { usePathname, useRouter } from 'next/navigation';\nimport { useMutation, useQueryClient } from '@tanstack/react-query';\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n} from '@/components/ui/dropdown-menu';\nimport { Button } from '@/components/ui/button';\nimport { Separator } from '@/components/ui/separator';\nimport { cn } from '@/utils';\nimport {\n LogOut,\n Menu,\n X,\n UserRound,\n ChevronDown,\n ChevronRight,\n Handshake,\n Mail,\n History,\n FileText,\n Users,\n LayoutDashboard,\n FileSignature,\n GraduationCap,\n Building2,\n SearchCheck,\n} from 'lucide-react';\nimport { useState, useEffect } from 'react';\nimport type { LucideIcon } from 'lucide-react';\n\nexport interface NavItem {\n href: string;\n label: string;\n badge?: number;\n icon?: LucideIcon;\n}\n\ninterface AppHeaderProps {\n portal: string;\n homeHref: string;\n nav: NavItem[];\n userPrimary?: string;\n userSecondary?: string;\n logout: () => Promise<unknown>;\n postLogoutPath: string;\n profileHref?: string;\n userAvatarUrl?: string | null;\n accountNav?: NavItem[];\n}\n\nfunction labelIcon(label: string): LucideIcon {\n const map: Record<string, LucideIcon> = {\n Partners: Handshake,\n Invites: Mail,\n Invitations: Mail,\n Accounts: Users,\n 'Activity Log': History,\n 'MOA Templates': FileText,\n Universities: GraduationCap,\n Companies: Building2,\n 'Company Reviews': SearchCheck,\n 'Request MOA': FileSignature,\n Dashboard: LayoutDashboard,\n };\n return map[label] ?? Handshake;\n}\n\nexport function AppHeader({\n portal,\n homeHref,\n nav,\n userPrimary,\n logout: logoutFn,\n postLogoutPath,\n profileHref,\n userAvatarUrl,\n accountNav = [],\n}: AppHeaderProps) {\n const pathname = usePathname() ?? '';\n const router = useRouter();\n const queryClient = useQueryClient();\n const [isDrawerOpen, setIsDrawerOpen] = useState(false);\n\n useEffect(() => {\n setIsDrawerOpen(false);\n }, [pathname]);\n\n useEffect(() => {\n document.body.style.overflow = isDrawerOpen ? 'hidden' : '';\n return () => {\n document.body.style.overflow = '';\n };\n }, [isDrawerOpen]);\n\n const logout = useMutation({\n mutationFn: logoutFn,\n onSettled: () => {\n queryClient.clear();\n router.replace(postLogoutPath);\n },\n });\n\n const isActive = (href: string) =>\n pathname === href || pathname.startsWith(`${href}/`);\n\n return (\n <header className=\"bg-background/70 sticky top-0 z-40 border-b py-2 backdrop-blur\">\n <div className=\"mx-auto flex h-16 items-center justify-between gap-2 px-4 sm:px-6 lg:px-8\">\n {/* Brand */}\n <Link\n href={homeHref}\n className=\"block flex-shrink-0 border-none text-black! outline-none focus:outline-none\"\n >\n <div className=\"flex items-center gap-2\">\n <Image\n src=\"/betterinternship-logo.png\"\n alt=\"\"\n width={25}\n height={25}\n className=\"flex-none\"\n />\n <div className=\"flex items-center\">\n <h1 className=\"font-display text-lg font-bold text-gray-900\">\n Partners\n </h1>\n <span className=\"mx-2.5 text-gray-300\" aria-hidden=\"true\">\n |\n </span>\n <span className=\"font-display text-gray-500\">\n {portal === 'Platform Admin' ? portal : `${portal} Portal`}\n </span>\n </div>\n </div>\n </Link>\n\n {/* Desktop right side: nav buttons + user */}\n <div className=\"hidden flex-1 items-center justify-end gap-2 md:flex\">\n {nav.map((item) => {\n const Icon = item.icon ?? labelIcon(item.label);\n return (\n <Button\n key={item.href}\n variant=\"ghost\"\n className={cn(\n 'relative h-auto min-w-0 flex-col items-center justify-center gap-1 rounded-[0.33em] px-3 py-1',\n isActive(item.href)\n ? 'text-primary'\n : 'opacity-80 hover:bg-gray-100 hover:opacity-100',\n )}\n onClick={() => router.push(item.href)}\n >\n <Icon className=\"!h-6 !w-6\" strokeWidth={1.7} />\n <span className=\"text-xs\">{item.label}</span>\n {!!item.badge && (\n <span className=\"absolute -top-0.5 right-5.5 inline-flex h-4 w-4 items-center justify-center rounded-full bg-amber-400 text-[10px] font-bold leading-none text-amber-900\">\n {item.badge}\n </span>\n )}\n </Button>\n );\n })}\n\n {/* User dropdown */}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n className={cn(\n 'group h-auto w-20 flex-col items-center justify-center gap-1 rounded-[0.33em] px-2 py-1',\n (profileHref && isActive(profileHref)) ||\n accountNav.some((item) => isActive(item.href))\n ? 'text-primary'\n : 'opacity-80 hover:bg-gray-100 hover:opacity-100',\n )}\n >\n <div className=\"flex h-6 w-6 items-center justify-center overflow-hidden rounded-full bg-gray-100\">\n {userAvatarUrl ? (\n <img\n src={userAvatarUrl}\n alt=\"\"\n className=\"h-full w-full object-contain\"\n />\n ) : (\n <UserRound className=\"h-5 w-5 text-gray-500\" />\n )}\n </div>\n <div className=\"flex items-center gap-0.5\">\n <span className=\"text-xs\">Account</span>\n <ChevronDown className=\"!h-3 !w-3 transition-transform group-data-[state=open]:rotate-180\" />\n </div>\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-max min-w-44\">\n {userPrimary && (\n <div className=\"px-2 py-1.5\">\n <div className=\"text-center text-sm font-medium\">\n {userPrimary}\n </div>\n </div>\n )}\n <DropdownMenuSeparator />\n {profileHref && (\n <DropdownMenuItem asChild>\n <Link href={profileHref}>\n <UserRound className=\"h-4 w-4\" />\n Profile\n </Link>\n </DropdownMenuItem>\n )}\n {accountNav.map((item) => {\n const Icon = item.icon ?? labelIcon(item.label);\n return (\n <DropdownMenuItem key={item.href} asChild>\n <Link href={item.href}>\n <Icon className=\"h-4 w-4\" />\n {item.label}\n </Link>\n </DropdownMenuItem>\n );\n })}\n {(profileHref || accountNav.length > 0) && (\n <DropdownMenuSeparator />\n )}\n <DropdownMenuItem\n variant=\"destructive\"\n disabled={logout.isPending}\n onClick={() => logout.mutate()}\n >\n <LogOut className=\"h-4 w-4\" />\n {logout.isPending ? 'Logging out...' : 'Sign Out'}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n\n {/* Mobile hamburger */}\n <button\n type=\"button\"\n aria-label={isDrawerOpen ? 'Close menu' : 'Open menu'}\n className=\"inline-flex h-10 w-10 items-center justify-center rounded-md border border-gray-300 hover:bg-gray-50 md:hidden\"\n onClick={() => setIsDrawerOpen(!isDrawerOpen)}\n >\n {isDrawerOpen ? (\n <X className=\"h-5 w-5\" />\n ) : (\n <Menu className=\"h-5 w-5\" />\n )}\n </button>\n </div>\n\n {/* Mobile right drawer */}\n {isDrawerOpen && (\n <div\n className=\"fixed inset-0 z-[30] duration-200 md:hidden\"\n onClick={() => setIsDrawerOpen(false)}\n />\n )}\n\n <div\n className={cn(\n 'fixed top-0 right-0 z-[31] h-[100svh] w-full max-w-[92%] border-l border-gray-200 bg-white shadow-xl sm:max-w-[420px] md:hidden',\n 'transition-transform duration-250 ease-out',\n isDrawerOpen ? 'translate-x-0' : 'translate-x-full',\n )}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Mobile menu\"\n >\n <div className=\"flex h-full flex-col\">\n <div className=\"mt-1 flex items-center justify-between border-b px-4 py-3\">\n <div className=\"flex items-center gap-2\">\n <Image\n src=\"/betterinternship-logo.png\"\n alt=\"\"\n width={25}\n height={25}\n className=\"h-6 w-6 rounded object-contain\"\n />\n <span className=\"text-sm font-semibold\">Partners</span>\n <span className=\"rounded border border-gray-200 bg-gray-50 px-1 py-0 text-[10px] font-medium text-gray-400 leading-none\">\n {portal}\n </span>\n </div>\n <button\n type=\"button\"\n aria-label=\"Close menu\"\n className=\"inline-flex h-9 w-9 items-center justify-center rounded-md transition-colors hover:bg-gray-100\"\n onClick={() => setIsDrawerOpen(false)}\n >\n <X className=\"h-5 w-5\" />\n </button>\n </div>\n\n <div className=\"flex-1 overflow-y-auto p-4\">\n {userPrimary && (\n <div className=\"flex items-center gap-2 pb-2\">\n <UserRound className=\"h-5 w-5 text-gray-500\" />\n <span className=\"text-sm font-semibold text-gray-900\">\n {userPrimary}\n </span>\n </div>\n )}\n\n <Separator className=\"my-4\" />\n\n <nav className=\"space-y-1\">\n {nav.map((item) => {\n const Icon = item.icon ?? labelIcon(item.label);\n return (\n <Link\n key={item.href}\n href={item.href}\n className=\"block w-full\"\n >\n <button className=\"flex w-full items-center justify-between rounded-md border border-transparent px-3 py-2 text-sm transition-colors hover:border-gray-200 hover:bg-gray-50\">\n <div className=\"flex items-center gap-2\">\n <Icon className=\"h-4 w-4 text-gray-500\" />\n <span>{item.label}</span>\n {!!item.badge && (\n <span className=\"inline-flex h-4 w-4 items-center justify-center rounded-full bg-amber-400 text-[10px] font-bold leading-none text-amber-900\">\n !\n </span>\n )}\n </div>\n <ChevronRight className=\"h-4 w-4 text-gray-300\" />\n </button>\n </Link>\n );\n })}\n </nav>\n </div>\n\n <div className=\"mt-auto border-t px-4 py-3 space-y-1\">\n {profileHref && (\n <Link href={profileHref} className=\"block w-full\">\n <button className=\"flex w-full items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors hover:bg-gray-50\">\n <UserRound className=\"h-4 w-4\" />\n Profile\n </button>\n </Link>\n )}\n {accountNav.map((item) => {\n const Icon = item.icon ?? labelIcon(item.label);\n return (\n <Link key={item.href} href={item.href} className=\"block w-full\">\n <button className=\"flex w-full items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors hover:bg-gray-50\">\n <Icon className=\"h-4 w-4\" />\n {item.label}\n </button>\n </Link>\n );\n })}\n <button\n onClick={() => logout.mutate()}\n disabled={logout.isPending}\n className=\"flex w-full items-center justify-center gap-2 rounded-md py-2 font-medium text-red-600 transition-colors hover:bg-red-50\"\n >\n <LogOut className=\"h-4 w-4\" />\n {logout.isPending ? 'Logging out...' : 'Sign Out'}\n </button>\n </div>\n </div>\n </div>\n </header>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;AAuDA,SAAS,SAAS,CAAC,KAAa,EAAA;AAC9B,IAAA,MAAM,GAAG,GAA+B;AACtC,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,QAAQ,EAAE,KAAK;AACf,QAAA,cAAc,EAAE,OAAO;AACvB,QAAA,eAAe,EAAE,QAAQ;AACzB,QAAA,YAAY,EAAE,aAAa;AAC3B,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,WAAW;AAC9B,QAAA,aAAa,EAAE,aAAa;AAC5B,QAAA,SAAS,EAAE,eAAe;KAC3B;AACD,IAAA,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,SAAS;AAChC;AAEM,SAAU,SAAS,CAAC,EACxB,MAAM,EACN,QAAQ,EACR,GAAG,EACH,WAAW,EACX,MAAM,EAAE,QAAQ,EAChB,cAAc,EACd,WAAW,EACX,aAAa,EACb,UAAU,GAAG,EAAE,GACA,EAAA;AACf,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,IAAI,EAAE;AACpC,IAAA,MAAM,MAAM,GAAG,SAAS,EAAE;AAC1B,IAAA,MAAM,WAAW,GAAG,cAAc,EAAE;IACpC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEvD,SAAS,CAAC,MAAK;QACb,eAAe,CAAC,KAAK,CAAC;AACxB,IAAA,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAEd,SAAS,CAAC,MAAK;A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SAAS,EAAC,0HAA0H,EAAA,QAAA,EAAA,CAEpIC,GAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,SAAS,EAAA,CAAG,EAC7B,MAAM,CAAC,SAAS,GAAG,gBAAgB,GAAG,UAAU,CAAA,EAAA,CAC1C,IACL,CAAA,EAAA,CACF,EAAA,CACF,CAAA,EAAA,CACC;AAEb;;;;"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
3
|
import { cn } from '../../utils.js';
|
|
4
4
|
|
|
5
5
|
function Avatar({ className, ...props }) {
|
|
6
|
-
return (
|
|
6
|
+
return (jsx(AvatarPrimitive.Root, { "data-slot": "avatar", className: cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className), ...props }));
|
|
7
7
|
}
|
|
8
8
|
function AvatarImage({ className, ...props }) {
|
|
9
|
-
return (
|
|
9
|
+
return (jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn('aspect-square size-full', className), ...props }));
|
|
10
10
|
}
|
|
11
11
|
function AvatarFallback({ className, ...props }) {
|
|
12
|
-
return (
|
|
12
|
+
return (jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('bg-muted flex size-full items-center justify-center rounded-full', className), ...props }));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export { Avatar, AvatarFallback, AvatarImage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sources":["../../../src/components/ui/avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\n\nimport { cn } from '@/utils';\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n 'relative flex size-8 shrink-0 overflow-hidden rounded-full',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('aspect-square size-full', className)}\n {...props}\n />\n );\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'bg-muted flex size-full items-center justify-center rounded-full',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Avatar, AvatarImage, AvatarFallback };\n"],"names":["_jsx"],"mappings":";;;;AAKA,SAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EAC0C,EAAA;IAClD,QACEA,
|
|
1
|
+
{"version":3,"file":"avatar.js","sources":["../../../src/components/ui/avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\n\nimport { cn } from '@/utils';\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n 'relative flex size-8 shrink-0 overflow-hidden rounded-full',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('aspect-square size-full', className)}\n {...props}\n />\n );\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'bg-muted flex size-full items-center justify-center rounded-full',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Avatar, AvatarImage, AvatarFallback };\n"],"names":["_jsx"],"mappings":";;;;AAKA,SAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EAC0C,EAAA;IAClD,QACEA,IAAC,eAAe,CAAC,IAAI,EAAA,EAAA,WAAA,EACT,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,4DAA4D,EAC5D,SAAS,CACV,KACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EAC2C,EAAA;IACnD,QACEA,IAAC,eAAe,CAAC,KAAK,EAAA,EAAA,WAAA,EACV,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,KAC/C,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EAC8C,EAAA;IACtD,QACEA,IAAC,eAAe,CAAC,QAAQ,EAAA,EAAA,WAAA,EACb,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CACX,kEAAkE,EAClE,SAAS,CACV,KACG,KAAK,EAAA,CACT;AAEN;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { cva } from '../../node_modules/class-variance-authority/dist/index.js';
|
|
3
3
|
import { cn } from '../../utils.js';
|
|
4
4
|
import { BooleanCheckIcon } from './icons.js';
|
|
@@ -102,11 +102,11 @@ const badgeVariants = cva([
|
|
|
102
102
|
},
|
|
103
103
|
});
|
|
104
104
|
function Badge({ className, variant, type, strength, ...props }) {
|
|
105
|
-
return (
|
|
105
|
+
return (jsx("div", { className: cn(badgeVariants({ variant, type, strength }), className), ...props }));
|
|
106
106
|
}
|
|
107
107
|
Badge.displayName = 'Badge';
|
|
108
108
|
function BoolBadge({ state, onValue, offValue, onScheme = 'supportive', offScheme = 'accent', className = '', ...props }) {
|
|
109
|
-
return (
|
|
109
|
+
return (jsxs(Badge, { variant: "solid", type: state ? onScheme : offScheme, ...props, className: cn('pointer-events-none rounded-[0.33em]', className), children: [jsx(BooleanCheckIcon, { checked: state }), state ? onValue : offValue] }));
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
export { Badge, BoolBadge };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["../../../src/components/ui/badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/utils';\nimport { BooleanCheckIcon } from './icons';\n\nconst badgeVariants = cva(\n [\n 'border',\n 'cursor-default',\n 'font-semibold',\n 'inline-flex',\n 'items-center',\n 'px-[0.75em]',\n 'py-[0.25em]',\n 'rounded-[0.33em]',\n 'select-none',\n 'text-xs',\n 'transition-colors',\n 'whitespace-nowrap',\n ],\n {\n variants: {\n variant: {\n outline: ['bg-transparent', 'border-opacity-70'],\n solid: ['border-transparent'],\n },\n type: {\n default: [],\n primary: [],\n accent: [],\n supportive: [],\n warning: [],\n destructive: [],\n },\n strength: {\n default: ['opacity-100'],\n medium: ['opacity-80'],\n light: ['opacity-50'],\n invisible: ['opacity-0'],\n },\n },\n compoundVariants: [\n {\n variant: 'outline',\n type: 'default',\n class: 'border-gray-400 text-gray-600',\n },\n {\n variant: 'outline',\n type: 'primary',\n class: 'border-primary/80 text-primary',\n },\n {\n variant: 'outline',\n type: 'accent',\n class: 'border-accent/80 text-accent',\n },\n {\n variant: 'outline',\n type: 'supportive',\n class: 'border-supportive/80 text-supportive',\n },\n {\n variant: 'outline',\n type: 'warning',\n class: 'border-warning/80 text-warning',\n },\n {\n variant: 'outline',\n type: 'destructive',\n class: 'border-destructive/80 text-destructive',\n },\n { variant: 'solid', type: 'default', class: 'bg-gray-100 text-gray-700' },\n {\n variant: 'solid',\n type: 'primary',\n class: 'bg-primary text-primary-foreground',\n },\n {\n variant: 'solid',\n type: 'accent',\n class: 'bg-accent text-accent-foreground',\n },\n {\n variant: 'solid',\n type: 'supportive',\n class: 'bg-supportive text-supportive-foreground',\n },\n {\n variant: 'solid',\n type: 'warning',\n class: 'bg-warning text-warning-foreground',\n },\n {\n variant: 'solid',\n type: 'destructive',\n class: 'bg-destructive text-destructive-foreground',\n },\n ],\n defaultVariants: {\n variant: 'outline',\n type: 'default',\n strength: 'default',\n },\n },\n);\n\nexport interface BadgeProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nexport function Badge({\n className,\n variant,\n type,\n strength,\n ...props\n}: BadgeProps) {\n return (\n <div\n className={cn(badgeVariants({ variant, type, strength }), className)}\n {...props}\n />\n );\n}\nBadge.displayName = 'Badge';\n\nexport function BoolBadge({\n state,\n onValue,\n offValue,\n onScheme = 'supportive',\n offScheme = 'accent',\n className = '',\n ...props\n}: {\n state: boolean | null | undefined;\n onValue: string;\n offValue: string;\n onScheme?: 'default' | 'primary' | 'accent' | 'supportive' | 'destructive';\n offScheme?: 'default' | 'primary' | 'accent' | 'supportive' | 'destructive';\n className?: string;\n}) {\n return (\n <Badge\n variant=\"solid\"\n type={state ? onScheme : offScheme}\n {...props}\n className={cn('pointer-events-none rounded-[0.33em]', className)}\n >\n <BooleanCheckIcon checked={state} />\n {state ? onValue : offValue}\n </Badge>\n );\n}\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAMA,MAAM,aAAa,GAAG,GAAG,CACvB;IACE,QAAQ;IACR,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,cAAc;IACd,aAAa;IACb,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,SAAS;IACT,mBAAmB;IACnB,mBAAmB;CACpB,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;YAChD,KAAK,EAAE,CAAC,oBAAoB,CAAC;AAC9B,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,MAAM,EAAE,EAAE;AACV,Y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;AAChB,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,KAAK,EAAE,kCAAkC;AAC1C,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,IAAI,EAAE,YAAY;AAClB,YAAA,KAAK,EAAE,0CAA0C;AAClD,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,oCAAoC;AAC5C,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,KAAK,EAAE,4CAA4C;AACpD,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,QAAQ,EAAE,SAAS;AACpB,KAAA;AACF,CAAA,CACF;AAOK,SAAU,KAAK,CAAC,EACpB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACG,EAAA;IACX,QACEA
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../src/components/ui/badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/utils';\nimport { BooleanCheckIcon } from './icons';\n\nconst badgeVariants = cva(\n [\n 'border',\n 'cursor-default',\n 'font-semibold',\n 'inline-flex',\n 'items-center',\n 'px-[0.75em]',\n 'py-[0.25em]',\n 'rounded-[0.33em]',\n 'select-none',\n 'text-xs',\n 'transition-colors',\n 'whitespace-nowrap',\n ],\n {\n variants: {\n variant: {\n outline: ['bg-transparent', 'border-opacity-70'],\n solid: ['border-transparent'],\n },\n type: {\n default: [],\n primary: [],\n accent: [],\n supportive: [],\n warning: [],\n destructive: [],\n },\n strength: {\n default: ['opacity-100'],\n medium: ['opacity-80'],\n light: ['opacity-50'],\n invisible: ['opacity-0'],\n },\n },\n compoundVariants: [\n {\n variant: 'outline',\n type: 'default',\n class: 'border-gray-400 text-gray-600',\n },\n {\n variant: 'outline',\n type: 'primary',\n class: 'border-primary/80 text-primary',\n },\n {\n variant: 'outline',\n type: 'accent',\n class: 'border-accent/80 text-accent',\n },\n {\n variant: 'outline',\n type: 'supportive',\n class: 'border-supportive/80 text-supportive',\n },\n {\n variant: 'outline',\n type: 'warning',\n class: 'border-warning/80 text-warning',\n },\n {\n variant: 'outline',\n type: 'destructive',\n class: 'border-destructive/80 text-destructive',\n },\n { variant: 'solid', type: 'default', class: 'bg-gray-100 text-gray-700' },\n {\n variant: 'solid',\n type: 'primary',\n class: 'bg-primary text-primary-foreground',\n },\n {\n variant: 'solid',\n type: 'accent',\n class: 'bg-accent text-accent-foreground',\n },\n {\n variant: 'solid',\n type: 'supportive',\n class: 'bg-supportive text-supportive-foreground',\n },\n {\n variant: 'solid',\n type: 'warning',\n class: 'bg-warning text-warning-foreground',\n },\n {\n variant: 'solid',\n type: 'destructive',\n class: 'bg-destructive text-destructive-foreground',\n },\n ],\n defaultVariants: {\n variant: 'outline',\n type: 'default',\n strength: 'default',\n },\n },\n);\n\nexport interface BadgeProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nexport function Badge({\n className,\n variant,\n type,\n strength,\n ...props\n}: BadgeProps) {\n return (\n <div\n className={cn(badgeVariants({ variant, type, strength }), className)}\n {...props}\n />\n );\n}\nBadge.displayName = 'Badge';\n\nexport function BoolBadge({\n state,\n onValue,\n offValue,\n onScheme = 'supportive',\n offScheme = 'accent',\n className = '',\n ...props\n}: {\n state: boolean | null | undefined;\n onValue: string;\n offValue: string;\n onScheme?: 'default' | 'primary' | 'accent' | 'supportive' | 'destructive';\n offScheme?: 'default' | 'primary' | 'accent' | 'supportive' | 'destructive';\n className?: string;\n}) {\n return (\n <Badge\n variant=\"solid\"\n type={state ? onScheme : offScheme}\n {...props}\n className={cn('pointer-events-none rounded-[0.33em]', className)}\n >\n <BooleanCheckIcon checked={state} />\n {state ? onValue : offValue}\n </Badge>\n );\n}\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAMA,MAAM,aAAa,GAAG,GAAG,CACvB;IACE,QAAQ;IACR,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,cAAc;IACd,aAAa;IACb,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,SAAS;IACT,mBAAmB;IACnB,mBAAmB;CACpB,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;YAChD,KAAK,EAAE,CAAC,oBAAoB,CAAC;AAC9B,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,MAAM,EAAE,EAAE;AACV,YAAA,UAAU,EAAE,EAAE;AACd,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,WAAW,EAAE,EAAE;AAChB,SAAA;AACD,QAAA,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,aAAa,CAAC;YACxB,MAAM,EAAE,CAAC,YAAY,CAAC;YACtB,KAAK,EAAE,CAAC,YAAY,CAAC;YACrB,SAAS,EAAE,CAAC,WAAW,CAAC;AACzB,SAAA;AACF,KAAA;AACD,IAAA,gBAAgB,EAAE;AAChB,QAAA;AACE,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,+BAA+B;AACvC,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,KAAK,EAAE,gCAAgC;AACxC,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,KAAK,EAAE,8BAA8B;AACtC,SAAA;AACD,QAAA;AACE,YAAA,OAAO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EA,aACE,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,EAAA,GAChE,KAAK,EAAA,CACT;AAEN;AACA,KAAK,CAAC,WAAW,GAAG,OAAO;AAErB,SAAU,SAAS,CAAC,EACxB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,YAAY,EACvB,SAAS,GAAG,QAAQ,EACpB,SAAS,GAAG,EAAE,EACd,GAAG,KAAK,EAQT,EAAA;IACC,QACEC,KAAC,KAAK,EAAA,EACJ,OAAO,EAAC,OAAO,EACf,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,EAAA,GAC9B,KAAK,EACT,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CAEhED,IAAC,gBAAgB,EAAA,EAAC,OAAO,EAAE,KAAK,EAAA,CAAI,EACnC,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA,EAAA,CACrB;AAEZ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { Slot } from '@radix-ui/react-slot';
|
|
4
4
|
import { cva } from '../../node_modules/class-variance-authority/dist/index.js';
|
|
@@ -80,7 +80,7 @@ const buttonVariants = cva([
|
|
|
80
80
|
});
|
|
81
81
|
const Button = React__default.forwardRef(({ className, variant, scheme, size, expandIcon, asChild = false, ...props }, ref) => {
|
|
82
82
|
const Comp = asChild ? Slot : 'button';
|
|
83
|
-
return (
|
|
83
|
+
return (jsx(Comp, { className: cn(buttonVariants({ variant, scheme, size, expandIcon, className })), ref: ref, ...props }));
|
|
84
84
|
});
|
|
85
85
|
Button.displayName = 'Button';
|
|
86
86
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/utils';\n\nconst buttonVariants = cva(\n [\n 'inline-flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'whitespace-nowrap',\n 'rounded-[0.33em]',\n 'text-sm',\n 'font-medium',\n 'transition-colors',\n 'cursor-pointer',\n 'focus:outline-none',\n 'focus:ring-transparent',\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n '[&_svg]:pointer-events-none',\n '[&_svg]:size-4',\n '[&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n outline:\n 'border border-gray-300 text-gray-700 bg-background hover:bg-accent',\n ghost: 'hover:bg-accent text-gray-700 hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n scheme: {\n default: '',\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90',\n supportive:\n 'bg-supportive text-supportive-foreground hover:bg-supportive/90',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n },\n size: {\n default: 'h-8 px-[1em] py-[0.33em]',\n sm: 'h-8 px-3',\n lg: 'h-11 px-8',\n md: 'h-10 px-6',\n icon: 'h-10 w-10',\n xs: 'h-6 px-3 text-xs',\n },\n expandIcon: {\n true: 'max-w-8 gap-0 overflow-hidden px-2 transition-[max-width,padding,gap] duration-200 hover:max-w-48 hover:gap-2 hover:px-3 focus-visible:max-w-48 focus-visible:gap-2 focus-visible:px-3 [&_.button-label]:max-w-0 [&_.button-label]:overflow-hidden [&_.button-label]:opacity-0 [&_.button-label]:transition-[max-width,opacity] [&_.button-label]:duration-200 hover:[&_.button-label]:max-w-40 hover:[&_.button-label]:opacity-100 focus-visible:[&_.button-label]:max-w-40 focus-visible:[&_.button-label]:opacity-100',\n false: '',\n },\n },\n compoundVariants: [\n {\n variant: 'outline',\n scheme: 'primary',\n class:\n 'bg-background border border-primary text-primary hover:bg-blue-50',\n },\n {\n variant: 'outline',\n scheme: 'supportive',\n class:\n 'bg-background border border-supportive text-supportive hover:bg-green-50',\n },\n {\n variant: 'outline',\n scheme: 'destructive',\n class:\n 'bg-background border border-destructive text-destructive hover:bg-red-50',\n },\n {\n variant: 'ghost',\n scheme: 'destructive',\n class:\n 'bg-transparent text-destructive hover:bg-red-50 hover:text-destructive',\n },\n ],\n defaultVariants: {\n variant: 'default',\n size: 'default',\n expandIcon: false,\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, variant, scheme, size, expandIcon, asChild = false, ...props },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button';\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, scheme, size, expandIcon, className }),\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\n"],"names":["React","_jsx"],"mappings":";;;;;;AAMA,MAAM,cAAc,GAAG,GAAG,CACxB;IACE,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,mBAAmB;IACnB,kBAAkB;IAClB,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,wBAAwB;IACxB,8BAA8B;IAC9B,qBAAqB;IACrB,6BAA6B;IAC7B,gBAAgB;IAChB,kBAAkB;CACnB,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,wDAAwD;AACjE,YAAA,OAAO,EACL,oEAAoE;AACtE,YAAA,KAAK,EAAE,4DAA4D;AACnE,YAAA,IAAI,EAAE,iDAAiD;AACxD,SAAA;AACD,QAAA,MAAM,EAAE;AACN,Y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OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAC3E,GAAG,KACD;IACF,MAAM,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,QAAQ;AACtC,IAAA,QACEC,
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/utils';\n\nconst buttonVariants = cva(\n [\n 'inline-flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'whitespace-nowrap',\n 'rounded-[0.33em]',\n 'text-sm',\n 'font-medium',\n 'transition-colors',\n 'cursor-pointer',\n 'focus:outline-none',\n 'focus:ring-transparent',\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n '[&_svg]:pointer-events-none',\n '[&_svg]:size-4',\n '[&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n outline:\n 'border border-gray-300 text-gray-700 bg-background hover:bg-accent',\n ghost: 'hover:bg-accent text-gray-700 hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n scheme: {\n default: '',\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90',\n supportive:\n 'bg-supportive text-supportive-foreground hover:bg-supportive/90',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n },\n size: {\n default: 'h-8 px-[1em] py-[0.33em]',\n sm: 'h-8 px-3',\n lg: 'h-11 px-8',\n md: 'h-10 px-6',\n icon: 'h-10 w-10',\n xs: 'h-6 px-3 text-xs',\n },\n expandIcon: {\n true: 'max-w-8 gap-0 overflow-hidden px-2 transition-[max-width,padding,gap] duration-200 hover:max-w-48 hover:gap-2 hover:px-3 focus-visible:max-w-48 focus-visible:gap-2 focus-visible:px-3 [&_.button-label]:max-w-0 [&_.button-label]:overflow-hidden [&_.button-label]:opacity-0 [&_.button-label]:transition-[max-width,opacity] [&_.button-label]:duration-200 hover:[&_.button-label]:max-w-40 hover:[&_.button-label]:opacity-100 focus-visible:[&_.button-label]:max-w-40 focus-visible:[&_.button-label]:opacity-100',\n false: '',\n },\n },\n compoundVariants: [\n {\n variant: 'outline',\n scheme: 'primary',\n class:\n 'bg-background border border-primary text-primary hover:bg-blue-50',\n },\n {\n variant: 'outline',\n scheme: 'supportive',\n class:\n 'bg-background border border-supportive text-supportive hover:bg-green-50',\n },\n {\n variant: 'outline',\n scheme: 'destructive',\n class:\n 'bg-background border border-destructive text-destructive hover:bg-red-50',\n },\n {\n variant: 'ghost',\n scheme: 'destructive',\n class:\n 'bg-transparent text-destructive hover:bg-red-50 hover:text-destructive',\n },\n ],\n defaultVariants: {\n variant: 'default',\n size: 'default',\n expandIcon: false,\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, variant, scheme, size, expandIcon, asChild = false, ...props },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button';\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, scheme, size, expandIcon, className }),\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\n"],"names":["React","_jsx"],"mappings":";;;;;;AAMA,MAAM,cAAc,GAAG,GAAG,CACxB;IACE,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,mBAAmB;IACnB,kBAAkB;IAClB,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,wBAAwB;IACxB,8BAA8B;IAC9B,qBAAqB;IACrB,6BAA6B;IAC7B,gBAAgB;IAChB,kBAAkB;CACnB,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAA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AS;AACf,QAAA,UAAU,EAAE,KAAK;AAClB,KAAA;AACF,CAAA;AAUH,MAAM,MAAM,GAAGA,cAAK,CAAC,UAAU,CAC7B,CACE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAC3E,GAAG,KACD;IACF,MAAM,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,QAAQ;AACtC,IAAA,QACEC,GAAA,CAAC,IAAI,EAAA,EACH,SAAS,EAAE,EAAE,CACX,cAAc,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CACjE,EACD,GAAG,EAAE,GAAG,EAAA,GACJ,KAAK,EAAA,CACT;AAEN,CAAC;AAEH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { cn } from '../../utils.js';
|
|
3
3
|
|
|
4
4
|
function Card({ className, ...props }) {
|
|
5
|
-
return (
|
|
5
|
+
return (jsx("div", { "data-slot": "card", className: cn('bg-card text-card-foreground flex flex-col gap-6 rounded-[0.33em] border border-gray-300 py-4', className), ...props }));
|
|
6
6
|
}
|
|
7
7
|
function CardHeader({ className, ...props }) {
|
|
8
|
-
return (
|
|
8
|
+
return (jsx("div", { "data-slot": "card-header", className: cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6', className), ...props }));
|
|
9
9
|
}
|
|
10
10
|
function CardTitle({ className, ...props }) {
|
|
11
|
-
return (
|
|
11
|
+
return (jsx("div", { "data-slot": "card-title", className: cn('leading-none font-semibold', className), ...props }));
|
|
12
12
|
}
|
|
13
13
|
function CardDescription({ className, ...props }) {
|
|
14
|
-
return (
|
|
14
|
+
return (jsx("div", { "data-slot": "card-description", className: cn('text-muted-foreground text-sm', className), ...props }));
|
|
15
15
|
}
|
|
16
16
|
function CardAction({ className, ...props }) {
|
|
17
|
-
return (
|
|
17
|
+
return (jsx("div", { "data-slot": "card-action", className: cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className), ...props }));
|
|
18
18
|
}
|
|
19
19
|
function CardContent({ className, ...props }) {
|
|
20
|
-
return (
|
|
20
|
+
return (jsx("div", { "data-slot": "card-content", className: cn('px-6', className), ...props }));
|
|
21
21
|
}
|
|
22
22
|
function CardFooter({ className, ...props }) {
|
|
23
|
-
return (
|
|
23
|
+
return (jsx("div", { "data-slot": "card-footer", className: cn('flex items-center px-6 [.border-t]:pt-6', className), ...props }));
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sources":["../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nfunction Card({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n 'bg-card text-card-foreground flex flex-col gap-6 rounded-[0.33em] border border-gray-300 py-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n 'col-start-2 row-span-2 row-start-1 self-start justify-self-end',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('px-6', className)}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center px-6 [.border-t]:pt-6', className)}\n {...props}\n />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n};\n"],"names":["_jsx"],"mappings":";;;AAIA,SAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AAChE,IAAA,QACEA,
|
|
1
|
+
{"version":3,"file":"card.js","sources":["../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nfunction Card({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n 'bg-card text-card-foreground flex flex-col gap-6 rounded-[0.33em] border border-gray-300 py-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n 'col-start-2 row-span-2 row-start-1 self-start justify-self-end',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('px-6', className)}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center px-6 [.border-t]:pt-6', className)}\n {...props}\n />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n};\n"],"names":["_jsx"],"mappings":";;;AAIA,SAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AAChE,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,MAAM,EAChB,SAAS,EAAE,EAAE,CACX,+FAA+F,EAC/F,SAAS,CACV,EAAA,GACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AACtE,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,aAAa,EACvB,SAAS,EAAE,EAAE,CACX,4JAA4J,EAC5J,SAAS,CACV,EAAA,GACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AACrE,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,YAAY,EACtB,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,EAAA,GAClD,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AAC3E,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,kBAAkB,EAC5B,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,EAAA,GACrD,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AACtE,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,aAAa,EACvB,SAAS,EAAE,EAAE,CACX,gEAAgE,EAChE,SAAS,CACV,EAAA,GACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AACvE,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAA,GAC5B,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AACtE,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,yCAAyC,EAAE,SAAS,CAAC,EAAA,GAC/D,KAAK,EAAA,CACT;AAEN;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
3
|
import { CheckIcon } from 'lucide-react';
|
|
4
4
|
import { cn } from '../../utils.js';
|
|
5
5
|
|
|
6
6
|
function Checkbox({ className, ...props }) {
|
|
7
|
-
return (
|
|
7
|
+
return (jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", onClick: (e) => e.stopPropagation(), className: cn('peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center text-current transition-none", children: jsx(CheckIcon, { className: "size-3.5" }) }) }));
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export { Checkbox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../../src/components/ui/checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n onClick={(e) => e.stopPropagation()}\n className={cn(\n 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"names":["_jsx"],"mappings":";;;;;AAMA,SAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EAC4C,EAAA;IACpD,QACEA,
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../src/components/ui/checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n onClick={(e) => e.stopPropagation()}\n className={cn(\n 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"names":["_jsx"],"mappings":";;;;;AAMA,SAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EAC4C,EAAA;IACpD,QACEA,GAAA,CAAC,iBAAiB,CAAC,IAAI,iBACX,UAAU,EACpB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,EACnC,SAAS,EAAE,EAAE,CACX,4fAA4f,EAC5f,SAAS,CACV,EAAA,GACG,KAAK,EAAA,QAAA,EAETA,GAAA,CAAC,iBAAiB,CAAC,SAAS,EAAA,EAAA,WAAA,EAChB,oBAAoB,EAC9B,SAAS,EAAC,+DAA+D,EAAA,QAAA,EAEzEA,GAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAC,UAAU,EAAA,CAAG,EAAA,CACN,EAAA,CACP;AAE7B;;;;"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
3
|
import { XIcon } from 'lucide-react';
|
|
4
4
|
import { cn } from '../../utils.js';
|
|
5
5
|
|
|
6
6
|
function Dialog({ ...props }) {
|
|
7
|
-
return
|
|
7
|
+
return jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
8
8
|
}
|
|
9
9
|
function DialogTrigger({ ...props }) {
|
|
10
|
-
return
|
|
10
|
+
return jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
11
11
|
}
|
|
12
12
|
function DialogPortal({ ...props }) {
|
|
13
|
-
return
|
|
13
|
+
return jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
14
14
|
}
|
|
15
15
|
function DialogClose({ ...props }) {
|
|
16
|
-
return
|
|
16
|
+
return jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
17
17
|
}
|
|
18
18
|
function DialogOverlay({ className, ...props }) {
|
|
19
|
-
return (
|
|
19
|
+
return (jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50', className), ...props }));
|
|
20
20
|
}
|
|
21
21
|
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
22
|
-
return (
|
|
22
|
+
return (jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [jsx(DialogOverlay, {}), jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn('bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg', className), ...props, children: [children, showCloseButton && (jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [jsx(XIcon, {}), jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
|
|
23
23
|
}
|
|
24
24
|
function DialogHeader({ className, ...props }) {
|
|
25
|
-
return (
|
|
25
|
+
return (jsx("div", { "data-slot": "dialog-header", className: cn('flex flex-col gap-2 text-center sm:text-left', className), ...props }));
|
|
26
26
|
}
|
|
27
27
|
function DialogFooter({ className, ...props }) {
|
|
28
|
-
return (
|
|
28
|
+
return (jsx("div", { "data-slot": "dialog-footer", className: cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className), ...props }));
|
|
29
29
|
}
|
|
30
30
|
function DialogTitle({ className, ...props }) {
|
|
31
|
-
return (
|
|
31
|
+
return (jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn('text-lg leading-none font-semibold', className), ...props }));
|
|
32
32
|
}
|
|
33
33
|
function DialogDescription({ className, ...props }) {
|
|
34
|
-
return (
|
|
34
|
+
return (jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn('text-muted-foreground text-sm', className), ...props }));
|
|
35
35
|
}
|
|
36
36
|
function DialogBottomSheet({ className, children, showCloseButton = true, ...props }) {
|
|
37
|
-
return (
|
|
37
|
+
return (jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [jsx(DialogOverlay, {}), jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn('bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom fixed bottom-0 left-0 right-0 z-50 w-full rounded-t-xl border-t shadow-lg duration-300', className), ...props, children: [children, showCloseButton && (jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [jsx(XIcon, {}), jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export { Dialog, DialogBottomSheet, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction DialogBottomSheet({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom fixed bottom-0 left-0 right-0 z-50 w-full rounded-t-xl border-t shadow-lg duration-300',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nexport {\n Dialog,\n DialogBottomSheet,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAMA,SAAS,MAAM,CAAC,EACd,GAAG,KAAK,EAC0C,EAAA;IAClD,OAAOA,
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction DialogBottomSheet({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom fixed bottom-0 left-0 right-0 z-50 w-full rounded-t-xl border-t shadow-lg duration-300',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nexport {\n Dialog,\n DialogBottomSheet,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAMA,SAAS,MAAM,CAAC,EACd,GAAG,KAAK,EAC0C,EAAA;IAClD,OAAOA,GAAA,CAAC,eAAe,CAAC,IAAI,iBAAW,QAAQ,EAAA,GAAK,KAAK,EAAA,CAAI;AAC/D;AAEA,SAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EAC6C,EAAA;IACrD,OAAOA,GAAA,CAAC,eAAe,CAAC,OAAO,iBAAW,gBAAgB,EAAA,GAAK,KAAK,EAAA,CAAI;AAC1E;AAEA,SAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EAC4C,EAAA;IACpD,OAAOA,GAAA,CAAC,eAAe,CAAC,MAAM,iBAAW,eAAe,EAAA,GAAK,KAAK,EAAA,CAAI;AACxE;AAEA,SAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EAC2C,EAAA;IACnD,OAAOA,GAAA,CAAC,eAAe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