@arch-cadre/ui 0.0.45 → 0.0.47

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 (74) hide show
  1. package/package.json +6 -3
  2. package/build.config.js +0 -22
  3. package/build.config.ts +0 -23
  4. package/components.json +0 -20
  5. package/postcss.config.mjs +0 -6
  6. package/scripts/switchToDist.js +0 -55
  7. package/scripts/switchToSrc.js +0 -52
  8. package/src/components/.gitkeep +0 -0
  9. package/src/components/accordion.tsx +0 -66
  10. package/src/components/alert-dialog.tsx +0 -157
  11. package/src/components/alert.tsx +0 -66
  12. package/src/components/aspect-ratio.tsx +0 -12
  13. package/src/components/avatar.tsx +0 -53
  14. package/src/components/badge.tsx +0 -46
  15. package/src/components/breadcrumb.tsx +0 -111
  16. package/src/components/button-group.tsx +0 -86
  17. package/src/components/button.tsx +0 -62
  18. package/src/components/calendar.tsx +0 -220
  19. package/src/components/card.tsx +0 -92
  20. package/src/components/checkbox.tsx +0 -32
  21. package/src/components/collapsible.tsx +0 -34
  22. package/src/components/command.tsx +0 -184
  23. package/src/components/context-menu.tsx +0 -252
  24. package/src/components/dialog.tsx +0 -143
  25. package/src/components/drawer.tsx +0 -135
  26. package/src/components/dropdown-menu.tsx +0 -257
  27. package/src/components/empty.tsx +0 -105
  28. package/src/components/field.tsx +0 -251
  29. package/src/components/form.tsx +0 -170
  30. package/src/components/hover-card.tsx +0 -44
  31. package/src/components/input-group.tsx +0 -170
  32. package/src/components/input-otp.tsx +0 -77
  33. package/src/components/input.tsx +0 -21
  34. package/src/components/item.tsx +0 -193
  35. package/src/components/kbd.tsx +0 -29
  36. package/src/components/label.tsx +0 -24
  37. package/src/components/language-switcher.tsx +0 -49
  38. package/src/components/menubar.tsx +0 -276
  39. package/src/components/navigation-menu.tsx +0 -168
  40. package/src/components/pagination.tsx +0 -130
  41. package/src/components/popover.tsx +0 -48
  42. package/src/components/progress.tsx +0 -31
  43. package/src/components/radio-group.tsx +0 -45
  44. package/src/components/scroll-area.tsx +0 -67
  45. package/src/components/select.tsx +0 -190
  46. package/src/components/separator.tsx +0 -28
  47. package/src/components/sheet.tsx +0 -139
  48. package/src/components/sidebar.tsx +0 -726
  49. package/src/components/skeleton.tsx +0 -14
  50. package/src/components/slider.tsx +0 -63
  51. package/src/components/sonner.tsx +0 -41
  52. package/src/components/spinner.tsx +0 -17
  53. package/src/components/switch.tsx +0 -31
  54. package/src/components/table.tsx +0 -116
  55. package/src/components/tabs.tsx +0 -66
  56. package/src/components/textarea.tsx +0 -18
  57. package/src/components/toggle-group.tsx +0 -83
  58. package/src/components/toggle.tsx +0 -47
  59. package/src/components/tooltip.tsx +0 -61
  60. package/src/hooks/.gitkeep +0 -0
  61. package/src/hooks/use-mobile.ts +0 -21
  62. package/src/hooks/use-user.ts +0 -27
  63. package/src/index.ts +0 -15
  64. package/src/lib/utils.ts +0 -6
  65. package/src/logo.tsx +0 -49
  66. package/src/postcss.config.mjs +0 -6
  67. package/src/providers/auth-provider.tsx +0 -66
  68. package/src/providers/index.tsx +0 -50
  69. package/src/shared/access-denied.tsx +0 -31
  70. package/src/shared/loader.tsx +0 -109
  71. package/src/shared/page-loader.tsx +0 -24
  72. package/src/shared/scroll-fade-effect.tsx +0 -23
  73. package/src/styles/globals.css +0 -314
  74. package/tsconfig.json +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arch-cadre/ui",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
@@ -36,6 +36,9 @@
36
36
  "import": "./dist/hooks/*.js"
37
37
  }
38
38
  },
39
+ "files": [
40
+ "dist"
41
+ ],
39
42
  "scripts": {
40
43
  "clean": "rm -rf ./dist",
41
44
  "switch:dev": "node scripts/switchToSrc.js",
@@ -47,8 +50,8 @@
47
50
  "build": "pnpm clean && tsc --module esnext"
48
51
  },
49
52
  "dependencies": {
50
- "@arch-cadre/core": "^0.0.45",
51
- "@arch-cadre/intl": "^0.0.45",
53
+ "@arch-cadre/core": "^0.0.47",
54
+ "@arch-cadre/intl": "^0.0.47",
52
55
  "@hookform/resolvers": "^5.2.2",
53
56
  "@iconify-json/solar": "^1.2.2",
54
57
  "@iconify/react": "^6.0.0",
package/build.config.js DELETED
@@ -1,22 +0,0 @@
1
- import { defineBuildConfig } from "unbuild";
2
- export default defineBuildConfig({
3
- entries: [
4
- // {
5
- // builder: "mkdist",
6
- // input: "./src",
7
- // outDir: "./dist",
8
- // format: "cjs",
9
- // ext: "cjs",
10
- // },
11
- {
12
- builder: "mkdist",
13
- input: "./src",
14
- outDir: "./dist",
15
- format: "esm",
16
- ext: "mjs",
17
- },
18
- ],
19
- clean: true,
20
- declaration: true,
21
- failOnWarn: false,
22
- });
package/build.config.ts DELETED
@@ -1,23 +0,0 @@
1
- import { defineBuildConfig } from "unbuild";
2
-
3
- export default defineBuildConfig({
4
- entries: [
5
- // {
6
- // builder: "mkdist",
7
- // input: "./src",
8
- // outDir: "./dist",
9
- // format: "cjs",
10
- // ext: "cjs",
11
- // },
12
- {
13
- builder: "mkdist",
14
- input: "./src",
15
- outDir: "./dist",
16
- format: "esm",
17
- ext: "mjs",
18
- },
19
- ],
20
- clean: true,
21
- declaration: true,
22
- failOnWarn: false,
23
- });
package/components.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "new-york",
4
- "rsc": true,
5
- "tsx": true,
6
- "tailwind": {
7
- "config": "",
8
- "css": "src/styles/globals.css",
9
- "baseColor": "neutral",
10
- "cssVariables": true
11
- },
12
- "iconLibrary": "lucide",
13
- "aliases": {
14
- "components": "@arch-cadre/ui/components",
15
- "utils": "@arch-cadre/ui/lib/utils",
16
- "hooks": "@arch-cadre/ui/hooks",
17
- "lib": "@arch-cadre/ui/lib",
18
- "ui": "@arch-cadre/ui/components"
19
- }
20
- }
@@ -1,6 +0,0 @@
1
- /** @type {import('postcss-load-config').Config} */
2
- const config = {
3
- plugins: { "@tailwindcss/postcss": {} },
4
- };
5
-
6
- export default config;
@@ -1,55 +0,0 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
7
-
8
- const packagePath = path.resolve(__dirname, "../package.json");
9
- const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
10
-
11
- pkg.main = "./dist/index.mjs";
12
-
13
- pkg.exports = {
14
- "./package.json": "./package.json",
15
- "./globals.css": "./dist/styles/globals.css",
16
- "./postcss.config": "./postcss.config.mjs",
17
- ".": {
18
- types: "./dist/index.d.ts",
19
- import: "./dist/index.mjs",
20
- require: "./dist/index.cjs",
21
- },
22
- "./providers": {
23
- types: "./dist/providers/index.d.ts",
24
- import: "./dist/providers/index.mjs",
25
- require: "./dist/providers/index.cjs",
26
- },
27
- "./brand/logo": {
28
- types: "./dist/logo.d.ts",
29
- import: "./dist/logo.mjs",
30
- require: "./dist/logo.cjs",
31
- },
32
- "./shared/*": {
33
- types: "./dist/shared/*.d.ts",
34
- import: "./dist/shared/*.mjs",
35
- require: "./dist/shared/*.cjs",
36
- },
37
- "./lib/*": {
38
- types: "./dist/lib/*.d.ts",
39
- import: "./dist/lib/*.mjs",
40
- require: "./dist/lib/*.cjs",
41
- },
42
- "./components/*": {
43
- types: "./dist/components/*.d.ts",
44
- import: "./dist/components/*.mjs",
45
- require: "./dist/components/*.cjs",
46
- },
47
- "./hooks/*": {
48
- types: "./dist/hooks/*.d.ts",
49
- import: "./dist/hooks/*.mjs",
50
- require: "./dist/hooks/*.cjs",
51
- },
52
- };
53
-
54
- fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2));
55
- console.log("Switched exports to use dist for production");
@@ -1,52 +0,0 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
7
-
8
- const packagePath = path.resolve(__dirname, "../package.json");
9
-
10
- // Leer el archivo package.json
11
- const pkg = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
12
-
13
- pkg.main = "./src/index.ts";
14
-
15
- // Modificar los exports
16
- pkg.exports = {
17
- "./package.json": "./package.json",
18
- "./globals.css": "./src/styles/globals.css",
19
- "./postcss.config": "./postcss.config.mjs",
20
- ".": {
21
- import: "./src/index.ts",
22
- require: "./dist/index.cjs",
23
- },
24
- "./providers": {
25
- import: "./src/providers/index.tsx",
26
- require: "./dist/providers/index.cjs",
27
- },
28
- "./brand/logo": {
29
- import: "./src/logo.tsx",
30
- require: "./dist/logo.cjs",
31
- },
32
- "./shared/*": {
33
- import: "./src/shared/*.tsx",
34
- require: "./dist/shared/*.cjs",
35
- },
36
- "./lib/*": {
37
- import: "./src/lib/*.ts",
38
- require: "./dist/lib/*.cjs",
39
- },
40
- "./components/*": {
41
- import: "./src/components/*.tsx",
42
- require: "./dist/components/*.cjs",
43
- },
44
- "./hooks/*": {
45
- import: "./src/hooks/*.ts",
46
- require: "./dist/hooks/*.cjs",
47
- },
48
- };
49
-
50
- // Guardar los cambios en package.json
51
- fs.writeFileSync(packagePath, JSON.stringify(pkg, null, 2));
52
- console.log("Switched exports to use src for development");
File without changes
@@ -1,66 +0,0 @@
1
- "use client";
2
-
3
- import { ChevronDownIcon } from "lucide-react";
4
- import { Accordion as AccordionPrimitive } from "radix-ui";
5
- import * as React from "react";
6
-
7
- import { cn } from "../lib/utils";
8
-
9
- function Accordion({
10
- ...props
11
- }: React.ComponentProps<typeof AccordionPrimitive.Root>) {
12
- return <AccordionPrimitive.Root data-slot="accordion" {...props} />;
13
- }
14
-
15
- function AccordionItem({
16
- className,
17
- ...props
18
- }: React.ComponentProps<typeof AccordionPrimitive.Item>) {
19
- return (
20
- <AccordionPrimitive.Item
21
- data-slot="accordion-item"
22
- className={cn("border-b last:border-b-0", className)}
23
- {...props}
24
- />
25
- );
26
- }
27
-
28
- function AccordionTrigger({
29
- className,
30
- children,
31
- ...props
32
- }: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
33
- return (
34
- <AccordionPrimitive.Header className="flex">
35
- <AccordionPrimitive.Trigger
36
- data-slot="accordion-trigger"
37
- className={cn(
38
- "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
39
- className,
40
- )}
41
- {...props}
42
- >
43
- {children}
44
- <ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
45
- </AccordionPrimitive.Trigger>
46
- </AccordionPrimitive.Header>
47
- );
48
- }
49
-
50
- function AccordionContent({
51
- className,
52
- children,
53
- ...props
54
- }: React.ComponentProps<typeof AccordionPrimitive.Content>) {
55
- return (
56
- <AccordionPrimitive.Content
57
- data-slot="accordion-content"
58
- className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
59
- {...props}
60
- >
61
- <div className={cn("pt-0 pb-4", className)}>{children}</div>
62
- </AccordionPrimitive.Content>
63
- );
64
- }
65
-
66
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -1,157 +0,0 @@
1
- "use client";
2
-
3
- import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
4
- import * as React from "react";
5
-
6
- import { cn } from "../lib/utils";
7
- import { buttonVariants } from "./button";
8
-
9
- function AlertDialog({
10
- ...props
11
- }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
12
- return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
13
- }
14
-
15
- function AlertDialogTrigger({
16
- ...props
17
- }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
18
- return (
19
- <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
20
- );
21
- }
22
-
23
- function AlertDialogPortal({
24
- ...props
25
- }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
26
- return (
27
- <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
28
- );
29
- }
30
-
31
- function AlertDialogOverlay({
32
- className,
33
- ...props
34
- }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
35
- return (
36
- <AlertDialogPrimitive.Overlay
37
- data-slot="alert-dialog-overlay"
38
- className={cn(
39
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
40
- className,
41
- )}
42
- {...props}
43
- />
44
- );
45
- }
46
-
47
- function AlertDialogContent({
48
- className,
49
- ...props
50
- }: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
51
- return (
52
- <AlertDialogPortal>
53
- <AlertDialogOverlay />
54
- <AlertDialogPrimitive.Content
55
- data-slot="alert-dialog-content"
56
- className={cn(
57
- "bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
58
- className,
59
- )}
60
- {...props}
61
- />
62
- </AlertDialogPortal>
63
- );
64
- }
65
-
66
- function AlertDialogHeader({
67
- className,
68
- ...props
69
- }: React.ComponentProps<"div">) {
70
- return (
71
- <div
72
- data-slot="alert-dialog-header"
73
- className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
74
- {...props}
75
- />
76
- );
77
- }
78
-
79
- function AlertDialogFooter({
80
- className,
81
- ...props
82
- }: React.ComponentProps<"div">) {
83
- return (
84
- <div
85
- data-slot="alert-dialog-footer"
86
- className={cn(
87
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
88
- className,
89
- )}
90
- {...props}
91
- />
92
- );
93
- }
94
-
95
- function AlertDialogTitle({
96
- className,
97
- ...props
98
- }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
99
- return (
100
- <AlertDialogPrimitive.Title
101
- data-slot="alert-dialog-title"
102
- className={cn("text-lg font-semibold", className)}
103
- {...props}
104
- />
105
- );
106
- }
107
-
108
- function AlertDialogDescription({
109
- className,
110
- ...props
111
- }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
112
- return (
113
- <AlertDialogPrimitive.Description
114
- data-slot="alert-dialog-description"
115
- className={cn("text-muted-foreground text-sm", className)}
116
- {...props}
117
- />
118
- );
119
- }
120
-
121
- function AlertDialogAction({
122
- className,
123
- ...props
124
- }: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
125
- return (
126
- <AlertDialogPrimitive.Action
127
- className={cn(buttonVariants(), className)}
128
- {...props}
129
- />
130
- );
131
- }
132
-
133
- function AlertDialogCancel({
134
- className,
135
- ...props
136
- }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
137
- return (
138
- <AlertDialogPrimitive.Cancel
139
- className={cn(buttonVariants({ variant: "outline" }), className)}
140
- {...props}
141
- />
142
- );
143
- }
144
-
145
- export {
146
- AlertDialog,
147
- AlertDialogPortal,
148
- AlertDialogOverlay,
149
- AlertDialogTrigger,
150
- AlertDialogContent,
151
- AlertDialogHeader,
152
- AlertDialogFooter,
153
- AlertDialogTitle,
154
- AlertDialogDescription,
155
- AlertDialogAction,
156
- AlertDialogCancel,
157
- };
@@ -1,66 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import * as React from "react";
3
-
4
- import { cn } from "../lib/utils";
5
-
6
- const alertVariants = cva(
7
- "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
8
- {
9
- variants: {
10
- variant: {
11
- default: "bg-card text-card-foreground",
12
- destructive:
13
- "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "default",
18
- },
19
- },
20
- );
21
-
22
- function Alert({
23
- className,
24
- variant,
25
- ...props
26
- }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
27
- return (
28
- <div
29
- data-slot="alert"
30
- role="alert"
31
- className={cn(alertVariants({ variant }), className)}
32
- {...props}
33
- />
34
- );
35
- }
36
-
37
- function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
38
- return (
39
- <div
40
- data-slot="alert-title"
41
- className={cn(
42
- "col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
43
- className,
44
- )}
45
- {...props}
46
- />
47
- );
48
- }
49
-
50
- function AlertDescription({
51
- className,
52
- ...props
53
- }: React.ComponentProps<"div">) {
54
- return (
55
- <div
56
- data-slot="alert-description"
57
- className={cn(
58
- "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
59
- className,
60
- )}
61
- {...props}
62
- />
63
- );
64
- }
65
-
66
- export { Alert, AlertTitle, AlertDescription };
@@ -1,12 +0,0 @@
1
- "use client";
2
-
3
- import { AspectRatio as AspectRatioPrimitive } from "radix-ui";
4
- import * as React from "react";
5
-
6
- function AspectRatio({
7
- ...props
8
- }: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
9
- return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />;
10
- }
11
-
12
- export { AspectRatio };
@@ -1,53 +0,0 @@
1
- "use client";
2
-
3
- import { Avatar as AvatarPrimitive } from "radix-ui";
4
- import * as React from "react";
5
-
6
- import { cn } from "../lib/utils";
7
-
8
- function Avatar({
9
- className,
10
- ...props
11
- }: React.ComponentProps<typeof AvatarPrimitive.Root>) {
12
- return (
13
- <AvatarPrimitive.Root
14
- data-slot="avatar"
15
- className={cn(
16
- "relative flex size-8 shrink-0 overflow-hidden rounded-full",
17
- className,
18
- )}
19
- {...props}
20
- />
21
- );
22
- }
23
-
24
- function AvatarImage({
25
- className,
26
- ...props
27
- }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
28
- return (
29
- <AvatarPrimitive.Image
30
- data-slot="avatar-image"
31
- className={cn("aspect-square size-full", className)}
32
- {...props}
33
- />
34
- );
35
- }
36
-
37
- function AvatarFallback({
38
- className,
39
- ...props
40
- }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
41
- return (
42
- <AvatarPrimitive.Fallback
43
- data-slot="avatar-fallback"
44
- className={cn(
45
- "bg-muted flex size-full items-center justify-center rounded-full",
46
- className,
47
- )}
48
- {...props}
49
- />
50
- );
51
- }
52
-
53
- export { Avatar, AvatarImage, AvatarFallback };
@@ -1,46 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import { Slot as SlotPrimitive } from "radix-ui";
3
- import * as React from "react";
4
-
5
- import { cn } from "../lib/utils";
6
-
7
- const badgeVariants = cva(
8
- "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
9
- {
10
- variants: {
11
- variant: {
12
- default:
13
- "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
14
- secondary:
15
- "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
16
- destructive:
17
- "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
18
- outline:
19
- "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
20
- },
21
- },
22
- defaultVariants: {
23
- variant: "default",
24
- },
25
- },
26
- );
27
-
28
- function Badge({
29
- className,
30
- variant,
31
- asChild = false,
32
- ...props
33
- }: React.ComponentProps<"span"> &
34
- VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
35
- const Comp = asChild ? SlotPrimitive.Slot : "span";
36
-
37
- return (
38
- <Comp
39
- data-slot="badge"
40
- className={cn(badgeVariants({ variant }), className)}
41
- {...props}
42
- />
43
- );
44
- }
45
-
46
- export { Badge, badgeVariants };