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

Commit

Permalink
feat: implement EC component message - INNO-1347 (#47)
Browse files Browse the repository at this point in the history
# PR description

Add component Message (EC only)
  • Loading branch information
emeryro authored and yhuard committed Mar 22, 2019
1 parent 7666db4 commit db8f489
Show file tree
Hide file tree
Showing 10 changed files with 886 additions and 113 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@ecl-twig/storybook-addon-code": "file:utils/storybook-addon-code",
"@ecl-twig/storybook-addon-notes": "file:utils/storybook-addon-notes",
"@ecl-twig/test-utils": "file:utils/test-utils",
"@storybook/addon-knobs": "5.0.1",
"@storybook/addon-options": "5.0.1",
"@storybook/addon-viewport": "5.0.1",
"@storybook/html": "5.0.1",
"@storybook/addon-knobs": "5.0.3",
"@storybook/addon-options": "5.0.3",
"@storybook/addon-viewport": "5.0.3",
"@storybook/html": "5.0.3",
"babel-jest": "24.3.1",
"babel-loader": "8.0.5",
"clipboard": "2.0.4",
Expand Down
55 changes: 55 additions & 0 deletions src/ec/packages/ec-component-message/README.md
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' }
]
} %}
```
Loading

0 comments on commit db8f489

Please sign in to comment.