Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add o-search-input component #8401

Merged
merged 8 commits into from May 14, 2024
Merged

Add o-search-input component #8401

merged 8 commits into from May 14, 2024

Conversation

anselmbradford
Copy link
Member

@anselmbradford anselmbradford commented May 9, 2024

Additions

  • Add new search input component pattern.

Changes

  • Migrate various search inputs to single search input component.

How to test this PR

The (x) inside the search input should not show up unless text is entered. It should darken on hover and it should get a focus rectangle on tabbing to the (x) icon.

Global search - Any page expand the global search.

Ask landing - search should show autocomplete
http://localhost:8000/ask-cfpb/

Ask landing Spanish - search show autocomplete
http://localhost:8000/es/obtener-respuestas/

Ask search - search should not show autocomplete
http://localhost:8000/ask-cfpb/search

eRegs
http://localhost:8000/rules-policy/regulations/search-regulations/results/?regs=1002

TDP
http://localhost:8000/consumer-tools/educator-tools/youth-financial-education/teach/activities/

Prepaid
http://localhost:8000/data-research/prepaid-accounts/search-agreements/

Screenshots

Ask CFPB:

Screen.Recording.2024-05-10.at.1.56.48.PM.mov

Before (mobile view):
Screenshot 2024-05-10 at 1 59 01 PM

After (mobile view):
Screenshot 2024-05-10 at 1 58 33 PM

Regs:

Before:
Screenshot 2024-05-10 at 2 10 50 PM

After:
Screenshot 2024-05-10 at 2 10 40 PM

TDP:

Before:
Screenshot 2024-05-10 at 2 12 12 PM

After:
Screenshot 2024-05-10 at 2 12 02 PM

Prepaid:

Before:
Screenshot 2024-05-10 at 2 13 23 PM

After:
Screenshot 2024-05-10 at 2 13 10 PM

iOS 17.2

Screenshot 2024-05-10 at 5 21 29 PM

Note

  • This pattern will be added to the DS, once this is approved.
  • The Ask answers page should maybe use this component too, see version on
    http://localhost:8000/consumer-tools/auto-loans/answers/
  • The touch target makes the button wider than the x icon, but to align it correctly the icon is offset from the button center. To make the focus rectangle look correct, it is only on the icon. This means it's possible to push the button to the left of the focus rectangle, but I think this is fine.

@anselmbradford anselmbradford force-pushed the ans_search_input branch 11 times, most recently from 8100da9 to 8f34b10 Compare May 10, 2024 18:50
@anselmbradford anselmbradford marked this pull request as ready for review May 10, 2024 18:50
@anselmbradford anselmbradford changed the title Add o-search-input component Add o-search-input component May 10, 2024
@anselmbradford anselmbradford force-pushed the ans_search_input branch 2 times, most recently from 72174a8 to f62459c Compare May 10, 2024 21:40
anselmbradford and others added 2 commits May 14, 2024 09:20
* Remove need for data-language attribute and remove 'with context' from search imports

Co-authored-by: Ans <anselmbradford@users.noreply.github.com>
Copy link
Member

@wpears wpears left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆒

Copy link
Member

@wpears wpears left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cfgov/ask_cfpb/jinja2/ask-cfpb/_ask-search.html got borked by a merge conflict

@anselmbradford
Copy link
Member Author

cfgov/ask_cfpb/jinja2/ask-cfpb/_ask-search.html got borked by a merge conflict

Fixed in 0c152c8
I'm not sure how that happened, as I fixed it via the GH UI editor 🤔 oh well…

@anselmbradford anselmbradford added this pull request to the merge queue May 14, 2024
Merged via the queue into main with commit ceef705 May 14, 2024
17 checks passed
@anselmbradford anselmbradford deleted the ans_search_input branch May 14, 2024 16:05
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.

None yet

3 participants