Skip to content

feat(ui): polish core components with additive variants#157

Merged
antosubash merged 3 commits into
mainfrom
claude/improve-design-system-NAPKg
May 11, 2026
Merged

feat(ui): polish core components with additive variants#157
antosubash merged 3 commits into
mainfrom
claude/improve-design-system-NAPKg

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Summary

Additive polish to the core UI primitives in @simplemodule/ui and @simplemodule/theme-default. All changes are backwards-compatible — existing call sites use the default variant and need no updates.

What changed

  • Dialogsize prop with sm | default | lg | xl | full so modules can drop hardcoded sm:max-w-lg overrides.
  • ButtonisLoading + loadingText props that render an inline spinner and set aria-busy; new size="icon" variant; standard focus-visible ring on the base.
  • Inputprefix / suffix slots that absolute-position adornments inside the field with auto-padding, and a wrapperClassName for outer customization.
  • Card — extracted cardVariants with variant (default / flat / elevated / ghost) and padding (none / sm / default / lg). Default behaviour unchanged.
  • AppLayout — sidebar nav classes moved from inline TSX constants into theme as .sidebar-nav-link-active / -inactive with focus-visible ring, so styling is themable.
  • Theme — new .focus-ring and .focus-ring-danger utilities for consistent focus treatment across custom interactive elements.

Why

The base library had high adoption (97 import sites) but a few rough edges showed up repeatedly: dialogs with hardcoded widths in module pages, no isLoading button state, no input adornment slots, and nav classes hardcoded in app-layout.tsx. These additions cover the common asks without touching any consumer.

Test plan

  • npm run check:fix (biome) clean
  • npm run validate-pages clean
  • npm run build (all module Vite library builds + ClientApp) succeeds
  • dotnet build succeeds with 0 warnings / 0 errors
  • Visual smoke check: open a page using Dialog / Button / Input / Card and confirm default rendering is unchanged
  • Try a <Dialog><DialogContent size="lg"> and <Button isLoading>Save</Button> in a module page

Generated by Claude Code

- Dialog: add size variants (sm/default/lg/xl/full); modules can drop
  hardcoded sm:max-w-lg overrides.
- Button: add isLoading + loadingText props with inline spinner; size
  gains an icon variant; add focus-visible ring.
- Input: add prefix/suffix slots that auto-pad the field and merge
  cleanly with existing variants.
- Card: extract cardVariants with variant (default/flat/elevated/ghost)
  and padding (none/sm/default/lg) options.
- AppLayout: extract sidebar nav classes into theme as
  .sidebar-nav-link-active / -inactive (with focus-visible ring) so
  styling is themable rather than hardcoded in tsx.
- Theme: add .focus-ring and .focus-ring-danger utilities for
  consistent focus treatment across custom interactive elements.

All changes are backwards-compatible - existing call sites use the
default variant and need no updates.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 9, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 56279c9
Status: ✅  Deploy successful!
Preview URL: https://fab16643.simplemodule-website.pages.dev
Branch Preview URL: https://claude-improve-design-system.simplemodule-website.pages.dev

View logs

claude and others added 2 commits May 9, 2026 20:51
Reconcile #155 (Card m-2 margin) with this branch's CVA-based Card
refactor by adding `m-2` to the cardVariants base classes so the
default visual is preserved across all variant/padding combinations.

Also fix a TS2430 conflict surfaced by `npm run typecheck` after the
merge: HTMLInputElement has a built-in `prefix?: string` (RDFa)
attribute, which collided with our new `prefix?: ReactNode` slot.
Resolved by `Omit<..., 'prefix'>` on the InputProps base interface.
@antosubash antosubash marked this pull request as ready for review May 11, 2026 15:24
@antosubash antosubash merged commit f0cfe2e into main May 11, 2026
6 checks passed
@antosubash antosubash deleted the claude/improve-design-system-NAPKg branch May 11, 2026 15:32
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.

2 participants