Skip to content

feat(shared): add UI primitives and kernel barrel#13

Merged
rivodotlove merged 1 commit into
mainfrom
feat/shared-ui-primitives
Jun 2, 2026
Merged

feat(shared): add UI primitives and kernel barrel#13
rivodotlove merged 1 commit into
mainfrom
feat/shared-ui-primitives

Conversation

@rivodotlove

@rivodotlove rivodotlove commented Jun 2, 2026

Copy link
Copy Markdown
Owner

What

Adds reusable, cva-based UI primitives under src/shared/ui with a barrel export:

  • Box — block div with display variant + asChild
  • Flex — flexbox div with direction/align/justify/wrap/gap/inline + asChild
  • Typographyvariant (h1–h4, p, span, code, muted, …) maps to semantic tag, as override + asChild
  • Button, Checkbox, Label, Textarea — shadcn/radix primitives

Also adds a src/shared/kernel barrel re-exporting registry + result, and hardens main.tsx root lookup with an explicit HTMLElement cast.

Why

Establishes a small design-system layer so feature code composes primitives instead of repeating raw div/span + Tailwind. Consumer refactors (shell, base64) land in follow-up PRs.

Verification

vp check passes (format, lint, types) on all new files.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added comprehensive UI component library with Box, Button, Checkbox, Flex, Label, Textarea, and Typography components featuring configurable display and styling variants.
  • Refactor

    • Updated root initialization and reorganized module export structure.

Add Box, Flex, Typography, Button, Checkbox, Label, Textarea cva-based
primitives with a shared/ui barrel, plus a shared/kernel barrel
re-exporting registry and result. Harden main.tsx root lookup with an
explicit HTMLElement cast.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rivodotlove rivodotlove self-assigned this Jun 2, 2026
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR establishes core shared library infrastructure by introducing a comprehensive UI component library, configuring kernel module exports, and refactoring the application entry point. The UI components follow a consistent pattern: define variants via class-variance-authority, render polymorphically with Radix UI, and apply merged styling.

Changes

Shared Library and Application Foundation

Layer / File(s) Summary
Application entry point root element resolution
src/main.tsx
DOM root element is resolved into a typed variable before being passed to createRoot, removing the inline non-null assertion.
Kernel module public surface
src/shared/kernel/index.ts
Barrel exports establish public API for registry and result modules.
UI layout components with variants
src/shared/ui/box.tsx, src/shared/ui/flex.tsx
Box and Flex components define cva variants for display and layout control. Both support asChild polymorphism and forward props.
UI form and interactive components
src/shared/ui/button.tsx, src/shared/ui/checkbox.tsx, src/shared/ui/label.tsx, src/shared/ui/textarea.tsx
Form controls wrap Radix UI primitives or native elements, apply fixed and mergeable Tailwind styling, and include data attributes for hooks.
UI typography system with polymorphic variant support
src/shared/ui/typography.tsx
Typography component supports variant-driven element selection (via VARIANT_TAGS), asChild composition, and optional tag override with as prop. Variants map to heading and text styles.
UI library public surface barrel export
src/shared/ui/index.ts
Barrel re-exports all UI components and variant configurations to establish the shared UI module's public API.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • rivodotlove/devbox#8: Introduces the registry and result modules whose public exports are now established via the kernel barrel in this PR.

Poem

🐰 Components in layers so neat,
Variants dance where style and logic meet,
Radix primitives wrapped with care and grace,
A UI library finds its place!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(shared): add UI primitives and kernel barrel' accurately describes the main changes—introduction of UI primitives and kernel barrel exports—and follows conventional commit conventions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/shared-ui-primitives

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
devbox d839a66 Commit Preview URL

Branch Preview URL
Jun 02 2026, 02:41 PM

@rivodotlove rivodotlove merged commit 94837f2 into main Jun 2, 2026
2 of 3 checks passed
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.

1 participant