@reliability-design/web 1.0.2 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/rel-accordion/README.md +132 -0
- package/dist/components/rel-accordion/rel-accordion.ts +61 -29
- package/dist/components/rel-alert/README.md +141 -0
- package/dist/components/rel-alert/rel-alert.ts +110 -67
- package/dist/components/rel-avatar/README.md +119 -0
- package/dist/components/rel-avatar/rel-avatar.ts +8 -15
- package/dist/components/rel-badge/README.md +86 -0
- package/dist/components/rel-badge/rel-badge.ts +28 -21
- package/dist/components/rel-breadcrumb/README.md +102 -0
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +24 -18
- package/dist/components/rel-button/README.md +130 -0
- package/dist/components/rel-button/rel-button.ts +39 -59
- package/dist/components/rel-calendar/README.md +109 -0
- package/dist/components/rel-calendar/index.ts +1 -0
- package/dist/components/rel-calendar/rel-calendar.ts +467 -0
- package/dist/components/rel-card/README.md +94 -0
- package/dist/components/rel-card/rel-card.ts +21 -11
- package/dist/components/rel-cardmedia/README.md +127 -0
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +22 -18
- package/dist/components/rel-carousel/README.md +166 -0
- package/dist/components/rel-carousel/index.ts +1 -0
- package/dist/components/rel-carousel/rel-carousel.ts +469 -0
- package/dist/components/rel-chart/README.md +286 -0
- package/dist/components/rel-chart/index.ts +1 -0
- package/dist/components/rel-chart/rel-chart.ts +736 -0
- package/dist/components/rel-checkbox/README.md +77 -0
- package/dist/components/rel-checkbox/rel-checkbox.ts +36 -45
- package/dist/components/rel-chip/README.md +114 -0
- package/dist/components/rel-chip/rel-chip.ts +47 -122
- package/dist/components/rel-container/README.md +99 -0
- package/dist/components/rel-container/rel-container.ts +1 -6
- package/dist/components/rel-date-picker/README.md +253 -0
- package/dist/components/rel-date-picker/index.ts +1 -0
- package/dist/components/rel-date-picker/rel-date-picker.ts +916 -0
- package/dist/components/rel-divider/README.md +100 -0
- package/dist/components/rel-divider/rel-divider.ts +37 -37
- package/dist/components/rel-drawer/README.md +200 -0
- package/dist/components/rel-drawer/index.ts +1 -0
- package/dist/components/rel-drawer/rel-drawer.ts +621 -0
- package/dist/components/rel-kbd/README.md +151 -0
- package/dist/components/rel-kbd/rel-kbd.ts +118 -0
- package/dist/components/rel-layout/README.md +88 -0
- package/dist/components/rel-layout/rel-layout.ts +12 -14
- package/dist/components/rel-menu/README.md +151 -0
- package/dist/components/rel-menu/rel-menu.ts +18 -10
- package/dist/components/rel-menubar/README.md +329 -0
- package/dist/components/rel-menubar/index.ts +2 -0
- package/dist/components/rel-menubar/rel-menubar-menu.ts +16 -0
- package/dist/components/rel-menubar/rel-menubar.ts +576 -0
- package/dist/components/rel-nav-menu/README.md +289 -0
- package/dist/components/rel-nav-menu/index.ts +3 -0
- package/dist/components/rel-nav-menu/rel-nav-menu-item.ts +143 -0
- package/dist/components/rel-nav-menu/rel-nav-menu-panel.ts +53 -0
- package/dist/components/rel-nav-menu/rel-nav-menu.ts +331 -0
- package/dist/components/rel-navbar/README.md +126 -0
- package/dist/components/rel-navbar/rel-navbar.ts +91 -0
- package/dist/components/rel-otp/README.md +440 -0
- package/dist/components/rel-otp/index.ts +1 -0
- package/dist/components/rel-otp/rel-otp.ts +504 -0
- package/dist/components/rel-pagination/README.md +410 -0
- package/dist/components/rel-pagination/index.ts +1 -0
- package/dist/components/rel-pagination/rel-pagination.ts +376 -0
- package/dist/components/rel-popover/README.md +568 -0
- package/dist/components/rel-popover/index.ts +2 -0
- package/dist/components/rel-popover/rel-popover-content.ts +55 -0
- package/dist/components/rel-popover/rel-popover.ts +327 -0
- package/dist/components/rel-progress/README.md +110 -0
- package/dist/components/rel-progress/rel-progress.ts +58 -20
- package/dist/components/rel-quote-page/README.md +166 -0
- package/dist/components/rel-quote-page/rel-quote-page.ts +816 -0
- package/dist/components/rel-radio/README.md +120 -0
- package/dist/components/rel-radio/rel-radio.ts +41 -73
- package/dist/components/rel-resizable/README.md +140 -0
- package/dist/components/rel-resizable/index.ts +3 -0
- package/dist/components/rel-resizable/rel-resizable-group.ts +374 -0
- package/dist/components/rel-resizable/rel-resizable-handle.ts +149 -0
- package/dist/components/rel-resizable/rel-resizable-panel.ts +47 -0
- package/dist/components/rel-segmented-button/README.md +141 -0
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +18 -13
- package/dist/components/rel-select/README.md +107 -0
- package/dist/components/rel-select/rel-select.ts +14 -14
- package/dist/components/rel-sheet/README.md +224 -0
- package/dist/components/rel-sheet/rel-sheet.ts +683 -0
- package/dist/components/rel-sidebar/README.md +209 -0
- package/dist/components/rel-sidebar/rel-sidebar.ts +1158 -0
- package/dist/components/rel-slider/README.md +135 -0
- package/dist/components/rel-slider/rel-slider.ts +19 -7
- package/dist/components/rel-snackbar/README.md +134 -0
- package/dist/components/rel-snackbar/rel-snackbar.ts +73 -2
- package/dist/components/rel-stepper/README.md +160 -0
- package/dist/components/rel-stepper/rel-stepper.ts +29 -8
- package/dist/components/rel-switch/README.md +102 -0
- package/dist/components/rel-switch/rel-switch.ts +22 -11
- package/dist/components/rel-tab/README.md +163 -0
- package/dist/components/rel-tab/rel-tab.ts +46 -22
- package/dist/components/rel-table/README.md +178 -0
- package/dist/components/rel-table/rel-table-body.ts +16 -0
- package/dist/components/rel-table/rel-table-caption.ts +22 -0
- package/dist/components/rel-table/rel-table-cell.ts +49 -0
- package/dist/components/rel-table/rel-table-footer.ts +18 -0
- package/dist/components/rel-table/rel-table-head.ts +33 -0
- package/dist/components/rel-table/rel-table-header.ts +16 -0
- package/dist/components/rel-table/rel-table-row.ts +32 -0
- package/dist/components/rel-table/rel-table.ts +47 -0
- package/dist/components/rel-textfield/README.md +90 -0
- package/dist/components/rel-textfield/rel-textfield.ts +37 -21
- package/dist/components/rel-toast/README.md +148 -0
- package/dist/components/rel-toast/rel-toast.ts +32 -14
- package/dist/components/rel-tooltip/README.md +103 -0
- package/dist/components/rel-tooltip/rel-tooltip.ts +9 -9
- package/dist/index.d.mts +846 -7
- package/dist/index.d.ts +846 -7
- package/dist/index.js +10860 -1803
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10820 -1809
- package/dist/index.mjs.map +1 -1
- package/dist/styles/vars.css +293 -183
- package/dist/vars-ITL2K3KO.css +294 -0
- package/package.json +2 -2
- package/dist/components/rel-accordion/rel-accordion.stories.ts +0 -313
- package/dist/components/rel-alert/rel-alert.stories.ts +0 -412
- package/dist/components/rel-avatar/rel-avatar.stories.ts +0 -327
- package/dist/components/rel-badge/rel-badge.stories.ts +0 -350
- package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +0 -306
- package/dist/components/rel-button/rel-button.stories.ts +0 -356
- package/dist/components/rel-card/rel-card.stories.ts +0 -299
- package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +0 -368
- package/dist/components/rel-checkbox/rel-checkbox.stories.ts +0 -414
- package/dist/components/rel-chip/rel-chip.stories.ts +0 -552
- package/dist/components/rel-container/rel-container.stories.ts +0 -239
- package/dist/components/rel-divider/rel-divider.stories.ts +0 -229
- package/dist/components/rel-layout/rel-layout.stories.ts +0 -713
- package/dist/components/rel-menu/rel-menu.stories.ts +0 -910
- package/dist/components/rel-progress/rel-progress.stories.ts +0 -817
- package/dist/components/rel-radio/rel-radio.stories.ts +0 -1048
- package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +0 -1079
- package/dist/components/rel-select/rel-select.stories.ts +0 -1201
- package/dist/components/rel-slider/rel-slider.stories.ts +0 -730
- package/dist/components/rel-snackbar/rel-snackbar.stories.ts +0 -808
- package/dist/components/rel-stepper/rel-stepper.stories.ts +0 -752
- package/dist/components/rel-switch/rel-switch.stories.ts +0 -441
- package/dist/components/rel-tab/rel-tab.stories.ts +0 -492
- package/dist/components/rel-textfield/rel-textfield.stories.ts +0 -710
- package/dist/components/rel-toast/rel-toast.stories.ts +0 -394
- package/dist/components/rel-tooltip/rel-tooltip.stories.ts +0 -364
|
@@ -3,12 +3,8 @@ import { customElement, property } from "lit/decorators.js";
|
|
|
3
3
|
|
|
4
4
|
@customElement("rel-alert")
|
|
5
5
|
export class RelAlert extends LitElement {
|
|
6
|
-
@property({ type: String })
|
|
7
|
-
|
|
8
|
-
| "success"
|
|
9
|
-
| "warning"
|
|
10
|
-
| "error"
|
|
11
|
-
| "neutral" = "neutral";
|
|
6
|
+
@property({ type: String })
|
|
7
|
+
type: "info" | "success" | "warning" | "error" | "neutral" = "neutral";
|
|
12
8
|
|
|
13
9
|
@property({ type: String }) message1 = "";
|
|
14
10
|
@property({ type: String }) message2?: string;
|
|
@@ -17,7 +13,7 @@ export class RelAlert extends LitElement {
|
|
|
17
13
|
@property({ type: String }) urlHref?: string;
|
|
18
14
|
|
|
19
15
|
@property({ type: Boolean }) dismissible = true;
|
|
20
|
-
@property({ type: Boolean }) dismissed = false;
|
|
16
|
+
@property({ type: Boolean, reflect: true }) dismissed = false;
|
|
21
17
|
|
|
22
18
|
static styles = css`
|
|
23
19
|
:host {
|
|
@@ -25,14 +21,16 @@ export class RelAlert extends LitElement {
|
|
|
25
21
|
font-family: var(--rel-fontFamilies-primary);
|
|
26
22
|
}
|
|
27
23
|
|
|
24
|
+
:host([dismissed]) {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
28
|
.rel-alert {
|
|
29
29
|
display: flex;
|
|
30
30
|
align-items: center;
|
|
31
|
-
gap: var(--rel-spacing-space-xs);
|
|
31
|
+
gap: var(--rel-spacing-space-xs);
|
|
32
32
|
padding: var(--rel-spacing-space-sm) var(--rel-spacing-space-md);
|
|
33
|
-
|
|
34
|
-
border-radius: var(--rel-borders-radius-border-radius-200); /* 8px */
|
|
35
|
-
width: fit-content;
|
|
33
|
+
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
36
34
|
min-width: 360px;
|
|
37
35
|
box-sizing: border-box;
|
|
38
36
|
}
|
|
@@ -44,8 +42,6 @@ export class RelAlert extends LitElement {
|
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
.rel-message1 {
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
45
|
margin: 0;
|
|
50
46
|
font-size: var(--rel-fontSizes-md);
|
|
51
47
|
font-weight: var(--rel-fontWeights-medium);
|
|
@@ -54,16 +50,9 @@ export class RelAlert extends LitElement {
|
|
|
54
50
|
.rel-message2 {
|
|
55
51
|
margin: 0;
|
|
56
52
|
font-size: var(--rel-fontSizes-sm);
|
|
57
|
-
font-weight: var(--rel-fontWeights-regular);
|
|
58
53
|
opacity: 0.9;
|
|
59
54
|
}
|
|
60
55
|
|
|
61
|
-
.rel-icon {
|
|
62
|
-
display: flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
justify-content: center;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
56
|
.rel-icon svg {
|
|
68
57
|
width: 16px;
|
|
69
58
|
height: 16px;
|
|
@@ -73,8 +62,8 @@ export class RelAlert extends LitElement {
|
|
|
73
62
|
font-size: var(--rel-fontSizes-sm);
|
|
74
63
|
font-weight: var(--rel-fontWeights-medium);
|
|
75
64
|
text-decoration: underline;
|
|
76
|
-
margin-top: 2px;
|
|
77
65
|
color: inherit;
|
|
66
|
+
margin-top: 2px;
|
|
78
67
|
}
|
|
79
68
|
|
|
80
69
|
.rel-close {
|
|
@@ -82,21 +71,25 @@ export class RelAlert extends LitElement {
|
|
|
82
71
|
background: none;
|
|
83
72
|
border: none;
|
|
84
73
|
cursor: pointer;
|
|
85
|
-
width: 16px;
|
|
86
|
-
height: 16px;
|
|
87
74
|
opacity: 0.6;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
75
|
+
color: inherit;
|
|
76
|
+
font-size: 16px;
|
|
77
|
+
padding: var(--rel-spacing-space-2xs);
|
|
78
|
+
line-height: 1;
|
|
79
|
+
border-radius: var(--rel-borders-radius-border-radius-100, 4px);
|
|
92
80
|
}
|
|
93
81
|
|
|
94
82
|
.rel-close:hover {
|
|
95
83
|
opacity: 1;
|
|
96
84
|
}
|
|
97
85
|
|
|
98
|
-
|
|
86
|
+
.rel-close:focus-visible {
|
|
87
|
+
outline: 2px solid currentColor;
|
|
88
|
+
outline-offset: 2px;
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
99
91
|
|
|
92
|
+
/* COLORS */
|
|
100
93
|
.alert-info {
|
|
101
94
|
background: var(--rel-background-info);
|
|
102
95
|
color: var(--rel-text-info);
|
|
@@ -124,50 +117,100 @@ export class RelAlert extends LitElement {
|
|
|
124
117
|
}
|
|
125
118
|
`;
|
|
126
119
|
|
|
120
|
+
private dismissAlert() {
|
|
121
|
+
this.dismissed = true;
|
|
122
|
+
|
|
123
|
+
this.dispatchEvent(
|
|
124
|
+
new CustomEvent("dismiss", {
|
|
125
|
+
bubbles: true,
|
|
126
|
+
composed: true,
|
|
127
|
+
})
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
127
131
|
private get iconSvg() {
|
|
128
132
|
switch (this.type) {
|
|
129
133
|
case "info":
|
|
130
|
-
return html
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
return html`
|
|
135
|
+
<svg
|
|
136
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
137
|
+
width="18"
|
|
138
|
+
height="18"
|
|
139
|
+
viewBox="0 0 18 18"
|
|
140
|
+
fill="none"
|
|
141
|
+
>
|
|
142
|
+
<path
|
|
143
|
+
d="M9 4.75C8.75917 4.75 8.55715 4.8316 8.39395 4.9948C8.23132 5.15743 8.15 5.35917 8.15 5.6C8.15 5.84083 8.23132 6.04285 8.39395 6.20605C8.55715 6.36868 8.75917 6.45 9 6.45C9.24083 6.45 9.44257 6.36868 9.6052 6.20605C9.7684 6.04285 9.85 5.84083 9.85 5.6C9.85 5.35917 9.7684 5.15743 9.6052 4.9948C9.44257 4.8316 9.24083 4.75 9 4.75ZM9.85 8.15L8.15 8.15L8.15 13.25L9.85 13.25L9.85 8.15ZM9 0.499999C10.1758 0.499999 11.2808 0.723266 12.315 1.1698C13.3492 1.61633 14.2488 2.22182 15.0138 2.98625C15.7788 3.75068 16.3842 4.65027 16.8302 5.685C17.2762 6.71973 17.4994 7.82473 17.5 9C17.5006 10.1753 17.2773 11.2803 16.8302 12.315C16.3842 13.3492 15.7787 14.2487 15.0137 15.0137C14.2487 15.7787 13.3492 16.3845 12.315 16.831C11.2808 17.2776 10.1758 17.5006 9 17.5C7.82417 17.4994 6.71917 17.2764 5.685 16.831C4.65083 16.3845 3.75125 15.7787 2.98625 15.0137C2.22125 14.2487 1.61577 13.3492 1.1698 12.315C0.723834 11.2808 0.500567 10.1758 0.500001 9C0.499434 7.82417 0.722701 6.71917 1.1698 5.685C1.61577 4.65083 2.22125 3.75125 2.98625 2.98625C3.75125 2.22125 4.65084 1.61577 5.685 1.1698C6.71917 0.723832 7.82417 0.500566 9 0.499999ZM9 2.2C7.10167 2.2 5.49375 2.85875 4.17625 4.17625C2.85875 5.49375 2.2 7.10167 2.2 9C2.2 10.8983 2.85875 12.5062 4.17625 13.8237C5.49375 15.1412 7.10167 15.8 9 15.8C10.8983 15.8 12.5062 15.1412 13.8237 13.8237C15.1412 12.5062 15.8 10.8983 15.8 9C15.8 7.10167 15.1413 5.49375 13.8238 4.17625C12.5063 2.85875 10.8983 2.2 9 2.2Z"
|
|
144
|
+
fill="var(--rel-icon-info)"
|
|
145
|
+
/>
|
|
146
|
+
</svg>
|
|
147
|
+
`;
|
|
136
148
|
case "success":
|
|
137
|
-
return html
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
149
|
+
return html`
|
|
150
|
+
<svg
|
|
151
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
152
|
+
width="18"
|
|
153
|
+
height="18"
|
|
154
|
+
viewBox="0 0 18 18"
|
|
155
|
+
fill="none"
|
|
156
|
+
>
|
|
157
|
+
<path
|
|
158
|
+
d="M7.81 12.91L13.8025 6.9175L12.6125 5.7275L7.81 10.53L5.3875 8.1075L4.1975 9.2975L7.81 12.91ZM9 17.5C7.82417 17.5 6.71917 17.2767 5.685 16.8302C4.65083 16.3837 3.75125 15.7782 2.98625 15.0138C2.22125 14.2493 1.61577 13.3497 1.1698 12.315C0.723834 11.2803 0.500568 10.1753 0.500001 9C0.499434 7.82473 0.722701 6.71973 1.1698 5.685C1.61577 4.65083 2.22125 3.75125 2.98625 2.98625C3.75125 2.22125 4.65083 1.61548 5.685 1.16895C6.71917 0.722418 7.82417 0.499434 9 0.500001C10.1758 0.500568 11.2808 0.723551 12.315 1.16895C13.3492 1.61548 14.2488 2.22125 15.0138 2.98625C15.7788 3.75125 16.3842 4.65083 16.8302 5.685C17.2762 6.71917 17.4994 7.82417 17.5 9C17.5006 10.1758 17.2773 11.2808 16.8302 12.315C16.3842 13.3492 15.7788 14.2488 15.0138 15.0138C14.2488 15.7788 13.3492 16.3842 12.315 16.8302C11.2808 17.2762 10.1758 17.4994 9 17.5ZM9 15.8C10.8983 15.8 12.5062 15.1412 13.8237 13.8237C15.1412 12.5062 15.8 10.8983 15.8 9C15.8 7.10167 15.1412 5.49375 13.8237 4.17625C12.5062 2.85875 10.8983 2.2 9 2.2C7.10167 2.2 5.49375 2.85875 4.17625 4.17625C2.85875 5.49375 2.2 7.10167 2.2 9C2.2 10.8983 2.85875 12.5062 4.17625 13.8237C5.49375 15.1412 7.10167 15.8 9 15.8Z"
|
|
159
|
+
fill="var(--rel-icon-success)"
|
|
160
|
+
/>
|
|
161
|
+
</svg>
|
|
162
|
+
`;
|
|
143
163
|
case "warning":
|
|
144
|
-
return html
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
164
|
+
return html`
|
|
165
|
+
<svg
|
|
166
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
167
|
+
width="16"
|
|
168
|
+
height="14"
|
|
169
|
+
viewBox="0 0 16 14"
|
|
170
|
+
fill="none"
|
|
171
|
+
>
|
|
172
|
+
<path
|
|
173
|
+
d="M0 14L8 0L16 14H0ZM2.50909 12.5263H13.4909L8 2.94737L2.50909 12.5263ZM8 11.7895C8.20606 11.7895 8.37891 11.7187 8.51855 11.5773C8.6577 11.4363 8.72727 11.2614 8.72727 11.0526C8.72727 10.8439 8.6577 10.669 8.51855 10.528C8.37891 10.3865 8.20606 10.3158 8 10.3158C7.79394 10.3158 7.62133 10.3865 7.48218 10.528C7.34255 10.669 7.27273 10.8439 7.27273 11.0526C7.27273 11.2614 7.34255 11.4363 7.48218 11.5773C7.62133 11.7187 7.79394 11.7895 8 11.7895ZM7.27273 9.57895H8.72727V5.89474H7.27273V9.57895Z"
|
|
174
|
+
fill="var(--rel-icon-warning)"
|
|
175
|
+
/>
|
|
176
|
+
</svg>
|
|
177
|
+
`;
|
|
150
178
|
case "error":
|
|
151
|
-
return html
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
179
|
+
return html`
|
|
180
|
+
<svg
|
|
181
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
182
|
+
width="18"
|
|
183
|
+
height="18"
|
|
184
|
+
viewBox="0 0 18 18"
|
|
185
|
+
fill="none"
|
|
186
|
+
>
|
|
187
|
+
<path
|
|
188
|
+
d="M9 13.25C9.24083 13.25 9.44285 13.1684 9.60605 13.0052C9.76868 12.8426 9.85 12.6408 9.85 12.4C9.85 12.1592 9.76868 11.9571 9.60605 11.7939C9.44285 11.6313 9.24083 11.55 9 11.55C8.75917 11.55 8.55743 11.6313 8.3948 11.7939C8.2316 11.9571 8.15 12.1592 8.15 12.4C8.15 12.6408 8.2316 12.8426 8.3948 13.0052C8.55743 13.1684 8.75917 13.25 9 13.25ZM8.15 9.85H9.85V4.75H8.15V9.85ZM9 17.5C7.82417 17.5 6.71917 17.2767 5.685 16.8302C4.65083 16.3837 3.75125 15.7782 2.98625 15.0138C2.22125 14.2493 1.61577 13.3497 1.1698 12.315C0.723834 11.2803 0.500568 10.1753 0.500001 9C0.499434 7.82473 0.722701 6.71973 1.1698 5.685C1.61577 4.65083 2.22125 3.75125 2.98625 2.98625C3.75125 2.22125 4.65083 1.61548 5.685 1.16895C6.71917 0.722418 7.82417 0.499434 9 0.500001C10.1758 0.500568 11.2808 0.723551 12.315 1.16895C13.3492 1.61548 14.2488 2.22125 15.0138 2.98625C15.7788 3.75125 16.3842 4.65083 16.8302 5.685C17.2762 6.71917 17.4994 7.82417 17.5 9C17.5006 10.1758 17.2773 11.2808 16.8302 12.315C16.3842 13.3492 15.7788 14.2488 15.0138 15.0138C14.2488 15.7788 13.3492 16.3842 12.315 16.8302C11.2808 17.2762 10.1758 17.4994 9 17.5ZM9 15.8C10.8983 15.8 12.5062 15.1412 13.8237 13.8237C15.1412 12.5062 15.8 10.8983 15.8 9C15.8 7.10167 15.1412 5.49375 13.8237 4.17625C12.5062 2.85875 10.8983 2.2 9 2.2C7.10167 2.2 5.49375 2.85875 4.17625 4.17625C2.85875 5.49375 2.2 7.10167 2.2 9C2.2 10.8983 2.85875 12.5062 4.17625 13.8237C5.49375 15.1412 7.10167 15.8 9 15.8Z"
|
|
189
|
+
fill="var(--rel-icon-error)"
|
|
190
|
+
/>
|
|
191
|
+
</svg>
|
|
192
|
+
`;
|
|
157
193
|
default:
|
|
158
|
-
return html
|
|
194
|
+
return html`
|
|
195
|
+
<svg
|
|
196
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
197
|
+
width="18"
|
|
198
|
+
height="18"
|
|
199
|
+
viewBox="0 0 18 18"
|
|
200
|
+
fill="none"
|
|
201
|
+
>
|
|
202
|
+
<path
|
|
203
|
+
d="M9 4.75C8.75917 4.75 8.55715 4.8316 8.39395 4.9948C8.23132 5.15743 8.15 5.35917 8.15 5.6C8.15 5.84083 8.23132 6.04285 8.39395 6.20605C8.55715 6.36868 8.75917 6.45 9 6.45C9.24083 6.45 9.44257 6.36868 9.6052 6.20605C9.7684 6.04285 9.85 5.84083 9.85 5.6C9.85 5.35917 9.7684 5.15743 9.6052 4.9948C9.44257 4.8316 9.24083 4.75 9 4.75ZM9.85 8.15L8.15 8.15L8.15 13.25L9.85 13.25L9.85 8.15ZM9 0.499999C10.1758 0.499999 11.2808 0.723266 12.315 1.1698C13.3492 1.61633 14.2488 2.22182 15.0138 2.98625C15.7788 3.75068 16.3842 4.65027 16.8302 5.685C17.2762 6.71973 17.4994 7.82473 17.5 9C17.5006 10.1753 17.2773 11.2803 16.8302 12.315C16.3842 13.3492 15.7787 14.2487 15.0137 15.0137C14.2487 15.7787 13.3492 16.3845 12.315 16.831C11.2808 17.2776 10.1758 17.5006 9 17.5C7.82417 17.4994 6.71917 17.2764 5.685 16.831C4.65083 16.3845 3.75125 15.7787 2.98625 15.0137C2.22125 14.2487 1.61577 13.3492 1.1698 12.315C0.723834 11.2808 0.500567 10.1758 0.500001 9C0.499434 7.82417 0.722701 6.71917 1.1698 5.685C1.61577 4.65083 2.22125 3.75125 2.98625 2.98625C3.75125 2.22125 4.65084 1.61577 5.685 1.1698C6.71917 0.723832 7.82417 0.500566 9 0.499999ZM9 2.2C7.10167 2.2 5.49375 2.85875 4.17625 4.17625C2.85875 5.49375 2.2 7.10167 2.2 9C2.2 10.8983 2.85875 12.5062 4.17625 13.8237C5.49375 15.1412 7.10167 15.8 9 15.8C10.8983 15.8 12.5062 15.1412 13.8237 13.8237C15.1412 12.5062 15.8 10.8983 15.8 9C15.8 7.10167 15.1413 5.49375 13.8238 4.17625C12.5063 2.85875 10.8983 2.2 9 2.2Z"
|
|
204
|
+
fill="var(--rel-colors-black)"
|
|
205
|
+
/>
|
|
206
|
+
</svg>
|
|
207
|
+
`;
|
|
159
208
|
}
|
|
160
209
|
}
|
|
161
210
|
|
|
162
|
-
private dismissAlert() {
|
|
163
|
-
this.dismissed = true;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
211
|
render() {
|
|
167
|
-
if (this.dismissed) return null;
|
|
168
|
-
|
|
169
212
|
return html`
|
|
170
|
-
<div class="rel-alert alert-${this.type}">
|
|
213
|
+
<div class="rel-alert alert-${this.type}" role="alert">
|
|
171
214
|
<div class="rel-icon">${this.iconSvg}</div>
|
|
172
215
|
|
|
173
216
|
<div class="rel-content">
|
|
@@ -175,19 +218,19 @@ export class RelAlert extends LitElement {
|
|
|
175
218
|
|
|
176
219
|
${this.message2
|
|
177
220
|
? html`<p class="rel-message2">${this.message2}</p>`
|
|
178
|
-
:
|
|
221
|
+
: null}
|
|
179
222
|
${this.urlText && this.urlHref
|
|
180
|
-
? html`<a class="rel-link" href
|
|
181
|
-
|
|
182
|
-
>`
|
|
183
|
-
:
|
|
223
|
+
? html`<a class="rel-link" href=${this.urlHref}>
|
|
224
|
+
${this.urlText}
|
|
225
|
+
</a>`
|
|
226
|
+
: null}
|
|
184
227
|
</div>
|
|
185
228
|
|
|
186
229
|
${this.dismissible
|
|
187
|
-
? html`<button class="rel-close" @click=${this.dismissAlert}>
|
|
230
|
+
? html`<button class="rel-close" @click=${this.dismissAlert} aria-label="Dismiss">
|
|
188
231
|
✕
|
|
189
232
|
</button>`
|
|
190
|
-
:
|
|
233
|
+
: null}
|
|
191
234
|
</div>
|
|
192
235
|
`;
|
|
193
236
|
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# rel-avatar
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
A circular avatar component supporting three display types: image, text initials, or custom icon content. Provides four size variants with automatic text transformation and SVG sizing for icons.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
```html
|
|
8
|
+
<!-- Image avatar -->
|
|
9
|
+
<rel-avatar
|
|
10
|
+
type="image"
|
|
11
|
+
src="./user-photo.jpg"
|
|
12
|
+
alt="John Doe">
|
|
13
|
+
</rel-avatar>
|
|
14
|
+
|
|
15
|
+
<!-- Text initials avatar -->
|
|
16
|
+
<rel-avatar
|
|
17
|
+
type="text"
|
|
18
|
+
text="JD">
|
|
19
|
+
</rel-avatar>
|
|
20
|
+
|
|
21
|
+
<!-- Icon avatar with slotted SVG -->
|
|
22
|
+
<rel-avatar type="icon">
|
|
23
|
+
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
24
|
+
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
|
|
25
|
+
</svg>
|
|
26
|
+
</rel-avatar>
|
|
27
|
+
|
|
28
|
+
<!-- Different sizes -->
|
|
29
|
+
<rel-avatar type="text" text="XS" size="xs"></rel-avatar>
|
|
30
|
+
<rel-avatar type="text" text="SM" size="sm"></rel-avatar>
|
|
31
|
+
<rel-avatar type="text" text="MD" size="md"></rel-avatar>
|
|
32
|
+
<rel-avatar type="text" text="LG" size="lg"></rel-avatar>
|
|
33
|
+
|
|
34
|
+
<!-- User list with avatars -->
|
|
35
|
+
<div style="display: flex; gap: 8px; align-items: center;">
|
|
36
|
+
<rel-avatar type="image" src="user1.jpg" size="sm"></rel-avatar>
|
|
37
|
+
<span>John Doe</span>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<!-- Avatar group -->
|
|
41
|
+
<div style="display: flex; margin-left: -8px;">
|
|
42
|
+
<rel-avatar type="text" text="A" size="md" style="margin-left: -8px;"></rel-avatar>
|
|
43
|
+
<rel-avatar type="text" text="B" size="md" style="margin-left: -8px;"></rel-avatar>
|
|
44
|
+
<rel-avatar type="text" text="C" size="md" style="margin-left: -8px;"></rel-avatar>
|
|
45
|
+
</div>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## API
|
|
49
|
+
|
|
50
|
+
### Attributes/Properties
|
|
51
|
+
| Name | Type | Default | Description |
|
|
52
|
+
|------|------|---------|-------------|
|
|
53
|
+
| `size` (reflected) | `"lg" \| "md" \| "sm" \| "xs"` | `"md"` | Avatar size variant |
|
|
54
|
+
| `type` (reflected) | `"image" \| "text" \| "icon"` | `"image"` | Display type |
|
|
55
|
+
| `src` | `string` | `""` | Image URL (for `type="image"`) |
|
|
56
|
+
| `text` | `string` | `""` | Text content (for `type="text"`, usually initials) |
|
|
57
|
+
| `alt` | `string` | `"Avatar"` | Alt text for the image |
|
|
58
|
+
|
|
59
|
+
## Events
|
|
60
|
+
None.
|
|
61
|
+
|
|
62
|
+
## Slots
|
|
63
|
+
| Slot | Description |
|
|
64
|
+
|------|-------------|
|
|
65
|
+
| (default) | Custom icon content (for `type="icon"`, typically an SVG) |
|
|
66
|
+
|
|
67
|
+
## CSS Parts
|
|
68
|
+
None exposed.
|
|
69
|
+
|
|
70
|
+
## Tokens / CSS Variables
|
|
71
|
+
|
|
72
|
+
### Semantic Tokens
|
|
73
|
+
- `--rel-fontFamilies-primary` - Font family
|
|
74
|
+
|
|
75
|
+
### Font Tokens
|
|
76
|
+
- `--rel-fontSizes-xl` - Large avatar text size
|
|
77
|
+
- `--rel-fontSizes-lg` - Medium avatar text size
|
|
78
|
+
- `--rel-fontSizes-md` - Small avatar text size
|
|
79
|
+
- `--rel-fontSizes-xs` - Extra small avatar text size
|
|
80
|
+
- `--rel-fontWeights-bold` - Text font weight
|
|
81
|
+
|
|
82
|
+
### Color Tokens
|
|
83
|
+
- `--rel-colors-gray-heading` - Avatar background color
|
|
84
|
+
- `--rel-colors-white` - Text/icon color
|
|
85
|
+
|
|
86
|
+
## Accessibility
|
|
87
|
+
- Image avatars include `alt` attribute for screen readers
|
|
88
|
+
- Text is automatically uppercased for consistency
|
|
89
|
+
- Ensure meaningful `alt` text is provided for image avatars
|
|
90
|
+
|
|
91
|
+
### Keyboard Interactions
|
|
92
|
+
- None (purely presentational)
|
|
93
|
+
|
|
94
|
+
### Focus Behavior
|
|
95
|
+
- Does not receive focus
|
|
96
|
+
|
|
97
|
+
## Notes / Edge Cases
|
|
98
|
+
- **Size variants**:
|
|
99
|
+
- **lg**: 40px × 40px, font-size: `--rel-fontSizes-xl`
|
|
100
|
+
- **md**: 32px × 32px, font-size: `--rel-fontSizes-lg`
|
|
101
|
+
- **sm**: 24px × 24px, font-size: `--rel-fontSizes-md`
|
|
102
|
+
- **xs**: 18px × 18px, font-size: `--rel-fontSizes-xs`
|
|
103
|
+
|
|
104
|
+
- **Display types**:
|
|
105
|
+
- **image**: Displays an `<img>` with `src` and `alt`
|
|
106
|
+
- Uses `object-fit: cover` for proper image scaling
|
|
107
|
+
- Image is `width: 100%`, `height: 100%`
|
|
108
|
+
- **text**: Displays the `text` property in a `<span>`
|
|
109
|
+
- Text is automatically uppercased via `text-transform: uppercase`
|
|
110
|
+
- **icon**: Displays slotted content (typically SVG)
|
|
111
|
+
- Slotted SVGs are automatically sized to 50% of the avatar size
|
|
112
|
+
|
|
113
|
+
- The avatar is always circular via `border-radius: 50%`
|
|
114
|
+
- The avatar uses `overflow: hidden` to clip images to circle shape
|
|
115
|
+
- Text and icons are centered using flexbox
|
|
116
|
+
- The avatar is `inline-flex` for easy inline usage with text
|
|
117
|
+
- The `size` and `type` attributes are reflected in HTML
|
|
118
|
+
- The component uses `user-select: none` to prevent text selection
|
|
119
|
+
- If `type` is `image` but `src` is empty, nothing is displayed (no fallback)
|
|
@@ -3,8 +3,11 @@ import { customElement, property } from "lit/decorators.js";
|
|
|
3
3
|
|
|
4
4
|
@customElement("rel-avatar")
|
|
5
5
|
export class RelAvatar extends LitElement {
|
|
6
|
-
@property({ type: String
|
|
7
|
-
|
|
6
|
+
@property({ type: String, reflect: true })
|
|
7
|
+
size: "lg" | "md" | "sm" | "xs" = "md";
|
|
8
|
+
|
|
9
|
+
@property({ type: String, reflect: true })
|
|
10
|
+
type: "image" | "text" | "icon" = "image";
|
|
8
11
|
|
|
9
12
|
@property({ type: String }) src = "";
|
|
10
13
|
@property({ type: String }) text = "";
|
|
@@ -31,35 +34,29 @@ export class RelAvatar extends LitElement {
|
|
|
31
34
|
text-transform: uppercase;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
/*
|
|
35
|
-
CORRECTED SIZE CLASSES
|
|
36
|
-
------------------------- */
|
|
37
|
+
/* Sizes */
|
|
37
38
|
.avatar-lg {
|
|
38
39
|
width: 40px;
|
|
39
40
|
height: 40px;
|
|
40
41
|
font-size: var(--rel-fontSizes-xl);
|
|
41
|
-
line-height: 38px;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.avatar-md {
|
|
45
45
|
width: 32px;
|
|
46
46
|
height: 32px;
|
|
47
47
|
font-size: var(--rel-fontSizes-lg);
|
|
48
|
-
line-height: 32px;
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
.avatar-sm {
|
|
52
51
|
width: 24px;
|
|
53
52
|
height: 24px;
|
|
54
53
|
font-size: var(--rel-fontSizes-md);
|
|
55
|
-
line-height: 24px;
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
.avatar-xs {
|
|
59
57
|
width: 18px;
|
|
60
58
|
height: 18px;
|
|
61
59
|
font-size: var(--rel-fontSizes-xs);
|
|
62
|
-
line-height: 18px;
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
img {
|
|
@@ -76,10 +73,6 @@ export class RelAvatar extends LitElement {
|
|
|
76
73
|
justify-content: center;
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
.icon-slot ::slotted(*) {
|
|
80
|
-
font-size: var(--rel-fontSizes-md);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
76
|
.icon-slot ::slotted(svg) {
|
|
84
77
|
width: 50%;
|
|
85
78
|
height: 50%;
|
|
@@ -89,8 +82,8 @@ export class RelAvatar extends LitElement {
|
|
|
89
82
|
render() {
|
|
90
83
|
return html`
|
|
91
84
|
<div class="avatar avatar-${this.size}">
|
|
92
|
-
${this.type === "image"
|
|
93
|
-
? html`<img src=${this.src
|
|
85
|
+
${this.type === "image" && this.src
|
|
86
|
+
? html`<img src=${this.src} alt=${this.alt} />`
|
|
94
87
|
: this.type === "text"
|
|
95
88
|
? html`<span>${this.text}</span>`
|
|
96
89
|
: html`<span class="icon-slot"><slot></slot></span>`}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# rel-badge
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
A simple notification badge component displaying numeric counts or dot indicators. Supports three sizes (sm, md, lg) and two variants (number, dot). Ideal for indicating counts, status, or notifications in UI elements.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
```html
|
|
8
|
+
<!-- Number badges -->
|
|
9
|
+
<rel-badge number="5"></rel-badge>
|
|
10
|
+
<rel-badge number="12" size="md"></rel-badge>
|
|
11
|
+
<rel-badge number="99+" size="lg"></rel-badge>
|
|
12
|
+
|
|
13
|
+
<!-- Dot badges (no number shown) -->
|
|
14
|
+
<rel-badge variant="dot" size="sm"></rel-badge>
|
|
15
|
+
<rel-badge variant="dot" size="md"></rel-badge>
|
|
16
|
+
<rel-badge variant="dot" size="lg"></rel-badge>
|
|
17
|
+
|
|
18
|
+
<!-- Common use case: Badge on icon/button -->
|
|
19
|
+
<div style="position: relative; display: inline-block;">
|
|
20
|
+
<button>🔔 Notifications</button>
|
|
21
|
+
<rel-badge number="3" size="sm" style="position: absolute; top: -8px; right: -8px;"></rel-badge>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!-- Sizes comparison -->
|
|
25
|
+
<rel-badge number="1" size="sm"></rel-badge>
|
|
26
|
+
<rel-badge number="2" size="md"></rel-badge>
|
|
27
|
+
<rel-badge number="3" size="lg"></rel-badge>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## API
|
|
31
|
+
|
|
32
|
+
### Attributes/Properties
|
|
33
|
+
| Name | Type | Default | Description |
|
|
34
|
+
|------|------|---------|-------------|
|
|
35
|
+
| `number` | `string` | `""` | Text to display in number variant (can be numeric or text like "99+") |
|
|
36
|
+
| `size` | `"sm" \| "md" \| "lg"` (reflected) | `"md"` | Size variant |
|
|
37
|
+
| `variant` | `"dot" \| "number"` (reflected) | `"number"` | Display mode (number shows text, dot shows indicator only) |
|
|
38
|
+
|
|
39
|
+
## Events
|
|
40
|
+
None.
|
|
41
|
+
|
|
42
|
+
## Slots
|
|
43
|
+
Default slot not used.
|
|
44
|
+
|
|
45
|
+
## CSS Parts
|
|
46
|
+
None exposed.
|
|
47
|
+
|
|
48
|
+
## Tokens / CSS Variables
|
|
49
|
+
|
|
50
|
+
### Semantic Tokens
|
|
51
|
+
- `--rel-fontFamilies-primary` - Font family
|
|
52
|
+
- `--rel-fontWeights-semibold` - Font weight (number variant)
|
|
53
|
+
- `--rel-fontSizes-xs`, `--rel-fontSizes-sm`, `--rel-fontSizes-lg` - Font sizes for number variant sizes
|
|
54
|
+
|
|
55
|
+
### Color Tokens
|
|
56
|
+
- `--rel-colors-red-primary` - Background color
|
|
57
|
+
- `--rel-colors-white` - Text color
|
|
58
|
+
|
|
59
|
+
## Accessibility
|
|
60
|
+
- Purely visual indicator (no ARIA roles)
|
|
61
|
+
- For critical information, ensure accompanying text or ARIA labels on parent elements
|
|
62
|
+
- Screen readers will not announce badge content unless used with proper labeling
|
|
63
|
+
|
|
64
|
+
### Keyboard Interactions
|
|
65
|
+
- None (not focusable)
|
|
66
|
+
|
|
67
|
+
### Focus Behavior
|
|
68
|
+
- Not focusable
|
|
69
|
+
|
|
70
|
+
## Notes / Edge Cases
|
|
71
|
+
- **Number variant sizes**:
|
|
72
|
+
- **sm**: 20px × 20px, 12px font
|
|
73
|
+
- **md**: 28px × 28px, 14px font
|
|
74
|
+
- **lg**: 40px × 40px, 20px font
|
|
75
|
+
- **Dot variant sizes**:
|
|
76
|
+
- **sm**: 8px × 8px
|
|
77
|
+
- **md**: 10px × 10px
|
|
78
|
+
- **lg**: 12px × 12px
|
|
79
|
+
- All badges are circular (`border-radius: 50%`)
|
|
80
|
+
- The `number` property accepts any string (e.g., "99+", "NEW", or numeric values)
|
|
81
|
+
- In dot variant, the `number` property is ignored and nothing is rendered inside
|
|
82
|
+
- The component is `display: inline-flex` for easy positioning
|
|
83
|
+
- Badges use `justify-content: center` and `align-items: center` for centering content
|
|
84
|
+
- `size` and `variant` are reflected attributes (appear in HTML when set)
|
|
85
|
+
- Common pattern: position badges absolutely over parent elements (e.g., icons, avatar images)
|
|
86
|
+
- For very large numbers, consider truncating or using "99+" format to avoid overflow
|
|
@@ -4,8 +4,12 @@ import { customElement, property } from "lit/decorators.js";
|
|
|
4
4
|
@customElement("rel-badge")
|
|
5
5
|
export class RelBadge extends LitElement {
|
|
6
6
|
@property({ type: String }) number = "";
|
|
7
|
-
|
|
8
|
-
@property({ type: String
|
|
7
|
+
|
|
8
|
+
@property({ type: String, reflect: true })
|
|
9
|
+
size: "sm" | "md" | "lg" = "md";
|
|
10
|
+
|
|
11
|
+
@property({ type: String, reflect: true })
|
|
12
|
+
variant: "dot" | "number" = "number";
|
|
9
13
|
|
|
10
14
|
static styles = css`
|
|
11
15
|
:host {
|
|
@@ -16,43 +20,46 @@ export class RelBadge extends LitElement {
|
|
|
16
20
|
display: inline-flex;
|
|
17
21
|
align-items: center;
|
|
18
22
|
justify-content: center;
|
|
19
|
-
font-family:
|
|
20
|
-
font-weight: 600;
|
|
23
|
+
font-family: var(--rel-fontFamilies-primary, sans-serif);
|
|
24
|
+
font-weight: var(--rel-fontWeights-semibold, 600);
|
|
21
25
|
background-color: var(--rel-colors-red-primary);
|
|
22
|
-
color: var(--rel-colors-white);
|
|
26
|
+
color: var(--rel-colors-white, #fff);
|
|
23
27
|
border-radius: 50%;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
/*
|
|
30
|
+
/* NUMBER BADGES */
|
|
27
31
|
.badge-sm {
|
|
28
32
|
width: 20px;
|
|
29
33
|
height: 20px;
|
|
30
|
-
font-size: 12px;
|
|
34
|
+
font-size: var(--rel-fontSizes-xs, 12px);
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
.badge-md {
|
|
34
38
|
width: 28px;
|
|
35
39
|
height: 28px;
|
|
36
|
-
font-size: 14px;
|
|
40
|
+
font-size: var(--rel-fontSizes-sm, 14px);
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
.badge-lg {
|
|
40
44
|
width: 40px;
|
|
41
45
|
height: 40px;
|
|
42
|
-
font-size: 20px;
|
|
46
|
+
font-size: var(--rel-fontSizes-lg, 20px);
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
/* DOT
|
|
46
|
-
.badge-dot {
|
|
47
|
-
width:
|
|
48
|
-
height:
|
|
49
|
-
padding: 0 !important;
|
|
49
|
+
/* DOT BADGES */
|
|
50
|
+
.badge-dot.badge-sm {
|
|
51
|
+
width: 8px;
|
|
52
|
+
height: 8px;
|
|
50
53
|
}
|
|
51
54
|
|
|
52
|
-
.badge-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
.badge-dot.badge-md {
|
|
56
|
+
width: 10px;
|
|
57
|
+
height: 10px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.badge-dot.badge-lg {
|
|
61
|
+
width: 12px;
|
|
62
|
+
height: 12px;
|
|
56
63
|
}
|
|
57
64
|
`;
|
|
58
65
|
|
|
@@ -61,10 +68,10 @@ export class RelBadge extends LitElement {
|
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
render() {
|
|
64
|
-
const isDot = this.variant === "dot";
|
|
65
|
-
|
|
66
71
|
return html`
|
|
67
|
-
<span class="${this.classes}"
|
|
72
|
+
<span class="${this.classes}">
|
|
73
|
+
${this.variant === "number" ? this.number : null}
|
|
74
|
+
</span>
|
|
68
75
|
`;
|
|
69
76
|
}
|
|
70
77
|
}
|