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.
- package/README.md +77 -14
- package/bin/index.js +510 -75
- package/package.json +12 -4
- package/templates/action-sheet/action-sheet.tsx +113 -0
- package/templates/alert/alert.tsx +96 -0
- package/templates/avatar/avatar.tsx +21 -4
- package/templates/badge/badge.tsx +106 -15
- package/templates/breadcrumb/breadcrumb.tsx +113 -0
- package/templates/button/button.tsx +40 -2
- package/templates/button-group/button-group.tsx +93 -0
- package/templates/card/card.tsx +31 -19
- package/templates/checkbox/checkbox.tsx +4 -3
- package/templates/context-menu/context-menu.tsx +177 -0
- package/templates/dialog/dialog.tsx +127 -0
- package/templates/dropdown/dropdown.tsx +180 -0
- package/templates/input/input.tsx +30 -3
- package/templates/label/label.tsx +2 -2
- package/templates/list/list.tsx +96 -0
- package/templates/loader/loader.tsx +38 -0
- package/templates/navbar-bottom/navbar-bottom.tsx +76 -0
- package/templates/navbar-top/navbar-top.tsx +84 -0
- package/templates/page-control/page-control.tsx +55 -0
- package/templates/pagination/pagination.tsx +109 -0
- package/templates/progress/progress.tsx +69 -0
- package/templates/radio/radio.tsx +41 -0
- package/templates/stepper/stepper.tsx +93 -0
- package/templates/tabs/tabs.tsx +57 -0
- package/templates/textarea/textarea.tsx +1 -1
- package/templates/toggle/toggle.tsx +27 -0
- package/templates/tooltip/tooltip.tsx +37 -0
|
@@ -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-
|
|
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 }
|