@ardly/bunext 1.0.5 → 1.0.7

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 (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -16
  3. package/cli.mjs +126 -0
  4. package/package.json +14 -58
  5. package/.eslintrc.json +0 -8
  6. package/.prettierignore +0 -4
  7. package/STRUCTURE.md +0 -77
  8. package/bin/cli.mjs +0 -133
  9. package/bin/utils.mjs +0 -32
  10. package/components.json +0 -21
  11. package/next.config.ts +0 -22
  12. package/postcss.config.mjs +0 -8
  13. package/prettier.config.js +0 -7
  14. package/public/android-chrome-192x192.png +0 -0
  15. package/public/android-chrome-512x512.png +0 -0
  16. package/public/favicon.svg +0 -1
  17. package/public/loading-dots.gif +0 -0
  18. package/public/logo.svg +0 -1
  19. package/public/ogImage.webp +0 -0
  20. package/public/site.webmanifest +0 -19
  21. package/src/actions/placeholder.ts +0 -30
  22. package/src/actions/sampleAction.ts +0 -39
  23. package/src/app/(index)/intr/TestCard.tsx +0 -31
  24. package/src/app/(index)/intr/page.tsx +0 -17
  25. package/src/app/(index)/page.tsx +0 -156
  26. package/src/app/(index)/pagetr/page.tsx +0 -37
  27. package/src/app/error-wrapper.tsx +0 -32
  28. package/src/app/global-error.tsx +0 -53
  29. package/src/app/layout.tsx +0 -56
  30. package/src/app/loading.tsx +0 -11
  31. package/src/app/not-found.tsx +0 -45
  32. package/src/app/sitemap.ts +0 -14
  33. package/src/components/Providers/root-provider.tsx +0 -22
  34. package/src/components/Providers/theme-provider.tsx +0 -27
  35. package/src/components/TestComp.tsx +0 -11
  36. package/src/components/brand.tsx +0 -35
  37. package/src/components/navigation/footer.tsx +0 -32
  38. package/src/components/navigation/main-nav.tsx +0 -55
  39. package/src/components/navigation/mobile-nav.tsx +0 -154
  40. package/src/components/navigation/site-header.tsx +0 -67
  41. package/src/components/ui/avatar.tsx +0 -50
  42. package/src/components/ui/badge.tsx +0 -36
  43. package/src/components/ui/button.tsx +0 -56
  44. package/src/components/ui/card.tsx +0 -79
  45. package/src/components/ui/command.tsx +0 -153
  46. package/src/components/ui/dialog.tsx +0 -122
  47. package/src/components/ui/drawer.tsx +0 -118
  48. package/src/components/ui/dropdown-menu.tsx +0 -200
  49. package/src/components/ui/input.tsx +0 -22
  50. package/src/components/ui/label.tsx +0 -26
  51. package/src/components/ui/multi-select.tsx +0 -380
  52. package/src/components/ui/origin/multiselect.tsx +0 -645
  53. package/src/components/ui/popover.tsx +0 -31
  54. package/src/components/ui/radio-group.tsx +0 -44
  55. package/src/components/ui/separator.tsx +0 -31
  56. package/src/components/ui/skeleton.tsx +0 -15
  57. package/src/components/ui/themeSelector.tsx +0 -157
  58. package/src/components/ui/toast.tsx +0 -129
  59. package/src/components/ui/toaster.tsx +0 -31
  60. package/src/components/ui/tooltip.tsx +0 -39
  61. package/src/components/utils/ConditionalLink.tsx +0 -46
  62. package/src/components/utils/Image.tsx +0 -57
  63. package/src/components/utils/Img.tsx +0 -104
  64. package/src/components/utils/Spinner.tsx +0 -29
  65. package/src/components/utils/TopButton.tsx +0 -67
  66. package/src/components/utils/TransitionLink.tsx +0 -67
  67. package/src/components/utils/copy.tsx +0 -98
  68. package/src/components/utils/featureFlag.tsx +0 -22
  69. package/src/components/utils/icons.tsx +0 -155
  70. package/src/components/utils/share-modal.tsx +0 -159
  71. package/src/hooks/use-intersection.ts +0 -52
  72. package/src/hooks/use-lazy-load.ts +0 -33
  73. package/src/hooks/use-meta-color.ts +0 -25
  74. package/src/hooks/use-toast.ts +0 -191
  75. package/src/lib/config/featureflags.ts +0 -63
  76. package/src/lib/config/siteConfig.ts +0 -172
  77. package/src/lib/config/user.ts +0 -9
  78. package/src/lib/data/footer-data.ts +0 -85
  79. package/src/lib/data/nav-data.ts +0 -30
  80. package/src/lib/data/siteData.ts +0 -52
  81. package/src/lib/utils/index.ts +0 -190
  82. package/src/styles/customGlobal.css +0 -141
  83. package/src/styles/globals.css +0 -72
  84. package/src/styles/tailwind/base.ts +0 -46
  85. package/src/styles/tailwind/fonts/ClashDisplay-Bold.eot +0 -0
  86. package/src/styles/tailwind/fonts/ClashDisplay-Bold.ttf +0 -0
  87. package/src/styles/tailwind/fonts/ClashDisplay-Bold.woff +0 -0
  88. package/src/styles/tailwind/fonts/ClashDisplay-Bold.woff2 +0 -0
  89. package/src/styles/tailwind/fonts/ClashDisplay-Extralight.eot +0 -0
  90. package/src/styles/tailwind/fonts/ClashDisplay-Extralight.ttf +0 -0
  91. package/src/styles/tailwind/fonts/ClashDisplay-Extralight.woff +0 -0
  92. package/src/styles/tailwind/fonts/ClashDisplay-Extralight.woff2 +0 -0
  93. package/src/styles/tailwind/fonts/ClashDisplay-Light.eot +0 -0
  94. package/src/styles/tailwind/fonts/ClashDisplay-Light.ttf +0 -0
  95. package/src/styles/tailwind/fonts/ClashDisplay-Light.woff +0 -0
  96. package/src/styles/tailwind/fonts/ClashDisplay-Light.woff2 +0 -0
  97. package/src/styles/tailwind/fonts/ClashDisplay-Medium.eot +0 -0
  98. package/src/styles/tailwind/fonts/ClashDisplay-Medium.ttf +0 -0
  99. package/src/styles/tailwind/fonts/ClashDisplay-Medium.woff +0 -0
  100. package/src/styles/tailwind/fonts/ClashDisplay-Medium.woff2 +0 -0
  101. package/src/styles/tailwind/fonts/ClashDisplay-Regular.eot +0 -0
  102. package/src/styles/tailwind/fonts/ClashDisplay-Regular.ttf +0 -0
  103. package/src/styles/tailwind/fonts/ClashDisplay-Regular.woff +0 -0
  104. package/src/styles/tailwind/fonts/ClashDisplay-Regular.woff2 +0 -0
  105. package/src/styles/tailwind/fonts/ClashDisplay-Semibold.eot +0 -0
  106. package/src/styles/tailwind/fonts/ClashDisplay-Semibold.ttf +0 -0
  107. package/src/styles/tailwind/fonts/ClashDisplay-Semibold.woff +0 -0
  108. package/src/styles/tailwind/fonts/ClashDisplay-Semibold.woff2 +0 -0
  109. package/src/styles/tailwind/fonts/ClashDisplay-Variable.eot +0 -0
  110. package/src/styles/tailwind/fonts/ClashDisplay-Variable.ttf +0 -0
  111. package/src/styles/tailwind/fonts/ClashDisplay-Variable.woff +0 -0
  112. package/src/styles/tailwind/fonts/ClashDisplay-Variable.woff2 +0 -0
  113. package/src/styles/tailwind/fonts/GeistMonoVF.woff +0 -0
  114. package/src/styles/tailwind/fonts/GeistVF.woff +0 -0
  115. package/src/styles/tailwind/fonts.ts +0 -51
  116. package/src/styles/tailwind/tailwindUtils.ts +0 -29
  117. package/src/types/index.ts +0 -80
  118. package/tailwind.config.ts +0 -104
  119. package/tsconfig.json +0 -28
  120. package/vercel.json +0 -6
@@ -1,32 +0,0 @@
1
- import { simpleFooterData } from '@/lib/data/footer-data'
2
- import { cn } from '@/lib/utils'
3
- export function SimpleFooter({ className }: { className?: string }) {
4
- return (
5
- <footer
6
- className={cn(
7
- 'max-h-24 border-t border-border/40 py-6 dark:border-border md:px-8 md:py-0',
8
- className
9
- )}
10
- >
11
- <div className="container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row md:px-0">
12
- {simpleFooterData?.texts.map((item, index) => (
13
- <p
14
- className="text-balance text-center text-sm leading-loose text-muted-foreground md:text-left"
15
- key={index}
16
- >
17
- {item.pretext}{' '}
18
- <a
19
- href={item.url}
20
- target="_blank"
21
- rel="noreferrer"
22
- className="font-medium underline-offset-4 hover:underline"
23
- >
24
- {item.label}
25
- </a>
26
- .
27
- </p>
28
- ))}
29
- </div>
30
- </footer>
31
- )
32
- }
@@ -1,55 +0,0 @@
1
- 'use client'
2
-
3
- import Link from 'next/link'
4
- import Image from 'next/image'
5
- import { usePathname } from 'next/navigation'
6
-
7
- import { navData } from '@/lib/data/nav-data'
8
- import { cn, truncateString } from '@/lib/utils'
9
-
10
- export function MainNav() {
11
- const pathname = usePathname()
12
-
13
- return (
14
- <div className="mr-4 hidden md:flex">
15
- <Link href="/" className="mr-4 flex items-center gap-2 lg:mr-6">
16
- {navData.logo && (
17
- <Image
18
- src={navData.logo.src}
19
- alt={navData.logo.alt}
20
- width={36}
21
- height={36}
22
- className="size-10"
23
- />
24
- )}
25
- <span
26
- className={cn('text-2xl font-bold', !navData.showTitle && 'sr-only')}
27
- >
28
- {truncateString(navData.title, 20)}
29
- </span>
30
- </Link>
31
- <nav className="flex items-center gap-4 text-sm font-medium xl:gap-6">
32
- {navData?.links?.map((link) => (
33
- <Link
34
- key={link.href}
35
- href={link.href}
36
- className={cn(
37
- 'transition-colors hover:text-foreground/80',
38
- link.href === '/'
39
- ? pathname === '/'
40
- ? 'text-foreground'
41
- : 'text-foreground/70'
42
- : pathname?.startsWith(link.href) && link.href !== '/'
43
- ? 'text-foreground'
44
- : 'text-foreground/70'
45
- )}
46
- target={link.external ? '_blank' : ''}
47
- rel={link.external ? 'noreferrer' : ''}
48
- >
49
- {link.label}
50
- </Link>
51
- ))}
52
- </nav>
53
- </div>
54
- )
55
- }
@@ -1,154 +0,0 @@
1
- 'use client'
2
-
3
- import Link, { type LinkProps } from 'next/link'
4
- import { useRouter } from 'next/navigation'
5
- import * as React from 'react'
6
-
7
- import { Button } from '@/components/ui/button'
8
- import {
9
- Drawer,
10
- DrawerContent,
11
- DrawerTitle,
12
- DrawerHeader,
13
- DrawerTrigger,
14
- } from '@/components/ui/drawer'
15
- import { useMetaColor } from '@/hooks/use-meta-color'
16
- import { cn, truncateString } from '@/lib/utils'
17
-
18
- import { navData } from '@/lib/data/nav-data'
19
- import Image from 'next/image'
20
- export function MobileNav() {
21
- const [open, setOpen] = React.useState(false)
22
- const { setMetaColor, metaColor } = useMetaColor()
23
-
24
- const onOpenChange = React.useCallback(
25
- (open: boolean) => {
26
- setOpen(open)
27
- setMetaColor(open ? '#09090b' : metaColor)
28
- },
29
- [setMetaColor, metaColor]
30
- )
31
- React.useEffect(() => {
32
- const handleResize = () => {
33
- if (window.innerWidth >= 768 && open) {
34
- setOpen(false)
35
- setMetaColor(metaColor)
36
- }
37
- }
38
- window.addEventListener('resize', handleResize)
39
- return () => window.removeEventListener('resize', handleResize)
40
- }, [open, setMetaColor, metaColor])
41
-
42
- return (
43
- <div className="flex items-center justify-between md:hidden">
44
- <Drawer open={open} onOpenChange={onOpenChange}>
45
- <DrawerTrigger asChild>
46
- <Button
47
- variant="ghost"
48
- className="group -ml-2 mr-2 h-8 w-8 px-0 text-base hover:bg-transparent focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0"
49
- aria-label={open ? 'Close menu' : 'Open menu'}
50
- aria-expanded={open}
51
- >
52
- <svg
53
- className="pointer-events-none"
54
- width={24}
55
- height={24}
56
- viewBox="0 0 24 24"
57
- fill="none"
58
- stroke="currentColor"
59
- strokeWidth="2"
60
- strokeLinecap="round"
61
- strokeLinejoin="round"
62
- xmlns="http://www.w3.org/2000/svg"
63
- >
64
- <path
65
- d="M2 12L22 12"
66
- className="origin-center -translate-y-[7px] transition-all duration-300 [transition-timing-function:cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-x-0 group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[315deg]"
67
- />
68
- <path
69
- d="M2 12H22"
70
- className="origin-center transition-all duration-300 [transition-timing-function:cubic-bezier(.5,.85,.25,1.8)] group-aria-expanded:rotate-45"
71
- />
72
- <path
73
- d="M2 12H22"
74
- className="origin-center translate-y-[7px] transition-all duration-300 [transition-timing-function:cubic-bezier(.5,.85,.25,1.1)] group-aria-expanded:translate-y-0 group-aria-expanded:rotate-[135deg]"
75
- />
76
- </svg>
77
- <span className="sr-only">Toggle Menu</span>
78
- </Button>
79
- </DrawerTrigger>
80
- <DrawerContent className="max-h-[60svh] p-0">
81
- <DrawerTitle className="px-5 text-2xl opacity-35">
82
- {navData.title}
83
- </DrawerTitle>
84
-
85
- <div className="overflow-auto p-6">
86
- <div className="flex flex-col space-y-3">
87
- {navData?.links?.map(
88
- (item) =>
89
- item.href && (
90
- <MobileLink
91
- key={item.href}
92
- href={item.href}
93
- target={item.external ? '_blank' : ''}
94
- onOpenChange={setOpen}
95
- >
96
- {item.label}
97
- </MobileLink>
98
- )
99
- )}
100
- </div>
101
- </div>
102
- </DrawerContent>
103
- </Drawer>
104
- <Link href="/" className="mr-4 flex items-center gap-2 lg:mr-6">
105
- {navData.logo && (
106
- <Image
107
- src={navData.logo.src}
108
- alt={navData.logo.alt}
109
- width={36}
110
- height={36}
111
- className="size-12"
112
- />
113
- )}
114
- <span
115
- className={cn('text-2xl font-bold', !navData.showTitle && 'sr-only')}
116
- >
117
- {truncateString(navData.title, 20)}
118
- </span>
119
- </Link>
120
- </div>
121
- )
122
- }
123
-
124
- interface MobileLinkProps extends LinkProps {
125
- onOpenChange?: (open: boolean) => void
126
- children: React.ReactNode
127
- className?: string
128
- target?: string
129
- }
130
-
131
- function MobileLink({
132
- href,
133
- onOpenChange,
134
- className,
135
- children,
136
- target,
137
- ...props
138
- }: MobileLinkProps) {
139
- const router = useRouter()
140
- return (
141
- <Link
142
- href={href}
143
- onClick={() => {
144
- router.push(href.toString())
145
- onOpenChange?.(false)
146
- }}
147
- className={cn('text-lg', className)}
148
- target={target}
149
- {...props}
150
- >
151
- {children}
152
- </Link>
153
- )
154
- }
@@ -1,67 +0,0 @@
1
- import Link from 'next/link'
2
-
3
- import { MainNav } from '@/components/navigation/main-nav'
4
- import { MobileNav } from '@/components/navigation/mobile-nav'
5
- import { Button } from '@/components/ui/button'
6
- import { ShareModal } from '@/components/utils/share-modal'
7
- import { navData } from '@/lib/data/nav-data'
8
- import { Rocket, Share2 } from 'lucide-react'
9
- import { remoteUrl } from '@/lib/config/siteConfig'
10
- import { cn } from '@/lib/utils'
11
-
12
- export function SiteHeader({ className }: { className?: string }) {
13
- return (
14
- <header
15
- className={cn(
16
- 'sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 dark:border-border',
17
- className
18
- )}
19
- >
20
- <div className="flex h-16 items-center px-4">
21
- <MainNav />
22
- <MobileNav />
23
- <div className="flex flex-1 items-center justify-end gap-2">
24
- {/* <div className="w-full flex-1 md:w-auto md:flex-none">
25
- <Search />
26
- </div> */}
27
- <nav className="flex items-center gap-0.5">
28
- <ShareModal shareUrl={remoteUrl}>
29
- <Button variant="ghost" size="icon" className="size-10 px-0">
30
- <Share2 className="size-5" />
31
- <span className="sr-only">Share</span>
32
- </Button>
33
- </ShareModal>
34
- {navData?.iconButtons.map((social) => {
35
- const Icon = social.Icon
36
- return (
37
- <Button
38
- key={social.href}
39
- variant="ghost"
40
- size="icon"
41
- className="size-10 px-0"
42
- asChild
43
- >
44
- <Link href={social.href} target="_blank" rel="noreferrer">
45
- {Icon && <Icon className="size-5" />}
46
- <span className="sr-only">{social.label}</span>
47
- </Link>
48
- </Button>
49
- )
50
- })}
51
- <Button size="sm" variant="outline" className="h-10" asChild>
52
- <a
53
- href="https://github.com/DarkidOP/Bunext/generate"
54
- target="_blank"
55
- rel="noopener noreferrer"
56
- className="flex items-center gap-2"
57
- >
58
- <Rocket className="size-5" />
59
- <span className="sr-only sm:not-sr-only">Use Template</span>
60
- </a>
61
- </Button>
62
- </nav>
63
- </div>
64
- </div>
65
- </header>
66
- )
67
- }
@@ -1,50 +0,0 @@
1
- 'use client'
2
-
3
- import * as AvatarPrimitive from '@radix-ui/react-avatar'
4
- import * as React from 'react'
5
-
6
- import { cn } from '@/lib/utils'
7
-
8
- const Avatar = React.forwardRef<
9
- React.ElementRef<typeof AvatarPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
11
- >(({ className, ...props }, ref) => (
12
- <AvatarPrimitive.Root
13
- ref={ref}
14
- className={cn(
15
- 'relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full',
16
- className
17
- )}
18
- {...props}
19
- />
20
- ))
21
- Avatar.displayName = AvatarPrimitive.Root.displayName
22
-
23
- const AvatarImage = React.forwardRef<
24
- React.ElementRef<typeof AvatarPrimitive.Image>,
25
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
26
- >(({ className, ...props }, ref) => (
27
- <AvatarPrimitive.Image
28
- ref={ref}
29
- className={cn('aspect-square h-full w-full', className)}
30
- {...props}
31
- />
32
- ))
33
- AvatarImage.displayName = AvatarPrimitive.Image.displayName
34
-
35
- const AvatarFallback = React.forwardRef<
36
- React.ElementRef<typeof AvatarPrimitive.Fallback>,
37
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
38
- >(({ className, ...props }, ref) => (
39
- <AvatarPrimitive.Fallback
40
- ref={ref}
41
- className={cn(
42
- 'flex h-full w-full items-center justify-center rounded-full bg-muted',
43
- className
44
- )}
45
- {...props}
46
- />
47
- ))
48
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
49
-
50
- export { Avatar, AvatarImage, AvatarFallback }
@@ -1,36 +0,0 @@
1
- import { type VariantProps, cva } from 'class-variance-authority'
2
- import type * as React from 'react'
3
-
4
- import { cn } from '@/lib/utils'
5
-
6
- const badgeVariants = cva(
7
- 'inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
8
- {
9
- variants: {
10
- variant: {
11
- default:
12
- 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
13
- secondary:
14
- 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
15
- destructive:
16
- 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
17
- outline: 'text-foreground',
18
- },
19
- },
20
- defaultVariants: {
21
- variant: 'default',
22
- },
23
- }
24
- )
25
-
26
- export interface BadgeProps
27
- extends React.HTMLAttributes<HTMLDivElement>,
28
- VariantProps<typeof badgeVariants> {}
29
-
30
- function Badge({ className, variant, ...props }: BadgeProps) {
31
- return (
32
- <div className={cn(badgeVariants({ variant }), className)} {...props} />
33
- )
34
- }
35
-
36
- export { Badge, badgeVariants }
@@ -1,56 +0,0 @@
1
- import { Slot } from '@radix-ui/react-slot'
2
- import { type VariantProps, cva } from 'class-variance-authority'
3
- import * as React from 'react'
4
-
5
- import { cn } from '@/lib/utils'
6
-
7
- const buttonVariants = cva(
8
- 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
9
- {
10
- variants: {
11
- variant: {
12
- default: 'bg-primary text-primary-foreground hover:bg-primary/90',
13
- destructive:
14
- 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
15
- outline:
16
- 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
17
- secondary:
18
- 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
19
- ghost: 'hover:bg-accent hover:text-accent-foreground',
20
- link: 'text-primary underline-offset-4 hover:underline',
21
- },
22
- size: {
23
- default: 'h-10 px-4 py-2',
24
- sm: 'h-9 rounded-md px-3',
25
- lg: 'h-11 rounded-md px-8',
26
- icon: 'h-10 w-10',
27
- },
28
- },
29
- defaultVariants: {
30
- variant: 'default',
31
- size: 'default',
32
- },
33
- }
34
- )
35
-
36
- export interface ButtonProps
37
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38
- VariantProps<typeof buttonVariants> {
39
- asChild?: boolean
40
- }
41
-
42
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43
- ({ className, variant, size, asChild = false, ...props }, ref) => {
44
- const Comp = asChild ? Slot : 'button'
45
- return (
46
- <Comp
47
- className={cn(buttonVariants({ variant, size, className }))}
48
- ref={ref}
49
- {...props}
50
- />
51
- )
52
- }
53
- )
54
- Button.displayName = 'Button'
55
-
56
- export { Button, buttonVariants }
@@ -1,79 +0,0 @@
1
- import * as React from 'react'
2
-
3
- import { cn } from '@/lib/utils'
4
-
5
- const Card = React.forwardRef<
6
- HTMLDivElement,
7
- React.HTMLAttributes<HTMLDivElement>
8
- >(({ className, ...props }, ref) => (
9
- <div
10
- ref={ref}
11
- className={cn(
12
- 'rounded-lg border bg-card text-card-foreground shadow-sm',
13
- className
14
- )}
15
- {...props}
16
- />
17
- ))
18
- Card.displayName = 'Card'
19
-
20
- const CardHeader = React.forwardRef<
21
- HTMLDivElement,
22
- React.HTMLAttributes<HTMLDivElement>
23
- >(({ className, ...props }, ref) => (
24
- <div
25
- ref={ref}
26
- className={cn('flex flex-col space-y-1.5 p-6', className)}
27
- {...props}
28
- />
29
- ))
30
- CardHeader.displayName = 'CardHeader'
31
-
32
- const CardTitle = React.forwardRef<
33
- HTMLDivElement,
34
- React.HTMLAttributes<HTMLDivElement>
35
- >(({ className, ...props }, ref) => (
36
- <div
37
- ref={ref}
38
- className={cn(
39
- 'text-2xl font-semibold leading-none tracking-tight',
40
- className
41
- )}
42
- {...props}
43
- />
44
- ))
45
- CardTitle.displayName = 'CardTitle'
46
-
47
- const CardDescription = React.forwardRef<
48
- HTMLDivElement,
49
- React.HTMLAttributes<HTMLDivElement>
50
- >(({ className, ...props }, ref) => (
51
- <div
52
- ref={ref}
53
- className={cn('text-sm text-muted-foreground', className)}
54
- {...props}
55
- />
56
- ))
57
- CardDescription.displayName = 'CardDescription'
58
-
59
- const CardContent = React.forwardRef<
60
- HTMLDivElement,
61
- React.HTMLAttributes<HTMLDivElement>
62
- >(({ className, ...props }, ref) => (
63
- <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
64
- ))
65
- CardContent.displayName = 'CardContent'
66
-
67
- const CardFooter = React.forwardRef<
68
- HTMLDivElement,
69
- React.HTMLAttributes<HTMLDivElement>
70
- >(({ className, ...props }, ref) => (
71
- <div
72
- ref={ref}
73
- className={cn('flex items-center p-6 pt-0', className)}
74
- {...props}
75
- />
76
- ))
77
- CardFooter.displayName = 'CardFooter'
78
-
79
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
@@ -1,153 +0,0 @@
1
- 'use client'
2
-
3
- import * as React from 'react'
4
- import { type DialogProps } from '@radix-ui/react-dialog'
5
- import { Command as CommandPrimitive } from 'cmdk'
6
- import { Search } from 'lucide-react'
7
-
8
- import { cn } from '@/lib/utils'
9
- import { Dialog, DialogContent } from '@/components/ui/dialog'
10
-
11
- const Command = React.forwardRef<
12
- React.ElementRef<typeof CommandPrimitive>,
13
- React.ComponentPropsWithoutRef<typeof CommandPrimitive>
14
- >(({ className, ...props }, ref) => (
15
- <CommandPrimitive
16
- ref={ref}
17
- className={cn(
18
- 'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',
19
- className
20
- )}
21
- {...props}
22
- />
23
- ))
24
- Command.displayName = CommandPrimitive.displayName
25
-
26
- const CommandDialog = ({ children, ...props }: DialogProps) => {
27
- return (
28
- <Dialog {...props}>
29
- <DialogContent className="overflow-hidden p-0 shadow-lg">
30
- <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">
31
- {children}
32
- </Command>
33
- </DialogContent>
34
- </Dialog>
35
- )
36
- }
37
-
38
- const CommandInput = React.forwardRef<
39
- React.ElementRef<typeof CommandPrimitive.Input>,
40
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
41
- >(({ className, ...props }, ref) => (
42
- <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
43
- <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
44
- <CommandPrimitive.Input
45
- ref={ref}
46
- className={cn(
47
- 'flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
48
- className
49
- )}
50
- {...props}
51
- />
52
- </div>
53
- ))
54
-
55
- CommandInput.displayName = CommandPrimitive.Input.displayName
56
-
57
- const CommandList = React.forwardRef<
58
- React.ElementRef<typeof CommandPrimitive.List>,
59
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
60
- >(({ className, ...props }, ref) => (
61
- <CommandPrimitive.List
62
- ref={ref}
63
- className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}
64
- {...props}
65
- />
66
- ))
67
-
68
- CommandList.displayName = CommandPrimitive.List.displayName
69
-
70
- const CommandEmpty = React.forwardRef<
71
- React.ElementRef<typeof CommandPrimitive.Empty>,
72
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
73
- >((props, ref) => (
74
- <CommandPrimitive.Empty
75
- ref={ref}
76
- className="py-6 text-center text-sm"
77
- {...props}
78
- />
79
- ))
80
-
81
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName
82
-
83
- const CommandGroup = React.forwardRef<
84
- React.ElementRef<typeof CommandPrimitive.Group>,
85
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
86
- >(({ className, ...props }, ref) => (
87
- <CommandPrimitive.Group
88
- ref={ref}
89
- className={cn(
90
- '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',
91
- className
92
- )}
93
- {...props}
94
- />
95
- ))
96
-
97
- CommandGroup.displayName = CommandPrimitive.Group.displayName
98
-
99
- const CommandSeparator = React.forwardRef<
100
- React.ElementRef<typeof CommandPrimitive.Separator>,
101
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
102
- >(({ className, ...props }, ref) => (
103
- <CommandPrimitive.Separator
104
- ref={ref}
105
- className={cn('-mx-1 h-px bg-border', className)}
106
- {...props}
107
- />
108
- ))
109
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName
110
-
111
- const CommandItem = React.forwardRef<
112
- React.ElementRef<typeof CommandPrimitive.Item>,
113
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
114
- >(({ className, ...props }, ref) => (
115
- <CommandPrimitive.Item
116
- ref={ref}
117
- className={cn(
118
- "relative flex cursor-default select-none items-center gap-2 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",
119
- className
120
- )}
121
- {...props}
122
- />
123
- ))
124
-
125
- CommandItem.displayName = CommandPrimitive.Item.displayName
126
-
127
- const CommandShortcut = ({
128
- className,
129
- ...props
130
- }: React.HTMLAttributes<HTMLSpanElement>) => {
131
- return (
132
- <span
133
- className={cn(
134
- 'ml-auto text-xs tracking-widest text-muted-foreground',
135
- className
136
- )}
137
- {...props}
138
- />
139
- )
140
- }
141
- CommandShortcut.displayName = 'CommandShortcut'
142
-
143
- export {
144
- Command,
145
- CommandDialog,
146
- CommandInput,
147
- CommandList,
148
- CommandEmpty,
149
- CommandGroup,
150
- CommandItem,
151
- CommandShortcut,
152
- CommandSeparator,
153
- }