docthub-core-components 2.3.6 → 2.3.9

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 (31) hide show
  1. package/dist/index.esm.js +14825 -3875
  2. package/dist/landing.html +82 -0
  3. package/package.json +14 -14
  4. package/dist/index.html +0 -54
  5. package/dist/registry/@docthub/alert.json +0 -16
  6. package/dist/registry/@docthub/auto-complete-component.test.json +0 -14
  7. package/dist/registry/@docthub/avatar.json +0 -16
  8. package/dist/registry/@docthub/badge.json +0 -16
  9. package/dist/registry/@docthub/button.json +0 -17
  10. package/dist/registry/@docthub/button.test.json +0 -14
  11. package/dist/registry/@docthub/calendar.json +0 -17
  12. package/dist/registry/@docthub/checkbox.json +0 -17
  13. package/dist/registry/@docthub/command.json +0 -18
  14. package/dist/registry/@docthub/dialog.json +0 -17
  15. package/dist/registry/@docthub/drawer.json +0 -16
  16. package/dist/registry/@docthub/dropdown-menu.json +0 -17
  17. package/dist/registry/@docthub/index.json +0 -106
  18. package/dist/registry/@docthub/input.json +0 -14
  19. package/dist/registry/@docthub/label.json +0 -17
  20. package/dist/registry/@docthub/popover.json +0 -16
  21. package/dist/registry/@docthub/progress.json +0 -16
  22. package/dist/registry/@docthub/radio-group.json +0 -17
  23. package/dist/registry/@docthub/select.json +0 -17
  24. package/dist/registry/@docthub/skeleton.json +0 -14
  25. package/dist/registry/@docthub/tabs.json +0 -16
  26. package/dist/registry/@docthub/textarea.json +0 -14
  27. package/dist/registry/@docthub/toast.json +0 -17
  28. package/dist/registry/@docthub/toast.test.json +0 -14
  29. package/dist/registry/@docthub/tooltip.json +0 -16
  30. package/dist/registry/@docthub/typography.json +0 -14
  31. package/dist/registry/@docthub/typography.test.json +0 -14
@@ -1,106 +0,0 @@
1
- [
2
- {
3
- "name": "alert",
4
- "url": "/registry/@docthub/alert.json"
5
- },
6
- {
7
- "name": "auto-complete-component.test",
8
- "url": "/registry/@docthub/auto-complete-component.test.json"
9
- },
10
- {
11
- "name": "avatar",
12
- "url": "/registry/@docthub/avatar.json"
13
- },
14
- {
15
- "name": "badge",
16
- "url": "/registry/@docthub/badge.json"
17
- },
18
- {
19
- "name": "button.test",
20
- "url": "/registry/@docthub/button.test.json"
21
- },
22
- {
23
- "name": "button",
24
- "url": "/registry/@docthub/button.json"
25
- },
26
- {
27
- "name": "calendar",
28
- "url": "/registry/@docthub/calendar.json"
29
- },
30
- {
31
- "name": "checkbox",
32
- "url": "/registry/@docthub/checkbox.json"
33
- },
34
- {
35
- "name": "command",
36
- "url": "/registry/@docthub/command.json"
37
- },
38
- {
39
- "name": "dialog",
40
- "url": "/registry/@docthub/dialog.json"
41
- },
42
- {
43
- "name": "drawer",
44
- "url": "/registry/@docthub/drawer.json"
45
- },
46
- {
47
- "name": "dropdown-menu",
48
- "url": "/registry/@docthub/dropdown-menu.json"
49
- },
50
- {
51
- "name": "input",
52
- "url": "/registry/@docthub/input.json"
53
- },
54
- {
55
- "name": "label",
56
- "url": "/registry/@docthub/label.json"
57
- },
58
- {
59
- "name": "popover",
60
- "url": "/registry/@docthub/popover.json"
61
- },
62
- {
63
- "name": "progress",
64
- "url": "/registry/@docthub/progress.json"
65
- },
66
- {
67
- "name": "radio-group",
68
- "url": "/registry/@docthub/radio-group.json"
69
- },
70
- {
71
- "name": "select",
72
- "url": "/registry/@docthub/select.json"
73
- },
74
- {
75
- "name": "skeleton",
76
- "url": "/registry/@docthub/skeleton.json"
77
- },
78
- {
79
- "name": "tabs",
80
- "url": "/registry/@docthub/tabs.json"
81
- },
82
- {
83
- "name": "textarea",
84
- "url": "/registry/@docthub/textarea.json"
85
- },
86
- {
87
- "name": "toast.test",
88
- "url": "/registry/@docthub/toast.test.json"
89
- },
90
- {
91
- "name": "toast",
92
- "url": "/registry/@docthub/toast.json"
93
- },
94
- {
95
- "name": "tooltip",
96
- "url": "/registry/@docthub/tooltip.json"
97
- },
98
- {
99
- "name": "typography.test",
100
- "url": "/registry/@docthub/typography.test.json"
101
- },
102
- {
103
- "name": "typography",
104
- "url": "/registry/@docthub/typography.json"
105
- }
106
- ]
@@ -1,14 +0,0 @@
1
- {
2
- "name": "input",
3
- "type": "registry:ui",
4
- "title": "Input",
5
- "description": "Input component",
6
- "dependencies": [],
7
- "files": [
8
- {
9
- "type": "registry:ui",
10
- "path": "components/ui/input.tsx",
11
- "content": "import * as React from \"react\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\r\n ({ className, type, ...props }, ref) => {\r\n return (\r\n <input\r\n type={type}\r\n className={cn(\r\n \"flex h-10 w-full rounded-md border border-gray-300 bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder-gray-400 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\r\n className\r\n )}\r\n ref={ref}\r\n {...props}\r\n />\r\n )\r\n }\r\n)\r\nInput.displayName = \"Input\"\r\n\r\nexport { Input }\r\n"
12
- }
13
- ]
14
- }
@@ -1,17 +0,0 @@
1
- {
2
- "name": "label",
3
- "type": "registry:ui",
4
- "title": "Label",
5
- "description": "Label component",
6
- "dependencies": [
7
- "@radix-ui/react-label",
8
- "class-variance-authority"
9
- ],
10
- "files": [
11
- {
12
- "type": "registry:ui",
13
- "path": "components/ui/label.tsx",
14
- "content": "\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst labelVariants = cva(\r\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\r\n)\r\n\r\nconst Label = React.forwardRef<\r\n React.ElementRef<typeof LabelPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\r\n VariantProps<typeof labelVariants>\r\n>(({ className, ...props }, ref) => (\r\n <LabelPrimitive.Root\r\n ref={ref}\r\n className={cn(labelVariants(), className)}\r\n {...props}\r\n />\r\n))\r\nLabel.displayName = LabelPrimitive.Root.displayName\r\n\r\nexport { Label }\r\n"
15
- }
16
- ]
17
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "popover",
3
- "type": "registry:ui",
4
- "title": "Popover",
5
- "description": "Popover component",
6
- "dependencies": [
7
- "@radix-ui/react-popover"
8
- ],
9
- "files": [
10
- {
11
- "type": "registry:ui",
12
- "path": "components/ui/popover.tsx",
13
- "content": "import * as React from \"react\"\r\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Popover = PopoverPrimitive.Root\r\n\r\nconst PopoverTrigger = PopoverPrimitive.Trigger\r\nconst PopoverAnchor = PopoverPrimitive.Anchor\r\n\r\nconst PopoverContent = React.forwardRef<\r\n React.ElementRef<typeof PopoverPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\r\n>(({ className, sideOffset = 4, ...props }, ref) => (\r\n <PopoverPrimitive.Portal>\r\n <PopoverPrimitive.Content\r\n ref={ref}\r\n sideOffset={sideOffset}\r\n className={cn(\r\n 'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\r\n className\r\n )}\r\n {...props}\r\n />\r\n </PopoverPrimitive.Portal>\r\n))\r\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\r\n\r\nexport {\r\n Popover,\r\n PopoverTrigger,\r\n PopoverContent,\r\n PopoverAnchor,\r\n}\r\n"
14
- }
15
- ]
16
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "progress",
3
- "type": "registry:ui",
4
- "title": "Progress",
5
- "description": "Progress component",
6
- "dependencies": [
7
- "@radix-ui/react-progress"
8
- ],
9
- "files": [
10
- {
11
- "type": "registry:ui",
12
- "path": "components/ui/progress.tsx",
13
- "content": "import * as React from \"react\"\r\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Progress = React.forwardRef<\r\n React.ElementRef<typeof ProgressPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\r\n>(({ className, value, ...props }, ref) => (\r\n <ProgressPrimitive.Root\r\n ref={ref}\r\n className={cn(\r\n \"relative h-1.5 w-full overflow-hidden rounded-full bg-secondary\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n <ProgressPrimitive.Indicator\r\n className=\"h-full w-full flex-1 bg-brandBlue transition-all\"\r\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\r\n />\r\n </ProgressPrimitive.Root>\r\n))\r\nProgress.displayName = ProgressPrimitive.Root.displayName\r\n\r\nexport { Progress }\r\n"
14
- }
15
- ]
16
- }
@@ -1,17 +0,0 @@
1
- {
2
- "name": "radio-group",
3
- "type": "registry:ui",
4
- "title": "Radio Group",
5
- "description": "Radio Group component",
6
- "dependencies": [
7
- "@radix-ui/react-radio-group",
8
- "lucide-react"
9
- ],
10
- "files": [
11
- {
12
- "type": "registry:ui",
13
- "path": "components/ui/radio-group.tsx",
14
- "content": "import * as React from \"react\";\r\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\r\nimport { Circle } from \"lucide-react\";\r\n\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst RadioGroup = React.forwardRef<\r\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\r\n>(({ className, ...props }, ref) => (\r\n <RadioGroupPrimitive.Root\r\n ref={ref}\r\n className={cn(\"grid gap-2\", className)}\r\n {...props}\r\n />\r\n));\r\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\r\n\r\nconst RadioGroupItem = React.forwardRef<\r\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\r\n>(({ className, ...props }, ref) => (\r\n <RadioGroupPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n `\r\n aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background\r\n focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\r\n disabled:cursor-not-allowed disabled:opacity-50\r\n `,\r\n className\r\n )}\r\n {...props}\r\n >\r\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\r\n <Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\r\n </RadioGroupPrimitive.Indicator>\r\n </RadioGroupPrimitive.Item>\r\n));\r\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\r\n\r\nexport { RadioGroup, RadioGroupItem };\r\n"
15
- }
16
- ]
17
- }
@@ -1,17 +0,0 @@
1
- {
2
- "name": "select",
3
- "type": "registry:ui",
4
- "title": "Select",
5
- "description": "Select component",
6
- "dependencies": [
7
- "@radix-ui/react-select",
8
- "lucide-react"
9
- ],
10
- "files": [
11
- {
12
- "type": "registry:ui",
13
- "path": "components/ui/select.tsx",
14
- "content": "import * as React from \"react\"\r\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\r\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Select = SelectPrimitive.Root\r\n\r\nconst SelectGroup = SelectPrimitive.Group\r\n\r\nconst SelectValue = SelectPrimitive.Value\r\n\r\nconst SelectTrigger = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Trigger>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\r\n>(({ className, children, ...props }, ref) => (\r\n <SelectPrimitive.Trigger\r\n ref={ref}\r\n className={cn(\r\n \"flex h-10 w-full items-center justify-between rounded-md border border-gray-300 bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <SelectPrimitive.Icon asChild>\r\n <ChevronDown strokeWidth={1.5} className=\"h-4 w-4 text-foreground\" />\r\n </SelectPrimitive.Icon>\r\n </SelectPrimitive.Trigger>\r\n))\r\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\r\n\r\nconst SelectScrollUpButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollUpButton\r\n ref={ref}\r\n className={cn(\r\n \"flex cursor-default items-center justify-center py-1\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n <ChevronUp className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollUpButton>\r\n))\r\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\r\n\r\nconst SelectScrollDownButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollDownButton\r\n ref={ref}\r\n className={cn(\r\n \"flex cursor-default items-center justify-center py-1\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollDownButton>\r\n))\r\nSelectScrollDownButton.displayName =\r\n SelectPrimitive.ScrollDownButton.displayName\r\n\r\nconst SelectContent = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\r\n>(({ className, children, position = \"popper\", ...props }, ref) => (\r\n <SelectPrimitive.Portal>\r\n <SelectPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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-select-content-transform-origin]\",\r\n position === \"popper\" &&\r\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\r\n className\r\n )}\r\n position={position}\r\n {...props}\r\n >\r\n <SelectScrollUpButton />\r\n <SelectPrimitive.Viewport\r\n className={cn(\r\n \"p-1\",\r\n position === \"popper\" &&\r\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\r\n )}\r\n >\r\n {children}\r\n </SelectPrimitive.Viewport>\r\n <SelectScrollDownButton />\r\n </SelectPrimitive.Content>\r\n </SelectPrimitive.Portal>\r\n))\r\nSelectContent.displayName = SelectPrimitive.Content.displayName\r\n\r\nconst SelectLabel = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Label\r\n ref={ref}\r\n className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\r\n {...props}\r\n />\r\n))\r\nSelectLabel.displayName = SelectPrimitive.Label.displayName\r\n\r\nconst SelectItem = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\r\n>(({ className, children, ...props }, ref) => (\r\n <SelectPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\r\n <SelectPrimitive.ItemIndicator>\r\n <Check className=\"h-4 w-4\" />\r\n </SelectPrimitive.ItemIndicator>\r\n </span>\r\n\r\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\r\n </SelectPrimitive.Item>\r\n))\r\nSelectItem.displayName = SelectPrimitive.Item.displayName\r\n\r\nconst SelectSeparator = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Separator\r\n ref={ref}\r\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\r\n {...props}\r\n />\r\n))\r\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\r\n\r\nexport {\r\n Select,\r\n SelectGroup,\r\n SelectValue,\r\n SelectTrigger,\r\n SelectContent,\r\n SelectLabel,\r\n SelectItem,\r\n SelectSeparator,\r\n SelectScrollUpButton,\r\n SelectScrollDownButton,\r\n}\r\n"
15
- }
16
- ]
17
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "skeleton",
3
- "type": "registry:ui",
4
- "title": "Skeleton",
5
- "description": "Skeleton component",
6
- "dependencies": [],
7
- "files": [
8
- {
9
- "type": "registry:ui",
10
- "path": "components/ui/skeleton.tsx",
11
- "content": "import { cn } from \"@/lib/utils\"\r\n\r\nfunction Skeleton({\r\n className,\r\n ...props\r\n}: React.HTMLAttributes<HTMLDivElement>) {\r\n return (\r\n <div\r\n className={cn(\"animate-pulse rounded-md bg-muted\", className)}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport { Skeleton }\r\n"
12
- }
13
- ]
14
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "tabs",
3
- "type": "registry:ui",
4
- "title": "Tabs",
5
- "description": "Tabs component",
6
- "dependencies": [
7
- "@radix-ui/react-tabs"
8
- ],
9
- "files": [
10
- {
11
- "type": "registry:ui",
12
- "path": "components/ui/tabs.tsx",
13
- "content": "import * as React from \"react\"\r\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Tabs = TabsPrimitive.Root\r\n\r\nconst TabsList = React.forwardRef<\r\n React.ElementRef<typeof TabsPrimitive.List>,\r\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\r\n>(({ className, ...props }, ref) => (\r\n <TabsPrimitive.List\r\n ref={ref}\r\n className={cn(\r\n \"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nTabsList.displayName = TabsPrimitive.List.displayName\r\n\r\nconst TabsTrigger = React.forwardRef<\r\n React.ElementRef<typeof TabsPrimitive.Trigger>,\r\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\r\n>(({ className, ...props }, ref) => (\r\n <TabsPrimitive.Trigger\r\n ref={ref}\r\n className={cn(\r\n \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 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-sm\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\r\n\r\nconst TabsContent = React.forwardRef<\r\n React.ElementRef<typeof TabsPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\r\n>(({ className, ...props }, ref) => (\r\n <TabsPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nTabsContent.displayName = TabsPrimitive.Content.displayName\r\n\r\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\r\n"
14
- }
15
- ]
16
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "textarea",
3
- "type": "registry:ui",
4
- "title": "Textarea",
5
- "description": "Textarea component",
6
- "dependencies": [],
7
- "files": [
8
- {
9
- "type": "registry:ui",
10
- "path": "components/ui/textarea.tsx",
11
- "content": "import * as React from \"react\"\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\r\n label?: string\r\n helperText?: string\r\n errorText?: string\r\n required?: boolean\r\n}\r\n\r\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\r\n ({ label, helperText, errorText, required, className, placeholder = \"Write here...\", rows = 4, ...props }, ref) => {\r\n const hasError = Boolean(errorText)\r\n\r\n return (\r\n <div className={cn(\"space-y-1\", className)}>\r\n {label && (\r\n <label className=\"block text-sm font-medium text-foreground\">\r\n {label}\r\n {required && <span className=\"text-destructive ml-1\">*</span>}\r\n </label>\r\n )}\r\n\r\n <textarea\r\n ref={ref}\r\n placeholder={placeholder}\r\n rows={rows}\r\n className={cn(\r\n \"flex min-h-[80px] w-full rounded-md border bg-background px-3 py-2 text-base placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\r\n hasError\r\n ? \"border border-destructive\"\r\n : \"border-input focus:ring-ring\"\r\n )}\r\n {...props}\r\n />\r\n\r\n {(helperText || errorText) && (\r\n <p className={cn(\"text-xs\", hasError ? \"text-destructive\" : \"text-muted-foreground\")}>\r\n {errorText || helperText}\r\n </p>\r\n )}\r\n </div>\r\n )\r\n }\r\n)\r\n\r\nTextarea.displayName = \"Textarea\"\r\n\r\nexport { Textarea }\r\n"
12
- }
13
- ]
14
- }
@@ -1,17 +0,0 @@
1
- {
2
- "name": "toast",
3
- "type": "registry:ui",
4
- "title": "Toast",
5
- "description": "Toast component",
6
- "dependencies": [
7
- "sonner",
8
- "lucide-react"
9
- ],
10
- "files": [
11
- {
12
- "type": "registry:ui",
13
- "path": "components/ui/toast.tsx",
14
- "content": "import {\r\n Toaster as SonnerToaster,\r\n toast as sonnerToast,\r\n type ToasterProps as SonnerToasterProps,\r\n} from \"sonner\";\r\nimport * as React from \"react\";\r\nimport { X, Info, CheckCircle2, AlertTriangle, XCircle } from \"lucide-react\";\r\nimport { DoctButton } from \"./button\";\r\n\r\nexport type ToastVariant = \"error\" | \"info\" | \"warning\" | \"success\";\r\nexport type ToastPosition =\r\n | \"top-right\"\r\n | \"top-center\"\r\n | \"top-left\"\r\n | \"bottom-right\"\r\n | \"bottom-center\"\r\n | \"bottom-left\";\r\n\r\nconst variantClasses: Record<ToastVariant, string> = {\r\n error: \"bg-red-500 text-white\",\r\n info: \"bg-blue-500 text-white\",\r\n warning: \"bg-amber-500 text-white\",\r\n success: \"bg-green-500 text-white\",\r\n};\r\n\r\nconst variantDurations: Record<ToastVariant, number> = {\r\n error: 5000,\r\n info: 4000,\r\n warning: 5000,\r\n success: 4000,\r\n};\r\n\r\nconst defaultIcons: Record<ToastVariant, React.ReactNode> = {\r\n error: <XCircle className=\"w-4 h-4 text-white\" />,\r\n info: <Info className=\"w-4 h-4 text-white\" />,\r\n warning: <AlertTriangle className=\"w-4 h-4 text-white\" />,\r\n success: <CheckCircle2 className=\"w-4 h-4 text-white\" />,\r\n};\r\n\r\nexport interface ToastOptions {\r\n description?: string;\r\n variant?: ToastVariant;\r\n action?: { label: string; onClick: () => void };\r\n duration?: number;\r\n icon?: React.ReactNode;\r\n iconPosition?: \"left\" | \"right\";\r\n}\r\n\r\nexport const toast = (message: string, options?: ToastOptions) => {\r\n const variant = options?.variant || \"info\";\r\n const colorClasses = variantClasses[variant];\r\n const icon = options?.icon ?? defaultIcons[variant];\r\n const iconPosition = options?.iconPosition ?? \"left\";\r\n\r\n const content = (t: string | number) => (\r\n <div\r\n className={`flex items-center justify-between w-full p-3 rounded-md shadow-md ${colorClasses}`}\r\n >\r\n <div className=\"flex items-center\">\r\n {icon && iconPosition === \"left\" && <div className=\"mr-3\">{icon}</div>}\r\n <div>\r\n <p className=\"text-sm font-semibold\">{message}</p>\r\n {options?.description && (\r\n <p className=\"text-sm text-white/90\">{options.description}</p>\r\n )}\r\n </div>\r\n </div>\r\n <div className=\"flex items-center\">\r\n {icon && iconPosition === \"right\" && <div className=\"ml-3\">{icon}</div>}\r\n {options?.action && (\r\n <DoctButton\r\n variant=\"ghost\"\r\n size=\"small\"\r\n className=\"ml-3 text-white hover:text-black/80\"\r\n onClick={options.action.onClick}\r\n >\r\n {options.action.label}\r\n </DoctButton>\r\n )}\r\n <DoctButton\r\n variant=\"ghost\"\r\n size=\"icon.large\"\r\n className=\"ml-3 text-white hover:text-black/80\"\r\n onClick={() => sonnerToast.dismiss(t)}\r\n >\r\n <X className=\"w-4 h-4\" strokeWidth={2.5} />\r\n </DoctButton>\r\n </div>\r\n </div>\r\n );\r\n\r\n const toastOptions = {\r\n unstyled: true,\r\n duration: options?.duration || variantDurations[variant],\r\n style: {\r\n padding: 0,\r\n margin: 0,\r\n border: \"none\",\r\n background: \"none\",\r\n },\r\n };\r\n\r\n return sonnerToast.custom(content, toastOptions);\r\n};\r\n\r\nexport interface ToasterProps extends Omit<SonnerToasterProps, \"position\"> {\r\n position?: ToastPosition;\r\n}\r\n\r\nexport function Toaster(props: ToasterProps) {\r\n return <SonnerToaster {...props} />;\r\n}\r\n"
15
- }
16
- ]
17
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "toast.test",
3
- "type": "registry:ui",
4
- "title": "Toast.test",
5
- "description": "Toast.test component",
6
- "dependencies": [],
7
- "files": [
8
- {
9
- "type": "registry:ui",
10
- "path": "components/ui/toast.test.tsx",
11
- "content": "import { render, screen, act } from '@testing-library/react';\r\nimport { Toaster, toast } from './toast';\r\nimport React from 'react';\r\n\r\ndescribe('Toast (Sonner)', () => {\r\n it.skip('renders the Toaster provider', () => {\r\n render(<Toaster />);\r\n // Sonner renders a portal, so we check for the container\r\n // expect(document.querySelector('[data-sonner-toaster]')).toBeInTheDocument();\r\n });\r\n\r\n it('shows a toast message when toast() is called', async () => {\r\n render(<Toaster />);\r\n act(() => {\r\n toast('Hello, world!');\r\n });\r\n // Sonner renders toasts in a portal, so we query the document body\r\n expect(await screen.findByText('Hello, world!')).toBeInTheDocument();\r\n });\r\n}); "
12
- }
13
- ]
14
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "tooltip",
3
- "type": "registry:ui",
4
- "title": "Tooltip",
5
- "description": "Tooltip component",
6
- "dependencies": [
7
- "@radix-ui/react-tooltip"
8
- ],
9
- "files": [
10
- {
11
- "type": "registry:ui",
12
- "path": "components/ui/tooltip.tsx",
13
- "content": "import * as React from \"react\";\r\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\r\nimport { cn } from \"@/lib/utils\";\r\n\r\nconst TooltipProvider = TooltipPrimitive.Provider;\r\nconst Tooltip = TooltipPrimitive.Root;\r\nconst TooltipTrigger = TooltipPrimitive.Trigger;\r\n\r\nconst TooltipContent = React.forwardRef<\r\n React.ElementRef<typeof TooltipPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\r\n>(({ className, sideOffset = 4, children, ...props }, ref) => (\r\n <TooltipPrimitive.Content\r\n ref={ref}\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"z-50 rounded-xl border border-border bg-background px-3 py-1.5 text-sm text-foreground shadow-xl transition-all\",\r\n \"animate-in fade-in zoom-in-95\",\r\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95\",\r\n \"data-[side=bottom]:slide-in-from-top-2\",\r\n \"data-[side=left]:slide-in-from-right-2\",\r\n \"data-[side=right]:slide-in-from-left-2\",\r\n \"data-[side=top]:slide-in-from-bottom-2\",\r\n \"origin-[--radix-tooltip-content-transform-origin]\",\r\n className\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <TooltipPrimitive.Arrow className=\"fill-background stroke-border h-2 w-4\" />\r\n </TooltipPrimitive.Content>\r\n));\r\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\r\n\r\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\r\n"
14
- }
15
- ]
16
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "typography",
3
- "type": "registry:ui",
4
- "title": "Typography",
5
- "description": "Typography component",
6
- "dependencies": [],
7
- "files": [
8
- {
9
- "type": "registry:ui",
10
- "path": "components/ui/typography.tsx",
11
- "content": "import React from \"react\";\r\n\r\nexport interface DoctTypographyProps {\r\n variant:\r\n | \"h1\"\r\n | \"h2\"\r\n | \"h3\"\r\n | \"h4\"\r\n | \"h5\"\r\n | \"h6\"\r\n | \"h7\"\r\n | \"h8\"\r\n | \"title1\"\r\n | \"title2\"\r\n | \"title3\"\r\n | \"title4\"\r\n | \"body1\"\r\n | \"body2\"\r\n | \"body3\"\r\n | \"body4\"\r\n | \"textLabel1\"\r\n | \"textLabel2\"\r\n | \"textLabel3\"\r\n | \"textLabel4\";\r\n weight?: \"regular\" | \"medium\" | \"semiBold\" | \"bold\" | \"extraBold\" | \"light\";\r\n children: React.ReactNode;\r\n color?: string;\r\n align?: \"inherit\" | \"left\" | \"center\" | \"right\" | \"justify\";\r\n className?: string;\r\n}\r\n\r\nconst typographyStyles: Record<\r\n DoctTypographyProps[\"variant\"],\r\n { fontSize: string; tag: keyof React.JSX.IntrinsicElements }\r\n> = {\r\n h1: { fontSize: \"3.5rem\", tag: \"h1\" },\r\n h2: { fontSize: \"2.875rem\", tag: \"h2\" },\r\n h3: { fontSize: \"2.25rem\", tag: \"h3\" },\r\n h4: { fontSize: \"2rem\", tag: \"h4\" }, // 32px -> 2rem\r\n h5: { fontSize: \"1.75rem\", tag: \"h5\" }, // 28px -> 1.75rem\r\n h6: { fontSize: \"1.5rem\", tag: \"h6\" }, // 24px -> 1.5rem\r\n h7: { fontSize: \"1.25rem\", tag: \"p\" }, // 20px -> 1.25rem\r\n h8: { fontSize: \"1.125rem\", tag: \"p\" }, // 18px -> 1.125rem\r\n title1: { fontSize: \"1.375rem\", tag: \"p\" }, // 22px -> 1.375rem\r\n title2: { fontSize: \"1.125rem\", tag: \"p\" }, // 18px -> 1.125rem\r\n title3: { fontSize: \"0.875rem\", tag: \"p\" }, // 14px -> 0.875rem\r\n title4: { fontSize: \"0.75rem\", tag: \"p\" }, // 12px -> 0.75rem\r\n body1: { fontSize: \"1rem\", tag: \"p\" }, // 16px -> 1rem\r\n body2: { fontSize: \"0.875rem\", tag: \"p\" }, // 14px -> 0.875rem\r\n body3: { fontSize: \"0.75rem\", tag: \"p\" }, // 12px -> 0.75rem\r\n body4: { fontSize: \"0.625rem\", tag: \"p\" }, // 10px -> 0.625rem\r\n textLabel1: { fontSize: \"1rem\", tag: \"span\" }, // 16px -> 1rem\r\n textLabel2: { fontSize: \"0.875rem\", tag: \"span\" }, // 14px -> 0.875rem\r\n textLabel3: { fontSize: \"0.75rem\", tag: \"span\" }, // 12px -> 0.75rem\r\n textLabel4: { fontSize: \"0.6875rem\", tag: \"span\" }, // 11px -> 0.6875rem\r\n};\r\n\r\nconst fontWeights: Record<string, string> = {\r\n regular: \"400\",\r\n medium: \"500\",\r\n semiBold: \"600\",\r\n bold: \"700\",\r\n extraBold: \"800\",\r\n light: \"300\",\r\n};\r\n\r\nconst DoctTypography: React.FC<DoctTypographyProps> = ({\r\n variant,\r\n weight = \"regular\",\r\n children,\r\n color = \"#000\",\r\n align = \"inherit\",\r\n className = \"\",\r\n}) => {\r\n const typographyStyle = typographyStyles[variant] ?? {\r\n fontSize: \"16px\",\r\n tag: \"p\",\r\n };\r\n const { fontSize, tag: Tag } = typographyStyle;\r\n\r\n return (\r\n <Tag\r\n className={className}\r\n style={{\r\n fontSize,\r\n fontWeight: fontWeights[weight] ?? \"400\",\r\n color,\r\n textAlign: align,\r\n }}\r\n >\r\n {children}\r\n </Tag>\r\n );\r\n};\r\n\r\nexport { DoctTypography };\r\n"
12
- }
13
- ]
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "typography.test",
3
- "type": "registry:ui",
4
- "title": "Typography.test",
5
- "description": "Typography.test component",
6
- "dependencies": [],
7
- "files": [
8
- {
9
- "type": "registry:ui",
10
- "path": "components/ui/typography.test.tsx",
11
- "content": "import { render, screen } from \"@testing-library/react\";\r\nimport { DoctTypography } from \"./typography\";\r\nimport { describe, it, expect } from \"vitest\";\r\nimport '@testing-library/jest-dom';\r\n\r\ndescribe(\"Typography\", () => {\r\n it(\"renders children\", () => {\r\n render(<DoctTypography>Test Text</DoctTypography>);\r\n expect(screen.getByText(\"Test Text\")).toBeInTheDocument();\r\n });\r\n\r\n it(\"applies className\", () => {\r\n render(<DoctTypography className=\"custom-class\">Styled Text</DoctTypography>);\r\n expect(screen.getByText(\"Styled Text\")).toHaveClass(\"custom-class\");\r\n });\r\n}); "
12
- }
13
- ]
14
- }