From 81c4190b0062053a1b1dda32fd6e1dfe2f569eb5 Mon Sep 17 00:00:00 2001 From: swve Date: Mon, 10 Mar 2025 13:26:53 +0100 Subject: [PATCH] feat: migrate tailwind to v4 --- apps/web/app/auth/forgot/forgot.tsx | 4 +- apps/web/app/auth/login/login.tsx | 6 +- apps/web/app/auth/reset/reset.tsx | 4 +- apps/web/app/auth/signup/InviteOnlySignUp.tsx | 6 +- apps/web/app/auth/signup/OpenSignup.tsx | 6 +- .../(withmenu)/collections/new/page.tsx | 12 +- .../activity/[activityid]/activity.tsx | 16 +- .../(withmenu)/course/[courseuuid]/course.tsx | 2 +- .../Subs/AssignmentTaskGeneralEdit.tsx | 4 +- .../Subs/TaskTypes/TaskFileObject.tsx | 20 +- .../Subs/TaskTypes/TaskQuizObject.tsx | 6 +- .../_components/TaskEditor/TaskEditor.tsx | 4 +- .../assignments/[assignmentuuid]/page.tsx | 6 +- .../subpages/AssignmentEditorSubPage.tsx | 2 +- .../course/[courseuuid]/[subpage]/page.tsx | 2 +- apps/web/app/orgs/[orgslug]/dash/page.tsx | 34 +- .../dash/users/settings/[subpage]/page.tsx | 2 +- apps/web/components.json | 3 +- .../EditCourseAccess/EditCourseAccess.tsx | 2 +- .../EditCourseGeneral/EditCourseGeneral.tsx | 4 +- .../EditCourseGeneral/LearningItemsList.tsx | 6 +- .../EditCourseGeneral/ThumbnailUpdate.tsx | 8 +- .../EditCourseGeneral/UnsplashImagePicker.tsx | 2 +- .../Buttons/NewActivityButton.tsx | 6 +- .../DraggableElements/ActivityElement.tsx | 8 +- .../DraggableElements/ChapterElement.tsx | 4 +- .../EditCourseStructure.tsx | 2 +- .../Pages/Org/OrgEditImages/OrgEditImages.tsx | 32 +- .../Org/OrgEditLanding/OrgEditLanding.tsx | 14 +- .../Payments/PaymentsConfigurationPage.tsx | 4 +- .../Pages/Payments/PaymentsProductPage.tsx | 6 +- .../SubComponents/CreateProductForm.tsx | 2 +- .../SubComponents/LinkCourseModal.tsx | 6 +- .../Pages/Users/OrgAccess/OrgAccess.tsx | 2 +- .../Users/OrgUserGroups/OrgUserGroups.tsx | 2 +- .../Pages/Users/OrgUsers/OrgUsers.tsx | 2 +- .../Pages/Users/OrgUsersAdd/OrgUsersAdd.tsx | 2 +- .../web/components/Landings/LandingCustom.tsx | 8 +- .../Objects/Activities/AI/AIActivityAsk.tsx | 8 +- .../Activities/Assignment/AssignmentBoxUI.tsx | 12 +- .../Assignment/AssignmentStudentActivity.tsx | 10 +- .../Objects/Activities/Video/Video.tsx | 4 +- .../CourseActions/CourseActionsMobile.tsx | 2 +- .../CourseActions/CoursePaidOptions.tsx | 2 +- .../Objects/Editor/AI/AIEditorToolkit.tsx | 8 +- apps/web/components/Objects/Editor/Editor.tsx | 6 +- .../Extensions/Badges/BadgesExtension.tsx | 2 +- .../Extensions/Buttons/ButtonsExtension.tsx | 2 +- .../Callout/Info/InfoCalloutComponent.tsx | 4 +- .../Warning/WarningCalloutComponent.tsx | 4 +- .../EmbedObjects/EmbedObjectsComponent.tsx | 12 +- .../Extensions/Image/ImageBlockComponent.tsx | 4 +- .../Extensions/PDF/PDFBlockComponent.tsx | 2 +- .../Extensions/Quiz/QuizBlockComponent.tsx | 12 +- .../Extensions/Video/VideoBlockComponent.tsx | 2 +- apps/web/components/Objects/Menus/OrgMenu.tsx | 4 +- .../Modals/Activities/Create/NewActivity.tsx | 2 +- .../Modals/Course/Create/CreateCourse.tsx | 6 +- .../Dash/EditCourseAccess/LinkToUserGroup.tsx | 2 +- .../Objects/Onboarding/Onboarding.tsx | 4 +- .../components/Objects/Search/SearchBar.tsx | 2 +- .../ConfirmationModal/ConfirmationModal.tsx | 2 +- .../Objects/StyledElements/Error/Error.tsx | 2 +- .../Objects/StyledElements/Form/TagInput.tsx | 2 +- .../Objects/StyledElements/Info/Info.tsx | 2 +- .../Wrappers/GeneralWrapper.tsx | 2 +- .../Thumbnails/CourseThumbnailLanding.tsx | 2 +- .../Pages/CourseEdit/Draggables/Activity.tsx | 4 +- .../Pages/CourseEdit/Draggables/Chapter.tsx | 8 +- .../Pages/Trail/TrailCourseElement.tsx | 4 +- .../components/Security/HeaderProfileBox.tsx | 2 +- apps/web/components/ui/badge.tsx | 6 +- apps/web/components/ui/button.tsx | 10 +- apps/web/components/ui/dialog.tsx | 7 +- apps/web/components/ui/dropdown-menu.tsx | 8 +- apps/web/components/ui/input.tsx | 2 +- apps/web/components/ui/select.tsx | 4 +- apps/web/components/ui/switch.tsx | 2 +- apps/web/components/ui/table.tsx | 2 +- apps/web/components/ui/tabs.tsx | 4 +- apps/web/components/ui/textarea.tsx | 2 +- apps/web/components/ui/toggle.tsx | 4 +- apps/web/package.json | 4 +- apps/web/pnpm-lock.yaml | 498 ++++++++++-------- apps/web/postcss.config.js | 3 +- apps/web/styles/globals.css | 270 ++++++---- apps/web/tailwind.config.js | 160 +++--- 87 files changed, 773 insertions(+), 620 deletions(-) diff --git a/apps/web/app/auth/forgot/forgot.tsx b/apps/web/app/auth/forgot/forgot.tsx index c37af352..48d651a0 100644 --- a/apps/web/app/auth/forgot/forgot.tsx +++ b/apps/web/app/auth/forgot/forgot.tsx @@ -113,13 +113,13 @@ function ForgotPasswordClient() {

{error && ( -
+
{error}
)} {message && ( -
+
{message}
diff --git a/apps/web/app/auth/login/login.tsx b/apps/web/app/auth/login/login.tsx index 24fec8ea..df428d71 100644 --- a/apps/web/app/auth/login/login.tsx +++ b/apps/web/app/auth/login/login.tsx @@ -132,7 +132,7 @@ const LoginClient = (props: LoginClientProps) => {
{error && ( -
+
{error}
@@ -188,11 +188,11 @@ const LoginClient = (props: LoginClientProps) => {
OR
- + Sign up - diff --git a/apps/web/app/auth/reset/reset.tsx b/apps/web/app/auth/reset/reset.tsx index 7451d140..25f77280 100644 --- a/apps/web/app/auth/reset/reset.tsx +++ b/apps/web/app/auth/reset/reset.tsx @@ -133,14 +133,14 @@ function ResetPasswordClient() {

{error && ( -
+
{error}
)} {message && (
-
+
{message}
diff --git a/apps/web/app/auth/signup/InviteOnlySignUp.tsx b/apps/web/app/auth/signup/InviteOnlySignUp.tsx index 41a21618..69e49653 100644 --- a/apps/web/app/auth/signup/InviteOnlySignUp.tsx +++ b/apps/web/app/auth/signup/InviteOnlySignUp.tsx @@ -98,13 +98,13 @@ function InviteOnlySignUpComponent(props: InviteOnlySignUpProps) { return (
{error && ( -
+
{error}
)} {message && ( -
+
{message}
@@ -185,7 +185,7 @@ function InviteOnlySignUpComponent(props: InviteOnlySignUpProps) {
- diff --git a/apps/web/app/auth/signup/OpenSignup.tsx b/apps/web/app/auth/signup/OpenSignup.tsx index 20fe9c91..ee44ed4e 100644 --- a/apps/web/app/auth/signup/OpenSignup.tsx +++ b/apps/web/app/auth/signup/OpenSignup.tsx @@ -94,13 +94,13 @@ function OpenSignUpComponent() { return (
{error && ( -
+
{error}
)} {message && ( -
+
{message}
@@ -179,7 +179,7 @@ function OpenSignUpComponent() {
- diff --git a/apps/web/app/orgs/[orgslug]/(withmenu)/collections/new/page.tsx b/apps/web/app/orgs/[orgslug]/(withmenu)/collections/new/page.tsx index 621ce2fa..817ee69e 100644 --- a/apps/web/app/orgs/[orgslug]/(withmenu)/collections/new/page.tsx +++ b/apps/web/app/orgs/[orgslug]/(withmenu)/collections/new/page.tsx @@ -107,7 +107,7 @@ function NewCollection(params: any) { placeholder="Enter collection name" value={name} onChange={handleNameChange} - className="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition" + className="mt-1 block w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:border-transparent transition" maxLength={100} /> @@ -116,7 +116,7 @@ function NewCollection(params: any) { Visibility i.id === item.id)?.link || ''} diff --git a/apps/web/components/Dashboard/Pages/Course/EditCourseGeneral/ThumbnailUpdate.tsx b/apps/web/components/Dashboard/Pages/Course/EditCourseGeneral/ThumbnailUpdate.tsx index ba264bd2..3b7a77ef 100644 --- a/apps/web/components/Dashboard/Pages/Course/EditCourseGeneral/ThumbnailUpdate.tsx +++ b/apps/web/components/Dashboard/Pages/Course/EditCourseGeneral/ThumbnailUpdate.tsx @@ -52,19 +52,19 @@ function ThumbnailUpdate() { } return ( -
+
{error && ( -
+
{error}
)} {localThumbnail ? ( ) : ( )}
diff --git a/apps/web/components/Dashboard/Pages/Course/EditCourseGeneral/UnsplashImagePicker.tsx b/apps/web/components/Dashboard/Pages/Course/EditCourseGeneral/UnsplashImagePicker.tsx index 68abb289..708a8a32 100644 --- a/apps/web/components/Dashboard/Pages/Course/EditCourseGeneral/UnsplashImagePicker.tsx +++ b/apps/web/components/Dashboard/Pages/Course/EditCourseGeneral/UnsplashImagePicker.tsx @@ -106,7 +106,7 @@ const UnsplashImagePicker: React.FC = ({ onSelect, onC value={query} onChange={handleSearch} placeholder="Search for images..." - className="w-full p-2 pl-10 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" + className="w-full p-2 pl-10 border rounded-lg focus:outline-hidden focus:ring-2 focus:ring-blue-500" />
diff --git a/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/Buttons/NewActivityButton.tsx b/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/Buttons/NewActivityButton.tsx index 63e8f0f5..e955c0cc 100644 --- a/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/Buttons/NewActivityButton.tsx +++ b/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/Buttons/NewActivityButton.tsx @@ -117,10 +117,10 @@ function NewActivityButton(props: NewActivityButtonProps) { onClick={() => { openNewActivityModal(props.chapterId) }} - className="flex w-44 h-10 space-x-2 items-center py-2 my-3 rounded-xl justify-center text-white bg-black hover:cursor-pointer" + className="flex w-44 h-10 items-center justify-center py-2 my-3 rounded-xl text-white bg-black hover:cursor-pointer" > - -
+ +
Add Activity
diff --git a/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx b/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx index 294fc2fb..a27ec2a8 100644 --- a/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx +++ b/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx @@ -129,7 +129,7 @@ function ActivityElement(props: ActivitiyElementProps) {
changePublicStatus()} > @@ -192,7 +192,7 @@ function ActivityElement(props: ActivitiyElementProps) { )}` } prefetch - className="p-1 px-2 sm:px-3 bg-gradient-to-bl text-cyan-800 from-sky-400/50 to-cyan-200/80 border border-cyan-600/10 shadow-md rounded-md font-bold text-xs flex items-center space-x-1 transition-colors duration-200 hover:from-sky-500/50 hover:to-cyan-300/80" + className="p-1 px-2 sm:px-3 bg-linear-to-bl text-cyan-800 from-sky-400/50 to-cyan-200/80 border border-cyan-600/10 shadow-md rounded-md font-bold text-xs flex items-center space-x-1 transition-colors duration-200 hover:from-sky-500/50 hover:to-cyan-300/80" rel="noopener noreferrer" > diff --git a/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/DraggableElements/ChapterElement.tsx b/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/DraggableElements/ChapterElement.tsx index f035b937..2ca954a8 100644 --- a/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/DraggableElements/ChapterElement.tsx +++ b/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/DraggableElements/ChapterElement.tsx @@ -92,7 +92,7 @@ function ChapterElement(props: ChapterElementProps) {
diff --git a/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/EditCourseStructure.tsx b/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/EditCourseStructure.tsx index 834a0d1f..ac1508e0 100644 --- a/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/EditCourseStructure.tsx +++ b/apps/web/components/Dashboard/Pages/Course/EditCourseStructure/EditCourseStructure.tsx @@ -164,7 +164,7 @@ const EditCourseStructure = (props: EditCourseStructureProps) => { dialogTitle="Create chapter" dialogDescription="Add a new chapter to the course" dialogTrigger={ -
+
Logo Thumbnail Previews @@ -390,7 +390,7 @@ export default function OrgEditImages() {
-
+
-
+
-
+
@@ -520,7 +520,7 @@ export default function OrgEditImages() { ref={provided.innerRef} {...provided.draggableProps} className={cn( - "relative group flex-shrink-0", + "relative group shrink-0", "w-48", snapshot.isDragging ? "scale-105 z-50" : "hover:scale-102", )} @@ -529,7 +529,7 @@ export default function OrgEditImages() { onClick={() => removePreview(preview.id)} className={cn( "absolute -top-2 -right-2 bg-red-500 hover:bg-red-600 text-white rounded-full p-1.5", - "opacity-0 group-hover:opacity-100 z-10 shadow-sm", + "opacity-0 group-hover:opacity-100 z-10 shadow-xs", "transition-opacity duration-200" )} > @@ -539,7 +539,7 @@ export default function OrgEditImages() { {...provided.dragHandleProps} className={cn( "absolute -top-2 -left-2 bg-gray-600 hover:bg-gray-700 text-white rounded-full p-1.5", - "opacity-0 group-hover:opacity-100 cursor-grab active:cursor-grabbing z-10 shadow-sm", + "opacity-0 group-hover:opacity-100 cursor-grab active:cursor-grabbing z-10 shadow-xs", "transition-opacity duration-200" )} > @@ -551,7 +551,7 @@ export default function OrgEditImages() { `w-full ${PREVIEW_HEIGHT} bg-contain bg-no-repeat bg-center rounded-xl bg-white`, "border border-gray-200 hover:border-gray-300", "transition-colors duration-200", - snapshot.isDragging ? "shadow-lg" : "shadow-sm hover:shadow-md" + snapshot.isDragging ? "shadow-lg" : "shadow-xs hover:shadow-md" )} style={{ backgroundImage: `url(${getOrgPreviewMediaDirectory(org?.org_uuid, preview.id)})`, @@ -561,7 +561,7 @@ export default function OrgEditImages() {
{ diff --git a/apps/web/components/Dashboard/Pages/Org/OrgEditLanding/OrgEditLanding.tsx b/apps/web/components/Dashboard/Pages/Org/OrgEditLanding/OrgEditLanding.tsx index 8e9d6b53..ddd69c2a 100644 --- a/apps/web/components/Dashboard/Pages/Org/OrgEditLanding/OrgEditLanding.tsx +++ b/apps/web/components/Dashboard/Pages/Org/OrgEditLanding/OrgEditLanding.tsx @@ -288,7 +288,7 @@ const OrgEditLanding = () => { onChange={() => setIsLandingEnabled(!isLandingEnabled)} className="sr-only peer" /> -
+
-
+

{product.description} @@ -194,7 +194,7 @@ function PaymentsProductPage() {

-
+
diff --git a/apps/web/components/Dashboard/Pages/Payments/SubComponents/CreateProductForm.tsx b/apps/web/components/Dashboard/Pages/Payments/SubComponents/CreateProductForm.tsx index 25efeb62..d068d300 100644 --- a/apps/web/components/Dashboard/Pages/Payments/SubComponents/CreateProductForm.tsx +++ b/apps/web/components/Dashboard/Pages/Payments/SubComponents/CreateProductForm.tsx @@ -135,7 +135,7 @@ const CreateProductForm: React.FC<{ onSuccess: () => void }> = ({ onSuccess }) =
-
+
diff --git a/apps/web/components/Dashboard/Pages/Payments/SubComponents/LinkCourseModal.tsx b/apps/web/components/Dashboard/Pages/Payments/SubComponents/LinkCourseModal.tsx index 9052f239..5c66e188 100644 --- a/apps/web/components/Dashboard/Pages/Payments/SubComponents/LinkCourseModal.tsx +++ b/apps/web/components/Dashboard/Pages/Payments/SubComponents/LinkCourseModal.tsx @@ -43,12 +43,12 @@ const CoursePreview = ({ course, orgslug, onLink, isLinked }: CoursePreviewProps
{/* Thumbnail */}
{/* Content */} -
+

{course.name}

@@ -58,7 +58,7 @@ const CoursePreview = ({ course, orgslug, onLink, isLinked }: CoursePreviewProps
{/* Action Button */} -
+
{isLinked ? (
-
+

diff --git a/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx b/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx index e8dd3953..5bf99b3d 100644 --- a/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx +++ b/apps/web/components/Objects/Editor/AI/AIEditorToolkit.tsx @@ -86,7 +86,7 @@ function AIEditorToolkit(props: AIEditorToolkitProps) { background: 'linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%), radial-gradient(105.16% 105.16% at 50% -5.16%, rgba(255, 255, 255, 0.18) 0%, rgba(0, 0, 0, 0) 100%), rgb(2 1 25 / 98%)', }} - className="z-50 rounded-2xl max-w-screen-2xl my-10 mx-auto w-fit fixed bottom-0 left-1/2 transform -translate-x-1/2 shadow-xl ring-1 ring-inset ring-white/10 text-white p-3 flex-col-reverse backdrop-blur-md" + className="z-50 rounded-2xl max-w-(--breakpoint-2xl) my-10 mx-auto w-fit fixed bottom-0 left-1/2 transform -translate-x-1/2 shadow-xl ring-1 ring-inset ring-white/10 text-white p-3 flex-col-reverse backdrop-blur-md" >

@@ -447,7 +447,7 @@ const UserFeedbackModal = (props: AIEditorToolkitProps) => { background: 'linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.2) 100%), radial-gradient(105.16% 105.16% at 50% -5.16%, rgba(255, 255, 255, 0.18) 0%, rgba(0, 0, 0, 0) 100%), rgb(2 1 25 / 95%)', }} - className="backdrop-blur-md z-50 rounded-2xl max-w-screen-2xl my-10 mx-auto w-[500px] h-[200px] fixed bottom-16 left-1/2 transform -translate-x-1/2 shadow-xl ring-1 ring-inset ring-white/10 text-white p-3 flex-col-reverse" + className="backdrop-blur-md z-50 rounded-2xl max-w-(--breakpoint-2xl) my-10 mx-auto w-[500px] h-[200px] fixed bottom-16 left-1/2 transform -translate-x-1/2 shadow-xl ring-1 ring-inset ring-white/10 text-white p-3 flex-col-reverse" >
{ value={aiEditorState.chatInputValue} onChange={handleChange} placeholder="Ask AI" - className="ring-1 ring-inset ring-white/20 w-full bg-gray-950/20 rounded-lg outline-none px-4 py-2 text-white text-sm placeholder:text-white/30" + className="ring-1 ring-inset ring-white/20 w-full bg-gray-950/20 rounded-lg outline-hidden px-4 py-2 text-white text-sm placeholder:text-white/30" >
@@ -620,7 +620,7 @@ const AiEditorActionScreen = ({ value={aiEditorState.chatInputValue} onChange={handleChange} placeholder="Japanese, Arabic, German, etc. " - className="ring-1 ring-inset ring-white/20 w-full bg-gray-950/20 rounded-lg outline-none px-4 py- text-white text-sm placeholder:text-white/30" + className="ring-1 ring-inset ring-white/20 w-full bg-gray-950/20 rounded-lg outline-hidden px-4 py- text-white text-sm placeholder:text-white/30" >
- + @@ -254,7 +254,7 @@ function Editor(props: Editor) { />
props.setContent(editor.getJSON())} > {' '} @@ -265,7 +265,7 @@ function Editor(props: Editor) { target="_blank" href={`/course/${course_uuid}/activity/${activity_uuid}`} > -
+
diff --git a/apps/web/components/Objects/Editor/Extensions/Badges/BadgesExtension.tsx b/apps/web/components/Objects/Editor/Extensions/Badges/BadgesExtension.tsx index 41e1a2fc..8ac76efc 100644 --- a/apps/web/components/Objects/Editor/Extensions/Badges/BadgesExtension.tsx +++ b/apps/web/components/Objects/Editor/Extensions/Badges/BadgesExtension.tsx @@ -164,7 +164,7 @@ const BadgesExtension: React.FC = (props: any) => { {colors.map((c) => (