@reinvented/design 0.4.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +55 -21
- package/src/components/blocks/auth/auth-card/AuthCard.tsx +62 -0
- package/src/components/blocks/auth/auth-card/index.ts +1 -0
- package/src/components/blocks/auth/index.ts +3 -0
- package/src/components/blocks/auth/social-login/SocialLoginGroup.tsx +75 -0
- package/src/components/blocks/auth/social-login/index.ts +1 -0
- package/src/components/blocks/auth/two-factor/TwoFactorForm.tsx +59 -0
- package/src/components/blocks/auth/two-factor/index.ts +1 -0
- package/src/components/blocks/communication/activity-item/ActivityItem.tsx +17 -0
- package/src/components/blocks/communication/activity-item/ActivityItemAvatar.tsx +21 -0
- package/src/components/blocks/communication/activity-item/ActivityItemContent.tsx +16 -0
- package/src/components/blocks/communication/activity-item/index.ts +3 -0
- package/src/components/blocks/communication/chat-bubble/ChatBubble.tsx +21 -0
- package/src/components/blocks/communication/chat-bubble/ChatBubbleAvatar.tsx +19 -0
- package/src/components/blocks/communication/chat-bubble/ChatBubbleMessage.tsx +35 -0
- package/src/components/blocks/communication/chat-bubble/ChatBubbleTimestamp.tsx +15 -0
- package/src/components/blocks/communication/chat-bubble/index.ts +4 -0
- package/src/components/blocks/communication/index.ts +2 -0
- package/src/components/blocks/content/article-header/ArticleHeader.tsx +73 -0
- package/src/components/blocks/content/article-header/index.ts +1 -0
- package/src/components/blocks/content/author-card/AuthorCard.tsx +46 -0
- package/src/components/blocks/content/author-card/index.ts +1 -0
- package/src/components/blocks/content/index.ts +3 -0
- package/src/components/blocks/content/rich-text/RichTextContent.tsx +27 -0
- package/src/components/blocks/content/rich-text/index.ts +1 -0
- package/src/components/blocks/data-management/index.ts +2 -0
- package/src/components/blocks/data-management/kanban/KanbanBoard.tsx +10 -0
- package/src/components/blocks/data-management/kanban/KanbanCard.tsx +102 -0
- package/src/components/blocks/data-management/kanban/KanbanColumn.tsx +41 -0
- package/src/components/blocks/data-management/kanban/index.ts +3 -0
- package/src/components/blocks/data-management/tree-view/TreeItem.tsx +68 -0
- package/src/components/blocks/data-management/tree-view/TreeView.tsx +10 -0
- package/src/components/blocks/data-management/tree-view/index.ts +2 -0
- package/src/components/blocks/data-viz/financial-ticker/FinancialTicker.tsx +35 -0
- package/src/components/blocks/data-viz/financial-ticker/index.ts +1 -0
- package/src/components/blocks/data-viz/index.ts +3 -0
- package/src/components/blocks/data-viz/kpi-card/KpiCard.tsx +61 -0
- package/src/components/blocks/data-viz/kpi-card/index.ts +1 -0
- package/src/components/blocks/data-viz/stat-grid/StatGrid.tsx +28 -0
- package/src/components/blocks/data-viz/stat-grid/index.ts +1 -0
- package/src/components/blocks/ecommerce/index.ts +3 -0
- package/src/components/blocks/ecommerce/pricing-tier/PricingFeatureList.tsx +27 -0
- package/src/components/blocks/ecommerce/pricing-tier/PricingHeader.tsx +25 -0
- package/src/components/blocks/ecommerce/pricing-tier/PricingTier.tsx +31 -0
- package/src/components/blocks/ecommerce/pricing-tier/index.ts +3 -0
- package/src/components/blocks/ecommerce/product-card/ProductCard.tsx +17 -0
- package/src/components/blocks/ecommerce/product-card/ProductCardContent.tsx +15 -0
- package/src/components/blocks/ecommerce/product-card/ProductCardImage.tsx +20 -0
- package/src/components/blocks/ecommerce/product-card/ProductCardPrice.tsx +20 -0
- package/src/components/blocks/ecommerce/product-card/index.ts +4 -0
- package/src/components/blocks/ecommerce/rating-summary/RatingStars.tsx +32 -0
- package/src/components/blocks/ecommerce/rating-summary/index.ts +1 -0
- package/src/components/blocks/feedback/empty-state/EmptyState.tsx +53 -0
- package/src/components/blocks/feedback/empty-state/index.ts +1 -0
- package/src/components/blocks/feedback/error-state/ErrorState.tsx +50 -0
- package/src/components/blocks/feedback/error-state/index.ts +1 -0
- package/src/components/blocks/feedback/index.ts +3 -0
- package/src/components/blocks/feedback/not-found/NotFoundState.tsx +47 -0
- package/src/components/blocks/feedback/not-found/index.ts +1 -0
- package/src/components/blocks/filtering/faceted-sidebar/FacetedGroup.tsx +32 -0
- package/src/components/blocks/filtering/faceted-sidebar/FacetedSidebar.tsx +26 -0
- package/src/components/blocks/filtering/faceted-sidebar/index.ts +2 -0
- package/src/components/blocks/filtering/filter-bar/FilterBar.tsx +85 -0
- package/src/components/blocks/filtering/filter-bar/index.ts +1 -0
- package/src/components/blocks/filtering/index.ts +3 -0
- package/src/components/blocks/filtering/search-result/SearchResultItem.tsx +70 -0
- package/src/components/blocks/filtering/search-result/index.ts +1 -0
- package/src/components/blocks/index.ts +21 -0
- package/src/components/blocks/marketing/cta-block/CtaBlock.tsx +80 -0
- package/src/components/blocks/marketing/cta-block/index.ts +1 -0
- package/src/components/blocks/marketing/feature-grid/FeatureGrid.tsx +47 -0
- package/src/components/blocks/marketing/feature-grid/index.ts +1 -0
- package/src/components/blocks/marketing/hero-section/HeroSection.tsx +89 -0
- package/src/components/blocks/marketing/hero-section/index.ts +1 -0
- package/src/components/blocks/marketing/index.ts +4 -0
- package/src/components/blocks/marketing/testimonial-card/TestimonialCard.tsx +71 -0
- package/src/components/blocks/marketing/testimonial-card/index.ts +1 -0
- package/src/components/blocks/media/call-controls/CallControlButton.tsx +52 -0
- package/src/components/blocks/media/call-controls/CallControls.tsx +10 -0
- package/src/components/blocks/media/call-controls/index.ts +2 -0
- package/src/components/blocks/media/index.ts +2 -0
- package/src/components/blocks/media/media-player/MediaPlayer.tsx +20 -0
- package/src/components/blocks/media/media-player/MediaPlayerControls.tsx +16 -0
- package/src/components/blocks/media/media-player/MediaPlayerScrubber.tsx +29 -0
- package/src/components/blocks/media/media-player/MediaPlayerVideo.tsx +25 -0
- package/src/components/blocks/media/media-player/index.ts +4 -0
- package/src/components/blocks/navigation/app-sidebar/AppSidebar.tsx +32 -0
- package/src/components/blocks/navigation/app-sidebar/NavItem.tsx +43 -0
- package/src/components/blocks/navigation/app-sidebar/index.ts +2 -0
- package/src/components/blocks/navigation/context-switcher/ContextSwitcher.tsx +77 -0
- package/src/components/blocks/navigation/context-switcher/index.ts +1 -0
- package/src/components/blocks/navigation/index.ts +3 -0
- package/src/components/blocks/navigation/top-navbar/TopNavbar.tsx +47 -0
- package/src/components/blocks/navigation/top-navbar/index.ts +1 -0
- package/src/components/blocks/onboarding/index.ts +2 -0
- package/src/components/blocks/onboarding/onboarding-welcome/OnboardingWelcome.tsx +74 -0
- package/src/components/blocks/onboarding/onboarding-welcome/index.ts +1 -0
- package/src/components/blocks/onboarding/step-wizard/StepWizard.tsx +72 -0
- package/src/components/blocks/onboarding/step-wizard/index.ts +1 -0
- package/src/components/blocks/profiles/connection-list/ConnectionItem.tsx +35 -0
- package/src/components/blocks/profiles/connection-list/ConnectionList.tsx +16 -0
- package/src/components/blocks/profiles/connection-list/index.ts +2 -0
- package/src/components/blocks/profiles/index.ts +3 -0
- package/src/components/blocks/profiles/profile-header/ProfileHeader.tsx +88 -0
- package/src/components/blocks/profiles/profile-header/index.ts +1 -0
- package/src/components/blocks/profiles/profile-stats/ProfileStats.tsx +20 -0
- package/src/components/blocks/profiles/profile-stats/index.ts +1 -0
- package/src/components/blocks/scheduling/booking-slot/BookingSlot.tsx +44 -0
- package/src/components/blocks/scheduling/booking-slot/index.ts +1 -0
- package/src/components/blocks/scheduling/event-card/EventCard.tsx +85 -0
- package/src/components/blocks/scheduling/event-card/index.ts +1 -0
- package/src/components/blocks/scheduling/index.ts +3 -0
- package/src/components/blocks/scheduling/timeline-row/TimelineRow.tsx +82 -0
- package/src/components/blocks/scheduling/timeline-row/index.ts +1 -0
- package/src/components/blocks/settings/billing-usage/BillingUsage.tsx +49 -0
- package/src/components/blocks/settings/billing-usage/index.ts +1 -0
- package/src/components/blocks/settings/index.ts +3 -0
- package/src/components/blocks/settings/integration-card/IntegrationCard.tsx +62 -0
- package/src/components/blocks/settings/integration-card/index.ts +1 -0
- package/src/components/blocks/settings/settings-section/SettingsSection.tsx +23 -0
- package/src/components/blocks/settings/settings-section/index.ts +1 -0
- package/src/components/ui/accordion.tsx +56 -0
- package/src/components/ui/alert-dialog.tsx +141 -0
- package/src/components/ui/alert.tsx +59 -0
- package/src/components/ui/aspect-ratio.tsx +5 -0
- package/src/components/ui/avatar.tsx +50 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/breadcrumb.tsx +115 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/calendar.tsx +211 -0
- package/src/components/ui/card.tsx +79 -0
- package/src/components/ui/carousel.tsx +262 -0
- package/src/components/ui/chart.tsx +367 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/collapsible.tsx +11 -0
- package/src/components/ui/command.tsx +153 -0
- package/src/components/ui/component-placeholder.tsx +38 -0
- package/src/components/ui/context-menu.tsx +198 -0
- package/src/components/ui/dialog.tsx +122 -0
- package/src/components/ui/drawer.tsx +116 -0
- package/src/components/ui/dropdown-menu.tsx +200 -0
- package/src/components/ui/form.tsx +176 -0
- package/src/components/ui/hover-card.tsx +27 -0
- package/src/components/ui/input-otp.tsx +69 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/menubar.tsx +256 -0
- package/src/components/ui/navigation-menu.tsx +128 -0
- package/src/components/ui/pagination.tsx +117 -0
- package/src/components/ui/popover.tsx +29 -0
- package/src/components/ui/progress.tsx +28 -0
- package/src/components/ui/radio-group.tsx +42 -0
- package/src/components/ui/resizable.tsx +45 -0
- package/src/components/ui/scroll-area.tsx +46 -0
- package/src/components/ui/select.tsx +160 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.tsx +140 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/slider.tsx +26 -0
- package/src/components/ui/sonner.tsx +45 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/table.tsx +117 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.tsx +22 -0
- package/src/components/ui/toast.tsx +127 -0
- package/src/components/ui/toaster.tsx +33 -0
- package/src/components/ui/toggle-group.tsx +61 -0
- package/src/components/ui/toggle.tsx +45 -0
- package/src/components/ui/tooltip.tsx +28 -0
- package/src/hooks/use-toast.ts +194 -0
- package/src/index.ts +53 -56
- package/src/styles/tokens.css +30 -14
- package/tailwind.config.js +120 -98
- package/tsconfig.json +2 -2
- package/src/components/ui/accordion/Accordion.vue +0 -13
- package/src/components/ui/accordion/AccordionContent.vue +0 -20
- package/src/components/ui/accordion/AccordionItem.vue +0 -15
- package/src/components/ui/accordion/AccordionTrigger.vue +0 -25
- package/src/components/ui/accordion/index.ts +0 -4
- package/src/components/ui/alert/Alert.vue +0 -38
- package/src/components/ui/alert/AlertDescription.vue +0 -12
- package/src/components/ui/alert/AlertTitle.vue +0 -12
- package/src/components/ui/alert/index.ts +0 -3
- package/src/components/ui/alert-dialog/AlertDialog.vue +0 -13
- package/src/components/ui/alert-dialog/AlertDialogAction.vue +0 -21
- package/src/components/ui/alert-dialog/AlertDialogCancel.vue +0 -21
- package/src/components/ui/alert-dialog/AlertDialogContent.vue +0 -39
- package/src/components/ui/alert-dialog/AlertDialogDescription.vue +0 -15
- package/src/components/ui/alert-dialog/AlertDialogFooter.vue +0 -12
- package/src/components/ui/alert-dialog/AlertDialogHeader.vue +0 -12
- package/src/components/ui/alert-dialog/AlertDialogTitle.vue +0 -15
- package/src/components/ui/alert-dialog/AlertDialogTrigger.vue +0 -11
- package/src/components/ui/alert-dialog/index.ts +0 -9
- package/src/components/ui/avatar/Avatar.vue +0 -14
- package/src/components/ui/avatar/index.ts +0 -1
- package/src/components/ui/badge/Badge.vue +0 -27
- package/src/components/ui/badge/index.ts +0 -1
- package/src/components/ui/breadcrumb/Breadcrumb.vue +0 -6
- package/src/components/ui/breadcrumb/BreadcrumbEllipsis.vue +0 -12
- package/src/components/ui/breadcrumb/BreadcrumbItem.vue +0 -6
- package/src/components/ui/breadcrumb/BreadcrumbLink.vue +0 -20
- package/src/components/ui/breadcrumb/BreadcrumbList.vue +0 -6
- package/src/components/ui/breadcrumb/BreadcrumbPage.vue +0 -6
- package/src/components/ui/breadcrumb/BreadcrumbSeparator.vue +0 -11
- package/src/components/ui/breadcrumb/index.ts +0 -7
- package/src/components/ui/button/Button.vue +0 -65
- package/src/components/ui/button/index.ts +0 -1
- package/src/components/ui/card/Card.vue +0 -13
- package/src/components/ui/card/CardContent.vue +0 -7
- package/src/components/ui/card/CardDescription.vue +0 -7
- package/src/components/ui/card/CardFooter.vue +0 -7
- package/src/components/ui/card/CardHeader.vue +0 -9
- package/src/components/ui/card/CardTitle.vue +0 -7
- package/src/components/ui/card/index.ts +0 -6
- package/src/components/ui/checkbox/Checkbox.vue +0 -25
- package/src/components/ui/checkbox/index.ts +0 -1
- package/src/components/ui/collapsible/Collapsible.vue +0 -13
- package/src/components/ui/collapsible/index.ts +0 -2
- package/src/components/ui/command/Command.vue +0 -16
- package/src/components/ui/command/CommandEmpty.vue +0 -5
- package/src/components/ui/command/CommandGroup.vue +0 -22
- package/src/components/ui/command/CommandInput.vue +0 -21
- package/src/components/ui/command/CommandItem.vue +0 -22
- package/src/components/ui/command/CommandList.vue +0 -17
- package/src/components/ui/command/CommandSeparator.vue +0 -5
- package/src/components/ui/command/index.ts +0 -7
- package/src/components/ui/context-menu/ContextMenuContent.vue +0 -24
- package/src/components/ui/context-menu/ContextMenuItem.vue +0 -16
- package/src/components/ui/context-menu/ContextMenuLabel.vue +0 -9
- package/src/components/ui/context-menu/ContextMenuSeparator.vue +0 -9
- package/src/components/ui/context-menu/ContextMenuSubContent.vue +0 -14
- package/src/components/ui/context-menu/index.ts +0 -9
- package/src/components/ui/dialog/Dialog.vue +0 -14
- package/src/components/ui/dialog/DialogClose.vue +0 -12
- package/src/components/ui/dialog/DialogContent.vue +0 -48
- package/src/components/ui/dialog/DialogDescription.vue +0 -23
- package/src/components/ui/dialog/DialogFooter.vue +0 -12
- package/src/components/ui/dialog/DialogHeader.vue +0 -12
- package/src/components/ui/dialog/DialogScrollContent.vue +0 -47
- package/src/components/ui/dialog/DialogTitle.vue +0 -23
- package/src/components/ui/dialog/DialogTrigger.vue +0 -12
- package/src/components/ui/dialog/index.ts +0 -9
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +0 -13
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +0 -28
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +0 -33
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +0 -11
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +0 -27
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +0 -23
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +0 -13
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +0 -27
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +0 -13
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +0 -12
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +0 -13
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +0 -27
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +0 -23
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +0 -11
- package/src/components/ui/dropdown-menu/index.ts +0 -14
- package/src/components/ui/form/FormControl.vue +0 -3
- package/src/components/ui/form/FormDescription.vue +0 -6
- package/src/components/ui/form/FormItem.vue +0 -6
- package/src/components/ui/form/FormLabel.vue +0 -10
- package/src/components/ui/form/FormMessage.vue +0 -10
- package/src/components/ui/form/index.ts +0 -9
- package/src/components/ui/hover-card/HoverCard.vue +0 -13
- package/src/components/ui/hover-card/HoverCardContent.vue +0 -26
- package/src/components/ui/hover-card/HoverCardTrigger.vue +0 -11
- package/src/components/ui/hover-card/index.ts +0 -3
- package/src/components/ui/input/Input.vue +0 -23
- package/src/components/ui/input/index.ts +0 -1
- package/src/components/ui/label/Label.vue +0 -18
- package/src/components/ui/label/index.ts +0 -1
- package/src/components/ui/lib/utils.ts +0 -2
- package/src/components/ui/menubar/MenubarContent.vue +0 -15
- package/src/components/ui/menubar/MenubarItem.vue +0 -13
- package/src/components/ui/menubar/MenubarTrigger.vue +0 -13
- package/src/components/ui/menubar/index.ts +0 -5
- package/src/components/ui/navigation-menu/NavigationMenuContent.vue +0 -14
- package/src/components/ui/navigation-menu/NavigationMenuTrigger.vue +0 -15
- package/src/components/ui/navigation-menu/index.ts +0 -4
- package/src/components/ui/pagination/PaginationContent.vue +0 -13
- package/src/components/ui/pagination/PaginationEllipsis.vue +0 -12
- package/src/components/ui/pagination/PaginationNext.vue +0 -14
- package/src/components/ui/pagination/PaginationPrev.vue +0 -14
- package/src/components/ui/pagination/index.ts +0 -6
- package/src/components/ui/popover/Popover.vue +0 -13
- package/src/components/ui/popover/PopoverContent.vue +0 -27
- package/src/components/ui/popover/PopoverTrigger.vue +0 -11
- package/src/components/ui/popover/index.ts +0 -3
- package/src/components/ui/progress/Progress.vue +0 -21
- package/src/components/ui/progress/index.ts +0 -1
- package/src/components/ui/radio-group/RadioGroup.vue +0 -16
- package/src/components/ui/radio-group/RadioGroupItem.vue +0 -24
- package/src/components/ui/radio-group/index.ts +0 -2
- package/src/components/ui/scroll-area/ScrollArea.vue +0 -13
- package/src/components/ui/scroll-area/index.ts +0 -1
- package/src/components/ui/select/Select.vue +0 -13
- package/src/components/ui/select/SelectContent.vue +0 -40
- package/src/components/ui/select/SelectGroup.vue +0 -15
- package/src/components/ui/select/SelectItem.vue +0 -30
- package/src/components/ui/select/SelectLabel.vue +0 -15
- package/src/components/ui/select/SelectSeparator.vue +0 -13
- package/src/components/ui/select/SelectTrigger.vue +0 -23
- package/src/components/ui/select/SelectValue.vue +0 -11
- package/src/components/ui/select/index.ts +0 -8
- package/src/components/ui/separator/Separator.vue +0 -16
- package/src/components/ui/separator/index.ts +0 -1
- package/src/components/ui/sheet/Sheet.vue +0 -13
- package/src/components/ui/sheet/SheetClose.vue +0 -11
- package/src/components/ui/sheet/SheetContent.vue +0 -65
- package/src/components/ui/sheet/SheetDescription.vue +0 -15
- package/src/components/ui/sheet/SheetFooter.vue +0 -12
- package/src/components/ui/sheet/SheetHeader.vue +0 -12
- package/src/components/ui/sheet/SheetTitle.vue +0 -15
- package/src/components/ui/sheet/SheetTrigger.vue +0 -11
- package/src/components/ui/sheet/index.ts +0 -8
- package/src/components/ui/skeleton/Skeleton.vue +0 -9
- package/src/components/ui/skeleton/index.ts +0 -1
- package/src/components/ui/slider/Slider.vue +0 -26
- package/src/components/ui/slider/index.ts +0 -1
- package/src/components/ui/switch/Switch.vue +0 -24
- package/src/components/ui/switch/index.ts +0 -1
- package/src/components/ui/table/Table.vue +0 -13
- package/src/components/ui/table/TableBody.vue +0 -6
- package/src/components/ui/table/TableCaption.vue +0 -6
- package/src/components/ui/table/TableCell.vue +0 -6
- package/src/components/ui/table/TableFooter.vue +0 -6
- package/src/components/ui/table/TableHead.vue +0 -6
- package/src/components/ui/table/TableHeader.vue +0 -6
- package/src/components/ui/table/TableRow.vue +0 -6
- package/src/components/ui/table/index.ts +0 -8
- package/src/components/ui/tabs/Tabs.vue +0 -13
- package/src/components/ui/tabs/TabsContent.vue +0 -21
- package/src/components/ui/tabs/TabsList.vue +0 -21
- package/src/components/ui/tabs/TabsTrigger.vue +0 -21
- package/src/components/ui/tabs/index.ts +0 -4
- package/src/components/ui/textarea/Textarea.vue +0 -29
- package/src/components/ui/textarea/index.ts +0 -1
- package/src/components/ui/toggle/Toggle.vue +0 -40
- package/src/components/ui/toggle/index.ts +0 -1
- package/src/components/ui/toggle-group/ToggleGroup.vue +0 -16
- package/src/components/ui/toggle-group/ToggleGroupItem.vue +0 -21
- package/src/components/ui/toggle-group/index.ts +0 -2
- package/src/components/ui/tooltip/Tooltip.vue +0 -13
- package/src/components/ui/tooltip/TooltipContent.vue +0 -27
- package/src/components/ui/tooltip/TooltipProvider.vue +0 -12
- package/src/components/ui/tooltip/TooltipTrigger.vue +0 -11
- package/src/components/ui/tooltip/index.ts +0 -4
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as ToastPrimitives from "@radix-ui/react-toast"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
import { X } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const ToastProvider = ToastPrimitives.Provider
|
|
9
|
+
|
|
10
|
+
const ToastViewport = React.forwardRef<
|
|
11
|
+
React.ElementRef<typeof ToastPrimitives.Viewport>,
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
|
|
13
|
+
>(({ className, ...props }, ref) => (
|
|
14
|
+
<ToastPrimitives.Viewport
|
|
15
|
+
ref={ref}
|
|
16
|
+
className={cn(
|
|
17
|
+
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
))
|
|
23
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName
|
|
24
|
+
|
|
25
|
+
const toastVariants = cva(
|
|
26
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
default: "border bg-background text-foreground",
|
|
31
|
+
destructive:
|
|
32
|
+
"destructive group border-destructive bg-destructive text-destructive-foreground",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
const Toast = React.forwardRef<
|
|
42
|
+
React.ElementRef<typeof ToastPrimitives.Root>,
|
|
43
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
|
44
|
+
VariantProps<typeof toastVariants>
|
|
45
|
+
>(({ className, variant, ...props }, ref) => {
|
|
46
|
+
return (
|
|
47
|
+
<ToastPrimitives.Root
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={cn(toastVariants({ variant }), className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
53
|
+
})
|
|
54
|
+
Toast.displayName = ToastPrimitives.Root.displayName
|
|
55
|
+
|
|
56
|
+
const ToastAction = React.forwardRef<
|
|
57
|
+
React.ElementRef<typeof ToastPrimitives.Action>,
|
|
58
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
|
|
59
|
+
>(({ className, ...props }, ref) => (
|
|
60
|
+
<ToastPrimitives.Action
|
|
61
|
+
ref={ref}
|
|
62
|
+
className={cn(
|
|
63
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
64
|
+
className
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
))
|
|
69
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName
|
|
70
|
+
|
|
71
|
+
const ToastClose = React.forwardRef<
|
|
72
|
+
React.ElementRef<typeof ToastPrimitives.Close>,
|
|
73
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
|
|
74
|
+
>(({ className, ...props }, ref) => (
|
|
75
|
+
<ToastPrimitives.Close
|
|
76
|
+
ref={ref}
|
|
77
|
+
className={cn(
|
|
78
|
+
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
toast-close=""
|
|
82
|
+
{...props}
|
|
83
|
+
>
|
|
84
|
+
<X className="h-4 w-4" />
|
|
85
|
+
</ToastPrimitives.Close>
|
|
86
|
+
))
|
|
87
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName
|
|
88
|
+
|
|
89
|
+
const ToastTitle = React.forwardRef<
|
|
90
|
+
React.ElementRef<typeof ToastPrimitives.Title>,
|
|
91
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
|
|
92
|
+
>(({ className, ...props }, ref) => (
|
|
93
|
+
<ToastPrimitives.Title
|
|
94
|
+
ref={ref}
|
|
95
|
+
className={cn("text-sm font-semibold", className)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
))
|
|
99
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName
|
|
100
|
+
|
|
101
|
+
const ToastDescription = React.forwardRef<
|
|
102
|
+
React.ElementRef<typeof ToastPrimitives.Description>,
|
|
103
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
|
|
104
|
+
>(({ className, ...props }, ref) => (
|
|
105
|
+
<ToastPrimitives.Description
|
|
106
|
+
ref={ref}
|
|
107
|
+
className={cn("text-sm opacity-90", className)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
))
|
|
111
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName
|
|
112
|
+
|
|
113
|
+
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>
|
|
114
|
+
|
|
115
|
+
type ToastActionElement = React.ReactElement<typeof ToastAction>
|
|
116
|
+
|
|
117
|
+
export {
|
|
118
|
+
type ToastProps,
|
|
119
|
+
type ToastActionElement,
|
|
120
|
+
ToastProvider,
|
|
121
|
+
ToastViewport,
|
|
122
|
+
Toast,
|
|
123
|
+
ToastTitle,
|
|
124
|
+
ToastDescription,
|
|
125
|
+
ToastClose,
|
|
126
|
+
ToastAction,
|
|
127
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useToast } from "@/hooks/use-toast"
|
|
2
|
+
import {
|
|
3
|
+
Toast,
|
|
4
|
+
ToastClose,
|
|
5
|
+
ToastDescription,
|
|
6
|
+
ToastProvider,
|
|
7
|
+
ToastTitle,
|
|
8
|
+
ToastViewport,
|
|
9
|
+
} from "@/components/ui/toast"
|
|
10
|
+
|
|
11
|
+
export function Toaster() {
|
|
12
|
+
const { toasts } = useToast()
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<ToastProvider>
|
|
16
|
+
{toasts.map(function ({ id, title, description, action, ...props }: any) {
|
|
17
|
+
return (
|
|
18
|
+
<Toast key={id} {...props}>
|
|
19
|
+
<div className="grid gap-1">
|
|
20
|
+
{title && <ToastTitle>{title}</ToastTitle>}
|
|
21
|
+
{description && (
|
|
22
|
+
<ToastDescription>{description}</ToastDescription>
|
|
23
|
+
)}
|
|
24
|
+
</div>
|
|
25
|
+
{action}
|
|
26
|
+
<ToastClose />
|
|
27
|
+
</Toast>
|
|
28
|
+
)
|
|
29
|
+
})}
|
|
30
|
+
<ToastViewport />
|
|
31
|
+
</ToastProvider>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
|
|
5
|
+
import { type VariantProps } from "class-variance-authority"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
import { toggleVariants } from "@/components/ui/toggle"
|
|
9
|
+
|
|
10
|
+
const ToggleGroupContext = React.createContext<
|
|
11
|
+
VariantProps<typeof toggleVariants>
|
|
12
|
+
>({
|
|
13
|
+
size: "default",
|
|
14
|
+
variant: "default",
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const ToggleGroup = React.forwardRef<
|
|
18
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
|
19
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
|
|
20
|
+
VariantProps<typeof toggleVariants>
|
|
21
|
+
>(({ className, variant, size, children, ...props }, ref) => (
|
|
22
|
+
<ToggleGroupPrimitive.Root
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cn("flex items-center justify-center gap-1", className)}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
28
|
+
{children}
|
|
29
|
+
</ToggleGroupContext.Provider>
|
|
30
|
+
</ToggleGroupPrimitive.Root>
|
|
31
|
+
))
|
|
32
|
+
|
|
33
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
|
|
34
|
+
|
|
35
|
+
const ToggleGroupItem = React.forwardRef<
|
|
36
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
|
37
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
|
|
38
|
+
VariantProps<typeof toggleVariants>
|
|
39
|
+
>(({ className, children, variant, size, ...props }, ref) => {
|
|
40
|
+
const context = React.useContext(ToggleGroupContext)
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<ToggleGroupPrimitive.Item
|
|
44
|
+
ref={ref}
|
|
45
|
+
className={cn(
|
|
46
|
+
toggleVariants({
|
|
47
|
+
variant: context.variant || variant,
|
|
48
|
+
size: context.size || size,
|
|
49
|
+
}),
|
|
50
|
+
className
|
|
51
|
+
)}
|
|
52
|
+
{...props}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</ToggleGroupPrimitive.Item>
|
|
56
|
+
)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
|
|
60
|
+
|
|
61
|
+
export { ToggleGroup, ToggleGroupItem }
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle"
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
const toggleVariants = cva(
|
|
10
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "bg-transparent",
|
|
15
|
+
outline:
|
|
16
|
+
"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: "h-10 px-3 min-w-10",
|
|
20
|
+
sm: "h-9 px-2.5 min-w-9",
|
|
21
|
+
lg: "h-11 px-5 min-w-11",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default",
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
const Toggle = React.forwardRef<
|
|
32
|
+
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
33
|
+
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
34
|
+
VariantProps<typeof toggleVariants>
|
|
35
|
+
>(({ className, variant, size, ...props }, ref) => (
|
|
36
|
+
<TogglePrimitive.Root
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
))
|
|
42
|
+
|
|
43
|
+
Toggle.displayName = TogglePrimitive.Root.displayName
|
|
44
|
+
|
|
45
|
+
export { Toggle, toggleVariants }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const TooltipProvider = TooltipPrimitive.Provider
|
|
7
|
+
|
|
8
|
+
const Tooltip = TooltipPrimitive.Root
|
|
9
|
+
|
|
10
|
+
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
11
|
+
|
|
12
|
+
const TooltipContent = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
15
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
16
|
+
<TooltipPrimitive.Content
|
|
17
|
+
ref={ref}
|
|
18
|
+
sideOffset={sideOffset}
|
|
19
|
+
className={cn(
|
|
20
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
))
|
|
26
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
27
|
+
|
|
28
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
// Inspired by react-hot-toast library
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
ToastActionElement,
|
|
8
|
+
ToastProps,
|
|
9
|
+
} from "@/components/ui/toast"
|
|
10
|
+
|
|
11
|
+
const TOAST_LIMIT = 1
|
|
12
|
+
const TOAST_REMOVE_DELAY = 1000000
|
|
13
|
+
|
|
14
|
+
type ToasterToast = ToastProps & {
|
|
15
|
+
id: string
|
|
16
|
+
title?: React.ReactNode
|
|
17
|
+
description?: React.ReactNode
|
|
18
|
+
action?: ToastActionElement
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const actionTypes = {
|
|
22
|
+
ADD_TOAST: "ADD_TOAST",
|
|
23
|
+
UPDATE_TOAST: "UPDATE_TOAST",
|
|
24
|
+
DISMISS_TOAST: "DISMISS_TOAST",
|
|
25
|
+
REMOVE_TOAST: "REMOVE_TOAST",
|
|
26
|
+
} as const
|
|
27
|
+
|
|
28
|
+
let count = 0
|
|
29
|
+
|
|
30
|
+
function genId() {
|
|
31
|
+
count = (count + 1) % Number.MAX_SAFE_INTEGER
|
|
32
|
+
return count.toString()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type ActionType = typeof actionTypes
|
|
36
|
+
|
|
37
|
+
type Action =
|
|
38
|
+
| {
|
|
39
|
+
type: ActionType["ADD_TOAST"]
|
|
40
|
+
toast: ToasterToast
|
|
41
|
+
}
|
|
42
|
+
| {
|
|
43
|
+
type: ActionType["UPDATE_TOAST"]
|
|
44
|
+
toast: Partial<ToasterToast>
|
|
45
|
+
}
|
|
46
|
+
| {
|
|
47
|
+
type: ActionType["DISMISS_TOAST"]
|
|
48
|
+
toastId?: ToasterToast["id"]
|
|
49
|
+
}
|
|
50
|
+
| {
|
|
51
|
+
type: ActionType["REMOVE_TOAST"]
|
|
52
|
+
toastId?: ToasterToast["id"]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface State {
|
|
56
|
+
toasts: ToasterToast[]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>()
|
|
60
|
+
|
|
61
|
+
const addToRemoveQueue = (toastId: string) => {
|
|
62
|
+
if (toastTimeouts.has(toastId)) {
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const timeout = setTimeout(() => {
|
|
67
|
+
toastTimeouts.delete(toastId)
|
|
68
|
+
dispatch({
|
|
69
|
+
type: "REMOVE_TOAST",
|
|
70
|
+
toastId: toastId,
|
|
71
|
+
})
|
|
72
|
+
}, TOAST_REMOVE_DELAY)
|
|
73
|
+
|
|
74
|
+
toastTimeouts.set(toastId, timeout)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const reducer = (state: State, action: Action): State => {
|
|
78
|
+
switch (action.type) {
|
|
79
|
+
case "ADD_TOAST":
|
|
80
|
+
return {
|
|
81
|
+
...state,
|
|
82
|
+
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
case "UPDATE_TOAST":
|
|
86
|
+
return {
|
|
87
|
+
...state,
|
|
88
|
+
toasts: state.toasts.map((t) =>
|
|
89
|
+
t.id === action.toast.id ? { ...t, ...action.toast } : t
|
|
90
|
+
),
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
case "DISMISS_TOAST": {
|
|
94
|
+
const { toastId } = action
|
|
95
|
+
|
|
96
|
+
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
|
97
|
+
// but I'll keep it here for simplicity
|
|
98
|
+
if (toastId) {
|
|
99
|
+
addToRemoveQueue(toastId)
|
|
100
|
+
} else {
|
|
101
|
+
state.toasts.forEach((toast) => {
|
|
102
|
+
addToRemoveQueue(toast.id)
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
...state,
|
|
108
|
+
toasts: state.toasts.map((t) =>
|
|
109
|
+
t.id === toastId || toastId === undefined
|
|
110
|
+
? {
|
|
111
|
+
...t,
|
|
112
|
+
open: false,
|
|
113
|
+
}
|
|
114
|
+
: t
|
|
115
|
+
),
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
case "REMOVE_TOAST":
|
|
119
|
+
if (action.toastId === undefined) {
|
|
120
|
+
return {
|
|
121
|
+
...state,
|
|
122
|
+
toasts: [],
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
...state,
|
|
127
|
+
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const listeners: Array<(state: State) => void> = []
|
|
133
|
+
|
|
134
|
+
let memoryState: State = { toasts: [] }
|
|
135
|
+
|
|
136
|
+
function dispatch(action: Action) {
|
|
137
|
+
memoryState = reducer(memoryState, action)
|
|
138
|
+
listeners.forEach((listener) => {
|
|
139
|
+
listener(memoryState)
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
type Toast = Omit<ToasterToast, "id">
|
|
144
|
+
|
|
145
|
+
function toast({ ...props }: Toast) {
|
|
146
|
+
const id = genId()
|
|
147
|
+
|
|
148
|
+
const update = (props: ToasterToast) =>
|
|
149
|
+
dispatch({
|
|
150
|
+
type: "UPDATE_TOAST",
|
|
151
|
+
toast: { ...props, id },
|
|
152
|
+
})
|
|
153
|
+
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id })
|
|
154
|
+
|
|
155
|
+
dispatch({
|
|
156
|
+
type: "ADD_TOAST",
|
|
157
|
+
toast: {
|
|
158
|
+
...props,
|
|
159
|
+
id,
|
|
160
|
+
open: true,
|
|
161
|
+
onOpenChange: (open) => {
|
|
162
|
+
if (!open) dismiss()
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
id: id,
|
|
169
|
+
dismiss,
|
|
170
|
+
update,
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function useToast() {
|
|
175
|
+
const [state, setState] = React.useState<State>(memoryState)
|
|
176
|
+
|
|
177
|
+
React.useEffect(() => {
|
|
178
|
+
listeners.push(setState)
|
|
179
|
+
return () => {
|
|
180
|
+
const index = listeners.indexOf(setState)
|
|
181
|
+
if (index > -1) {
|
|
182
|
+
listeners.splice(index, 1)
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}, [state])
|
|
186
|
+
|
|
187
|
+
return {
|
|
188
|
+
...state,
|
|
189
|
+
toast,
|
|
190
|
+
dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { useToast, toast }
|
package/src/index.ts
CHANGED
|
@@ -4,60 +4,57 @@
|
|
|
4
4
|
// Utilities
|
|
5
5
|
export { cn } from './lib/utils'
|
|
6
6
|
|
|
7
|
-
// ──
|
|
7
|
+
// ── Component Exports ──────────────────────────────────────────
|
|
8
|
+
|
|
9
|
+
export * from './components/ui/accordion'
|
|
10
|
+
export * from './components/ui/alert'
|
|
11
|
+
export * from './components/ui/alert-dialog'
|
|
12
|
+
export * from './components/ui/aspect-ratio'
|
|
13
|
+
export * from './components/ui/avatar'
|
|
14
|
+
export * from './components/ui/badge'
|
|
15
|
+
export * from './components/ui/breadcrumb'
|
|
16
|
+
export * from './components/ui/button'
|
|
17
|
+
export * from './components/ui/calendar'
|
|
18
|
+
export * from './components/ui/card'
|
|
19
|
+
export * from './components/ui/carousel'
|
|
20
|
+
export * from './components/ui/chart'
|
|
21
|
+
|
|
22
|
+
export * from './components/ui/checkbox'
|
|
23
|
+
export * from './components/ui/collapsible'
|
|
24
|
+
export * from './components/ui/command'
|
|
25
|
+
export * from './components/ui/context-menu'
|
|
26
|
+
export * from './components/ui/dialog'
|
|
27
|
+
export * from './components/ui/drawer'
|
|
28
|
+
export * from './components/ui/dropdown-menu'
|
|
29
|
+
export * from './components/ui/form'
|
|
30
|
+
export * from './components/ui/hover-card'
|
|
31
|
+
export * from './components/ui/input'
|
|
32
|
+
export * from './components/ui/label'
|
|
33
|
+
export * from './components/ui/menubar'
|
|
34
|
+
export * from './components/ui/navigation-menu'
|
|
35
|
+
export * from './components/ui/pagination'
|
|
36
|
+
export * from './components/ui/popover'
|
|
37
|
+
export * from './components/ui/progress'
|
|
38
|
+
export * from './components/ui/radio-group'
|
|
39
|
+
export * from './components/ui/resizable'
|
|
40
|
+
export * from './components/ui/scroll-area'
|
|
41
|
+
export * from './components/ui/select'
|
|
42
|
+
export * from './components/ui/separator'
|
|
43
|
+
export * from './components/ui/sheet'
|
|
44
|
+
export * from './components/ui/skeleton'
|
|
45
|
+
export * from './components/ui/slider'
|
|
46
|
+
export * from './components/ui/sonner'
|
|
47
|
+
export * from './components/ui/switch'
|
|
48
|
+
export * from './components/ui/table'
|
|
49
|
+
export * from './components/ui/tabs'
|
|
50
|
+
export * from './components/ui/textarea'
|
|
51
|
+
export * from './components/ui/toast'
|
|
52
|
+
export * from './components/ui/toggle'
|
|
53
|
+
export * from './components/ui/toggle-group'
|
|
54
|
+
export * from './components/ui/tooltip'
|
|
55
|
+
// Custom internal components
|
|
56
|
+
export * from './components/ui/component-placeholder'
|
|
57
|
+
|
|
58
|
+
// Blocks (Composite Components)
|
|
59
|
+
export * from './components/blocks'
|
|
8
60
|
|
|
9
|
-
// Core
|
|
10
|
-
export { Button } from './components/ui/button'
|
|
11
|
-
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from './components/ui/card'
|
|
12
|
-
export { Input } from './components/ui/input'
|
|
13
|
-
export { Badge } from './components/ui/badge'
|
|
14
|
-
export { Avatar } from './components/ui/avatar'
|
|
15
|
-
export { Separator } from './components/ui/separator'
|
|
16
|
-
export { Skeleton } from './components/ui/skeleton'
|
|
17
|
-
export { ScrollArea } from './components/ui/scroll-area'
|
|
18
|
-
|
|
19
|
-
// Overlays
|
|
20
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogScrollContent, DialogTitle, DialogTrigger } from './components/ui/dialog'
|
|
21
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from './components/ui/alert-dialog'
|
|
22
|
-
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from './components/ui/sheet'
|
|
23
|
-
|
|
24
|
-
// Data Input
|
|
25
|
-
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from './components/ui/select'
|
|
26
|
-
export { Label } from './components/ui/label'
|
|
27
|
-
export { Textarea } from './components/ui/textarea'
|
|
28
|
-
export { Switch } from './components/ui/switch'
|
|
29
|
-
export { Checkbox } from './components/ui/checkbox'
|
|
30
|
-
export { RadioGroup, RadioGroupItem } from './components/ui/radio-group'
|
|
31
|
-
export { Slider } from './components/ui/slider'
|
|
32
|
-
|
|
33
|
-
// Navigation & Menus
|
|
34
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './components/ui/dropdown-menu'
|
|
35
|
-
export { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuSubContent } from './components/ui/context-menu'
|
|
36
|
-
export { Menubar, MenubarContent, MenubarItem, MenubarMenu, MenubarSeparator, MenubarTrigger } from './components/ui/menubar'
|
|
37
|
-
export { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport } from './components/ui/navigation-menu'
|
|
38
|
-
export { Tabs, TabsContent, TabsList, TabsTrigger } from './components/ui/tabs'
|
|
39
|
-
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from './components/ui/breadcrumb'
|
|
40
|
-
export { Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationLast, PaginationNext, PaginationPrev } from './components/ui/pagination'
|
|
41
|
-
|
|
42
|
-
// Feedback
|
|
43
|
-
export { Alert, AlertDescription, AlertTitle } from './components/ui/alert'
|
|
44
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './components/ui/tooltip'
|
|
45
|
-
export { Popover, PopoverContent, PopoverTrigger } from './components/ui/popover'
|
|
46
|
-
export { HoverCard, HoverCardContent, HoverCardTrigger } from './components/ui/hover-card'
|
|
47
|
-
export { Progress } from './components/ui/progress'
|
|
48
|
-
|
|
49
|
-
// Data Display
|
|
50
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './components/ui/table'
|
|
51
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './components/ui/accordion'
|
|
52
|
-
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from './components/ui/collapsible'
|
|
53
|
-
|
|
54
|
-
// Actions
|
|
55
|
-
export { Toggle } from './components/ui/toggle'
|
|
56
|
-
export { ToggleGroup, ToggleGroupItem } from './components/ui/toggle-group'
|
|
57
|
-
export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from './components/ui/command'
|
|
58
|
-
|
|
59
|
-
// Form
|
|
60
|
-
export { Form, FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage } from './components/ui/form'
|
|
61
|
-
|
|
62
|
-
// External library re-exports
|
|
63
|
-
export { Toaster, toast } from 'vue-sonner'
|