Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 2 additions & 59 deletions apps/ui-layout/components/website/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,2 @@
import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
import { cva, type VariantProps } from 'class-variance-authority';

import { cn } from '@/lib/utils';

const buttonVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
{
variants: {
variant: {
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
destructive:
'bg-destructive text-destructive-foreground hover:bg-destructive/90',
outline:
'border border-input dark:bg-neutral-800 bg-neutral-50 hover:bg-accent hover:text-accent-foreground',
secondary:
'bg-secondary text-secondary-foreground hover:bg-secondary/80',
ghost: 'hover:bg-accent hover:text-accent-foreground',
link: 'text-primary underline-offset-4 hover:underline',
uilayouts:
'dark:bg-zinc-900 bg-neutral-200 dark:text-white text-black border dark:border-neutral-800',
},
size: {
default: 'h-10 px-4 py-2',
sm: 'h-9 rounded-md px-3',
lg: 'h-11 rounded-md px-8',
icon: 'h-10 w-10',
},
},
defaultVariants: {
variant: 'default',
size: 'default',
},
}
);

export interface ButtonProps
extends
React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : 'button';
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
}
);
Button.displayName = 'Button';

export { Button, buttonVariants };
export { Button, buttonVariants } from '@repo/shadcn'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the local uilayouts button variant

Re-exporting the shared package button drops the app-specific uilayouts variant that this file used to define. The website still renders <Button variant='uilayouts'> in apps/ui-layout/components/website/copy-page.tsx lines 82 and 136, and the shared packages/shadcn/src/ui/button.tsx variant map has no uilayouts entry, so those copy-page controls lose their intended dark/light border styling at runtime rather than behaving like the previous local button.

Useful? React with 👍 / 👎.

export type { ButtonProps } from '@repo/shadcn'
6 changes: 5 additions & 1 deletion apps/ui-layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@
"unist-util-visit": "^5.1.0",
"vaul": "^1.0.0",
"zod": "^3.23.8",
"zustand": "5.0.0-rc.2"
"zustand": "5.0.0-rc.2",
"@base-ui-components/react": "^1.0.0-beta.3",
"@radix-ui/react-accordion": "^1.2.4",
"@radix-ui/react-collapsible": "^1.1.4",
"@radix-ui/react-separator": "^1.1.4"
Comment on lines +81 to +84

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the Bun lockfile with the new dependencies

These newly added packages are not represented anywhere in the committed bun.lock (I checked with rg for @base-ui-components/react, @radix-ui/react-accordion, @radix-ui/react-collapsible, and @radix-ui/react-separator). In environments that install with bun install --frozen-lockfile—whose help says it disallows lockfile changes—the install cannot materialize the new dependencies required by the new accordion import, so the lockfile needs to be regenerated and committed with the package.json changes.

Useful? React with 👍 / 👎.

},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.14",
Expand Down
13 changes: 12 additions & 1 deletion packages/shadcn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@
"clsx": "^2.1.1",
"lucide-react": "^0.344.0",
"react-day-picker": "^8.10.1",
"tailwind-merge": "^2.6.0"
"tailwind-merge": "^2.6.0",
"@base-ui-components/react": "^1.0.0-beta.3",
"@radix-ui/react-accordion": "^1.2.4",
"@radix-ui/react-collapsible": "^1.1.4",
"@radix-ui/react-separator": "^1.1.4",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-context-menu": "^2.2.16",
"@radix-ui/react-menubar": "^1.1.16",
"@radix-ui/react-progress": "^1.1.7",
"@radix-ui/react-radio-group": "^1.3.7",
"@radix-ui/react-toggle": "^1.1.11",
"@radix-ui/react-toggle-group": "^1.1.12"
},
"peerDependencies": {
"react": "^19.1.4",
Expand Down
39 changes: 39 additions & 0 deletions packages/shadcn/src/base-ui/accordion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use client'

import * as React from 'react'
import { Accordion as BaseAccordion } from '@base-ui-components/react/accordion'
import { ChevronDown } from 'lucide-react'

const cx = (...classes: Array<string | undefined>) => classes.filter(Boolean).join(' ')

function Root({ className, ...props }: React.ComponentProps<typeof BaseAccordion.Root> & { className?: string }) {
return <BaseAccordion.Root className={cx('w-full', className)} {...props} />
}

function Item({ className, ...props }: React.ComponentProps<typeof BaseAccordion.Item> & { className?: string }) {
return <BaseAccordion.Item className={cx('border-b', className)} {...props} />
}

function Trigger({ className, children, ...props }: React.ComponentProps<typeof BaseAccordion.Trigger> & { className?: string }) {
return (
<BaseAccordion.Header>
<BaseAccordion.Trigger
className={cx('flex w-full items-center justify-between py-4 text-left text-sm font-medium transition-all hover:underline', className)}
{...props}
>
{children}
<ChevronDown className="h-4 w-4 shrink-0 transition-transform data-[panel-open]:rotate-180" />
</BaseAccordion.Trigger>
</BaseAccordion.Header>
)
}

function Content({ className, children, ...props }: React.ComponentProps<typeof BaseAccordion.Panel> & { className?: string }) {
return (
<BaseAccordion.Panel className={cx('overflow-hidden text-sm', className)} {...props}>
<div className="pb-4 pt-0">{children}</div>
</BaseAccordion.Panel>
)
}

export const BaseUiAccordion = { Root, Item, Trigger, Content }
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/alert-dialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/alert-dialog'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/alert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/alert'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/aspect-ratio.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `aspect-ratio`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/aspect-ratio'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/badge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `badge`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/badge'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `button`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/button'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/calendar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `calendar`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/calendar'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `card`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/card'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/charts.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `charts`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/charts'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/checkbox'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/collapsible.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/collapsible'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/combobox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/combobox'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/command.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `command`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/command'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/context-menu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/context-menu'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/date-picker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/date-picker'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/dialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `dialog`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/dialog'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/drawer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `drawer`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/drawer'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/dropdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `dropdown`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/dropdown'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/form.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `form`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/form'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/hover-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `hover-card`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/hover-card'
42 changes: 42 additions & 0 deletions packages/shadcn/src/base-ui/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export * from './accordion'
export * from './aspect-ratio'
export * from './badge'
export * from './button'
export * from './calendar'
export * from './card'
export * from './charts'
export * from './command'
export * from './dialog'
export * from './drawer'
export * from './dropdown'
export * from './form'
export * from './hover-card'
export * from './input'
export * from './label'
export * from './navigation-menu'
export * from './plastic-button'
export * from './popover'
export * from './scroll-area'
export * from './slider'
export * from './switch'
export * from './tabs'
export * from './toast'
export * from './tooltip'
export * from './alert'
export * from './alert-dialog'
export * from './checkbox'
export * from './collapsible'
export * from './context-menu'
export * from './date-picker'
export * from './menubar'
export * from './progress'
export * from './radio-group'
export * from './select'
export * from './separator'
export * from './sheet'
export * from './skeleton'
export * from './sonner'
export * from './textarea'
export * from './toggle'
export * from './toggle-group'
export * from './combobox'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `input`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/input'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/label.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `label`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/label'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/menubar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/menubar'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/navigation-menu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `navigation-menu`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/navigation-menu'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/plastic-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `plastic-button`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/plastic-button'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/popover.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `popover`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/popover'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/progress.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/progress'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/radio-group.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/radio-group'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/scroll-area.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `scroll-area`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/scroll-area'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/select.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/select'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/separator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/separator'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/sheet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/sheet'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/skeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/skeleton'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/slider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `slider`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/slider'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/sonner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/sonner'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/switch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `switch`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/switch'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/tabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `tabs`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/tabs'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/textarea.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/textarea'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/toast.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `toast`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/toast'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/toggle-group.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/toggle-group'
1 change: 1 addition & 0 deletions packages/shadcn/src/base-ui/toggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '../ui/toggle'
3 changes: 3 additions & 0 deletions packages/shadcn/src/base-ui/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Base UI variant placeholder for `tooltip`.
// This currently re-exports the Radix/shadcn implementation to keep API parity.
export * from '../ui/tooltip'
3 changes: 3 additions & 0 deletions packages/shadcn/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export * from './ui'

export * from './base-ui/accordion'
export * from './base-ui'
Comment on lines +3 to +4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if base-ui/index.tsx re-exports accordion (would cause duplicate)
echo "=== Checking base-ui/index.tsx for accordion re-export ==="
cat packages/shadcn/src/base-ui/index.tsx 2>/dev/null || echo "File not found"

echo ""
echo "=== Checking base-ui modules for pass-through re-exports from ui ==="
# Look at a sample base-ui module to see if it re-exports with same names
rg -n "export.*from.*['\"]\.\.\/ui" packages/shadcn/src/base-ui/ --type tsx --type ts 2>/dev/null || \
rg -n "export.*from.*['\"]\.\.\/ui" packages/shadcn/src/base-ui/

echo ""
echo "=== Checking ui barrel for exported symbols ==="
cat packages/shadcn/src/ui/index.tsx 2>/dev/null | head -30

Repository: ui-layouts/uilayouts

Length of output: 1298


🏁 Script executed:

#!/bin/bash
echo "=== Checking what ui/button exports ==="
cat packages/shadcn/src/ui/button/index.tsx 2>/dev/null || echo "Not found"

echo ""
echo "=== Checking what base-ui/button exports ==="
cat packages/shadcn/src/base-ui/button/index.tsx 2>/dev/null || echo "Not found"

echo ""
echo "=== Checking what ui/badge exports ==="
cat packages/shadcn/src/ui/badge/index.tsx 2>/dev/null || echo "Not found"

echo ""
echo "=== Checking what base-ui/badge exports ==="
cat packages/shadcn/src/base-ui/badge/index.tsx 2>/dev/null || echo "Not found"

Repository: ui-layouts/uilayouts

Length of output: 275


🏁 Script executed:

#!/bin/bash
echo "=== Directory structure of packages/shadcn/src/ ==="
ls -la packages/shadcn/src/

echo ""
echo "=== Content of ui directory ==="
ls packages/shadcn/src/ui/ 2>/dev/null || echo "ui not found"

echo ""
echo "=== Content of base-ui directory ==="
ls packages/shadcn/src/base-ui/ 2>/dev/null | head -20 || echo "base-ui not found"

echo ""
echo "=== Files in ui directory (recursive, limiting to depth 2) ==="
find packages/shadcn/src/ui -maxdepth 2 -type f -name "*.tsx" -o -name "*.ts" 2>/dev/null | head -20

Repository: ui-layouts/uilayouts

Length of output: 1797


🏁 Script executed:

#!/bin/bash
echo "=== ui/button.tsx ==="
cat packages/shadcn/src/ui/button.tsx

echo ""
echo "=== base-ui/button.tsx ==="
cat packages/shadcn/src/base-ui/button.tsx

Repository: ui-layouts/uilayouts

Length of output: 2175


🏁 Script executed:

#!/bin/bash
echo "=== ui/accordion.tsx ==="
cat packages/shadcn/src/ui/accordion.tsx

echo ""
echo "=== base-ui/accordion.tsx ==="
cat packages/shadcn/src/base-ui/accordion.tsx

Repository: ui-layouts/uilayouts

Length of output: 3671


Remove the redundant accordion export and the conflicting base-ui barrel.

Lines 3–4 cause export collisions:

  1. Duplicate accordion export: Line 3 exports BaseUiAccordion from ./base-ui/accordion, and line 4 re-exports it via ./base-ui (which includes export * from './accordion').

  2. Conflicting base-ui re-exports: Base-ui modules re-export identifiers from ui with identical names (e.g., export * from '../ui/button'). Lines 1 and 4 together create duplicate exports of Button, Badge, Tooltip, Command, Popover, and others, preventing bundler compilation.

Remove line 3 and either remove line 4 or line 1, depending on the intended export strategy.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/shadcn/src/index.tsx` around lines 3 - 4, The top-level exports in
packages/shadcn/src/index.tsx are causing duplicate exports: remove the explicit
accordion re-export and eliminate the conflicting base-ui barrel to avoid
duplicate symbols (e.g., BaseUiAccordion, Button, Badge, Tooltip, Command,
Popover); specifically delete the line exporting './base-ui/accordion' and
remove (or replace) the line exporting './base-ui' so you only export the
intended modules directly (or only export the base-ui barrel), ensuring no
duplicate re-exports of ui/button and other identical identifiers.

53 changes: 53 additions & 0 deletions packages/shadcn/src/ui/accordion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use client'

import * as React from 'react'
import * as AccordionPrimitive from '@radix-ui/react-accordion'
import { ChevronDown } from 'lucide-react'

import { cn } from '@/lib/utils'

const Accordion = AccordionPrimitive.Root

const AccordionItem = React.forwardRef<
React.ElementRef<typeof AccordionPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
>(({ className, ...props }, ref) => (
<AccordionPrimitive.Item ref={ref} className={cn('border-b', className)} {...props} />
))
AccordionItem.displayName = 'AccordionItem'

const AccordionTrigger = React.forwardRef<
React.ElementRef<typeof AccordionPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
>(({ className, children, ...props }, ref) => (
<AccordionPrimitive.Header className='flex'>
<AccordionPrimitive.Trigger
ref={ref}
className={cn(
'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180',
className
)}
{...props}
>
{children}
<ChevronDown className='h-4 w-4 shrink-0 transition-transform duration-200' />
</AccordionPrimitive.Trigger>
</AccordionPrimitive.Header>
))
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName

const AccordionContent = React.forwardRef<
React.ElementRef<typeof AccordionPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
>(({ className, children, ...props }, ref) => (
<AccordionPrimitive.Content
ref={ref}
className='overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down'
{...props}
>
<div className={cn('pb-4 pt-0', className)}>{children}</div>
</AccordionPrimitive.Content>
Comment on lines +43 to +49

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Apply className to AccordionPrimitive.Content, not the inner wrapper.

Current placement changes consumer-facing styling semantics and blocks overrides on the content root.

Proposed fix
   <AccordionPrimitive.Content
     ref={ref}
-    className='overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down'
+    className={cn(
+      'overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down',
+      className
+    )}
     {...props}
   >
-    <div className={cn('pb-4 pt-0', className)}>{children}</div>
+    <div className='pb-4 pt-0'>{children}</div>
   </AccordionPrimitive.Content>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/shadcn/src/ui/accordion.tsx` around lines 43 - 49, The
consumer-facing className is being applied to the inner wrapper instead of the
content root; change the placement so AccordionPrimitive.Content receives the
merged classes (including 'overflow-hidden text-sm
data-[state=closed]:animate-accordion-up
data-[state=open]:animate-accordion-down' and the incoming className via cn) and
remove className from the inner div that currently wraps children so that
consumers can override the content root; update the component that renders
AccordionPrimitive.Content (keeping ref, {...props}, children) to merge
cn(className, ...) onto AccordionPrimitive.Content instead of the inner <div>.

))
AccordionContent.displayName = AccordionPrimitive.Content.displayName

export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
11 changes: 11 additions & 0 deletions packages/shadcn/src/ui/alert-dialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Dialog, DialogTrigger, DialogContent, DialogTitle, DialogDescription, DialogClose } from './dialog'

const AlertDialog = Dialog
const AlertDialogTrigger = DialogTrigger
const AlertDialogContent = DialogContent
const AlertDialogTitle = DialogTitle
const AlertDialogDescription = DialogDescription
const AlertDialogCancel = DialogClose
const AlertDialogAction = DialogClose

export { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogTitle, AlertDialogDescription, AlertDialogCancel, AlertDialogAction }
11 changes: 11 additions & 0 deletions packages/shadcn/src/ui/alert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { cva, type VariantProps } from 'class-variance-authority'
import * as React from 'react'
import { cn } from '@/lib/utils'

const alertVariants = cva('relative w-full rounded-lg border p-4', { variants: { variant: { default: 'bg-background text-foreground', destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive' } }, defaultVariants: { variant: 'default' } })
export const Alert = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>>(({ className, variant, ...props }, ref) => <div ref={ref} role='alert' className={cn(alertVariants({ variant }), className)} {...props} />)
Alert.displayName = 'Alert'
export const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => <h5 ref={ref} className={cn('mb-1 font-medium leading-none tracking-tight', className)} {...props} />)
AlertTitle.displayName='AlertTitle'
export const AlertDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => <div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />)
AlertDescription.displayName='AlertDescription'
7 changes: 7 additions & 0 deletions packages/shadcn/src/ui/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use client'
import * as React from 'react'
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
import { Check } from 'lucide-react'
import { cn } from '@/lib/utils'
export const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>>(({ className, ...props }, ref)=><CheckboxPrimitive.Root ref={ref} className={cn('peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground', className)} {...props}><CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}><Check className='h-4 w-4'/></CheckboxPrimitive.Indicator></CheckboxPrimitive.Root>)
Checkbox.displayName=CheckboxPrimitive.Root.displayName
2 changes: 2 additions & 0 deletions packages/shadcn/src/ui/collapsible.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'use client'
export * from '@radix-ui/react-collapsible'
Loading