Repository navigation
feat(ui): add @biochain/key-utils and @biochain/key-ui packages - #213
Merged
Merged
Conversation
Introduce shared UI component library following Base-UI architecture: packages/key-utils: - cn() - className merging (clsx + tailwind-merge) - formatAmount() - amount formatting with compact mode - truncateAddress() - address truncation with presets - measureText() - canvas text measurement - useCopyToClipboard() - clipboard hook packages/key-ui: - AddressDisplay - smart truncation + copy (with useAddressDisplay hook) - AmountDisplay - animated numbers + compact mode - AmountWithFiat - amount + fiat value display - TokenIcon - compound component (Root/Image/Fallback) - useRenderElement - unified rendering abstraction White-book documentation added for all components.
Ensure key-utils is built before key-ui typecheck runs.
- Remove unused imports (formatNumberToString, KeyUIComponentProps) - Fix aria-role: change 'text' to 'img' - Fix eqeqeq: use !== instead of != - Replace 'any' types with 'unknown', 'object', or specific types - Add eslint-disable comments for intentional exhaustive-deps violations - Use English string for accessibility status
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.
Summary
Introduce shared UI component library following Base-UI architecture for KeyApp and MiniApps.
New Packages
@biochain/key-utils
cn()- className merging (clsx + tailwind-merge)formatAmount()- amount formatting with compact mode (K/M/B)truncateAddress()- address truncation with presets (compact/standard/detailed)measureText()- canvas text measurementuseCopyToClipboard()- clipboard hook@biochain/key-ui
AddressDisplay- smart truncation + copy (withuseAddressDisplayhook)AmountDisplay- animated numbers + compact modeAmountWithFiat- amount + fiat value displayTokenIcon- compound component (Root/Image/Fallback)useRenderElement- unified rendering abstraction (Base-UI style)Architecture
Follows Base-UI patterns:
renderprop for custom renderingDocumentation
White-book updated:
docs/white-book/03-UI-Ref/06-KeyUI/00-Overview.mddocs/white-book/03-UI-Ref/06-KeyUI/01-AddressDisplay.mddocs/white-book/03-UI-Ref/06-KeyUI/02-AmountDisplay.mddocs/white-book/03-UI-Ref/06-KeyUI/03-TokenIcon.mdNext Steps
@biochain/key-uicomponents