dees-catalog/ts_web/elements/dees-simple-login.ts
2023-08-19 11:47:45 +02:00

75 lines
1.7 KiB
TypeScript

import {
customElement,
html,
DeesElement,
property,
type TemplateResult,
cssManager,
css,
unsafeCSS,
type CSSResult,
state,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
declare global {
interface HTMLElementTagNameMap {
'dees-simple-login': DeesSimpleLogin;
}
}
@customElement('dees-simple-login')
export class DeesSimpleLogin extends DeesElement {
// STATIC
public static demo = () => html` <dees-simple-login></dees-simple-login> `;
// INSTANCE
@property()
public title = 'Dees Simple Login';
public static styles = [
cssManager.defaultStyles,
css`
:host {
color: ${cssManager.bdTheme('#333', '#fff')};
}
.loginContainer {
display: flex;
justify-content: center; /* aligns horizontally */
align-items: center; /* aligns vertically */
height: 100%;
}
.login {
min-width: 320px;
min-height: 100px;
background: ${cssManager.bdTheme('#eeeeeb', '#111')};
box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')};
border-radius: 3px;
padding: 24px;
}
.header {
text-align: center;
}
`,
];
public render(): TemplateResult {
return html`
<div class="loginContainer">
<div class="login">
<dees-form>
<div class="header">Login to ${this.title}</div>
<dees-input-text label="username"></dees-input-text>
<dees-input-text label="password" isPasswordBool></dees-input-text>
<dees-form-submit>login</dees-form-submit>
</dees-form>
</div>
</div>
<slot></slot>
`;
}
}