File tree Expand file tree Collapse file tree 3 files changed +61
-6
lines changed
.cursor/rules/product-component-requirements-mdc Expand file tree Collapse file tree 3 files changed +61
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,36 @@ alwaysApply: false
77
88# Product Detail Component
99
10- ## Data Model
10+ ## 🚀 Quick Start (Beginner)
11+ If you're new to product components, start here:
12+
13+ ### Basic Product Detail
14+ ```jsx
15+ const ProductDetail = ({ product, onAddToCart }) => {
16+ return (
17+ <div className="product-detail">
18+ <img src={product.image} alt={product.name} />
19+ <h1>{product.name}</h1>
20+ <p>{product.description}</p>
21+ <p>Price: {product.price}</p>
22+ <button onClick={() => onAddToCart(product)}>
23+ Add to Cart
24+ </button>
25+ </div>
26+ )
27+ }
28+ ```
29+
30+ ### Essential Props
31+ - `product`: Product data object
32+ - `onAddToCart`: Function to add product to cart
33+ - `className`: Optional styling
34+
35+ ---
36+
37+ ## 📋 Full Requirements (Advanced)
38+
39+ ### Data Model
1140- Product
1241- Product Bundle (parent with child items; only parent can be added to cart)
1342- Product Set (logical group; all items added to cart together, no parent/child)
Original file line number Diff line number Diff line change 11---
2- description: Product list component requirement template
2+ description: Product list component requirement template
33globs: "**/components/**"
44type: agent-requested
55alwaysApply: false
66---
77# Product List Component
88
9+ ## 🚀 Quick Start (Beginner)
10+ If you're new to product components, start here:
11+
12+ ### Basic Product List
13+ ```jsx
14+ const ProductList = ({ products, onAddToCart }) => {
15+ return (
16+ <div className="product-list">
17+ {products.map(product => (
18+ <ProductTile
19+ key={product.id}
20+ product={product}
21+ onAddToCart={onAddToCart}
22+ />
23+ ))}
24+ </div>
25+ )
26+ }
27+ ```
28+
29+ ### Essential Props
30+ - `products`: Array of product objects
31+ - `onAddToCart`: Function to add product to cart
32+ - `className`: Optional styling
33+
34+ ---
35+
36+ ## 📋 Full Requirements (Advanced)
37+
938## Data Model
1039- Array of Products (single items)
1140- Array of Product Bundles (parent with child items; only parent can be added to cart)
@@ -22,7 +51,7 @@ alwaysApply: false
2251- Empty state handling
2352- Product count display
2453- View mode persistence
25- - Responsive grid/list layouts
54+ - Responsive grid/list layout
2655- Bulk actions (add multiple to cart, wishlist)
2756
2857## Look & Feel
Original file line number Diff line number Diff line change @@ -4,9 +4,6 @@ globs: "**/components/**"
44type: agent-requested
55alwaysApply: false
66---
7- name: Product Tile Component
8- description: Requirements and examples for creating product tile components (cards, grid items)
9- globs: ["**/components/**"]
107
118# Product Tile Component
129
You can’t perform that action at this time.
0 commit comments