Skip to content

Commit

Permalink
fix: following best tailwind practices (#470)
Browse files Browse the repository at this point in the history
* fix: following best tailwind practises

* fix: lint fix
  • Loading branch information
itsarghyadas authored Dec 27, 2024
1 parent a780bf2 commit 2793413
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion registry/default/magicui/bento-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type BentoCardProps = {
name: string;
className: string;
background: ReactNode;
Icon: any;
Icon: React.ElementType;
description: string;
href: string;
cta: string;
Expand Down
16 changes: 8 additions & 8 deletions registry/default/magicui/dot-pattern.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { useId } from "react";
import { cn } from "@/lib/utils";

interface DotPatternProps {
width?: any;
height?: any;
x?: any;
y?: any;
cx?: any;
cy?: any;
cr?: any;
width?: number;
height?: number;
x?: number;
y?: number;
cx?: number;
cy?: number;
cr?: number;
className?: string;
[key: string]: any;
[key: string]: unknown;
}
export function DotPattern({
width = 16,
Expand Down
19 changes: 10 additions & 9 deletions registry/default/magicui/hero-video-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @next/next/no-img-element */
"use client";

import { useState } from "react";
Expand Down Expand Up @@ -80,23 +81,23 @@ export default function HeroVideoDialog({
return (
<div className={cn("relative", className)}>
<div
className="relative cursor-pointer group"
className="group relative cursor-pointer"
onClick={() => setIsVideoOpen(true)}
>
<img
src={thumbnailSrc}
alt={thumbnailAlt}
width={1920}
height={1080}
className="w-full transition-all duration-200 group-hover:brightness-[0.8] ease-out rounded-md shadow-lg border"
className="w-full rounded-md border shadow-lg transition-all duration-200 ease-out group-hover:brightness-[0.8]"
/>
<div className="absolute inset-0 flex items-center justify-center group-hover:scale-100 scale-[0.9] transition-all duration-200 ease-out rounded-2xl">
<div className="bg-primary/10 flex items-center justify-center rounded-full backdrop-blur-md size-28">
<div className="absolute inset-0 flex scale-[0.9] items-center justify-center rounded-2xl transition-all duration-200 ease-out group-hover:scale-100">
<div className="flex size-28 items-center justify-center rounded-full bg-primary/10 backdrop-blur-md">
<div
className={`flex items-center justify-center bg-gradient-to-b from-primary/30 to-primary shadow-md rounded-full size-20 transition-all ease-out duration-200 relative group-hover:scale-[1.2] scale-100`}
className={`relative flex size-20 scale-100 items-center justify-center rounded-full bg-gradient-to-b from-primary/30 to-primary shadow-md transition-all duration-200 ease-out group-hover:scale-[1.2]`}
>
<Play
className="size-8 text-white fill-white group-hover:scale-105 scale-100 transition-transform duration-200 ease-out"
className="size-8 scale-100 fill-white text-white transition-transform duration-200 ease-out group-hover:scale-105"
style={{
filter:
"drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06))",
Expand All @@ -118,12 +119,12 @@ export default function HeroVideoDialog({
<motion.div
{...selectedAnimation}
transition={{ type: "spring", damping: 30, stiffness: 300 }}
className="relative w-full max-w-4xl aspect-video mx-4 md:mx-0"
className="relative mx-4 aspect-video w-full max-w-4xl md:mx-0"
>
<motion.button className="absolute -top-16 right-0 text-white text-xl bg-neutral-900/50 ring-1 backdrop-blur-md rounded-full p-2 dark:bg-neutral-100/50 dark:text-black">
<motion.button className="absolute -top-16 right-0 rounded-full bg-neutral-900/50 p-2 text-xl text-white ring-1 backdrop-blur-md dark:bg-neutral-100/50 dark:text-black">
<XIcon className="size-5" />
</motion.button>
<div className="size-full border-2 border-white rounded-2xl overflow-hidden isolate z-[1] relative">
<div className="relative isolate z-[1] size-full overflow-hidden rounded-2xl border-2 border-white">
<iframe
src={videoSrc}
className="size-full rounded-2xl"
Expand Down
2 changes: 1 addition & 1 deletion registry/default/magicui/icon-cloud.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const renderCustomIcon = (
href: undefined,
target: undefined,
rel: undefined,
onClick: (e: any) => e.preventDefault(),
onClick: (e: React.MouseEvent<HTMLAnchorElement>) => e.preventDefault(),
},
});
};
Expand Down
2 changes: 1 addition & 1 deletion registry/default/magicui/letter-pullup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function LetterPullup({

const pullupVariant = {
initial: { y: 100, opacity: 0 },
animate: (i: any) => ({
animate: (i: number) => ({
y: 0,
opacity: 1,
transition: {
Expand Down
2 changes: 1 addition & 1 deletion registry/default/magicui/magic-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function MagicCard({
<div
ref={cardRef}
className={cn(
"group relative flex size-full overflow-hidden rounded-xl bg-neutral-100 dark:bg-neutral-900 border text-black dark:text-white",
"group relative flex size-full overflow-hidden rounded-xl border bg-neutral-100 text-black dark:bg-neutral-900 dark:text-white",
className,
)}
>
Expand Down
2 changes: 1 addition & 1 deletion registry/default/magicui/number-ticker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function NumberTicker({
return (
<span
className={cn(
"inline-block tabular-nums text-black dark:text-white tracking-wider",
"inline-block tabular-nums tracking-wider text-black dark:text-white",
className,
)}
ref={ref}
Expand Down
4 changes: 2 additions & 2 deletions registry/default/magicui/pulsating-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function PulsatingButton({
return (
<button
className={cn(
"relative text-center cursor-pointer flex justify-center items-center rounded-lg text-white dark:text-black bg-blue-500 dark:bg-blue-500 px-4 py-2",
"relative flex cursor-pointer items-center justify-center rounded-lg bg-blue-500 px-4 py-2 text-center text-white dark:bg-blue-500 dark:text-black",
className,
)}
style={
Expand All @@ -32,7 +32,7 @@ export default function PulsatingButton({
{...props}
>
<div className="relative z-10">{children}</div>
<div className="absolute top-1/2 left-1/2 size-full rounded-lg bg-inherit animate-pulse -translate-x-1/2 -translate-y-1/2" />
<div className="absolute left-1/2 top-1/2 size-full -translate-x-1/2 -translate-y-1/2 animate-pulse rounded-lg bg-inherit" />
</button>
);
}
2 changes: 1 addition & 1 deletion registry/default/magicui/shimmer-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const ShimmerButton = React.forwardRef<HTMLButtonElement, ShimmerButtonProps>(
{/* spark */}
<div className="absolute inset-0 h-[100cqh] animate-shimmer-slide [aspect-ratio:1] [border-radius:0] [mask:none]">
{/* spark before */}
<div className="animate-spin-around absolute -inset-full w-auto rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))] [translate:0_0]" />
<div className="absolute -inset-full w-auto rotate-0 animate-spin-around [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))] [translate:0_0]" />
</div>
</div>
{children}
Expand Down
2 changes: 1 addition & 1 deletion registry/default/magicui/sparkles-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const SparklesText: React.FC<SparklesTextProps> = ({
const interval = setInterval(updateStars, 100);

return () => clearInterval(interval);
}, [colors.first, colors.second]);
}, [colors.first, colors.second, sparklesCount]);

return (
<div
Expand Down
8 changes: 5 additions & 3 deletions registry/default/magicui/tweet-card.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @next/next/no-img-element */
import { Suspense } from "react";
import {
enrichTweet,
Expand All @@ -11,7 +12,7 @@ import { cn } from "@/lib/utils";

interface TwitterIconProps {
className?: string;
[key: string]: any;
[key: string]: unknown;
}
const Twitter = ({ className, ...props }: TwitterIconProps) => (
<svg
Expand Down Expand Up @@ -64,7 +65,7 @@ export const TweetSkeleton = ({
...props
}: {
className?: string;
[key: string]: any;
[key: string]: unknown;
}) => (
<div
className={cn(
Expand All @@ -86,7 +87,7 @@ export const TweetNotFound = ({
...props
}: {
className?: string;
[key: string]: any;
[key: string]: unknown;
}) => (
<div
className={cn(
Expand Down Expand Up @@ -214,6 +215,7 @@ export const TweetMedia = ({ tweet }: { tweet: EnrichedTweet }) => (
// @ts-ignore
src={tweet.card.binding_values.thumbnail_image_large.image_value.url}
className="h-64 rounded-xl border object-cover shadow-sm"
alt={tweet.text}
/>
)}
</div>
Expand Down

0 comments on commit 2793413

Please sign in to comment.