@c-rex/ui 0.0.4 → 0.0.6

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 (53) hide show
  1. package/dist/ui/src/alert.d.ts +1 -1
  2. package/dist/ui/src/alert.d.ts.map +1 -1
  3. package/dist/ui/src/button.d.ts +1 -1
  4. package/dist/ui/src/button.d.ts.map +1 -1
  5. package/dist/ui/src/sheet.d.ts +1 -1
  6. package/dist/ui/src/sheet.d.ts.map +1 -1
  7. package/dist/ui/src/sidebar.d.ts +1 -1
  8. package/dist/ui/src/sidebar.d.ts.map +1 -1
  9. package/package.json +17 -16
  10. package/src/alert.tsx +58 -0
  11. package/src/breadcrumb.tsx +115 -0
  12. package/src/button.tsx +66 -0
  13. package/src/command.tsx +151 -0
  14. package/src/dialog.tsx +122 -0
  15. package/src/hooks/use-mobile.tsx +19 -0
  16. package/src/input.tsx +22 -0
  17. package/src/popover.tsx +31 -0
  18. package/src/select.tsx +157 -0
  19. package/src/separator.tsx +29 -0
  20. package/src/sheet.tsx +140 -0
  21. package/src/sidebar.tsx +785 -0
  22. package/src/skeleton.tsx +15 -0
  23. package/src/table.tsx +120 -0
  24. package/src/tooltip.tsx +30 -0
  25. package/dist/constants/src/index.js +0 -30
  26. package/dist/interfaces/src/common.js +0 -2
  27. package/dist/interfaces/src/config.js +0 -2
  28. package/dist/interfaces/src/directoryNodes.js +0 -2
  29. package/dist/interfaces/src/documentTypes.js +0 -2
  30. package/dist/interfaces/src/index.js +0 -22
  31. package/dist/interfaces/src/informationUnits.js +0 -2
  32. package/dist/interfaces/src/treeOfContent.js +0 -2
  33. package/dist/types/src/index.js +0 -2
  34. package/dist/ui/src/alert.js +0 -60
  35. package/dist/ui/src/breadcrumb.js +0 -65
  36. package/dist/ui/src/button.js +0 -79
  37. package/dist/ui/src/command.js +0 -72
  38. package/dist/ui/src/dialog.js +0 -68
  39. package/dist/ui/src/hooks/use-mobile.js +0 -18
  40. package/dist/ui/src/input.js +0 -44
  41. package/dist/ui/src/popover.js +0 -49
  42. package/dist/ui/src/select.js +0 -71
  43. package/dist/ui/src/separator.js +0 -43
  44. package/dist/ui/src/sheet.js +0 -82
  45. package/dist/ui/src/sidebar.js +0 -292
  46. package/dist/ui/src/skeleton.js +0 -8
  47. package/dist/ui/src/table.js +0 -63
  48. package/dist/ui/src/tooltip.js +0 -49
  49. package/dist/utils/src/breadcrumbs.js +0 -14
  50. package/dist/utils/src/classMerge.js +0 -8
  51. package/dist/utils/src/index.js +0 -20
  52. package/dist/utils/src/treeOfContent.js +0 -85
  53. package/dist/utils/src/utils.js +0 -37
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
4
4
  variant?: "default" | "destructive" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
5
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
6
6
  declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
7
7
  declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
8
8
  export { Alert, AlertTitle, AlertDescription };
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAmBlE,QAAA,MAAM,KAAK;;sHAUT,CAAC;AAGH,QAAA,MAAM,UAAU,uHASd,CAAC;AAGH,QAAA,MAAM,gBAAgB,yHASpB,CAAC;AAGH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAmBlE,QAAA,MAAM,KAAK;;2HAUT,CAAC;AAGH,QAAA,MAAM,UAAU,uHASd,CAAC;AAGH,QAAA,MAAM,gBAAgB,yHASpB,CAAC;AAGH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC"}
@@ -4,7 +4,7 @@ declare const buttonVariants: (props?: ({
4
4
  variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
5
5
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
6
  rounded?: "default" | "sm" | "lg" | "xl" | "2xl" | "full" | null | undefined;
7
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
8
8
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
9
9
  asChild?: boolean;
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;;8EAqCnB,CAAC;AAEF,MAAM,WAAW,WACb,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACrD,YAAY,CAAC,OAAO,cAAc,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,MAAM,uFAWX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;;mFAqCnB,CAAC;AAEF,MAAM,WAAW,WACb,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACrD,YAAY,CAAC,OAAO,cAAc,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,MAAM,uFAWX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -8,7 +8,7 @@ declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
8
8
  declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
9
  declare const sheetVariants: (props?: ({
10
10
  side?: "top" | "right" | "bottom" | "left" | null | undefined;
11
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
12
12
  interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
13
13
  }
14
14
  declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../src/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,KAAK,sCAAsB,CAAC;AAElC,QAAA,MAAM,YAAY,6GAAyB,C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,OAAO,CAAC,EACrE,YAAY,CAAC,OAAO,aAAa,CAAC;CAAI;AAE1C,QAAA,MAAM,YAAY,0FAkBhB,CAAC;AAGH,QAAA,MAAM,WAAW;8BAGd,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,WAAW;8BAGd,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,UAAU,mKASd,CAAC;AAGH,QAAA,MAAM,gBAAgB,6KASpB,CAAC;AAGH,OAAO,EACH,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,GACnB,CAAC"}
@@ -47,7 +47,7 @@ declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<React.Clas
47
47
  } & VariantProps<(props?: ({
48
48
  variant?: "default" | "outline" | null | undefined;
49
49
  size?: "default" | "sm" | "lg" | null | undefined;
50
- } & import("class-variance-authority/types").ClassProp) | undefined) => string>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
50
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
51
51
  declare const SidebarMenuAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
52
52
  asChild?: boolean;
53
53
  showOnHover?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAe7D,OAAO,EAEH,cAAc,EAGjB,MAAM,WAAW,CAAC;AASnB,KAAK,cAAc,GAAG;IAClB,KAAK,EAAE,UAAU,GAAG,WAAW,CAAC;IAChC,IAAI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kB,kKAG6B,CAAC;AAGtD,QAAA,MAAM,oBAAoB;cAGR,OAAO;WACV,IAAI,GAAG,IAAI;eACP,OAAO;mDAuBxB,CAAC;AAGH,OAAO,EACH,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,UAAU,GACb,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@c-rex/ui",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "files": [
5
+ "src",
5
6
  "dist"
6
7
  ],
7
8
  "publishConfig": {
@@ -9,63 +10,63 @@
9
10
  },
10
11
  "exports": {
11
12
  "./alert": {
12
- "types": "./src/alert.tsx",
13
+ "types": "./dist/alert.d.ts",
13
14
  "import": "./src/alert.tsx"
14
15
  },
15
16
  "./breadcrumb": {
16
- "types": "./src/breadcrumb.tsx",
17
+ "types": "./dist/breadcrumb.d.ts",
17
18
  "import": "./src/breadcrumb.tsx"
18
19
  },
19
20
  "./button": {
20
- "types": "./src/button.tsx",
21
+ "types": "./dist/button.d.ts",
21
22
  "import": "./src/button.tsx"
22
23
  },
23
24
  "./command": {
24
- "types": "./src/command.tsx",
25
+ "types": "./dist/command.d.ts",
25
26
  "import": "./src/command.tsx"
26
27
  },
27
28
  "./dialog": {
28
- "types": "./src/dialog.tsx",
29
+ "types": "./dist/dialog.d.ts",
29
30
  "import": "./src/dialog.tsx"
30
31
  },
31
32
  "./hooks/use-mobile": {
32
- "types": "./src/hooks/use-mobile.tsx",
33
+ "types": "./dist/hooks/use-mobile.d.ts",
33
34
  "import": "./src/hooks/use-mobile.tsx"
34
35
  },
35
36
  "./input": {
36
- "types": "./src/input.tsx",
37
+ "types": "./dist/input.d.ts",
37
38
  "import": "./src/input.tsx"
38
39
  },
39
40
  "./popover": {
40
- "types": "./src/popover.tsx",
41
+ "types": "./dist/popover.d.ts",
41
42
  "import": "./src/popover.tsx"
42
43
  },
43
44
  "./select": {
44
- "types": "./src/select.tsx",
45
+ "types": "./dist/select.d.ts",
45
46
  "import": "./src/select.tsx"
46
47
  },
47
48
  "./separator": {
48
- "types": "./src/separator.tsx",
49
+ "types": "./dist/separator.d.ts",
49
50
  "import": "./src/separator.tsx"
50
51
  },
51
52
  "./sheet": {
52
- "types": "./src/sheet.tsx",
53
+ "types": "./dist/sheet.d.ts",
53
54
  "import": "./src/sheet.tsx"
54
55
  },
55
56
  "./sidebar": {
56
- "types": "./src/sidebar.tsx",
57
+ "types": "./dist/sidebar.d.ts",
57
58
  "import": "./src/sidebar.tsx"
58
59
  },
59
60
  "./skeleton": {
60
- "types": "./src/skeleton.tsx",
61
+ "types": "./dist/skeleton.d.ts",
61
62
  "import": "./src/skeleton.tsx"
62
63
  },
63
64
  "./table": {
64
- "types": "./src/table.tsx",
65
+ "types": "./dist/table.d.ts",
65
66
  "import": "./src/table.tsx"
66
67
  },
67
68
  "./tooltip": {
68
- "types": "./src/tooltip.tsx",
69
+ "types": "./dist/tooltip.d.ts",
69
70
  "import": "./src/tooltip.tsx"
70
71
  },
71
72
  "./package.json": "./package.json"
package/src/alert.tsx ADDED
@@ -0,0 +1,58 @@
1
+ import * as React from "react";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { cn } from "@c-rex/utils";
4
+
5
+ const alertVariants = cva(
6
+ "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-background text-foreground",
11
+ destructive:
12
+ "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
13
+ },
14
+ },
15
+ defaultVariants: {
16
+ variant: "default",
17
+ },
18
+ },
19
+ );
20
+
21
+ const Alert = React.forwardRef<
22
+ HTMLDivElement,
23
+ React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
24
+ >(({ className, variant, ...props }, ref) => (
25
+ <div
26
+ ref={ref}
27
+ role="alert"
28
+ className={cn(alertVariants({ variant }), className)}
29
+ {...props}
30
+ />
31
+ ));
32
+ Alert.displayName = "Alert";
33
+
34
+ const AlertTitle = React.forwardRef<
35
+ HTMLParagraphElement,
36
+ React.HTMLAttributes<HTMLHeadingElement>
37
+ >(({ className, ...props }, ref) => (
38
+ <h5
39
+ ref={ref}
40
+ className={cn("mb-1 font-medium leading-none tracking-tight", className)}
41
+ {...props}
42
+ />
43
+ ));
44
+ AlertTitle.displayName = "AlertTitle";
45
+
46
+ const AlertDescription = React.forwardRef<
47
+ HTMLParagraphElement,
48
+ React.HTMLAttributes<HTMLParagraphElement>
49
+ >(({ className, ...props }, ref) => (
50
+ <div
51
+ ref={ref}
52
+ className={cn("text-sm [&_p]:leading-relaxed", className)}
53
+ {...props}
54
+ />
55
+ ));
56
+ AlertDescription.displayName = "AlertDescription";
57
+
58
+ export { Alert, AlertTitle, AlertDescription };
@@ -0,0 +1,115 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { ChevronRight, MoreHorizontal } from "lucide-react";
4
+
5
+ import { cn } from "@c-rex/utils";
6
+
7
+ const Breadcrumb = React.forwardRef<
8
+ HTMLElement,
9
+ React.ComponentPropsWithoutRef<"nav"> & {
10
+ separator?: React.ReactNode;
11
+ }
12
+ >(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />);
13
+ Breadcrumb.displayName = "Breadcrumb";
14
+
15
+ const BreadcrumbList = React.forwardRef<
16
+ HTMLOListElement,
17
+ React.ComponentPropsWithoutRef<"ol">
18
+ >(({ className, ...props }, ref) => (
19
+ <ol
20
+ ref={ref}
21
+ className={cn(
22
+ "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
23
+ className,
24
+ )}
25
+ {...props}
26
+ />
27
+ ));
28
+ BreadcrumbList.displayName = "BreadcrumbList";
29
+
30
+ const BreadcrumbItem = React.forwardRef<
31
+ HTMLLIElement,
32
+ React.ComponentPropsWithoutRef<"li">
33
+ >(({ className, ...props }, ref) => (
34
+ <li
35
+ ref={ref}
36
+ className={cn("inline-flex items-center gap-1.5", className)}
37
+ {...props}
38
+ />
39
+ ));
40
+ BreadcrumbItem.displayName = "BreadcrumbItem";
41
+
42
+ const BreadcrumbLink = React.forwardRef<
43
+ HTMLAnchorElement,
44
+ React.ComponentPropsWithoutRef<"a"> & {
45
+ asChild?: boolean;
46
+ }
47
+ >(({ asChild, className, ...props }, ref) => {
48
+ const Comp = asChild ? Slot : "a";
49
+
50
+ return (
51
+ <Comp
52
+ ref={ref}
53
+ className={cn("transition-colors hover:text-foreground", className)}
54
+ {...props}
55
+ />
56
+ );
57
+ });
58
+ BreadcrumbLink.displayName = "BreadcrumbLink";
59
+
60
+ const BreadcrumbPage = React.forwardRef<
61
+ HTMLSpanElement,
62
+ React.ComponentPropsWithoutRef<"span">
63
+ >(({ className, ...props }, ref) => (
64
+ <span
65
+ ref={ref}
66
+ role="link"
67
+ aria-disabled="true"
68
+ aria-current="page"
69
+ className={cn("font-normal text-foreground", className)}
70
+ {...props}
71
+ />
72
+ ));
73
+ BreadcrumbPage.displayName = "BreadcrumbPage";
74
+
75
+ const BreadcrumbSeparator = ({
76
+ children,
77
+ className,
78
+ ...props
79
+ }: React.ComponentProps<"li">) => (
80
+ <li
81
+ role="presentation"
82
+ aria-hidden="true"
83
+ className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
84
+ {...props}
85
+ >
86
+ {children ?? <ChevronRight />}
87
+ </li>
88
+ );
89
+ BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
90
+
91
+ const BreadcrumbEllipsis = ({
92
+ className,
93
+ ...props
94
+ }: React.ComponentProps<"span">) => (
95
+ <span
96
+ role="presentation"
97
+ aria-hidden="true"
98
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
99
+ {...props}
100
+ >
101
+ <MoreHorizontal className="h-4 w-4" />
102
+ <span className="sr-only">More</span>
103
+ </span>
104
+ );
105
+ BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
106
+
107
+ export {
108
+ Breadcrumb,
109
+ BreadcrumbList,
110
+ BreadcrumbItem,
111
+ BreadcrumbLink,
112
+ BreadcrumbPage,
113
+ BreadcrumbSeparator,
114
+ BreadcrumbEllipsis,
115
+ };
package/src/button.tsx ADDED
@@ -0,0 +1,66 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { cva, type VariantProps } from "class-variance-authority";
4
+
5
+ import { cn } from "@c-rex/utils";
6
+
7
+ const buttonVariants = cva(
8
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default:
13
+ "bg-primary text-primary-foreground shadow hover:bg-primary/90",
14
+ destructive:
15
+ "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
16
+ outline:
17
+ "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
18
+ secondary:
19
+ "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
20
+ ghost: "hover:bg-accent hover:text-accent-foreground",
21
+ link: "text-primary underline-offset-4 hover:underline",
22
+ },
23
+ size: {
24
+ default: "h-9 px-4 py-2",
25
+ sm: "h-8 rounded-md px-3 text-xs",
26
+ lg: "h-10 rounded-md px-8",
27
+ icon: "h-9 w-9",
28
+ },
29
+ rounded: {
30
+ default: "rounded-md",
31
+ sm: "rounded-sm",
32
+ lg: "rounded-lg",
33
+ xl: "rounded-xl",
34
+ "2xl": "rounded-2xl",
35
+ full: "rounded-full",
36
+ },
37
+ },
38
+ defaultVariants: {
39
+ variant: "default",
40
+ size: "default",
41
+ rounded: "default",
42
+ },
43
+ },
44
+ );
45
+
46
+ export interface ButtonProps
47
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
48
+ VariantProps<typeof buttonVariants> {
49
+ asChild?: boolean;
50
+ }
51
+
52
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
53
+ ({ className, variant, size, rounded, asChild = false, ...props }, ref) => {
54
+ const Comp = asChild ? Slot : "button";
55
+ return (
56
+ <Comp
57
+ className={cn(buttonVariants({ variant, size, rounded, className }))}
58
+ ref={ref}
59
+ {...props}
60
+ />
61
+ );
62
+ },
63
+ );
64
+ Button.displayName = "Button";
65
+
66
+ export { Button, buttonVariants };
@@ -0,0 +1,151 @@
1
+ import * as React from "react";
2
+ import { type DialogProps } from "@radix-ui/react-dialog";
3
+ import { Command as CommandPrimitive } from "cmdk";
4
+ import { Search } from "lucide-react";
5
+
6
+ import { cn } from "@c-rex/utils";
7
+ import { Dialog, DialogContent } from "./dialog";
8
+
9
+ const Command = React.forwardRef<
10
+ React.ElementRef<typeof CommandPrimitive>,
11
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive>
12
+ >(({ className, ...props }, ref) => (
13
+ <CommandPrimitive
14
+ ref={ref}
15
+ className={cn(
16
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
17
+ className,
18
+ )}
19
+ {...props}
20
+ />
21
+ ));
22
+ Command.displayName = CommandPrimitive.displayName;
23
+
24
+ const CommandDialog = ({ children, ...props }: DialogProps) => {
25
+ return (
26
+ <Dialog {...props}>
27
+ <DialogContent className="overflow-hidden p-0">
28
+ <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
29
+ {children}
30
+ </Command>
31
+ </DialogContent>
32
+ </Dialog>
33
+ );
34
+ };
35
+
36
+ const CommandInput = React.forwardRef<
37
+ React.ElementRef<typeof CommandPrimitive.Input>,
38
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
39
+ >(({ className, ...props }, ref) => (
40
+ <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
41
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
42
+ <CommandPrimitive.Input
43
+ ref={ref}
44
+ className={cn(
45
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
46
+ className,
47
+ )}
48
+ {...props}
49
+ />
50
+ </div>
51
+ ));
52
+
53
+ CommandInput.displayName = CommandPrimitive.Input.displayName;
54
+
55
+ const CommandList = React.forwardRef<
56
+ React.ElementRef<typeof CommandPrimitive.List>,
57
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
58
+ >(({ className, ...props }, ref) => (
59
+ <CommandPrimitive.List
60
+ ref={ref}
61
+ className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
62
+ {...props}
63
+ />
64
+ ));
65
+
66
+ CommandList.displayName = CommandPrimitive.List.displayName;
67
+
68
+ const CommandEmpty = React.forwardRef<
69
+ React.ElementRef<typeof CommandPrimitive.Empty>,
70
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
71
+ >((props, ref) => (
72
+ <CommandPrimitive.Empty
73
+ ref={ref}
74
+ className="py-6 text-center text-sm"
75
+ {...props}
76
+ />
77
+ ));
78
+
79
+ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
80
+
81
+ const CommandGroup = React.forwardRef<
82
+ React.ElementRef<typeof CommandPrimitive.Group>,
83
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
84
+ >(({ className, ...props }, ref) => (
85
+ <CommandPrimitive.Group
86
+ ref={ref}
87
+ className={cn(
88
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
89
+ className,
90
+ )}
91
+ {...props}
92
+ />
93
+ ));
94
+
95
+ CommandGroup.displayName = CommandPrimitive.Group.displayName;
96
+
97
+ const CommandSeparator = React.forwardRef<
98
+ React.ElementRef<typeof CommandPrimitive.Separator>,
99
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
100
+ >(({ className, ...props }, ref) => (
101
+ <CommandPrimitive.Separator
102
+ ref={ref}
103
+ className={cn("-mx-1 h-px bg-border", className)}
104
+ {...props}
105
+ />
106
+ ));
107
+ CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
108
+
109
+ const CommandItem = React.forwardRef<
110
+ React.ElementRef<typeof CommandPrimitive.Item>,
111
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
112
+ >(({ className, ...props }, ref) => (
113
+ <CommandPrimitive.Item
114
+ ref={ref}
115
+ className={cn(
116
+ "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
117
+ className,
118
+ )}
119
+ {...props}
120
+ />
121
+ ));
122
+
123
+ CommandItem.displayName = CommandPrimitive.Item.displayName;
124
+
125
+ const CommandShortcut = ({
126
+ className,
127
+ ...props
128
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
129
+ return (
130
+ <span
131
+ className={cn(
132
+ "ml-auto text-xs tracking-widest text-muted-foreground",
133
+ className,
134
+ )}
135
+ {...props}
136
+ />
137
+ );
138
+ };
139
+ CommandShortcut.displayName = "CommandShortcut";
140
+
141
+ export {
142
+ Command,
143
+ CommandDialog,
144
+ CommandInput,
145
+ CommandList,
146
+ CommandEmpty,
147
+ CommandGroup,
148
+ CommandItem,
149
+ CommandShortcut,
150
+ CommandSeparator,
151
+ };
package/src/dialog.tsx ADDED
@@ -0,0 +1,122 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
5
+ import { X } from "lucide-react";
6
+
7
+ import { cn } from "@c-rex/utils";
8
+
9
+ const Dialog = DialogPrimitive.Root;
10
+
11
+ const DialogTrigger = DialogPrimitive.Trigger;
12
+
13
+ const DialogPortal = DialogPrimitive.Portal;
14
+
15
+ const DialogClose = DialogPrimitive.Close;
16
+
17
+ const DialogOverlay = React.forwardRef<
18
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
19
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
20
+ >(({ className, ...props }, ref) => (
21
+ <DialogPrimitive.Overlay
22
+ ref={ref}
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
+ />
29
+ ));
30
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
31
+
32
+ const DialogContent = React.forwardRef<
33
+ React.ElementRef<typeof DialogPrimitive.Content>,
34
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
35
+ >(({ className, children, ...props }, ref) => (
36
+ <DialogPortal>
37
+ <DialogOverlay />
38
+ <DialogPrimitive.Content
39
+ ref={ref}
40
+ className={cn(
41
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
42
+ className,
43
+ )}
44
+ {...props}
45
+ >
46
+ {children}
47
+ <DialogPrimitive.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-accent data-[state=open]:text-muted-foreground">
48
+ <X className="h-4 w-4" />
49
+ <span className="sr-only">Close</span>
50
+ </DialogPrimitive.Close>
51
+ </DialogPrimitive.Content>
52
+ </DialogPortal>
53
+ ));
54
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
55
+
56
+ const DialogHeader = ({
57
+ className,
58
+ ...props
59
+ }: React.HTMLAttributes<HTMLDivElement>) => (
60
+ <div
61
+ className={cn(
62
+ "flex flex-col space-y-1.5 text-center sm:text-left",
63
+ className,
64
+ )}
65
+ {...props}
66
+ />
67
+ );
68
+ DialogHeader.displayName = "DialogHeader";
69
+
70
+ const DialogFooter = ({
71
+ className,
72
+ ...props
73
+ }: React.HTMLAttributes<HTMLDivElement>) => (
74
+ <div
75
+ className={cn(
76
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
77
+ className,
78
+ )}
79
+ {...props}
80
+ />
81
+ );
82
+ DialogFooter.displayName = "DialogFooter";
83
+
84
+ const DialogTitle = React.forwardRef<
85
+ React.ElementRef<typeof DialogPrimitive.Title>,
86
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
87
+ >(({ className, ...props }, ref) => (
88
+ <DialogPrimitive.Title
89
+ ref={ref}
90
+ className={cn(
91
+ "text-lg font-semibold leading-none tracking-tight",
92
+ className,
93
+ )}
94
+ {...props}
95
+ />
96
+ ));
97
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
98
+
99
+ const DialogDescription = React.forwardRef<
100
+ React.ElementRef<typeof DialogPrimitive.Description>,
101
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
102
+ >(({ className, ...props }, ref) => (
103
+ <DialogPrimitive.Description
104
+ ref={ref}
105
+ className={cn("text-sm text-muted-foreground", className)}
106
+ {...props}
107
+ />
108
+ ));
109
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
110
+
111
+ export {
112
+ Dialog,
113
+ DialogPortal,
114
+ DialogOverlay,
115
+ DialogTrigger,
116
+ DialogClose,
117
+ DialogContent,
118
+ DialogHeader,
119
+ DialogFooter,
120
+ DialogTitle,
121
+ DialogDescription,
122
+ };