A comprehensive React UI library and design system built for Minutemailer. Built on top of shadcn/ui and Tailwind CSS, this kit provides utilities, icons, state management, and components for building consistent user interfaces.
npm install @minutemailer/kit
The kit exports four main modules:
import {
strToDate,
zeroPad,
replacePlaceholders,
choice,
capitalize,
objToQuery,
} from '@minutemailer/kit/utils';
import { Alert, Arrow, Check, Close } from '@minutemailer/kit/icons';
import { createStore, getStore, useSelector } from '@minutemailer/kit/store';
// Create a store
const userStore = createStore('user', { name: '', email: '' }, (state, action) => {
switch (action.type) {
case 'SET_NAME':
return { ...state, name: action.value };
default:
return state;
}
});
// Use in React components
function UserProfile() {
const name = useSelector('user', state => state.name);
return <div>{name}</div>;
}
import { createMachine } from '@minutemailer/kit/state';
const machine = createMachine(
{
IDLE: { on: { START: 'LOADING' } },
LOADING: { on: { SUCCESS: 'IDLE', ERROR: 'ERROR' } },
ERROR: { on: { RETRY: 'LOADING' } },
},
{
START: (context) => ({ ...context, loading: true }),
SUCCESS: (context) => ({ ...context, loading: false }),
},
{ loading: false },
);
git clone <repository-url>
cd kit
npm install
npm start - Start Storybook development servernpm test - Run testsnpm run build - Build the librarynpm run icons:build - Generate icon components from SVG filesnpm run docs - Generate documentationPlace SVG files in resources/icons/ and run:
npm run icons:build
This will generate React components in src/icons/ using SVGR.
Built with:
Notes:
Follow this workflow when introducing a new UI component to the kit:
Add from shadcn registry
src/components/ui.Create a Storybook story in the category WIP
src/stories and set title to start with WIP/, for example: title: 'WIP/Button'..storybook/preview.tsx).Theme it
Move to category UI once ready
title from WIP/... to UI/... and adjust the file if needed.MIT
This library is built specifically for Minutemailer's design system. For contributions, please follow the existing patterns and ensure all changes maintain consistency with the Minutemailer brand.