ui-arreya-components 0.0.16 → 0.1.2

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.
Files changed (109) hide show
  1. package/dist/index.d.mts +342 -0
  2. package/dist/index.d.ts +342 -0
  3. package/dist/index.js +1682 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +1495 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +61 -106
  8. package/.github/workflows/npm-publish.yml +0 -35
  9. package/.storybook/main.ts +0 -18
  10. package/.storybook/preview.ts +0 -16
  11. package/.storybook/vitest.setup.ts +0 -9
  12. package/README.md +0 -62
  13. package/components.json +0 -21
  14. package/dist/styles.css +0 -3
  15. package/dist/ui.cjs.js +0 -242
  16. package/dist/ui.es.js +0 -25142
  17. package/dist/ui.umd.js +0 -242
  18. package/eslint.config.js +0 -28
  19. package/postcss.config.js +0 -6
  20. package/scripts/build-index-ts.sh +0 -16
  21. package/scripts/template.sh +0 -57
  22. package/src/components/feature/graph-card.stories.tsx +0 -138
  23. package/src/components/feature/graph-card.tsx +0 -113
  24. package/src/components/feature/header.stories.tsx +0 -129
  25. package/src/components/feature/header.tsx +0 -78
  26. package/src/components/feature/login-form.stories.tsx +0 -35
  27. package/src/components/feature/login-form.tsx +0 -97
  28. package/src/components/feature/search-bar.stories.tsx +0 -35
  29. package/src/components/feature/search-bar.tsx +0 -141
  30. package/src/components/feature/wizard.stories.tsx +0 -199
  31. package/src/components/feature/wizard.tsx +0 -278
  32. package/src/components/ui/accordion.stories.tsx.disabled +0 -36
  33. package/src/components/ui/accordion.tsx +0 -55
  34. package/src/components/ui/alert-dialog.stories.tsx +0 -46
  35. package/src/components/ui/alert-dialog.tsx +0 -139
  36. package/src/components/ui/alert.stories.tsx +0 -45
  37. package/src/components/ui/alert.tsx +0 -59
  38. package/src/components/ui/aspect-ratio.stories.tsx +0 -24
  39. package/src/components/ui/aspect-ratio.tsx +0 -5
  40. package/src/components/ui/avatar.stories.tsx +0 -29
  41. package/src/components/ui/avatar.tsx +0 -48
  42. package/src/components/ui/badge.stories.tsx +0 -43
  43. package/src/components/ui/badge.tsx +0 -36
  44. package/src/components/ui/breadcrumb.stories.tsx +0 -146
  45. package/src/components/ui/breadcrumb.tsx +0 -115
  46. package/src/components/ui/button.stories.tsx +0 -87
  47. package/src/components/ui/button.tsx +0 -57
  48. package/src/components/ui/card.stories.tsx +0 -99
  49. package/src/components/ui/card.tsx +0 -76
  50. package/src/components/ui/carousel.stories.tsx +0 -47
  51. package/src/components/ui/carousel.tsx +0 -260
  52. package/src/components/ui/chart.stories.tsx.disabled +0 -44
  53. package/src/components/ui/chart.tsx +0 -363
  54. package/src/components/ui/checkbox.stories.tsx +0 -56
  55. package/src/components/ui/checkbox.tsx +0 -28
  56. package/src/components/ui/collapsible.stories.tsx +0 -58
  57. package/src/components/ui/collapsible.tsx +0 -9
  58. package/src/components/ui/context-menu.stories.tsx +0 -34
  59. package/src/components/ui/context-menu.tsx +0 -198
  60. package/src/components/ui/dialog.stories.tsx +0 -40
  61. package/src/components/ui/dialog.tsx +0 -120
  62. package/src/components/ui/drawer.stories.tsx +0 -48
  63. package/src/components/ui/drawer.tsx +0 -116
  64. package/src/components/ui/dropdown-menu.stories.tsx +0 -92
  65. package/src/components/ui/dropdown-menu.tsx +0 -199
  66. package/src/components/ui/form.tsx +0 -176
  67. package/src/components/ui/hover-card.stories.tsx +0 -31
  68. package/src/components/ui/hover-card.tsx +0 -27
  69. package/src/components/ui/input-otp.tsx +0 -69
  70. package/src/components/ui/input.stories.tsx +0 -63
  71. package/src/components/ui/input.tsx +0 -22
  72. package/src/components/ui/label.tsx +0 -24
  73. package/src/components/ui/menubar.tsx +0 -254
  74. package/src/components/ui/navigation-menu.tsx +0 -128
  75. package/src/components/ui/pagination.tsx +0 -117
  76. package/src/components/ui/popover.tsx +0 -31
  77. package/src/components/ui/progress.tsx +0 -26
  78. package/src/components/ui/radio-group.tsx +0 -42
  79. package/src/components/ui/resizable.tsx +0 -43
  80. package/src/components/ui/scroll-area.tsx +0 -46
  81. package/src/components/ui/select.tsx +0 -157
  82. package/src/components/ui/separator.tsx +0 -29
  83. package/src/components/ui/sheet.tsx +0 -138
  84. package/src/components/ui/sidebar.tsx +0 -771
  85. package/src/components/ui/skeleton.tsx +0 -15
  86. package/src/components/ui/slider.tsx +0 -26
  87. package/src/components/ui/sonner.tsx +0 -29
  88. package/src/components/ui/switch.tsx +0 -27
  89. package/src/components/ui/table.tsx +0 -120
  90. package/src/components/ui/tabs.tsx +0 -53
  91. package/src/components/ui/textarea.tsx +0 -22
  92. package/src/components/ui/toast.tsx +0 -127
  93. package/src/components/ui/toaster.tsx +0 -33
  94. package/src/components/ui/toggle-group.tsx +0 -59
  95. package/src/components/ui/toggle.tsx +0 -43
  96. package/src/components/ui/tooltip.tsx +0 -30
  97. package/src/hooks/use-mobile.tsx +0 -19
  98. package/src/hooks/use-toast.ts +0 -194
  99. package/src/index.css +0 -3633
  100. package/src/index.ts +0 -51
  101. package/src/lib/types.ts +0 -5
  102. package/src/lib/utils.ts +0 -6
  103. package/src/styles/tailwind.css +0 -100
  104. package/tailwind.config.js +0 -94
  105. package/tsconfig.app.json +0 -30
  106. package/tsconfig.json +0 -13
  107. package/tsconfig.node.json +0 -24
  108. package/vite.config.ts +0 -33
  109. package/vitest.workspace.ts +0 -32
@@ -1,15 +0,0 @@
1
- import { cn } from "@/lib/utils"
2
-
3
- function Skeleton({
4
- className,
5
- ...props
6
- }: React.HTMLAttributes<HTMLDivElement>) {
7
- return (
8
- <div
9
- className={cn("animate-pulse rounded-md bg-primary/10", className)}
10
- {...props}
11
- />
12
- )
13
- }
14
-
15
- export { Skeleton }
@@ -1,26 +0,0 @@
1
- import * as React from "react"
2
- import * as SliderPrimitive from "@radix-ui/react-slider"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const Slider = React.forwardRef<
7
- React.ElementRef<typeof SliderPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
9
- >(({ className, ...props }, ref) => (
10
- <SliderPrimitive.Root
11
- ref={ref}
12
- className={cn(
13
- "relative flex w-full touch-none select-none items-center",
14
- className
15
- )}
16
- {...props}
17
- >
18
- <SliderPrimitive.Track className="relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20">
19
- <SliderPrimitive.Range className="absolute h-full bg-primary" />
20
- </SliderPrimitive.Track>
21
- <SliderPrimitive.Thumb className="block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" />
22
- </SliderPrimitive.Root>
23
- ))
24
- Slider.displayName = SliderPrimitive.Root.displayName
25
-
26
- export { Slider }
@@ -1,29 +0,0 @@
1
- import { useTheme } from "next-themes"
2
- import { Toaster as Sonner } from "sonner"
3
-
4
- type ToasterProps = React.ComponentProps<typeof Sonner>
5
-
6
- const SonnerToaster = ({ ...props }: ToasterProps) => {
7
- const { theme = "system" } = useTheme()
8
-
9
- return (
10
- <Sonner
11
- theme={theme as ToasterProps["theme"]}
12
- className="toaster group"
13
- toastOptions={{
14
- classNames: {
15
- toast:
16
- "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
17
- description: "group-[.toast]:text-muted-foreground",
18
- actionButton:
19
- "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
20
- cancelButton:
21
- "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
22
- },
23
- }}
24
- {...props}
25
- />
26
- )
27
- }
28
-
29
- export { SonnerToaster }
@@ -1,27 +0,0 @@
1
- import * as React from "react"
2
- import * as SwitchPrimitives from "@radix-ui/react-switch"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const Switch = React.forwardRef<
7
- React.ElementRef<typeof SwitchPrimitives.Root>,
8
- React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
9
- >(({ className, ...props }, ref) => (
10
- <SwitchPrimitives.Root
11
- className={cn(
12
- "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
13
- className
14
- )}
15
- {...props}
16
- ref={ref}
17
- >
18
- <SwitchPrimitives.Thumb
19
- className={cn(
20
- "pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
21
- )}
22
- />
23
- </SwitchPrimitives.Root>
24
- ))
25
- Switch.displayName = SwitchPrimitives.Root.displayName
26
-
27
- export { Switch }
@@ -1,120 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- const Table = React.forwardRef<
6
- HTMLTableElement,
7
- React.HTMLAttributes<HTMLTableElement>
8
- >(({ className, ...props }, ref) => (
9
- <div className="relative w-full overflow-auto">
10
- <table
11
- ref={ref}
12
- className={cn("w-full caption-bottom text-sm", className)}
13
- {...props}
14
- />
15
- </div>
16
- ))
17
- Table.displayName = "Table"
18
-
19
- const TableHeader = React.forwardRef<
20
- HTMLTableSectionElement,
21
- React.HTMLAttributes<HTMLTableSectionElement>
22
- >(({ className, ...props }, ref) => (
23
- <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
24
- ))
25
- TableHeader.displayName = "TableHeader"
26
-
27
- const TableBody = React.forwardRef<
28
- HTMLTableSectionElement,
29
- React.HTMLAttributes<HTMLTableSectionElement>
30
- >(({ className, ...props }, ref) => (
31
- <tbody
32
- ref={ref}
33
- className={cn("[&_tr:last-child]:border-0", className)}
34
- {...props}
35
- />
36
- ))
37
- TableBody.displayName = "TableBody"
38
-
39
- const TableFooter = React.forwardRef<
40
- HTMLTableSectionElement,
41
- React.HTMLAttributes<HTMLTableSectionElement>
42
- >(({ className, ...props }, ref) => (
43
- <tfoot
44
- ref={ref}
45
- className={cn(
46
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
47
- className
48
- )}
49
- {...props}
50
- />
51
- ))
52
- TableFooter.displayName = "TableFooter"
53
-
54
- const TableRow = React.forwardRef<
55
- HTMLTableRowElement,
56
- React.HTMLAttributes<HTMLTableRowElement>
57
- >(({ className, ...props }, ref) => (
58
- <tr
59
- ref={ref}
60
- className={cn(
61
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
62
- className
63
- )}
64
- {...props}
65
- />
66
- ))
67
- TableRow.displayName = "TableRow"
68
-
69
- const TableHead = React.forwardRef<
70
- HTMLTableCellElement,
71
- React.ThHTMLAttributes<HTMLTableCellElement>
72
- >(({ className, ...props }, ref) => (
73
- <th
74
- ref={ref}
75
- className={cn(
76
- "h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
77
- className
78
- )}
79
- {...props}
80
- />
81
- ))
82
- TableHead.displayName = "TableHead"
83
-
84
- const TableCell = React.forwardRef<
85
- HTMLTableCellElement,
86
- React.TdHTMLAttributes<HTMLTableCellElement>
87
- >(({ className, ...props }, ref) => (
88
- <td
89
- ref={ref}
90
- className={cn(
91
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
92
- className
93
- )}
94
- {...props}
95
- />
96
- ))
97
- TableCell.displayName = "TableCell"
98
-
99
- const TableCaption = React.forwardRef<
100
- HTMLTableCaptionElement,
101
- React.HTMLAttributes<HTMLTableCaptionElement>
102
- >(({ className, ...props }, ref) => (
103
- <caption
104
- ref={ref}
105
- className={cn("mt-4 text-sm text-muted-foreground", className)}
106
- {...props}
107
- />
108
- ))
109
- TableCaption.displayName = "TableCaption"
110
-
111
- export {
112
- Table,
113
- TableHeader,
114
- TableBody,
115
- TableFooter,
116
- TableHead,
117
- TableRow,
118
- TableCell,
119
- TableCaption,
120
- }
@@ -1,53 +0,0 @@
1
- import * as React from "react"
2
- import * as TabsPrimitive from "@radix-ui/react-tabs"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const Tabs = TabsPrimitive.Root
7
-
8
- const TabsList = React.forwardRef<
9
- React.ElementRef<typeof TabsPrimitive.List>,
10
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
11
- >(({ className, ...props }, ref) => (
12
- <TabsPrimitive.List
13
- ref={ref}
14
- className={cn(
15
- "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
16
- className
17
- )}
18
- {...props}
19
- />
20
- ))
21
- TabsList.displayName = TabsPrimitive.List.displayName
22
-
23
- const TabsTrigger = React.forwardRef<
24
- React.ElementRef<typeof TabsPrimitive.Trigger>,
25
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
26
- >(({ className, ...props }, ref) => (
27
- <TabsPrimitive.Trigger
28
- ref={ref}
29
- className={cn(
30
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all 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=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
31
- className
32
- )}
33
- {...props}
34
- />
35
- ))
36
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
37
-
38
- const TabsContent = React.forwardRef<
39
- React.ElementRef<typeof TabsPrimitive.Content>,
40
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
41
- >(({ className, ...props }, ref) => (
42
- <TabsPrimitive.Content
43
- ref={ref}
44
- className={cn(
45
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
46
- className
47
- )}
48
- {...props}
49
- />
50
- ))
51
- TabsContent.displayName = TabsPrimitive.Content.displayName
52
-
53
- export { Tabs, TabsList, TabsTrigger, TabsContent }
@@ -1,22 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- const Textarea = React.forwardRef<
6
- HTMLTextAreaElement,
7
- React.ComponentProps<"textarea">
8
- >(({ className, ...props }, ref) => {
9
- return (
10
- <textarea
11
- className={cn(
12
- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
13
- className
14
- )}
15
- ref={ref}
16
- {...props}
17
- />
18
- )
19
- })
20
- Textarea.displayName = "Textarea"
21
-
22
- export { Textarea }
@@ -1,127 +0,0 @@
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-2 overflow-hidden rounded-md border p-4 pr-6 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 transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring 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-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 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 [&+div]:text-xs", 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
- }
@@ -1,33 +0,0 @@
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 }) {
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
- }
@@ -1,59 +0,0 @@
1
- import * as React from "react"
2
- import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
3
- import { type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "@/lib/utils"
6
- import { toggleVariants } from "@/components/ui/toggle"
7
-
8
- const ToggleGroupContext = React.createContext<
9
- VariantProps<typeof toggleVariants>
10
- >({
11
- size: "default",
12
- variant: "default",
13
- })
14
-
15
- const ToggleGroup = React.forwardRef<
16
- React.ElementRef<typeof ToggleGroupPrimitive.Root>,
17
- React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
18
- VariantProps<typeof toggleVariants>
19
- >(({ className, variant, size, children, ...props }, ref) => (
20
- <ToggleGroupPrimitive.Root
21
- ref={ref}
22
- className={cn("flex items-center justify-center gap-1", className)}
23
- {...props}
24
- >
25
- <ToggleGroupContext.Provider value={{ variant, size }}>
26
- {children}
27
- </ToggleGroupContext.Provider>
28
- </ToggleGroupPrimitive.Root>
29
- ))
30
-
31
- ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
32
-
33
- const ToggleGroupItem = React.forwardRef<
34
- React.ElementRef<typeof ToggleGroupPrimitive.Item>,
35
- React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
36
- VariantProps<typeof toggleVariants>
37
- >(({ className, children, variant, size, ...props }, ref) => {
38
- const context = React.useContext(ToggleGroupContext)
39
-
40
- return (
41
- <ToggleGroupPrimitive.Item
42
- ref={ref}
43
- className={cn(
44
- toggleVariants({
45
- variant: context.variant || variant,
46
- size: context.size || size,
47
- }),
48
- className
49
- )}
50
- {...props}
51
- >
52
- {children}
53
- </ToggleGroupPrimitive.Item>
54
- )
55
- })
56
-
57
- ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
58
-
59
- export { ToggleGroup, ToggleGroupItem }
@@ -1,43 +0,0 @@
1
- import * as React from "react"
2
- import * as TogglePrimitive from "@radix-ui/react-toggle"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const toggleVariants = cva(
8
- "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring 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",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-transparent",
13
- outline:
14
- "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",
15
- },
16
- size: {
17
- default: "h-9 px-2 min-w-9",
18
- sm: "h-8 px-1.5 min-w-8",
19
- lg: "h-10 px-2.5 min-w-10",
20
- },
21
- },
22
- defaultVariants: {
23
- variant: "default",
24
- size: "default",
25
- },
26
- }
27
- )
28
-
29
- const Toggle = React.forwardRef<
30
- React.ElementRef<typeof TogglePrimitive.Root>,
31
- React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
32
- VariantProps<typeof toggleVariants>
33
- >(({ className, variant, size, ...props }, ref) => (
34
- <TogglePrimitive.Root
35
- ref={ref}
36
- className={cn(toggleVariants({ variant, size, className }))}
37
- {...props}
38
- />
39
- ))
40
-
41
- Toggle.displayName = TogglePrimitive.Root.displayName
42
-
43
- export { Toggle, toggleVariants }
@@ -1,30 +0,0 @@
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.Portal>
17
- <TooltipPrimitive.Content
18
- ref={ref}
19
- sideOffset={sideOffset}
20
- className={cn(
21
- "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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]",
22
- className
23
- )}
24
- {...props}
25
- />
26
- </TooltipPrimitive.Portal>
27
- ))
28
- TooltipContent.displayName = TooltipPrimitive.Content.displayName
29
-
30
- export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
@@ -1,19 +0,0 @@
1
- import * as React from "react"
2
-
3
- const MOBILE_BREAKPOINT = 768
4
-
5
- export function useIsMobile() {
6
- const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
7
-
8
- React.useEffect(() => {
9
- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
10
- const onChange = () => {
11
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
12
- }
13
- mql.addEventListener("change", onChange)
14
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
15
- return () => mql.removeEventListener("change", onChange)
16
- }, [])
17
-
18
- return !!isMobile
19
- }