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 Minimal header component #846

Merged
merged 36 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2bae7dd
Add minimal header
ataker Sep 13, 2023
b47030d
Update components.d.ts
ataker Sep 13, 2023
bc6b097
cleanup
ataker Sep 14, 2023
715de67
Merge branch 'main' into minimal-header-dst2030
ataker Sep 14, 2023
75a6a19
Update storybook, clean up subheader
ataker Sep 14, 2023
25d2433
Add tests
ataker Sep 14, 2023
19ef5a0
Merge branch 'main' into minimal-header-dst2030
ataker Sep 15, 2023
fe59eeb
Merge branch 'main' into minimal-header-dst2030
ataker Sep 15, 2023
3dd9508
PR feedback updates
ataker Sep 15, 2023
06d1d4d
update ems to px, restore working import
ataker Sep 15, 2023
5ad88d2
Making va-crisis-line-modal a standalone component
Andrew565 Sep 22, 2023
fda448a
Removing extra assets
Andrew565 Sep 22, 2023
21e029c
Fix for non-loading SVG file
Andrew565 Sep 25, 2023
a8107f4
Merge branch 'main' into minimal-header-dst2030
Andrew565 Sep 25, 2023
3792ccd
Merge branch 'main' into minimal-header-dst2030
Andrew565 Sep 28, 2023
8870440
Various fixes and adding tests
Andrew565 Sep 28, 2023
4f0b3f9
Attempt to fix contacts
Andrew565 Sep 28, 2023
bcd2a3c
Actual fix to contacts type issue
Andrew565 Sep 28, 2023
7266a66
Merge branch 'main' into minimal-header-dst2030
Andrew565 Sep 28, 2023
2e7fb4e
Various fixes
Andrew565 Oct 3, 2023
2ad22e4
Fixes to focus outlines and tab order
Andrew565 Oct 4, 2023
eece851
Adding TTY prompt back in
Andrew565 Oct 5, 2023
48bc847
Update render e2e test
ataker Oct 10, 2023
c6de010
Revert "Update render e2e test"
ataker Oct 10, 2023
c119af9
update render e2e test
ataker Oct 10, 2023
07b4d17
remove unused assetsDirs
ataker Oct 10, 2023
f402c44
Merge branch 'main' into minimal-header-dst2030
ataker Oct 10, 2023
5a7d7da
version bump
ataker Oct 10, 2023
3ba4613
Merge branch 'main' into minimal-header-dst2030
ataker Oct 10, 2023
2076dff
Merge branch 'main' into minimal-header-dst2030
ataker Oct 10, 2023
876339c
Merge branch 'main' into minimal-header-dst2030
ataker Oct 13, 2023
255f050
Making design-related adjustments
Andrew565 Oct 18, 2023
56064c2
Merge branch 'main' into minimal-header-dst2030
Andrew565 Oct 19, 2023
61fa24b
Bringing crisis line modal button closer to prod
Andrew565 Oct 20, 2023
f6e2b97
Changing icon hover color
Andrew565 Oct 20, 2023
0e2437b
Merge branch 'main' into minimal-header-dst2030
Andrew565 Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions packages/storybook/stories/va-minimal-header.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react';
import { getWebComponentDocs, propStructure, StoryDocs, componentStructure } from './wc-helpers';

const minimalHeaderDocs = getWebComponentDocs('va-minimal-header');
const vaCrisisLineModal = getWebComponentDocs('va-crisis-line-modal');

export default {
title: 'Components/MinimalHeader',
id: 'components/va-minimal-header',
subcomponents: componentStructure(vaCrisisLineModal),
parameters: {
componentSubtitle: `va-minimal-header web component`,
docs: {
page: () => <StoryDocs data={minimalHeaderDocs} />,
},
},
};

const defaultArgs = {
header: "Authorization To Disclose Personal Information To A Third Party",
subheader: ""
};
const Template = ({ header, subheader }) => {
return (
<va-minimal-header
header={header}
subheader={subheader}
/>
);
};

export const Default = Template.bind(null);
Default.args = {
...defaultArgs,
};
Default.argTypes = propStructure(minimalHeaderDocs);

export const withSubheader = Template.bind(null);
withSubheader.args = {
...defaultArgs,
subheader: "(VA Form 21-0845)",
};
Binary file added packages/web-components/assets/VA-seal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/web-components/assets/VCL-icon-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/web-components/src/assets/VA-seal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/web-components/src/assets/VCL-icon-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/web-components/src/assets/arrow-right-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions packages/web-components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ export namespace Components {
*/
"uswds"?: boolean;
}
interface VaCrisisLineModal {
}
interface VaDate {
/**
* Whether or not an analytics event will be fired.
Expand Down Expand Up @@ -562,6 +564,10 @@ export namespace Components {
*/
"value"?: string;
}
interface VaMinimalHeader {
"header"?: string;
"subheader"?: string;
}
interface VaModal {
/**
* Additional DOM-nodes that should not be hidden from screen readers. Useful when an open modal shouldn't hide all content behind the overlay.
Expand Down Expand Up @@ -1439,6 +1445,12 @@ declare global {
prototype: HTMLVaCheckboxGroupElement;
new (): HTMLVaCheckboxGroupElement;
};
interface HTMLVaCrisisLineModalElement extends Components.VaCrisisLineModal, HTMLStencilElement {
}
var HTMLVaCrisisLineModalElement: {
prototype: HTMLVaCrisisLineModalElement;
new (): HTMLVaCrisisLineModalElement;
};
interface HTMLVaDateElement extends Components.VaDate, HTMLStencilElement {
}
var HTMLVaDateElement: {
Expand Down Expand Up @@ -1487,6 +1499,12 @@ declare global {
prototype: HTMLVaMemorableDateElement;
new (): HTMLVaMemorableDateElement;
};
interface HTMLVaMinimalHeaderElement extends Components.VaMinimalHeader, HTMLStencilElement {
}
var HTMLVaMinimalHeaderElement: {
prototype: HTMLVaMinimalHeaderElement;
new (): HTMLVaMinimalHeaderElement;
};
interface HTMLVaModalElement extends Components.VaModal, HTMLStencilElement {
}
var HTMLVaModalElement: {
Expand Down Expand Up @@ -1639,6 +1657,7 @@ declare global {
"va-card": HTMLVaCardElement;
"va-checkbox": HTMLVaCheckboxElement;
"va-checkbox-group": HTMLVaCheckboxGroupElement;
"va-crisis-line-modal": HTMLVaCrisisLineModalElement;
"va-date": HTMLVaDateElement;
"va-featured-content": HTMLVaFeaturedContentElement;
"va-file-input": HTMLVaFileInputElement;
Expand All @@ -1647,6 +1666,7 @@ declare global {
"va-loading-indicator": HTMLVaLoadingIndicatorElement;
"va-maintenance-banner": HTMLVaMaintenanceBannerElement;
"va-memorable-date": HTMLVaMemorableDateElement;
"va-minimal-header": HTMLVaMinimalHeaderElement;
"va-modal": HTMLVaModalElement;
"va-need-help": HTMLVaNeedHelpElement;
"va-notification": HTMLVaNotificationElement;
Expand Down Expand Up @@ -2067,6 +2087,8 @@ declare namespace LocalJSX {
*/
"uswds"?: boolean;
}
interface VaCrisisLineModal {
}
interface VaDate {
/**
* Whether or not an analytics event will be fired.
Expand Down Expand Up @@ -2341,6 +2363,10 @@ declare namespace LocalJSX {
*/
"value"?: string;
}
interface VaMinimalHeader {
"header"?: string;
"subheader"?: string;
}
interface VaModal {
/**
* Additional DOM-nodes that should not be hidden from screen readers. Useful when an open modal shouldn't hide all content behind the overlay.
Expand Down Expand Up @@ -3124,6 +3150,7 @@ declare namespace LocalJSX {
"va-card": VaCard;
"va-checkbox": VaCheckbox;
"va-checkbox-group": VaCheckboxGroup;
"va-crisis-line-modal": VaCrisisLineModal;
"va-date": VaDate;
"va-featured-content": VaFeaturedContent;
"va-file-input": VaFileInput;
Expand All @@ -3132,6 +3159,7 @@ declare namespace LocalJSX {
"va-loading-indicator": VaLoadingIndicator;
"va-maintenance-banner": VaMaintenanceBanner;
"va-memorable-date": VaMemorableDate;
"va-minimal-header": VaMinimalHeader;
"va-modal": VaModal;
"va-need-help": VaNeedHelp;
"va-notification": VaNotification;
Expand Down Expand Up @@ -3174,6 +3202,7 @@ declare module "@stencil/core" {
"va-card": LocalJSX.VaCard & JSXBase.HTMLAttributes<HTMLVaCardElement>;
"va-checkbox": LocalJSX.VaCheckbox & JSXBase.HTMLAttributes<HTMLVaCheckboxElement>;
"va-checkbox-group": LocalJSX.VaCheckboxGroup & JSXBase.HTMLAttributes<HTMLVaCheckboxGroupElement>;
"va-crisis-line-modal": LocalJSX.VaCrisisLineModal & JSXBase.HTMLAttributes<HTMLVaCrisisLineModalElement>;
"va-date": LocalJSX.VaDate & JSXBase.HTMLAttributes<HTMLVaDateElement>;
"va-featured-content": LocalJSX.VaFeaturedContent & JSXBase.HTMLAttributes<HTMLVaFeaturedContentElement>;
"va-file-input": LocalJSX.VaFileInput & JSXBase.HTMLAttributes<HTMLVaFileInputElement>;
Expand All @@ -3182,6 +3211,7 @@ declare module "@stencil/core" {
"va-loading-indicator": LocalJSX.VaLoadingIndicator & JSXBase.HTMLAttributes<HTMLVaLoadingIndicatorElement>;
"va-maintenance-banner": LocalJSX.VaMaintenanceBanner & JSXBase.HTMLAttributes<HTMLVaMaintenanceBannerElement>;
"va-memorable-date": LocalJSX.VaMemorableDate & JSXBase.HTMLAttributes<HTMLVaMemorableDateElement>;
"va-minimal-header": LocalJSX.VaMinimalHeader & JSXBase.HTMLAttributes<HTMLVaMinimalHeaderElement>;
"va-modal": LocalJSX.VaModal & JSXBase.HTMLAttributes<HTMLVaModalElement>;
"va-need-help": LocalJSX.VaNeedHelp & JSXBase.HTMLAttributes<HTMLVaNeedHelpElement>;
"va-notification": LocalJSX.VaNotification & JSXBase.HTMLAttributes<HTMLVaNotificationElement>;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { newE2EPage } from '@stencil/core/testing';

describe('va-minimal-header', () => {
it('renders', async () => {
const page = await newE2EPage();
await page.setContent('<va-minimal-header></va-minimal-header>');

const element = await page.find('va-minimal-header');
expect(element).toHaveClass('hydrated');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { newSpecPage } from '@stencil/core/testing';
import { VaMinimalHeader } from '../va-minimal-header';

describe('va-minimal-header', () => {
it('renders', async () => {
const page = await newSpecPage({
components: [VaMinimalHeader],
html: `<va-minimal-header header='Header'></va-minimal-header>`,
});
expect(page.root).toEqualHtml(`
<va-minimal-header header='Header'>
<mock:shadow-root>
<va-official-gov-banner></va-official-gov-banner>
<va-crisis-line-modal></va-crisis-line-modal>
<div class="va-flex">
<a href="/">
<div class="va-logo"></div>
</a>
<div class="header-container">
<h1>Header</h1>
</div>
</div>
</mock:shadow-root>
</va-minimal-header>
`);
});

it('renders with a subheader', async () => {
const page = await newSpecPage({
components: [VaMinimalHeader],
html: `<va-minimal-header header='Header' subheader='Subheader'></va-minimal-header>`,
});
expect(page.root).toEqualHtml(`
<va-minimal-header header='Header' subheader='Subheader'>
<mock:shadow-root>
<va-official-gov-banner></va-official-gov-banner>
<va-crisis-line-modal></va-crisis-line-modal>
<div class="va-flex">
<a href="/">
<div class="va-logo"></div>
</a>
<div class="header-container">
<h1>Header</h1>
<h2>Subheader</h2>
</div>
</div>
</mock:shadow-root>
</va-minimal-header>
`);
});
});
Loading