2 Commits
Author SHA1 Message Date
thekhalidsha 9255b255a6 Package Tansy UI as @openkhalix/tansy-ui in a monorepo (v0.4.0)
CI / check (push) Successful in 3m9s
Release / publish (push) Failing after 1m22s
Restructure the repo into npm workspaces so the component kit publishes as
its own package, like MUI and shadcn/ui:

- packages/ui: @openkhalix/tansy-ui (published), with components, stories,
  tests, tokens and the library build
- packages/brand: private logo and catalogue data shared by both apps
- apps/site: the landing page
- apps/docs: Storybook

The package:
- MIT licence (copyright OpenKhalix)
- per-component ES modules and type declarations
- "use client" on component modules so they import into Next.js Server
  Components; helpers stay server-safe
- tokens.css for Tailwind v4 apps, and a prebuilt styles.css for apps
  without Tailwind
- lucide-react 1.x, whose types compile against current React 19 types

The apps resolve the package through a "source" export condition, so they
hot-reload component edits, while outside users get dist/.

scripts/test-package.mjs packs the package and installs the tarball into
Vite + Tailwind (strict types), plain React and Next.js apps; each must
build and render correctly. Gitea workflows run CI on push and publish to
npm when a vX.Y.Z tag matching the package version is pushed.
2026-09-29 09:24:03 +05:30
thekhalidsha 23e67006d3 Make every component and the landing page responsive (v0.3.1)
Every story and the landing page now fit from a 320px phone to a wide
desktop without scrolling sideways.

- Inputs in flex rows (Input, FeaturedInput, NumberInput, Combobox) shrink
  instead of holding their native width
- Tab rows and ToggleGroup scroll within themselves on narrow screens;
  vertical tabs stack above their panel on phones
- Positioned popups cap at Base UI's --available-width
- Landing page: tablet header no longer crowds; code sample fits at 1024px
- Storybook a11y panel skips page-level rules that can't apply to a story
- check-stories.mjs gains --width and fails on horizontal overflow; all
  423 stories pass at 320, 375, 768 and desktop widths in both modes
2026-09-28 22:47:26 +05:30
214 changed files with 1654 additions and 417 deletions

No files matched your search

+4 -8
View File
@@ -1,10 +1,6 @@
node_modules
npm-debug.log*
dist
storybook-static
**/node_modules
**/dist
apps/docs/storybook-static
.git
.gitignore
.dockerignore
Dockerfile
README.md
*.log
scripts/deploy.env
+25
View File
@@ -0,0 +1,25 @@
# Runs on every push and pull request. Gitea Actions uses GitHub Actions syntax.
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm test
# Package, landing page and Storybook.
- run: npm run build
# What `npm publish` would upload.
- run: npm pack -w @openkhalix/tansy-ui --dry-run
+34
View File
@@ -0,0 +1,34 @@
# Publishes @openkhalix/tansy-ui when a version tag (v0.4.0, v1.0.0 …) is pushed.
#
# Needs a repository secret NPM_TOKEN: an npm "Automation" (or granular
# publish) token for an account that belongs to the openkhalix npm org.
name: Release
on:
push:
tags: ['v*']
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
registry-url: https://registry.npmjs.org
- run: npm ci
- name: Tag must match the package version
run: |
version=$(node -p "require('./packages/ui/package.json').version")
if [ "${GITHUB_REF_NAME}" != "v${version}" ]; then
echo "Tag ${GITHUB_REF_NAME} does not match package version v${version}" >&2
exit 1
fi
- run: npm run lint
- run: npm test
# prepublishOnly re-runs typecheck, tests and the library build.
- run: npm publish -w @openkhalix/tansy-ui --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
-1
View File
@@ -1,7 +1,6 @@
node_modules
dist
dist-ssr
dist-lib
storybook-static
*.local
.DS_Store
+7 -7
View File
@@ -17,13 +17,13 @@
"overrides": [
{
"files": [
"src/components/Card.tsx",
"src/components/Dialog.tsx",
"src/components/Drawer.tsx",
"src/components/DropdownMenu.tsx",
"src/components/Popover.tsx",
"src/components/Table.tsx",
"src/components/Tabs.tsx"
"packages/ui/src/components/Card.tsx",
"packages/ui/src/components/Dialog.tsx",
"packages/ui/src/components/Drawer.tsx",
"packages/ui/src/components/DropdownMenu.tsx",
"packages/ui/src/components/Popover.tsx",
"packages/ui/src/components/Table.tsx",
"packages/ui/src/components/Tabs.tsx"
],
"rules": {
"react/only-export-components": "off"
+10 -5
View File
@@ -4,25 +4,30 @@ FROM node:26-alpine AS build
WORKDIR /app
# Workspace manifests first, so dependency installs cache between builds.
COPY package.json package-lock.json ./
COPY packages/ui/package.json packages/ui/
COPY packages/brand/package.json packages/brand/
COPY apps/site/package.json apps/site/
COPY apps/docs/package.json apps/docs/
RUN npm ci
COPY . .
RUN npm run lint \
&& npm run build \
&& npm run build-storybook
&& npm test \
&& npm run build
FROM nginx:1.29-alpine AS runtime
LABEL org.opencontainers.image.title="Tansy UI" \
org.opencontainers.image.description="Landing page and Storybook for the Tansy UI React component kit" \
org.opencontainers.image.source="local:ui-showcase" \
org.opencontainers.image.licenses="UNLICENSED"
org.opencontainers.image.licenses="MIT"
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=build /app/storybook-static /usr/share/nginx/html/docs
COPY --from=build /app/apps/site/dist /usr/share/nginx/html
COPY --from=build /app/apps/docs/storybook-static /usr/share/nginx/html/docs
EXPOSE 80
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 OpenKhalix
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+63 -142
View File
@@ -1,186 +1,107 @@
<p align="center">
<img src="public/tansy-mark.svg" width="88" height="88" alt="Tansy UI logo" />
<img src="packages/brand/public/tansy-mark.svg" width="88" height="88" alt="Tansy UI logo" />
</p>
<h1 align="center">Tansy UI</h1>
<p align="center">
A themeable React component kit, with every state documented in Storybook.<br />
By OpenKhalix.
A themeable, accessible React component kit by OpenKhalix.<br />
<a href="https://ui.openkhalix.com">Website</a> ·
<a href="https://ui.openkhalix.com/docs/">Storybook</a> ·
<a href="packages/ui/README.md">Package README</a> ·
<a href="packages/ui/CHANGELOG.md">Changelog</a>
</p>
---
Tansy UI is named after the tansy flower, also called *golden buttons*: many small, round heads that together read as one bloom. The kit works the same way. It is a set of small, owned parts (buttons, fields, selects, feedback and overlays) that combine into a consistent interface.
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`**:
Every part ships with:
- **Named variants.** A short list of deliberate choices, such as `variant="outline"`, instead of one-off styling.
- **Its states.** Error, disabled, loading and required are part of the component, and each has its own story.
- **Tokens, not hex codes.** Colours come from a 50–900 palette ramp, so switching the palette re-themes every part without a code change.
> **Status:** pre-release (v0.3.0). Tansy UI builds as a library (`npm run build:lib`) but is not published to npm yet. It is developed in this repository, with a landing page and a Storybook workshop as its showcase.
## Components
Built on [Base UI](https://base-ui.com) for accessible behaviour, styled with Tailwind CSS v4.
| Group | Components |
|---|---|
| Actions | `Button`, `IconButton`, `LinkButton`, `ToggleGroup`, `Toggle` |
| Forms | `Field`, `Input`, `FeaturedInput`, `TextArea`, `FeaturedTextArea`, `NumberInput`, `Select`, `FeaturedSelect`, `Combobox`, `NativeSelect`, `Checkbox`, `CheckboxGroup`, `Radio`, `Switch`, `Slider` |
| Overlays | `Dialog` (`Modal`), `AlertDialog`, `Drawer` (`Sheet`), `Popover`, `Tooltip`, `InfoTip`, `DropdownMenu` |
| Navigation | `Tabs`, `Accordion`, `Breadcrumb`, `Pagination` |
| Feedback | `Alert`, `Toast` (`Toaster`, `useToast`), `Spinner`, `Progress`, `Meter`, `Skeleton` |
| Display | `Badge`, `CountBadge`, `Avatar`, `AvatarGroup`, `Kbd`, `Table` |
| Layout | `Card`, `Separator` |
Every component follows one API (see [`docs/CONVENTIONS.md`](docs/CONVENTIONS.md)):
- `color` for meaning and `variant` for style;
- `size` of `sm`, `md` or `lg`;
- `startIcon` and `endIcon` as React nodes;
- `label`, `description` and `error` on every field;
- `value`, `defaultValue` and `onValueChange` for anything with a value.
## Usage
```css
/* app.css */
@import "tailwindcss";
@import "tansy-ui/tokens.css";
@source "../node_modules/tansy-ui/dist-lib";
```bash
npm install @openkhalix/tansy-ui
```
```tsx
import { Mail } from 'lucide-react'
import { Button, FeaturedInput, Select, Switch } from 'tansy-ui'
See the [package README](packages/ui/README.md) for setup and usage.
export function InviteForm() {
return (
<form className="grid max-w-sm gap-5">
<FeaturedInput label="Work email" type="email" startIcon={<Mail />} required />
<Select
label="Team"
options={[
{ value: 'design', label: 'Design' },
{ value: 'engineering', label: 'Engineering' },
]}
/>
<Switch label="Send a welcome email" defaultChecked />
<Button type="submit">Send invite</Button>
</form>
)
}
```
## Repository layout
**Dark mode:** add the `dark` class to `<html>`.
This is an npm workspaces monorepo, laid out the way MUI and shadcn/ui lay out theirs:
## Theming
| Path | Package | Published | What it is |
|---|---|---|---|
| [`packages/ui`](packages/ui) | `@openkhalix/tansy-ui` | yes | The components, their stories and tests, tokens, and the library build |
| [`packages/brand`](packages/brand) | `@tansy/brand` | no | The Tansy mark and the component catalogue, shared by both apps |
| [`apps/site`](apps/site) | `@tansy/site` | no | The landing page at ui.openkhalix.com |
| [`apps/docs`](apps/docs) | `@tansy/docs` | no | Storybook at ui.openkhalix.com/docs |
| [`docs`](docs) | | | [Conventions](docs/CONVENTIONS.md) and [roadmap](docs/ROADMAP.md) |
| [`scripts`](scripts) | | | Deploy, story checks, package install tests, catalogue generator |
Tansy UI ships seven palettes: Classic Blue (default), Emerald, Violet, Amber, Crimson, Slate and Teal. Each defines full `primary`, `secondary`, `gray` and `zink` ramps plus semantic colours in `src/theme/palettes.ts`.
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/`.
`applyPalette(element, name)` writes a palette as CSS custom properties on any element. Tailwind v4 reads those properties, so a palette applies to one subtree and several palettes can appear on the same page:
```ts
import { applyPalette } from './theme/applyPalette'
applyPalette(document.getElementById('settings')!, 'emerald')
```
Storybook's **Palette** toolbar and the landing page playground both use this function.
## Development
## Develop
```bash
npm install
npm run dev # landing page at http://localhost:5173
npm run storybook # component workshop at http://localhost:6006
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 # landing page -> dist/
npm run build-storybook # workshop -> storybook-static/
npm run build:lib # library -> dist-lib/ (ES modules, types, tokens.css)
npm run build # package, then landing page, then Storybook
```
To check every story in a real browser (runtime errors and axe, including colour contrast):
### Checks before a release
```bash
npm run build-storybook
node scripts/check-stories.mjs --mode light
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
python3 scripts/contact-sheet.py /tmp/tansy-story-check/light # screenshots to review
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
Adding a component: follow [`docs/CONVENTIONS.md`](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.
Follow [`docs/CONVENTIONS.md`](docs/CONVENTIONS.md). In short:
## Release
1. Build it on Base UI where it has behaviour, in `src/components/`, with style maps in a sibling `*.tokens.ts`.
2. Use only the tokens (`bg-surface`, `text-fg`, `primary-*`, `danger-*` …), and check it in dark mode.
3. Add `Name.stories.tsx` with controls for every prop and a story for every state, and `Name.test.tsx` with keyboard and axe checks.
4. Export it from `src/index.ts`.
5. Run `npm test`, the story check in both modes, then `python3 scripts/gen_catalogue.py --patch` to refresh the landing page catalogue.
1. Move the **Unreleased** notes in [`packages/ui/CHANGELOG.md`](packages/ui/CHANGELOG.md) under the new
version and set `version` in `packages/ui/package.json`.
2. Run the checks above.
3. Commit, tag and push: `git tag -a v0.4.0 -m "Tansy UI v0.4.0" && git push origin main --follow-tags`.
4. 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 an `NPM_TOKEN` repository secret for an
account in the `openkhalix` npm organisation.
## Versioning
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).
Tansy UI follows [Semantic Versioning](https://semver.org). While the version is `0.x`, a minor release may include breaking changes.
## Deploy the website
- `package.json` holds the version. The build injects it into the landing page and Storybook through `src/version.ts`, so it is never typed by hand.
- Every release gets an entry in [`CHANGELOG.md`](CHANGELOG.md) and an annotated git tag such as `v0.2.0`.
- Every deploy publishes `/version.json`, which records the version and commit that are live.
The landing page is served at `/` and Storybook at `/docs/`.
To cut a release:
- **cPanel:** `python3 scripts/deploy.py` builds a committed tree, uploads it and removes files left over
from earlier builds. See [`scripts/README.md`](scripts/README.md).
- **Container:** the `Dockerfile` runs the checks, builds both apps and serves them from nginx with a
`/healthz` endpoint:
```bash
# 1. Move the [Unreleased] notes in CHANGELOG.md under the new version, then:
npm version minor -m "Release v%s" # or patch / major; bumps package.json, commits and tags
git push origin main --follow-tags
python3 scripts/deploy.py # builds that commit and deploys it
```
## Project structure
```text
src/
├── brand/TansyMark.tsx # Palette-aware logo
├── components/ # Components, their tokens, stories and tests
├── data/catalogue.ts # Landing page catalogue (regenerated by scripts/gen_catalogue.py)
├── docs/ # Storybook Introduction pages (MDX)
├── lib/ # cn(), shared styles, useControllableState
├── styles/tokens.css # Design tokens (shipped as tansy-ui/tokens.css)
├── test/ # Vitest setup and the axe helper
├── theme/ # Palettes and applyPalette()
├── index.ts # Public API
├── version.ts # VERSION, injected from package.json
├── App.tsx # Landing page, built only from Tansy components
└── index.css # Tailwind entry and landing styles
.storybook/ # Storybook config, Tansy theme, light/dark and palette toolbars
docs/ # CONVENTIONS.md, ROADMAP.md
scripts/ # Deploy, catalogue, story check and contact sheets
public/ # tansy-mark.svg and favicon.svg
```
```bash
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.
- `src/brand/TansyMark.tsx` re-themes with the active palette. The gold centre stays fixed.
- `public/tansy-mark.svg` is the fixed Classic Blue version, used by Storybook.
- `public/favicon.svg` is the mark on a dark tile, so it stays visible in both light and dark browser tabs.
## Licence
Typefaces: Schibsted Grotesk for headings, Instrument Sans for text and JetBrains Mono for code.
## Deployment
The build serves the landing page at `/` and Storybook at `/docs/`.
**Container.** The `Dockerfile` lints and builds both surfaces, then serves them from nginx with a `/healthz` endpoint:
```bash
docker build -t tansy-ui .
docker run --rm -p 8041:80 tansy-ui
curl http://127.0.0.1:8041/healthz
```
**cPanel.** `python3 scripts/deploy.py` builds, packages and uploads to a cPanel host, then removes files left over from earlier builds. See [`scripts/README.md`](scripts/README.md) for setup.
[MIT](LICENSE) © 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.
@@ -1,6 +1,5 @@
import { useEffect, type ReactNode } from 'react'
import { applyPalette } from '../src/theme/applyPalette'
import type { PaletteName } from '../src/theme/palettes'
import { applyPalette, type PaletteName } from '@openkhalix/tansy-ui'
/**
* Applies the toolbar's palette and light/dark mode to <html>.
@@ -2,7 +2,7 @@ import type { StorybookConfig } from '@storybook/react-vite'
import remarkGfm from 'remark-gfm'
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(ts|tsx)'],
stories: ['../src/**/*.mdx', '../../../packages/ui/src/**/*.stories.@(ts|tsx)'],
addons: [
{
name: '@storybook/addon-docs',
@@ -16,7 +16,7 @@ const config: StorybookConfig = {
options: {},
},
// Serves the Tansy mark and favicon to the manager and the Welcome page.
staticDirs: ['../public'],
staticDirs: ['../../../packages/brand/public'],
docs: {
defaultName: 'Documentation',
},
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
import type { Decorator, Preview } from '@storybook/react-vite'
import '../src/index.css'
import { palettes, DEFAULT_PALETTE, type PaletteName } from '../src/theme/palettes'
import '../src/styles.css'
import { palettes, DEFAULT_PALETTE, type PaletteName } from '@openkhalix/tansy-ui'
import { tansyTheme } from './tansyTheme'
import { ThemeSurface } from './ThemeSurface'
@@ -50,6 +50,17 @@ const preview: Preview = {
},
parameters: {
backgrounds: { disable: true },
a11y: {
// Page-level rules can't apply to an isolated component: a story has no
// <main>, no <h1> and no landmarks of its own. Everything else runs.
config: {
rules: [
{ id: 'landmark-one-main', enabled: false },
{ id: 'page-has-heading-one', enabled: false },
{ id: 'region', enabled: false },
],
},
},
docs: {
theme: tansyTheme,
},
File renamed without changes.
+31
View File
@@ -0,0 +1,31 @@
{
"name": "@tansy/docs",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "storybook dev -p 6006",
"build": "storybook build -o storybook-static"
},
"dependencies": {
"@openkhalix/tansy-ui": "*",
"@tansy/brand": "*",
"lucide-react": "^1.48.0",
"react": "^19.2.8",
"react-dom": "^19.2.8"
},
"devDependencies": {
"@storybook/addon-a11y": "^10.6.0",
"@storybook/addon-docs": "^10.6.0",
"@storybook/react-vite": "^10.6.0",
"@tailwindcss/vite": "^4.3.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.7",
"@vitejs/plugin-react": "^6.1.1",
"remark-gfm": "^4.0.1",
"storybook": "^10.6.0",
"tailwindcss": "^4.3.3",
"typescript": "~6.0.2",
"vite": "^8.3.0"
}
}
File renamed without changes.
@@ -1,6 +1,6 @@
import { Meta, Markdown } from '@storybook/addon-docs/blocks'
import { DocHero } from './DocBlocks'
import changelog from '../../CHANGELOG.md?raw'
import changelog from '../../../packages/ui/CHANGELOG.md?raw'
<Meta title="Introduction/Changelog" />
@@ -1,6 +1,6 @@
import type { ReactNode } from 'react'
import { TansyMark } from '../brand/TansyMark'
import { VERSION } from '../version'
import { VERSION } from '@openkhalix/tansy-ui'
import { TansyMark } from '@tansy/brand'
/*
* Building blocks for the Storybook Introduction pages. They sit inside
@@ -4,7 +4,7 @@ import { DocHero } from './DocBlocks'
<Meta title="Introduction/Getting started" />
<DocHero title="Getting started">
Add Tansy UI to a React 19 and Tailwind CSS v4 app, import the tokens once, and every component is ready to use.
Install one package, add one line of CSS, and every component is ready to use in any React 19 app, with or without Tailwind.
</DocHero>
## Requirements
@@ -12,41 +12,36 @@ import { DocHero } from './DocBlocks'
| Dependency | Version | Why |
|---|---|---|
| React and React DOM | 19 | Peer dependency. Components take `ref` as a normal prop |
| Tailwind CSS | 4 | Components are styled with Tailwind utilities generated from the Tansy tokens |
| `@base-ui/react` | 1.8+ | Accessible behaviour: focus management, keyboard navigation, popups |
| `lucide-react` | 0.460+ | The icons components draw themselves (chevrons, close, status icons) |
| Tailwind CSS | 4, optional | With Tailwind, your build generates the utilities; without it, use the prebuilt `styles.css` |
| `@base-ui/react` | 1.8+ | Accessible behaviour: focus management, keyboard navigation, popups. Installed with the package |
| `lucide-react` | 1.x | The icons components draw themselves (chevrons, close, status icons). Installed with the package |
| `clsx` + `tailwind-merge` | 2 and 3 | `cn()` merges class names so your `className` always wins |
## 1. Add the package
## 1. Install
Tansy UI isn't on npm yet. Build the library from this repository and install it from the folder:
<Source language="bash" code={`npm install @openkhalix/tansy-ui`} />
<Source
language="bash"
code={`npm run build:lib # writes dist-lib/
npm install ../ui-showcase # from your app, pointing at this repository`}
/>
## 2. Add the styles
You can also copy `src/components`, `src/lib` and `src/theme` into your app and own the code, as with shadcn/ui.
## 2. Import the tokens
The tokens define every colour utility the components use (`bg-surface`, `text-fg`, `bg-primary-500`, `border-danger-500` and so on). Import them after Tailwind, and tell Tailwind to scan the package for class names:
**With Tailwind CSS v4** (recommended). Import the tokens after Tailwind, and let Tailwind scan the package for the classes it uses:
<Source
language="css"
code={`@import "tailwindcss";
@import "tansy-ui/tokens.css";
@source "../node_modules/tansy-ui/dist-lib";`}
@import "@openkhalix/tansy-ui/tokens.css";
@source "../node_modules/@openkhalix/tansy-ui/dist";`}
/>
**Without Tailwind.** Import the prebuilt stylesheet once. It includes the tokens, the utilities the components use, and a modern CSS reset the components rely on:
<Source language="ts" code={`import '@openkhalix/tansy-ui/styles.css'`} />
## 3. Render components
<Source
language="tsx"
code={`import { Mail } from 'lucide-react'
import { Button, FeaturedInput, Select, Switch } from 'tansy-ui'
import { Button, FeaturedInput, Select, Switch } from '@openkhalix/tansy-ui'
export function InviteForm() {
return (
@@ -68,6 +63,10 @@ export function InviteForm() {
Every form component takes the same field props, `label`, `description`, `error` and `required`, and links them to the control for screen readers. Values work controlled (`value` and `onValueChange`) or uncontrolled (`defaultValue`).
## Next.js
Components are marked `"use client"`, so you can import them straight into Server Components. Helpers like `cn` and `applyPalette` stay server-safe.
## 4. Dark mode
Add the `dark` class to `<html>`. The surface, border and text tokens switch, and every component and popup follows:
@@ -80,7 +79,7 @@ Classic Blue is the default. Apply another palette to any element; everything in
<Source
language="tsx"
code={`import { applyPalette } from 'tansy-ui'
code={`import { applyPalette } from '@openkhalix/tansy-ui'
applyPalette(document.documentElement, 'emerald')`}
/>
@@ -1,6 +1,6 @@
import { Meta, Markdown } from '@storybook/addon-docs/blocks'
import { DocHero } from './DocBlocks'
import roadmap from '../../docs/ROADMAP.md?raw'
import roadmap from '../../../docs/ROADMAP.md?raw'
<Meta title="Introduction/Roadmap" />
@@ -1,6 +1,6 @@
import { Meta, ColorPalette, ColorItem, Source } from '@storybook/addon-docs/blocks'
import { DocHero } from './DocBlocks'
import { palettes } from '../theme/palettes'
import { palettes } from '@openkhalix/tansy-ui'
<Meta title="Introduction/Theming" />
@@ -20,7 +20,7 @@ export const ramp = (r) => Object.fromEntries(STEPS.map((s) => [s, r[s]]))
<Source
language="tsx"
code={`import { applyPalette } from './theme/applyPalette'
code={`import { applyPalette } from '@openkhalix/tansy-ui'
// Whole app
applyPalette(document.documentElement, 'violet')
@@ -1,6 +1,6 @@
import { Meta } from '@storybook/addon-docs/blocks'
import { DocHero, DocCards } from './DocBlocks'
import { documentation, totalStories } from '../data/catalogue'
import { documentation, totalStories } from '@tansy/brand'
<Meta title="Introduction/Welcome" />
+6
View File
@@ -0,0 +1,6 @@
@import "tailwindcss";
@import "../../../packages/ui/src/styles/tokens.css";
/* Components and their stories live in the package. */
@source "../../../packages/ui/src";
@source not "../../../packages/ui/src/**/*.test.tsx";
+20
View File
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es2023",
"lib": ["ES2023", "DOM"],
"module": "esnext",
"moduleResolution": "bundler",
"customConditions": ["source"],
"types": ["vite/client"],
"jsx": "react-jsx",
"skipLibCheck": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"allowImportingTsExtensions": true,
"noEmit": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src", ".storybook"]
}
+13
View File
@@ -0,0 +1,13 @@
import { readFileSync } from 'node:fs'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { defaultClientConditions, defineConfig } from 'vite'
/** Storybook's Vite config: stories render the package from source. */
const ui = JSON.parse(readFileSync(new URL('../../packages/ui/package.json', import.meta.url), 'utf8')) as { version: string }
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: { conditions: ['source', ...defaultClientConditions] },
define: { __TANSY_VERSION__: JSON.stringify(ui.version) },
})
View File
File renamed without changes.
+27
View File
@@ -0,0 +1,27 @@
{
"name": "@tansy/site",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -p tsconfig.json --noEmit && vite build",
"preview": "vite preview"
},
"dependencies": {
"@openkhalix/tansy-ui": "*",
"@tansy/brand": "*",
"lucide-react": "^1.48.0",
"react": "^19.2.8",
"react-dom": "^19.2.8"
},
"devDependencies": {
"@tailwindcss/vite": "^4.3.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.7",
"@vitejs/plugin-react": "^6.1.1",
"tailwindcss": "^4.3.3",
"typescript": "~6.0.2",
"vite": "^8.3.0"
}
}
+23 -17
View File
@@ -1,20 +1,24 @@
import { useEffect, useState, type FormEvent, type ReactNode } from 'react'
import { ArrowRight, Mail, UserRound } from 'lucide-react'
import { TansyMark } from './brand/TansyMark'
import { Alert } from './components/Alert'
import { Badge } from './components/Badge'
import { Button, LinkButton } from './components/Button'
import { Card } from './components/Card'
import { Checkbox } from './components/Checkbox'
import { FeaturedInput } from './components/FeaturedInput'
import { FeaturedSelect } from './components/FeaturedSelect'
import { Radio } from './components/Radio'
import { Switch } from './components/Switch'
import { Tooltip } from './components/Tooltip'
import { documentation, featured, totalStories, type FeaturedName } from './data/catalogue'
import { applyPalette } from './theme/applyPalette'
import { VERSION } from './version'
import { palettes, DEFAULT_PALETTE, type PaletteName } from './theme/palettes'
import {
Alert,
Badge,
Button,
Card,
Checkbox,
FeaturedInput,
FeaturedSelect,
LinkButton,
Radio,
Switch,
Tooltip,
applyPalette,
palettes,
DEFAULT_PALETTE,
VERSION,
type PaletteName,
} from '@openkhalix/tansy-ui'
import { TansyMark, documentation, featured, totalStories, type FeaturedName } from '@tansy/brand'
const STORYBOOK = '/docs/'
@@ -43,8 +47,10 @@ const DOCS = {
roadmap: `${STORYBOOK}?path=/docs/introduction-roadmap--documentation`,
}
const USAGE = `import { Button } from './Button'
import { Switch } from './Switch'
const USAGE = `import {
Button,
Switch,
} from '@openkhalix/tansy-ui'
<Switch label="Welcome email" />
<Button>Send invite</Button>`
+21 -1
View File
@@ -1,6 +1,11 @@
@import "tailwindcss";
@import "./styles/tokens.css";
@import "../../../packages/ui/src/styles/tokens.css";
/* The landing page renders package components: generate their utilities. */
@source "../../../packages/ui/src";
@source not "../../../packages/ui/src/**/*.stories.tsx";
@source not "../../../packages/ui/src/**/*.test.tsx";
/* ------------------------------------------------------------------
Tansy UI landing page.
@@ -152,6 +157,7 @@
}
.brand-by {
white-space: nowrap;
padding-left: 0.6rem;
border-left: 1px solid var(--line-strong);
font-size: 0.8125rem;
@@ -805,6 +811,20 @@
/* ---------- Responsive ---------- */
/* Tablets: the nav needs the room the tagline was using. */
@media (max-width: 900px) {
.brand-by {
display: none;
}
}
/* Three narrow "Why" cards: keep the longest code line inside its card. */
@media (min-width: 961px) and (max-width: 1199px) {
.code-sample pre {
font-size: 0.6875rem;
}
}
@media (max-width: 960px) {
.hero,
.playground-grid {
File renamed without changes.
+20
View File
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es2023",
"lib": ["ES2023", "DOM"],
"module": "esnext",
"moduleResolution": "bundler",
"customConditions": ["source"],
"types": ["vite/client"],
"jsx": "react-jsx",
"skipLibCheck": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"allowImportingTsExtensions": true,
"noEmit": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src"]
}
+15
View File
@@ -0,0 +1,15 @@
import { readFileSync } from 'node:fs'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { defaultClientConditions, defineConfig } from 'vite'
const ui = JSON.parse(readFileSync(new URL('../../packages/ui/package.json', import.meta.url), 'utf8')) as { version: string }
export default defineConfig({
plugins: [react(), tailwindcss()],
// Resolve @openkhalix/tansy-ui to its source (the "source" export condition),
// so edits to components hot-reload without rebuilding the package.
resolve: { conditions: ['source', ...defaultClientConditions] },
define: { __TANSY_VERSION__: JSON.stringify(ui.version) },
publicDir: '../../packages/brand/public',
})
+21 -5
View File
@@ -1,8 +1,8 @@
# Component conventions
Every Tansy UI component follows these rules, so the kit reads as one API. The
reference implementations are `src/components/Button.tsx`, `Input.tsx` and
`Field.tsx`, with their stories and tests. When in doubt, copy them.
reference implementations are `packages/ui/src/components/Button.tsx`,
`Input.tsx` and `Field.tsx`, with their stories and tests. When in doubt, copy them.
## Foundation
@@ -16,7 +16,8 @@ reference implementations are `src/components/Button.tsx`, `Input.tsx` and
- **Styling:** Tailwind v4 utilities only. Shared class strings live in
`src/lib/styles.ts` (`focusRing`, `controlHeight`, `controlBox`, `popupSurface`,
`popupMotion`, `listItem`, `labelText`, `descriptionText`, `errorText`).
Use them instead of repeating utilities.
Use them instead of repeating utilities. (Paths in this document are relative
to `packages/ui`.)
- **Class merging:** always `cn(...)` from `src/lib/cn.ts`, with the consumer's
`className` last so it wins.
- **Refs:** React 19 passes `ref` as a normal prop. Type props from
@@ -83,6 +84,20 @@ comment; Storybook's docs table reads them.
as the WAI-ARIA pattern describes. Base UI does this when used as documented.
- Respect `motion-reduce:` for animations.
## Responsive
Every component must work from a 320px phone up without making the page
scroll sideways:
- Inputs inside flex rows use `w-0 min-w-0 flex-1` so they can shrink.
- Rows of items (tabs, segmented controls) scroll within themselves on narrow
screens rather than widening the page.
- Positioned popups cap at `max-w-(--available-width)`; never give them a
`min-width` larger than that.
- Story layouts wrap (`flex-wrap`) instead of assuming a wide canvas.
Check with `node scripts/check-stories.mjs --width 320` (and 375 and 768).
## Stories
- `title`: `Group/Name`. Groups: `Actions`, `Forms`, `Overlays`, `Navigation`,
@@ -111,12 +126,13 @@ Every component has `Name.test.tsx` (Vitest, Testing Library, user-event):
- keyboard interaction for the component's pattern (Escape, arrows, Enter/Space),
- `await expectNoA11yViolations(container)` from `src/test/a11y.ts`.
Run `npx vitest run src/components/Name.test.tsx`.
Run `npx vitest run src/components/Name.test.tsx` inside `packages/ui`, or
`npm test` from the root. Export every public component from `src/index.ts`.
## Checking in a real browser
```bash
npm run build-storybook
npm run build:docs
node scripts/check-stories.mjs --filter forms-input --mode light
node scripts/check-stories.mjs --filter forms-input --mode dark
python3 scripts/contact-sheet.py /tmp/tansy-story-check/light --prefix forms-input
+18 -6
View File
@@ -3,13 +3,13 @@
Where Tansy UI stands against MUI and shadcn/ui, what's done, and what comes
before v1.
Last reviewed: 2026-09-28, at v0.3.0.
Last reviewed: 2026-09-29, at v0.4.0.
## Where things stand
| | Tansy UI (v0.3) | shadcn/ui | MUI (Material UI + Base UI) |
|---|---|---|---|
| Distribution | Library build (ES modules, types, tokens.css); not yet on npm | CLI and registries. CLI v4 installs a whole design system in one payload | npm packages |
| Distribution | npm package `@openkhalix/tansy-ui` (ES modules, types, Tailwind or prebuilt CSS) | CLI and registries. CLI v4 installs a whole design system in one payload | npm packages |
| Components | 38 | 50+, plus blocks and charts | Material UI's full set; Base UI v1 has 35 unstyled parts; MUI X adds Data Grid, Charts, Date Pickers, Tree View |
| Accessibility base | Base UI primitives | Radix and Base UI primitives | Base UI primitives |
| Theming | Seven runtime palettes, scoped to any element; semantic tokens | CSS variables | `createTheme`, CSS variables |
@@ -63,13 +63,25 @@ and a docs page.
## Phase 2: Distribution
- [ ] Claim the npm scope and publish the library build.
Done in v0.4.0:
- [x] Monorepo: `packages/ui` (published), `apps/site`, `apps/docs`
- [x] Package `@openkhalix/tansy-ui`: ES modules per component, types,
`"use client"` for Next.js, `tokens.css` for Tailwind apps and a
prebuilt `styles.css` for apps without Tailwind
- [x] MIT licence
- [x] Install tests: the packed tarball must build and render in Vite +
Tailwind, plain React and Next.js apps (`npm run test:package`)
- [x] CI and tag-triggered publishing (Gitea Actions)
Still to do:
- [ ] Create the `openkhalix` npm organisation and publish the first release.
- [ ] Serve the same components as a shadcn-compatible registry, so
`npx shadcn add <url>` copies a Tansy component into a project: the
same code as a dependency or as source you own.
`npx shadcn add <url>` copies a Tansy component into a project.
- [ ] Ship the palettes as a registry base item (tokens, fonts and CSS
variables in one install).
- [ ] Automate releases (Changesets) from `CHANGELOG.md`.
- [ ] A public repository URL in `package.json` once the repo is public.
## Phase 3: Where Tansy can lead
+579 -27
View File
@@ -1,46 +1,67 @@
{
"name": "tansy-ui",
"version": "0.3.0",
"name": "tansy-ui-monorepo",
"version": "0.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "tansy-ui",
"version": "0.3.0",
"name": "tansy-ui-monorepo",
"version": "0.0.0",
"license": "MIT",
"workspaces": [
"packages/*",
"apps/*"
],
"devDependencies": {
"axe-core": "^4.13.0",
"oxlint": "^1.81.0",
"playwright": "^1.63.0",
"typescript": "~6.0.2"
}
},
"apps/docs": {
"name": "@tansy/docs",
"version": "0.0.0",
"dependencies": {
"@base-ui/react": "^1.8.0",
"clsx": "^2.1.1",
"lucide-react": "^0.460.0",
"tailwind-merge": "^3.7.0"
"@openkhalix/tansy-ui": "*",
"@tansy/brand": "*",
"lucide-react": "^1.48.0",
"react": "^19.2.8",
"react-dom": "^19.2.8"
},
"devDependencies": {
"@storybook/addon-a11y": "^10.6.0",
"@storybook/addon-docs": "^10.6.0",
"@storybook/react-vite": "^10.6.0",
"@tailwindcss/vite": "^4.3.3",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.7",
"@types/node": "^24.13.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.7",
"@vitejs/plugin-react": "^6.1.1",
"axe-core": "^4.13.0",
"jsdom": "^30.1.1",
"oxlint": "^1.81.0",
"playwright": "^1.63.0",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"remark-gfm": "^4.0.1",
"storybook": "^10.6.0",
"tailwindcss": "^4.3.3",
"typescript": "~6.0.2",
"vite": "^8.3.0",
"vitest": "^5.0.2"
"vite": "^8.3.0"
}
},
"peerDependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
"apps/site": {
"name": "@tansy/site",
"version": "0.0.0",
"dependencies": {
"@openkhalix/tansy-ui": "*",
"@tansy/brand": "*",
"lucide-react": "^1.48.0",
"react": "^19.2.8",
"react-dom": "^19.2.8"
},
"devDependencies": {
"@tailwindcss/vite": "^4.3.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.7",
"@vitejs/plugin-react": "^6.1.1",
"tailwindcss": "^4.3.3",
"typescript": "~6.0.2",
"vite": "^8.3.0"
}
},
"node_modules/@adobe/css-tools": {
@@ -1197,6 +1218,10 @@
"@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4"
}
},
"node_modules/@openkhalix/tansy-ui": {
"resolved": "packages/ui",
"link": true
},
"node_modules/@oxc-parser/binding-android-arm-eabi": {
"version": "0.127.0",
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.127.0.tgz",
@@ -2249,6 +2274,346 @@
"node": "^20.19.0 || >=22.12.0"
}
},
"node_modules/@parcel/watcher": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz",
"integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"detect-libc": "^1.0.3",
"is-glob": "^4.0.3",
"micromatch": "^4.0.5",
"node-addon-api": "^7.0.0"
},
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
},
"optionalDependencies": {
"@parcel/watcher-android-arm64": "2.5.1",
"@parcel/watcher-darwin-arm64": "2.5.1",
"@parcel/watcher-darwin-x64": "2.5.1",
"@parcel/watcher-freebsd-x64": "2.5.1",
"@parcel/watcher-linux-arm-glibc": "2.5.1",
"@parcel/watcher-linux-arm-musl": "2.5.1",
"@parcel/watcher-linux-arm64-glibc": "2.5.1",
"@parcel/watcher-linux-arm64-musl": "2.5.1",
"@parcel/watcher-linux-x64-glibc": "2.5.1",
"@parcel/watcher-linux-x64-musl": "2.5.1",
"@parcel/watcher-win32-arm64": "2.5.1",
"@parcel/watcher-win32-ia32": "2.5.1",
"@parcel/watcher-win32-x64": "2.5.1"
}
},
"node_modules/@parcel/watcher-android-arm64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz",
"integrity": "sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-darwin-arm64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz",
"integrity": "sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-darwin-x64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz",
"integrity": "sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-freebsd-x64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz",
"integrity": "sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-arm-glibc": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz",
"integrity": "sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==",
"cpu": [
"arm"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-arm-musl": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz",
"integrity": "sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==",
"cpu": [
"arm"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-arm64-glibc": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz",
"integrity": "sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==",
"cpu": [
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-arm64-musl": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz",
"integrity": "sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==",
"cpu": [
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-x64-glibc": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz",
"integrity": "sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==",
"cpu": [
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-linux-x64-musl": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz",
"integrity": "sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==",
"cpu": [
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-win32-arm64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz",
"integrity": "sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-win32-ia32": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz",
"integrity": "sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher-win32-x64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz",
"integrity": "sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@parcel/watcher/node_modules/detect-libc": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
"integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"detect-libc": "bin/detect-libc.js"
},
"engines": {
"node": ">=0.10"
}
},
"node_modules/@rolldown/binding-android-arm-eabi": {
"version": "1.2.11",
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.11.tgz",
@@ -2730,6 +3095,25 @@
}
}
},
"node_modules/@tailwindcss/cli": {
"version": "4.3.3",
"resolved": "https://registry.npmjs.org/@tailwindcss/cli/-/cli-4.3.3.tgz",
"integrity": "sha512-ZvS/n1ZHOBKcVlhkt8l5NNr1EDXk1NboYO5CYDOs6NUmvT9z6bzkwsosaJftY57T/3gWNzWMJzIXLodZC8ssdw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@parcel/watcher": "2.5.1",
"@tailwindcss/node": "4.3.3",
"@tailwindcss/oxide": "4.3.3",
"enhanced-resolve": "^5.24.1",
"mri": "^1.2.0",
"picocolors": "^1.1.1",
"tailwindcss": "4.3.3"
},
"bin": {
"tailwindcss": "dist/index.mjs"
}
},
"node_modules/@tailwindcss/node": {
"version": "4.3.3",
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.3.tgz",
@@ -3024,6 +3408,18 @@
"vite": "^5.2.0 || ^6 || ^7 || ^8"
}
},
"node_modules/@tansy/brand": {
"resolved": "packages/brand",
"link": true
},
"node_modules/@tansy/docs": {
"resolved": "apps/docs",
"link": true
},
"node_modules/@tansy/site": {
"resolved": "apps/site",
"link": true
},
"node_modules/@testing-library/dom": {
"version": "10.4.2",
"resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.2.tgz",
@@ -3574,6 +3970,19 @@
"node": "20 || >=22"
}
},
"node_modules/braces": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true,
"license": "MIT",
"dependencies": {
"fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/browserslist": {
"version": "4.29.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.1.tgz",
@@ -4105,6 +4514,19 @@
}
}
},
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true,
"license": "MIT",
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
@@ -4233,6 +4655,29 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"dev": true,
"license": "MIT",
"dependencies": {
"is-extglob": "^2.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-inside-container": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
@@ -4252,6 +4697,16 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/is-plain-obj": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
@@ -4680,12 +5135,12 @@
}
},
"node_modules/lucide-react": {
"version": "0.460.0",
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.460.0.tgz",
"integrity": "sha512-BVtq/DykVeIvRTJvRAgCsOwaGL8Un3Bxh8MbDxMhEWlZay3T4IpEKDEpwt5KZ0KJMHzgm6jrltxlT5eXOWXDHg==",
"version": "1.48.0",
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.48.0.tgz",
"integrity": "sha512-R0CIKY/fXiC6y9xRBADgsK+VW2p/pcTJOMhLZf1T+uG+vJUvyUR02nGOgmIIC7MPkiNK4Ox8QDnbqF8rJYWPZQ==",
"license": "ISC",
"peerDependencies": {
"react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc"
"react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
"node_modules/lz-string": {
@@ -5541,6 +5996,33 @@
],
"license": "MIT"
},
"node_modules/micromatch": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true,
"license": "MIT",
"dependencies": {
"braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=8.6"
}
},
"node_modules/micromatch/node_modules/picomatch": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/min-indent": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
@@ -5587,6 +6069,16 @@
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/mri": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
"integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -5613,6 +6105,13 @@
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/node-addon-api": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz",
"integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==",
"dev": true,
"license": "MIT"
},
"node_modules/node-releases": {
"version": "2.0.57",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.57.tgz",
@@ -6471,6 +6970,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
},
"node_modules/tough-cookie": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-6.0.2.tgz",
@@ -7320,6 +7832,46 @@
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"packages/brand": {
"name": "@tansy/brand",
"version": "0.0.0",
"peerDependencies": {
"react": "^19.0.0"
}
},
"packages/ui": {
"name": "@openkhalix/tansy-ui",
"version": "0.4.0",
"license": "MIT",
"dependencies": {
"@base-ui/react": "^1.8.0",
"clsx": "^2.1.1",
"lucide-react": "^1.48.0",
"tailwind-merge": "^3.7.0"
},
"devDependencies": {
"@tailwindcss/cli": "^4.3.3",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.7",
"@types/node": "^24.13.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.7",
"@vitejs/plugin-react": "^6.1.1",
"axe-core": "^4.13.0",
"jsdom": "^30.1.1",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"tailwindcss": "^4.3.3",
"typescript": "~6.0.2",
"vite": "^8.3.0",
"vitest": "^5.0.2"
},
"peerDependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
}
}
}
+18 -59
View File
@@ -1,72 +1,31 @@
{
"name": "tansy-ui",
"name": "tansy-ui-monorepo",
"private": true,
"version": "0.3.0",
"description": "A themeable, accessible React component kit built on Base UI and Tailwind CSS v4.",
"version": "0.0.0",
"type": "module",
"sideEffects": [
"*.css"
],
"module": "./dist-lib/index.js",
"types": "./dist-lib/index.d.ts",
"exports": {
".": {
"types": "./dist-lib/index.d.ts",
"import": "./dist-lib/index.js"
},
"./tokens.css": "./dist-lib/tokens.css",
"./package.json": "./package.json"
},
"files": [
"dist-lib",
"README.md",
"CHANGELOG.md"
"description": "Tansy UI: the @openkhalix/tansy-ui package, its Storybook and its landing page.",
"license": "MIT",
"workspaces": [
"packages/*",
"apps/*"
],
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"build:lib": "vite build --config vite.lib.config.ts && tsc -p tsconfig.lib.json && cp src/styles/tokens.css dist-lib/tokens.css",
"lint": "oxlint src .storybook",
"test": "vitest run",
"test:watch": "vitest",
"dev": "npm run dev -w @tansy/site",
"storybook": "npm run dev -w @tansy/docs",
"build": "npm run build -w @openkhalix/tansy-ui && npm run build -w @tansy/site && npm run build -w @tansy/docs",
"build:lib": "npm run build -w @openkhalix/tansy-ui",
"build:site": "npm run build -w @tansy/site",
"build:docs": "npm run build -w @tansy/docs",
"test": "npm test -w @openkhalix/tansy-ui",
"typecheck": "npm run typecheck -w @openkhalix/tansy-ui && tsc -p apps/site/tsconfig.json --noEmit",
"lint": "oxlint packages apps",
"check:stories": "node scripts/check-stories.mjs",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"peerDependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"dependencies": {
"@base-ui/react": "^1.8.0",
"clsx": "^2.1.1",
"lucide-react": "^0.460.0",
"tailwind-merge": "^3.7.0"
"test:package": "node scripts/test-package.mjs"
},
"devDependencies": {
"@storybook/addon-a11y": "^10.6.0",
"@storybook/addon-docs": "^10.6.0",
"@storybook/react-vite": "^10.6.0",
"@tailwindcss/vite": "^4.3.3",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.7",
"@types/node": "^24.13.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.7",
"@vitejs/plugin-react": "^6.1.1",
"axe-core": "^4.13.0",
"jsdom": "^30.1.1",
"oxlint": "^1.81.0",
"playwright": "^1.63.0",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"remark-gfm": "^4.0.1",
"storybook": "^10.6.0",
"tailwindcss": "^4.3.3",
"typescript": "~6.0.2",
"vite": "^8.3.0",
"vitest": "^5.0.2"
"typescript": "~6.0.2"
}
}
+14
View File
@@ -0,0 +1,14 @@
{
"name": "@tansy/brand",
"private": true,
"version": "0.0.0",
"type": "module",
"description": "Tansy UI logo and catalogue data, shared by the landing page and Storybook. Not published.",
"exports": {
".": "./src/index.ts",
"./public/*": "./public/*"
},
"peerDependencies": {
"react": "^19.0.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+10
View File
@@ -0,0 +1,10 @@
export { TansyMark, type TansyMarkProps } from './TansyMark'
export {
documentation,
featured,
featuredNames,
storyCounts,
totalStories,
type CatalogueEntry,
type FeaturedName,
} from './catalogue'
+56
View File
@@ -7,6 +7,62 @@ All notable changes to Tansy UI are recorded here. The format follows
## [Unreleased]
## [0.4.0] - 2026-09-29
Tansy UI is now a publishable npm package: **`@openkhalix/tansy-ui`**.
### Added
- **Package:** `npm install @openkhalix/tansy-ui`. One ES module per component
(tree-shakeable), TypeScript declarations, and MIT licence.
- **Two ways to style:** `@openkhalix/tansy-ui/tokens.css` for Tailwind v4
apps, or the prebuilt `@openkhalix/tansy-ui/styles.css` for apps without
Tailwind (tokens, the utilities the components use, and a modern reset).
- **Next.js:** component modules are marked `"use client"`, so they import
directly into Server Components; helpers stay server-safe.
- **Install tests:** `npm run test:package` installs the packed tarball into
Vite + Tailwind (strict types), plain React and Next.js apps and checks each
builds and renders correctly.
- **Release workflow:** tag `vX.Y.Z` to publish from CI.
### Changed
- **Monorepo:** the package lives in `packages/ui`, the landing page in
`apps/site` and Storybook in `apps/docs`.
- `lucide-react` 1.x (0.460's types don't compile against current React 19
types when an app type-checks its dependencies).
### Breaking
- The package name is `@openkhalix/tansy-ui` (it was the unpublished
`tansy-ui`), and its build output moved from `dist-lib/` to `dist/`.
## [0.3.1] - 2026-09-28
Every component and the landing page now work from 320px phones to wide
desktops without scrolling sideways.
### Fixed
- **Inputs:** Input, FeaturedInput, NumberInput and Combobox shrink to fit
narrow containers. Inputs no longer hold their ~20-character native width
inside flex rows.
- **Tabs:** a row of tabs that doesn't fit scrolls sideways within itself, and
vertical tabs stack above their panel on phones.
- **ToggleGroup:** scrolls within itself when wider than the screen; its focus
ring is drawn inset so scrolling can't clip it.
- **Popups:** menus, selects, popovers and tooltips never grow past the screen
edge (they cap at Base UI's `--available-width`).
- **Landing page:** the header no longer crowds at tablet widths, and the code
sample fits its card at 1024px.
- **Storybook:** the Accessibility panel no longer counts page-level rules
(`<main>`, `<h1>`, landmarks) that can't apply to an isolated component.
### Added
- `scripts/check-stories.mjs --width <px>` fails any story that makes the page
scroll sideways at that width.
## [0.3.0] - 2026-09-28
A rebuild on Base UI with one consistent API, dark mode, and 28 new components.
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 OpenKhalix
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+115
View File
@@ -0,0 +1,115 @@
# Tansy UI
A themeable, accessible React component kit by [OpenKhalix](https://ui.openkhalix.com), built on
[Base UI](https://base-ui.com) and Tailwind CSS v4.
- **38 components:** forms with floating labels, selects and comboboxes, dialogs, drawers, menus, tabs,
toasts, tables and more.
- **Accessible:** keyboard support and screen-reader wiring from Base UI, visible focus rings, and every
story checked with axe in light and dark mode.
- **Themeable:** seven palettes switchable at runtime, class-based dark mode, and one semantic token set.
- **One API:** `color`, `variant` and `size` on everything; `label`, `description` and `error` on every
field; controlled or uncontrolled values.
**Docs and live examples:** https://ui.openkhalix.com/docs/
## Install
```bash
npm install @openkhalix/tansy-ui
```
Needs React 19. `@base-ui/react`, `lucide-react`, `clsx` and `tailwind-merge` install with it.
## Add the styles
Pick one of the two setups.
### With Tailwind CSS v4 (recommended)
Import the tokens after Tailwind, and let Tailwind scan the package for the classes it uses:
```css
/* app.css */
@import "tailwindcss";
@import "@openkhalix/tansy-ui/tokens.css";
@source "../node_modules/@openkhalix/tansy-ui/dist";
```
Your own Tailwind utilities can then use the same tokens (`bg-surface`, `text-fg`, `bg-primary-500`).
### Without Tailwind
Import the prebuilt stylesheet once, for example in your entry file:
```ts
import '@openkhalix/tansy-ui/styles.css'
```
It contains the tokens, only the utilities the components use, and a modern CSS reset (Tailwind's
preflight), which the components rely on, much as MUI relies on `CssBaseline`. The reset normalises
margins, borders and form controls across your app. If you already use Tailwind, use the setup above
instead.
## Use
```tsx
import { Mail } from 'lucide-react'
import { Button, FeaturedInput, Select, Switch } from '@openkhalix/tansy-ui'
export function InviteForm() {
return (
<form className="grid max-w-sm gap-5">
<FeaturedInput label="Work email" type="email" startIcon={<Mail />} required />
<Select
label="Team"
options={[
{ value: 'design', label: 'Design' },
{ value: 'engineering', label: 'Engineering' },
]}
/>
<Switch label="Send a welcome email" defaultChecked />
<Button type="submit">Send invite</Button>
</form>
)
}
```
### Next.js
Components are marked `"use client"`, so you can import them straight into Server Components. Helpers such
as `cn` and `applyPalette` stay server-safe.
## Dark mode and palettes
```ts
import { applyPalette } from '@openkhalix/tansy-ui'
document.documentElement.classList.toggle('dark', true) // dark mode
applyPalette(document.documentElement, 'emerald') // classicBlue, emerald, violet, amber, crimson, slate, teal
```
Apply a palette to `<html>` so popups, which render in a portal, pick it up too.
## Components
| Group | Components |
|---|---|
| Actions | `Button`, `IconButton`, `LinkButton`, `ToggleGroup`, `Toggle` |
| Forms | `Field`, `Input`, `FeaturedInput`, `TextArea`, `FeaturedTextArea`, `NumberInput`, `Select`, `FeaturedSelect`, `Combobox`, `NativeSelect`, `Checkbox`, `CheckboxGroup`, `Radio`, `Switch`, `Slider` |
| Overlays | `Dialog` (`Modal`), `AlertDialog`, `Drawer` (`Sheet`), `Popover`, `Tooltip`, `InfoTip`, `DropdownMenu` |
| Navigation | `Tabs`, `Accordion`, `Breadcrumb`, `Pagination` |
| Feedback | `Alert`, `Toast` (`Toaster`, `useToast`), `Spinner`, `Progress`, `Meter`, `Skeleton` |
| Display | `Badge`, `CountBadge`, `Avatar`, `AvatarGroup`, `Kbd`, `Table` |
| Layout | `Card`, `Separator` |
Every component has a Storybook page with its props, controls and a story for each state:
https://ui.openkhalix.com/docs/
## Licence and credit
MIT © OpenKhalix. Use it, fork it, and ship it in commercial products, free. The licence's only condition
is that you keep the copyright notice in copies of the code.
If Tansy UI helps you, a visible credit such as "UI by [Tansy UI](https://ui.openkhalix.com)" in your
README or site footer is much appreciated. It isn't required.
+78
View File
@@ -0,0 +1,78 @@
{
"name": "@openkhalix/tansy-ui",
"version": "0.4.0",
"description": "A themeable, accessible React component kit built on Base UI and Tailwind CSS v4.",
"license": "MIT",
"author": "OpenKhalix",
"homepage": "https://ui.openkhalix.com",
"keywords": [
"react",
"components",
"ui",
"design-system",
"tailwindcss",
"base-ui",
"accessible",
"dark-mode"
],
"type": "module",
"sideEffects": [
"*.css"
],
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./tokens.css": "./dist/tokens.css",
"./styles.css": "./dist/styles.css",
"./package.json": "./package.json"
},
"files": [
"dist",
"README.md",
"CHANGELOG.md",
"LICENSE"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "vite build --config vite.lib.config.ts && tsc -p tsconfig.lib.json && cp src/styles/tokens.css dist/tokens.css && tailwindcss -i src/styles/styles.css -o dist/styles.css --minify",
"typecheck": "tsc -p tsconfig.json --noEmit",
"test": "vitest run",
"test:watch": "vitest",
"prepublishOnly": "npm run typecheck && npm test && npm run build"
},
"peerDependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"dependencies": {
"@base-ui/react": "^1.8.0",
"clsx": "^2.1.1",
"lucide-react": "^1.48.0",
"tailwind-merge": "^3.7.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.7",
"@types/node": "^24.13.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.7",
"@vitejs/plugin-react": "^6.1.1",
"axe-core": "^4.13.0",
"jsdom": "^30.1.1",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"tailwindcss": "^4.3.3",
"typescript": "~6.0.2",
"vite": "^8.3.0",
"vitest": "^5.0.2",
"@tailwindcss/cli": "^4.3.3"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -93,7 +93,7 @@ export const Fallbacks: Story = {
export const WithStatus: Story = {
render: (args) => (
<div className="grid gap-5">
<div className="flex items-center gap-5">
<div className="flex flex-wrap items-center gap-5">
{AVATAR_STATUSES.map((status) => (
<div key={status} className="flex flex-col items-center gap-2">
<Avatar {...args} status={status} />
@@ -101,7 +101,7 @@ export const WithStatus: Story = {
</div>
))}
</div>
<div className="flex items-end gap-4">
<div className="flex flex-wrap items-end gap-4">
{AVATAR_SIZES_LIST.map((size) => (
<Avatar key={size} name="John Smith" src={PORTRAITS.john} size={size} status="online" />
))}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -156,7 +156,7 @@ export function Combobox<Multiple extends boolean | undefined = false>({
aria-invalid={invalid || undefined}
aria-busy={loading || undefined}
className={cn(
'min-w-0 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-muted disabled:cursor-not-allowed',
'w-0 min-w-0 flex-1 bg-transparent text-fg outline-none placeholder:text-fg-muted disabled:cursor-not-allowed',
multiple ? cn('min-w-16 px-1', CHIP_INPUT_HEIGHT[size]) : cn('h-full', controlPaddingX[size]),
!multiple && startIcon != null && 'pl-2',
inputClassName,
@@ -206,7 +206,7 @@ export function Combobox<Multiple extends boolean | undefined = false>({
</span>
)}
{multiple ? (
<BaseCombobox.Chips className="flex min-w-0 flex-1 flex-wrap items-center gap-1 py-1 pl-1.5">
<BaseCombobox.Chips className="flex w-0 min-w-0 flex-1 flex-wrap items-center gap-1 py-1 pl-1.5">
{selectedOptions.map((option) => (
<BaseCombobox.Chip
key={option.value}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -125,7 +125,7 @@ export function FeaturedInput({
{startIcon}
</span>
)}
<div className="relative min-w-0 flex-1">
<div className="relative w-0 min-w-0 flex-1">
<BaseInput
ref={setRefs}
type={isPassword && revealed ? 'text' : type}
File renamed without changes.
Loaded 100 of 214 files, more files were not shown because too many files have changed in this diff. Show more