@@ -60,20 +60,10 @@ import {
6060 DrawerTrigger ,
6161} from "@/components/ui/drawer" ;
6262import { FileUpload } from "@/components/ui/file-upload" ;
63- import {
64- Tooltip ,
65- TooltipContent ,
66- TooltipProvider ,
67- TooltipTrigger ,
68- } from "@/components/ui/tooltip" ;
69- import { FloatingActionButton } from "@/components/ui/floating-action-button" ;
70- import { PlusIcon , HeartIcon , MessageCircleIcon } from "lucide-react" ;
7163// REMOVED: import React, { useState } from "react";
7264// ADDED: Import the component that now correctly encapsulates useState:
7365import { SliderDemo } from "@/components/ui/sliderDemo" ;
7466
75-
76-
7767export const componentsData = [
7868 {
7969 id : "button" ,
@@ -956,7 +946,8 @@ export function DrawerDemo() {
956946 {
957947 id : "file-upload" ,
958948 title : "File Upload" ,
959- description : "A versatile file upload component with drag & drop, progress tracking, and multiple variants." ,
949+ description :
950+ "A versatile file upload component with drag & drop, progress tracking, and multiple variants." ,
960951 category : "Form" ,
961952 preview : (
962953 < div className = "w-full max-w-md space-y-4" >
@@ -1027,6 +1018,64 @@ export function FileUploadDemo() {
10271018 </FileUpload>
10281019 </div>
10291020 )
1021+ }` ,
1022+ } ,
1023+ {
1024+ id : "sonner" ,
1025+ title : "Sonner" ,
1026+ description :
1027+ "A toast notification system for displaying brief messages to users." ,
1028+ category : "Feedback" ,
1029+ preview : (
1030+ < div className = "flex justify-center gap-4" >
1031+ < Button
1032+ onClick = { ( ) => {
1033+ toast ( "Hi there, I am Sonner! 👋" ) ;
1034+ } }
1035+ >
1036+ Show Toast
1037+ </ Button >
1038+ < Button
1039+ variant = "secondary"
1040+ onClick = { ( ) => {
1041+ toast . success ( "Success message!" ) ;
1042+ } }
1043+ >
1044+ Success
1045+ </ Button >
1046+ < Button
1047+ variant = "destructive"
1048+ onClick = { ( ) => {
1049+ toast . error ( "Something went wrong" ) ;
1050+ } }
1051+ >
1052+ Error
1053+ </ Button >
1054+ </ div >
1055+ ) ,
1056+ code : `import { toast } from "sonner"
1057+ import { Button } from "@/components/ui/button"
1058+
1059+ export function SonnerDemo() {
1060+ return (
1061+ <div className="flex gap-4">
1062+ <Button onClick={() => toast("Simple notification")}>
1063+ Show Toast
1064+ </Button>
1065+ <Button
1066+ variant="secondary"
1067+ onClick={() => toast.success("Success message!")}
1068+ >
1069+ Success
1070+ </Button>
1071+ <Button
1072+ variant="destructive"
1073+ onClick={() => toast.error("Something went wrong")}
1074+ >
1075+ Error
1076+ </Button>
1077+ </div>
1078+ )
10301079}` ,
10311080 } ,
10321081] ;
0 commit comments