Skip to content

Commit

Permalink
feat(cxl-ui): cxl-inline-notification add component
Browse files Browse the repository at this point in the history
  • Loading branch information
anoblet committed May 17, 2024
1 parent 2abd89a commit 4a7a139
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/cxl-ui/scss/cxl-inline-notification.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// stylelint-disable order/properties-order
:host {
background-color: var(--lumo-contrast-5pct);
display: flex;

.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;
}
29 changes: 29 additions & 0 deletions packages/cxl-ui/src/components/cxl-inline-notification.js
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 packages/storybook/cxl-ui/cxl-inline-notification.stories.js
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 = {};

0 comments on commit 4a7a139

Please sign in to comment.