UNPKG

1.33 kBJavaScriptView Raw
1import {
2 badge_styles_default
3} from "./chunk.INE3EZCE.js";
4import {
5 o
6} from "./chunk.IAELDRGJ.js";
7import {
8 e,
9 n
10} from "./chunk.VKNZYXSO.js";
11import {
12 $,
13 s
14} from "./chunk.WWAD5WF4.js";
15import {
16 __decorateClass
17} from "./chunk.K2NRSETB.js";
18
19// src/components/badge/badge.ts
20var SlBadge = class extends s {
21 constructor() {
22 super(...arguments);
23 this.variant = "primary";
24 this.pill = false;
25 this.pulse = false;
26 }
27 render() {
28 return $`
29 <span
30 part="base"
31 class=${o({
32 badge: true,
33 "badge--primary": this.variant === "primary",
34 "badge--success": this.variant === "success",
35 "badge--neutral": this.variant === "neutral",
36 "badge--warning": this.variant === "warning",
37 "badge--danger": this.variant === "danger",
38 "badge--pill": this.pill,
39 "badge--pulse": this.pulse
40 })}
41 role="status"
42 >
43 <slot></slot>
44 </span>
45 `;
46 }
47};
48SlBadge.styles = badge_styles_default;
49__decorateClass([
50 e({ reflect: true })
51], SlBadge.prototype, "variant", 2);
52__decorateClass([
53 e({ type: Boolean, reflect: true })
54], SlBadge.prototype, "pill", 2);
55__decorateClass([
56 e({ type: Boolean, reflect: true })
57], SlBadge.prototype, "pulse", 2);
58SlBadge = __decorateClass([
59 n("sl-badge")
60], SlBadge);
61
62export {
63 SlBadge
64};