This repository has been archived by the owner on May 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init component * update component * add snap * small fixes * update snap
- Loading branch information
1 parent
c3242c4
commit 5752dc6
Showing
12 changed files
with
2,336 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,5 @@ | ||
__snapshots__ | ||
demo | ||
*.story.js | ||
*.test.js | ||
**/*.md |
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,116 @@ | ||
# ECL Twig - EC Gallery | ||
|
||
npm package: `@ecl-twig/ec-component-gallery` | ||
|
||
```shell | ||
npm install --save @ecl-twig/ec-component-gallery | ||
``` | ||
|
||
## Gallery | ||
|
||
### Parameters | ||
|
||
- **"overlay"** (object) (default: {}) | ||
- **"close"** (object) (default: {}): object of type button | ||
- **"previous"** (object) (default: {}): object of type button | ||
- **"next"** (object) (default: {}): object of type button | ||
- **"counter_separator"** (string) (default: '') | ||
- **"download"** (object) (default: {}): object of type link | ||
- **"share"** (object) (default: {}): object of type link | ||
- **"items"** (array) (default: []) | ||
- **"path"** (string) (default: '') | ||
- **"alt"** (string) (default: '') | ||
- **"description"** (string) (default: '') | ||
- **"meta"** (string) (default: '') | ||
- **"icon"** (object) (default: {}): object of type icon | ||
- **"share_path"** (string) (default: '') | ||
- **"selected_item_id"** (int) (default: 0) | ||
- **"extra_classes"** (optional) (string) (default: '') | ||
- **"extra_attributes"** (optional) (array) (default: []) | ||
- **"name"** (string) Attribute name, eg. 'data-test' | ||
- **"value"** (string) Attribute value, eg: 'data-test-1' | ||
|
||
### Example : | ||
|
||
<!-- prettier-ignore --> | ||
```twig | ||
{% include 'path/to/gallery.html.twig' with { | ||
items: [ | ||
{ | ||
path: 'path/to/image.jpg', | ||
alt: 'Image 1', | ||
description: | ||
'The EU in brief, institutions and bodies, countries, symbols, history, facts and figures', | ||
meta: 'Copyright, Author, Licence for image 1', | ||
share_href: '/share#example-image.jpg', | ||
}, | ||
{ | ||
path: 'path/to/image2.jpg', | ||
alt: 'Image 2', | ||
description: 'Living, working, travelling in the EU', | ||
meta: 'Copyright, Author, Licence for image 2', | ||
icon: { | ||
path: 'path/to/icons.svg', | ||
type: 'general', | ||
name: 'audio', | ||
}, | ||
share_href: '/share#example-image2.jpg', | ||
}, | ||
... | ||
], | ||
overlay: { | ||
close: { | ||
variant: 'ghost', | ||
label: 'Close', | ||
icon: { | ||
path: 'path/to/icons.svg', | ||
type: 'ui', | ||
name: 'close', | ||
size: 's', | ||
}, | ||
}, | ||
previous: { | ||
variant: 'ghost', | ||
label: 'Previous', | ||
icon: { | ||
path: 'path/to/icons.svg', | ||
type: 'ui', | ||
name: 'corner-arrow', | ||
transform: 'rotate-270', | ||
size: 'l', | ||
}, | ||
icon_position: 'before', | ||
}, | ||
next: { | ||
variant: 'ghost', | ||
label: 'Next', | ||
icon: { | ||
path: 'path/to/icons.svg', | ||
type: 'ui', | ||
name: 'corner-arrow', | ||
transform: 'rotate-90', | ||
size: 'l', | ||
}, | ||
}, | ||
counter_separator: 'of', | ||
download: { | ||
label: 'Download', | ||
icon: { | ||
path: 'path/to/icons.svg', | ||
type: 'ui', | ||
name: 'download', | ||
size: 'fluid', | ||
}, | ||
}, | ||
share: { | ||
label: 'Share', | ||
icon: { | ||
path: 'path/to/icons.svg', | ||
type: 'general', | ||
name: 'share', | ||
size: 'fluid', | ||
}, | ||
}, | ||
}, | ||
} %} | ||
``` |
Oops, something went wrong.