diff --git a/sparkle/src/components/AnimatedShinyText.tsx b/sparkle/src/components/AnimatedShinyText.tsx
deleted file mode 100644
index d554e29a142c..000000000000
--- a/sparkle/src/components/AnimatedShinyText.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { CSSProperties, ReactNode } from "react";
-import React from "react";
-
-import { cn } from "@sparkle/lib/utils";
-
-interface AnimatedShinyTextProps {
- children: ReactNode;
- className?: string;
-}
-
-export function AnimatedShinyText({
- children,
- className,
-}: AnimatedShinyTextProps) {
- return (
-
- {children}
-
- );
-}
diff --git a/sparkle/src/components/AnimatedText.tsx b/sparkle/src/components/AnimatedText.tsx
new file mode 100644
index 000000000000..e70d593b3025
--- /dev/null
+++ b/sparkle/src/components/AnimatedText.tsx
@@ -0,0 +1,53 @@
+import { cva, VariantProps } from "class-variance-authority";
+import { ReactNode } from "react";
+import React from "react";
+
+import { cn } from "@sparkle/lib/utils";
+
+const animVariants = cva(
+ "s-relative s-mx-auto s-max-w-md s-text-black/0 s-animate-shiny-text s-bg-clip-text s-bg-no-repeat [background-position:0_0] [background-size:50%_100%] s-bg-gradient-to-r",
+ {
+ variants: {
+ variant: {
+ muted:
+ "s-from-transparent s-via-primary-950/80 s-via-50% s-to-transparent",
+ highlight:
+ "s-from-highlight s-via-highlight-800 s-via-50% s-to-highlight",
+ },
+ },
+ defaultVariants: {
+ variant: "muted",
+ },
+ }
+);
+
+const textVariants = cva("s-absolute s-inset-0", {
+ variants: {
+ variant: {
+ muted: "s-text-muted-foreground",
+ highlight: "s-text-highlight",
+ },
+ },
+ defaultVariants: {
+ variant: "muted",
+ },
+});
+
+interface AnimatedShinyTextProps {
+ children: ReactNode;
+ variant?: VariantProps["variant"];
+ className?: string;
+}
+
+export function AnimatedText({
+ children,
+ variant,
+ className,
+}: AnimatedShinyTextProps) {
+ return (
+
+ {children}
+ {children}
+
+ );
+}
diff --git a/sparkle/src/components/index.ts b/sparkle/src/components/index.ts
index 0d8e57983562..55360e1d3923 100644
--- a/sparkle/src/components/index.ts
+++ b/sparkle/src/components/index.ts
@@ -1,4 +1,4 @@
-export { AnimatedShinyText } from "./AnimatedShinyText";
+export { AnimatedText } from "./AnimatedText";
export { AssistantPreview } from "./AssistantPreview";
export { Avatar } from "./Avatar";
export { Banner } from "./Banner";
diff --git a/sparkle/src/stories/AnimatedShinyText.stories.tsx b/sparkle/src/stories/AnimatedShinyText.stories.tsx
deleted file mode 100644
index f1bc8a4aa1b8..000000000000
--- a/sparkle/src/stories/AnimatedShinyText.stories.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { Meta } from "@storybook/react";
-import React from "react";
-
-import { cn } from "@sparkle/lib";
-
-import { AnimatedShinyText } from "../index_with_tw_base";
-
-const meta = {
- title: "Primitives/AnimatedShinyText",
- component: AnimatedShinyText,
-} satisfies Meta;
-
-export default meta;
-
-export function AnimatedShinyTextDemo() {
- return (
-
-
-
- ✨ Introducing Magic UI
-
-
-
- );
-}
diff --git a/sparkle/src/stories/AnimatedText.stories.tsx b/sparkle/src/stories/AnimatedText.stories.tsx
new file mode 100644
index 000000000000..dedf7f8ec1c8
--- /dev/null
+++ b/sparkle/src/stories/AnimatedText.stories.tsx
@@ -0,0 +1,46 @@
+import { Meta } from "@storybook/react";
+import React from "react";
+
+import { AnimatedText } from "../index_with_tw_base";
+
+const meta = {
+ title: "Primitives/AnimatedText",
+ component: AnimatedText,
+} satisfies Meta;
+
+export default meta;
+
+export function AnimatedShinyTextDemo() {
+ return (
+
+
+
+
+
+
+
+
Thinking a long long long long time
+
+
+
+
+
+
+
+
+
+ Thinking a long long long long time
+
+
+
+
+ );
+}
diff --git a/sparkle/tailwind.config.js b/sparkle/tailwind.config.js
index 12c21e796a98..3039739adeb8 100644
--- a/sparkle/tailwind.config.js
+++ b/sparkle/tailwind.config.js
@@ -31,6 +31,7 @@ const safeColorlist = safeColorsArray.flatMap((color) => [
`s-border-${color}-100`,
`s-border-${color}-200`,
`s-border-${color}-300`,
+ `s-text-${color}-500`,
`s-text-${color}-800`,
`s-text-${color}-900`,
`s-text-${color}-950`,
@@ -166,16 +167,16 @@ module.exports = {
},
},
"shiny-text": {
- "0%, 90%, 100%": {
- "background-position": "calc(-100% - 100px) 0",
+ "0%": {
+ "background-position": "calc(-200%) 0",
},
- "30%, 60%": {
- "background-position": "calc(100% + 100px) 0",
+ "100%": {
+ "background-position": "calc(200%) 0",
},
},
},
animation: {
- "shiny-text": "shiny-text 8s infinite",
+ "shiny-text": "shiny-text 2s infinite",
pulse: "pulse var(--duration) ease-out infinite",
"opacity-pulse": "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
"background-position-spin":