generated from nl-design-system/example
-
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.
- Loading branch information
Showing
11 changed files
with
196 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Page Header |
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 @@ | ||
/** | ||
* @license EUPL-1.2 | ||
* Copyright (c) 2021 Robbert Broersma | ||
*/ | ||
|
||
export const PageHeader = ({ innerHTML = '' }) => `<header class="utrecht-page-header">${innerHTML}</header>`; |
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 @@ | ||
/** | ||
* @license EUPL-1.2 | ||
* Copyright (c) 2021 Gemeente Utrecht | ||
* Copyright (c) 2021 Robbert Broersma | ||
*/ | ||
|
||
.utrecht-page-header { | ||
background-color: var(--utrecht-page-header-background-color); | ||
color: var(--utrecht-page-header-color); | ||
grid-area: "utrecht-header"; | ||
padding-block-end: var(--utrecht-page-header-padding-block-end); | ||
padding-block-start: var(--utrecht-page-header-padding-block-start); | ||
padding-inline-end: var(--utrecht-page-padding-inline-end); | ||
padding-inline-start: var(--utrecht-page-padding-inline-start); | ||
} | ||
|
||
.utrecht-page-header__content { | ||
max-inline-size: var(--utrecht-page-max-inline-size); | ||
} |
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 @@ | ||
<!-- | ||
@license EUPL-1.2 | ||
Copyright (c) 2021 Robbert Broersma | ||
--> | ||
|
||
import { ArgsTable, Canvas, Meta, Story } from "@storybook/addon-docs"; | ||
import { PageHeader } from "./bem"; | ||
import "./bem.scss"; | ||
|
||
<Meta | ||
title="CSS Component/Page Header" | ||
argTypes={{ | ||
innerHTML: { | ||
description: "HTML content", | ||
control: "text", | ||
}, | ||
}} | ||
parameters={{ | ||
docs: { | ||
transformSource: (_src, { args }) => PageHeader(args), | ||
}, | ||
status: "WORK IN PROGRESS", | ||
}} | ||
/> | ||
|
||
# Page Header | ||
|
||
<Canvas> | ||
<Story | ||
name="Page Header" | ||
args={{ | ||
innerHTML: "Header content", | ||
}} | ||
> | ||
{PageHeader.bind({})} | ||
</Story> | ||
</Canvas> | ||
|
||
<ArgsTable story="Page Header" /> |
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,30 @@ | ||
{ | ||
"utrecht": { | ||
"page-header": { | ||
"background-color": { | ||
"css": { | ||
"syntax": "<color>", | ||
"inherits": true | ||
} | ||
}, | ||
"color": { | ||
"css": { | ||
"syntax": "<color>", | ||
"inherits": true | ||
} | ||
}, | ||
"padding-start": { | ||
"css": { | ||
"syntax": "<length>", | ||
"inherits": true | ||
} | ||
}, | ||
"padding-block-end": { | ||
"css": { | ||
"syntax": "<length>", | ||
"inherits": true | ||
} | ||
} | ||
} | ||
} | ||
} |
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,12 @@ | ||
import { Description, Meta } from "@storybook/addon-docs"; | ||
import { ComponentTokensTable } from "../../documentation/components/ComponentTokensTable"; | ||
import tokens from "../../proprietary/design-tokens/dist/index.json"; | ||
import document from "./README.md"; | ||
|
||
<Meta title="CSS Component/Page Header/README" /> | ||
|
||
<Description>{document}</Description> | ||
|
||
## Design Tokens | ||
|
||
<ComponentTokensTable tokens={tokens} component="utrecht-page-header"></ComponentTokensTable> |
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,14 @@ | ||
/** | ||
* @license EUPL-1.2 | ||
* Copyright (c) 2021 Robbert Broersma | ||
*/ | ||
|
||
@import "./bem"; | ||
|
||
:host { | ||
display: block; | ||
} | ||
|
||
:host([hidden]) { | ||
display: none !important; | ||
} |
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 @@ | ||
<!-- | ||
@license EUPL-1.2 | ||
Copyright (c) 2021 Robbert Broersma | ||
--> | ||
|
||
import { ArgsTable, Canvas, Meta, Story } from "@storybook/addon-docs"; | ||
export const Template = ({ innerHTML = "" }) => `<utrecht-page-header>${innerHTML}</utrecht-page-header>`; | ||
|
||
<Meta | ||
title="Web Component/Page Header" | ||
argTypes={{ | ||
innerHTML: { | ||
description: "HTML content", | ||
control: "text", | ||
}, | ||
}} | ||
parameters={{ | ||
docs: { | ||
transformSource: (_src, { args }) => Template(args), | ||
}, | ||
status: { | ||
type: "WORK IN PROGRESS", | ||
}, | ||
}} | ||
/> | ||
|
||
# Page Header | ||
|
||
<Canvas> | ||
<Story | ||
name="Page Header" | ||
args={{ | ||
innerHTML: "Header content", | ||
}} | ||
> | ||
{Template.bind({})} | ||
</Story> | ||
</Canvas> | ||
|
||
<ArgsTable story="Page Header" /> |
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 { Component, h } from "@stencil/core"; | ||
|
||
/** | ||
* @license EUPL-1.2 | ||
* Copyright (c) 2021 Gemeente Utrecht | ||
*/ | ||
|
||
@Component({ | ||
tag: "utrecht-page-header", | ||
styleUrl: "stencil.scss", | ||
shadow: true, | ||
}) | ||
export class PageHeader { | ||
render() { | ||
return ( | ||
<header class="utrecht-page-header"> | ||
<div class="utrecht-page-header__content"> | ||
<slot></slot> | ||
</div> | ||
</header> | ||
); | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
proprietary/design-tokens/src/component/utrecht/page-header/block.tokens.json
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,10 @@ | ||
{ | ||
"utrecht": { | ||
"page-header": { | ||
"padding-inline-end": { "value": "2.4em" }, | ||
"padding-inline-start": { "value": "2em" }, | ||
"padding-block-end": { "value": "1em" }, | ||
"padding-block-start": { "value": "1.8em" } | ||
} | ||
} | ||
} |