forked from web-padawan/aybolit
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cxl-ui): cxl-inline-notification add component
- Loading branch information
Showing
3 changed files
with
93 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,27 @@ | ||
// stylelint-disable order/properties-order | ||
:host { | ||
background-color: var(--lumo-contrast-5pct); | ||
display: flex; | ||
padding: var(--lumo-space-s) var(--lumo-space-l); | ||
|
||
.wrap { | ||
display: flex; | ||
flex-grow: 1; | ||
margin: 0 auto; | ||
max-width: var(--cxl-content-max-width-wide); | ||
} | ||
|
||
#content { | ||
flex-grow: 1; | ||
} | ||
|
||
vaadin-button { | ||
background-color: inherit; | ||
color: var(--cxl-brand-color-black); | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
:host([hidden]) { | ||
display: none; | ||
} |
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,29 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import '@conversionxl/cxl-lumo-styles'; | ||
import { LitElement, html } from 'lit'; | ||
import { customElement } from 'lit/decorators.js'; | ||
import cxlInlineNotificationStyles from '../styles/cxl-inline-notification-css.js'; | ||
|
||
@customElement('cxl-inline-notification') | ||
export class CXLInlineNotification extends LitElement { | ||
static get styles() { | ||
return [cxlInlineNotificationStyles]; | ||
} | ||
|
||
hide() { | ||
this.hidden = true; | ||
} | ||
|
||
render() { | ||
return html` | ||
<div class="wrap"> | ||
<div id="content"> | ||
<slot></slot> | ||
</div> | ||
<vaadin-button @click=${this.hide} theme="icon" aria-label="Close"> | ||
<vaadin-icon icon="lumo:cross"></vaadin-icon> | ||
</vaadin-button> | ||
</div> | ||
`; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
packages/storybook/cxl-ui/cxl-inline-notification.stories.js
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,37 @@ | ||
import { html } from 'lit'; | ||
import '@conversionxl/cxl-ui/src/components/cxl-inline-notification.js'; | ||
|
||
export default { | ||
title: 'CXL UI/cxl-inline-notification', | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
}; | ||
|
||
export const CXLInlineNotification = () => html` | ||
<cxl-inline-notification> | ||
<p> | ||
The <strong>Automation with Apps script course</strong> is part of the Technical Marketing | ||
minidegree. | ||
</p> | ||
<p> | ||
The <strong>Automation with Apps script course</strong> is part of the Technical Marketing | ||
minidegree. | ||
</p> | ||
<p> | ||
The <strong>Automation with Apps script course</strong> is part of the Technical Marketing | ||
minidegree. | ||
</p> | ||
<p> | ||
The <strong>Automation with Apps script course</strong> is part of the Technical Marketing | ||
minidegree. | ||
</p> | ||
<p> | ||
The <strong>Automation with Apps script course</strong> is part of the Technical Marketing | ||
minidegree. | ||
</p> | ||
</cxl-inline-notification> | ||
`; | ||
|
||
CXLInlineNotification.storyName = 'cxl-inline-notification'; | ||
CXLInlineNotification.args = {}; |