An Nx monorepo implementing a locked-down design system based on @razorpay/blade with restricted color and spacing tokens.
This monorepo contains three packages:
- @workindia/tokens - Restricted design token definitions (colors, spacing, typography)
- @workindia/dsm - Design system wrapper that maps restricted tokens to Blade's theme structure
- @workindia/app - Example consumer application demonstrating proper usage
The design system enforces token lockdown through:
- TypeScript Types: Strong typing ensures only approved tokens are used
- ESLint Rules: Blocks direct imports from
@razorpay/bladein consumer apps - Theme Mapping: Maps restricted WorkIndia tokens to Blade's comprehensive theme structure
- Node.js >= 18.12.1
- npm
# Install dependencies
npm install# Build all packages
npm run build
# Build specific package
npm run build:tokens
npm run build:dsm
npm run build:app# Type check all packages
npm run typecheck
# Lint all packages
npm run lint
# Format code
npm run formatThe single source of truth for design tokens. Defines restricted colors, spacing, and typography values.
Restricted Colors:
brand.primary- Primary brand color (#005A9C)brand.secondary- Secondary brand color (#FF9900)feedback.success- Success state (#008000)feedback.error- Error state (#D9304F)text.body- Body text colortext.heading- Heading text colortext.subtle- Subtle text color
Restricted Spacing:
small- 8pxmedium- 16pxlarge- 24pxxlarge- 32px
Design system wrapper that:
- Maps restricted tokens to Blade's theme structure
- Provides
WorkIndiaProvidercomponent - Re-exports Blade components configured with WorkIndia theme
Example consumer application with ESLint rules that prevent direct Blade imports.
This project follows GitHub Flow - all work branches from main, and PRs merge back to main for automated releases.
See CONTRIBUTING.md for detailed development workflow, branching strategy, and release process.
This repository uses Changesets for version management and automated releases.
When you make changes that should be published, create a changeset:
npm run changesetThis will prompt you to:
- Select which packages have changed (
@workindia/tokens,@workindia/dsm) - Choose the type of change (major, minor, or patch)
- Write a summary of the changes
To bump versions based on changesets:
npm run versionThis updates package versions and CHANGELOG.md files based on changesets.
To publish packages to npm:
npm run releaseThis will build, test, and publish all packages with pending changesets.
The GitHub Actions workflow automatically:
- Creates a PR when changesets are added to main branch
- Publishes packages to npm when the version PR is merged
This repository uses npm's OIDC (OpenID Connect) Trusted Publishing for secure, token-less publishing. This eliminates the need for long-lived npm tokens.
For manual publishing, ensure you have:
- Created changesets for changed packages
- Bumped versions with
npm run version - Built and tested the packages
- Published with
npm run release
See .changeset/README.md for more details.
import { WorkIndiaProvider, Button, Heading } from '@workindia/dsm';
function App() {
return (
<WorkIndiaProvider>
<Heading>Welcome to WorkIndia</Heading>
<Button variant="primary">Apply Now</Button>
</WorkIndiaProvider>
);
}Important: Never import directly from @razorpay/blade in your applications. Always use @workindia/dsm.
MIT License - See LICENSE.md for details.
This project is built on top of @razorpay/blade, which is also licensed under MIT License.