Entry point for AI agents working on @cube-dev/ui-kit.
- Package:
@cube-dev/ui-kit - Repository: cube-js/cube-ui-kit
- Storybook: cube-ui-kit.vercel.app
- Styling engine: Tasty (
@tenphi/tasty) - Palette engine: Glaze (
@tenphi/glaze)
Maintenance note: The design-system reference (tokens, presets, colors, modifiers, state syntax, form system, icons) lives in
src/stories/Usage.docs.mdx(Storybook → Getting Started / Usage). The component creation guide lives insrc/stories/CreateComponent.docs.mdx(Getting Started / Create Component). Update these whenever you add components, change the API surface, or modify tokens/presets.
Project-specific working rules for AI agents. Not published with the package.
- coding.md — development flow, code style, knowledge maintenance
- storybook.md —
.stories.tsxand.docs.mdxauthoring - documentation.md —
.docs.mdxstructure + update flow - tests.md — Vitest + React Testing Library patterns
- commit-changes.md — commit message convention
When making code changes that affect end users or the public API, always add a new changeset or update an existing one in .changeset/ as part of the same task. Do not wait to be asked.
- Prefer updating an existing open changeset that already covers the same work/PR; otherwise add a new
.mdfile. - Use
patchfor bug fixes and small changes;minorfor new features and noticeable breaking changes. - Keep the summary concise and user-focused (
"@cube-dev/ui-kit": patch|minorfrontmatter). - Skip changesets for docs-only, test-only, Storybook-only, or internal tooling that does not affect package consumers. Also skip fixes for issues introduced and resolved within the same PR.
- Add changeset manually (no CLI) — full guidelines:
.cursor/commands/add-changeset.md.
src/
├── components/ # actions, content, fields, form, layout, navigation,
│ # organisms, overlays, status, helpers, portal, other, shared
├── icons/ # 130+ icon components
├── shared/ # Form types (FieldBaseProps, FormBaseProps, FieldCoreProps)
├── tokens/ # Design tokens (colors, typography, spacing, sizes, shadows, layout)
├── stories/ # Storybook guides and documentation pages
├── _internal/ # Internal hooks (useEvent, etc.)
├── tasty-augment.d.ts # TypeScript module augmentation for tasty
└── index.ts # Public barrel export
Each component lives in src/components/{category}/{ComponentName}/ and ships ComponentName.tsx, .stories.tsx, .docs.mdx, .test.tsx, and index.tsx.
pnpm storybook— start Storybook on port 6060pnpm build— build library (tsdown, unbundled ESM)pnpm test— run all tests (Vitest); add-- ComponentNameto filter,-uto update snapshotspnpm fix— lint + format (Oxlint + Prettier)pnpm size— check bundle size limitspnpm chromatic— visual regressionpnpm add-icons— add new icons from tablerpnpm audit-docs— audit component API ↔ docs ↔ argTypes sync. Options:--component=Name,--fix-stories,--fix-docs,--json,--verbose,--all-props. Run after changing a component's API or adding a new component.pnpm run update-tasty/pnpm run update-glaze— bump and pin@tenphi/tastyor@tenphi/glazeto the latest version. Pass--version=X.Y.Zto pin a specific version.
- Node
>=22.0.0, pnpm^10(pinned topnpm@10.32.0). The publish workflow (publish.yml) still runs on Node 24 because OIDC trusted publishing requires npm ≥ 11.5.1+, which Node 24 ships natively (Node 22 ships npm 10.x). - After
pnpm install, runpnpm rebuild esbuild(postinstall is blocked inpnpm-workspace.yaml). - Husky hooks:
pre-commitrunspnpm lint-staged;pre-pushrunspnpm test. Skip only intentionally (--no-verifyorHUSKY=0). - No external services or databases required for local development.
Bundled in docs/tasty/ (symlinked from node_modules/@tenphi/tasty/docs in dev, copied at pack time by scripts/prepare-docs.mjs). Consult these when authoring components or working with style props:
getting-started.md,methodology.md,design-system.md,react-api.md,dsl.md,styles.md,configuration.md,debug.md
Internal-only references (pipeline.md, injector.md), positioning material (comparison.md, adoption.md), and modes the UI Kit does not ship (tasty-static.md, ssr.md) are intentionally omitted; read them directly in docs/tasty/ if needed.
Bundled in docs/glaze/ (same symlink/copy mechanism). Consult when working on color tokens, theme generation, or contrast tuning — Glaze powers src/tokens/palette.ts.
- Styling:
@tenphi/tasty(declarative token-aware CSS-in-JS) - Accessibility:
react-aria+react-stately - Icons:
@tabler/icons-react+ custom icons insrc/icons/ - Testing: Vitest + React Testing Library + Chromatic
- Build: tsdown (unbundled ESM,
es2022) - Storybook: v10 (
@storybook/react-vite) - React: 18 and 19 supported
See src/stories/CreateComponent.docs.mdx (Storybook → Getting Started / Create Component) for the full guide: styleProps vs extractStyles, filterBaseProps, modifiers, sub-elements, React Aria integration, variants, useEvent, and complete examples.
See src/stories/Usage.docs.mdx (Storybook → Getting Started / Usage) for units, base/spacing/size/shadow/layout tokens, color tokens, typography presets, themes, recipes, modifiers, state syntax, icons, and the form system.
- Module augmentation:
src/tasty-augment.d.tsextends@tenphi/tastywith project-specific color tokens, preset names, and theme names. - Props naming:
Cube{ComponentName}Props. ExtendBaseProps/AllBasePropsfrom@tenphi/tasty; mix in style-prop interfaces (ContainerStyleProps,OuterStyleProps,ColorStyleProps, …) as needed. Form types live insrc/shared/. - Barrel exports: every category has an
index.ts; everything re-exports throughsrc/index.ts. - Compound components:
Object.assign(Button, { Group: ButtonGroup, Split: ButtonSplit }). - Tasty re-exports: only types are re-exported. Runtime imports (
tasty,extractStyles,filterBaseProps) come directly from@tenphi/tasty.
- Helpers:
renderWithRoot(wraps with<Root>),renderWithForm(returns{ formInstance, ...renderResult }). - QA selectors:
qaprop →data-qaattribute →screen.getByTestId('name')(testIdAttributeis configured todata-qa). - Tasty snapshots:
toMatchTastySnapshot()captures markup + CSS together. - Patterns: see docs/rules/tests.md.