mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-28 07:04:20 +00:00
Compare commits
8 Commits
shadcn-ui@
...
shadcn-ui@
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c765635e13 | ||
|
|
95a9673b1e | ||
|
|
617cdd0e77 | ||
|
|
1536b7824e | ||
|
|
524e4b8b95 | ||
|
|
1f16cf4728 | ||
|
|
4f8d768e59 | ||
|
|
c0deeac0d0 |
@@ -151,7 +151,7 @@ export function CopyNpmCommandButton({
|
|||||||
}, [hasCopied])
|
}, [hasCopied])
|
||||||
|
|
||||||
const copyCommand = React.useCallback(
|
const copyCommand = React.useCallback(
|
||||||
(value: string, pm: "npm" | "pnpm" | "yarn") => {
|
(value: string, pm: "npm" | "pnpm" | "yarn" | "bun") => {
|
||||||
copyToClipboardWithMeta(value, {
|
copyToClipboardWithMeta(value, {
|
||||||
name: "copy_npm_command",
|
name: "copy_npm_command",
|
||||||
properties: {
|
properties: {
|
||||||
@@ -199,6 +199,11 @@ export function CopyNpmCommandButton({
|
|||||||
>
|
>
|
||||||
pnpm
|
pnpm
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem
|
||||||
|
onClick={() => copyCommand(commands.__bunCommand__, "bun")}
|
||||||
|
>
|
||||||
|
bun
|
||||||
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -170,8 +170,9 @@ const components = {
|
|||||||
className,
|
className,
|
||||||
__rawString__,
|
__rawString__,
|
||||||
__npmCommand__,
|
__npmCommand__,
|
||||||
__pnpmCommand__,
|
|
||||||
__yarnCommand__,
|
__yarnCommand__,
|
||||||
|
__pnpmCommand__,
|
||||||
|
__bunCommand__,
|
||||||
__withMeta__,
|
__withMeta__,
|
||||||
__src__,
|
__src__,
|
||||||
__event__,
|
__event__,
|
||||||
@@ -201,16 +202,20 @@ const components = {
|
|||||||
className={cn("absolute right-4 top-4", __withMeta__ && "top-16")}
|
className={cn("absolute right-4 top-4", __withMeta__ && "top-16")}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{__npmCommand__ && __yarnCommand__ && __pnpmCommand__ && (
|
{__npmCommand__ &&
|
||||||
<CopyNpmCommandButton
|
__yarnCommand__ &&
|
||||||
commands={{
|
__pnpmCommand__ &&
|
||||||
__npmCommand__,
|
__bunCommand__ && (
|
||||||
__pnpmCommand__,
|
<CopyNpmCommandButton
|
||||||
__yarnCommand__,
|
commands={{
|
||||||
}}
|
__npmCommand__,
|
||||||
className={cn("absolute right-4 top-4", __withMeta__ && "top-16")}
|
__yarnCommand__,
|
||||||
/>
|
__pnpmCommand__,
|
||||||
)}
|
__bunCommand__,
|
||||||
|
}}
|
||||||
|
className={cn("absolute right-4 top-4", __withMeta__ && "top-16")}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</StyleWrapper>
|
</StyleWrapper>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ export function rehypeNpmCommand() {
|
|||||||
"npm install",
|
"npm install",
|
||||||
"pnpm add"
|
"pnpm add"
|
||||||
)
|
)
|
||||||
|
node.properties["__bunCommand__"] = npmCommand.replace(
|
||||||
|
"npm install",
|
||||||
|
"bun add"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// npx create.
|
// npx create.
|
||||||
@@ -34,6 +38,7 @@ export function rehypeNpmCommand() {
|
|||||||
"npx create-",
|
"npx create-",
|
||||||
"pnpm create "
|
"pnpm create "
|
||||||
)
|
)
|
||||||
|
node.properties["__bunCommand__"] = npmCommand.replace("npx", "bunx")
|
||||||
}
|
}
|
||||||
|
|
||||||
// npx.
|
// npx.
|
||||||
@@ -48,6 +53,7 @@ export function rehypeNpmCommand() {
|
|||||||
"npx",
|
"npx",
|
||||||
"pnpm dlx"
|
"pnpm dlx"
|
||||||
)
|
)
|
||||||
|
node.properties["__bunCommand__"] = npmCommand.replace("npx", "bunx")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ export default function ComboboxForm() {
|
|||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent className="w-[200px] p-0">
|
<PopoverContent className="w-[200px] p-0">
|
||||||
<Command>
|
<Command>
|
||||||
<CommandInput placeholder="Search framework..." />
|
<CommandInput placeholder="Search language..." />
|
||||||
<CommandEmpty>No framework found.</CommandEmpty>
|
<CommandEmpty>No language found.</CommandEmpty>
|
||||||
<CommandGroup>
|
<CommandGroup>
|
||||||
{languages.map((language) => (
|
{languages.map((language) => (
|
||||||
<CommandItem
|
<CommandItem
|
||||||
|
|||||||
@@ -10,13 +10,7 @@ const AlertDialog = AlertDialogPrimitive.Root
|
|||||||
|
|
||||||
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
||||||
|
|
||||||
const AlertDialogPortal = ({
|
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
||||||
className,
|
|
||||||
...props
|
|
||||||
}: AlertDialogPrimitive.AlertDialogPortalProps) => (
|
|
||||||
<AlertDialogPrimitive.Portal className={cn(className)} {...props} />
|
|
||||||
)
|
|
||||||
AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName
|
|
||||||
|
|
||||||
const AlertDialogOverlay = React.forwardRef<
|
const AlertDialogOverlay = React.forwardRef<
|
||||||
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
||||||
@@ -134,6 +128,8 @@ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
|
AlertDialogPortal,
|
||||||
|
AlertDialogOverlay,
|
||||||
AlertDialogTrigger,
|
AlertDialogTrigger,
|
||||||
AlertDialogContent,
|
AlertDialogContent,
|
||||||
AlertDialogHeader,
|
AlertDialogHeader,
|
||||||
|
|||||||
@@ -10,13 +10,7 @@ const Dialog = DialogPrimitive.Root
|
|||||||
|
|
||||||
const DialogTrigger = DialogPrimitive.Trigger
|
const DialogTrigger = DialogPrimitive.Trigger
|
||||||
|
|
||||||
const DialogPortal = ({
|
const DialogPortal = DialogPrimitive.Portal
|
||||||
className,
|
|
||||||
...props
|
|
||||||
}: DialogPrimitive.DialogPortalProps) => (
|
|
||||||
<DialogPrimitive.Portal className={cn(className)} {...props} />
|
|
||||||
)
|
|
||||||
DialogPortal.displayName = DialogPrimitive.Portal.displayName
|
|
||||||
|
|
||||||
const DialogOverlay = React.forwardRef<
|
const DialogOverlay = React.forwardRef<
|
||||||
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
||||||
@@ -114,6 +108,8 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
Dialog,
|
Dialog,
|
||||||
|
DialogPortal,
|
||||||
|
DialogOverlay,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
|
|||||||
@@ -40,7 +40,12 @@ const ScrollBar = React.forwardRef<
|
|||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
<ScrollAreaPrimitive.ScrollAreaThumb
|
||||||
|
className={cn(
|
||||||
|
"relative rounded-full bg-border",
|
||||||
|
orientation === "vertical" && "flex-1"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
||||||
))
|
))
|
||||||
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ SheetDescription.displayName = SheetPrimitive.Description.displayName
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
Sheet,
|
Sheet,
|
||||||
|
SheetPortal,
|
||||||
|
SheetOverlay,
|
||||||
SheetTrigger,
|
SheetTrigger,
|
||||||
SheetClose,
|
SheetClose,
|
||||||
SheetContent,
|
SheetContent,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const Table = React.forwardRef<
|
|||||||
HTMLTableElement,
|
HTMLTableElement,
|
||||||
React.HTMLAttributes<HTMLTableElement>
|
React.HTMLAttributes<HTMLTableElement>
|
||||||
>(({ className, ...props }, ref) => (
|
>(({ className, ...props }, ref) => (
|
||||||
<div className="w-full overflow-auto">
|
<div className="relative w-full overflow-auto">
|
||||||
<table
|
<table
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn("w-full caption-bottom text-sm", className)}
|
className={cn("w-full caption-bottom text-sm", className)}
|
||||||
|
|||||||
@@ -10,13 +10,7 @@ const AlertDialog = AlertDialogPrimitive.Root
|
|||||||
|
|
||||||
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
||||||
|
|
||||||
const AlertDialogPortal = ({
|
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
||||||
className,
|
|
||||||
...props
|
|
||||||
}: AlertDialogPrimitive.AlertDialogPortalProps) => (
|
|
||||||
<AlertDialogPrimitive.Portal className={cn(className)} {...props} />
|
|
||||||
)
|
|
||||||
AlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName
|
|
||||||
|
|
||||||
const AlertDialogOverlay = React.forwardRef<
|
const AlertDialogOverlay = React.forwardRef<
|
||||||
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
||||||
@@ -134,6 +128,8 @@ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
|
AlertDialogPortal,
|
||||||
|
AlertDialogOverlay,
|
||||||
AlertDialogTrigger,
|
AlertDialogTrigger,
|
||||||
AlertDialogContent,
|
AlertDialogContent,
|
||||||
AlertDialogHeader,
|
AlertDialogHeader,
|
||||||
|
|||||||
@@ -10,13 +10,7 @@ const Dialog = DialogPrimitive.Root
|
|||||||
|
|
||||||
const DialogTrigger = DialogPrimitive.Trigger
|
const DialogTrigger = DialogPrimitive.Trigger
|
||||||
|
|
||||||
const DialogPortal = ({
|
const DialogPortal = DialogPrimitive.Portal
|
||||||
className,
|
|
||||||
...props
|
|
||||||
}: DialogPrimitive.DialogPortalProps) => (
|
|
||||||
<DialogPrimitive.Portal className={cn(className)} {...props} />
|
|
||||||
)
|
|
||||||
DialogPortal.displayName = DialogPrimitive.Portal.displayName
|
|
||||||
|
|
||||||
const DialogOverlay = React.forwardRef<
|
const DialogOverlay = React.forwardRef<
|
||||||
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
||||||
@@ -114,6 +108,8 @@ DialogDescription.displayName = DialogPrimitive.Description.displayName
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
Dialog,
|
Dialog,
|
||||||
|
DialogPortal,
|
||||||
|
DialogOverlay,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
|
|||||||
@@ -40,7 +40,12 @@ const ScrollBar = React.forwardRef<
|
|||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
<ScrollAreaPrimitive.ScrollAreaThumb
|
||||||
|
className={cn(
|
||||||
|
"relative rounded-full bg-border",
|
||||||
|
orientation === "vertical" && "flex-1"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
||||||
))
|
))
|
||||||
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ SheetDescription.displayName = SheetPrimitive.Description.displayName
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
Sheet,
|
Sheet,
|
||||||
|
SheetPortal,
|
||||||
|
SheetOverlay,
|
||||||
SheetTrigger,
|
SheetTrigger,
|
||||||
SheetClose,
|
SheetClose,
|
||||||
SheetContent,
|
SheetContent,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const Table = React.forwardRef<
|
|||||||
HTMLTableElement,
|
HTMLTableElement,
|
||||||
React.HTMLAttributes<HTMLTableElement>
|
React.HTMLAttributes<HTMLTableElement>
|
||||||
>(({ className, ...props }, ref) => (
|
>(({ className, ...props }, ref) => (
|
||||||
<div className="w-full overflow-auto">
|
<div className="relative w-full overflow-auto">
|
||||||
<table
|
<table
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn("w-full caption-bottom text-sm", className)}
|
className={cn("w-full caption-bottom text-sm", className)}
|
||||||
|
|||||||
@@ -27,4 +27,5 @@ export interface NpmCommands {
|
|||||||
__npmCommand__?: string
|
__npmCommand__?: string
|
||||||
__yarnCommand__?: string
|
__yarnCommand__?: string
|
||||||
__pnpmCommand__?: string
|
__pnpmCommand__?: string
|
||||||
|
__bunCommand__?: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @shadcn/ui
|
# @shadcn/ui
|
||||||
|
|
||||||
|
## 0.4.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1662](https://github.com/shadcn-ui/ui/pull/1662) [`95a9673`](https://github.com/shadcn-ui/ui/commit/95a9673b1ec6a1954d941d35624ad2cd93faccc4) Thanks [@shadcn](https://github.com/shadcn)! - minify build
|
||||||
|
|
||||||
## 0.4.0
|
## 0.4.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "shadcn-ui",
|
"name": "shadcn-ui",
|
||||||
"version": "0.4.0",
|
"version": "0.4.1",
|
||||||
"description": "Add components to your apps.",
|
"description": "Add components to your apps.",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export default defineConfig({
|
|||||||
entry: ["src/index.ts"],
|
entry: ["src/index.ts"],
|
||||||
format: ["esm"],
|
format: ["esm"],
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
|
minify: true,
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
outDir: "dist",
|
outDir: "dist",
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user