Skip to content

Implement component library structure with shadcn/ui#26

Open
Copilot wants to merge 5 commits into
mainfrom
copilot/add-component-library-structure
Open

Implement component library structure with shadcn/ui#26
Copilot wants to merge 5 commits into
mainfrom
copilot/add-component-library-structure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 6, 2025

Establishes organized component architecture with shadcn/ui integration per issue #10.

Structure

src/
├── components/
│   ├── ui/              # 16 shadcn base components
│   ├── features/        # Feature-specific components
│   ├── layouts/         # Layout components
│   └── providers/       # Context providers
├── hooks/               # Custom React hooks
├── utils/               # Utility functions
├── types/               # Shared TypeScript types
└── constants/           # App constants

Each directory includes README with purpose and guidelines.

Components Added

Forms: Input, Select, Checkbox, Label, Textarea
Layout: Card (with Header/Title/Description/Content/Footer), Separator
Feedback: Dialog/Modal, Alert, Skeleton
Interactive: Button (6 variants), Badge, Avatar, Tabs

Implementation

  • Created cn() utility for class merging with clsx + tailwind-merge
  • Configured globals.css with shadcn color system and CSS variables
  • Updated NumberedList to use cn() instead of string concatenation
  • All components typed with TypeScript, exported via index.ts
  • Complete Storybook documentation for all components

Storybook Documentation

All components are fully documented in Storybook with multiple variants and examples:

Button Component

Button Component

Card Component

Card Component

Input Component

Input Component

Dialog/Modal Component

Dialog Component

Usage

import { Button, Card, CardHeader, CardTitle, CardContent, Input, Label } from "@/components/ui"

export function ContactForm() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Contact Us</CardTitle>
      </CardHeader>
      <CardContent className="space-y-4">
        <div>
          <Label htmlFor="email">Email</Label>
          <Input id="email" type="email" placeholder="your@email.com" />
        </div>
        <Button>Submit</Button>
      </CardContent>
    </Card>
  )
}

View all components and their variants in Storybook by running pnpm storybook.


Fixes #25

Original prompt

This section details on the original issue you should resolve

<issue_title>Component Library Structure</issue_title>
<issue_description>### 10. 🏗️ Component Library Structure
Priority: Medium

Organized component patterns.

Structure:

src/ 
  components/ 
    ui/           # Base UI components (Button, Input, Card, etc.) 
    features/     # Feature-specific components 
    layouts/      # Layout components (Header, Footer, Sidebar) 
    providers/    # Context providers 
  hooks/          # Custom React hooks 
  utils/          # Utility functions 
  types/          # Shared TypeScript types 
  constants/      # App constants 

Examples to add (use shadcn):

  • Form components (Input, Select, Checkbox and more)
  • Modal/Dialog component
  • Cards
  • Loading states and skeletons
  • 5 more shadcn ui components of your choice

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: DanStuartDept <87612831+DanStuartDept@users.noreply.github.com>
@DanStuartDept DanStuartDept marked this pull request as ready for review November 6, 2025 23:20
Co-authored-by: DanStuartDept <87612831+DanStuartDept@users.noreply.github.com>
Copilot AI changed the title [WIP] Add structure for component library with examples Implement component library structure with shadcn/ui Nov 6, 2025
Copilot AI requested a review from DanStuartDept November 6, 2025 23:26
Copy link
Copy Markdown
Owner

@DanStuartDept DanStuartDept left a comment

Choose a reason for hiding this comment

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

Fix the conflicts @copilot

@DanStuartDept
Copy link
Copy Markdown
Owner

@copilot i dont want the demo page. im happy with just documenting these in storybook. please update PR description with screenshots of the new components you added in storybook.

also fyi, the main branch has been updated and your PR branch is out of date.

Co-authored-by: DanStuartDept <87612831+DanStuartDept@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 7, 2025

@copilot i dont want the demo page. im happy with just documenting these in storybook. please update PR description with screenshots of the new components you added in storybook.

also fyi, the main...

Removed the demo page and created comprehensive Storybook stories for all 14 UI components. The PR description has been updated with screenshots from Storybook showing the Button, Card, Input, and Dialog components. All components are now fully documented with multiple variants and examples. (commit 3559827)

Fix the conflicts @copilot

Conflicts resolved and merged with main branch. All components are working correctly with the latest codebase. (commit 58ad9f0)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • storybook.js.org
    • Triggering command: node /home/REDACTED/work/example-next-product/example-next-product/node_modules/.bin/../storybook/dist/bin/dispatcher.js dev -p 6006 --port 6006 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Co-authored-by: DanStuartDept <87612831+DanStuartDept@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Component Library Structure

2 participants