Skip to content

Commit

Permalink
refactor!: move alwatr-surface to ui-kit and remove old alwatr-card
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Jan 22, 2023
1 parent 8e78cde commit 9eec506
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 34 deletions.
1 change: 0 additions & 1 deletion ui/element/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {globalAlwatr} from '@alwatr/logger';

export * from './dummy-element.js';
export * from './smart-element.js';
export * from './surface-element.js';

export * from './mixins/localize.js';
export * from './mixins/direction.js';
Expand Down
29 changes: 0 additions & 29 deletions ui/ui-kit/src/card/card.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import {css, type CSSResultGroup} from 'lit';
import {AlwatrDummyElement, customElement, html, css, type CSSResultGroup} from '@alwatr/element';

import {AlwatrDummyElement} from './dummy-element.js';
declare global {
interface HTMLElementTagNameMap {
'alwatr-surface': AlwatrSurface;
}
}

/**
* Alwatr Surface Base Element
* Alwatr Surface Element
*
* @extends AlwatrDummyElement
*
Expand All @@ -22,7 +26,8 @@ import {AlwatrDummyElement} from './dummy-element.js';
* @cssprop {Number} [--_surface-tint-opacity=0]
* @cssprop {Number} [--_surface-state-opacity=0]
*/
export class AlwatrSurfaceElement extends AlwatrDummyElement {
@customElement('alwatr-surface')
export class AlwatrSurface extends AlwatrDummyElement {
static override styles: CSSResultGroup = css`
:host {
--_surface-color-on: var(--sys-color-on-surface-hsl);
Expand All @@ -34,6 +39,7 @@ export class AlwatrSurfaceElement extends AlwatrDummyElement {
--_surface-state-opacity: 0;
display: block;
padding: calc(2 * var(--sys-spacing-track));
color: hsl(var(--_surface-color-on));
background-color: hsl(var(--_surface-color-bg));
box-shadow: var(--_surface-elevation);
Expand Down Expand Up @@ -137,4 +143,9 @@ export class AlwatrSurfaceElement extends AlwatrDummyElement {
opacity: var(--sys-surface-disabled-outlined-opacity);
}
`;

override render(): unknown {
this._logger.logMethod('render');
return html`<slot></slot>`;
}
}

0 comments on commit 9eec506

Please sign in to comment.