feat: port Table, Pagination, Drawer, EmptyState; fix Badge themes #1

Merged
sione merged 1 commit from feat/ui-contributions into main 2026-09-26 10:58:29 +02:00
Owner

Summary

Ports the Credit App bureau/src/components/ui/ primitives into the library as TypeScript source, and fixes the Badge theme gap.

  • Badge fix: adds amber + violet themes (unknown themes previously rendered colourless via an undefined class lookup), className passthrough via cn(), dev warning + gray fallback for unknown themes. Lookup tables are typed Record<BadgeTheme, ...> so a missing theme class is now a compile error.
  • EmptyState: standalone zero-state (distinct from ListView-locked ListEmptyState).
  • Pagination: controlled toolbar + pure pageWindow() helper.
  • Drawer: slide-over on @headlessui/react Dialog (focus trap, Escape, scroll-lock, aria).
  • Table/DataTable: primitives + sortable table (controlled/uncontrolled sort, aria-sort, nulls-last).

Every component ships types.ts + index.ts + .stories.tsx + tests/, registered in components/index.ts.

Validation

  • pnpm lint:types (tsc): clean
  • eslint on all touched paths: clean
  • pnpm test:unit on the 5 suites: 47/47 pass

Follow-ups

Split into per-component PRs for upstream rtCamp (each needs a discussion issue first per their contributing guide).

## Summary Ports the Credit App `bureau/src/components/ui/` primitives into the library as TypeScript source, and fixes the Badge theme gap. - **Badge fix**: adds `amber` + `violet` themes (unknown themes previously rendered colourless via an `undefined` class lookup), `className` passthrough via `cn()`, dev warning + gray fallback for unknown themes. Lookup tables are typed `Record<BadgeTheme, ...>` so a missing theme class is now a compile error. - **EmptyState**: standalone zero-state (distinct from ListView-locked `ListEmptyState`). - **Pagination**: controlled toolbar + pure `pageWindow()` helper. - **Drawer**: slide-over on `@headlessui/react` Dialog (focus trap, Escape, scroll-lock, aria). - **Table/DataTable**: primitives + sortable table (controlled/uncontrolled sort, `aria-sort`, nulls-last). Every component ships `types.ts` + `index.ts` + `.stories.tsx` + `tests/`, registered in `components/index.ts`. ## Validation - `pnpm lint:types` (tsc): clean - `eslint` on all touched paths: clean - `pnpm test:unit` on the 5 suites: **47/47 pass** ## Follow-ups Split into per-component PRs for upstream rtCamp (each needs a discussion issue first per their contributing guide).
Badge: add amber/violet themes, className passthrough, dev warning for unknown themes. Lookup tables typed Record<BadgeTheme,...> so missing theme classes fail the build. New components (Table/DataTable, Pagination+pageWindow, Drawer, EmptyState) ported from bureau ui/ to TS with types, stories, tests; registered in components/index.ts. Validated: tsc clean, eslint clean, 47/47 unit tests pass.
sione merged commit 57c2acafbc into main 2026-09-26 10:58:29 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sione/frappe-ui-react!1
No description provided.