feat(ui): NumericText primitive, button variant polish, loading state - #445
Merged
IbrahimIjai merged 1 commit intoJul 28, 2026
Merged
Conversation
… 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
|
@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. |
|
@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! 🚀 |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
packages/ui/src/components/primitives.test.tsxandstat.tsx/stat-chart-card.tsxalready reference aNumericTextcomponent andnumericRoleForValuehelper, but they were never actually implemented innumeric.tsx(the test file's imports were broken). ImplementedNumericText: tabular figures + slashed zero,neutral/positive/negative/warning/accent/mutedtones, and the samesize/weightscale asText. Also fixed a pre-existing bug instat-chart-card.tsxwhere it referencedNumericRolewithout importing it. Kept the older, value-formattingNumericcomponent untouched (still used by 18 call sites across the app) — renamed its own role type toLegacyNumericRoleto avoid colliding with the newNumericRole.Buttonvariant (default/outline/secondary/ghost/destructive/linkhad default/hover/focus/disabled states but no distinct active state). Added tests iterating every variant and size.LoadingButton(disables itself, setsaria-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 (justinvisiblewhen idle) so entering the loading state never changes the button's width, and the spinner now respectsprefers-reduced-motion. Added tests for both text and icon-only loading buttons.Text/Headingwere already complete with tests (polymorphic viarender, typography/tone variants, a11y coverage) — no changes needed.Test execution note
bun installfails 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 runpackages/ui's vitest suite locally, so I verified all new/changed code by hand against:primitives.test.tsxspec forNumericText/numericRoleForValue(role→class mapping, tabular-nums assertion)stat.tsx's actualNumericTextusage (role/size/weightprops)button.test.tsxa11y-testing patternsPlease run CI/local tests to confirm — happy to fix up if anything doesn't match.
Closes #398
Closes #399
Closes #400
Closes #401