diff --git a/apps/web/src/app/(dashboard)/documents/upload-document.tsx b/apps/web/src/app/(dashboard)/documents/upload-document.tsx
index 28ddd4318..26f1e795c 100644
--- a/apps/web/src/app/(dashboard)/documents/upload-document.tsx
+++ b/apps/web/src/app/(dashboard)/documents/upload-document.tsx
@@ -2,7 +2,6 @@
import { useMemo, useState } from 'react';
-import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { Loader } from 'lucide-react';
@@ -139,27 +138,6 @@ export const UploadDocument = ({ className, team }: UploadDocumentProps) => {
)}
-
- {team?.id === undefined && remaining.documents === 0 && (
-
-
-
- You have reached your document limit.
-
-
-
- You can upload up to {quota.documents} documents per month on your current plan.
-
-
-
- Upgrade your account to upload more documents.
-
-
-
- )}
);
};
diff --git a/packages/tailwind-config/index.cjs b/packages/tailwind-config/index.cjs
index 81706fd37..92222462f 100644
--- a/packages/tailwind-config/index.cjs
+++ b/packages/tailwind-config/index.cjs
@@ -28,6 +28,9 @@ module.exports = {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))',
},
+ warning: {
+ DEFAULT: 'hsl(var(--warning))',
+ },
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))',
diff --git a/packages/ui/lib/document-dropzone-constants.ts b/packages/ui/lib/document-dropzone-constants.ts
new file mode 100644
index 000000000..dd12acf97
--- /dev/null
+++ b/packages/ui/lib/document-dropzone-constants.ts
@@ -0,0 +1,120 @@
+import type { Variants } from 'framer-motion';
+
+export const DocumentDropzoneContainerVariants: Variants = {
+ initial: {
+ scale: 1,
+ },
+ animate: {
+ scale: 1,
+ },
+ hover: {
+ transition: {
+ staggerChildren: 0.05,
+ },
+ },
+};
+
+export const DocumentDropzoneCardLeftVariants: Variants = {
+ initial: {
+ x: 40,
+ y: -10,
+ rotate: -14,
+ },
+ animate: {
+ x: 40,
+ y: -10,
+ rotate: -14,
+ },
+ hover: {
+ x: -25,
+ y: -25,
+ rotate: -22,
+ },
+};
+
+export const DocumentDropzoneCardRightVariants: Variants = {
+ initial: {
+ x: -40,
+ y: -10,
+ rotate: 14,
+ },
+ animate: {
+ x: -40,
+ y: -10,
+ rotate: 14,
+ },
+ hover: {
+ x: 25,
+ y: -25,
+ rotate: 22,
+ },
+};
+
+export const DocumentDropzoneCardCenterVariants: Variants = {
+ initial: {
+ x: 0,
+ y: 0,
+ },
+ animate: {
+ x: 0,
+ y: 0,
+ },
+ hover: {
+ x: 0,
+ y: -25,
+ },
+};
+
+export const DocumentDropzoneDisabledCardLeftVariants: Variants = {
+ initial: {
+ x: 50,
+ y: 0,
+ rotate: -14,
+ },
+ animate: {
+ x: 50,
+ y: 0,
+ rotate: -14,
+ },
+ hover: {
+ x: 30,
+ y: 0,
+ rotate: -17,
+ transition: { type: 'spring', duration: 0.3, stiffness: 500 },
+ },
+};
+
+export const DocumentDropzoneDisabledCardRightVariants: Variants = {
+ initial: {
+ x: -50,
+ y: 0,
+ rotate: 14,
+ },
+ animate: {
+ x: -50,
+ y: 0,
+ rotate: 14,
+ },
+ hover: {
+ x: -30,
+ y: 0,
+ rotate: 17,
+ transition: { type: 'spring', duration: 0.3, stiffness: 500 },
+ },
+};
+
+export const DocumentDropzoneDisabledCardCenterVariants: Variants = {
+ initial: {
+ x: -10,
+ y: 0,
+ },
+ animate: {
+ x: -10,
+ y: 0,
+ },
+ hover: {
+ x: [-15, -10, -5, -10],
+ y: 0,
+ transition: { type: 'spring', duration: 0.3, stiffness: 1000 },
+ },
+};
diff --git a/packages/ui/primitives/document-dropzone.tsx b/packages/ui/primitives/document-dropzone.tsx
index 6caf6d040..c0006a5f6 100644
--- a/packages/ui/primitives/document-dropzone.tsx
+++ b/packages/ui/primitives/document-dropzone.tsx
@@ -1,90 +1,27 @@
'use client';
-import type { Variants } from 'framer-motion';
+import Link from 'next/link';
+
import { motion } from 'framer-motion';
-import { Plus } from 'lucide-react';
+import { AlertTriangle, Plus } from 'lucide-react';
import { useDropzone } from 'react-dropzone';
-import { APP_DOCUMENT_UPLOAD_SIZE_LIMIT } from '@documenso/lib/constants/app';
+import { APP_DOCUMENT_UPLOAD_SIZE_LIMIT, IS_BILLING_ENABLED } from '@documenso/lib/constants/app';
import { megabytesToBytes } from '@documenso/lib/universal/unit-convertions';
+import {
+ DocumentDropzoneCardCenterVariants,
+ DocumentDropzoneCardLeftVariants,
+ DocumentDropzoneCardRightVariants,
+ DocumentDropzoneContainerVariants,
+ DocumentDropzoneDisabledCardCenterVariants,
+ DocumentDropzoneDisabledCardLeftVariants,
+ DocumentDropzoneDisabledCardRightVariants,
+} from '../lib/document-dropzone-constants';
import { cn } from '../lib/utils';
+import { Button } from './button';
import { Card, CardContent } from './card';
-const DocumentDropzoneContainerVariants: Variants = {
- initial: {
- scale: 1,
- },
- animate: {
- scale: 1,
- },
- hover: {
- transition: {
- staggerChildren: 0.05,
- },
- },
-};
-
-const DocumentDropzoneCardLeftVariants: Variants = {
- initial: {
- x: 40,
- y: -10,
- rotate: -14,
- },
- animate: {
- x: 40,
- y: -10,
- rotate: -14,
- },
- hover: {
- x: -25,
- y: -25,
- rotate: -22,
- },
-};
-
-const DocumentDropzoneCardRightVariants: Variants = {
- initial: {
- x: -40,
- y: -10,
- rotate: 14,
- },
- animate: {
- x: -40,
- y: -10,
- rotate: 14,
- },
- hover: {
- x: 25,
- y: -25,
- rotate: 22,
- },
-};
-
-const DocumentDropzoneCardCenterVariants: Variants = {
- initial: {
- x: 0,
- y: 0,
- },
- animate: {
- x: 0,
- y: 0,
- },
- hover: {
- x: 0,
- y: -25,
- },
-};
-
-const DocumentDescription = {
- document: {
- headline: 'Add a document',
- },
- template: {
- headline: 'Upload Template Document',
- },
-};
-
export type DocumentDropzoneProps = {
className?: string;
disabled?: boolean;
@@ -123,68 +60,108 @@ export const DocumentDropzone = ({
maxSize: megabytesToBytes(APP_DOCUMENT_UPLOAD_SIZE_LIMIT),
});
+ const heading = {
+ document: disabled ? 'You have reached your document limit.' : 'Add a document',
+ template: 'Upload Template Document',
+ };
+
return (
- {/* */}
-
-
-
-
-
-
+ {disabled ? (
+ // Disabled State
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+ ) : (
+ // Non Disabled State
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
-
- {DocumentDescription[type].headline}
-
+ {heading[type]}
-
+
{disabled ? disabledMessage : 'Drag & drop your PDF here.'}
+
+ {disabled && IS_BILLING_ENABLED() && (
+
+ )}
diff --git a/packages/ui/styles/theme.css b/packages/ui/styles/theme.css
index 58dbc892d..8e488ad95 100644
--- a/packages/ui/styles/theme.css
+++ b/packages/ui/styles/theme.css
@@ -42,6 +42,8 @@
--ring: 95.08 71.08% 67.45%;
--radius: 0.5rem;
+
+ --warning: 54 96% 45%;
}
.dark {
@@ -79,6 +81,8 @@
--ring: 95.08 71.08% 67.45%;
--radius: 0.5rem;
+
+ --warning: 54 96% 45%;
}
}