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

DATAP-1392 - update dependencies, update markup for text inputs and search inputs #514

Merged
merged 4 commits into from
Jun 14, 2024

Conversation

flacoman91
Copy link
Contributor

@flacoman91 flacoman91 commented May 17, 2024

Addresses: DATAP-1392
Addresses: DATAP-1429

This PR:

  • Updates dependencies to the latest where applicable
  • Adds less loader config option to craco to search the correct node_modules path for cf-base.less
  • Rewrites markup for inputs, date inputs. Greatly simplified date picker logic by using native JS date picker's cancel
  • Fixes visual bugs with error styling not appearing in date filters
  • Fixes typeahead bug not showing the matched text in the typeahead options
  • Fixes styling in mobile search bar with new input markup

@flacoman91 flacoman91 force-pushed the DATAP-1392-update-dependencies branch from 34752d4 to 9cfed16 Compare May 20, 2024 14:38
@flacoman91
Copy link
Contributor Author

I added a less loader path option so the cf-forms error doesn't appear anymore, but the buttons inside of the inputs appear broken.

Screenshot 2024-05-31 at 1 18 01 PM Screenshot 2024-05-31 at 1 17 51 PM Screenshot 2024-05-31 at 1 17 37 PM

@anselmbradford if you get a chance, could you take a look at these?

@anselmbradford
Copy link
Member

@flacoman91 Hmm I suspect cfpb/design-system#1979

@flacoman91 flacoman91 force-pushed the DATAP-1392-update-dependencies branch 3 times, most recently from 1a9da9b to 73ac7bb Compare June 5, 2024 19:09
@flacoman91
Copy link
Contributor Author

Screenshots of fixes:
Screenshot 2024-06-05 at 3 09 22 PM
Screenshot 2024-06-05 at 3 03 57 PM
Screenshot 2024-06-05 at 3 03 43 PM
Screenshot 2024-06-05 at 3 03 30 PM
Screenshot 2024-06-05 at 3 03 09 PM
Screenshot 2024-06-05 at 3 03 01 PM
Screenshot 2024-06-05 at 3 02 56 PM
Screenshot 2024-06-05 at 3 02 44 PM

@flacoman91 flacoman91 changed the title DATAP-1392 - update dependencies DATAP-1392 - update dependencies, update markup for text inputs and search inputs Jun 5, 2024
@flacoman91 flacoman91 marked this pull request as ready for review June 5, 2024 19:17
@flacoman91 flacoman91 force-pushed the DATAP-1392-update-dependencies branch from 73ac7bb to b264d9f Compare June 5, 2024 19:39
@flacoman91 flacoman91 enabled auto-merge June 5, 2024 19:43
@flacoman91 flacoman91 requested a review from anselmbradford June 5, 2024 19:43
@anselmbradford
Copy link
Member

If it makes it easier, the date inputs technically don't need a clear since they have it in the default calendar UI. See https://cfpb.github.io/design-system/components/date-picker

Screenshot 2024-06-06 at 11 02 04 AM

@flacoman91
Copy link
Contributor Author

@anselmbradford

We'll need to rethink that.
If we use the native clear button, it clears it out, but what we really want is to set it to the MinDate of 12/01/2011 which is what happens when you click the X.

@anselmbradford
Copy link
Member

We'll need to rethink that.
If we use the native clear button, it clears it out, but what we really want is to set it to the MinDate of 12/01/2011 which is what happens when you click the X.

Gotcha! That's great feedback. Yeah use what you need and I'll bring this example up when we revisit the date input in the DS.

fixing search bar text area

fixing z-index of spyglass icon

getting typeahead to work correctly with styling.

move button around, fix date filter

async typeahead  text fix

update some stuff

update filter and snapshot

hide cancel button if no value

update more deps, fixing cypress tests

fix warnings and nags

fix error styles, remove clear button, fixing styles in mobile view.
@flacoman91 flacoman91 force-pushed the DATAP-1392-update-dependencies branch from 514a54d to 3099ac7 Compare June 6, 2024 16:37
@flacoman91
Copy link
Contributor Author

@anselmbradford i figured it out. We can set the min/max values if the value is empty in the onChange handler.

@flacoman91
Copy link
Contributor Author

flacoman91 commented Jun 6, 2024

Fixes for mobile view,
Missed markup during design system 1.0 migration

Screenshot 2024-06-06 at 12 27 10 PM Screenshot 2024-06-06 at 12 26 49 PM Screenshot 2024-06-06 at 12 26 42 PM Screenshot 2024-06-06 at 11 58 52 AM Screenshot 2024-06-06 at 11 58 45 AM

@flacoman91
Copy link
Contributor Author

Sorry for the rapid fire commits. This is ready now.

{errors.length
? errors.map((message, key) => (
{errors.length ? (
<div className="a-form-alert a-form-alert__error" role="alert">
Copy link
Member

Choose a reason for hiding this comment

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

Update a-form-alert__error to a-form-alert--error

{errors.length
? errors.map((message, key) => (
{errors.length ? (
<div className="a-form-alert a-form-alert__error" role="alert">
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<div className="a-form-alert a-form-alert__error" role="alert">
<div className="a-form-alert a-form-alert--error" role="alert">

<svg
className="cf-icon-svg cf-icon-delete-round"
<div
className="a-form-alert a-form-alert__error"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
className="a-form-alert a-form-alert__error"
className="a-form-alert a-form-alert--error"

disabled={isDisabled}
inputProps={{
id: htmlId,
className: 'a-text-input a-text-input__full',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
className: 'a-text-input a-text-input__full',
className: 'a-text-input a-text-input--full',

onChange={handleChange}
onKeyDown={handlePressEnter}
className={'a-text-input a-text-input__full ' + className}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
className={'a-text-input a-text-input__full ' + className}
className={'a-text-input a-text-input--full ' + className}

@@ -100,6 +89,13 @@
background-color: var(--gray-10);
}
}

.o-search-input__input {
//display: block;
Copy link
Member

Choose a reason for hiding this comment

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

Can this be deleted?

.o-search-input__input {
//display: block;
&-label {
z-index: 1;
Copy link
Member

Choose a reason for hiding this comment

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

Why's this necessary? Maybe add a code comment. Is it possible to put the z-index on the parent o-search-input, so that you're not customizing the component internals?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

without the z-index, the spyglass is appearing under the input box.

I think this is due to how the typeahead works.
With the code it looks like:
Screenshot 2024-06-14 at 11 13 43 AM
without this code:
Screenshot 2024-06-14 at 11 14 00 AM

)}
inputProps={{
id: htmlId,
className: 'a-text-input a-text-input__full',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
className: 'a-text-input a-text-input__full',
className: 'a-text-input a-text-input--full',

@flacoman91 flacoman91 added this pull request to the merge queue Jun 14, 2024
Copy link
Member

@anselmbradford anselmbradford left a comment

Choose a reason for hiding this comment

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

A couple modifiers that need updating from old BEM to new BEM, but otherwise GTG.

Merged via the queue into main with commit 25f8d2a Jun 14, 2024
2 checks passed
@flacoman91 flacoman91 deleted the DATAP-1392-update-dependencies branch June 14, 2024 14:08
@anselmbradford
Copy link
Member

Whoops, looks like this may have auto gone in without the BEM updates

@flacoman91
Copy link
Contributor Author

Whoops, looks like this may have auto gone in without the BEM updates

I'll take care of it

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.

2 participants