@reown/appkit-ui
Version:
The full stack toolkit to build onchain app UX.
68 lines • 2.33 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { LitElement, html } from 'lit';
import { property } from 'lit/decorators.js';
import '../../components/wui-icon/index.js';
import '../../components/wui-text/index.js';
import { elementStyles, resetStyles } from '../../utils/ThemeUtil.js';
import { customElement } from '../../utils/WebComponentsUtil.js';
import styles from './styles.js';
const TEXT_VARIANT_BY_SIZE = {
sm: 'sm-medium',
md: 'md-medium'
};
const TEXT_COLOR_BY_VARIANT = {
accent: 'accent-primary',
secondary: 'secondary'
};
let WuiLink = class WuiLink extends LitElement {
constructor() {
super(...arguments);
this.size = 'md';
this.disabled = false;
this.variant = 'accent';
this.icon = undefined;
}
render() {
return html `
<button ?disabled=${this.disabled} data-variant=${this.variant}>
<slot name="iconLeft"></slot>
<wui-text
color=${TEXT_COLOR_BY_VARIANT[this.variant]}
variant=${TEXT_VARIANT_BY_SIZE[this.size]}
>
<slot></slot>
</wui-text>
${this.iconTemplate()}
</button>
`;
}
iconTemplate() {
if (!this.icon) {
return null;
}
return html `<wui-icon name=${this.icon} size="sm"></wui-icon>`;
}
};
WuiLink.styles = [resetStyles, elementStyles, styles];
__decorate([
property()
], WuiLink.prototype, "size", void 0);
__decorate([
property({ type: Boolean })
], WuiLink.prototype, "disabled", void 0);
__decorate([
property()
], WuiLink.prototype, "variant", void 0);
__decorate([
property()
], WuiLink.prototype, "icon", void 0);
WuiLink = __decorate([
customElement('wui-link')
], WuiLink);
export { WuiLink };
//# sourceMappingURL=index.js.map