@code-sherpas/pharos-react
v0.10.0
Published
React component library for Code Sherpas. Consumes @code-sherpas/pharos-tokens. Vite library mode + CSS Modules — no Tailwind, no CSS framework required at the consumer.
Readme
@code-sherpas/pharos-react
React component library for Code Sherpas. Consumes
@code-sherpas/pharos-tokens
as a peer dependency. Built with Vite library mode, React 19 and CSS Modules.
The published bundle ships zero Tailwind, zero PostCSS preflight and zero
global resets — see Decision D9 in PLAN-pharos-alexandria.md.
What's in this package
This package provides the React component layer of Code Sherpas's design
system. It does not define design values — those live in pharos-tokens.
Installation
pnpm add @code-sherpas/pharos-react @code-sherpas/pharos-tokens
# or npm / yarn@code-sherpas/pharos-tokens is a peer dependency and must be installed
explicitly alongside this package.
Usage
// Root entry file (e.g. main.tsx, app/layout.tsx). Import once.
import '@code-sherpas/pharos-tokens/css'; // CSS variables for the design tokens
import '@code-sherpas/pharos-react/styles.css'; // hashed component stylesimport { Button } from '@code-sherpas/pharos-react';
export function Demo() {
return <Button intent="primary">Save changes</Button>;
}Rules for consumers
See RULES.md — published with the package.
Storybook
The live component reference runs on Storybook 10 + @storybook/react-vite.
pnpm storybook— dev server on port 6006.pnpm build-storybook— static build tostorybook-static/. The hosted URL will be published once Render deployment is wired up (phase 1B.4 / 1B.5).
Contributing
pnpm install- Implement the component under
src/components/<Name>.tsxplus its siblingsrc/components/<Name>.module.css(Decision D9). Export it fromsrc/index.ts. - Add a story alongside:
src/components/<Name>.stories.tsx. - Add tests under
tests/(Vitest + Testing Library). pnpm build— verify the Vite library bundle compiles cleanly.pnpm build-storybook— verify stories render.pnpm test/pnpm typecheck/pnpm lint/pnpm format:check.pnpm changeset— declare the type of change (patch / minor / major).- Open a PR.
License
MIT. See LICENSE.
