Repository navigation
[BHO-94]: add Button and Filter components - #107
Merged
Merged
Conversation
naman0r
reviewed
Nov 22, 2026
Author
|
note to self: Resolve issues/comments once #101 is merged and pull from main |
cheangie
force-pushed
the
cheangie/button-filter-components
branch
from
November 22, 2026 21:32
74819b6 to
0d79d41
Compare
Resolve components/index.ts by keeping the exports from #102 and from this PR.
naman0r
self-requested a review
November 22, 2026 21:55
naman0r
approved these changes
Nov 22, 2026
…m/Code-4-Community/bho into cheangie/button-filter-components
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.
ℹ️ Issue
Closes #94
Uses the tokens from #68 (merged in #72) and the Chakra setup from #99.
Figma: https://www.figma.com/design/MrZxYY9J7DP0w7RWuamueg/BHO (Buttons
156:1559, Filter528:7117, filter bar528:7052/531:16311)📝 Description
Adds a shared
ButtonandFilterinapps/frontend/src/components/, built on Chakra primitives and styled with the CSS variables instyles/tokens.css. Like #102 and #103 there is no custom Chakra theme.Button(wraps Chakra'sButton)primary(Upload, Re-Upload, Refresh, Download, Submit, Add Text, Source: All),secondary(Cancel, Close),dark(Clear Filters),link(Today's Entry),ghost(icon-only Open). Callers pass the label and iconsmd(Figma's 40px) andsmleftIcon/rightIcon(decorative,aria-hidden),loading/loadingText(disabled,aria-busy, width stays stable),disabled, hover / active / focus-visible stylestypedefaults to"button";type="submit"passes throughhrefrenders a real<a>;asChildworks with a router Link. Icon-only buttons must have anaria-label(enforced by the types)Button/variants.ts, one entry per lookFilter(built on Chakra'sSelect)options,value,onChange, pluslabel(wired to the trigger),icon,placeholder,size,disabled,widtharia-selected), trigger hasaria-expanded; Enter / Space / Arrows open, arrows move, Enter selects, Escape closes (from Chakra){ value, label }is the hook soFilterwon't need to changeOther changes
lucide-react(added in [BHO-86]: add DataTable, SubmittedEntriesTable and ErrorLogTable #101). Stroke widths and sizes follow the Figma icons; the Figma SVGs are not copied into the repo/designpage (containers/button-filter-demo.tsx, mock data incontainers/mockFilters.ts). Picking "Sep 1 - Sep 30, 2026" shows "0 entries" and a working Clear Filters buttonrenderWithProvidersand plain DOM assertions (no jest-dom, which only Add Tag, Tile, LastUploadTile, Section and SectionRow components (#67) #102 sets up)Where this differs from the handoff: the secondary border is 1.5px and the filter radius 10px, as Figma shows. Figma's link "Clicked" color is
--sea-green-600.🔎 Needs a decision or follow-up
Values with no token in
tokens.css(named invariants.ts/Filter.tsx, not hard-coded around the code):--color-primary-hover: only in Add UploadFile, FileRejected, Subsection and FileItem components (#76) #103, read with fallbacks so this works before and after it mergessmsizes (32px button, 40px filter), which are not in Figma--sea-green-600, no Figma design)✔️ Verification
Screen.Recording.2026-11-22.at.3.51.05.PM.mov
$ npx vitest run # from apps/frontend ✓ src/components/Button/Button.spec.tsx (17 tests) ✓ src/components/Filter/Filter.spec.tsx (10 tests) (plus the existing specs) Test Files 7 passed (7) Tests 43 passed (43)Prettier is clean. To check it yourself:
npx nx serve frontend, open http://localhost:4200/design and scroll to Buttons, Filters and Filter bar and compare with the Figma frames above.