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.
feat: implement EC component message - INNO-1347 (#47)
# PR description Add component Message (EC only)
- Loading branch information
Showing
10 changed files
with
886 additions
and
113 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# ECL Twig - EC Message component | ||
|
||
npm package: `@ecl-twig/ec-component-message` | ||
|
||
```shell | ||
npm install --save @ecl-twig/ec-component-message | ||
``` | ||
|
||
## Message | ||
|
||
### Parameters: | ||
|
||
- **"variant"** (string) (default: ''): could be 'info, 'success', 'warning' or 'error' | ||
- **"icon"** (object of type "icon") (default: {}) | ||
- **"title"** (string) (default: '') | ||
- **"close"** (object of type "button") (default: {}): close button | ||
- **"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' | ||
|
||
### Blocks: | ||
|
||
- **"description"**: content of the message | ||
|
||
### Example: | ||
|
||
<!-- prettier-ignore --> | ||
```twig | ||
{% include 'path/to/message.html.twig' with { | ||
variant: 'info', | ||
icon: { | ||
path: 'path/to/icons.svg', | ||
type: 'notifications', | ||
name: 'info', | ||
size: 'l', | ||
}, | ||
title: 'Information message', | ||
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', | ||
close: { | ||
label: 'Close', | ||
icon: { | ||
path: 'path/to/icons.svg', | ||
type: 'ui', | ||
name: 'close', | ||
size: 's', | ||
}, | ||
}, | ||
extra_classes: 'my-extra-class-1 my-extra-class-2', | ||
extra_attributes: [ | ||
{ name: 'data-test-1', value: 'data-test-value-1' }, | ||
{ name: 'data-test-2', value: 'data-test-value-2' } | ||
] | ||
} %} | ||
``` |
Oops, something went wrong.