tr]:last:border-b-0",
48 | className
49 | )}
50 | {...props}
51 | />
52 | )
53 | }
54 |
55 | function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
56 | return (
57 |
65 | )
66 | }
67 |
68 | function TableHead({ className, ...props }: React.ComponentProps<"th">) {
69 | return (
70 | [role=checkbox]]:translate-y-[2px]",
74 | className
75 | )}
76 | {...props}
77 | />
78 | )
79 | }
80 |
81 | function TableCell({ className, ...props }: React.ComponentProps<"td">) {
82 | return (
83 | | [role=checkbox]]:translate-y-[2px]",
87 | className
88 | )}
89 | {...props}
90 | />
91 | )
92 | }
93 |
94 | function TableCaption({
95 | className,
96 | ...props
97 | }: React.ComponentProps<"caption">) {
98 | return (
99 |
104 | )
105 | }
106 |
107 | export {
108 | Table,
109 | TableHeader,
110 | TableBody,
111 | TableFooter,
112 | TableHead,
113 | TableRow,
114 | TableCell,
115 | TableCaption,
116 | }
117 |
--------------------------------------------------------------------------------
/package/src/app/components/auth/login.tsx:
--------------------------------------------------------------------------------
1 | 'use client'
2 |
3 | import FullLogo from '@/app/(DashboardLayout)/layout/shared/logo/FullLogo'
4 | import CardBox from '../shared/CardBox'
5 | import Link from 'next/link'
6 | import { Label } from '@/components/ui/label'
7 | import { Checkbox } from '@/components/ui/checkbox'
8 | import { Button } from '@/components/ui/button'
9 | import { Input } from '@/components/ui/input'
10 |
11 | export const Login = () => {
12 | return (
13 | <>
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | Your Social Campaigns
22 |
23 |
24 |
25 |
28 |
29 |
35 |
36 |
37 |
38 |
41 |
42 |
48 |
49 |
50 |
51 |
52 |
57 |
58 |
61 | Forgot Password ?
62 |
63 |
64 |
67 |
68 |
69 | New to MaterialM?
70 |
71 |
74 | Create an account
75 |
76 |
77 |
78 |
79 |
80 | >
81 | )
82 | }
83 |
--------------------------------------------------------------------------------
/package/src/app/components/apps/notes/NoteContent.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import { Textarea } from "@/components/ui/textarea";
3 | import React, { useEffect, useState } from "react";
4 | import { TbCheck } from "react-icons/tb";
5 |
6 | interface colorsType {
7 | lineColor: string;
8 | disp: string | any;
9 | id: any;
10 | }
11 |
12 | interface Note {
13 | id: any;
14 | title: string;
15 | content?: string;
16 | color: string;
17 | }
18 |
19 | interface NoteContentProps {
20 | note: any | any;
21 | updateNote: (id: any, title: string, color: string) => void;
22 | }
23 |
24 | const NoteContent: React.FC = ({ note, updateNote }) => {
25 | const [initialTitle, setInitialTitle] = useState("");
26 | const [updatedTitle, setUpdatedTitle] = useState("");
27 | const [isEditing, setIsEditing] = useState(false);
28 |
29 | useEffect(() => {
30 | if (note) {
31 | setInitialTitle(note.title);
32 | setUpdatedTitle(note.title);
33 | }
34 | }, [note]);
35 |
36 | const handleTitleChange = (e: React.ChangeEvent) => {
37 | setUpdatedTitle(e.target.value);
38 | setIsEditing(true);
39 | };
40 |
41 | const handleColorChange = (color: string) => {
42 | if (!note) return;
43 | const titleToUse = isEditing ? updatedTitle : initialTitle;
44 | updateNote(note.id, titleToUse, color);
45 | };
46 |
47 | const handleBlur = () => {
48 | if (!note) return;
49 | setIsEditing(false);
50 | updateNote(note.id, updatedTitle, note.color);
51 | };
52 |
53 | const colorvariation: colorsType[] = [
54 | { id: 1, lineColor: "warning", disp: "warning" },
55 | { id: 2, lineColor: "primary", disp: "primary" },
56 | { id: 3, lineColor: "error", disp: "error" },
57 | { id: 4, lineColor: "success", disp: "success" },
58 | { id: 5, lineColor: "secondary", disp: "secondary" },
59 | ];
60 |
61 | if (!note) {
62 | return (
63 |
64 | Select a Note
65 |
66 | );
67 | }
68 |
69 | return (
70 |
71 |
72 |
81 |
82 | Change Note Color
83 |
84 | {colorvariation.map((color1) => (
85 | handleColorChange(color1.disp)}
89 | >
90 | {note.color === color1.disp ? (
91 |
92 | ) : null}
93 |
94 | ))}
95 |
96 |
97 |
98 | );
99 | };
100 |
101 | export default NoteContent;
102 |
--------------------------------------------------------------------------------
/package/src/components/ui/breadcrumb.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import { Slot } from "@radix-ui/react-slot"
3 | import { ChevronRight, MoreHorizontal } from "lucide-react"
4 |
5 | import { cn } from "@/lib/utils"
6 |
7 | const Breadcrumb = React.forwardRef<
8 | HTMLElement,
9 | React.ComponentPropsWithoutRef<"nav"> & {
10 | separator?: React.ReactNode
11 | }
12 | >(({ ...props }, ref) => )
13 | Breadcrumb.displayName = "Breadcrumb"
14 |
15 | const BreadcrumbList = React.forwardRef<
16 | HTMLOListElement,
17 | React.ComponentPropsWithoutRef<"ol">
18 | >(({ className, ...props }, ref) => (
19 |
27 | ))
28 | BreadcrumbList.displayName = "BreadcrumbList"
29 |
30 | const BreadcrumbItem = React.forwardRef<
31 | HTMLLIElement,
32 | React.ComponentPropsWithoutRef<"li">
33 | >(({ className, ...props }, ref) => (
34 |
39 | ))
40 | BreadcrumbItem.displayName = "BreadcrumbItem"
41 |
42 | const BreadcrumbLink = React.forwardRef<
43 | HTMLAnchorElement,
44 | React.ComponentPropsWithoutRef<"a"> & {
45 | asChild?: boolean
46 | }
47 | >(({ asChild, className, ...props }, ref) => {
48 | const Comp = asChild ? Slot : "a"
49 |
50 | return (
51 |
56 | )
57 | })
58 | BreadcrumbLink.displayName = "BreadcrumbLink"
59 |
60 | const BreadcrumbPage = React.forwardRef<
61 | HTMLSpanElement,
62 | React.ComponentPropsWithoutRef<"span">
63 | >(({ className, ...props }, ref) => (
64 |
72 | ))
73 | BreadcrumbPage.displayName = "BreadcrumbPage"
74 |
75 | const BreadcrumbSeparator = ({
76 | children,
77 | className,
78 | ...props
79 | }: React.ComponentProps<"li">) => (
80 | svg]:w-3.5 [&>svg]:h-3.5", className)}
84 | {...props}
85 | >
86 | {children ?? }
87 |
88 | )
89 | BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
90 |
91 | const BreadcrumbEllipsis = ({
92 | className,
93 | ...props
94 | }: React.ComponentProps<"span">) => (
95 |
101 |
102 | More
103 |
104 | )
105 | BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
106 |
107 | export {
108 | Breadcrumb,
109 | BreadcrumbList,
110 | BreadcrumbItem,
111 | BreadcrumbLink,
112 | BreadcrumbPage,
113 | BreadcrumbSeparator,
114 | BreadcrumbEllipsis,
115 | }
116 |
--------------------------------------------------------------------------------
/package/src/app/components/apps/blog/BlogFeaturedCard.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import Link from "next/link";
3 | import { Icon } from "@iconify/react";
4 | import { GoDot } from "react-icons/go";
5 | import { format } from "date-fns";
6 | import React, { useEffect, useContext } from "react";
7 | import { BlogContext, BlogContextProps } from "@/app/context/BlogContext/index";
8 | import { BlogPostType } from "@/app/(DashboardLayout)/types/blog";
9 | import { Card } from "@/components/ui/card";
10 | import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
11 | import { Badge } from "@/components/ui/badge";
12 |
13 | interface Btype {
14 | post: BlogPostType;
15 | index: number;
16 | }
17 |
18 | const BlogFeaturedCard = ({ post, index }: Btype) => {
19 | const { coverImg, title, view, comments, category, author, createdAt }: any =
20 | post;
21 |
22 | const linkTo = title
23 | .toLowerCase()
24 | .replace(/ /g, "-")
25 | .replace(/[^\w-]+/g, "");
26 |
27 | const mainPost = index === 0;
28 |
29 | const { setLoading }: BlogContextProps = useContext(BlogContext);
30 |
31 | useEffect(() => {
32 | const timer = setTimeout(() => {
33 | setLoading(false);
34 | }, 700);
35 |
36 | return () => clearTimeout(timer);
37 | }, [setLoading]);
38 |
39 | return (
40 | <>
41 | {post ? (
42 |
45 |
46 | {/* Background Image */}
47 |
48 | 
53 |
54 |
55 |
56 | {/* Content */}
57 |
58 |
59 |
60 |
61 |
62 | {author?.name ? author.name[0] : "?"}
63 |
64 |
65 |
66 |
67 | {category}
68 |
69 |
70 |
71 |
72 |
73 | {title}
74 |
75 |
76 |
77 | {view}
78 |
79 |
80 | {" "}
81 | {comments?.length}
82 |
83 |
84 |
85 | {format(new Date(createdAt), "E, MMM d")}
86 |
87 |
88 |
89 |
90 |
91 |
92 | ) : null}
93 | >
94 | );
95 | };
96 |
97 | export default BlogFeaturedCard;
98 |
--------------------------------------------------------------------------------
/package/src/app/components/apps/blog/BlogCard.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import { format } from "date-fns";
3 | import { GoDot } from "react-icons/go";
4 | import { Icon } from "@iconify/react";
5 | import CardBox from "../../shared/CardBox";
6 | import Link from "next/link";
7 | import Image from "next/image";
8 | import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
9 | import { Badge } from "@/components/ui/badge";
10 | import {
11 | Tooltip,
12 | TooltipProvider,
13 | TooltipTrigger,
14 | TooltipContent,
15 | } from "@/components/ui/tooltip";
16 |
17 | import { BlogPostType } from "@/app/(DashboardLayout)/types/blog";
18 |
19 | interface Btype {
20 | post: BlogPostType;
21 | index?: number;
22 | }
23 |
24 | const BlogCard = ({ post }: Btype) => {
25 | const { coverImg, title, view, comments, category, author, createdAt }: any =
26 | post;
27 |
28 | const linkTo = title
29 | .toLowerCase()
30 | .replace(/ /g, "-")
31 | .replace(/[^\w-]+/g, "");
32 |
33 | return (
34 |
35 |
36 |
37 |
38 |
39 |
46 |
47 |
48 | 2 min Read
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | {author?.name ? author.name[0] : "?"}
60 |
61 |
62 |
63 | {author?.name}
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | {category}
72 |
73 |
74 |
75 |
79 | {title}
80 |
81 |
82 |
83 |
84 |
85 | {view}
86 |
87 |
88 | {" "}
93 | {comments?.length}
94 |
95 |
96 |
97 | {format(new Date(createdAt), "E, MMM d")}
98 |
99 |
100 |
101 |
102 |
103 | );
104 | };
105 |
106 | export default BlogCard;
107 |
--------------------------------------------------------------------------------
/package/src/app/components/apps/blog/detail/BlogCommnets.tsx:
--------------------------------------------------------------------------------
1 | 'use client'
2 | import { useState } from "react";
3 | import { Icon } from "@iconify/react";
4 | import { BlogType } from "@/app/(DashboardLayout)/types/blog";
5 | import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
6 | import { Input } from "@/components/ui/input";
7 | import { Button } from "@/components/ui/button";
8 | import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
9 |
10 | const BlogComment = ({ comment }: BlogType | any) => {
11 | const [showReply, setShowReply] = useState(false);
12 | return (
13 | <>
14 |
15 |
16 |
17 |
18 |
19 | {comment?.profile.name}
20 |
21 |
22 | {comment?.profile.name}
23 |
24 | {comment?.profile.time}
25 |
26 |
27 | {comment?.comment}
28 |
29 |
30 |
31 |
32 |
33 |
39 |
40 |
41 | Reply
42 |
43 |
44 |
45 |
46 |
47 | {comment?.replies ? (
48 | <>
49 | {comment?.replies.map((reply: BlogType | any) => {
50 | return (
51 |
52 |
53 |
54 |
55 |
56 |
57 | {reply.profile.name}
58 |
59 |
60 | {reply.profile.name}
61 |
62 | {comment?.profile.time}
63 |
64 |
65 | {reply.comment}
66 |
67 |
68 |
69 | );
70 | })}
71 | >
72 | ) : null}
73 | {showReply ? (
74 |
75 |
76 |
77 |
78 |
79 |
80 | {comment?.profile.name}
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | ) : (
89 | ""
90 | )}
91 | >
92 | );
93 | };
94 | export default BlogComment;
95 |
--------------------------------------------------------------------------------
/package/src/app/components/apps/notes/Notelist.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 |
3 | import { Icon } from "@iconify/react";
4 | import React, { useState, useEffect } from "react";
5 | import { NotesType } from "@/app/(DashboardLayout)/types/apps/notes";
6 | import { Input } from "@/components/ui/input";
7 | import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
8 | import { Button } from "@/components/ui/button";
9 | import { Alert, AlertTitle } from "@/components/ui/alert";
10 |
11 | interface NotelistProps {
12 | notes: NotesType[];
13 | loading: boolean;
14 | onSelectNote: (noteId: string) => void;
15 | onDeleteNote: (noteId: string) => void;
16 | }
17 |
18 | const Notelist: React.FC = ({ notes, loading, onSelectNote, onDeleteNote }) => {
19 | const [searchTerm, setSearchTerm] = useState("");
20 | const [activeNoteId, setActiveNoteId] = useState(null);
21 |
22 | useEffect(() => {
23 | if (notes.length > 0) {
24 | const firstNoteId = notes[0].id;
25 | setActiveNoteId(String(firstNoteId));
26 | }
27 | }, [notes]);
28 |
29 | const filterNotes = (notes: NotesType[], nSearch: string) => {
30 | if (nSearch !== "")
31 | return notes.filter(
32 | (t: any) =>
33 | !t.deleted &&
34 | t.title.toLowerCase().includes(nSearch.toLowerCase())
35 | );
36 |
37 | return notes?.filter((t: any) => !t.deleted);
38 | };
39 |
40 | const filteredNotes = filterNotes(Array.isArray(notes) ? notes : [], searchTerm);
41 |
42 | const handleNoteClick = (noteId: string) => {
43 | setActiveNoteId(noteId);
44 | onSelectNote(noteId);
45 | };
46 |
47 | if (loading) {
48 | return Loading notes... ;
49 | }
50 |
51 | return (
52 |
53 | setSearchTerm(e.target.value)}
58 | className="w-full"
59 | />
60 | All Notes
61 |
62 | {filteredNotes && filteredNotes.length ? (
63 | filteredNotes.map((note: any, index: any) => (
64 |
65 | handleNoteClick(note.id)}
69 | >
70 |
71 | {note.title}
72 |
73 |
74 |
75 | {new Date(note.datef).toLocaleDateString()}
76 |
77 |
78 |
79 |
80 |
88 |
89 | Delete
90 |
91 |
92 |
93 |
94 |
95 | ))
96 | ) : (
97 |
98 | No Notes Found!
99 |
100 | )}
101 |
102 |
103 | );
104 | };
105 |
106 | export default Notelist;
107 |
--------------------------------------------------------------------------------
/package/src/app/context/BlogContext/index.tsx:
--------------------------------------------------------------------------------
1 | 'use client'
2 | import React, { createContext, useState, useEffect, ReactNode, Dispatch, SetStateAction } from 'react';
3 | import { BlogPostType, BlogType } from '@/app/(DashboardLayout)/types/blog';
4 |
5 | export interface BlogContextProps {
6 | posts: BlogPostType[];
7 | sortBy: string;
8 | selectedPost: BlogPostType | null;
9 | isLoading: boolean;
10 | setPosts: Dispatch>;
11 | setSortBy: Dispatch>;
12 | setSelectedPost: Dispatch>;
13 | setLoading: Dispatch>;
14 | addComment: (postId: number, newComment: BlogType) => void;
15 | fetchPostById: (id: number) => Promise;
16 | error: any;
17 | }
18 |
19 | export const BlogContext = createContext({
20 | posts: [],
21 | sortBy: 'newest',
22 | selectedPost: null,
23 | isLoading: true,
24 | setPosts: () => { },
25 | setSortBy: () => { },
26 | setSelectedPost: () => { },
27 | setLoading: () => { },
28 | addComment: () => { },
29 | fetchPostById: async () => { },
30 | error: null
31 | });
32 |
33 | export const BlogProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
34 | const [posts, setPosts] = useState([]);
35 | const [sortBy, setSortBy] = useState('newest');
36 | const [selectedPost, setSelectedPost] = useState(null);
37 | const [isLoading, setLoading] = useState(true);
38 | const [error, setError] = useState(null);
39 |
40 | // Fetch all posts
41 | const fetchPosts = async () => {
42 | try {
43 | setLoading(true);
44 | const res = await fetch('/api/blog');
45 | const data = await res.json();
46 | if (data.status === 200) {
47 | setPosts(data.data);
48 | setError(null);
49 | } else {
50 | setError(data.msg);
51 | }
52 | } catch (err) {
53 | setError(err);
54 | } finally {
55 | setLoading(false);
56 | }
57 | };
58 |
59 | // Fetch single post
60 | const fetchPostById = async (id: number) => {
61 | try {
62 | setLoading(true);
63 | const res = await fetch(`/api/blog/${id}`);
64 | const data = await res.json();
65 | if (data.status === 200) {
66 | setSelectedPost(data.data);
67 | setError(null);
68 | } else {
69 | setError(data.msg);
70 | }
71 | } catch (err) {
72 | setError(err);
73 | } finally {
74 | setLoading(false);
75 | }
76 | };
77 |
78 | // Add comment locally + optionally call API
79 | const addComment = async (postId: number, newComment: BlogType) => {
80 | setPosts((prevPosts) =>
81 | prevPosts.map((post) =>
82 | post.id === postId ? { ...post, comments: [newComment, ...(post.comments || [])] } : post
83 | )
84 | );
85 |
86 | try {
87 | await fetch('/api/blog', {
88 | method: 'POST',
89 | headers: { 'Content-Type': 'application/json' },
90 | body: JSON.stringify({ postId, comment: newComment })
91 | });
92 | } catch (err) {
93 | console.error("Failed to save comment:", err);
94 | }
95 | };
96 |
97 | // Fetch posts initially
98 | useEffect(() => {
99 | fetchPosts();
100 | }, []);
101 |
102 | const value: BlogContextProps = {
103 | posts,
104 | sortBy,
105 | selectedPost,
106 | isLoading,
107 | setPosts,
108 | setSortBy,
109 | setSelectedPost,
110 | setLoading,
111 | addComment,
112 | fetchPostById,
113 | error
114 | };
115 |
116 | return {children};
117 | };
118 |
--------------------------------------------------------------------------------
/package/src/components/ui/button.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react'
2 | import { Slot } from '@radix-ui/react-slot'
3 | import { cva, type VariantProps } from 'class-variance-authority'
4 |
5 | import { cn } from '@/lib/utils'
6 |
7 | const buttonVariants = cva(
8 | 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:cursor-pointer',
9 | {
10 | variants: {
11 | variant: {
12 | default: 'bg-primary text-white hover:bg-primaryemphasis',
13 | destructive:
14 | 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
15 | outline:
16 | 'border border-primary text-primary bg-transparent hover:bg-primary hover:text-white',
17 | outlinesecondary:
18 | 'border border-secondary text-secondary bg-transparent hover:bg-secondary hover:text-white',
19 | outlinesuccess:
20 | 'border border-success bg-transparent hover:bg-success text-success hover:text-white',
21 | outlinewarning:
22 | 'border border-warning bg-transparent hover:bg-warning text-warning hover:text-white',
23 | outlineinfo:
24 | 'border border-info bg-transparent hover:bg-info text-info hover:text-white',
25 | outlineerror:
26 | 'border border-error bg-transparent hover:bg-error text-error hover:text-white',
27 | secondary: 'bg-secondary text-white hover:bg-secondaryemphasis',
28 | success: 'bg-success text-white hover:bg-successemphasis',
29 | warning: 'bg-warning text-white hover:bg-warningemphasis',
30 | info: 'bg-info text-white hover:bg-infoemphasis',
31 | error: 'bg-error text-white hover:bg-erroremphasis',
32 | ghost: 'hover:bg-accent hover:text-accent-foreground',
33 | ghostprimary: 'hover:bg-lightprimary hover:text-primary text-primary',
34 | ghostsecondary:
35 | 'hover:bg-lightsecondary hover:text-secondary text-secondary',
36 | ghostsuccess: 'hover:bg-lightsuccess hover:text-success text-success',
37 | ghostwarning: 'hover:bg-lightwarning hover:text-warning text-warning',
38 | ghosterror: 'hover:bg-lighterror hover:text-error text-error',
39 | ghostinfo: 'hover:bg-lightinfo hover:text-info text-info',
40 | link: 'text-primary underline-offset-4 hover:underline',
41 | lightprimary:
42 | 'bg-lightprimary text-primary hover:bg-primary hover:text-white',
43 | lightsecondary:
44 | 'bg-lightsecondary text-secondary hover:bg-secondary hover:text-white',
45 | lightsuccess:
46 | 'bg-lightsuccess text-success hover:bg-success hover:text-white',
47 | lightwarning:
48 | 'bg-lightwarning text-warning hover:bg-warning hover:text-white',
49 | lightinfo: 'bg-lightinfo text-info hover:bg-info hover:text-white',
50 | lighterror: 'bg-lighterror text-error hover:bg-error hover:text-white',
51 | },
52 | size: {
53 | default: 'h-10 px-5 py-2',
54 | sm: 'h-9 rounded-md px-3',
55 | lg: 'h-11 rounded-md px-8',
56 | icon: 'h-10 w-10',
57 | },
58 | shape: {
59 | pill: 'rounded-full',
60 | },
61 | },
62 | defaultVariants: {
63 | variant: 'default',
64 | size: 'default',
65 | },
66 | }
67 | )
68 |
69 | export interface ButtonProps
70 | extends React.ButtonHTMLAttributes,
71 | VariantProps {
72 | asChild?: boolean
73 | }
74 |
75 | const Button = React.forwardRef(
76 | ({ className, variant, size, shape, asChild = false, ...props }, ref) => {
77 | const Comp = asChild ? Slot : 'button'
78 | return (
79 |
84 | )
85 | }
86 | )
87 | Button.displayName = 'Button'
88 |
89 | export { Button, buttonVariants }
90 |
--------------------------------------------------------------------------------
/package/src/components/ui/dialog.tsx:
--------------------------------------------------------------------------------
1 | 'use client'
2 |
3 | import * as React from 'react'
4 | import * as DialogPrimitive from '@radix-ui/react-dialog'
5 | import { X } from 'lucide-react'
6 |
7 | import { cn } from '@/lib/utils'
8 |
9 | const Dialog = DialogPrimitive.Root
10 |
11 | const DialogTrigger = DialogPrimitive.Trigger
12 |
13 | const DialogPortal = DialogPrimitive.Portal
14 |
15 | const DialogClose = DialogPrimitive.Close
16 |
17 | const DialogOverlay = React.forwardRef<
18 | React.ElementRef,
19 | React.ComponentPropsWithoutRef
20 | >(({ className, ...props }, ref) => (
21 |
29 | ))
30 | DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
31 |
32 | const DialogContent = React.forwardRef<
33 | React.ElementRef,
34 | React.ComponentPropsWithoutRef
35 | >(({ className, children, ...props }, ref) => (
36 |
37 |
38 |
49 | {children}
50 |
51 |
52 | Close
53 |
54 |
55 |
56 | ))
57 | DialogContent.displayName = DialogPrimitive.Content.displayName
58 |
59 | const DialogHeader = ({
60 | className,
61 | ...props
62 | }: React.HTMLAttributes) => (
63 |
70 | )
71 | DialogHeader.displayName = 'DialogHeader'
72 |
73 | const DialogFooter = ({
74 | className,
75 | ...props
76 | }: React.HTMLAttributes) => (
77 |
81 | )
82 | DialogFooter.displayName = 'DialogFooter'
83 |
84 | const DialogTitle = React.forwardRef<
85 | React.ElementRef,
86 | React.ComponentPropsWithoutRef
87 | >(({ className, ...props }, ref) => (
88 |
96 | ))
97 | DialogTitle.displayName = DialogPrimitive.Title.displayName
98 |
99 | const DialogDescription = React.forwardRef<
100 | React.ElementRef,
101 | React.ComponentPropsWithoutRef
102 | >(({ className, ...props }, ref) => (
103 |
108 | ))
109 | DialogDescription.displayName = DialogPrimitive.Description.displayName
110 |
111 | export {
112 | Dialog,
113 | DialogPortal,
114 | DialogOverlay,
115 | DialogTrigger,
116 | DialogClose,
117 | DialogContent,
118 | DialogHeader,
119 | DialogFooter,
120 | DialogTitle,
121 | DialogDescription,
122 | }
123 |
--------------------------------------------------------------------------------
/package/src/app/components/dashboard/BlogCards.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import Image from "next/image";
3 |
4 | import user1 from "../../../../public/images/profile/user-6.jpg";
5 | import user2 from "../../../../public/images/profile/user-2.jpg";
6 | import user3 from "../../../../public/images/profile/user-3.jpg";
7 | import img1 from "../../../../public/images/blog/blog-img1.jpg";
8 | import img2 from "../../../../public/images/blog/blog-img2.jpg";
9 | import img3 from "../../../../public/images/blog/blog-img3.jpg";
10 | import { TbPoint } from "react-icons/tb";
11 |
12 | import { Icon } from "@iconify/react";
13 | import Link from "next/link";
14 | import { Badge } from "@/components/ui/badge";
15 |
16 | const BlogCardsData = [
17 | {
18 | avatar: user1,
19 | coveravatar: img1,
20 | read: "2 min Read",
21 | title: "As yen tumbles, gadget-loving Japan goes for secondhand iPhones",
22 | category: "Social",
23 | name: "Georgeanna Ramero",
24 | view: "9,125",
25 | comments: "3",
26 | time: "Mon, Dec 19",
27 | url:''
28 | },
29 | {
30 | avatar: user2,
31 | coveravatar: img2,
32 | read: "2 min Read",
33 | title:
34 | "Intel loses bid to revive antitrust case against patent foe Fortress",
35 | category: "Gadget",
36 | name: "Georgeanna Ramero",
37 | view: "4,150",
38 | comments: "38",
39 | time: "Sun, Dec 18",
40 | url:''
41 | },
42 | {
43 | avatar: user3,
44 | coveravatar: img3,
45 | read: "2 min Read",
46 | title: "COVID outbreak deepens as more lockdowns loom in China",
47 | category: "Health",
48 | name: "Georgeanna Ramero",
49 | view: "9,480",
50 | comments: "12",
51 | time: "Sat, Dec 17",
52 | url:''
53 | },
54 | ];
55 |
56 | const BlogCards = () => {
57 | return (
58 | <>
59 |
60 | {BlogCardsData.map((item, i) => (
61 |
62 |
63 |
64 |
65 |
66 |
67 | {item.read}
68 |
69 |
70 |
71 |
72 |
77 |
78 | {item.category}
79 |
80 | {item.title}
81 |
82 |
83 |
84 | {item.view}
85 |
86 |
87 |
88 | {item.view}
89 |
90 |
91 | {" "}
95 | {item.time}
96 |
97 |
98 |
99 |
100 |
101 |
102 | ))}
103 |
104 | >
105 | );
106 | };
107 |
108 | export default BlogCards;
109 |
--------------------------------------------------------------------------------
/package/src/app/components/dashboard/SalesProfit.tsx:
--------------------------------------------------------------------------------
1 | "use client";
2 | import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
3 | import dynamic from "next/dynamic";
4 | const Chart = dynamic(() => import("react-apexcharts"), { ssr: false });
5 | const SalesProfit = () => {
6 | // chart
7 | const optionscolumnchart: any = {
8 | chart: {
9 | fontFamily: "inherit",
10 | foreColor: "#adb0bb",
11 | fontSize: "12px",
12 | offsetX: 0,
13 | offsetY: 10,
14 | animations: {
15 | speed: 500,
16 | },
17 | toolbar: {
18 | show: false,
19 | },
20 | },
21 | colors: ["var(--color-primary)", "#adb0bb35"],
22 | dataLabels: {
23 | enabled: false,
24 | },
25 | fill: {
26 | type: "gradient",
27 | gradient: {
28 | shadeIntensity: 0,
29 | inverseColors: false,
30 | opacityFrom: 0.1,
31 | opacity: 0.3,
32 | stops: [100],
33 | },
34 | },
35 | grid: {
36 | show: true,
37 | strokeDashArray: 3,
38 | borderColor: "#90A4AE50",
39 | },
40 | stroke: {
41 | curve: "smooth",
42 | width: 2,
43 | },
44 | xaxis: {
45 | axisBorder: {
46 | show: false,
47 | },
48 | axisTicks: {
49 | show: false,
50 | },
51 | },
52 | yaxis: {
53 | min: 0,
54 | max: 90,
55 | tickAmount: 3,
56 | },
57 | legend: {
58 | show: false,
59 | },
60 | tooltip: {
61 | theme: "dark",
62 | },
63 | };
64 |
65 | const areaChart = {
66 | series: [
67 | {
68 | type: "area",
69 | name: "This Year",
70 | chart: {
71 | foreColor: "#111c2d99",
72 | fontSize: 12,
73 | fontWeight: 500,
74 | dropShadow: {
75 | enabled: true,
76 | enabledOnSeries: undefined,
77 | top: 5,
78 | left: 0,
79 | blur: 3,
80 | color: "#000",
81 | opacity: 0.1,
82 | },
83 | },
84 | data: [
85 | { x: "Aug", y: 25 },
86 | { x: "Sep", y: 25 },
87 | { x: "Oct", y: 10 },
88 | { x: "Nov", y: 10 },
89 | { x: "Dec", y: 45 },
90 | { x: "Jan", y: 45 },
91 | { x: "Feb", y: 75 },
92 | { x: "Mar", y: 70 },
93 | { x: "Apr", y: 35 },
94 | ],
95 | },
96 | {
97 | type: "area",
98 | name: "Last Year",
99 | chart: {
100 | foreColor: "#111c2d99",
101 | },
102 |
103 | data: [
104 | { x: "Aug", y: 50 },
105 | { x: "Sep", y: 50 },
106 | { x: "Oct", y: 25 },
107 | { x: "Nov", y: 20 },
108 | { x: "Dec", y: 20 },
109 | { x: "Jan", y: 20 },
110 | { x: "Feb", y: 35 },
111 | { x: "Mar", y: 35 },
112 | { x: "Apr", y: 60 },
113 | ],
114 | },
115 | ],
116 | };
117 |
118 | return (
119 |
120 |
121 | Sales Profit
122 |
133 |
134 |
135 |
136 |
143 |
144 |
145 | );
146 | };
147 |
148 | export default SalesProfit;
149 |
--------------------------------------------------------------------------------
/package/src/app/css/theme/default-colors.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --color-info: #46caeb;
3 | --color-success: #00ceb6;
4 | --color-warning: #FFB900;
5 | --color-error: #FF6692;
6 | --color-darkinfo: #223662;
7 | --color-white: #fff;
8 | --color-dark: #111c2d;
9 | --color-border: #e0e6eb;
10 | --color-darkborder: #333f55;
11 | --color-link: #2a3547;
12 | --color-muted: #EFF4FA;
13 | --color-darkmuted: #2a3851;
14 | --color-darklink: #7b8893;
15 | --color-lightgray: #F8FAFD;
16 | --color-darkgray: #1a2537;
17 | --color-bodytext: #EFF4FAbf;
18 | --color-primary: #00A1FF;
19 | --color-secondary: #16CDC7;
20 | --color-input: #e5e7eb;
21 | --color-graymuted: #DECFDA;
22 | /* --color-error-emphasis: #d5745b; */
23 | /* --color-warning-emphasis: #d9941a; */
24 | /* --color-success-emphasis: #10bd9d; */
25 | /* --color-primary-emphasis: #4f73d9; */
26 | /* --color-secondary-emphasis: #3ea2d9; */
27 | /* --color-lightprimary: #00A1FF20; */
28 | /* --color-lightsecondary: #16CDC720; */
29 | /* --color-lightsuccess: #00ceb620; */
30 | /* --color-lighterror: #fa896b20; */
31 | /* --color-lightinfo: #46caeb1a; */
32 | /* --color-lightwarning: #ffae1f20; */
33 |
34 | /* Light Variants */
35 | --color-lightprimary: color-mix(
36 | in oklab,
37 | var(--color-primary) 12%,
38 | transparent
39 | );
40 | --color-lightsecondary: color-mix(
41 | in oklab,
42 | var(--color-secondary) 12%,
43 | transparent
44 | );
45 | --color-lightsuccess: color-mix(
46 | in oklab,
47 | var(--color-success) 12%,
48 | transparent
49 | );
50 | --color-lightwarning: color-mix(
51 | in oklab,
52 | var(--color-warning) 12%,
53 | transparent
54 | );
55 | --color-lighterror: color-mix(in oklab, var(--color-error) 12%, transparent);
56 | --color-lightinfo: color-mix(in oklab, var(--color-info) 12%, transparent);
57 |
58 | /* Emphasis Variants */
59 | --color-primary-emphasis: color-mix(
60 | in oklab,
61 | var(--color-primary) 80%,
62 | black
63 | );
64 | --color-secondary-emphasis: color-mix(
65 | in oklab,
66 | var(--color-secondary) 80%,
67 | black
68 | );
69 | --color-success-emphasis: color-mix(
70 | in oklab,
71 | var(--color-success) 80%,
72 | black
73 | );
74 | --color-warning-emphasis: color-mix(
75 | in oklab,
76 | var(--color-warning) 80%,
77 | black
78 | );
79 | --color-error-emphasis: color-mix(in oklab, var(--color-error) 80%, black);
80 | --color-info-emphasis: color-mix(in oklab, var(--color-info) 80%, black);
81 |
82 | /* common var for dark&light */
83 | --color-charcoal: #2a3547;
84 | --color-customdark: #111c2d;
85 | --color-defaultBorder: #e0e6eb;
86 | --color-slateGray: #EFF4FAbf;
87 | --color-breadcrumbColor: #16CDC720;
88 |
89 | --shadow-md: 0px 1px 4px 0px rgba(133, 146, 173, 0.2);
90 |
91 | /* shadCN Compnent */
92 |
93 | --radius: 10px;
94 | --background: #ffff;
95 | --foreground: var(--color-link);
96 | --card: var(--color-white);
97 | --card-foreground: var(--color-link);
98 | --popover: var(--color-white);
99 | --popover-foreground: var(--color-link);
100 | --primary: var(--color-primary);
101 | --primary-foreground: var(--color-white);
102 | --secondary: var(--color-secondary);
103 | --secondary-foreground: var(--color-white);
104 | --muted: #f5f5f5;
105 | --muted-foreground: #737373;
106 | --accent: var(--color-lightprimary);
107 | --accent-foreground: var(--color-primary);
108 | --destructive: var(--color-error);
109 | --destructive-foreground: var(--color-white);
110 | --border: #e5e5e5;
111 | --input: var(--color-input);
112 | --ring: var(--color-lightprimary);
113 | --chart-1: var(--color-primary);
114 | --chart-2: var(--color-secondary);
115 | --chart-3: var(--color-success);
116 | --chart-4: var(--color-warning);
117 | --chart-5: var(--color-error);
118 | --sidebar: var(--color-white);
119 | --sidebar-foreground: var(--color-link);
120 | --sidebar-primary: var(--color-primary);
121 | --sidebar-primary-foreground: var(--color-white);
122 | --sidebar-accent: var(--color-lightprimary);
123 | --sidebar-accent-foreground: var(--color-primary);
124 | --sidebar-border: #e5e5e5;
125 | --sidebar-ring: #a1a1a1;
126 | }
127 |
--------------------------------------------------------------------------------
|