Skip to content

feat: datum-ui v0.2 — monorepo scaffold, component library, tests, storybook, docs#13

Open
yahyafakhroji wants to merge 12 commits intomainfrom
feat/v0.2-refactor
Open

feat: datum-ui v0.2 — monorepo scaffold, component library, tests, storybook, docs#13
yahyafakhroji wants to merge 12 commits intomainfrom
feat/v0.2-refactor

Conversation

@yahyafakhroji
Copy link

@yahyafakhroji yahyafakhroji commented Mar 3, 2026

Summary

Complete restructure of the datum-ui package from a flat component library into a scalable monorepo-based design system with a two-layer architecture (shadcn primitives + datum components), full test suite, Storybook explorer, and Fumadocs documentation site.

  • Monorepo scaffold with turborepo, pnpm workspaces, shared config packages
  • 50+ components organized with compound patterns (Form system, DataTable, etc.)
  • 204 component tests via Vitest with jsdom
  • 44 Storybook stories with Rsbuild-based setup
  • Fumadocs documentation site with 57 pages, live component previews, and design token docs
  • Pre-commit hooks via Lefthook for lint and typecheck

What Changed

Architecture

  • Build system: migrated from tsup to tsdown with multi-entry builds and sub-path exports
  • Component architecture: 50+ components organized under src/components/ with individual barrel files
  • Form library: compound component pattern with Conform.js, stepper, validation, 8 field types
  • Theme system: custom ThemeProvider with CSS variable-based design tokens, dark/light/system mode
  • Extracted primitives: input, select, checkbox, switch, textarea, radio-group, autocomplete — each wrapped with datum design tokens

Testing (new)

  • Vitest setup with jsdom, React Testing Library
  • 204 tests across 29 component suites
  • Covers rendering, interactions, accessibility, and edge cases

Storybook (new)

  • Rsbuild-based Storybook with autodocs
  • 44 stories covering all major components
  • Datum theme applied with DatumProvider decorator

Documentation Site (new)

  • Fumadocs v15 with datum design token theming
  • Getting started guides (overview, installation, theming, providers)
  • 50+ component documentation pages with live ComponentPreview
  • Hook documentation (useDebounce, useCopyToClipboard)
  • Client/server boundary handled via 'use client' wrapper layer

Quality

  • Lefthook pre-commit hooks running ESLint + TypeScript typecheck
  • Project README with logo and usage guide

Old Setup vs New Setup

Aspect Old (v0.1) New (v0.2)
Structure Flat src/<component>/ directories Organized src/components/<component>/ with single top-level barrel
Primitives Direct shadcn re-exports Two-layer: shadcn primitives wrapped with datum design tokens
Build tsup, single entry point tsdown, multi-entry with sub-path exports for tree-shaking
Form No form system Compound Form.* API with validation, field arrays, multi-step
Theming Basic CSS with hardcoded tokens Custom ThemeProvider with dark/light/system, Figma token pipeline
Component count ~15 basic components 50+ components
Testing No tests 204 tests across 29 suites (Vitest)
Storybook Vite-based, minimal Rsbuild-based, 44 stories with autodocs
Documentation None Fumadocs site with 57 pages and live previews
CI hooks None Lefthook pre-commit (lint + typecheck)

Test Plan

  • pnpm --filter datum-ui test — 204 tests passing
  • pnpm --filter storybook build — builds successfully
  • pnpm --filter docs build — 57 static pages generated
  • pnpm --filter datum-ui typecheck — no type errors
  • Pre-commit hooks pass (lint + typecheck)

- Initialize v0.2 monorepo with turborepo, pnpm workspaces
- Add @repo/config (eslint, tsconfig presets), @repo/shadcn primitives
- Scaffold @datum-cloud/datum-ui with tsdown multi-entry build
- Add DatumProvider with theme system and design tokens
- Migrate all branded components from cloud-portal shadcn module
- Extract form primitives (input, select, checkbox, switch, textarea,
  radio-group, autocomplete) to top-level component directories
- Add compound Form library with stepper, validation, and Conform.js
- Add data-table, task-queue, time-range-picker, and 20+ components
- Set up Storybook with Rsbuild and Fumadocs documentation site
- Add Vitest test infrastructure with component tests
- Configure changesets for versioning
@kevwilliams
Copy link
Contributor

There are errors trying to run storybook in this branch I could not get it to load but it looks like it heads in a great direction.

Do you have any reservations keeping this as a Draft for now? I think we can merge this before we merge the Button replacement in the staff portal if we are happy with this. Once we decide on this we can expand on the component adoption in the staff portal / begin adoption in the cloud portal.

…mponents)

Adds comprehensive test coverage for all datum-ui components including
render, props, and interaction tests. Covers simple components (badge,
button, input, etc.), complex composites (form system with validation,
data-table with sorting/filtering), and utility components (toast,
loader-overlay, empty-content). Also adds shared test utilities
(renderWithProviders with DatumProvider + TooltipProvider) and jsdom
polyfills (ResizeObserver, pointer capture, scrollIntoView) for Radix
UI compatibility.
Adds lefthook to run ESLint (with auto-fix) and TypeScript type
checking on staged files before each commit. Also adds a typecheck
script to datum-ui and a typecheck task to turbo.json.
…nt/typecheck

- Rewrite all storybook stories to use @datum-cloud/datum-ui exports
- Add 30+ new stories (form, stepper, task-queue, sidebar, data-table, etc.)
- Bundle empty-content images as data URLs via tsdown loader
- Fix stepper story to use @stepperize/react v6 API (Stepper.Provider)
- Fix ReactNode controls crashing storybook (icon, actions argTypes)
- Remove redundant autodocs config from storybook main.ts
- Expand form stories to 14 variants covering all Form sub-components
- Add ESLint + typecheck scripts to storybook package
- Configure storybook ESLint with story-specific rule overrides
- Update lefthook to also check storybook (lint + typecheck)
- Add react-day-picker and @tanstack/react-table as storybook dev deps
…alog

- Configure fumadocs (v15) with datum-ui theme token mapping
- Add ComponentPreview for live component rendering in MDX
- Add getting started guides (overview, installation, theming, providers)
- Add documentation pages for all 50+ components across 8 categories
- Add hook documentation (useDebounce, useCopyToClipboard)
- Handle client/server boundary with 'use client' wrapper layer
@yahyafakhroji yahyafakhroji changed the title feat: datum-ui v0.2 monorepo scaffold with component library feat: datum-ui v0.2 — monorepo scaffold, component library, tests, storybook, docs Mar 4, 2026
@yahyafakhroji yahyafakhroji marked this pull request as ready for review March 4, 2026 04:08
@yahyafakhroji yahyafakhroji marked this pull request as draft March 4, 2026 04:09
@yahyafakhroji
Copy link
Author

yahyafakhroji commented Mar 4, 2026

@kevwilliams Hi Kevin, sorry for the error experience. This PR is still a draft when you tested it, so I'm still developing it.

However, you can try it again. I've completed this PR with all the components from the base cloud portal, Vitest, Storybook, and the docs site.

- Add CI workflow with lint, typecheck, test, and build jobs on PRs
- Restore release workflow with changesets for versioning
- Restore publish workflow using datum-cloud/actions reusable workflow
- Introduce functions to convert dates to UTC timestamps for start and end of day in specified timezones.
- Update datepicker component to utilize new timezone utilities for accurate date filtering.
@yahyafakhroji yahyafakhroji marked this pull request as ready for review March 4, 2026 05:29
@yahyafakhroji yahyafakhroji requested review from a team and kevwilliams March 4, 2026 05:29
…stency

- Refactor button variant styles in button.tsx to utilize new theme variables for primary, secondary, tertiary, and quaternary buttons.
- Introduce new CSS variables for button colors in alpha.css, enhancing light and dark mode support.
- Ensure consistent hover and active states across button types with updated color definitions.
- Update font-family definitions to use single quotes for consistency.
- Simplify button color-mix definitions by removing unnecessary line breaks.
- Ensure uniformity in button active states across primary, secondary, tertiary, and quaternary styles.
"mode": "auto"
}
],
"typescript.tsdk": "node_modules/typescript/lib",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep this in please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants