@gethashd/components
v1.0.0
Published
HASHD semantic design system - CSS and React components
Maintainers
Readme
@hashd/components
HASHD semantic design system - CSS and React components
Overview
This package serves dual purposes:
- Standalone Style Guide App - Interactive documentation of all design system components
- NPM Package - Reusable design system for HASHD projects
Quick Start
Running the Style Guide (Standalone)
View the interactive component documentation:
cd styles
yarn install
yarn startThe style guide will open at http://localhost:3001
Using as NPM Package
Install in your project:
# Local development (from project root)
yarn add @hashd/components@file:../styles
# From npm (when published)
yarn add @hashd/componentsImport CSS in your app:
// In your main entry file (index.tsx or App.tsx)
import '@hashd/components/dist/styles.css';Import React components:
import { HashdComponents } from '@hashd/components';
function App() {
return <HashdComponents />;
}Package Structure
styles/
├── public/ # HTML template for standalone app
│ └── index.html
├── src/
│ ├── index.tsx # React entry point (standalone app)
│ ├── index.ts # Package entry point (exports)
│ ├── index.css # Main CSS entry point
│ ├── css/ # Semantic CSS modules
│ │ ├── _variables.css
│ │ ├── _typography.css
│ │ ├── _buttons.css
│ │ ├── _cards.css
│ │ ├── _inputs.css
│ │ ├── _badges.css
│ │ ├── _modals.css
│ │ └── _utilities.css
│ └── components/
│ └── HashdComponents.tsx
├── dist/ # Built output (generated)
├── package.json
├── tsconfig.json
└── README.mdDevelopment
Building the Package
yarn buildThis runs two build steps:
build:ts- Compiles TypeScript to JavaScriptbuild:css- Copies CSS files to dist folder
Development Mode
Watch mode for TypeScript changes:
yarn devClean Build
Remove build artifacts:
yarn cleanPublishing to NPM
When ready to publish:
- Update version:
npm version patch # or minor, or major- Build the package:
yarn build- Publish:
npm publish --access public- Update consuming projects:
yarn add @hashd/components@latestLicense
MIT © 3oh Inc
