-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Va-minimal-footer: add component (#937)
* add va-minimal-footer * use svg * add alt attr to img * update tests * update alt/title attrs and tests * update story * add empty destructuring * restore index.html * restore index.html * remove .pngs not needed * update styles * keep padding consistent across screen sizes
- Loading branch information
1 parent
e0083d1
commit 03d3fdd
Showing
8 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import { getWebComponentDocs, propStructure, StoryDocs } from './wc-helpers'; | ||
|
||
const minimalFooterDocs = getWebComponentDocs('va-minimal-footer'); | ||
|
||
export default { | ||
title: 'Components/Minimal Footer', | ||
id: 'components/va-minimal-footer', | ||
parameters: { | ||
componentSubtitle: `va-minimal-footer web component`, | ||
docs: { | ||
page: () => <StoryDocs data={minimalFooterDocs} />, | ||
}, | ||
}, | ||
}; | ||
|
||
|
||
const Template = ({}) => { | ||
return ( | ||
<va-minimal-footer /> | ||
); | ||
}; | ||
|
||
export const Default = Template.bind(null); | ||
Default.argTypes = propStructure(minimalFooterDocs); |
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
11 changes: 11 additions & 0 deletions
11
packages/web-components/src/components/va-minimal-footer/test/va-minimal-footer.e2e.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
describe('va-minimal-footer', () => { | ||
it('renders', async () => { | ||
const page = await newE2EPage(); | ||
await page.setContent('<va-minimal-footer></va-minimal-footer>'); | ||
|
||
const element = await page.find('va-minimal-footer'); | ||
expect(element).toHaveClass('hydrated'); | ||
}); | ||
}); |
23 changes: 23 additions & 0 deletions
23
packages/web-components/src/components/va-minimal-footer/test/va-minimal-footer.spec.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { newSpecPage } from '@stencil/core/testing'; | ||
import { VAMinimalFooter } from '../va-minimal-footer'; | ||
|
||
describe('va-minimal-footer', () => { | ||
it('renders', async () => { | ||
const page = await newSpecPage({ | ||
components: [VAMinimalFooter], | ||
html: `<va-minimal-footer />`, | ||
}); | ||
expect(page.root).toEqualHtml(` | ||
<va-minimal-footer> | ||
<mock:shadow-root> | ||
<div class="va-footer"> | ||
<a href="/" title="Go to VA.gov"> | ||
<img alt="VA logo and Seal, U.S. Department of Veterans Affairs" class="va-logo" src="[object Object]"> | ||
</a> | ||
</div> | ||
</mock:shadow-root> | ||
</va-minimal-footer> | ||
`); | ||
}); | ||
|
||
}); |
15 changes: 15 additions & 0 deletions
15
packages/web-components/src/components/va-minimal-footer/va-minimal-footer.scss
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
:host { | ||
display: flex; | ||
justify-content: center; | ||
background-color: var(--color-primary-darkest); | ||
} | ||
|
||
.va-footer { | ||
box-sizing: border-box; | ||
width: 1000px; | ||
padding: 32px 8px; | ||
|
||
img.va-logo { | ||
width: 200px; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/web-components/src/components/va-minimal-footer/va-minimal-footer.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Component, Host, h } from '@stencil/core'; | ||
import vaSeal from '../../assets/va-logo-white.svg'; | ||
|
||
/** | ||
* @componentName Minimal Footer | ||
* @maturityCategory caution | ||
* @maturityLevel candidate | ||
*/ | ||
|
||
@Component({ | ||
tag: 'va-minimal-footer', | ||
styleUrl: 'va-minimal-footer.scss', | ||
shadow: true, | ||
}) | ||
export class VAMinimalFooter { | ||
|
||
render() { | ||
|
||
return ( | ||
<Host> | ||
<div class="va-footer"> | ||
<a href="/" title="Go to VA.gov" > | ||
<img class="va-logo" src={vaSeal} alt="VA logo and Seal, U.S. Department of Veterans Affairs"/> | ||
</a> | ||
</div> | ||
</Host> | ||
); | ||
} | ||
} |