Skip to content

feat(ui): NumericText primitive, button variant polish, loading state - #445

Merged
IbrahimIjai merged 1 commit into
SO4-Markets:mainfrom
tosin-zoffun:feat/issues-398-399-400-401
Jul 28, 2026
Merged

feat(ui): NumericText primitive, button variant polish, loading state#445
IbrahimIjai merged 1 commit into
SO4-Markets:mainfrom
tosin-zoffun:feat/issues-398-399-400-401

Conversation

@tosin-zoffun

Copy link
Copy Markdown
Contributor

Changes

  • DS-012 (DS-012: Add a numeric data primitive #399): packages/ui/src/components/primitives.test.tsx and stat.tsx/stat-chart-card.tsx already reference a NumericText component and numericRoleForValue helper, but they were never actually implemented in numeric.tsx (the test file's imports were broken). Implemented NumericText: tabular figures + slashed zero, neutral/positive/negative/warning/accent/muted tones, and the same size/weight scale as Text. Also fixed a pre-existing bug in stat-chart-card.tsx where it referenced NumericRole without importing it. Kept the older, value-formatting Numeric component untouched (still used by 18 call sites across the app) — renamed its own role type to LegacyNumericRole to avoid colliding with the new NumericRole.
  • DS-013 (DS-013: Align Button variants with the new system #400): added active-state background classes to every Button variant (default/outline/secondary/ghost/destructive/link had default/hover/focus/disabled states but no distinct active state). Added tests iterating every variant and size.
  • DS-014 (DS-014: Add loading state support to Button #401): the loading-state primitive already exists as LoadingButton (disables itself, sets aria-busy, swaps in a spinner) — fixed the two gaps the issue called out: the spinner now sits in a fixed-size slot that's always present (just invisible when idle) so entering the loading state never changes the button's width, and the spinner now respects prefers-reduced-motion. Added tests for both text and icon-only loading buttons.
  • DS-011 (DS-011: Add a typography primitive #398): Text/Heading were already complete with tests (polymorphic via render, typography/tone variants, a11y coverage) — no changes needed.

Test execution note

bun install fails silently (exit 1, no error output) in my environment, reproducibly, even from a clean checkout with no lockfile and a cleared bun cache — this is an environment issue, not caused by this change. I couldn't run packages/ui's vitest suite locally, so I verified all new/changed code by hand against:

  • the existing primitives.test.tsx spec for NumericText/numericRoleForValue (role→class mapping, tabular-nums assertion)
  • stat.tsx's actual NumericText usage (role/size/weight props)
  • the existing button.test.tsx a11y-testing patterns

Please run CI/local tests to confirm — happy to fix up if anything doesn't match.

Closes #398
Closes #399
Closes #400
Closes #401

… tests

- DS-012 (SO4-Markets#399): implement the NumericText primitive already specified
  by packages/ui/src/components/primitives.test.tsx and consumed by
  stat.tsx/stat-chart-card.tsx but never actually built: tabular
  figures + slashed zero, neutral/positive/negative/warning/accent/muted
  tones, and the same size/weight scale as Text. Also fixes a
  pre-existing bug in stat-chart-card.tsx: it referenced NumericRole
  without importing it. Kept the older value-formatting Numeric
  component (18 existing call sites) untouched, renaming its own role
  type to LegacyNumericRole to avoid colliding with the new NumericRole.
- DS-013 (SO4-Markets#400): added active-state background classes to every Button
  variant (default/outline/secondary/ghost/destructive/link previously
  had default/hover/focus/disabled but no distinct active state), plus
  tests iterating every variant and size.
- DS-014 (SO4-Markets#401): the loading-state primitive already exists as
  LoadingButton (aria-busy + disabled + spinner). Fixed the two gaps
  the issue called out: the spinner now sits in a fixed-size slot
  that's always present (invisible when idle) so entering the loading
  state never changes the button's width, and it now respects
  prefers-reduced-motion. Added tests for both text and icon-only
  loading buttons.
- DS-011 (SO4-Markets#398): Text/Heading primitives were already complete and
  tested; no changes needed.

Note: local `bun install` fails silently (exit 1, no diagnostics) in
this environment even from a clean checkout with no lockfile and a
cleared bun cache, so packages/ui's vitest suite couldn't be run
locally. All new/changed code was checked by hand against the existing
primitives.test.tsx spec, stat.tsx's NumericText usage, and the
button.test.tsx patterns already in the repo.

Closes SO4-Markets#398
Closes SO4-Markets#399
Closes SO4-Markets#400
Closes SO4-Markets#401
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@tosin-zoffun is attempting to deploy a commit to the Ijai's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@tosin-zoffun Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@IbrahimIjai
IbrahimIjai merged commit e15c6d6 into SO4-Markets:main Jul 28, 2026
0 of 4 checks passed
balisdev added a commit to balisdev/interface that referenced this pull request Jul 28, 2026
…area

Resolves conflicts in numeric.tsx and button.test.tsx against PR SO4-Markets#445,
which landed its own independent (and more complete) fix for the same
NumericText regression this branch also fixed. Took upstream's version of
numeric.tsx as-is: it keeps Numeric's original "danger"/"brand-long"/
"brand-short" roles under a LegacyNumericRole alias for backward
compatibility, alongside a properly separated NumericText/numericTextVariants
for the newer neutral/muted/positive/negative/warning/accent role set.

Reverted this branch's role="warning" edits in TradeInfoRows.tsx and
PositionsList.tsx back to role="danger" to match the restored
LegacyNumericRole type Numeric now uses upstream.

button.test.tsx conflict was just import ordering; kept both the sorted
imports and the `screen` import upstream's new test needs.
balisdev added a commit to balisdev/interface that referenced this pull request Jul 28, 2026
Sort-imports on the two files upstream's PR SO4-Markets#445 touched, and coerce
Stat's nullable role prop before passing it to NumericText, whose role
type (from the merged numeric.tsx) doesn't accept null.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants