Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

feat(page-header-standardised): Add component - TWIG-94 #206

Merged
merged 16 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ storiesOf('Components/Navigation/Breadcrumbs/Breadcrumb Standardised', module)
breadcrumb({
links: dataSimple.links,
icon_file_path: defaultSprite,
navigation_text: dataSimple.label,
navigation_text: dataSimple.navigation_text,
ellipsis_label: 'Click to expand',
}),
{
Expand All @@ -30,7 +30,7 @@ storiesOf('Components/Navigation/Breadcrumbs/Breadcrumb Standardised', module)
breadcrumb({
links: dataLong.links,
icon_file_path: defaultSprite,
navigation_text: dataLong.label,
navigation_text: dataLong.navigation_text,
ellipsis_label: 'Click to expand',
}),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('EC - Breadcrumb Standardised', () => {
const data = {
links: dataSimple.links,
icon_file_path: defaultIconPath,
navigation_text: dataSimple.label,
navigation_text: dataSimple.navigation_text,
ellipsis_label: 'Click to expand',
};

Expand Down Expand Up @@ -52,7 +52,7 @@ describe('EC - Breadcrumb Standardised', () => {
],
links: dataLong.links,
icon_file_path: defaultIconPath,
navigation_text: dataLong.label,
navigation_text: dataLong.navigation_text,
ellipsis_label: 'Click to expand',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const adapter = initialData => {
// Copy reference specification demo data.
const adaptedData = JSON.parse(JSON.stringify(initialData));
adaptedData.links = adaptedData.items.map(formatLinkAlt);
adaptedData.navigation_text = adaptedData.label;
delete adaptedData.label;
delete adaptedData.items;
return adaptedData;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__snapshots__
demo
*.story.js
*.test.js
41 changes: 41 additions & 0 deletions src/ec/packages/ec-component-page-header-standardised/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# ECL Twig - EC Page Header Standardised component

npm package: `@ecl-twig/ec-component-page-header-standardised`

```shell
npm install --save @ecl-twig/ec-component-page-header-standardised
```

## Page Header Standardised

### Parameters

- "title" (string) (default: '') Title of header
- "description" (string) (default: '') Description of header
- "meta" (string) (default: '') Meta of header
- "breadcrumb" (associative array) (default: '') Predefined structure compatible with EC Breadcrumb
- "extra_classes" (string) (default: '')
- "extra_attributes" (array) (default: []): format:
- "name" (string) (default: '')
- "value" (string) (default: '')

### Example :

<!-- prettier-ignore -->
```twig
{% include '@ecl-twig/ec-component-page-header-standardised/page-header-standardised.html.twig' with {
title: 'Page title',
description: 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium',
meta: 'News article | 17 October 2015',
breadcrumb: {
links: [
{
label: 'Link 1',
path: '/example'
},
],
icon_file_path: '/path-to-the-icons-file',
navigation_text: 'You are here:',
}
} %}
```
Loading