npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aui-component-library

v1.0.12

Published

A react component library for Aui.

Downloads

224

Readme

AUI Component Library

A modern React component library built with TypeScript, providing customizable UI components for your applications.

Features

  • 🎨 Customizable UI components with SCSS styling
  • 📦 Tree-shakeable ESM and CommonJS builds
  • 🔧 TypeScript support with full type definitions
  • 💪 Built with React 17+ compatibility
  • ⚡ Storybook documentation and development environment
  • 🎬 Animation support via Framer Motion
  • 🎯 Icon support via Remix Icons

Installation

Using npm:

npm install aui-component-library

Usage Guide

Button Component

import { Button } from 'aui-component-library';

// Default Button
<Button>Click me</Button>

// Button variants
<Button variant="default">Default Button</Button>
<Button variant="outlined">Outlined Button</Button>
<Button variant="tertiary1">Tertiary 1</Button>
<Button variant="tertiary2">Tertiary 2</Button>

// Disabled state
<Button disabled>Disabled Button</Button>

// Props
interface ButtonProps {
  children: React.ReactNode;
  variant?: 'default' | 'outlined' | 'tertiary1' | 'tertiary2' | 'disabled';
  disabled?: boolean;
  onClick?: () => void;
}

Input Component

import { Input } from 'aui-component-library';

// Basic Input
<Input
  value={value}
  onChange={(e) => setValue(e.target.value)}
/>

// Input with validation
<Input
  value={value}
  onChange={handleChange}
  isError={true}
  errorMsg="This field is required"
/>

// Input with prefix/suffix
<Input
  value={value}
  onChange={handleChange}
  prefix={<Icon />}
  suffix={<SearchIcon />}
/>

// Props
interface InputProps {
  value: string | number | undefined;
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  type?: 'text' | 'email' | 'password' | 'number';
  placeholder?: string;
  isError?: boolean;
  errorMsg?: string;
  name?: string;
  required?: boolean;
  readOnly?: boolean;
  disabled?: boolean;
  prefix?: React.ReactNode;
  suffix?: React.ReactNode;
  style?: Record<'input' | 'container', Record<string, string>>;
}

SearchBar Component

import { SearchBar } from "aui-component-library";

// Basic SearchBar
<SearchBar
  value={searchTerm}
  onChange={(e) => setSearchTerm(e.target.value)}
/>;

// Props
interface SearchBarProps {
  value: string;
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
  placeholder?: string;
}

Prompt Component (Modal)

import { Prompt } from "aui-component-library";

// Basic Modal
<Prompt
  isOpen={isModalOpen}
  title="Confirmation"
  onClose={() => setModalOpen(false)}
  onSuccess={handleSuccess}
>
  <p>Are you sure you want to proceed?</p>
</Prompt>;

// Props
interface PromptProps {
  isOpen: boolean;
  title: string;
  children?: React.ReactNode;
  onClose: () => void;
  onSuccess: () => void | undefined;
  cancellable?: boolean;
}

Accordion Component

import { Accordion } from 'aui-component-library';

// Basic Accordion
<Accordion title="Click to expand">
  <p>This is the accordion content</p>
</Accordion>

// Styled Accordion
<Accordion
  title="Custom Styled Accordion"
  styles={{
    header: { backgroundColor: '#f5f5f5' },
    body: { padding: '1rem' },
    container: { border: '1px solid #ddd' }
  }}
>
  <div>Custom styled content</div>
</Accordion>

// Props
interface AccordionProps {
  title: React.ReactNode;
  children: React.ReactNode;
  styles?: {
    header?: Record<string, string>;
    body?: Record<string, string>;
    container?: Record<string, string>;
  };
}

Development

  1. Clone the repository:
git clone https://github.com/NowPurchase/Aui.git
  1. Install dependencies:
npm install
  1. Start development environment:
npm run dev

This will start both the Rollup build process in watch mode and Storybook development server.

Available Scripts

  • npm run dev - Start development environment
  • npm run build - Build the library
  • npm run storybook - Start Storybook development server
  • npm run build-storybook - Build Storybook for production
  • npm run build-library - Build everything (library + Storybook)
  • npm run clean - Clean build directories

License

ISC © [Sujan]

Contributing

Please read our contributing guidelines before submitting pull requests.

Issues

For bugs and feature requests, please create an issue.