@syscore/ui-library 1.0.0 → 1.0.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 (55) hide show
  1. package/client/components/ui/accordion.tsx +56 -0
  2. package/client/components/ui/alert-dialog.tsx +139 -0
  3. package/client/components/ui/alert.tsx +59 -0
  4. package/client/components/ui/aspect-ratio.tsx +5 -0
  5. package/client/components/ui/avatar.tsx +48 -0
  6. package/client/components/ui/badge.tsx +36 -0
  7. package/client/components/ui/breadcrumb.tsx +115 -0
  8. package/client/components/ui/button.tsx +56 -0
  9. package/client/components/ui/calendar.tsx +68 -0
  10. package/client/components/ui/card.tsx +86 -0
  11. package/client/components/ui/carousel.tsx +260 -0
  12. package/client/components/ui/chart.tsx +363 -0
  13. package/client/components/ui/checkbox.tsx +28 -0
  14. package/client/components/ui/collapsible.tsx +9 -0
  15. package/client/components/ui/command.tsx +153 -0
  16. package/client/components/ui/context-menu.tsx +198 -0
  17. package/client/components/ui/dialog.tsx +120 -0
  18. package/client/components/ui/drawer.tsx +116 -0
  19. package/client/components/ui/dropdown-menu.tsx +198 -0
  20. package/client/components/ui/form.tsx +177 -0
  21. package/client/components/ui/hover-card.tsx +27 -0
  22. package/client/components/ui/input-otp.tsx +69 -0
  23. package/client/components/ui/input.tsx +22 -0
  24. package/client/components/ui/label.tsx +24 -0
  25. package/client/components/ui/menubar.tsx +234 -0
  26. package/client/components/ui/navigation-menu.tsx +128 -0
  27. package/client/components/ui/pagination.tsx +117 -0
  28. package/client/components/ui/popover.tsx +29 -0
  29. package/client/components/ui/progress.tsx +26 -0
  30. package/client/components/ui/radio-group.tsx +42 -0
  31. package/client/components/ui/resizable.tsx +43 -0
  32. package/client/components/ui/scroll-area.tsx +46 -0
  33. package/client/components/ui/select.tsx +158 -0
  34. package/client/components/ui/separator.tsx +29 -0
  35. package/client/components/ui/sheet.tsx +138 -0
  36. package/client/components/ui/sidebar.tsx +769 -0
  37. package/client/components/ui/skeleton.tsx +15 -0
  38. package/client/components/ui/slider.tsx +26 -0
  39. package/client/components/ui/sonner.tsx +29 -0
  40. package/client/components/ui/switch.tsx +27 -0
  41. package/client/components/ui/table.tsx +117 -0
  42. package/client/components/ui/tabs.tsx +53 -0
  43. package/client/components/ui/textarea.tsx +24 -0
  44. package/client/components/ui/toast.tsx +127 -0
  45. package/client/components/ui/toaster.tsx +33 -0
  46. package/client/components/ui/toggle-group.tsx +59 -0
  47. package/client/components/ui/toggle.tsx +43 -0
  48. package/client/components/ui/tooltip.tsx +28 -0
  49. package/client/components/ui/use-toast.ts +3 -0
  50. package/client/lib/utils.spec.ts +32 -0
  51. package/client/lib/utils.ts +6 -0
  52. package/dist/ui/index.cjs.js +1 -54
  53. package/dist/ui/index.d.ts +677 -0
  54. package/dist/ui/index.es.js +2790 -35587
  55. package/package.json +6 -4
@@ -0,0 +1,158 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ import { Check, ChevronDown, ChevronUp } from "lucide-react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ const Select = SelectPrimitive.Root;
8
+
9
+ const SelectGroup = SelectPrimitive.Group;
10
+
11
+ const SelectValue = SelectPrimitive.Value;
12
+
13
+ const SelectTrigger = React.forwardRef<
14
+ React.ElementRef<typeof SelectPrimitive.Trigger>,
15
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
16
+ >(({ className, children, ...props }, ref) => (
17
+ <SelectPrimitive.Trigger
18
+ ref={ref}
19
+ className={cn(
20
+ "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",
21
+ className,
22
+ )}
23
+ {...props}
24
+ >
25
+ {children}
26
+ <SelectPrimitive.Icon asChild>
27
+ <ChevronDown className="h-4 w-4 opacity-50" />
28
+ </SelectPrimitive.Icon>
29
+ </SelectPrimitive.Trigger>
30
+ ));
31
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
32
+
33
+ const SelectScrollUpButton = React.forwardRef<
34
+ React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
35
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
36
+ >(({ className, ...props }, ref) => (
37
+ <SelectPrimitive.ScrollUpButton
38
+ ref={ref}
39
+ className={cn(
40
+ "flex cursor-default items-center justify-center py-1",
41
+ className,
42
+ )}
43
+ {...props}
44
+ >
45
+ <ChevronUp className="h-4 w-4" />
46
+ </SelectPrimitive.ScrollUpButton>
47
+ ));
48
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
49
+
50
+ const SelectScrollDownButton = React.forwardRef<
51
+ React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
52
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
53
+ >(({ className, ...props }, ref) => (
54
+ <SelectPrimitive.ScrollDownButton
55
+ ref={ref}
56
+ className={cn(
57
+ "flex cursor-default items-center justify-center py-1",
58
+ className,
59
+ )}
60
+ {...props}
61
+ >
62
+ <ChevronDown className="h-4 w-4" />
63
+ </SelectPrimitive.ScrollDownButton>
64
+ ));
65
+ SelectScrollDownButton.displayName =
66
+ SelectPrimitive.ScrollDownButton.displayName;
67
+
68
+ const SelectContent = React.forwardRef<
69
+ React.ElementRef<typeof SelectPrimitive.Content>,
70
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
71
+ >(({ className, children, position = "popper", ...props }, ref) => (
72
+ <SelectPrimitive.Portal>
73
+ <SelectPrimitive.Content
74
+ ref={ref}
75
+ className={cn(
76
+ "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 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",
77
+ position === "popper" &&
78
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
79
+ className,
80
+ )}
81
+ position={position}
82
+ {...props}
83
+ >
84
+ <SelectScrollUpButton />
85
+ <SelectPrimitive.Viewport
86
+ className={cn(
87
+ "p-1",
88
+ position === "popper" &&
89
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
90
+ )}
91
+ >
92
+ {children}
93
+ </SelectPrimitive.Viewport>
94
+ <SelectScrollDownButton />
95
+ </SelectPrimitive.Content>
96
+ </SelectPrimitive.Portal>
97
+ ));
98
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
99
+
100
+ const SelectLabel = React.forwardRef<
101
+ React.ElementRef<typeof SelectPrimitive.Label>,
102
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
103
+ >(({ className, ...props }, ref) => (
104
+ <SelectPrimitive.Label
105
+ ref={ref}
106
+ className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
107
+ {...props}
108
+ />
109
+ ));
110
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
111
+
112
+ const SelectItem = React.forwardRef<
113
+ React.ElementRef<typeof SelectPrimitive.Item>,
114
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
115
+ >(({ className, children, ...props }, ref) => (
116
+ <SelectPrimitive.Item
117
+ ref={ref}
118
+ className={cn(
119
+ "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",
120
+ className,
121
+ )}
122
+ {...props}
123
+ >
124
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
125
+ <SelectPrimitive.ItemIndicator>
126
+ <Check className="h-4 w-4" />
127
+ </SelectPrimitive.ItemIndicator>
128
+ </span>
129
+
130
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
131
+ </SelectPrimitive.Item>
132
+ ));
133
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
134
+
135
+ const SelectSeparator = React.forwardRef<
136
+ React.ElementRef<typeof SelectPrimitive.Separator>,
137
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
138
+ >(({ className, ...props }, ref) => (
139
+ <SelectPrimitive.Separator
140
+ ref={ref}
141
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
142
+ {...props}
143
+ />
144
+ ));
145
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
146
+
147
+ export {
148
+ Select,
149
+ SelectGroup,
150
+ SelectValue,
151
+ SelectTrigger,
152
+ SelectContent,
153
+ SelectLabel,
154
+ SelectItem,
155
+ SelectSeparator,
156
+ SelectScrollUpButton,
157
+ SelectScrollDownButton,
158
+ };
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const Separator = React.forwardRef<
7
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
8
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
9
+ >(
10
+ (
11
+ { className, orientation = "horizontal", decorative = true, ...props },
12
+ ref,
13
+ ) => (
14
+ <SeparatorPrimitive.Root
15
+ ref={ref}
16
+ decorative={decorative}
17
+ orientation={orientation}
18
+ className={cn(
19
+ "shrink-0 bg-border",
20
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
21
+ className,
22
+ )}
23
+ {...props}
24
+ />
25
+ ),
26
+ );
27
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
28
+
29
+ export { Separator };
@@ -0,0 +1,138 @@
1
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { X } from "lucide-react";
4
+ import * as React from "react";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ const Sheet = SheetPrimitive.Root;
9
+
10
+ const SheetTrigger = SheetPrimitive.Trigger;
11
+
12
+ const SheetClose = SheetPrimitive.Close;
13
+
14
+ const SheetPortal = SheetPrimitive.Portal;
15
+
16
+ const SheetOverlay = React.forwardRef<
17
+ React.ElementRef<typeof SheetPrimitive.Overlay>,
18
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
19
+ >(({ className, ...props }, ref) => (
20
+ <SheetPrimitive.Overlay
21
+ className={cn(
22
+ "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",
23
+ className,
24
+ )}
25
+ {...props}
26
+ ref={ref}
27
+ />
28
+ ));
29
+ SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
30
+
31
+ const sheetVariants = cva(
32
+ "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",
33
+ {
34
+ variants: {
35
+ side: {
36
+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
37
+ bottom:
38
+ "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
39
+ 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",
40
+ right:
41
+ "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",
42
+ },
43
+ },
44
+ defaultVariants: {
45
+ side: "right",
46
+ },
47
+ },
48
+ );
49
+
50
+ interface SheetContentProps
51
+ extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
52
+ VariantProps<typeof sheetVariants> {}
53
+
54
+ const SheetContent = React.forwardRef<
55
+ React.ElementRef<typeof SheetPrimitive.Content>,
56
+ SheetContentProps
57
+ >(({ side = "right", className, children, ...props }, ref) => (
58
+ <SheetPortal>
59
+ <SheetOverlay />
60
+ <SheetPrimitive.Content
61
+ ref={ref}
62
+ className={cn(sheetVariants({ side }), className)}
63
+ {...props}
64
+ >
65
+ {children}
66
+ <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">
67
+ <X className="h-4 w-4" />
68
+ <span className="sr-only">Close</span>
69
+ </SheetPrimitive.Close>
70
+ </SheetPrimitive.Content>
71
+ </SheetPortal>
72
+ ));
73
+ SheetContent.displayName = SheetPrimitive.Content.displayName;
74
+
75
+ const SheetHeader = ({
76
+ className,
77
+ ...props
78
+ }: React.HTMLAttributes<HTMLDivElement>) => (
79
+ <div
80
+ className={cn(
81
+ "flex flex-col space-y-2 text-center sm:text-left",
82
+ className,
83
+ )}
84
+ {...props}
85
+ />
86
+ );
87
+ SheetHeader.displayName = "SheetHeader";
88
+
89
+ const SheetFooter = ({
90
+ className,
91
+ ...props
92
+ }: React.HTMLAttributes<HTMLDivElement>) => (
93
+ <div
94
+ className={cn(
95
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
96
+ className,
97
+ )}
98
+ {...props}
99
+ />
100
+ );
101
+ SheetFooter.displayName = "SheetFooter";
102
+
103
+ const SheetTitle = React.forwardRef<
104
+ React.ElementRef<typeof SheetPrimitive.Title>,
105
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
106
+ >(({ className, ...props }, ref) => (
107
+ <SheetPrimitive.Title
108
+ ref={ref}
109
+ className={cn("text-lg font-semibold text-foreground", className)}
110
+ {...props}
111
+ />
112
+ ));
113
+ SheetTitle.displayName = SheetPrimitive.Title.displayName;
114
+
115
+ const SheetDescription = React.forwardRef<
116
+ React.ElementRef<typeof SheetPrimitive.Description>,
117
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
118
+ >(({ className, ...props }, ref) => (
119
+ <SheetPrimitive.Description
120
+ ref={ref}
121
+ className={cn("text-sm text-muted-foreground", className)}
122
+ {...props}
123
+ />
124
+ ));
125
+ SheetDescription.displayName = SheetPrimitive.Description.displayName;
126
+
127
+ export {
128
+ Sheet,
129
+ SheetClose,
130
+ SheetContent,
131
+ SheetDescription,
132
+ SheetFooter,
133
+ SheetHeader,
134
+ SheetOverlay,
135
+ SheetPortal,
136
+ SheetTitle,
137
+ SheetTrigger,
138
+ };