diff --git a/src/components/design-system/Button.tsx b/src/components/design-system/Button.tsx deleted file mode 100644 index cb223e8..0000000 --- a/src/components/design-system/Button.tsx +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Button Component - * Luxury cosmetics brand button styles - * Variants: primary, secondary, accent, ghost - * Sizes: large, medium (default), small - */ - -import React from 'react'; - -export type ButtonVariant = 'primary' | 'secondary' | 'accent' | 'ghost'; -export type ButtonSize = 'small' | 'medium' | 'large'; - -interface ButtonProps extends React.ButtonHTMLAttributes { - variant?: ButtonVariant; - size?: ButtonSize; - children: React.ReactNode; - icon?: React.ReactNode; - loading?: boolean; - fullWidth?: boolean; -} - -export const Button = React.forwardRef( - ( - { - variant = 'primary', - size = 'medium', - children, - icon, - loading = false, - fullWidth = false, - disabled, - className = '', - ...props - }, - ref - ) => { - const baseClasses = 'button'; - const variantClasses = `btn-${variant}`; - const sizeClasses = size !== 'medium' ? `btn-${size}` : ''; - const widthClasses = fullWidth ? 'w-full' : ''; - const disabledClasses = disabled ? 'opacity-50 cursor-not-allowed' : ''; - - const allClasses = [ - baseClasses, - variantClasses, - sizeClasses, - widthClasses, - disabledClasses, - className, - ] - .filter(Boolean) - .join(' '); - - return ( - - ); - } -); - -Button.displayName = 'Button'; - -/** - * Icon Button Component - * Circular button for icon-only actions - */ -interface IconButtonProps extends React.ButtonHTMLAttributes { - icon: React.ReactNode; - ariaLabel: string; - size?: 'small' | 'medium' | 'large'; -} - -export const IconButton = React.forwardRef( - ({ icon, ariaLabel, size = 'medium', className = '', ...props }, ref) => { - const sizeMap = { - small: '36px', - medium: '44px', - large: '48px', - }; - - return ( - - ); - } -); - -IconButton.displayName = 'IconButton'; - -/** - * Button Group Component - * Multiple buttons with consistent spacing - */ -interface ButtonGroupProps { - children: React.ReactNode; - vertical?: boolean; - className?: string; -} - -export const ButtonGroup = ({ children, vertical = false, className = '' }: ButtonGroupProps) => { - const direction = vertical ? 'flex-col' : 'flex-row'; - return ( -
- {children} -
- ); -}; - -ButtonGroup.displayName = 'ButtonGroup'; diff --git a/src/components/design-system/Card.tsx b/src/components/design-system/Card.tsx deleted file mode 100644 index 038254c..0000000 --- a/src/components/design-system/Card.tsx +++ /dev/null @@ -1,203 +0,0 @@ -/** - * Card Components - * Reusable card layouts for various content types - * Variants: default, product, feature - */ - -import React from 'react'; - -interface CardProps { - children: React.ReactNode; - hoverable?: boolean; - className?: string; -} - -export const Card = ({ children, hoverable = true, className = '' }: CardProps) => { - return ( -
- {children} -
- ); -}; - -/** - * Product Card Component - * Displays product image, name, price, rating, and actions - */ -interface ProductCardProps { - image: string; - imageAlt: string; - name: string; - category?: string; - price: number; - originalPrice?: number; - rating?: number; - reviewCount?: number; - onAddToCart?: () => void; - onViewDetails?: () => void; - className?: string; -} - -export const ProductCard = ({ - image, - imageAlt, - name, - category, - price, - originalPrice, - rating, - reviewCount, - onAddToCart, - onViewDetails, - className = '', -}: ProductCardProps) => { - const discountPercent = - originalPrice && price < originalPrice - ? Math.round(((originalPrice - price) / originalPrice) * 100) - : null; - - return ( -
- {/* Product Image */} -
- {imageAlt} - {discountPercent && ( -
- -{discountPercent}% -
- )} - {category && ( -
- {category} -
- )} -
- - {/* Product Info */} -
-

{name}

- - {/* Rating */} - {rating !== undefined && ( -
- ★★★★★ - - {rating} ({reviewCount} reviews) - -
- )} - - {/* Price */} -
- ${price.toFixed(2)} - {originalPrice && price < originalPrice && ( - ${originalPrice.toFixed(2)} - )} -
- - {/* Actions */} -
- - -
-
-
- ); -}; - -/** - * Feature Card Component - * Highlights a feature with icon, title, and description - */ -interface FeatureCardProps { - icon: React.ReactNode; - title: string; - description: string; - href?: string; - className?: string; -} - -export const FeatureCard = ({ - icon, - title, - description, - href, - className = '', -}: FeatureCardProps) => { - const content = ( -
-
{icon}
-

{title}

-

{description}

-
- ); - - if (href) { - return {content}; - } - - return content; -}; - -/** - * Stat Card Component - * Display key metrics/KPIs - */ -interface StatCardProps { - label: string; - value: string | number; - change?: { - value: number; - direction: 'up' | 'down'; - }; - icon?: React.ReactNode; - className?: string; -} - -export const StatCard = ({ label, value, change, icon, className = '' }: StatCardProps) => { - return ( -
- {icon &&
{icon}
} -

{label}

-

{value}

- {change && ( -
- {change.direction === 'up' ? '↑' : '↓'} {Math.abs(change.value)}% -
- )} -
- ); -}; - -/** - * Card Grid Component - * Responsive grid of cards - */ -interface CardGridProps { - children: React.ReactNode; - columns?: 1 | 2 | 3 | 4; - gap?: 'sm' | 'md' | 'lg' | 'xl'; - className?: string; -} - -export const CardGrid = ({ - children, - columns = 3, - gap = 'lg', - className = '', -}: CardGridProps) => { - const gridClass = `grid--${columns}`; - const gapClass = `gap-${gap}`; - - return ( -
- {children} -
- ); -};