ais-toolkit v1.0.3
ais-toolkit
Overview
ais-toolkit
is a library of reusable React components built with TypeScript. These components, including buttons, inputs, and forms, are styled with TailwindCSS and optimized for modern React applications. This package provides a robust starting point for creating and scaling component libraries.
Features
- Customizable Components: Includes
Text
,Link
,Button
,Input
,Pagination
,List
,Select
, andSimpleSearchForm
. - TailwindCSS Styling: Pre-styled components for seamless integration.
- TypeScript Ready: Fully typed for enhanced development safety.
- Storybook Support: Component visualization and documentation.
- Optimized Builds: Rollup configuration for ES modules and CommonJS outputs.
Components
Form / Button
A flexible and customizable button component styled with TailwindCSS.
Form / Input
A versatile input component supporting various types, validations, and styles.
Component / SimpleSearchForm
A search form component with built-in input validation for streamlined search functionality.
Installation
Install the library with:
npm install ais-toolkit
Usage Example
import React from 'react';
import { SimpleSearchForm } from 'ais-toolkit';
const App = () => {
const handleSubmit = (data: { query: string }) => {
console.log('Searching:', data);
};
return (
<div className="p-4">
<h1 className="text-2xl font-bold">My App</h1>
<SimpleSearchForm onSubmit={handleSubmit} className="p-4" />
</div>
);
};
export default App;
Development
Follow these steps to contribute or develop the library:
Prerequisites
- Node.js (>= 16.0.0)
- npm (>= 7.0.0)
Getting Started
Clone the repository:
git clone https://github.com/sowamateusz/ais-toolkit.git cd ais-toolkit
Install dependencies:
npm install
Scripts
Build the Library:
npm run build
Run Storybook:
npm run storybook
Type Checking:
npm run type-check
Publishing to npm
Prerequisites
- An npm account (Sign up here)
- Ownership or maintenance rights to the
ais-toolkit
package.
Publishing Steps
Update Version: Modify the
version
inpackage.json
according to semantic versioning.Build and Test:
npm run build
Login to npm:
npm login
Publish the Package:
npm publish --access public
Updating Existing Versions
- Increment the version in
package.json
. - Rebuild and verify:
npm run build
- Publish the update:
npm publish
Contributing
We welcome contributions! To get started:
- Fork the repository.
- Create a feature branch.
- Submit a pull request with detailed changes.
License
This project is licensed under the ISC License. See the LICENSE file for details.
Questions
For questions or feedback, open an issue on GitHub or contact the author.