-
Notifications
You must be signed in to change notification settings - Fork 13
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 Minimal header component #846
Conversation
packages/web-components/src/components/va-minimal-header/va-minimal-header.tsx
Show resolved
Hide resolved
packages/web-components/src/components/va-minimal-header/va-minimal-header.scss
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/va-minimal-header/va-minimal-header.scss
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/va-minimal-header/va-crisis-line-modal.tsx
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/va-minimal-header/va-crisis-line-modal.tsx
Outdated
Show resolved
Hide resolved
$red-60v: #b51d09; | ||
$red-70v: #8b1303; | ||
|
||
$small-desktop-screen: 1008px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right place to be adding tokens? Do we have these values somewhere else in a central place we could pull from instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a good opportunity to add something like a breakpoints.json
file for token generation or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be irrelevant if we are able to just use the existing crisis modal variation from va-modal
: https://design.va.gov/storybook/?path=/docs/components-va-modal--crisis-line-modal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have access to the sketch file that contains the mocks for this. Do we have mockups that handle long header values that get passed in? Currently on mobile, long strings make the header take up a lot of space:
Again, I don't have access to the sketch file for this, so not sure if this is expected or not.
$red-60v: #b51d09; | ||
$red-70v: #8b1303; | ||
|
||
$small-desktop-screen: 1008px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a good opportunity to add something like a breakpoints.json
file for token generation or something.
@@ -0,0 +1,112 @@ | |||
import { Component, Host, State, h } from '@stencil/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be its own component? Doesn't feel like it belongs purely as a child component of the minimal header 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah saw that. We have this ticket to address some crisis line inconsistencies in storybook. It seems like .va-crisis-line
and .va-crisis-line-button
renders a different version than what we're using in here.
packages/web-components/src/components/va-minimal-header/va-minimal-header.tsx
Show resolved
Hide resolved
packages/web-components/src/components/va-minimal-header/va-minimal-header.scss
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/va-minimal-header/va-minimal-header.scss
Outdated
Show resolved
Hide resolved
packages/web-components/src/components/va-minimal-header/va-crisis-line-modal.scss
Outdated
Show resolved
Hide resolved
Updated logo to an SVG I found from va.gov Line height reduced for the header |
This PR is ready for re-review, and now also includes fixes for #2016. |
@@ -0,0 +1,130 @@ | |||
import { Component, Host, State, h } from '@stencil/core'; | |||
import arrowRightSvg from '../../assets/arrow-right-white.svg'; | |||
import { CONTACTS } from '../../../../react-components/src/components/Telephone/contacts'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That react Telephone import (along with the contacts file) should be deprecated/removed now.
This is how we have been doing it on vets-website. Does that work here too?
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternately, the direct path should be something like (it's in the packages/web-components/src/
folder)
import { CONTACTS } from '../../contacts.ts';
styleUrl: 'va-crisis-line-modal.scss', | ||
shadow: true, | ||
}) | ||
export class VACrisisLineModal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have some tests written for this component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, on it!
/> | ||
<p> | ||
Call TTY if you have hearing loss{' '} | ||
<strong class="vads-u-margin-left--0p5"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't want to rely on any Formation classes. Can those styles be moved into the component itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a good idea!
$red-60v: #b51d09; | ||
$red-70v: #8b1303; | ||
|
||
$small-desktop-screen: 1008px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right place for tokens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it and couldn't find a better solution for tokens than what Alex did here. These values just don't exist anywhere else that we can use right now, until the remainder of the USWDS tokens are brought into the variables file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now we have a tokens file in the web-components directory, in the CSS Library, and in Formation. Now we are adding random tokens here in a specific component.
It just feels like there are tokens everywhere and adding more here might make dealing with them later more challenging than it already will be.
Can we consider adding the colors we need to the CSS-Library, regenerate the file, and then updating the tokens file in the web-components directory with the new compiled file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Andrew565 If you're not going to address this feedback now, then please create a follow up ticket and link to that issue here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit 48bc847.
Addressed @jamigibbs's feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ataker! Let's just make sure that we have a designer approval on this too before it gets merged cc @babsdenney @danbrady @LWWright7
|
I just checked the Sketch file and it looks like what I intended to me: 8px at mobile, 16px at desktop between the vertical line and the elements near it. That's horizontal and vertical. At desktop I measured using the VA logo - that's 32px padding top and bottom, 16px to the line. I will bring the minimal header from the reference Sketch file into the Component library. |
@humancompanion-usds - not sure if I missed it, but can you drop a link to the sketch file for this in here so @Andrew565 can reference it? |
The Sketch file is in the issue that this PR is related to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked everything in storybook, and it looks good to me 👍
There's an issue with the official gov banner at the medium break point in story book, but we have an existing ticket to address that here - department-of-veterans-affairs/vets-design-system-documentation#2097
@Andrew565 I took a look at the new header. Everything looks great except the crisis line button. The color is a bit off and there's also some hover over states that could be adjusted. The Crisis line button is something that hasn't changed, could you match all the specifications from the production crisis line button. The simple header crisis line button can be identical to the VA.gov current header. |
@Andrew565 This looks so great! Thank you for making the changes! The only little nit-picky thing I see is the hover-over effect on the icon. It is a tad brighter than the one in the main VA header. Looking at the color they chose, it is not a color in the Design System. So that might be something to figure out in the future. They are using - #b51d09 Could we change that color to what is in VA.gov header in prod? |
I see we already made this change but, this is a bug. It is never, ever correct to use a color not in the Design System. Period. "They" here is VA, which is us. It's on us to fix it and not propagate it. I understand we're trying to recreate the current version but in future if the current version is broken or wrong we should address those things. Let's file an issue on this to correct it in future. |
@humancompanion-usds Thanks for calling this out! I definitely agree that should have been a flag to figure out how we could align with colors in the Design System. I made a design ticket for that work. department-of-veterans-affairs/vets-design-system-documentation#2221 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Design approved!
Chromatic
https://minimal-header-dst2030--60f9b557105290003b387cd5.chromatic.com
Description
Closes Minimal header - 2030
Testing done
Tested in Storybook in Chrome, Safari, Edge, and FIrefox
Screenshots
Acceptance criteria
Definition of done