@reliability-design/web 1.1.1 → 1.2.0
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 +17 -32
- package/dist/components/rel-alert/rel-alert.ts +34 -34
- package/dist/components/rel-avatar/rel-avatar.ts +5 -3
- package/dist/components/rel-badge/rel-badge.ts +2 -1
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +6 -6
- package/dist/components/rel-button/rel-button.ts +67 -21
- package/dist/components/rel-calendar/rel-calendar.ts +15 -8
- package/dist/components/rel-card/rel-card.ts +9 -17
- package/dist/components/rel-cardmedia/rel-cardmedia.ts +20 -23
- package/dist/components/rel-carousel/rel-carousel.ts +596 -468
- package/dist/components/rel-checkbox/rel-checkbox.ts +68 -16
- package/dist/components/rel-chip/rel-chip.ts +291 -244
- package/dist/components/rel-container/rel-container.ts +2 -2
- package/dist/components/rel-date-picker/rel-date-picker.ts +23 -19
- package/dist/components/rel-divider/rel-divider.ts +3 -3
- package/dist/components/rel-drawer/rel-drawer-footer.ts +0 -2
- package/dist/components/rel-drawer/rel-drawer.ts +41 -88
- package/dist/components/rel-kbd/rel-kbd.ts +94 -118
- package/dist/components/rel-layout/rel-layout.ts +49 -58
- package/dist/components/rel-menu/rel-menu.ts +359 -359
- package/dist/components/rel-menubar/rel-menubar-menu.css +3 -0
- package/dist/components/rel-menubar/rel-menubar-menu.ts +2 -1
- package/dist/components/rel-menubar/rel-menubar.ts +602 -605
- package/dist/components/rel-otp/rel-otp.ts +22 -25
- package/dist/components/rel-pagination/rel-pagination.ts +101 -57
- package/dist/components/rel-popover/rel-popover-content.ts +6 -5
- package/dist/components/rel-popover/rel-popover.ts +26 -7
- package/dist/components/rel-progress/rel-progress.ts +10 -9
- package/dist/components/rel-radio/rel-radio.ts +228 -172
- package/dist/components/rel-range-picker/rel-range-picker.css +349 -0
- package/dist/components/rel-range-picker/rel-range-picker.ts +1079 -0
- package/dist/components/rel-resizable/rel-resizable-handle.ts +8 -7
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +41 -20
- package/dist/components/rel-select/rel-select.ts +103 -32
- package/dist/components/rel-sheet/rel-sheet.ts +362 -684
- package/dist/components/rel-slider/rel-slider.ts +49 -27
- package/dist/components/rel-snackbar/rel-snackbar.ts +28 -28
- package/dist/components/rel-stepper/rel-stepper.ts +11 -10
- package/dist/components/rel-switch/rel-switch.ts +7 -6
- package/dist/components/rel-tab/rel-tab.ts +15 -29
- package/dist/components/rel-textfield/rel-textfield.ts +144 -35
- package/dist/components/rel-toast/rel-toast.ts +25 -12
- package/dist/components/rel-tooltip/rel-tooltip.ts +123 -123
- package/dist/components/rel-topbar/rel-topbar-actions.ts +1 -0
- package/dist/components/rel-topbar/rel-topbar-brand.ts +1 -0
- package/dist/components/rel-topbar/rel-topbar-dropdown-item.ts +32 -2
- package/dist/components/rel-topbar/rel-topbar-dropdown.ts +1 -1
- package/dist/components/rel-topbar/rel-topbar-item.ts +15 -10
- package/dist/components/rel-topbar/rel-topbar-mobile-panel.ts +1 -0
- package/dist/components/rel-topbar/rel-topbar-profile.ts +30 -56
- package/dist/components/rel-topbar/rel-topbar-utilities.ts +1 -0
- package/dist/components/rel-topbar/rel-topbar.ts +137 -28
- package/dist/index.d.mts +153 -178
- package/dist/index.d.ts +153 -178
- package/dist/index.js +4711 -3875
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4047 -3202
- package/dist/index.mjs.map +1 -1
- package/dist/rel-menubar-menu-BEEQDAXW.css +3 -0
- package/dist/styles/vars-v2.css +525 -0
- package/dist/styles/vars.css +346 -346
- package/dist/{vars-TBB4BMSD.css → vars-I2PC74XD.css} +346 -346
- package/dist/vars-v2-VMGWTFJZ.css +525 -0
- package/package.json +2 -1
|
@@ -24,8 +24,6 @@ export class RelOtp extends LitElement {
|
|
|
24
24
|
@property({ type: String }) size: "sm" | "md" | "lg" = "md";
|
|
25
25
|
|
|
26
26
|
@state() private cells: string[] = [];
|
|
27
|
-
@state() private focusedIndex: number = -1;
|
|
28
|
-
|
|
29
27
|
@query(".hidden-input") private hiddenInput?: HTMLInputElement;
|
|
30
28
|
|
|
31
29
|
private isUpdatingFromValue = false;
|
|
@@ -38,30 +36,30 @@ export class RelOtp extends LitElement {
|
|
|
38
36
|
|
|
39
37
|
:host([disabled]) {
|
|
40
38
|
opacity: 0.6;
|
|
41
|
-
|
|
39
|
+
cursor: not-allowed;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
.otp-root {
|
|
45
43
|
display: inline-flex;
|
|
46
44
|
align-items: center;
|
|
47
|
-
gap: var(--rel-spacing-space-2xs
|
|
45
|
+
gap: var(--rel-spacing-space-2xs);
|
|
48
46
|
position: relative;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
.otp-group {
|
|
52
50
|
display: flex;
|
|
53
|
-
gap: var(--rel-spacing-space-2xs
|
|
51
|
+
gap: var(--rel-spacing-space-2xs);
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
.otp-separator {
|
|
57
55
|
display: flex;
|
|
58
56
|
align-items: center;
|
|
59
57
|
justify-content: center;
|
|
60
|
-
color: var(--rel-
|
|
58
|
+
color: var(--rel-gray-divider-default);
|
|
61
59
|
font-size: var(--rel-fontSizes-lg);
|
|
62
60
|
font-weight: var(--rel-fontWeights-semibold);
|
|
63
61
|
user-select: none;
|
|
64
|
-
padding: 0 var(--rel-spacing-space-3xs
|
|
62
|
+
padding: 0 var(--rel-spacing-space-3xs);
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
.otp-separator.hidden {
|
|
@@ -71,17 +69,17 @@ export class RelOtp extends LitElement {
|
|
|
71
69
|
.otp-cell {
|
|
72
70
|
width: 40px;
|
|
73
71
|
height: 48px;
|
|
74
|
-
border: var(--rel-borders-width-stroke-100) solid var(--rel-border-default);
|
|
72
|
+
border: var(--rel-borders-width-stroke-100) solid var(--rel-color-border-default);
|
|
75
73
|
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
76
|
-
background: var(--rel-
|
|
74
|
+
background: var(--rel-color-bg-primary);
|
|
77
75
|
font-family: var(--rel-fontFamilies-primary);
|
|
78
76
|
font-size: var(--rel-fontSizes-lg);
|
|
79
77
|
font-weight: var(--rel-fontWeights-medium);
|
|
80
78
|
text-align: center;
|
|
81
|
-
color: var(--rel-text-primary);
|
|
79
|
+
color: var(--rel-color-text-primary);
|
|
82
80
|
outline: none;
|
|
83
81
|
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
84
|
-
caret-color: var(--rel-
|
|
82
|
+
caret-color: var(--rel-color-text-primary);
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
/* Size variants */
|
|
@@ -98,27 +96,31 @@ export class RelOtp extends LitElement {
|
|
|
98
96
|
}
|
|
99
97
|
|
|
100
98
|
.otp-cell::placeholder {
|
|
101
|
-
color: var(--rel-
|
|
99
|
+
color: var(--rel-color-text-placeholder);
|
|
102
100
|
opacity: 0.6;
|
|
103
101
|
}
|
|
104
102
|
|
|
105
103
|
.otp-cell:hover:not(:disabled):not(:read-only) {
|
|
106
|
-
border-color: var(--rel-
|
|
104
|
+
border-color: var(--rel-color-text-primary);
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
.otp-cell:focus-visible {
|
|
110
|
-
border-color: var(--rel-
|
|
111
|
-
box-shadow: 0 0 0 2px var(--rel-border-default);
|
|
108
|
+
border-color: var(--rel-color-text-heading);
|
|
109
|
+
box-shadow: 0 0 0 2px var(--rel-color-border-default);
|
|
112
110
|
}
|
|
113
111
|
|
|
114
112
|
.otp-cell:disabled {
|
|
115
|
-
background: var(--rel-
|
|
116
|
-
color: var(--rel-
|
|
113
|
+
background: var(--rel-color-bg-secondary);
|
|
114
|
+
color: var(--rel-color-text-disabled);
|
|
115
|
+
cursor: not-allowed;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host([disabled]) .otp-cell {
|
|
117
119
|
cursor: not-allowed;
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
.otp-cell:read-only {
|
|
121
|
-
background: var(--rel-
|
|
123
|
+
background: var(--rel-color-bg-tertiary);
|
|
122
124
|
cursor: default;
|
|
123
125
|
}
|
|
124
126
|
|
|
@@ -146,6 +148,7 @@ export class RelOtp extends LitElement {
|
|
|
146
148
|
transition: none;
|
|
147
149
|
}
|
|
148
150
|
}
|
|
151
|
+
|
|
149
152
|
`;
|
|
150
153
|
|
|
151
154
|
connectedCallback() {
|
|
@@ -382,16 +385,10 @@ export class RelOtp extends LitElement {
|
|
|
382
385
|
|
|
383
386
|
private handleFocus(e: FocusEvent) {
|
|
384
387
|
const input = e.currentTarget as HTMLInputElement;
|
|
385
|
-
const index = parseInt(input.dataset.index || "0", 10);
|
|
386
|
-
|
|
387
|
-
this.focusedIndex = index;
|
|
388
|
-
|
|
389
|
-
// Select all text on focus for easy replacement
|
|
390
388
|
input.select();
|
|
391
389
|
}
|
|
392
390
|
|
|
393
391
|
private handleBlur() {
|
|
394
|
-
this.focusedIndex = -1;
|
|
395
392
|
}
|
|
396
393
|
|
|
397
394
|
private focusCell(index: number) {
|
|
@@ -458,7 +455,7 @@ export class RelOtp extends LitElement {
|
|
|
458
455
|
data-index="${index}"
|
|
459
456
|
type="${this.mask ? "password" : "text"}"
|
|
460
457
|
inputmode="${this.getInputMode()}"
|
|
461
|
-
autocomplete="
|
|
458
|
+
autocomplete="new-password"
|
|
462
459
|
pattern="${this.pattern || ""}"
|
|
463
460
|
placeholder="${this.placeholder}"
|
|
464
461
|
maxlength="1"
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { LitElement, html, css } from "lit";
|
|
2
2
|
import { customElement, property, state } from "lit/decorators.js";
|
|
3
|
+
import "../../styles/vars-v2.css";
|
|
3
4
|
|
|
4
5
|
type DensityType = "comfortable" | "compact";
|
|
5
6
|
type VariantType = "default" | "icons";
|
|
6
|
-
type PageItem =
|
|
7
|
+
type PageItem =
|
|
8
|
+
| { type: "page"; value: number }
|
|
9
|
+
| { type: "ellipsis" }
|
|
10
|
+
| { type: "spacer" }
|
|
11
|
+
| { type: "prev" }
|
|
12
|
+
| { type: "next" };
|
|
7
13
|
|
|
8
14
|
@customElement("rel-pagination")
|
|
9
15
|
export class RelPagination extends LitElement {
|
|
@@ -30,6 +36,7 @@ export class RelPagination extends LitElement {
|
|
|
30
36
|
display: flex;
|
|
31
37
|
align-items: center;
|
|
32
38
|
gap: var(--rel-spacing-space-2xs);
|
|
39
|
+
min-width: max-content;
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
nav.compact {
|
|
@@ -41,35 +48,47 @@ export class RelPagination extends LitElement {
|
|
|
41
48
|
display: inline-flex;
|
|
42
49
|
align-items: center;
|
|
43
50
|
justify-content: center;
|
|
44
|
-
|
|
51
|
+
width: 40px;
|
|
45
52
|
height: 40px;
|
|
46
|
-
padding: 0
|
|
53
|
+
padding: 0;
|
|
47
54
|
font-family: var(--rel-fontFamilies-primary);
|
|
48
55
|
font-size: var(--rel-fontSizes-sm);
|
|
49
56
|
font-weight: var(--rel-fontWeights-medium);
|
|
50
|
-
color: var(--rel-
|
|
51
|
-
background: var(--rel-
|
|
52
|
-
border: var(--rel-borders-width-stroke-100) solid var(--rel-
|
|
57
|
+
color: var(--rel-color-text-heading);
|
|
58
|
+
background: var(--rel-color-bg-primary);
|
|
59
|
+
border: var(--rel-borders-width-stroke-100) solid var(--rel-color-border-default);
|
|
53
60
|
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
54
61
|
cursor: pointer;
|
|
55
|
-
transition:
|
|
62
|
+
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
|
|
56
63
|
text-decoration: none;
|
|
57
64
|
outline: none;
|
|
58
65
|
user-select: none;
|
|
59
66
|
}
|
|
60
67
|
|
|
68
|
+
button.prev-btn, button.next-btn,
|
|
69
|
+
a.prev-btn, a.next-btn {
|
|
70
|
+
width: auto;
|
|
71
|
+
padding: 0 var(--rel-spacing-space-sm);
|
|
72
|
+
}
|
|
73
|
+
|
|
61
74
|
nav.compact button,
|
|
62
75
|
nav.compact a {
|
|
63
|
-
|
|
76
|
+
width: 32px;
|
|
64
77
|
height: 32px;
|
|
65
|
-
padding: 0
|
|
78
|
+
padding: 0;
|
|
66
79
|
font-size: var(--rel-fontSizes-xs);
|
|
67
80
|
}
|
|
68
81
|
|
|
82
|
+
nav.compact button.prev-btn, nav.compact button.next-btn,
|
|
83
|
+
nav.compact a.prev-btn, nav.compact a.next-btn {
|
|
84
|
+
width: auto;
|
|
85
|
+
padding: 0 var(--rel-spacing-space-xs);
|
|
86
|
+
}
|
|
87
|
+
|
|
69
88
|
button:hover:not(:disabled),
|
|
70
89
|
a:hover:not([aria-disabled="true"]) {
|
|
71
|
-
background: var(--rel-
|
|
72
|
-
border-color: var(--rel-
|
|
90
|
+
background: var(--rel-color-bg-secondary);
|
|
91
|
+
border-color: var(--rel-color-text-primary);
|
|
73
92
|
}
|
|
74
93
|
|
|
75
94
|
button:focus-visible,
|
|
@@ -82,40 +101,50 @@ export class RelPagination extends LitElement {
|
|
|
82
101
|
a[aria-disabled="true"] {
|
|
83
102
|
opacity: 0.5;
|
|
84
103
|
cursor: not-allowed;
|
|
85
|
-
pointer-events: none;
|
|
86
104
|
}
|
|
87
105
|
|
|
88
106
|
button[aria-current="page"],
|
|
89
107
|
a[aria-current="page"] {
|
|
90
108
|
background: var(--rel-color-bg-selected);
|
|
91
109
|
color: var(--rel-color-text-primary);
|
|
92
|
-
border-color: var(--rel-
|
|
110
|
+
border-color: var(--rel-color-text-heading);
|
|
93
111
|
font-weight: var(--rel-fontWeights-semibold);
|
|
94
112
|
}
|
|
95
113
|
|
|
96
114
|
button[aria-current="page"]:hover,
|
|
97
115
|
a[aria-current="page"]:hover {
|
|
98
|
-
background: var(--rel-
|
|
99
|
-
border-color: var(--rel-
|
|
116
|
+
background: var(--rel-color-bg-selected);
|
|
117
|
+
border-color: var(--rel-color-text-heading);
|
|
100
118
|
}
|
|
101
119
|
|
|
102
120
|
.ellipsis {
|
|
103
121
|
display: inline-flex;
|
|
104
122
|
align-items: center;
|
|
105
123
|
justify-content: center;
|
|
106
|
-
|
|
124
|
+
width: 40px;
|
|
107
125
|
height: 40px;
|
|
108
|
-
color: var(--rel-
|
|
126
|
+
color: var(--rel-color-text-placeholder);
|
|
109
127
|
font-size: var(--rel-fontSizes-sm);
|
|
110
128
|
user-select: none;
|
|
111
129
|
}
|
|
112
130
|
|
|
113
131
|
nav.compact .ellipsis {
|
|
114
|
-
|
|
132
|
+
width: 32px;
|
|
115
133
|
height: 32px;
|
|
116
134
|
font-size: var(--rel-fontSizes-xs);
|
|
117
135
|
}
|
|
118
136
|
|
|
137
|
+
.pagination-spacer {
|
|
138
|
+
display: inline-flex;
|
|
139
|
+
width: 40px;
|
|
140
|
+
height: 40px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
nav.compact .pagination-spacer {
|
|
144
|
+
width: 32px;
|
|
145
|
+
height: 32px;
|
|
146
|
+
}
|
|
147
|
+
|
|
119
148
|
.icon {
|
|
120
149
|
width: 16px;
|
|
121
150
|
height: 16px;
|
|
@@ -127,6 +156,10 @@ export class RelPagination extends LitElement {
|
|
|
127
156
|
height: 14px;
|
|
128
157
|
}
|
|
129
158
|
|
|
159
|
+
:host([disabled]) {
|
|
160
|
+
cursor: not-allowed;
|
|
161
|
+
}
|
|
162
|
+
|
|
130
163
|
:host([disabled]) nav {
|
|
131
164
|
opacity: 0.5;
|
|
132
165
|
pointer-events: none;
|
|
@@ -135,6 +168,19 @@ export class RelPagination extends LitElement {
|
|
|
135
168
|
|
|
136
169
|
connectedCallback() {
|
|
137
170
|
super.connectedCallback();
|
|
171
|
+
// Manually parse numeric attributes in case they were set before upgrade
|
|
172
|
+
const totalPagesAttr = this.getAttribute('total-pages');
|
|
173
|
+
if (totalPagesAttr) {
|
|
174
|
+
this.totalPages = Number(totalPagesAttr);
|
|
175
|
+
}
|
|
176
|
+
const pageAttr = this.getAttribute('page');
|
|
177
|
+
if (pageAttr) {
|
|
178
|
+
this.page = Number(pageAttr);
|
|
179
|
+
}
|
|
180
|
+
const defaultPageAttr = this.getAttribute('default-page');
|
|
181
|
+
if (defaultPageAttr) {
|
|
182
|
+
this.defaultPage = Number(defaultPageAttr);
|
|
183
|
+
}
|
|
138
184
|
this.currentPage = this.page ?? this.defaultPage;
|
|
139
185
|
}
|
|
140
186
|
|
|
@@ -153,49 +199,39 @@ export class RelPagination extends LitElement {
|
|
|
153
199
|
const items: PageItem[] = [];
|
|
154
200
|
const current = this.activePage;
|
|
155
201
|
const total = this.totalPages;
|
|
156
|
-
|
|
157
|
-
|
|
202
|
+
|
|
203
|
+
if (total <= 0) return items;
|
|
158
204
|
|
|
159
205
|
items.push({ type: "prev" });
|
|
160
206
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
{
|
|
175
|
-
(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
// Combine all visible pages
|
|
179
|
-
const visiblePages = new Set([
|
|
180
|
-
...leftBoundary,
|
|
181
|
-
...leftSiblings,
|
|
182
|
-
current,
|
|
183
|
-
...rightSiblings,
|
|
184
|
-
...rightBoundary,
|
|
185
|
-
]);
|
|
186
|
-
|
|
187
|
-
const sortedPages = Array.from(visiblePages).sort((a, b) => a - b);
|
|
188
|
-
|
|
189
|
-
// Build items with ellipsis
|
|
190
|
-
sortedPages.forEach((page, index) => {
|
|
191
|
-
if (index > 0) {
|
|
192
|
-
const prevPage = sortedPages[index - 1];
|
|
193
|
-
if (page - prevPage > 1) {
|
|
194
|
-
items.push({ type: "ellipsis" });
|
|
195
|
-
}
|
|
207
|
+
if (total <= 7) {
|
|
208
|
+
for (let i = 1; i <= total; i++) {
|
|
209
|
+
items.push({ type: "page", value: i });
|
|
210
|
+
}
|
|
211
|
+
} else if (current <= 4) {
|
|
212
|
+
// Near start: [1, 2, 3, 4, 5] [ellipsis] [last]
|
|
213
|
+
for (let i = 1; i <= 5; i++) {
|
|
214
|
+
items.push({ type: "page", value: i });
|
|
215
|
+
}
|
|
216
|
+
items.push({ type: "ellipsis" });
|
|
217
|
+
items.push({ type: "page", value: total });
|
|
218
|
+
} else if (current >= total - 3) {
|
|
219
|
+
// Near end: [1] [ellipsis] [last-4, last-3, last-2, last-1, last]
|
|
220
|
+
items.push({ type: "page", value: 1 });
|
|
221
|
+
items.push({ type: "ellipsis" });
|
|
222
|
+
for (let i = total - 4; i <= total; i++) {
|
|
223
|
+
items.push({ type: "page", value: i });
|
|
196
224
|
}
|
|
197
|
-
|
|
198
|
-
|
|
225
|
+
} else {
|
|
226
|
+
// Middle: [1] [ellipsis] [current-1, current, current+1] [ellipsis] [last]
|
|
227
|
+
items.push({ type: "page", value: 1 });
|
|
228
|
+
items.push({ type: "ellipsis" });
|
|
229
|
+
items.push({ type: "page", value: current - 1 });
|
|
230
|
+
items.push({ type: "page", value: current });
|
|
231
|
+
items.push({ type: "page", value: current + 1 });
|
|
232
|
+
items.push({ type: "ellipsis" });
|
|
233
|
+
items.push({ type: "page", value: total });
|
|
234
|
+
}
|
|
199
235
|
|
|
200
236
|
items.push({ type: "next" });
|
|
201
237
|
|
|
@@ -254,6 +290,10 @@ export class RelPagination extends LitElement {
|
|
|
254
290
|
const current = this.activePage;
|
|
255
291
|
const useLinks = !!this.hrefTemplate;
|
|
256
292
|
|
|
293
|
+
if (item.type === "spacer") {
|
|
294
|
+
return html`<span class="pagination-spacer"></span>`;
|
|
295
|
+
}
|
|
296
|
+
|
|
257
297
|
if (item.type === "ellipsis") {
|
|
258
298
|
return html`<span class="ellipsis">…</span>`;
|
|
259
299
|
}
|
|
@@ -267,6 +307,7 @@ export class RelPagination extends LitElement {
|
|
|
267
307
|
return html`
|
|
268
308
|
<a
|
|
269
309
|
href="${href}"
|
|
310
|
+
class="prev-btn"
|
|
270
311
|
aria-label="Go to previous page"
|
|
271
312
|
aria-disabled="${disabled}"
|
|
272
313
|
@click="${(e: Event) => {
|
|
@@ -286,6 +327,7 @@ export class RelPagination extends LitElement {
|
|
|
286
327
|
return html`
|
|
287
328
|
<button
|
|
288
329
|
type="button"
|
|
330
|
+
class="prev-btn"
|
|
289
331
|
aria-label="Go to previous page"
|
|
290
332
|
?disabled="${disabled}"
|
|
291
333
|
@click="${() => this.handlePageChange(targetPage)}"
|
|
@@ -304,6 +346,7 @@ export class RelPagination extends LitElement {
|
|
|
304
346
|
return html`
|
|
305
347
|
<a
|
|
306
348
|
href="${href}"
|
|
349
|
+
class="next-btn"
|
|
307
350
|
aria-label="Go to next page"
|
|
308
351
|
aria-disabled="${disabled}"
|
|
309
352
|
@click="${(e: Event) => {
|
|
@@ -323,6 +366,7 @@ export class RelPagination extends LitElement {
|
|
|
323
366
|
return html`
|
|
324
367
|
<button
|
|
325
368
|
type="button"
|
|
369
|
+
class="next-btn"
|
|
326
370
|
aria-label="Go to next page"
|
|
327
371
|
?disabled="${disabled}"
|
|
328
372
|
@click="${() => this.handlePageChange(targetPage)}"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, css } from "lit";
|
|
2
2
|
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import "../../styles/vars-v2.css";
|
|
3
4
|
|
|
4
5
|
@customElement("rel-popover-content")
|
|
5
6
|
export class RelPopoverContent extends LitElement {
|
|
@@ -13,14 +14,14 @@ export class RelPopoverContent extends LitElement {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
.popover-content {
|
|
16
|
-
background: var(--rel-
|
|
17
|
-
border: var(--rel-borders-width-stroke-100) solid var(--rel-
|
|
17
|
+
background: var(--rel-color-bg-primary);
|
|
18
|
+
border: var(--rel-borders-width-stroke-100) solid var(--rel-color-border-default);
|
|
18
19
|
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
19
20
|
box-shadow: var(--rel-shadows-shadow-300);
|
|
20
21
|
padding: var(--rel-spacing-space-md);
|
|
21
22
|
font-family: var(--rel-fontFamilies-primary);
|
|
22
23
|
font-size: var(--rel-fontSizes-sm);
|
|
23
|
-
color: var(--rel-
|
|
24
|
+
color: var(--rel-color-text-heading);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
.popover-content ::slotted(h1),
|
|
@@ -31,12 +32,12 @@ export class RelPopoverContent extends LitElement {
|
|
|
31
32
|
.popover-content ::slotted(h6) {
|
|
32
33
|
margin: 0 0 var(--rel-spacing-space-xs);
|
|
33
34
|
font-weight: var(--rel-fontWeights-semibold);
|
|
34
|
-
color: var(--rel-
|
|
35
|
+
color: var(--rel-color-text-heading);
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
.popover-content ::slotted(p) {
|
|
38
39
|
margin: 0 0 var(--rel-spacing-space-sm);
|
|
39
|
-
color: var(--rel-
|
|
40
|
+
color: var(--rel-color-text-placeholder);
|
|
40
41
|
line-height: var(--rel-lineHeights-md);
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, css } from "lit";
|
|
2
2
|
import { customElement, property, state, query } from "lit/decorators.js";
|
|
3
|
+
import "../../styles/vars-v2.css";
|
|
3
4
|
|
|
4
5
|
type SideType = "top" | "right" | "bottom" | "left";
|
|
5
6
|
type AlignType = "start" | "center" | "end";
|
|
@@ -48,8 +49,12 @@ export class RelPopover extends LitElement {
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
:host([disabled]) {
|
|
51
|
-
pointer-events: none;
|
|
52
52
|
opacity: 0.6;
|
|
53
|
+
cursor: not-allowed;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([disabled]) * {
|
|
57
|
+
pointer-events: none;
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
.content-wrapper {
|
|
@@ -233,7 +238,8 @@ export class RelPopover extends LitElement {
|
|
|
233
238
|
}
|
|
234
239
|
|
|
235
240
|
private restoreFocus() {
|
|
236
|
-
this.triggerEl?.focus();
|
|
241
|
+
(this.returnFocusEl ?? this.triggerEl)?.focus();
|
|
242
|
+
this.returnFocusEl = null;
|
|
237
243
|
}
|
|
238
244
|
|
|
239
245
|
private trapFocusLoop(e: KeyboardEvent) {
|
|
@@ -272,12 +278,25 @@ export class RelPopover extends LitElement {
|
|
|
272
278
|
const t = this.triggerEl.getBoundingClientRect();
|
|
273
279
|
const c = this.contentWrapper.getBoundingClientRect();
|
|
274
280
|
|
|
275
|
-
let top =
|
|
276
|
-
let left =
|
|
281
|
+
let top = 0;
|
|
282
|
+
let left = 0;
|
|
277
283
|
|
|
278
|
-
if (this.side === "top")
|
|
279
|
-
|
|
280
|
-
|
|
284
|
+
if (this.side === "top") {
|
|
285
|
+
top = t.top - c.height - this.sideOffset;
|
|
286
|
+
left = t.left + t.width / 2 - c.width / 2;
|
|
287
|
+
}
|
|
288
|
+
if (this.side === "bottom") {
|
|
289
|
+
top = t.bottom + this.sideOffset;
|
|
290
|
+
left = t.left + t.width / 2 - c.width / 2;
|
|
291
|
+
}
|
|
292
|
+
if (this.side === "left") {
|
|
293
|
+
top = t.top + t.height / 2 - c.height / 2;
|
|
294
|
+
left = t.left - c.width - this.sideOffset;
|
|
295
|
+
}
|
|
296
|
+
if (this.side === "right") {
|
|
297
|
+
top = t.top + t.height / 2 - c.height / 2;
|
|
298
|
+
left = t.right + this.sideOffset;
|
|
299
|
+
}
|
|
281
300
|
|
|
282
301
|
top = Math.max(8, Math.min(top, window.innerHeight - c.height - 8));
|
|
283
302
|
left = Math.max(8, Math.min(left, window.innerWidth - c.width - 8));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, css } from "lit";
|
|
2
2
|
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import "../../styles/vars-v2.css";
|
|
3
4
|
|
|
4
5
|
export type ProgressMode =
|
|
5
6
|
| "linear-determinate"
|
|
@@ -21,7 +22,7 @@ export class RelProgress extends LitElement {
|
|
|
21
22
|
static styles = css`
|
|
22
23
|
:host {
|
|
23
24
|
display: block;
|
|
24
|
-
font-family: var(--rel-fontFamilies-primary
|
|
25
|
+
font-family: var(--rel-fontFamilies-primary);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
:host([mode*="circular"]) {
|
|
@@ -30,15 +31,15 @@ export class RelProgress extends LitElement {
|
|
|
30
31
|
|
|
31
32
|
/* Linear */
|
|
32
33
|
.linear-track {
|
|
33
|
-
background: var(--rel-
|
|
34
|
-
border-radius: var(--rel-borders-radius-border-radius-
|
|
34
|
+
background: var(--rel-color-border-default);
|
|
35
|
+
border-radius: var(--rel-borders-radius-border-radius-0);
|
|
35
36
|
height: 6px;
|
|
36
37
|
overflow: hidden;
|
|
37
38
|
width: 100%;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
.linear-bar {
|
|
41
|
-
background: var(--rel-
|
|
42
|
+
background: var(--rel-color-text-primary);
|
|
42
43
|
height: 100%;
|
|
43
44
|
transition: width 0.3s ease;
|
|
44
45
|
}
|
|
@@ -75,15 +76,15 @@ export class RelProgress extends LitElement {
|
|
|
75
76
|
|
|
76
77
|
.circular-bg {
|
|
77
78
|
fill: none;
|
|
78
|
-
stroke: var(--rel-
|
|
79
|
+
stroke: var(--rel-color-border-default);
|
|
79
80
|
stroke-width: 3;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
.circular-progress {
|
|
83
84
|
fill: none;
|
|
84
|
-
stroke: var(--rel-
|
|
85
|
+
stroke: var(--rel-color-text-primary);
|
|
85
86
|
stroke-width: 3;
|
|
86
|
-
stroke-linecap:
|
|
87
|
+
stroke-linecap: butt;
|
|
87
88
|
transition: stroke-dashoffset 0.35s;
|
|
88
89
|
}
|
|
89
90
|
|
|
@@ -93,8 +94,8 @@ export class RelProgress extends LitElement {
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
.spinner-path {
|
|
96
|
-
stroke: var(--rel-
|
|
97
|
-
stroke-linecap:
|
|
97
|
+
stroke: var(--rel-color-text-primary);
|
|
98
|
+
stroke-linecap: butt;
|
|
98
99
|
animation: dash 1.5s ease-in-out infinite;
|
|
99
100
|
}
|
|
100
101
|
|