cooterlabs 1.0.1 → 2.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.
@@ -0,0 +1,57 @@
1
+ import * as React from "react"
2
+ import * as TabsPrimitive from "@radix-ui/react-tabs"
3
+ import { clsx, type ClassValue } from "clsx"
4
+ import { twMerge } from "tailwind-merge"
5
+
6
+ export function cn(...inputs: ClassValue[]) {
7
+ return twMerge(clsx(inputs))
8
+ }
9
+
10
+ const Tabs = TabsPrimitive.Root
11
+
12
+ const TabsList = React.forwardRef<
13
+ React.ComponentRef<typeof TabsPrimitive.List>,
14
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
15
+ >(({ className, ...props }, ref) => (
16
+ <TabsPrimitive.List
17
+ ref={ref}
18
+ className={cn(
19
+ "inline-flex items-center justify-center gap-1 rounded-xs bg-secondary p-1",
20
+ className
21
+ )}
22
+ {...props}
23
+ />
24
+ ))
25
+ TabsList.displayName = TabsPrimitive.List.displayName
26
+
27
+ const TabsTrigger = React.forwardRef<
28
+ React.ComponentRef<typeof TabsPrimitive.Trigger>,
29
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
30
+ >(({ className, ...props }, ref) => (
31
+ <TabsPrimitive.Trigger
32
+ ref={ref}
33
+ className={cn(
34
+ "inline-flex h-10 items-center justify-center whitespace-nowrap rounded-xxs px-4 text-b4 text-muted-foreground ring-offset-background transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:text-grey-400 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-100",
35
+ className
36
+ )}
37
+ {...props}
38
+ />
39
+ ))
40
+ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
41
+
42
+ const TabsContent = React.forwardRef<
43
+ React.ComponentRef<typeof TabsPrimitive.Content>,
44
+ React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
45
+ >(({ className, ...props }, ref) => (
46
+ <TabsPrimitive.Content
47
+ ref={ref}
48
+ className={cn(
49
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
50
+ className
51
+ )}
52
+ {...props}
53
+ />
54
+ ))
55
+ TabsContent.displayName = TabsPrimitive.Content.displayName
56
+
57
+ export { Tabs, TabsList, TabsTrigger, TabsContent }
@@ -14,7 +14,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
14
14
  return (
15
15
  <textarea
16
16
  className={cn(
17
- "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
17
+ "flex min-h-24 w-full rounded-xs border border-input bg-background px-4 py-3 text-b1 text-foreground ring-offset-background transition-colors placeholder:text-muted-foreground hover:border-grey-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 aria-invalid:border-error disabled:pointer-events-none disabled:border-grey-200 disabled:bg-secondary disabled:text-grey-400",
18
18
  className
19
19
  )}
20
20
  ref={ref}
@@ -0,0 +1,27 @@
1
+ import * as React from "react"
2
+ import * as SwitchPrimitive from "@radix-ui/react-switch"
3
+ import { clsx, type ClassValue } from "clsx"
4
+ import { twMerge } from "tailwind-merge"
5
+
6
+ export function cn(...inputs: ClassValue[]) {
7
+ return twMerge(clsx(inputs))
8
+ }
9
+
10
+ const Toggle = React.forwardRef<
11
+ React.ElementRef<typeof SwitchPrimitive.Root>,
12
+ React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>
13
+ >(({ className, ...props }, ref) => (
14
+ <SwitchPrimitive.Root
15
+ ref={ref}
16
+ className={cn(
17
+ "peer inline-flex h-6 w-11 shrink-0 items-center rounded-full bg-grey-200 px-0.5 ring-offset-background transition-colors hover:bg-grey-300 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=checked]:bg-primary data-[state=checked]:hover:bg-primary-700",
18
+ className
19
+ )}
20
+ {...props}
21
+ >
22
+ <SwitchPrimitive.Thumb className="pointer-events-none block size-5 rounded-full bg-background shadow-100 transition-transform data-[state=checked]:translate-x-5" />
23
+ </SwitchPrimitive.Root>
24
+ ))
25
+ Toggle.displayName = "Toggle"
26
+
27
+ export { Toggle }
@@ -0,0 +1,37 @@
1
+ import * as React from "react"
2
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip"
3
+ import { clsx, type ClassValue } from "clsx"
4
+ import { twMerge } from "tailwind-merge"
5
+
6
+ export function cn(...inputs: ClassValue[]) {
7
+ return twMerge(clsx(inputs))
8
+ }
9
+
10
+ const TooltipProvider = TooltipPrimitive.Provider
11
+
12
+ const Tooltip = TooltipPrimitive.Root
13
+
14
+ const TooltipTrigger = TooltipPrimitive.Trigger
15
+
16
+ const TooltipContent = React.forwardRef<
17
+ React.ElementRef<typeof TooltipPrimitive.Content>,
18
+ React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
19
+ >(({ className, sideOffset = 4, children, ...props }, ref) => (
20
+ <TooltipPrimitive.Portal>
21
+ <TooltipPrimitive.Content
22
+ ref={ref}
23
+ sideOffset={sideOffset}
24
+ className={cn(
25
+ "z-50 overflow-hidden rounded-xxs bg-grey-900 px-3 py-1.5 text-c2 font-medium text-white shadow-300",
26
+ className
27
+ )}
28
+ {...props}
29
+ >
30
+ {children}
31
+ <TooltipPrimitive.Arrow className="fill-grey-900" />
32
+ </TooltipPrimitive.Content>
33
+ </TooltipPrimitive.Portal>
34
+ ))
35
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName
36
+
37
+ export { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent }