The repo moved from a local Gitea to a public one at git.openkhalix.com, renamed ui-showcase to tansy-ui. Add the repository and bugs fields so the npm page links to the source and its issue tracker, and record it under Unreleased for 0.4.1.
Tansy UI
A themeable, accessible React component kit by OpenKhalix.
Website ·
Storybook ·
Source ·
Package README ·
Changelog
Tansy UI is named after the tansy flower, also called golden buttons: many small, round heads that read
as one bloom. It is published to npm as @openkhalix/tansy-ui:
npm install @openkhalix/tansy-ui
See the package README for setup and usage.
Repository layout
This is an npm workspaces monorepo, laid out the way MUI and shadcn/ui lay out theirs:
| Path | Package | Published | What it is |
|---|---|---|---|
packages/ui |
@openkhalix/tansy-ui |
yes | The components, their stories and tests, tokens, and the library build |
packages/brand |
@tansy/brand |
no | The Tansy mark and the component catalogue, shared by both apps |
apps/site |
@tansy/site |
no | The landing page at ui.openkhalix.com |
apps/docs |
@tansy/docs |
no | Storybook at ui.openkhalix.com/docs |
docs |
Conventions and roadmap | ||
scripts |
Deploy, story checks, package install tests, catalogue generator |
The apps depend on the package through its real exports. In this repo they resolve its source export
condition, so editing a component hot-reloads the landing page and Storybook without a rebuild. Outside
users get the built files in dist/.
Develop
npm install
npm run dev # landing page at http://localhost:5173
npm run storybook # Storybook at http://localhost:6006
npm run lint
npm run typecheck
npm test # unit, keyboard and axe tests for every component
npm run build # package, then landing page, then Storybook
Checks before a release
npm run build:docs
node scripts/check-stories.mjs --mode light # every story in Chrome: errors and axe
node scripts/check-stories.mjs --mode dark
node scripts/check-stories.mjs --width 320 # nothing may scroll sideways on phones
npm run test:package # packs the package and installs it into Vite + Tailwind,
# plain React and Next.js apps; each must build and render
Adding a component: follow docs/CONVENTIONS.md, export it from
packages/ui/src/index.ts, then run python3 scripts/gen_catalogue.py --patch after npm run build:docs
to refresh the landing page catalogue.
Release
- Move the Unreleased notes in
packages/ui/CHANGELOG.mdunder the new version and setversioninpackages/ui/package.json. - Run the checks above.
- Commit, tag and push:
git tag -a v0.4.0 -m "Tansy UI v0.4.0" && git push origin main --follow-tags. - The Release workflow (
.gitea/workflows/release.yml) checks that the tag matches the package version, re-runs the checks and publishes to npm. It needs anNPM_TOKENrepository secret for an account in theopenkhalixnpm organisation.
To publish by hand instead: npm login, then npm publish -w @openkhalix/tansy-ui (the package's
prepublishOnly runs the type-check, tests and build first).
Deploy the website
The landing page is served at / and Storybook at /docs/.
-
cPanel:
python3 scripts/deploy.pybuilds a committed tree, uploads it and removes files left over from earlier builds. Seescripts/README.md. -
Container: the
Dockerfileruns the checks, builds both apps and serves them from nginx with a/healthzendpoint:docker build -t tansy-ui . docker run --rm -p 8041:80 tansy-ui
Brand
The mark is a tansy flowerhead: six buttons in the palette's primary colour around a gold centre button.
packages/brand/src/TansyMark.tsx re-themes with the active palette; packages/brand/public/ holds the
fixed-colour SVG and the favicon. Typefaces: Schibsted Grotesk, Instrument Sans and JetBrains Mono.
Licence
MIT © OpenKhalix. Free to use, fork and ship in commercial products; keep the copyright notice in copies of the code. A visible credit ("UI by Tansy UI") is appreciated but not required. Contributions are welcome.