Skip to content

Commit

Permalink
feat: page footer component
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed Jul 11, 2021
1 parent 9c39292 commit 32d921e
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/page-footer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Page Footer
32 changes: 32 additions & 0 deletions components/page-footer/bem.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @license EUPL-1.2
* Copyright (c) 2021 Gemeente Utrecht
* Copyright (c) 2021 Robbert Broersma
*/

.utrecht-page-footer {
font-family: var(--utrecht-document-font-family);
font-size: var(--utrecht-document-font-size);
background-color: var(--utrecht-page-footer-background-color);
background-image: var(--utrecht-page-footer-background-image);
color: var(--utrecht-page-footer-color);
padding-block-start: var(--utrecht-page-footer-padding-block-start);
padding-inline-end: var(--utrecht-page-footer-padding-inline-end);
padding-block-end: var(--utrecht-page-footer-padding-block-end);
padding-inline-start: var(--utrecht-page-footer-padding-inline-start);

--utrecht-document-color: currentColor;
--utrecht-heading-color: currentColor;
--utrecht-link-color: currentColor;
--utrecht-link-focus-color: currentColor;
--utrecht-link-hover-color: currentColor;
--utrecht-link-active-color: currentColor;
--utrecht-link-visited-color: currentColor;
}

.utrecht-page-footer__address--reset-address {
/* reset <address> */
font-style: inherit;
margin-block-start: 0;
margin-block-end: 0;
}
71 changes: 71 additions & 0 deletions components/page-footer/bem.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!--
@license EUPL-1.2
Copyright (c) 2021 Robbert Broersma
-->

import { Description, Meta, Story, Canvas, ArgsTable } from "@storybook/addon-docs/blocks";

import "./bem.css";

import README from "./README.md";

export const Template = ({ innerHTML }) => `<footer class="utrecht-page-footer">
${innerHTML}</header>`;

<Meta
title="Components/Page Footer"
argTypes={{
innerHTML: {
description: "HTML content",
control: "text",
defaultValue: "",
},
}}
parameters={{
docs: {
transformSource: (_src, { args }) => Template(args),
},
status: "WORK IN PROGRESS",
}}
/>

<Description>{README}</Description>

<Canvas>
<Story
name="Page Footer"
args={{
innerHTML: `<address class="utrecht-page-footer__address utrecht-page-footer__address--reset-address">
<h2 class="utrecht-heading-2 utrecht-heading-2--reset-h2">Gemeente Utrecht</h2>
<section>
<h3 class="utrecht-heading-3 utrecht-heading-3--distanced">Telefoon</h3>
<p class="utrecht-paragraph utrecht-paragraph--distanced">
<a href="tel:+31302860000" class="utrecht-link utrecht-link--telephone">14 030</a>
</p>
</section>
<section>
<h3 class="utrecht-heading-3 utrecht-heading-3--distanced">Adres</h3>
<p class="utrecht-paragraph utrecht-paragraph--distanced">
<strong>Stadskantoor</strong><br>
Stadsplateau 1<br>
3521AZ
</p>
</section>
</address>
<div class="utrecht-page-footer__navigation">
<ul class="utrecht-link-list utrecht-link-list--chevron">
<li class="utrecht-link-list__listitem">
<a href="/contact/" class="utrecht-link">Meer contactinformatie</a>
</li>
<li class="utrecht-link-list__listitem">
<a href="/over-deze-website" class="utrecht-link">Over deze website</a>
</li>
</ul>
</div>`,
}}
>
{Template.bind({})}
</Story>
</Canvas>

<ArgsTable story="Page Footer" />
13 changes: 13 additions & 0 deletions components/page-footer/block.style-dictionary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"utrecht": {
"page-footer": {
"color": {},
"background-color": {},
"background-image": {},
"padding-inline-end": {},
"padding-inline-start": {},
"padding-block-end": {},
"padding-block-start": {}
}
}
}
43 changes: 43 additions & 0 deletions components/page-footer/stencil.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!--
@license EUPL-1.2
Copyright (c) 2021 Robbert Broersma
-->

import { ArgsTable, Meta, Story, Canvas } from "@storybook/addon-docs";

<!-- Import Docs -->

import README from "./README.md";

export const Template = ({ content }) => `<utrecht-page-footer>${content}</utrecht-page-footer>`;

<Meta
title="Web Component/Page Footer"
argTypes={{}}
parameters={{
docs: {
transformSource: (_src, { args }) => Template(args),
},
status: {
type: "WORK IN PROGRESS",
},
notes: {
UX: README,
},
}}
/>

# Separator

<Canvas>
<Story
name="Page Footer"
args={{
content: "",
}}
>
{Template.bind({})}
</Story>
</Canvas>

<ArgsTable story="Page Footer" />
21 changes: 21 additions & 0 deletions components/page-footer/stencil.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Component, h } from "@stencil/core";

/**
* @license EUPL-1.2
* Copyright (c) 2021 Gemeente Utrecht
*/

@Component({
tag: "utrecht-page-footer",
styleUrl: "bem.css",
shadow: true,
})
export class PageFooter {
render() {
return (
<footer class="utrecht-page-footer">
<slot></slot>
</footer>
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.utrecht-page-footer {
--utrecht-heading-2-font-size: 1em;
--utrecht-heading-2-text-transform: uppercase;
--utrecht-heading-3-font-size: 1.125em;
--utrecht-heading-3-font-weight: normal;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"utrecht": {
"page-footer": {
"color": { "value": "{utrecht.color.white.value}" },
"background-color": { "value": "{utrecht.color.red.40.value}" },
"background-image": {
"value": "linear-gradient(45deg, {utrecht.color.red.40.value}, {utrecht.color.red.40.value} 50%, hsl(5 54% 59%) 50%);"
},
"padding-inline-end": { "value": "1em" },
"padding-inline-start": { "value": "1em" },
"padding-block-end": { "value": "1.8em" },
"padding-block-start": { "value": "1.8em" }
}
}
}
1 change: 1 addition & 0 deletions proprietary/design-tokens/src/custom.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@import "./component/utrecht/page-footer/custom";
@import "./responsive";

0 comments on commit 32d921e

Please sign in to comment.