@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.
- package/dist/components/rel-accordion/rel-accordion.ts +27 -22
- package/dist/components/rel-alert/rel-alert.ts +98 -66
- package/dist/components/rel-avatar/rel-avatar.ts +8 -15
- package/dist/components/rel-badge/rel-badge.ts +23 -16
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +12 -12
- package/dist/components/rel-button/rel-button.ts +39 -59
- package/dist/components/rel-card/rel-card.ts +11 -10
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +11 -17
- package/dist/components/rel-checkbox/rel-checkbox.ts +18 -35
- package/dist/components/rel-chip/rel-chip.ts +37 -128
- package/dist/components/rel-container/rel-container.ts +1 -6
- package/dist/components/rel-divider/rel-divider.ts +37 -37
- package/dist/components/rel-layout/rel-layout.ts +12 -14
- package/dist/components/rel-progress/rel-progress.ts +26 -15
- package/dist/components/rel-radio/rel-radio.ts +32 -72
- package/dist/components/rel-snackbar/rel-snackbar.ts +6 -0
- package/dist/components/rel-stepper/rel-stepper.ts +23 -2
- package/dist/components/rel-switch/rel-switch.ts +7 -5
- package/dist/components/rel-tab/rel-tab.ts +10 -8
- package/dist/components/rel-textfield/rel-textfield.ts +2 -2
- package/dist/index.d.mts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +367 -475
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +383 -489
- package/dist/index.mjs.map +1 -1
- package/dist/vars-6ZIUPIU4.css +184 -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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LitElement, html, css } from "lit";
|
|
2
|
-
import { customElement, property
|
|
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);
|
|
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);
|
|
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);
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
font-size: var(--rel-fontSizes-lg);
|
|
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
|
-
|
|
71
|
+
transition: max-height 0.25s ease, padding 0.2s ease;
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
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 })
|
|
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,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
|
|
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
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
|
152
|
-
<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
|
181
|
-
|
|
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
|
|
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>`}
|
|
@@ -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,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:
|
|
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
|
-
/*
|
|
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
|
|
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
|
}
|
|
@@ -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 })
|
|
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:
|
|
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
|
|
70
|
+
const isLast = index === this.items.length - 1;
|
|
71
|
+
|
|
71
72
|
return html`
|
|
72
73
|
<li>
|
|
73
|
-
${item.url && !
|
|
74
|
-
? html`<a href
|
|
74
|
+
${item.url && !isLast
|
|
75
|
+
? html`<a href=${item.url}>${item.label}</a>`
|
|
75
76
|
: html`<span class="current">${item.label}</span>`}
|
|
76
|
-
${!
|
|
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
|
-
|
|
86
|
+
/>
|
|
87
87
|
</svg>
|
|
88
88
|
`
|
|
89
|
-
:
|
|
89
|
+
: null}
|
|
90
90
|
</li>
|
|
91
91
|
`;
|
|
92
92
|
})}
|