@coston/ui 0.1.1 → 0.2.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 (177) hide show
  1. package/README.md +75 -10
  2. package/dist/{button-CJvoztqg.js → button-BJdMtkHX.js} +3 -3
  3. package/dist/button-BJdMtkHX.js.map +1 -0
  4. package/dist/{button-QxkOGnNm.d.ts → button-CyD56dqi.d.ts} +5 -5
  5. package/dist/{button-QxkOGnNm.d.ts.map → button-CyD56dqi.d.ts.map} +1 -1
  6. package/dist/components/accordion.d.ts.map +1 -1
  7. package/dist/components/accordion.js +4 -4
  8. package/dist/components/accordion.js.map +1 -1
  9. package/dist/components/alert-dialog.d.ts +3 -3
  10. package/dist/components/alert-dialog.d.ts.map +1 -1
  11. package/dist/components/alert-dialog.js +5 -5
  12. package/dist/components/alert-dialog.js.map +1 -1
  13. package/dist/components/alert.d.ts +2 -2
  14. package/dist/components/alert.js +3 -3
  15. package/dist/components/alert.js.map +1 -1
  16. package/dist/components/avatar.d.ts.map +1 -1
  17. package/dist/components/avatar.js +2 -2
  18. package/dist/components/avatar.js.map +1 -1
  19. package/dist/components/badge.d.ts +5 -5
  20. package/dist/components/badge.d.ts.map +1 -1
  21. package/dist/components/badge.js +4 -1
  22. package/dist/components/badge.js.map +1 -1
  23. package/dist/components/breadcrumb.d.ts +3 -3
  24. package/dist/components/breadcrumb.js +1 -1
  25. package/dist/components/button.d.ts +1 -1
  26. package/dist/components/button.js +2 -2
  27. package/dist/components/calendar.d.ts +2 -2
  28. package/dist/components/calendar.d.ts.map +1 -1
  29. package/dist/components/calendar.js +1 -1
  30. package/dist/components/card.d.ts +4 -1
  31. package/dist/components/card.d.ts.map +1 -1
  32. package/dist/components/card.js +5 -5
  33. package/dist/components/card.js.map +1 -1
  34. package/dist/components/carousel.d.ts +1 -1
  35. package/dist/components/carousel.js +2 -2
  36. package/dist/components/chart.d.ts +1 -1
  37. package/dist/components/chart.d.ts.map +1 -1
  38. package/dist/components/chart.js +1 -1
  39. package/dist/components/checkbox.js +3 -3
  40. package/dist/components/checkbox.js.map +1 -1
  41. package/dist/components/command.d.ts +75 -10
  42. package/dist/components/command.d.ts.map +1 -1
  43. package/dist/components/command.js +3 -3
  44. package/dist/components/command.js.map +1 -1
  45. package/dist/components/context-menu.d.ts +2 -2
  46. package/dist/components/context-menu.d.ts.map +1 -1
  47. package/dist/components/context-menu.js +3 -3
  48. package/dist/components/context-menu.js.map +1 -1
  49. package/dist/components/dialog.d.ts +3 -3
  50. package/dist/components/dialog.js +2 -2
  51. package/dist/components/drawer.d.ts +13 -11
  52. package/dist/components/drawer.d.ts.map +1 -1
  53. package/dist/components/drawer.js +2 -2
  54. package/dist/components/drawer.js.map +1 -1
  55. package/dist/components/dropdown-menu.d.ts +2 -2
  56. package/dist/components/dropdown-menu.d.ts.map +1 -1
  57. package/dist/components/dropdown-menu.js +3 -3
  58. package/dist/components/dropdown-menu.js.map +1 -1
  59. package/dist/components/hover-card.js +2 -2
  60. package/dist/components/hover-card.js.map +1 -1
  61. package/dist/components/input.js +1 -1
  62. package/dist/components/label.d.ts +2 -2
  63. package/dist/components/label.js +1 -1
  64. package/dist/components/menubar.d.ts +3 -3
  65. package/dist/components/menubar.js +4 -4
  66. package/dist/components/menubar.js.map +1 -1
  67. package/dist/components/navigation-menu.d.ts +2 -2
  68. package/dist/components/navigation-menu.js +2 -2
  69. package/dist/components/navigation-menu.js.map +1 -1
  70. package/dist/components/pagination.d.ts +7 -7
  71. package/dist/components/pagination.js +2 -2
  72. package/dist/components/popover.js +2 -2
  73. package/dist/components/popover.js.map +1 -1
  74. package/dist/components/progress.js +2 -2
  75. package/dist/components/progress.js.map +1 -1
  76. package/dist/components/radio-group.js +1 -1
  77. package/dist/components/resizable.d.ts +5 -5
  78. package/dist/components/resizable.d.ts.map +1 -1
  79. package/dist/components/resizable.js +4 -4
  80. package/dist/components/resizable.js.map +1 -1
  81. package/dist/components/scroll-area.js +1 -1
  82. package/dist/components/select.js +2 -2
  83. package/dist/components/select.js.map +1 -1
  84. package/dist/components/separator.js +2 -2
  85. package/dist/components/sheet.d.ts +6 -6
  86. package/dist/components/sheet.d.ts.map +1 -1
  87. package/dist/components/sheet.js +8 -8
  88. package/dist/components/sheet.js.map +1 -1
  89. package/dist/components/sidebar.d.ts +1 -1
  90. package/dist/components/sidebar.js +5 -5
  91. package/dist/components/sidebar.js.map +1 -1
  92. package/dist/components/skeleton.d.ts +2 -2
  93. package/dist/components/skeleton.js +1 -1
  94. package/dist/components/slider.js +3 -3
  95. package/dist/components/slider.js.map +1 -1
  96. package/dist/components/sonner.d.ts +2 -2
  97. package/dist/components/sonner.d.ts.map +1 -1
  98. package/dist/components/switch.js +3 -3
  99. package/dist/components/switch.js.map +1 -1
  100. package/dist/components/table.d.ts.map +1 -1
  101. package/dist/components/table.js +2 -2
  102. package/dist/components/table.js.map +1 -1
  103. package/dist/components/tabs.js +2 -2
  104. package/dist/components/tabs.js.map +1 -1
  105. package/dist/components/textarea.js +1 -1
  106. package/dist/components/toggle-group.d.ts +3 -3
  107. package/dist/components/toggle-group.js +2 -2
  108. package/dist/components/toggle.d.ts +3 -3
  109. package/dist/components/toggle.js +2 -2
  110. package/dist/components/tooltip.js +2 -2
  111. package/dist/{dialog-B_8jhMOs.js → dialog-COSqOqbH.js} +6 -6
  112. package/dist/dialog-COSqOqbH.js.map +1 -0
  113. package/dist/lib/utils.d.ts +2 -1
  114. package/dist/lib/utils.d.ts.map +1 -1
  115. package/dist/lib/utils.js +2 -2
  116. package/dist/{separator-9lzFsfCC.js → separator-C3mBJ8ik.js} +2 -2
  117. package/dist/{separator-9lzFsfCC.js.map → separator-C3mBJ8ik.js.map} +1 -1
  118. package/dist/{toggle-BpKiTVe4.js → toggle-CD9xIRlr.js} +3 -3
  119. package/dist/toggle-CD9xIRlr.js.map +1 -0
  120. package/dist/{tooltip-CXS6wR7g.js → tooltip-PxI7r4yP.js} +3 -3
  121. package/dist/tooltip-PxI7r4yP.js.map +1 -0
  122. package/dist/{utils-C0f9Ma6r.js → utils-CyPJ3VV3.js} +3 -2
  123. package/dist/utils-CyPJ3VV3.js.map +1 -0
  124. package/llms.txt +989 -0
  125. package/package.json +52 -14
  126. package/source.css +40 -0
  127. package/dist/button-CJvoztqg.js.map +0 -1
  128. package/dist/dialog-B_8jhMOs.js.map +0 -1
  129. package/dist/toggle-BpKiTVe4.js.map +0 -1
  130. package/dist/tooltip-CXS6wR7g.js.map +0 -1
  131. package/dist/utils-C0f9Ma6r.js.map +0 -1
  132. package/src/components/accordion.tsx +0 -51
  133. package/src/components/alert-dialog.tsx +0 -115
  134. package/src/components/alert.tsx +0 -49
  135. package/src/components/aspect-ratio.tsx +0 -5
  136. package/src/components/avatar.tsx +0 -44
  137. package/src/components/badge.tsx +0 -32
  138. package/src/components/breadcrumb.tsx +0 -101
  139. package/src/components/button.tsx +0 -48
  140. package/src/components/calendar.tsx +0 -76
  141. package/src/components/card.tsx +0 -60
  142. package/src/components/carousel.tsx +0 -240
  143. package/src/components/chart.tsx +0 -232
  144. package/src/components/checkbox.tsx +0 -25
  145. package/src/components/collapsible.tsx +0 -11
  146. package/src/components/command.tsx +0 -136
  147. package/src/components/context-menu.tsx +0 -187
  148. package/src/components/dialog.tsx +0 -105
  149. package/src/components/drawer.tsx +0 -98
  150. package/src/components/dropdown-menu.tsx +0 -185
  151. package/src/components/hover-card.tsx +0 -29
  152. package/src/components/input.tsx +0 -24
  153. package/src/components/label.tsx +0 -19
  154. package/src/components/menubar.tsx +0 -219
  155. package/src/components/navigation-menu.tsx +0 -120
  156. package/src/components/pagination.tsx +0 -98
  157. package/src/components/popover.tsx +0 -27
  158. package/src/components/progress.tsx +0 -23
  159. package/src/components/radio-group.tsx +0 -35
  160. package/src/components/resizable.tsx +0 -38
  161. package/src/components/scroll-area.tsx +0 -43
  162. package/src/components/select.tsx +0 -147
  163. package/src/components/separator.tsx +0 -23
  164. package/src/components/sheet.tsx +0 -122
  165. package/src/components/sidebar.tsx +0 -507
  166. package/src/components/skeleton.tsx +0 -7
  167. package/src/components/slider.tsx +0 -23
  168. package/src/components/sonner.tsx +0 -26
  169. package/src/components/switch.tsx +0 -26
  170. package/src/components/table.tsx +0 -95
  171. package/src/components/tabs.tsx +0 -53
  172. package/src/components/textarea.tsx +0 -20
  173. package/src/components/toggle-group.tsx +0 -54
  174. package/src/components/toggle.tsx +0 -40
  175. package/src/components/tooltip.tsx +0 -27
  176. package/src/hooks/use-mobile.tsx +0 -19
  177. package/src/lib/utils.ts +0 -6
@@ -1,98 +0,0 @@
1
- import * as React from 'react';
2
- import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';
3
-
4
- import { cn } from '../lib/utils';
5
- import { ButtonProps, buttonVariants } from './button';
6
-
7
- const Pagination = ({ className, ...props }: React.ComponentProps<'nav'>) => (
8
- <nav
9
- role="navigation"
10
- aria-label="pagination"
11
- className={cn('mx-auto flex w-full justify-center', className)}
12
- {...props}
13
- />
14
- );
15
- Pagination.displayName = 'Pagination';
16
-
17
- const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'>>(
18
- ({ className, ...props }, ref) => (
19
- <ul ref={ref} className={cn('flex flex-row items-center gap-1', className)} {...props} />
20
- )
21
- );
22
- PaginationContent.displayName = 'PaginationContent';
23
-
24
- const PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li'>>(
25
- ({ className, ...props }, ref) => <li ref={ref} className={cn('', className)} {...props} />
26
- );
27
- PaginationItem.displayName = 'PaginationItem';
28
-
29
- type PaginationLinkProps = {
30
- isActive?: boolean;
31
- } & Pick<ButtonProps, 'size'> &
32
- React.ComponentProps<'a'>;
33
-
34
- const PaginationLink = ({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) => (
35
- <a
36
- aria-current={isActive ? 'page' : undefined}
37
- className={cn(
38
- buttonVariants({
39
- variant: isActive ? 'default' : 'ghost',
40
- size,
41
- }),
42
- className
43
- )}
44
- {...props}
45
- />
46
- );
47
- PaginationLink.displayName = 'PaginationLink';
48
-
49
- const PaginationPrevious = ({
50
- className,
51
- ...props
52
- }: React.ComponentProps<typeof PaginationLink>) => (
53
- <PaginationLink
54
- aria-label="Go to previous page"
55
- size="default"
56
- className={cn('gap-1 pl-2.5', className)}
57
- {...props}
58
- >
59
- <ChevronLeft className="h-4 w-4" />
60
- <span>Previous</span>
61
- </PaginationLink>
62
- );
63
- PaginationPrevious.displayName = 'PaginationPrevious';
64
-
65
- const PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
66
- <PaginationLink
67
- aria-label="Go to next page"
68
- size="default"
69
- className={cn('gap-1 pr-2.5', className)}
70
- {...props}
71
- >
72
- <span>Next</span>
73
- <ChevronRight className="h-4 w-4" />
74
- </PaginationLink>
75
- );
76
- PaginationNext.displayName = 'PaginationNext';
77
-
78
- const PaginationEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => (
79
- <span
80
- aria-hidden
81
- className={cn('flex h-9 w-9 items-center justify-center', className)}
82
- {...props}
83
- >
84
- <MoreHorizontal className="h-4 w-4" />
85
- <span className="sr-only">More pages</span>
86
- </span>
87
- );
88
- PaginationEllipsis.displayName = 'PaginationEllipsis';
89
-
90
- export {
91
- Pagination,
92
- PaginationContent,
93
- PaginationItem,
94
- PaginationLink,
95
- PaginationPrevious,
96
- PaginationNext,
97
- PaginationEllipsis,
98
- };
@@ -1,27 +0,0 @@
1
- import * as React from 'react';
2
- import * as PopoverPrimitive from '@radix-ui/react-popover';
3
- import { cn } from '../lib/utils';
4
-
5
- const Popover = PopoverPrimitive.Root;
6
- const PopoverTrigger = PopoverPrimitive.Trigger;
7
-
8
- const PopoverContent = React.forwardRef<
9
- React.ComponentRef<typeof PopoverPrimitive.Content>,
10
- React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
11
- >(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (
12
- <PopoverPrimitive.Portal>
13
- <PopoverPrimitive.Content
14
- ref={ref}
15
- align={align}
16
- sideOffset={sideOffset}
17
- className={cn(
18
- '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 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
19
- className
20
- )}
21
- {...props}
22
- />
23
- </PopoverPrimitive.Portal>
24
- ));
25
- PopoverContent.displayName = PopoverPrimitive.Content.displayName;
26
-
27
- export { Popover, PopoverTrigger, PopoverContent };
@@ -1,23 +0,0 @@
1
- import * as React from 'react';
2
- import * as ProgressPrimitive from '@radix-ui/react-progress';
3
-
4
- import { cn } from '../lib/utils';
5
-
6
- const Progress = React.forwardRef<
7
- React.ElementRef<typeof ProgressPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
9
- >(({ className, value, ...props }, ref) => (
10
- <ProgressPrimitive.Root
11
- ref={ref}
12
- className={cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className)}
13
- {...props}
14
- >
15
- <ProgressPrimitive.Indicator
16
- className="h-full w-full flex-1 bg-primary transition-all"
17
- style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
18
- />
19
- </ProgressPrimitive.Root>
20
- ));
21
- Progress.displayName = ProgressPrimitive.Root.displayName;
22
-
23
- export { Progress };
@@ -1,35 +0,0 @@
1
- import * as React from 'react';
2
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
3
- import { Circle } from 'lucide-react';
4
- import { cn } from '../lib/utils';
5
-
6
- const RadioGroup = React.forwardRef<
7
- React.ComponentRef<typeof RadioGroupPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
9
- >(({ className, ...props }, ref) => {
10
- return <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={ref} />;
11
- });
12
- RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
13
-
14
- const RadioGroupItem = React.forwardRef<
15
- React.ComponentRef<typeof RadioGroupPrimitive.Item>,
16
- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
17
- >(({ className, ...props }, ref) => {
18
- return (
19
- <RadioGroupPrimitive.Item
20
- ref={ref}
21
- className={cn(
22
- 'aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
23
- className
24
- )}
25
- {...props}
26
- >
27
- <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
28
- <Circle className="h-2.5 w-2.5 fill-current text-current" />
29
- </RadioGroupPrimitive.Indicator>
30
- </RadioGroupPrimitive.Item>
31
- );
32
- });
33
- RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
34
-
35
- export { RadioGroup, RadioGroupItem };
@@ -1,38 +0,0 @@
1
- import * as React from 'react';
2
- import { GripVertical } from 'lucide-react';
3
- import { Group, Panel, Separator } from 'react-resizable-panels';
4
-
5
- import { cn } from '../lib/utils';
6
-
7
- const ResizablePanelGroup = ({ className, ...props }: React.ComponentProps<typeof Group>) => (
8
- <Group
9
- className={cn('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className)}
10
- {...props}
11
- />
12
- );
13
-
14
- const ResizablePanel = Panel;
15
-
16
- const ResizableHandle = ({
17
- withHandle,
18
- className,
19
- ...props
20
- }: React.ComponentProps<typeof Separator> & {
21
- withHandle?: boolean;
22
- }) => (
23
- <Separator
24
- className={cn(
25
- 'relative flex w-px items-center justify-center bg-border/40 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90',
26
- className
27
- )}
28
- {...props}
29
- >
30
- {withHandle && (
31
- <div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
32
- <GripVertical className="h-2.5 w-2.5" />
33
- </div>
34
- )}
35
- </Separator>
36
- );
37
-
38
- export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
@@ -1,43 +0,0 @@
1
- import * as React from 'react';
2
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
3
- import { cn } from '../lib/utils';
4
-
5
- const ScrollArea = React.forwardRef<
6
- React.ComponentRef<typeof ScrollAreaPrimitive.Root>,
7
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
8
- >(({ className, children, ...props }, ref) => (
9
- <ScrollAreaPrimitive.Root
10
- ref={ref}
11
- className={cn('relative overflow-hidden', className)}
12
- {...props}
13
- >
14
- <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
15
- {children}
16
- </ScrollAreaPrimitive.Viewport>
17
- <ScrollBar />
18
- <ScrollAreaPrimitive.Corner />
19
- </ScrollAreaPrimitive.Root>
20
- ));
21
- ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
22
-
23
- const ScrollBar = React.forwardRef<
24
- React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
25
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
26
- >(({ className, orientation = 'vertical', ...props }, ref) => (
27
- <ScrollAreaPrimitive.ScrollAreaScrollbar
28
- ref={ref}
29
- orientation={orientation}
30
- className={cn(
31
- 'flex touch-none select-none transition-colors',
32
- orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent p-[1px]',
33
- orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent p-[1px]',
34
- className
35
- )}
36
- {...props}
37
- >
38
- <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
39
- </ScrollAreaPrimitive.ScrollAreaScrollbar>
40
- ));
41
- ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
42
-
43
- export { ScrollArea, ScrollBar };
@@ -1,147 +0,0 @@
1
- import * as React from 'react';
2
- import * as SelectPrimitive from '@radix-ui/react-select';
3
- import { Check, ChevronDown, ChevronUp } from 'lucide-react';
4
- import { cn } from '../lib/utils';
5
-
6
- const Select = SelectPrimitive.Root;
7
- const SelectGroup = SelectPrimitive.Group;
8
- const SelectValue = SelectPrimitive.Value;
9
-
10
- const SelectTrigger = React.forwardRef<
11
- React.ComponentRef<typeof SelectPrimitive.Trigger>,
12
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
13
- >(({ className, children, ...props }, ref) => (
14
- <SelectPrimitive.Trigger
15
- ref={ref}
16
- className={cn(
17
- 'flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
18
- className
19
- )}
20
- {...props}
21
- >
22
- {children}
23
- <SelectPrimitive.Icon asChild>
24
- <ChevronDown className="h-4 w-4 opacity-50" />
25
- </SelectPrimitive.Icon>
26
- </SelectPrimitive.Trigger>
27
- ));
28
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
29
-
30
- const SelectScrollUpButton = React.forwardRef<
31
- React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,
32
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
33
- >(({ className, ...props }, ref) => (
34
- <SelectPrimitive.ScrollUpButton
35
- ref={ref}
36
- className={cn('flex cursor-default items-center justify-center py-1', className)}
37
- {...props}
38
- >
39
- <ChevronUp className="h-4 w-4" />
40
- </SelectPrimitive.ScrollUpButton>
41
- ));
42
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
43
-
44
- const SelectScrollDownButton = React.forwardRef<
45
- React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,
46
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
47
- >(({ className, ...props }, ref) => (
48
- <SelectPrimitive.ScrollDownButton
49
- ref={ref}
50
- className={cn('flex cursor-default items-center justify-center py-1', className)}
51
- {...props}
52
- >
53
- <ChevronDown className="h-4 w-4" />
54
- </SelectPrimitive.ScrollDownButton>
55
- ));
56
- SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
57
-
58
- const SelectContent = React.forwardRef<
59
- React.ComponentRef<typeof SelectPrimitive.Content>,
60
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
61
- >(({ className, children, position = 'popper', ...props }, ref) => (
62
- <SelectPrimitive.Portal>
63
- <SelectPrimitive.Content
64
- ref={ref}
65
- className={cn(
66
- 'relative z-50 max-h-96 min-w-[8rem] overflow-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',
67
- position === 'popper' &&
68
- 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
69
- className
70
- )}
71
- position={position}
72
- {...props}
73
- >
74
- <SelectScrollUpButton />
75
- <SelectPrimitive.Viewport
76
- className={cn(
77
- 'p-1',
78
- position === 'popper' &&
79
- 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'
80
- )}
81
- >
82
- {children}
83
- </SelectPrimitive.Viewport>
84
- <SelectScrollDownButton />
85
- </SelectPrimitive.Content>
86
- </SelectPrimitive.Portal>
87
- ));
88
- SelectContent.displayName = SelectPrimitive.Content.displayName;
89
-
90
- const SelectLabel = React.forwardRef<
91
- React.ComponentRef<typeof SelectPrimitive.Label>,
92
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
93
- >(({ className, ...props }, ref) => (
94
- <SelectPrimitive.Label
95
- ref={ref}
96
- className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)}
97
- {...props}
98
- />
99
- ));
100
- SelectLabel.displayName = SelectPrimitive.Label.displayName;
101
-
102
- const SelectItem = React.forwardRef<
103
- React.ComponentRef<typeof SelectPrimitive.Item>,
104
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
105
- >(({ className, children, ...props }, ref) => (
106
- <SelectPrimitive.Item
107
- ref={ref}
108
- className={cn(
109
- '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',
110
- className
111
- )}
112
- {...props}
113
- >
114
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
115
- <SelectPrimitive.ItemIndicator>
116
- <Check className="h-4 w-4" />
117
- </SelectPrimitive.ItemIndicator>
118
- </span>
119
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
120
- </SelectPrimitive.Item>
121
- ));
122
- SelectItem.displayName = SelectPrimitive.Item.displayName;
123
-
124
- const SelectSeparator = React.forwardRef<
125
- React.ComponentRef<typeof SelectPrimitive.Separator>,
126
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
127
- >(({ className, ...props }, ref) => (
128
- <SelectPrimitive.Separator
129
- ref={ref}
130
- className={cn('-mx-1 my-1 h-px bg-muted', className)}
131
- {...props}
132
- />
133
- ));
134
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
135
-
136
- export {
137
- Select,
138
- SelectGroup,
139
- SelectValue,
140
- SelectTrigger,
141
- SelectContent,
142
- SelectLabel,
143
- SelectItem,
144
- SelectSeparator,
145
- SelectScrollUpButton,
146
- SelectScrollDownButton,
147
- };
@@ -1,23 +0,0 @@
1
- import * as React from 'react';
2
- import * as SeparatorPrimitive from '@radix-ui/react-separator';
3
- import { cn } from '../lib/utils';
4
-
5
- const Separator = React.forwardRef<
6
- React.ComponentRef<typeof SeparatorPrimitive.Root>,
7
- React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
8
- >(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
9
- <SeparatorPrimitive.Root
10
- ref={ref}
11
- decorative={decorative}
12
- orientation={orientation}
13
- className={cn(
14
- 'shrink-0 bg-border',
15
- orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
16
- className
17
- )}
18
- {...props}
19
- />
20
- ));
21
- Separator.displayName = SeparatorPrimitive.Root.displayName;
22
-
23
- export { Separator };
@@ -1,122 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import * as SheetPrimitive from '@radix-ui/react-dialog';
5
- import { cva, type VariantProps } from 'class-variance-authority';
6
- import { X } from 'lucide-react';
7
-
8
- import { cn } from '../lib/utils';
9
-
10
- const Sheet = SheetPrimitive.Root;
11
-
12
- const SheetTrigger = SheetPrimitive.Trigger;
13
-
14
- const SheetClose = SheetPrimitive.Close;
15
-
16
- const SheetPortal = SheetPrimitive.Portal;
17
-
18
- const SheetOverlay = React.forwardRef<
19
- React.ElementRef<typeof SheetPrimitive.Overlay>,
20
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
21
- >(({ className, ...props }, ref) => (
22
- <SheetPrimitive.Overlay
23
- className={cn(
24
- 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
25
- className
26
- )}
27
- {...props}
28
- ref={ref}
29
- />
30
- ));
31
- SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
32
-
33
- const sheetVariants = cva(
34
- 'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
35
- {
36
- variants: {
37
- side: {
38
- top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
39
- bottom:
40
- 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
41
- left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
42
- right:
43
- 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
44
- },
45
- },
46
- defaultVariants: {
47
- side: 'right',
48
- },
49
- }
50
- );
51
-
52
- interface SheetContentProps
53
- extends
54
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
55
- VariantProps<typeof sheetVariants> {}
56
-
57
- const SheetContent = React.forwardRef<
58
- React.ElementRef<typeof SheetPrimitive.Content>,
59
- SheetContentProps
60
- >(({ side = 'right', className, children, ...props }, ref) => (
61
- <SheetPortal>
62
- <SheetOverlay />
63
- <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
64
- {children}
65
- <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
66
- <X className="h-4 w-4" />
67
- <span className="sr-only">Close</span>
68
- </SheetPrimitive.Close>
69
- </SheetPrimitive.Content>
70
- </SheetPortal>
71
- ));
72
- SheetContent.displayName = SheetPrimitive.Content.displayName;
73
-
74
- const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
75
- <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />
76
- );
77
- SheetHeader.displayName = 'SheetHeader';
78
-
79
- const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
80
- <div
81
- className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}
82
- {...props}
83
- />
84
- );
85
- SheetFooter.displayName = 'SheetFooter';
86
-
87
- const SheetTitle = React.forwardRef<
88
- React.ElementRef<typeof SheetPrimitive.Title>,
89
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
90
- >(({ className, ...props }, ref) => (
91
- <SheetPrimitive.Title
92
- ref={ref}
93
- className={cn('text-lg font-semibold text-foreground', className)}
94
- {...props}
95
- />
96
- ));
97
- SheetTitle.displayName = SheetPrimitive.Title.displayName;
98
-
99
- const SheetDescription = React.forwardRef<
100
- React.ElementRef<typeof SheetPrimitive.Description>,
101
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
102
- >(({ className, ...props }, ref) => (
103
- <SheetPrimitive.Description
104
- ref={ref}
105
- className={cn('text-sm text-muted-foreground', className)}
106
- {...props}
107
- />
108
- ));
109
- SheetDescription.displayName = SheetPrimitive.Description.displayName;
110
-
111
- export {
112
- Sheet,
113
- SheetPortal,
114
- SheetOverlay,
115
- SheetTrigger,
116
- SheetClose,
117
- SheetContent,
118
- SheetHeader,
119
- SheetFooter,
120
- SheetTitle,
121
- SheetDescription,
122
- };