@reliability-design/web 1.0.2 → 1.0.3

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.
Files changed (54) hide show
  1. package/dist/components/rel-accordion/rel-accordion.ts +27 -22
  2. package/dist/components/rel-alert/rel-alert.ts +98 -66
  3. package/dist/components/rel-avatar/rel-avatar.ts +8 -15
  4. package/dist/components/rel-badge/rel-badge.ts +23 -16
  5. package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +12 -12
  6. package/dist/components/rel-button/rel-button.ts +39 -59
  7. package/dist/components/rel-card/rel-card.ts +11 -10
  8. package/dist/components/rel-cardmedia/rel-cardmedia.ts +11 -17
  9. package/dist/components/rel-checkbox/rel-checkbox.ts +18 -35
  10. package/dist/components/rel-chip/rel-chip.ts +37 -128
  11. package/dist/components/rel-container/rel-container.ts +1 -6
  12. package/dist/components/rel-divider/rel-divider.ts +37 -37
  13. package/dist/components/rel-layout/rel-layout.ts +12 -14
  14. package/dist/components/rel-progress/rel-progress.ts +26 -15
  15. package/dist/components/rel-radio/rel-radio.ts +32 -72
  16. package/dist/components/rel-snackbar/rel-snackbar.ts +6 -0
  17. package/dist/components/rel-stepper/rel-stepper.ts +23 -2
  18. package/dist/components/rel-switch/rel-switch.ts +7 -5
  19. package/dist/components/rel-tab/rel-tab.ts +10 -8
  20. package/dist/components/rel-textfield/rel-textfield.ts +2 -2
  21. package/dist/index.d.mts +11 -7
  22. package/dist/index.d.ts +11 -7
  23. package/dist/index.js +367 -475
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +383 -489
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/vars-6ZIUPIU4.css +184 -0
  28. package/package.json +2 -2
  29. package/dist/components/rel-accordion/rel-accordion.stories.ts +0 -313
  30. package/dist/components/rel-alert/rel-alert.stories.ts +0 -412
  31. package/dist/components/rel-avatar/rel-avatar.stories.ts +0 -327
  32. package/dist/components/rel-badge/rel-badge.stories.ts +0 -350
  33. package/dist/components/rel-breadcrumb/rel-breadcrumb.stories.ts +0 -306
  34. package/dist/components/rel-button/rel-button.stories.ts +0 -356
  35. package/dist/components/rel-card/rel-card.stories.ts +0 -299
  36. package/dist/components/rel-cardmedia/rel-cardmedia.stories.ts +0 -368
  37. package/dist/components/rel-checkbox/rel-checkbox.stories.ts +0 -414
  38. package/dist/components/rel-chip/rel-chip.stories.ts +0 -552
  39. package/dist/components/rel-container/rel-container.stories.ts +0 -239
  40. package/dist/components/rel-divider/rel-divider.stories.ts +0 -229
  41. package/dist/components/rel-layout/rel-layout.stories.ts +0 -713
  42. package/dist/components/rel-menu/rel-menu.stories.ts +0 -910
  43. package/dist/components/rel-progress/rel-progress.stories.ts +0 -817
  44. package/dist/components/rel-radio/rel-radio.stories.ts +0 -1048
  45. package/dist/components/rel-segmented-button/rel-segmented-button.stories.ts +0 -1079
  46. package/dist/components/rel-select/rel-select.stories.ts +0 -1201
  47. package/dist/components/rel-slider/rel-slider.stories.ts +0 -730
  48. package/dist/components/rel-snackbar/rel-snackbar.stories.ts +0 -808
  49. package/dist/components/rel-stepper/rel-stepper.stories.ts +0 -752
  50. package/dist/components/rel-switch/rel-switch.stories.ts +0 -441
  51. package/dist/components/rel-tab/rel-tab.stories.ts +0 -492
  52. package/dist/components/rel-textfield/rel-textfield.stories.ts +0 -710
  53. package/dist/components/rel-toast/rel-toast.stories.ts +0 -394
  54. package/dist/components/rel-tooltip/rel-tooltip.stories.ts +0 -364
@@ -1,10 +1,10 @@
1
1
  import { LitElement, html, css } from "lit";
2
- import { customElement, property, state } from "lit/decorators.js";
2
+ import { customElement, property } from "lit/decorators.js";
3
3
 
4
4
  @customElement("rel-accordion")
5
5
  export class RelAccordion extends LitElement {
6
6
  @property({ type: String }) title = "Accordion";
7
- @property({ type: Boolean }) open = false;
7
+ @property({ type: Boolean, reflect: true }) open = false;
8
8
 
9
9
  static styles = css`
10
10
  :host {
@@ -16,9 +16,8 @@ export class RelAccordion extends LitElement {
16
16
  .accordion {
17
17
  background: var(--rel-colors-white);
18
18
  border: 1px solid var(--rel-border-default);
19
- border-radius: var(--rel-borders-radius-border-radius-200); /* 8px */
19
+ border-radius: var(--rel-borders-radius-border-radius-200);
20
20
  box-shadow: var(--rel-shadows-shadow-100);
21
- transition: all 0.2s ease;
22
21
  overflow: hidden;
23
22
  }
24
23
 
@@ -27,13 +26,13 @@ export class RelAccordion extends LitElement {
27
26
  display: flex;
28
27
  justify-content: space-between;
29
28
  align-items: center;
30
- padding: var(--rel-spacing-space-md); /* 16px */
29
+ padding: var(--rel-spacing-space-md);
31
30
  cursor: pointer;
32
31
  user-select: none;
33
32
  }
34
33
 
35
34
  .title {
36
- font-size: var(--rel-fontSizes-lg); /* 20px */
35
+ font-size: var(--rel-fontSizes-lg);
37
36
  font-weight: var(--rel-fontWeights-medium);
38
37
  color: var(--rel-colors-black);
39
38
  }
@@ -58,34 +57,37 @@ export class RelAccordion extends LitElement {
58
57
  stroke-linejoin: round;
59
58
  }
60
59
 
61
- .rotated {
60
+ .icon.rotated {
62
61
  transform: rotate(180deg);
63
62
  }
64
63
 
65
64
  /* BODY ------------------------------------------------------ */
66
65
  .body {
67
- padding: var(--rel-spacing-space-xl) var(--rel-spacing-space-md)
68
- var(--rel-spacing-space-lg);
69
- /* 24px 16px 20px */
70
- font-size: var(--rel-fontSizes-lg); /* 20px */
66
+ overflow: hidden;
67
+ max-height: 0;
68
+ padding: 0 var(--rel-spacing-space-md);
69
+ font-size: var(--rel-fontSizes-lg);
71
70
  color: var(--rel-colors-gray-primary);
72
- animation: fadeIn 0.2s ease;
71
+ transition: max-height 0.25s ease, padding 0.2s ease;
73
72
  }
74
73
 
75
- @keyframes fadeIn {
76
- from {
77
- opacity: 0;
78
- transform: translateY(-4px);
79
- }
80
- to {
81
- opacity: 1;
82
- transform: translateY(0);
83
- }
74
+ .body.open {
75
+ max-height: 1000px; /* sufficiently large */
76
+ padding: var(--rel-spacing-space-xl) var(--rel-spacing-space-md)
77
+ var(--rel-spacing-space-lg);
84
78
  }
85
79
  `;
86
80
 
87
81
  private toggle() {
88
82
  this.open = !this.open;
83
+
84
+ this.dispatchEvent(
85
+ new CustomEvent<boolean>("open-change", {
86
+ detail: this.open,
87
+ bubbles: true,
88
+ composed: true,
89
+ })
90
+ );
89
91
  }
90
92
 
91
93
  private chevron() {
@@ -107,7 +109,10 @@ export class RelAccordion extends LitElement {
107
109
  </div>
108
110
  </div>
109
111
 
110
- ${this.open ? html`<div class="body"><slot></slot></div>` : ""}
112
+ <!-- IMPORTANT: slot is ALWAYS rendered -->
113
+ <div class="body ${this.open ? "open" : ""}">
114
+ <slot></slot>
115
+ </div>
111
116
  </div>
112
117
  `;
113
118
  }
@@ -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 }) type:
7
- | "info"
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); /* 8px */
31
+ gap: var(--rel-spacing-space-xs);
32
32
  padding: var(--rel-spacing-space-sm) var(--rel-spacing-space-md);
33
- /* 12px vertical, 16px horizontal */
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,14 @@ 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
- padding: 0;
89
- display: flex;
90
- align-items: center;
91
- justify-content: center;
92
75
  }
93
76
 
94
77
  .rel-close:hover {
95
78
  opacity: 1;
96
79
  }
97
80
 
98
- /* COLORS — using token system */
99
-
81
+ /* COLORS */
100
82
  .alert-info {
101
83
  background: var(--rel-background-info);
102
84
  color: var(--rel-text-info);
@@ -124,48 +106,98 @@ export class RelAlert extends LitElement {
124
106
  }
125
107
  `;
126
108
 
109
+ private dismissAlert() {
110
+ this.dismissed = true;
111
+
112
+ this.dispatchEvent(
113
+ new CustomEvent("dismiss", {
114
+ bubbles: true,
115
+ composed: true,
116
+ })
117
+ );
118
+ }
119
+
127
120
  private get iconSvg() {
128
121
  switch (this.type) {
129
122
  case "info":
130
- return html`<svg viewBox="0 0 18 18" fill="none">
131
- <path
132
- d="M9 4.75c-.24 0-.44.08-.61.25-.16.16-.24.36-.24.6 0 .24.08.44.24.61.17.17.37.25.61.25.24 0 .44-.08.61-.25.17-.16.24-.36.24-.61 0-.24-.08-.44-.24-.6-.17-.17-.37-.25-.61-.25Zm.85 3.4h-1.7v5.1h1.7V8.15ZM9 .5c1.18 0 2.29.22 3.32.67 1.03.45 1.93 1.05 2.69 1.81.75.76 1.35 1.66 1.8 2.69.46 1.03.68 2.14.68 3.33 0 1.18-.22 2.29-.68 3.32-.45 1.04-1.05 1.93-1.8 2.69-.76.75-1.66 1.35-2.69 1.8-1.04.46-2.15.68-3.32.68-1.18 0-2.29-.22-3.32-.68-1.04-.45-1.93-1.05-2.69-1.8-.75-.76-1.35-1.66-1.8-2.69C1.92 11.28 1.7 10.17 1.7 9c0-1.18.22-2.29.68-3.32.45-1.04 1.05-1.93 1.8-2.69.76-.75 1.66-1.35 2.69-1.8C6.71.73 7.82.5 9 .5Z"
133
- fill="#4A90E2"
134
- />
135
- </svg>`;
123
+ return html`
124
+ <svg
125
+ xmlns="http://www.w3.org/2000/svg"
126
+ width="18"
127
+ height="18"
128
+ viewBox="0 0 18 18"
129
+ fill="none"
130
+ >
131
+ <path
132
+ 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"
133
+ fill="#4A90E2"
134
+ />
135
+ </svg>
136
+ `;
136
137
  case "success":
137
- return html`<svg viewBox="0 0 18 18" fill="none">
138
- <path
139
- d="M7.81 12.91 13.8 6.92l-1.19-1.19L7.81 10.53 5.39 8.11 4.2 9.3l3.61 3.61ZM9 17.5a8.49 8.49 0 1 1 0-17 8.49 8.49 0 0 1 0 17Z"
140
- fill="#4CAA47"
141
- />
142
- </svg>`;
138
+ return html`
139
+ <svg
140
+ xmlns="http://www.w3.org/2000/svg"
141
+ width="18"
142
+ height="18"
143
+ viewBox="0 0 18 18"
144
+ fill="none"
145
+ >
146
+ <path
147
+ 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"
148
+ fill="#4CAA47"
149
+ />
150
+ </svg>
151
+ `;
143
152
  case "warning":
144
- return html`<svg viewBox="0 0 16 14" fill="none">
145
- <path
146
- d="M0 14 8 0l8 14H0Zm2.51-1.47h10.98L8 2.95 2.51 12.53ZM8 11.79c.21 0 .38-.07.52-.21.14-.14.21-.31.21-.52 0-.21-.07-.38-.21-.52A.7.7 0 0 0 8 10.32a.7.7 0 0 0-.52.21c-.14.14-.21.31-.21.52 0 .21.07.38.21.52.14.14.31.21.52.21Zm-.73-2.21h1.46V5.89H7.27v3.69Z"
147
- fill="#FF6D00"
148
- />
149
- </svg>`;
153
+ return html`
154
+ <svg
155
+ xmlns="http://www.w3.org/2000/svg"
156
+ width="16"
157
+ height="14"
158
+ viewBox="0 0 16 14"
159
+ fill="none"
160
+ >
161
+ <path
162
+ 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"
163
+ fill="#FF6D00"
164
+ />
165
+ </svg>
166
+ `;
150
167
  case "error":
151
- return html`<svg viewBox="0 0 18 18" fill="none">
152
- <path
153
- d="M9 13.25c.24 0 .44-.08.61-.24.17-.17.24-.38.24-.61 0-.24-.08-.44-.24-.61-.17-.16-.37-.24-.61-.24-.24 0-.44.08-.61.24-.17.17-.24.37-.24.61 0 .24.08.44.24.61.17.16.37.24.61.24Zm-.85-3.4h1.7V4.75h-1.7v5.1ZM9 17.5c-1.18 0-2.29-.23-3.32-.68C4.64 16.37 3.74 15.77 2.99 15.02c-.75-.75-1.35-1.65-1.8-2.69C.73 11.29.5 10.18.5 9c0-1.18.23-2.29.68-3.32.45-1.03 1.05-1.93 1.8-2.69C5.03 1.23 5.94.63 6.97.18 8 .72 9.12.5 10.3.5c1.17 0 2.28.23 3.32.68 1.03.45 1.93 1.05 2.68 1.8.75.76 1.35 1.66 1.8 2.69.46 1.03.68 2.14.68 3.33 0 1.18-.22 2.29-.68 3.32-.45 1.04-1.05 1.93-1.8 2.69-.76.75-1.66 1.35-2.69 1.8-1.04.46-2.15.68-3.32.68Z"
154
- fill="#C62828"
155
- />
156
- </svg>`;
168
+ return html`
169
+ <svg
170
+ xmlns="http://www.w3.org/2000/svg"
171
+ width="18"
172
+ height="18"
173
+ viewBox="0 0 18 18"
174
+ fill="none"
175
+ >
176
+ <path
177
+ 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"
178
+ fill="#C62828"
179
+ />
180
+ </svg>
181
+ `;
157
182
  default:
158
- return html``;
183
+ return html`
184
+ <svg
185
+ xmlns="http://www.w3.org/2000/svg"
186
+ width="18"
187
+ height="18"
188
+ viewBox="0 0 18 18"
189
+ fill="none"
190
+ >
191
+ <path
192
+ 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"
193
+ fill="black"
194
+ />
195
+ </svg>
196
+ `;
159
197
  }
160
198
  }
161
199
 
162
- private dismissAlert() {
163
- this.dismissed = true;
164
- }
165
-
166
200
  render() {
167
- if (this.dismissed) return null;
168
-
169
201
  return html`
170
202
  <div class="rel-alert alert-${this.type}">
171
203
  <div class="rel-icon">${this.iconSvg}</div>
@@ -175,19 +207,19 @@ export class RelAlert extends LitElement {
175
207
 
176
208
  ${this.message2
177
209
  ? html`<p class="rel-message2">${this.message2}</p>`
178
- : ""}
210
+ : null}
179
211
  ${this.urlText && this.urlHref
180
- ? html`<a class="rel-link" href="${this.urlHref}"
181
- >${this.urlText}</a
182
- >`
183
- : ""}
212
+ ? html`<a class="rel-link" href=${this.urlHref}>
213
+ ${this.urlText}
214
+ </a>`
215
+ : null}
184
216
  </div>
185
217
 
186
218
  ${this.dismissible
187
219
  ? html`<button class="rel-close" @click=${this.dismissAlert}>
188
220
  ✕
189
221
  </button>`
190
- : ""}
222
+ : null}
191
223
  </div>
192
224
  `;
193
225
  }
@@ -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 }) size: "lg" | "md" | "sm" | "xs" = "md";
7
- @property({ type: String }) type: "image" | "text" | "icon" = "image";
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!} alt=${this.alt} />`
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>`}
@@ -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
- @property({ type: String }) size: "sm" | "md" | "lg" = "md";
8
- @property({ type: String }) variant: "dot" | "number" = "number";
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,14 +20,14 @@ export class RelBadge extends LitElement {
16
20
  display: inline-flex;
17
21
  align-items: center;
18
22
  justify-content: center;
19
- font-family: "Poppins", sans-serif;
23
+ font-family: var(--rel-fontFamilies-primary);
20
24
  font-weight: 600;
21
25
  background-color: var(--rel-colors-red-primary);
22
26
  color: var(--rel-colors-white);
23
27
  border-radius: 50%;
24
28
  }
25
29
 
26
- /* PERFECT CIRCLES — FIXED SIZES */
30
+ /* NUMBER BADGES */
27
31
  .badge-sm {
28
32
  width: 20px;
29
33
  height: 20px;
@@ -42,17 +46,20 @@ export class RelBadge extends LitElement {
42
46
  font-size: 20px;
43
47
  }
44
48
 
45
- /* DOT — smaller circle */
46
- .badge-dot {
47
- width: 10px !important;
48
- height: 10px !important;
49
- padding: 0 !important;
49
+ /* DOT BADGES */
50
+ .badge-dot.badge-sm {
51
+ width: 8px;
52
+ height: 8px;
50
53
  }
51
54
 
52
- .badge-number {
53
- display: flex;
54
- align-items: center;
55
- justify-content: center;
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}">${isDot ? "" : this.number}</span>
72
+ <span class="${this.classes}">
73
+ ${this.variant === "number" ? this.number : null}
74
+ </span>
68
75
  `;
69
76
  }
70
77
  }
@@ -1,14 +1,15 @@
1
1
  import { LitElement, html, css } from "lit";
2
2
  import { customElement, property } from "lit/decorators.js";
3
3
 
4
- interface BreadcrumbItem {
4
+ export interface BreadcrumbItem {
5
5
  label: string;
6
6
  url?: string;
7
7
  }
8
8
 
9
9
  @customElement("rel-breadcrumbs")
10
10
  export class RelBreadcrumbs extends LitElement {
11
- @property({ type: Array }) items: BreadcrumbItem[] = [];
11
+ @property({ type: Array })
12
+ items: BreadcrumbItem[] = [];
12
13
 
13
14
  static styles = css`
14
15
  :host {
@@ -19,7 +20,6 @@ export class RelBreadcrumbs extends LitElement {
19
20
  }
20
21
 
21
22
  nav {
22
- display: block;
23
23
  width: 100%;
24
24
  }
25
25
 
@@ -55,7 +55,7 @@ export class RelBreadcrumbs extends LitElement {
55
55
  }
56
56
 
57
57
  svg {
58
- stroke: var(--rel-colors-gray-text);
58
+ stroke: currentColor;
59
59
  width: 16px;
60
60
  height: 16px;
61
61
  margin: 0 10px;
@@ -67,26 +67,26 @@ export class RelBreadcrumbs extends LitElement {
67
67
  <nav aria-label="Breadcrumb">
68
68
  <ol>
69
69
  ${this.items.map((item, index) => {
70
- const last = index === this.items.length - 1;
70
+ const isLast = index === this.items.length - 1;
71
+
71
72
  return html`
72
73
  <li>
73
- ${item.url && !last
74
- ? html`<a href="${item.url}">${item.label}</a>`
74
+ ${item.url && !isLast
75
+ ? html`<a href=${item.url}>${item.label}</a>`
75
76
  : html`<span class="current">${item.label}</span>`}
76
- ${!last
77
+ ${!isLast
77
78
  ? html`
78
- <svg viewBox="0 0 24 24">
79
+ <svg viewBox="0 0 24 24" aria-hidden="true">
79
80
  <polyline
80
81
  points="9 18 15 12 9 6"
81
82
  fill="none"
82
- stroke="currentColor"
83
83
  stroke-width="2"
84
84
  stroke-linecap="round"
85
85
  stroke-linejoin="round"
86
- ></polyline>
86
+ />
87
87
  </svg>
88
88
  `
89
- : ""}
89
+ : null}
90
90
  </li>
91
91
  `;
92
92
  })}