-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new header and footer components
BREAKING CHANGE: consumer html for `.iati-header` and `.iati-footer` components must be updated BREAKING CHANGE: `.iati-title-bar` component has been removed
- Loading branch information
1 parent
96f41d4
commit 3dd37ec
Showing
49 changed files
with
1,386 additions
and
214 deletions.
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
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@use "../tokens/color" as *; | ||
|
||
:is(a, button, input, select, textarea, summary):focus-visible { | ||
outline: 2px solid $color-blue-60; | ||
outline-offset: 2px; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@forward "normalize"; | ||
@forward "reset"; | ||
@forward "mixins"; | ||
@forward "focus"; |
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
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
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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
@forward "button/button"; | ||
@forward "breadcrumb/breadcrumb"; | ||
@forward "brand-background/brand-background"; | ||
@forward "callout/callout"; | ||
@forward "card/card"; | ||
@forward "country-switcher/country-switcher"; | ||
@forward "piped-list/piped-list"; | ||
@forward "header-button/header-button"; | ||
@forward "icon/icon"; | ||
@forward "search-bar/search-bar"; | ||
@forward "table/table"; | ||
@forward "tool-nav/tool-nav"; | ||
@forward "menu-toggle/menu-toggle"; | ||
@forward "message/message"; | ||
@forward "mobile-nav/mobile-nav"; | ||
@forward "newsletter-form/newsletter-form"; | ||
@forward "title-bar/title-bar"; | ||
@forward "footer-block/footer-block"; |
22 changes: 22 additions & 0 deletions
22
src/scss/components/brand-background/_brand-background.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,22 @@ | ||
@use "../../tokens/color" as *; | ||
@use "../../tokens/screens" as *; | ||
|
||
.iati-brand-background { | ||
background-color: $color-teal-90; | ||
display: grid; | ||
@media (min-width: $screen-md) { | ||
&:after { | ||
content: ""; | ||
grid-area: 1/-1; | ||
background-image: url("/images/marque-white.svg"); | ||
background-repeat: no-repeat; | ||
background-position: right 2rem top; | ||
background-size: 32.3rem auto; | ||
opacity: 0.1; | ||
} | ||
.iati-brand-background__content { | ||
grid-area: 1/-1; | ||
z-index: 1; | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/scss/components/brand-background/brand-background.stories.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,19 @@ | ||
import type { Meta, StoryObj } from "@storybook/web-components"; | ||
|
||
import { html } from "lit"; | ||
|
||
const meta: Meta = { | ||
title: "Components/Brand Background", | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj; | ||
|
||
export const Default: Story = { | ||
render: () => | ||
html`<div class="iati-brand-background"> | ||
<div class="iati-brand-background__content"> | ||
<p>Some words</p> | ||
</div> | ||
</div>`, | ||
}; |
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,54 @@ | ||
@use "../../tokens/color" as *; | ||
@use "../../tokens/spacing" as *; | ||
@use "../../tokens/screens" as *; | ||
|
||
.iati-breadcrumb { | ||
font-weight: 600; | ||
} | ||
|
||
.iati-breadcrumb__list { | ||
list-style-type: none; | ||
padding: 0; | ||
margin: 0; | ||
display: flex; | ||
display: none; | ||
> *:not(:last-child)::after { | ||
content: "/"; | ||
color: $color-teal-90; | ||
font-weight: 600; | ||
display: inline-block; | ||
padding-inline: 0.4em; | ||
} | ||
} | ||
|
||
.iati-breadcrumb-item { | ||
line-height: 1; | ||
} | ||
|
||
.iati-breadcrumb__previous { | ||
display: flex; | ||
align-items: flex-end; | ||
&::before { | ||
content: ""; | ||
display: inline-block; | ||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor' class='size-5'%3E%3Cpath fill-rule='evenodd' d='M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z' clip-rule='evenodd' /%3E%3C/svg%3E%0A"); | ||
background-size: contain; | ||
background-position: center; | ||
height: 1.2em; | ||
width: 1.2em; | ||
} | ||
} | ||
|
||
.iati-breadcrumb-link { | ||
text-decoration: none; | ||
line-height: 1; | ||
} | ||
|
||
@media (min-width: $screen-sm) { | ||
.iati-breadcrumb__previous { | ||
display: none; | ||
} | ||
.iati-breadcrumb__list { | ||
display: flex; | ||
} | ||
} |
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,39 @@ | ||
import { html } from "lit"; | ||
import { classMap } from "lit-html/directives/class-map.js"; | ||
|
||
import type { Meta, StoryObj } from "@storybook/web-components"; | ||
|
||
const items = ["Home", "About", "Current page"]; | ||
|
||
const meta: Meta = { | ||
title: "Components/Breadcrumb", | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj; | ||
|
||
export const Breadcrumb: Story = { | ||
render: () => html` | ||
<nav class="iati-breadcrumb"> | ||
<p class="iati-breadcrumb__previous"> | ||
<a href="#" class="iati-breadcrumb-link">${items[items.length - 2]}</a> | ||
</p> | ||
<ol class="iati-breadcrumb__list""> | ||
${items.map( | ||
(i) => | ||
html`<li | ||
class="iati-breadcrumb-item ${classMap({ | ||
"iati-breadcrumb-item--current": i == "Current page", | ||
})}" | ||
> | ||
${i != "Current page" | ||
? html`<a href="#" class="iati-breadcrumb-link">${i}</a>` | ||
: html`<a aria-current="page" class="iati-breadcrumb-link" | ||
>${i}</a | ||
>`} | ||
</li>`, | ||
)} | ||
</ol> | ||
</nav> | ||
`, | ||
}; |
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
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
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
40 changes: 40 additions & 0 deletions
40
src/scss/components/country-switcher/_country-switcher.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,40 @@ | ||
@use "../../tokens/color" as *; | ||
@use "../../tokens/font" as *; | ||
@use "../../base/mixins"; | ||
|
||
.iati-country-switcher { | ||
background-color: #fff; | ||
position: relative; | ||
display: inline-block; | ||
color: #121212; | ||
cursor: pointer; | ||
.iati-country-switcher__label { | ||
@include mixins.sr-only; | ||
} | ||
.iati-country-switcher__control { | ||
padding: 0.7em 2.1em 0.7em calc(1em + 1rem); | ||
font-family: $font-stack-heading; | ||
line-height: 1.1; | ||
width: 100%; | ||
height: 100%; | ||
appearance: none; | ||
background-color: #fff; | ||
border: none; | ||
font-family: $font-stack-heading; | ||
color: $color-grey-90; | ||
font-weight: 600; | ||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none'%3E%3Cpath stroke='%23121212' stroke-linecap='square' stroke-width='1.3' d='M10 19c4.9706 0 9-4.0294 9-9 0-4.97056-4.0294-9-9-9-4.97056 0-9 4.02944-9 9 0 4.9706 4.02944 9 9 9Z'/%3E%3Cpath stroke='%23121212' stroke-linecap='round' stroke-linejoin='bevel' stroke-width='1.3' d='M9.99984 18.991C12.3938 16.8114 13.5908 13.8144 13.5908 10c0-3.81433-1.197-6.81133-3.59096-8.99097-2.394 2.17964-3.591 5.17664-3.591 8.99097 0 3.8144 1.197 6.8114 3.591 8.991Z'/%3E%3Cpath stroke='%23121212' stroke-linecap='round' stroke-width='1.3' d='M1.44991 7.29993H18.5499M1.44991 12.6999H18.5499'/%3E%3C/svg%3E"); | ||
background-repeat: no-repeat; | ||
background-position: 0.5em center; | ||
} | ||
&::after { | ||
position: absolute; | ||
right: 0.7em; | ||
top: calc(50% - 0.1875em); | ||
content: ""; | ||
width: 0.75em; | ||
height: 0.375em; | ||
background-color: currentColor; | ||
clip-path: polygon(15% 0, 0 0, 50% 100%, 100% 0, 85% 0, 50% 70%); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/scss/components/country-switcher/country-switcher.stories.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,28 @@ | ||
import type { Meta, StoryObj } from "@storybook/web-components"; | ||
import { html } from "lit"; | ||
|
||
const meta: Meta = { | ||
title: "Components/Country Switcher", | ||
parameters: { | ||
backgrounds: { | ||
default: "dark", | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj; | ||
|
||
export const CountrySwitcher: Story = { | ||
render: () => html` | ||
<div class="iati-country-switcher"> | ||
<label for="iati-country-switcher" class="iati-country-switcher__label" | ||
>Choose your language</label | ||
> | ||
<select id="iati-country-switcher" class="iati-country-switcher__control"> | ||
<option>English</option> | ||
<option>French</option> | ||
</select> | ||
</div> | ||
`, | ||
}; |
Oops, something went wrong.