@flowselections/core 1.0.8 → 1.0.10
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/auth/useAuth.d.ts +27 -27
- package/dist/auth/useAuth.js +72 -72
- package/dist/components/instellingen/NotificationSettingsCard.d.ts +1 -1
- package/dist/components/instellingen/NotificationSettingsCard.js +63 -63
- package/dist/components/layout/BugsDialog.d.ts +6 -6
- package/dist/components/layout/BugsDialog.js +148 -148
- package/dist/components/layout/Header.d.ts +5 -5
- package/dist/components/layout/Header.d.ts.map +1 -1
- package/dist/components/layout/Header.js +11 -30
- package/dist/components/layout/InstellingenPage.d.ts +4 -4
- package/dist/components/layout/InstellingenPage.js +78 -78
- package/dist/components/layout/LoginPage.d.ts +5 -5
- package/dist/components/layout/LoginPage.js +57 -57
- package/dist/components/layout/NotificationBell.d.ts +1 -1
- package/dist/components/layout/NotificationBell.js +45 -45
- package/dist/components/layout/ResetWachtwoordPage.d.ts +5 -5
- package/dist/components/layout/ResetWachtwoordPage.js +51 -51
- package/dist/components/layout/Sidebar.d.ts +8 -8
- package/dist/components/layout/Sidebar.d.ts.map +1 -1
- package/dist/components/layout/Sidebar.js +29 -31
- package/dist/components/ui/accordion.d.ts +7 -7
- package/dist/components/ui/accordion.js +13 -13
- package/dist/components/ui/alert-dialog.d.ts +20 -20
- package/dist/components/ui/alert-dialog.js +26 -26
- package/dist/components/ui/alert.d.ts +8 -8
- package/dist/components/ui/alert.js +22 -22
- package/dist/components/ui/aspect-ratio.d.ts +3 -3
- package/dist/components/ui/aspect-ratio.js +3 -3
- package/dist/components/ui/avatar.d.ts +6 -6
- package/dist/components/ui/avatar.js +12 -12
- package/dist/components/ui/badge.d.ts +9 -9
- package/dist/components/ui/badge.js +20 -20
- package/dist/components/ui/breadcrumb.d.ts +19 -19
- package/dist/components/ui/breadcrumb.js +23 -23
- package/dist/components/ui/button.d.ts +11 -11
- package/dist/components/ui/button.js +33 -33
- package/dist/components/ui/calendar.d.ts +8 -8
- package/dist/components/ui/calendar.js +74 -74
- package/dist/components/ui/card.d.ts +8 -8
- package/dist/components/ui/card.js +16 -16
- package/dist/components/ui/carousel.d.ts +18 -18
- package/dist/components/ui/carousel.js +98 -98
- package/dist/components/ui/chart.d.ts +62 -62
- package/dist/components/ui/chart.js +130 -130
- package/dist/components/ui/checkbox.d.ts +4 -4
- package/dist/components/ui/checkbox.js +8 -8
- package/dist/components/ui/collapsible.d.ts +5 -5
- package/dist/components/ui/collapsible.js +6 -6
- package/dist/components/ui/command.d.ts +80 -80
- package/dist/components/ui/command.js +29 -29
- package/dist/components/ui/context-menu.d.ts +27 -27
- package/dist/components/ui/context-menu.js +33 -33
- package/dist/components/ui/dialog.d.ts +19 -19
- package/dist/components/ui/dialog.js +23 -23
- package/dist/components/ui/drawer.d.ts +22 -22
- package/dist/components/ui/drawer.js +22 -22
- package/dist/components/ui/dropdown-menu.d.ts +27 -27
- package/dist/components/ui/dropdown-menu.js +36 -36
- package/dist/components/ui/form.d.ts +23 -23
- package/dist/components/ui/form.js +65 -65
- package/dist/components/ui/hover-card.d.ts +6 -6
- package/dist/components/ui/hover-card.js +9 -9
- package/dist/components/ui/icon-picker.d.ts +14 -14
- package/dist/components/ui/icon-picker.js +73 -73
- package/dist/components/ui/input-otp.d.ts +34 -34
- package/dist/components/ui/input-otp.js +18 -18
- package/dist/components/ui/input.d.ts +3 -3
- package/dist/components/ui/input.js +8 -8
- package/dist/components/ui/label.d.ts +5 -5
- package/dist/components/ui/label.js +10 -10
- package/dist/components/ui/menubar.d.ts +28 -28
- package/dist/components/ui/menubar.js +45 -45
- package/dist/components/ui/navigation-menu.d.ts +12 -12
- package/dist/components/ui/navigation-menu.js +24 -24
- package/dist/components/ui/pagination.d.ts +28 -28
- package/dist/components/ui/pagination.js +23 -23
- package/dist/components/ui/popover.d.ts +7 -7
- package/dist/components/ui/popover.js +10 -10
- package/dist/components/ui/progress.d.ts +4 -4
- package/dist/components/ui/progress.js +8 -8
- package/dist/components/ui/radio-group.d.ts +5 -5
- package/dist/components/ui/radio-group.js +14 -14
- package/dist/components/ui/resizable.d.ts +7 -7
- package/dist/components/ui/resizable.js +8 -8
- package/dist/components/ui/scroll-area.d.ts +5 -5
- package/dist/components/ui/scroll-area.js +11 -11
- package/dist/components/ui/select.d.ts +13 -13
- package/dist/components/ui/select.js +27 -27
- package/dist/components/ui/separator.d.ts +4 -4
- package/dist/components/ui/separator.js +7 -7
- package/dist/components/ui/sheet.d.ts +25 -25
- package/dist/components/ui/sheet.js +37 -37
- package/dist/components/ui/sidebar.d.ts +65 -65
- package/dist/components/ui/sidebar.js +224 -224
- package/dist/components/ui/skeleton.d.ts +2 -2
- package/dist/components/ui/skeleton.js +6 -6
- package/dist/components/ui/slider.d.ts +4 -4
- package/dist/components/ui/slider.js +7 -7
- package/dist/components/ui/sonner.d.ts +4 -4
- package/dist/components/ui/sonner.js +13 -13
- package/dist/components/ui/switch.d.ts +4 -4
- package/dist/components/ui/switch.js +7 -7
- package/dist/components/ui/table.d.ts +10 -10
- package/dist/components/ui/table.js +20 -20
- package/dist/components/ui/tabs.d.ts +7 -7
- package/dist/components/ui/tabs.js +12 -12
- package/dist/components/ui/textarea.d.ts +3 -3
- package/dist/components/ui/textarea.js +8 -8
- package/dist/components/ui/toggle-group.d.ts +12 -12
- package/dist/components/ui/toggle-group.js +21 -21
- package/dist/components/ui/toggle.d.ts +12 -12
- package/dist/components/ui/toggle.js +25 -25
- package/dist/components/ui/tooltip.d.ts +7 -7
- package/dist/components/ui/tooltip.js +11 -11
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.js +15 -15
- package/dist/hooks/useHuisstijl.d.ts +2 -0
- package/dist/hooks/useHuisstijl.d.ts.map +1 -0
- package/dist/hooks/useHuisstijl.js +22 -0
- package/dist/index.d.ts +32 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -33
- package/dist/lib/utils.d.ts +2 -2
- package/dist/lib/utils.js +5 -5
- package/dist/lib/validationSchemas.d.ts +14 -14
- package/dist/lib/validationSchemas.js +25 -25
- package/dist/supabase/auth-middleware.d.ts +638 -638
- package/dist/supabase/auth-middleware.js +52 -52
- package/dist/supabase/client.d.ts +634 -634
- package/dist/supabase/client.js +13 -13
- package/dist/supabase/client.server.d.ts +634 -634
- package/dist/supabase/client.server.js +30 -30
- package/dist/supabase/types.d.ts +716 -716
- package/dist/supabase/types.js +7 -7
- package/dist/types/module.d.ts +19 -19
- package/dist/types/module.js +1 -1
- package/package.json +1 -1
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Button } from "../ui/button";
|
|
4
|
-
import { Input } from "../ui/input";
|
|
5
|
-
import { Label } from "../ui/label";
|
|
6
|
-
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../ui/card";
|
|
7
|
-
import { toast } from "sonner";
|
|
8
|
-
import { loginSchema } from "../../lib/validationSchemas";
|
|
9
|
-
import { supabase } from "../../supabase/client";
|
|
10
|
-
export function LoginPage({ redirectTo }) {
|
|
11
|
-
const [email, setEmail] = useState("");
|
|
12
|
-
const [password, setPassword] = useState("");
|
|
13
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
14
|
-
const [showForgot, setShowForgot] = useState(false);
|
|
15
|
-
const [forgotEmail, setForgotEmail] = useState("");
|
|
16
|
-
const [forgotLoading, setForgotLoading] = useState(false);
|
|
17
|
-
const handleSubmit = async (e) => {
|
|
18
|
-
e.preventDefault();
|
|
19
|
-
const validation = loginSchema.safeParse({ email, password });
|
|
20
|
-
if (!validation.success) {
|
|
21
|
-
toast.error(validation.error.issues[0].message);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
setIsLoading(true);
|
|
25
|
-
const { error } = await supabase.auth.signInWithPassword({ email, password });
|
|
26
|
-
setIsLoading(false);
|
|
27
|
-
if (error) {
|
|
28
|
-
toast.error("Controleer je e-mailadres en wachtwoord.");
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
window.location.href = redirectTo;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const handleForgotPassword = async (e) => {
|
|
35
|
-
e.preventDefault();
|
|
36
|
-
if (!forgotEmail) {
|
|
37
|
-
toast.error("Vul je e-mailadres in");
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
setForgotLoading(true);
|
|
41
|
-
const { error } = await supabase.auth.resetPasswordForEmail(forgotEmail, {
|
|
42
|
-
redirectTo: `${window.location.origin}/reset-wachtwoord`,
|
|
43
|
-
});
|
|
44
|
-
setForgotLoading(false);
|
|
45
|
-
if (error) {
|
|
46
|
-
toast.error("Fout bij het versturen van de reset-link");
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
toast.success("Reset-link verstuurd! Controleer je e-mail.");
|
|
50
|
-
setShowForgot(false);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
if (showForgot) {
|
|
54
|
-
return (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-background p-4", children: _jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { className: "text-center", children: [_jsx(CardTitle, { className: "text-2xl", children: "Wachtwoord vergeten" }), _jsx(CardDescription, { children: "Vul je e-mailadres in om een reset-link te ontvangen" })] }), _jsxs("form", { onSubmit: handleForgotPassword, children: [_jsx(CardContent, { className: "space-y-4", children: _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "forgot-email", children: "E-mailadres" }), _jsx(Input, { id: "forgot-email", type: "email", placeholder: "naam@bedrijf.nl", value: forgotEmail, onChange: (e) => setForgotEmail(e.target.value), required: true, maxLength: 255 })] }) }), _jsxs(CardFooter, { className: "flex flex-col gap-4", children: [_jsx(Button, { type: "submit", className: "w-full", disabled: forgotLoading, children: forgotLoading ? "Versturen..." : "Reset-link versturen" }), _jsx("button", { type: "button", onClick: () => setShowForgot(false), className: "text-sm text-primary hover:underline", children: "Terug naar inloggen" })] })] })] }) }));
|
|
55
|
-
}
|
|
56
|
-
return (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-background p-4", children: _jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { className: "text-center", children: [_jsx(CardTitle, { className: "text-2xl", children: "Inloggen" }), _jsx(CardDescription, { children: "Voer je gegevens in om toegang te krijgen tot het systeem" })] }), _jsxs("form", { onSubmit: handleSubmit, children: [_jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "email", children: "E-mailadres" }), _jsx(Input, { id: "email", type: "email", placeholder: "naam@bedrijf.nl", value: email, onChange: (e) => setEmail(e.target.value), required: true, maxLength: 255 })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "password", children: "Wachtwoord" }), _jsx(Input, { id: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", type: "password", value: password, onChange: (e) => setPassword(e.target.value), required: true, maxLength: 128 })] })] }), _jsxs(CardFooter, { className: "flex flex-col gap-4", children: [_jsx(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? "Bezig met inloggen..." : "Inloggen" }), _jsx("button", { type: "button", onClick: () => setShowForgot(true), className: "text-sm text-muted-foreground hover:text-primary hover:underline", children: "Wachtwoord vergeten?" })] })] })] }) }));
|
|
57
|
-
}
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Button } from "../ui/button";
|
|
4
|
+
import { Input } from "../ui/input";
|
|
5
|
+
import { Label } from "../ui/label";
|
|
6
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../ui/card";
|
|
7
|
+
import { toast } from "sonner";
|
|
8
|
+
import { loginSchema } from "../../lib/validationSchemas";
|
|
9
|
+
import { supabase } from "../../supabase/client";
|
|
10
|
+
export function LoginPage({ redirectTo }) {
|
|
11
|
+
const [email, setEmail] = useState("");
|
|
12
|
+
const [password, setPassword] = useState("");
|
|
13
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
14
|
+
const [showForgot, setShowForgot] = useState(false);
|
|
15
|
+
const [forgotEmail, setForgotEmail] = useState("");
|
|
16
|
+
const [forgotLoading, setForgotLoading] = useState(false);
|
|
17
|
+
const handleSubmit = async (e) => {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
const validation = loginSchema.safeParse({ email, password });
|
|
20
|
+
if (!validation.success) {
|
|
21
|
+
toast.error(validation.error.issues[0].message);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
setIsLoading(true);
|
|
25
|
+
const { error } = await supabase.auth.signInWithPassword({ email, password });
|
|
26
|
+
setIsLoading(false);
|
|
27
|
+
if (error) {
|
|
28
|
+
toast.error("Controleer je e-mailadres en wachtwoord.");
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
window.location.href = redirectTo;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const handleForgotPassword = async (e) => {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
if (!forgotEmail) {
|
|
37
|
+
toast.error("Vul je e-mailadres in");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
setForgotLoading(true);
|
|
41
|
+
const { error } = await supabase.auth.resetPasswordForEmail(forgotEmail, {
|
|
42
|
+
redirectTo: `${window.location.origin}/reset-wachtwoord`,
|
|
43
|
+
});
|
|
44
|
+
setForgotLoading(false);
|
|
45
|
+
if (error) {
|
|
46
|
+
toast.error("Fout bij het versturen van de reset-link");
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
toast.success("Reset-link verstuurd! Controleer je e-mail.");
|
|
50
|
+
setShowForgot(false);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
if (showForgot) {
|
|
54
|
+
return (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-background p-4", children: _jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { className: "text-center", children: [_jsx(CardTitle, { className: "text-2xl", children: "Wachtwoord vergeten" }), _jsx(CardDescription, { children: "Vul je e-mailadres in om een reset-link te ontvangen" })] }), _jsxs("form", { onSubmit: handleForgotPassword, children: [_jsx(CardContent, { className: "space-y-4", children: _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "forgot-email", children: "E-mailadres" }), _jsx(Input, { id: "forgot-email", type: "email", placeholder: "naam@bedrijf.nl", value: forgotEmail, onChange: (e) => setForgotEmail(e.target.value), required: true, maxLength: 255 })] }) }), _jsxs(CardFooter, { className: "flex flex-col gap-4", children: [_jsx(Button, { type: "submit", className: "w-full", disabled: forgotLoading, children: forgotLoading ? "Versturen..." : "Reset-link versturen" }), _jsx("button", { type: "button", onClick: () => setShowForgot(false), className: "text-sm text-primary hover:underline", children: "Terug naar inloggen" })] })] })] }) }));
|
|
55
|
+
}
|
|
56
|
+
return (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-background p-4", children: _jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { className: "text-center", children: [_jsx(CardTitle, { className: "text-2xl", children: "Inloggen" }), _jsx(CardDescription, { children: "Voer je gegevens in om toegang te krijgen tot het systeem" })] }), _jsxs("form", { onSubmit: handleSubmit, children: [_jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "email", children: "E-mailadres" }), _jsx(Input, { id: "email", type: "email", placeholder: "naam@bedrijf.nl", value: email, onChange: (e) => setEmail(e.target.value), required: true, maxLength: 255 })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "password", children: "Wachtwoord" }), _jsx(Input, { id: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", type: "password", value: password, onChange: (e) => setPassword(e.target.value), required: true, maxLength: 128 })] })] }), _jsxs(CardFooter, { className: "flex flex-col gap-4", children: [_jsx(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? "Bezig met inloggen..." : "Inloggen" }), _jsx("button", { type: "button", onClick: () => setShowForgot(true), className: "text-sm text-muted-foreground hover:text-primary hover:underline", children: "Wachtwoord vergeten?" })] })] })] }) }));
|
|
57
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function NotificationBell(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function NotificationBell(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=NotificationBell.d.ts.map
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
import { Bell } from "lucide-react";
|
|
4
|
-
import { Button } from "../ui/button";
|
|
5
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|
6
|
-
import { supabase } from "../../supabase/client";
|
|
7
|
-
import { cn } from "../../lib/utils";
|
|
8
|
-
export function NotificationBell() {
|
|
9
|
-
const [notifications, setNotifications] = useState([]);
|
|
10
|
-
const [open, setOpen] = useState(false);
|
|
11
|
-
const unreadCount = notifications.filter((n) => !n.read).length;
|
|
12
|
-
const fetchNotifications = async () => {
|
|
13
|
-
const { data } = await supabase
|
|
14
|
-
.from("notifications")
|
|
15
|
-
.select("*")
|
|
16
|
-
.order("created_at", { ascending: false })
|
|
17
|
-
.limit(20);
|
|
18
|
-
if (data)
|
|
19
|
-
setNotifications(data);
|
|
20
|
-
};
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
fetchNotifications();
|
|
23
|
-
const channel = supabase
|
|
24
|
-
.channel("notifications")
|
|
25
|
-
.on("postgres_changes", { event: "*", schema: "public", table: "notifications" }, () => {
|
|
26
|
-
fetchNotifications();
|
|
27
|
-
})
|
|
28
|
-
.subscribe();
|
|
29
|
-
return () => { supabase.removeChannel(channel); };
|
|
30
|
-
}, []);
|
|
31
|
-
const markAsRead = async (id) => {
|
|
32
|
-
await supabase.from("notifications").update({ read: true }).eq("id", id);
|
|
33
|
-
setNotifications((prev) => prev.map((n) => (n.id === id ? { ...n, read: true } : n)));
|
|
34
|
-
};
|
|
35
|
-
const dismissNotification = async (id) => {
|
|
36
|
-
await supabase.from("notifications").delete().eq("id", id);
|
|
37
|
-
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
38
|
-
};
|
|
39
|
-
const formatDate = (dateStr) => {
|
|
40
|
-
return new Date(dateStr).toLocaleDateString("nl-NL", {
|
|
41
|
-
day: "2-digit", month: "2-digit", hour: "2-digit", minute: "2-digit",
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "icon", className: "relative", children: [_jsx(Bell, { className: "h-5 w-5" }), unreadCount > 0 && (_jsx("span", { className: "absolute -top-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full bg-destructive text-[10px] font-bold text-destructive-foreground", children: unreadCount > 9 ? "9+" : unreadCount }))] }) }), _jsxs(PopoverContent, { className: "w-80 p-0", align: "end", children: [_jsx("div", { className: "border-b p-3", children: _jsx("h4", { className: "font-semibold text-sm", children: "Notificaties" }) }), _jsx("div", { className: "max-h-80 overflow-y-auto", children: notifications.length === 0 ? (_jsx("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Geen notificaties" })) : (notifications.map((n) => (_jsxs("div", { className: cn("flex items-start gap-2 border-b p-3 cursor-pointer hover:bg-muted/50 transition-colors", !n.read && "bg-accent/30"), onClick: () => markAsRead(n.id), children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("p", { className: cn("text-sm", !n.read && "font-medium"), children: n.title }), n.message && _jsx("p", { className: "text-xs text-muted-foreground mt-0.5 truncate", children: n.message }), _jsx("p", { className: "text-xs text-muted-foreground mt-1", children: formatDate(n.created_at) })] }), _jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 shrink-0", onClick: (e) => { e.stopPropagation(); dismissNotification(n.id); }, children: _jsx("span", { className: "text-xs", children: "\u2715" }) })] }, n.id)))) })] })] }));
|
|
45
|
-
}
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { Bell } from "lucide-react";
|
|
4
|
+
import { Button } from "../ui/button";
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|
6
|
+
import { supabase } from "../../supabase/client";
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
8
|
+
export function NotificationBell() {
|
|
9
|
+
const [notifications, setNotifications] = useState([]);
|
|
10
|
+
const [open, setOpen] = useState(false);
|
|
11
|
+
const unreadCount = notifications.filter((n) => !n.read).length;
|
|
12
|
+
const fetchNotifications = async () => {
|
|
13
|
+
const { data } = await supabase
|
|
14
|
+
.from("notifications")
|
|
15
|
+
.select("*")
|
|
16
|
+
.order("created_at", { ascending: false })
|
|
17
|
+
.limit(20);
|
|
18
|
+
if (data)
|
|
19
|
+
setNotifications(data);
|
|
20
|
+
};
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
fetchNotifications();
|
|
23
|
+
const channel = supabase
|
|
24
|
+
.channel("notifications")
|
|
25
|
+
.on("postgres_changes", { event: "*", schema: "public", table: "notifications" }, () => {
|
|
26
|
+
fetchNotifications();
|
|
27
|
+
})
|
|
28
|
+
.subscribe();
|
|
29
|
+
return () => { supabase.removeChannel(channel); };
|
|
30
|
+
}, []);
|
|
31
|
+
const markAsRead = async (id) => {
|
|
32
|
+
await supabase.from("notifications").update({ read: true }).eq("id", id);
|
|
33
|
+
setNotifications((prev) => prev.map((n) => (n.id === id ? { ...n, read: true } : n)));
|
|
34
|
+
};
|
|
35
|
+
const dismissNotification = async (id) => {
|
|
36
|
+
await supabase.from("notifications").delete().eq("id", id);
|
|
37
|
+
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
38
|
+
};
|
|
39
|
+
const formatDate = (dateStr) => {
|
|
40
|
+
return new Date(dateStr).toLocaleDateString("nl-NL", {
|
|
41
|
+
day: "2-digit", month: "2-digit", hour: "2-digit", minute: "2-digit",
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "icon", className: "relative", children: [_jsx(Bell, { className: "h-5 w-5" }), unreadCount > 0 && (_jsx("span", { className: "absolute -top-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full bg-destructive text-[10px] font-bold text-destructive-foreground", children: unreadCount > 9 ? "9+" : unreadCount }))] }) }), _jsxs(PopoverContent, { className: "w-80 p-0", align: "end", children: [_jsx("div", { className: "border-b p-3", children: _jsx("h4", { className: "font-semibold text-sm", children: "Notificaties" }) }), _jsx("div", { className: "max-h-80 overflow-y-auto", children: notifications.length === 0 ? (_jsx("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Geen notificaties" })) : (notifications.map((n) => (_jsxs("div", { className: cn("flex items-start gap-2 border-b p-3 cursor-pointer hover:bg-muted/50 transition-colors", !n.read && "bg-accent/30"), onClick: () => markAsRead(n.id), children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("p", { className: cn("text-sm", !n.read && "font-medium"), children: n.title }), n.message && _jsx("p", { className: "text-xs text-muted-foreground mt-0.5 truncate", children: n.message }), _jsx("p", { className: "text-xs text-muted-foreground mt-1", children: formatDate(n.created_at) })] }), _jsx(Button, { variant: "ghost", size: "icon", className: "h-6 w-6 shrink-0", onClick: (e) => { e.stopPropagation(); dismissNotification(n.id); }, children: _jsx("span", { className: "text-xs", children: "\u2715" }) })] }, n.id)))) })] })] }));
|
|
45
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
interface ResetWachtwoordPageProps {
|
|
2
|
-
redirectTo: string;
|
|
3
|
-
}
|
|
4
|
-
export declare function ResetWachtwoordPage({ redirectTo }: ResetWachtwoordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export {};
|
|
1
|
+
interface ResetWachtwoordPageProps {
|
|
2
|
+
redirectTo: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function ResetWachtwoordPage({ redirectTo }: ResetWachtwoordPageProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
6
6
|
//# sourceMappingURL=ResetWachtwoordPage.d.ts.map
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
import { Button } from "../ui/button";
|
|
4
|
-
import { Input } from "../ui/input";
|
|
5
|
-
import { Label } from "../ui/label";
|
|
6
|
-
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../ui/card";
|
|
7
|
-
import { toast } from "sonner";
|
|
8
|
-
import { supabase } from "../../supabase/client";
|
|
9
|
-
export function ResetWachtwoordPage({ redirectTo }) {
|
|
10
|
-
const [password, setPassword] = useState("");
|
|
11
|
-
const [confirmPassword, setConfirmPassword] = useState("");
|
|
12
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
13
|
-
const [isReady, setIsReady] = useState(false);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const hash = window.location.hash;
|
|
16
|
-
if (hash && hash.includes("type=recovery")) {
|
|
17
|
-
setIsReady(true);
|
|
18
|
-
}
|
|
19
|
-
const { data: { subscription } } = supabase.auth.onAuthStateChange((event) => {
|
|
20
|
-
if (event === "PASSWORD_RECOVERY") {
|
|
21
|
-
setIsReady(true);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return () => subscription.unsubscribe();
|
|
25
|
-
}, []);
|
|
26
|
-
const handleSubmit = async (e) => {
|
|
27
|
-
e.preventDefault();
|
|
28
|
-
if (password.length < 6) {
|
|
29
|
-
toast.error("Wachtwoord moet minimaal 6 tekens bevatten");
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (password !== confirmPassword) {
|
|
33
|
-
toast.error("Wachtwoorden komen niet overeen");
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
setIsLoading(true);
|
|
37
|
-
const { error } = await supabase.auth.updateUser({ password });
|
|
38
|
-
setIsLoading(false);
|
|
39
|
-
if (error) {
|
|
40
|
-
toast.error("Fout bij het instellen van het nieuwe wachtwoord");
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
toast.success("Wachtwoord succesvol gewijzigd!");
|
|
44
|
-
window.location.href = redirectTo;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
if (!isReady) {
|
|
48
|
-
return (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-background p-4", children: _jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { className: "text-center", children: [_jsx(CardTitle, { className: "text-2xl", children: "Ongeldige link" }), _jsx(CardDescription, { children: "Deze reset-link is ongeldig of verlopen. Vraag een nieuwe aan via de inlogpagina." })] }), _jsx(CardFooter, { className: "justify-center", children: _jsx(Button, { onClick: () => window.location.href = "/login", children: "Naar inlogpagina" }) })] }) }));
|
|
49
|
-
}
|
|
50
|
-
return (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-background p-4", children: _jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { className: "text-center", children: [_jsx(CardTitle, { className: "text-2xl", children: "Nieuw wachtwoord instellen" }), _jsx(CardDescription, { children: "Kies een nieuw wachtwoord voor je account" })] }), _jsxs("form", { onSubmit: handleSubmit, children: [_jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "password", children: "Nieuw wachtwoord" }), _jsx(Input, { id: "password", type: "password", value: password, onChange: (e) => setPassword(e.target.value), required: true, minLength: 6, maxLength: 128 })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "confirmPassword", children: "Bevestig wachtwoord" }), _jsx(Input, { id: "confirmPassword", type: "password", value: confirmPassword, onChange: (e) => setConfirmPassword(e.target.value), required: true, minLength: 6, maxLength: 128 })] })] }), _jsx(CardFooter, { children: _jsx(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? "Opslaan..." : "Wachtwoord opslaan" }) })] })] }) }));
|
|
51
|
-
}
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { Button } from "../ui/button";
|
|
4
|
+
import { Input } from "../ui/input";
|
|
5
|
+
import { Label } from "../ui/label";
|
|
6
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../ui/card";
|
|
7
|
+
import { toast } from "sonner";
|
|
8
|
+
import { supabase } from "../../supabase/client";
|
|
9
|
+
export function ResetWachtwoordPage({ redirectTo }) {
|
|
10
|
+
const [password, setPassword] = useState("");
|
|
11
|
+
const [confirmPassword, setConfirmPassword] = useState("");
|
|
12
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
13
|
+
const [isReady, setIsReady] = useState(false);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const hash = window.location.hash;
|
|
16
|
+
if (hash && hash.includes("type=recovery")) {
|
|
17
|
+
setIsReady(true);
|
|
18
|
+
}
|
|
19
|
+
const { data: { subscription } } = supabase.auth.onAuthStateChange((event) => {
|
|
20
|
+
if (event === "PASSWORD_RECOVERY") {
|
|
21
|
+
setIsReady(true);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return () => subscription.unsubscribe();
|
|
25
|
+
}, []);
|
|
26
|
+
const handleSubmit = async (e) => {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
if (password.length < 6) {
|
|
29
|
+
toast.error("Wachtwoord moet minimaal 6 tekens bevatten");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (password !== confirmPassword) {
|
|
33
|
+
toast.error("Wachtwoorden komen niet overeen");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
setIsLoading(true);
|
|
37
|
+
const { error } = await supabase.auth.updateUser({ password });
|
|
38
|
+
setIsLoading(false);
|
|
39
|
+
if (error) {
|
|
40
|
+
toast.error("Fout bij het instellen van het nieuwe wachtwoord");
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
toast.success("Wachtwoord succesvol gewijzigd!");
|
|
44
|
+
window.location.href = redirectTo;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
if (!isReady) {
|
|
48
|
+
return (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-background p-4", children: _jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { className: "text-center", children: [_jsx(CardTitle, { className: "text-2xl", children: "Ongeldige link" }), _jsx(CardDescription, { children: "Deze reset-link is ongeldig of verlopen. Vraag een nieuwe aan via de inlogpagina." })] }), _jsx(CardFooter, { className: "justify-center", children: _jsx(Button, { onClick: () => window.location.href = "/login", children: "Naar inlogpagina" }) })] }) }));
|
|
49
|
+
}
|
|
50
|
+
return (_jsx("div", { className: "min-h-screen flex items-center justify-center bg-background p-4", children: _jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { className: "text-center", children: [_jsx(CardTitle, { className: "text-2xl", children: "Nieuw wachtwoord instellen" }), _jsx(CardDescription, { children: "Kies een nieuw wachtwoord voor je account" })] }), _jsxs("form", { onSubmit: handleSubmit, children: [_jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "password", children: "Nieuw wachtwoord" }), _jsx(Input, { id: "password", type: "password", value: password, onChange: (e) => setPassword(e.target.value), required: true, minLength: 6, maxLength: 128 })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "confirmPassword", children: "Bevestig wachtwoord" }), _jsx(Input, { id: "confirmPassword", type: "password", value: confirmPassword, onChange: (e) => setConfirmPassword(e.target.value), required: true, minLength: 6, maxLength: 128 })] })] }), _jsx(CardFooter, { children: _jsx(Button, { type: "submit", className: "w-full", disabled: isLoading, children: isLoading ? "Opslaan..." : "Wachtwoord opslaan" }) })] })] }) }));
|
|
51
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AuthContext } from "../../auth/useAuth";
|
|
2
|
-
import type { FlowModule } from "../../types/module";
|
|
3
|
-
interface SidebarProps {
|
|
4
|
-
auth: AuthContext;
|
|
5
|
-
modules: FlowModule[];
|
|
6
|
-
}
|
|
7
|
-
export declare function Sidebar({ auth, modules }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
import type { AuthContext } from "../../auth/useAuth";
|
|
2
|
+
import type { FlowModule } from "../../types/module";
|
|
3
|
+
interface SidebarProps {
|
|
4
|
+
auth: AuthContext;
|
|
5
|
+
modules: FlowModule[];
|
|
6
|
+
}
|
|
7
|
+
export declare function Sidebar({ auth, modules }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
9
|
//# sourceMappingURL=Sidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/core/components/layout/Sidebar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAW,MAAM,oBAAoB,CAAC;AAI9D,UAAU,YAAY;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/core/components/layout/Sidebar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAW,MAAM,oBAAoB,CAAC;AAI9D,UAAU,YAAY;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAkFD,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,YAAY,2CAkDtD"}
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Link, useLocation } from "@tanstack/react-router";
|
|
4
|
-
import { Settings, LogOut, ChevronDown } from "lucide-react";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
// ─── Single flat nav link ─────────────────────────────────────────────────────
|
|
7
|
-
function SidebarLink({ item, pathname, indent = false, }) {
|
|
8
|
-
const isActive = item.href
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return (_jsx("aside", { className: "fixed left-0 top-0 z-40 h-screen w-64 bg-sidebar", children: _jsxs("div", { className: "flex h-full flex-col", children: [_jsx("div", { className: "px-12 py-0 border-b border-sidebar-border", children: _jsx("img", { src: "/logo.png", alt: "Logo", className: "w-full h-auto object-contain" }) }), _jsx("nav", { className: "flex-1 space-y-1 px-3 py-4 overflow-y-auto sidebar-scroll", children: modules.map((mod) => mod.nav.children?.length ? (_jsx(SidebarGroup, { item: mod.nav, pathname: pathname }, mod.id)) : (_jsx(SidebarLink, { item: mod.nav, pathname: pathname }, mod.id))) }), _jsxs("div", { className: "border-t border-sidebar-border px-3 py-4", children: [_jsx(SidebarLink, { item: { label: "Instellingen", href: "/instellingen", icon: Settings }, pathname: pathname }), _jsxs("button", { onClick: handleSignOut, className: "flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-accent-foreground mt-1 cursor-pointer", children: [_jsx(LogOut, { className: "h-5 w-5" }), "Uitloggen"] })] })] }) }));
|
|
31
|
-
}
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Link, useLocation } from "@tanstack/react-router";
|
|
4
|
+
import { Settings, LogOut, ChevronDown } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
// ─── Single flat nav link ─────────────────────────────────────────────────────
|
|
7
|
+
function SidebarLink({ item, pathname, indent = false, }) {
|
|
8
|
+
const isActive = pathname === item.href;
|
|
9
|
+
return (_jsxs(Link, { to: item.href, className: cn("flex items-center gap-3 rounded-lg px-3 text-sm font-medium transition-colors", indent ? "py-2" : "py-2.5", isActive
|
|
10
|
+
? "bg-sidebar-accent text-sidebar-accent-foreground"
|
|
11
|
+
: "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"), children: [_jsx(item.icon, { className: cn(indent ? "h-4 w-4" : "h-5 w-5") }), item.label] }));
|
|
12
|
+
}
|
|
13
|
+
// ─── Collapsible group (for modules with children) ────────────────────────────
|
|
14
|
+
function SidebarGroup({ item, pathname, }) {
|
|
15
|
+
const groupActive = item.children?.some((child) => pathname === child.href || pathname.startsWith(child.href + "/")) ?? false;
|
|
16
|
+
const [open, setOpen] = useState(groupActive);
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { onClick: () => setOpen(!open), className: cn("flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors cursor-pointer", groupActive
|
|
18
|
+
? "text-sidebar-accent-foreground"
|
|
19
|
+
: "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"), children: [_jsx(item.icon, { className: "h-5 w-5" }), _jsx("span", { className: "flex-1 text-left", children: item.label }), _jsx(ChevronDown, { className: cn("h-4 w-4 transition-transform", open && "rotate-180") })] }), open && (_jsx("div", { className: "ml-3 space-y-1", children: item.children.map((child) => (_jsx(SidebarLink, { item: child, pathname: pathname, indent: true }, child.href))) }))] }));
|
|
20
|
+
}
|
|
21
|
+
// ─── Main Sidebar ─────────────────────────────────────────────────────────────
|
|
22
|
+
export function Sidebar({ auth, modules }) {
|
|
23
|
+
const location = useLocation();
|
|
24
|
+
const pathname = location.pathname;
|
|
25
|
+
const handleSignOut = async () => {
|
|
26
|
+
await auth.signOut();
|
|
27
|
+
};
|
|
28
|
+
return (_jsx("aside", { className: "fixed left-0 top-0 z-40 h-screen w-64 bg-sidebar", children: _jsxs("div", { className: "flex h-full flex-col", children: [_jsx("div", { className: "px-12 py-0 border-b border-sidebar-border", children: _jsx("img", { src: "/logo.png", alt: "Logo", className: "w-full h-auto object-contain" }) }), _jsx("nav", { className: "flex-1 space-y-1 px-3 py-4 overflow-y-auto sidebar-scroll", children: modules.map((mod) => mod.nav.children?.length ? (_jsx(SidebarGroup, { item: mod.nav, pathname: pathname }, mod.id)) : (_jsx(SidebarLink, { item: mod.nav, pathname: pathname }, mod.id))) }), _jsxs("div", { className: "border-t border-sidebar-border px-3 py-4", children: [_jsx(SidebarLink, { item: { label: "Instellingen", href: "/instellingen", icon: Settings }, pathname: pathname }), _jsxs("button", { onClick: handleSignOut, className: "flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-accent-foreground mt-1 cursor-pointer", children: [_jsx(LogOut, { className: "h-5 w-5" }), "Uitloggen"] })] })] }) }));
|
|
29
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
-
declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
-
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
8
8
|
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
4
|
-
import { ChevronDown } from "lucide-react";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
const Accordion = AccordionPrimitive.Root;
|
|
7
|
-
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(AccordionPrimitive.Item, { ref: ref, className: cn("border-b", className), ...props })));
|
|
8
|
-
AccordionItem.displayName = "AccordionItem";
|
|
9
|
-
const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { ref: ref, className: cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180", className), ...props, children: [children, _jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })] }) })));
|
|
10
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
11
|
-
const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(AccordionPrimitive.Content, { ref: ref, className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", ...props, children: _jsx("div", { className: cn("pb-4 pt-0", className), children: children }) })));
|
|
12
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
13
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
4
|
+
import { ChevronDown } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
const Accordion = AccordionPrimitive.Root;
|
|
7
|
+
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(AccordionPrimitive.Item, { ref: ref, className: cn("border-b", className), ...props })));
|
|
8
|
+
AccordionItem.displayName = "AccordionItem";
|
|
9
|
+
const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { ref: ref, className: cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180", className), ...props, children: [children, _jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })] }) })));
|
|
10
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
11
|
+
const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(AccordionPrimitive.Content, { ref: ref, className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", ...props, children: _jsx("div", { className: cn("pb-4 pt-0", className), children: children }) })));
|
|
12
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
13
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
-
declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
4
|
-
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
6
|
-
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
declare const AlertDialogHeader: {
|
|
9
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
12
|
-
declare const AlertDialogFooter: {
|
|
13
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
displayName: string;
|
|
15
|
-
};
|
|
16
|
-
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
17
|
-
declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
18
|
-
declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
-
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
-
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
|
|
4
|
+
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
6
|
+
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const AlertDialogHeader: {
|
|
9
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
declare const AlertDialogFooter: {
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
17
|
+
declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
18
|
+
declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
21
21
|
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
import { buttonVariants } from "./button";
|
|
6
|
-
const AlertDialog = AlertDialogPrimitive.Root;
|
|
7
|
-
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
8
|
-
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
9
|
-
const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Overlay, { className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props, ref: ref })));
|
|
10
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
11
|
-
const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props })] })));
|
|
12
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
13
|
-
const AlertDialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props }));
|
|
14
|
-
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
15
|
-
const AlertDialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
|
|
16
|
-
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
17
|
-
const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold", className), ...props })));
|
|
18
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
19
|
-
const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
20
|
-
AlertDialogDescription.displayName =
|
|
21
|
-
AlertDialogPrimitive.Description.displayName;
|
|
22
|
-
const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Action, { ref: ref, className: cn(buttonVariants(), className), ...props })));
|
|
23
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
24
|
-
const AlertDialogCancel = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Cancel, { ref: ref, className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className), ...props })));
|
|
25
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
26
|
-
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import { cn } from "../../lib/utils";
|
|
5
|
+
import { buttonVariants } from "./button";
|
|
6
|
+
const AlertDialog = AlertDialogPrimitive.Root;
|
|
7
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
8
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
9
|
+
const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Overlay, { className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props, ref: ref })));
|
|
10
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
11
|
+
const AlertDialogContent = React.forwardRef(({ className, ...props }, ref) => (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props })] })));
|
|
12
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
13
|
+
const AlertDialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props }));
|
|
14
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
15
|
+
const AlertDialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
|
|
16
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
17
|
+
const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold", className), ...props })));
|
|
18
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
19
|
+
const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
20
|
+
AlertDialogDescription.displayName =
|
|
21
|
+
AlertDialogPrimitive.Description.displayName;
|
|
22
|
+
const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Action, { ref: ref, className: cn(buttonVariants(), className), ...props })));
|
|
23
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
24
|
+
const AlertDialogCancel = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Cancel, { ref: ref, className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className), ...props })));
|
|
25
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
26
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|