Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/build

# misc
.idea
.DS_Store
*.pem

Expand Down
22 changes: 22 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,28 @@ export default function AnimationsExample() {
</p>
</div>
</div>
<div className="space-y-4">
<div className="space-y-2">
<label className="text-sm font-medium flex items-center gap-2">
<span className="w-2 h-2 bg-slate-500 rounded-full"></span>
No Animation
</label>
<MultiSelect
options={projectTypesWithStyle.slice(0, 3)}
onValueChange={() => {}}
defaultValue={["web-app"]}
animationConfig={{
badgeAnimation: "none",
popoverAnimation: "none",
optionHoverAnimation: "none",
}}
placeholder="Without animation effect"
/>
<p className="text-xs text-muted-foreground">
With animation effects disabled
</p>
</div>
</div>
</div>
</div>
<div
Expand Down
12 changes: 9 additions & 3 deletions src/components/multi-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ export const MultiSelect = React.forwardRef<MultiSelectRef, MultiSelectProps>(
case "flip":
return "animate-flipIn";
case "none":
return "";
return "!animate-none";
default:
return "";
}
Expand Down Expand Up @@ -858,7 +858,10 @@ export const MultiSelect = React.forwardRef<MultiSelectRef, MultiSelectProps>(
key={value}
className={cn(
getBadgeAnimationClass(),
multiSelectVariants({ variant }),
multiSelectVariants({
variant,
badgeAnimation: animationConfig?.badgeAnimation
}),
customStyle?.gradient &&
"text-white border-transparent",
responsiveSettings.compactMode &&
Expand Down Expand Up @@ -930,7 +933,10 @@ export const MultiSelect = React.forwardRef<MultiSelectRef, MultiSelectProps>(
className={cn(
"bg-transparent text-foreground border-foreground/1 hover:bg-transparent",
getBadgeAnimationClass(),
multiSelectVariants({ variant }),
multiSelectVariants({
variant,
badgeAnimation: animationConfig?.badgeAnimation
}),
responsiveSettings.compactMode &&
"text-xs px-1.5 py-0.5",
singleLine && "flex-shrink-0 whitespace-nowrap",
Expand Down