0.2.2 โ€ข Published 6 months ago

@re-shell/ui v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@re-shell/ui

A comprehensive, accessible, and customizable React component library for the Re-Shell microfrontend framework. Built with TypeScript and Tailwind CSS.

โœจ Features

  • ๐ŸŽจ 22+ Production-Ready Components - From basic buttons to complex data tables
  • ๐Ÿ”ง Highly Customizable - Multiple variants, sizes, and styling options
  • โ™ฟ Accessibility First - WCAG 2.1 compliant with proper ARIA attributes
  • ๐ŸŽฏ TypeScript Support - Full type safety with comprehensive interfaces
  • ๐Ÿ“ฑ Responsive Design - Mobile-first approach with responsive utilities
  • ๐ŸŽญ Multiple Variants - Different styles for every use case
  • ๐Ÿš€ Performance Optimized - Tree-shakeable with minimal bundle impact
  • ๐Ÿงช Well Tested - Comprehensive test coverage

๐Ÿ“ฆ Installation

npm install @re-shell/ui
# or
yarn add @re-shell/ui
# or
pnpm add @re-shell/ui

๐Ÿš€ Quick Start

import { Button, Card, CardHeader, CardBody, Input, Alert } from '@re-shell/ui';

function App() {
  return (
    <Card>
      <CardHeader>
        <h2>Welcome to Re-Shell UI</h2>
      </CardHeader>
      <CardBody>
        <Alert variant="success" title="Success!">
          Your component library is ready to use.
        </Alert>

        <Input label="Email" type="email" placeholder="Enter your email" leftIcon="mail" />

        <Button
          variant="primary"
          size="lg"
          leftIcon="check"
          onClick={() => console.log('Clicked!')}
        >
          Get Started
        </Button>
      </CardBody>
    </Card>
  );
}

๐Ÿ“š Component Categories

๐Ÿ”˜ Basic Components

  • Button - Enhanced button with icons, loading states, and multiple variants
  • Icon - Comprehensive icon library with 40+ SVG icons

๐Ÿ“ Form Components

  • Input - Text input with icons, validation, and multiple variants
  • Textarea - Multi-line text input with auto-resize and character count
  • Checkbox - Customizable checkbox with indeterminate state
  • Radio & RadioGroup - Radio buttons with group management
  • Select - Dropdown select with search and custom options
  • Switch - Toggle switch with smooth animations

๐Ÿ—๏ธ Layout Components

  • Card - Flexible card container with header, body, and footer
  • Divider - Horizontal and vertical dividers with labels

๐ŸŽญ Overlay Components

  • Modal - Accessible modal with focus management
  • Tooltip - Smart positioning tooltip with multiple triggers
  • Dropdown - Feature-rich dropdown menu with keyboard navigation

๐Ÿ’ฌ Feedback Components

  • Alert - Contextual alerts with icons and dismissible options
  • Spinner - Loading indicators with multiple animations
  • Progress - Progress bars with labels and animations

๐Ÿ“Š Data Display Components

  • Badge - Status indicators and labels
  • Avatar & AvatarGroup - User avatars with fallbacks and grouping
  • Tabs - Tabbed interface with multiple variants
  • Accordion - Collapsible content sections

๐Ÿงญ Navigation Components

  • Breadcrumb - Navigation breadcrumbs with overflow handling
  • Pagination - Page navigation with customizable display

๐ŸŽจ Styling & Theming

All components are built with Tailwind CSS and support:

  • Multiple Variants: primary, secondary, success, warning, error
  • Flexible Sizing: xs, sm, md, lg, xl, 2xl
  • Shape Options: rounded, pill, square, circle
  • Custom Classes: Override styles with className prop
<Button variant="primary" size="lg" shape="pill" className="custom-button-class">
  Custom Styled Button
</Button>

โ™ฟ Accessibility

Every component follows accessibility best practices:

  • Keyboard Navigation - Full keyboard support
  • Screen Reader Support - Proper ARIA labels and roles
  • Focus Management - Logical focus flow
  • Color Contrast - WCAG AA compliant colors
  • Semantic HTML - Proper HTML structure

๐Ÿ“– Component Examples

Enhanced Button

<Button
  variant="primary"
  size="md"
  leftIcon="plus"
  rightIcon="chevronDown"
  loading={isLoading}
  disabled={isDisabled}
  tooltip="Add new item"
  onClick={handleClick}
>
  Add Item
</Button>

Form with Validation

<form>
  <Input
    label="Email"
    type="email"
    leftIcon="mail"
    error={!!errors.email}
    errorMessage={errors.email}
    helperText="We'll never share your email"
  />

  <Switch label="Subscribe to newsletter" checked={subscribed} onChange={setSubscribed} />

  <Button type="submit" fullWidth>
    Submit
  </Button>
</form>

๐Ÿ”ง Development

# Install dependencies
npm install

# Start development server
npm run dev

# Build the package
npm run build

# Run tests
npm test

# Run linting
npm run lint

# Type checking
npm run type-check

๐Ÿ“ Contributing

We welcome contributions! Please see our Contributing Guide for details.

๐Ÿ“„ License

MIT License - see LICENSE for details.

0.2.2

6 months ago

0.2.0

6 months ago

0.1.0

7 months ago