Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sparkle] - chore(Chip): add "white" variant #11414

Merged
merged 2 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sparkle/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sparkle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dust-tt/sparkle",
"version": "0.2.440",
"version": "0.2.441",
"scripts": {
"build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs",
"tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css",
Expand Down
9 changes: 7 additions & 2 deletions sparkle/src/components/AnimatedText.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { cva, VariantProps } from "class-variance-authority";
import { ReactNode } from "react";
import React from "react";
import React, { ReactNode } from "react";

import { cn } from "@sparkle/lib/utils";

Expand All @@ -15,6 +14,7 @@ const ANIMATED_TEXT_VARIANTS = [
"sky",
"pink",
"red",
"white",
] as const;

type AnimatedTextVariantType = (typeof ANIMATED_TEXT_VARIANTS)[number];
Expand All @@ -36,6 +36,10 @@ const animatedVariants: Record<AnimatedTextVariantType, string> = {
"s-from-amber-800 s-via-amber-950 s-via-50% s-to-amber-800",
"dark:s-from-amber-800-night dark:s-via-amber-950-night dark:s-via-50% dark:s-to-amber-800-night"
),
white: cn(
"s-from-slate-600 s-via-slate-950 s-via-50% s-to-slate-600",
"dark:s-from-slate-600-night dark:s-via-slate-950-night dark:s-via-50% dark:s-to-slate-600-night"
),
slate: cn(
"s-from-slate-600 s-via-slate-950 s-via-50% s-to-slate-600",
"dark:s-from-slate-600-night dark:s-via-slate-950-night dark:s-via-50% dark:s-to-slate-600-night"
Expand Down Expand Up @@ -80,6 +84,7 @@ const animatedTextVariants: Record<AnimatedTextVariantType, string> = {
emerald: "s-text-emerald-800 dark:s-text-emerald-800-night",
amber: "s-text-amber-800 dark:s-text-amber-800-night",
slate: "s-text-muted-foreground dark:s-text-muted-foreground-night",
white: "s-text-muted-foreground dark:s-text-muted-foreground-night",
purple: "s-text-purple-800 dark:s-text-purple-800-night",
warning: "s-text-warning-800 dark:s-text-warning-800-night",
sky: "s-text-sky-800 dark:s-text-sky-800-night",
Expand Down
6 changes: 6 additions & 0 deletions sparkle/src/components/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const CHIP_COLORS = [
"sky",
"pink",
"red",
"white",
] as const;

type ChipColorType = (typeof CHIP_COLORS)[number];
Expand Down Expand Up @@ -57,6 +58,10 @@ const backgroundVariants: Record<ChipColorType, string> = {
"s-bg-purple-100 s-border-purple-200",
"dark:s-bg-purple-100-night dark:s-border-purple-200-night"
),
white: cn(
"s-bg-background s-border-border",
"dark:s-bg-muted-background-night dark:s-border-border-night"
),
warning: cn(
"s-bg-warning-100 s-border-warning-200",
"dark:s-bg-warning-100-night dark:s-border-warning-200-night"
Expand Down Expand Up @@ -84,6 +89,7 @@ const textVariants: Record<ChipColorType, string> = {
sky: "s-text-sky-900 dark:s-text-sky-900-night",
pink: "s-text-pink-900 dark:s-text-pink-900-night",
red: "s-text-red-900 dark:s-text-red-900-night",
white: "s-text-foreground dark:s-text-foreground-night",
};

const chipVariants = cva("s-inline-flex s-box-border s-items-center", {
Expand Down