@reliability-design/web 1.0.6 → 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 +20 -31
- package/dist/components/rel-alert/rel-alert.ts +81 -11
- package/dist/components/rel-avatar/rel-avatar.ts +6 -3
- package/dist/components/rel-badge/rel-badge.ts +8 -3
- package/dist/components/rel-breadcrumb/rel-breadcrumb.ts +6 -6
- package/dist/components/rel-button/rel-button.ts +118 -16
- package/dist/components/rel-calendar/rel-calendar.ts +16 -9
- 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 -469
- package/dist/components/rel-checkbox/rel-checkbox.ts +98 -15
- package/dist/components/rel-chip/rel-chip.ts +291 -186
- 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 +12 -3
- package/dist/components/rel-drawer/rel-drawer-footer.ts +27 -0
- package/dist/components/rel-drawer/rel-drawer.ts +57 -113
- 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 -327
- 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 -576
- package/dist/components/rel-nav-menu/rel-nav-menu-item.ts +240 -143
- package/dist/components/rel-nav-menu/rel-nav-menu.ts +227 -331
- package/dist/components/rel-navbar/rel-navbar.ts +13 -0
- package/dist/components/rel-otp/rel-otp.ts +22 -25
- package/dist/components/rel-pagination/rel-pagination.ts +112 -63
- package/dist/components/rel-popover/rel-popover-content.ts +6 -5
- package/dist/components/rel-popover/rel-popover.ts +42 -20
- package/dist/components/rel-progress/rel-progress.ts +10 -9
- package/dist/components/rel-radio/rel-radio.ts +228 -155
- 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 +12 -15
- package/dist/components/rel-segmented-button/rel-segmented-button.ts +41 -20
- package/dist/components/rel-select/rel-select.ts +112 -27
- package/dist/components/rel-sheet/rel-sheet.ts +362 -683
- package/dist/components/rel-sidebar/rel-sidebar.ts +13 -5
- package/dist/components/rel-slider/rel-slider.ts +74 -29
- package/dist/components/rel-snackbar/rel-snackbar.ts +67 -37
- package/dist/components/rel-stepper/rel-stepper.ts +43 -31
- package/dist/components/rel-switch/rel-switch.ts +26 -12
- package/dist/components/rel-tab/rel-tab.ts +57 -37
- package/dist/components/rel-table/rel-table-body.ts +5 -0
- package/dist/components/rel-table/rel-table-caption.ts +6 -1
- package/dist/components/rel-table/rel-table-cell.ts +42 -49
- package/dist/components/rel-table/rel-table-footer.ts +5 -0
- package/dist/components/rel-table/rel-table-head.ts +13 -1
- package/dist/components/rel-table/rel-table-header.ts +5 -0
- package/dist/components/rel-table/rel-table-row.ts +7 -3
- package/dist/components/rel-table/rel-table.ts +8 -2
- package/dist/components/rel-textfield/rel-textfield.ts +153 -44
- package/dist/components/rel-toast/rel-toast.ts +56 -22
- package/dist/components/rel-tooltip/rel-tooltip.ts +52 -9
- package/dist/components/rel-topbar/rel-topbar-actions.ts +24 -0
- package/dist/components/rel-topbar/rel-topbar-brand.ts +47 -0
- package/dist/components/rel-topbar/rel-topbar-dropdown-item.ts +63 -0
- package/dist/components/rel-topbar/rel-topbar-dropdown.ts +28 -0
- package/dist/components/rel-topbar/rel-topbar-item.ts +320 -0
- package/dist/components/rel-topbar/rel-topbar-mobile-panel.ts +24 -0
- package/dist/components/rel-topbar/rel-topbar-profile.ts +222 -0
- package/dist/components/rel-topbar/rel-topbar-utilities.ts +24 -0
- package/dist/components/rel-topbar/rel-topbar.ts +438 -0
- package/dist/index.d.mts +375 -411
- package/dist/index.d.ts +375 -411
- package/dist/index.js +7587 -7980
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7647 -8023
- 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 +79 -27
- package/dist/{vars-ITL2K3KO.css → vars-I2PC74XD.css} +79 -27
- package/dist/vars-v2-VMGWTFJZ.css +525 -0
- package/package.json +3 -1
- package/dist/components/rel-quote-page/README.md +0 -166
- package/dist/components/rel-quote-page/rel-quote-page.ts +0 -816
|
@@ -1,26 +1,23 @@
|
|
|
1
|
+
import "../../styles/vars-v2.css";
|
|
1
2
|
import { LitElement, html, css } from "lit";
|
|
2
3
|
import { customElement, property } from "lit/decorators.js";
|
|
3
|
-
|
|
4
4
|
@customElement("rel-accordion")
|
|
5
5
|
export class RelAccordion extends LitElement {
|
|
6
6
|
@property({ type: String }) title = "Accordion";
|
|
7
7
|
@property({ type: Boolean, reflect: true }) open = false;
|
|
8
|
-
|
|
9
8
|
static styles = css`
|
|
10
9
|
:host {
|
|
11
10
|
display: block;
|
|
12
11
|
width: 100%;
|
|
13
12
|
font-family: var(--rel-fontFamilies-primary, sans-serif);
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
.accordion {
|
|
17
|
-
background: var(--rel-
|
|
18
|
-
border:
|
|
19
|
-
border-
|
|
20
|
-
|
|
15
|
+
background: var(--rel-color-bg-primary);
|
|
16
|
+
border: none;
|
|
17
|
+
border-bottom: 1px solid var(--rel-gray-text-placeholder);
|
|
18
|
+
border-radius: 0;
|
|
21
19
|
overflow: hidden;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
/* HEADER --------------------------------------------------- */
|
|
25
22
|
.header {
|
|
26
23
|
display: flex;
|
|
@@ -29,24 +26,23 @@ export class RelAccordion extends LitElement {
|
|
|
29
26
|
padding: var(--rel-spacing-space-md, 16px);
|
|
30
27
|
cursor: pointer;
|
|
31
28
|
user-select: none;
|
|
32
|
-
border-radius:
|
|
29
|
+
border-radius: 0;
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
.header:hover {
|
|
36
32
|
background: var(--rel-surface-surface, #f5f5f5);
|
|
37
33
|
}
|
|
38
|
-
|
|
34
|
+
:host([open]) .header:hover {
|
|
35
|
+
background: transparent;
|
|
36
|
+
}
|
|
39
37
|
.header:focus-visible {
|
|
40
|
-
outline: 2px solid var(--rel-border-
|
|
38
|
+
outline: 2px solid var(--rel-color-border-focus);
|
|
41
39
|
outline-offset: -2px;
|
|
42
40
|
}
|
|
43
|
-
|
|
44
41
|
.title {
|
|
45
42
|
font-size: var(--rel-fontSizes-lg, 20px);
|
|
46
43
|
font-weight: var(--rel-fontWeights-medium, 500);
|
|
47
44
|
color: var(--rel-text-heading, #2b2b2b);
|
|
48
45
|
}
|
|
49
|
-
|
|
50
46
|
/* ICON ----------------------------------------------------- */
|
|
51
47
|
.icon {
|
|
52
48
|
width: 20px;
|
|
@@ -56,7 +52,6 @@ export class RelAccordion extends LitElement {
|
|
|
56
52
|
justify-content: center;
|
|
57
53
|
transition: transform 0.25s ease;
|
|
58
54
|
}
|
|
59
|
-
|
|
60
55
|
.icon svg {
|
|
61
56
|
width: 20px;
|
|
62
57
|
height: 20px;
|
|
@@ -66,11 +61,9 @@ export class RelAccordion extends LitElement {
|
|
|
66
61
|
stroke-linecap: round;
|
|
67
62
|
stroke-linejoin: round;
|
|
68
63
|
}
|
|
69
|
-
|
|
70
64
|
.icon.rotated {
|
|
71
65
|
transform: rotate(180deg);
|
|
72
66
|
}
|
|
73
|
-
|
|
74
67
|
/* BODY ------------------------------------------------------ */
|
|
75
68
|
.body {
|
|
76
69
|
overflow: hidden;
|
|
@@ -78,15 +71,15 @@ export class RelAccordion extends LitElement {
|
|
|
78
71
|
padding: 0 var(--rel-spacing-space-md, 16px);
|
|
79
72
|
font-size: var(--rel-fontSizes-md, 14px);
|
|
80
73
|
color: var(--rel-text-primary, #333);
|
|
81
|
-
transition:
|
|
74
|
+
transition:
|
|
75
|
+
max-height 0.25s ease,
|
|
76
|
+
padding 0.2s ease;
|
|
82
77
|
}
|
|
83
|
-
|
|
84
78
|
.body.open {
|
|
85
79
|
max-height: 1000px;
|
|
86
|
-
padding: var(--rel-spacing-space-xl, 24px)
|
|
87
|
-
var(--rel-spacing-space-lg, 20px);
|
|
80
|
+
padding: var(--rel-spacing-space-xl, 24px)
|
|
81
|
+
var(--rel-spacing-space-md, 16px) var(--rel-spacing-space-lg, 20px);
|
|
88
82
|
}
|
|
89
|
-
|
|
90
83
|
@media (prefers-reduced-motion: reduce) {
|
|
91
84
|
.icon,
|
|
92
85
|
.body {
|
|
@@ -94,19 +87,16 @@ export class RelAccordion extends LitElement {
|
|
|
94
87
|
}
|
|
95
88
|
}
|
|
96
89
|
`;
|
|
97
|
-
|
|
98
90
|
private toggle() {
|
|
99
91
|
this.open = !this.open;
|
|
100
|
-
|
|
101
92
|
this.dispatchEvent(
|
|
102
93
|
new CustomEvent<boolean>("open-change", {
|
|
103
94
|
detail: this.open,
|
|
104
95
|
bubbles: true,
|
|
105
96
|
composed: true,
|
|
106
|
-
})
|
|
97
|
+
}),
|
|
107
98
|
);
|
|
108
99
|
}
|
|
109
|
-
|
|
110
100
|
private chevron() {
|
|
111
101
|
return html`
|
|
112
102
|
<svg viewBox="0 0 24 24">
|
|
@@ -114,11 +104,11 @@ export class RelAccordion extends LitElement {
|
|
|
114
104
|
</svg>
|
|
115
105
|
`;
|
|
116
106
|
}
|
|
117
|
-
|
|
118
107
|
render() {
|
|
119
108
|
return html`
|
|
120
109
|
<div class="accordion">
|
|
121
|
-
<div
|
|
110
|
+
<div
|
|
111
|
+
class="header"
|
|
122
112
|
role="button"
|
|
123
113
|
tabindex="0"
|
|
124
114
|
aria-expanded="${this.open}"
|
|
@@ -128,14 +118,13 @@ export class RelAccordion extends LitElement {
|
|
|
128
118
|
e.preventDefault();
|
|
129
119
|
this.toggle();
|
|
130
120
|
}
|
|
131
|
-
}}
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
132
123
|
<div class="title">${this.title}</div>
|
|
133
|
-
|
|
134
124
|
<div class="icon ${this.open ? "rotated" : ""}">
|
|
135
125
|
${this.chevron()}
|
|
136
126
|
</div>
|
|
137
127
|
</div>
|
|
138
|
-
|
|
139
128
|
<!-- IMPORTANT: slot is ALWAYS rendered -->
|
|
140
129
|
<div class="body ${this.open ? "open" : ""}">
|
|
141
130
|
<slot></slot>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../../styles/vars-v2.css";
|
|
1
2
|
import { LitElement, html, css } from "lit";
|
|
2
3
|
import { customElement, property } from "lit/decorators.js";
|
|
3
4
|
|
|
@@ -89,31 +90,100 @@ export class RelAlert extends LitElement {
|
|
|
89
90
|
opacity: 1;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
/* COLORS */
|
|
93
|
+
/* COLORS — light mode */
|
|
94
|
+
.alert-neutral {
|
|
95
|
+
background: var(--rel-color-bg-primary);
|
|
96
|
+
color: var(--rel-color-text-primary);
|
|
97
|
+
}
|
|
98
|
+
|
|
93
99
|
.alert-info {
|
|
94
100
|
background: var(--rel-background-info);
|
|
95
|
-
color: var(--rel-text-
|
|
101
|
+
color: var(--rel-color-text-primary);
|
|
102
|
+
--rel-icon-info: var(--rel-colors-blue-tertiary);
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
.alert-success {
|
|
99
106
|
background: var(--rel-background-success);
|
|
100
|
-
color: var(--rel-text-
|
|
107
|
+
color: var(--rel-color-text-primary);
|
|
108
|
+
--rel-icon-success: var(--rel-success-surface-dark);
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
.alert-warning {
|
|
104
|
-
background: var(--rel-
|
|
105
|
-
color: var(--rel-text-
|
|
112
|
+
background: var(--rel-colors-gold-light);
|
|
113
|
+
color: var(--rel-color-text-primary);
|
|
114
|
+
--rel-icon-warning: var(--rel-warning-surface-dark);
|
|
106
115
|
}
|
|
107
116
|
|
|
108
117
|
.alert-error {
|
|
109
|
-
background: var(--rel-background-error);
|
|
110
|
-
color: var(--rel-
|
|
118
|
+
background: var(--rel-background-error-light);
|
|
119
|
+
color: var(--rel-error-surface-dark);
|
|
120
|
+
--rel-icon-error: var(--rel-error-surface-dark);
|
|
111
121
|
}
|
|
112
122
|
|
|
113
|
-
.alert-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
123
|
+
.alert-error .rel-close {
|
|
124
|
+
color: var(--rel-color-text-primary);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* COLORS — dark mode */
|
|
128
|
+
:host-context([data-theme="dark"]) .rel-alert,
|
|
129
|
+
:host-context(.dark) .rel-alert {
|
|
130
|
+
background: var(--rel-color-bg-tertiary);
|
|
131
|
+
color: var(--rel-color-text-primary);
|
|
132
|
+
border: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:host-context([data-theme="dark"]) .rel-close,
|
|
136
|
+
:host-context(.dark) .rel-close {
|
|
137
|
+
color: var(--rel-color-text-primary);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:host-context([data-theme="dark"]) .alert-neutral,
|
|
141
|
+
:host-context(.dark) .alert-neutral {
|
|
142
|
+
border: 1px solid var(--rel-color-border-strong);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:host-context([data-theme="dark"]) .alert-info,
|
|
146
|
+
:host-context(.dark) .alert-info {
|
|
147
|
+
border: 1px solid var(--rel-colors-blue-tertiary);
|
|
148
|
+
--rel-icon-info: var(--rel-colors-blue-tertiary);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host-context([data-theme="dark"]) .alert-info .rel-message2,
|
|
152
|
+
:host-context(.dark) .alert-info .rel-message2 {
|
|
153
|
+
color: var(--rel-colors-blue-tertiary);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:host-context([data-theme="dark"]) .alert-warning,
|
|
157
|
+
:host-context(.dark) .alert-warning {
|
|
158
|
+
border: 1px solid var(--rel-warning-surface-dark);
|
|
159
|
+
--rel-icon-warning: var(--rel-warning-surface-dark);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
:host-context([data-theme="dark"]) .alert-warning .rel-message2,
|
|
163
|
+
:host-context(.dark) .alert-warning .rel-message2 {
|
|
164
|
+
color: var(--rel-warning-surface-dark);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:host-context([data-theme="dark"]) .alert-success,
|
|
168
|
+
:host-context(.dark) .alert-success {
|
|
169
|
+
border: 1px solid var(--rel-success-surface-dark);
|
|
170
|
+
--rel-icon-success: var(--rel-success-surface-dark);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:host-context([data-theme="dark"]) .alert-success .rel-message2,
|
|
174
|
+
:host-context(.dark) .alert-success .rel-message2 {
|
|
175
|
+
color: var(--rel-success-surface-dark);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:host-context([data-theme="dark"]) .alert-error,
|
|
179
|
+
:host-context(.dark) .alert-error {
|
|
180
|
+
border: 1px solid var(--rel-error-surface-dark);
|
|
181
|
+
--rel-icon-error: var(--rel-error-surface-dark);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:host-context([data-theme="dark"]) .alert-error .rel-message2,
|
|
185
|
+
:host-context(.dark) .alert-error .rel-message2 {
|
|
186
|
+
color: var(--rel-error-surface-dark);
|
|
117
187
|
}
|
|
118
188
|
`;
|
|
119
189
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../../styles/vars-v2.css";
|
|
1
2
|
import { LitElement, html, css } from "lit";
|
|
2
3
|
import { customElement, property } from "lit/decorators.js";
|
|
3
4
|
|
|
@@ -12,6 +13,7 @@ export class RelAvatar extends LitElement {
|
|
|
12
13
|
@property({ type: String }) src = "";
|
|
13
14
|
@property({ type: String }) text = "";
|
|
14
15
|
@property({ type: String }) alt = "Avatar";
|
|
16
|
+
@property({ type: String }) bg: string = "";
|
|
15
17
|
|
|
16
18
|
static styles = css`
|
|
17
19
|
:host {
|
|
@@ -26,8 +28,8 @@ export class RelAvatar extends LitElement {
|
|
|
26
28
|
border-radius: 50%;
|
|
27
29
|
overflow: hidden;
|
|
28
30
|
|
|
29
|
-
background-color: var(--rel-colors-gray-
|
|
30
|
-
color: var(--rel-
|
|
31
|
+
background-color: var(--rel-colors-gray-disabled-text);
|
|
32
|
+
color: var(--rel-avatar-color, #ffffff);
|
|
31
33
|
font-weight: var(--rel-fontWeights-bold);
|
|
32
34
|
|
|
33
35
|
user-select: none;
|
|
@@ -71,6 +73,7 @@ export class RelAvatar extends LitElement {
|
|
|
71
73
|
display: inline-flex;
|
|
72
74
|
align-items: center;
|
|
73
75
|
justify-content: center;
|
|
76
|
+
color: #ffffff;
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
.icon-slot ::slotted(svg) {
|
|
@@ -81,7 +84,7 @@ export class RelAvatar extends LitElement {
|
|
|
81
84
|
|
|
82
85
|
render() {
|
|
83
86
|
return html`
|
|
84
|
-
<div class="avatar avatar-${this.size}">
|
|
87
|
+
<div class="avatar avatar-${this.size}" style=${this.bg ? `background-color: ${this.bg}` : ""}>
|
|
85
88
|
${this.type === "image" && this.src
|
|
86
89
|
? html`<img src=${this.src} alt=${this.alt} />`
|
|
87
90
|
: this.type === "text"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../../styles/vars-v2.css";
|
|
1
2
|
import { LitElement, html, css } from "lit";
|
|
2
3
|
import { customElement, property } from "lit/decorators.js";
|
|
3
4
|
|
|
@@ -5,6 +6,10 @@ import { customElement, property } from "lit/decorators.js";
|
|
|
5
6
|
export class RelBadge extends LitElement {
|
|
6
7
|
@property({ type: String }) number = "";
|
|
7
8
|
|
|
9
|
+
@property({ type: String }) ariaLabel: string = "";
|
|
10
|
+
|
|
11
|
+
@property({ type: String }) suffix: string = "notifications";
|
|
12
|
+
|
|
8
13
|
@property({ type: String, reflect: true })
|
|
9
14
|
size: "sm" | "md" | "lg" = "md";
|
|
10
15
|
|
|
@@ -22,8 +27,8 @@ export class RelBadge extends LitElement {
|
|
|
22
27
|
justify-content: center;
|
|
23
28
|
font-family: var(--rel-fontFamilies-primary, sans-serif);
|
|
24
29
|
font-weight: var(--rel-fontWeights-semibold, 600);
|
|
25
|
-
background-color: var(--rel-
|
|
26
|
-
color:
|
|
30
|
+
background-color: var(--rel-error-surface-default);
|
|
31
|
+
color: #ffffff;
|
|
27
32
|
border-radius: 50%;
|
|
28
33
|
}
|
|
29
34
|
|
|
@@ -69,7 +74,7 @@ export class RelBadge extends LitElement {
|
|
|
69
74
|
|
|
70
75
|
render() {
|
|
71
76
|
return html`
|
|
72
|
-
<span class="${this.classes}">
|
|
77
|
+
<span class="${this.classes}" aria-label=${this.ariaLabel || `${this.number} ${this.suffix}`}>
|
|
73
78
|
${this.variant === "number" ? this.number : null}
|
|
74
79
|
</span>
|
|
75
80
|
`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../../styles/vars-v2.css";
|
|
1
2
|
import { LitElement, html, css } from "lit";
|
|
2
3
|
import { customElement, property } from "lit/decorators.js";
|
|
3
4
|
|
|
@@ -38,25 +39,24 @@ export class RelBreadcrumbs extends LitElement {
|
|
|
38
39
|
|
|
39
40
|
a {
|
|
40
41
|
text-decoration: none;
|
|
41
|
-
font-weight: var(--rel-fontWeights-
|
|
42
|
-
color: var(--rel-text-
|
|
43
|
-
transition: color 0.2s ease;
|
|
42
|
+
font-weight: var(--rel-fontWeights-regular);
|
|
43
|
+
color: var(--rel-color-text-primary);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
a:hover {
|
|
47
47
|
text-decoration: underline;
|
|
48
|
-
color: var(--rel-
|
|
48
|
+
color: var(--rel-color-text-primary);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
a:focus-visible {
|
|
52
|
-
outline: 2px solid var(--rel-
|
|
52
|
+
outline: 2px solid var(--rel-color-border-focus);
|
|
53
53
|
outline-offset: 2px;
|
|
54
54
|
border-radius: 2px;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.current {
|
|
58
58
|
font-weight: var(--rel-fontWeights-bold);
|
|
59
|
-
color: var(--rel-text-
|
|
59
|
+
color: var(--rel-color-text-primary);
|
|
60
60
|
cursor: default;
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import "../../styles/vars-v2.css";
|
|
1
2
|
import { LitElement, html, css } from "lit";
|
|
2
3
|
import { customElement, property } from "lit/decorators.js";
|
|
4
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
3
5
|
|
|
4
6
|
@customElement("rel-button")
|
|
5
7
|
export class RelButton extends LitElement {
|
|
@@ -8,7 +10,7 @@ export class RelButton extends LitElement {
|
|
|
8
10
|
"default";
|
|
9
11
|
|
|
10
12
|
@property({ type: String })
|
|
11
|
-
tone: "default" | "critical" | "success" = "default";
|
|
13
|
+
tone: "default" | "primary" | "secondary" | "critical" | "success" = "default";
|
|
12
14
|
|
|
13
15
|
@property({ type: String })
|
|
14
16
|
size: "small" | "medium" | "large" = "medium";
|
|
@@ -19,6 +21,8 @@ export class RelButton extends LitElement {
|
|
|
19
21
|
|
|
20
22
|
@property({ type: Boolean, reflect: true }) disabled = false;
|
|
21
23
|
|
|
24
|
+
@property({ type: String, attribute: "aria-label" }) ariaLabel: string | null = null;
|
|
25
|
+
|
|
22
26
|
static styles = css`
|
|
23
27
|
:host {
|
|
24
28
|
display: inline-flex;
|
|
@@ -70,11 +74,23 @@ export class RelButton extends LitElement {
|
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
/* Disabled */
|
|
77
|
+
:host([disabled]) {
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
}
|
|
80
|
+
|
|
73
81
|
:host([disabled]) button {
|
|
74
82
|
cursor: not-allowed;
|
|
75
|
-
background-color: var(--rel-
|
|
76
|
-
color: var(--rel-
|
|
83
|
+
background-color: var(--rel-color-bg-tertiary) !important;
|
|
84
|
+
color: var(--rel-color-text-disabled) !important;
|
|
85
|
+
border: none !important;
|
|
77
86
|
pointer-events: none;
|
|
87
|
+
filter: none !important;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([disabled]):host-context([data-theme="dark"]) button,
|
|
91
|
+
:host([disabled]):host-context(.dark) button {
|
|
92
|
+
background-color: var(--rel-color-bg-tertiary) !important;
|
|
93
|
+
color: var(--rel-color-text-disabled) !important;
|
|
78
94
|
}
|
|
79
95
|
|
|
80
96
|
/* Variants & tones (unchanged) */
|
|
@@ -83,30 +99,30 @@ export class RelButton extends LitElement {
|
|
|
83
99
|
color: var(--rel-colors-white);
|
|
84
100
|
}
|
|
85
101
|
.btn-default.tone-critical {
|
|
86
|
-
background: var(--rel-
|
|
87
|
-
color:
|
|
102
|
+
background: var(--rel-error-surface-default);
|
|
103
|
+
color: #ffffff;
|
|
88
104
|
}
|
|
89
105
|
.btn-default.tone-success {
|
|
90
|
-
background: var(--rel-colors-green-
|
|
91
|
-
color:
|
|
106
|
+
background: var(--rel-colors-green-tertiary);
|
|
107
|
+
color: #ffffff;
|
|
92
108
|
}
|
|
93
109
|
|
|
94
110
|
.btn-primary.tone-default {
|
|
95
111
|
background: var(--rel-colors-green-primary);
|
|
96
|
-
color:
|
|
112
|
+
color: #000000;
|
|
97
113
|
}
|
|
98
114
|
.btn-primary.tone-critical {
|
|
99
|
-
background: var(--rel-
|
|
100
|
-
color:
|
|
115
|
+
background: var(--rel-error-surface-default);
|
|
116
|
+
color: #ffffff;
|
|
101
117
|
}
|
|
102
118
|
.btn-primary.tone-success {
|
|
103
|
-
background: var(--rel-colors-green-
|
|
104
|
-
color:
|
|
119
|
+
background: var(--rel-colors-green-tertiary);
|
|
120
|
+
color: #ffffff;
|
|
105
121
|
}
|
|
106
122
|
|
|
107
123
|
.btn-secondary {
|
|
108
124
|
background: var(--rel-colors-white);
|
|
109
|
-
border: 1px solid var(--rel-
|
|
125
|
+
border: 1px solid var(--rel-color-border-strong);
|
|
110
126
|
color: var(--rel-colors-black);
|
|
111
127
|
}
|
|
112
128
|
|
|
@@ -126,12 +142,69 @@ export class RelButton extends LitElement {
|
|
|
126
142
|
height: 40px;
|
|
127
143
|
padding: 0;
|
|
128
144
|
border-radius: 50%;
|
|
145
|
+
}
|
|
146
|
+
.btn-icon.tone-default {
|
|
129
147
|
background: var(--rel-colors-gray-light);
|
|
130
148
|
color: var(--rel-colors-black);
|
|
149
|
+
border: none;
|
|
150
|
+
}
|
|
151
|
+
.btn-icon.tone-primary {
|
|
152
|
+
background: var(--rel-colors-green-primary);
|
|
153
|
+
color: #000000;
|
|
154
|
+
border: none;
|
|
155
|
+
}
|
|
156
|
+
.btn-icon.tone-secondary {
|
|
157
|
+
background: var(--rel-colors-white);
|
|
158
|
+
color: var(--rel-colors-black);
|
|
159
|
+
border: 1px solid var(--rel-color-border-strong);
|
|
160
|
+
}
|
|
161
|
+
.btn-icon.tone-success {
|
|
162
|
+
background: var(--rel-colors-green-tertiary);
|
|
163
|
+
color: #ffffff;
|
|
164
|
+
border: none;
|
|
165
|
+
}
|
|
166
|
+
.btn-icon.tone-critical {
|
|
167
|
+
background: var(--rel-error-surface-default);
|
|
168
|
+
color: #ffffff;
|
|
169
|
+
border: none;
|
|
131
170
|
}
|
|
132
171
|
|
|
133
|
-
button:hover:not(:disabled) {
|
|
134
|
-
|
|
172
|
+
button.btn-primary.tone-default:hover:not(:disabled) {
|
|
173
|
+
background: var(--rel-color-brand-hover);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
button.btn-primary.tone-critical:hover:not(:disabled) {
|
|
177
|
+
filter: brightness(0.9);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
button.btn-primary.tone-success:hover:not(:disabled) {
|
|
181
|
+
filter: brightness(0.9);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* Generic hover — excludes icon (handled per-tone below) */
|
|
185
|
+
button:hover:not(:disabled):not(.btn-primary):not(.btn-default):not(.btn-icon) {
|
|
186
|
+
background: var(--rel-color-bg-hover);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
button.btn-default:hover:not(:disabled) {
|
|
190
|
+
filter: brightness(0.85);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Icon hover — each tone matches its corresponding button variant */
|
|
194
|
+
button.btn-icon.tone-default:hover:not(:disabled) {
|
|
195
|
+
filter: brightness(0.9);
|
|
196
|
+
}
|
|
197
|
+
button.btn-icon.tone-primary:hover:not(:disabled) {
|
|
198
|
+
background: var(--rel-color-brand-hover);
|
|
199
|
+
}
|
|
200
|
+
button.btn-icon.tone-secondary:hover:not(:disabled) {
|
|
201
|
+
background: var(--rel-color-bg-hover);
|
|
202
|
+
}
|
|
203
|
+
button.btn-icon.tone-success:hover:not(:disabled) {
|
|
204
|
+
filter: brightness(0.9);
|
|
205
|
+
}
|
|
206
|
+
button.btn-icon.tone-critical:hover:not(:disabled) {
|
|
207
|
+
filter: brightness(0.9);
|
|
135
208
|
}
|
|
136
209
|
|
|
137
210
|
button:active:not(:disabled) {
|
|
@@ -139,9 +212,37 @@ export class RelButton extends LitElement {
|
|
|
139
212
|
}
|
|
140
213
|
|
|
141
214
|
button:focus-visible {
|
|
142
|
-
outline: 2px solid var(--rel-
|
|
215
|
+
outline: 2px solid var(--rel-color-border-focus);
|
|
143
216
|
outline-offset: 2px;
|
|
144
217
|
}
|
|
218
|
+
|
|
219
|
+
/* Dark mode overrides */
|
|
220
|
+
:host-context([data-theme="dark"]) button.btn-default.tone-default,
|
|
221
|
+
:host-context(.dark) button.btn-default.tone-default {
|
|
222
|
+
background: var(--rel-gray-text-primary);
|
|
223
|
+
color: #000000;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
:host-context([data-theme="dark"]) button:focus-visible,
|
|
227
|
+
:host-context(.dark) button:focus-visible {
|
|
228
|
+
outline-color: var(--rel-color-text-primary);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
:host-context([data-theme="dark"]) button.btn-secondary,
|
|
232
|
+
:host-context(.dark) button.btn-secondary,
|
|
233
|
+
:host-context([data-theme="dark"]) button.btn-icon.tone-secondary,
|
|
234
|
+
:host-context(.dark) button.btn-icon.tone-secondary {
|
|
235
|
+
background: var(--rel-color-bg-primary);
|
|
236
|
+
border-color: var(--rel-color-border-strong);
|
|
237
|
+
color: var(--rel-color-text-primary);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:host-context([data-theme="dark"]) button.btn-text,
|
|
241
|
+
:host-context(.dark) button.btn-text {
|
|
242
|
+
color: var(--rel-color-text-primary);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* btn-link: blue in both modes — no dark override */
|
|
145
246
|
`;
|
|
146
247
|
|
|
147
248
|
private get classes() {
|
|
@@ -176,6 +277,7 @@ export class RelButton extends LitElement {
|
|
|
176
277
|
?disabled=${this.disabled}
|
|
177
278
|
@click=${this.handleClick}
|
|
178
279
|
aria-disabled=${this.disabled}
|
|
280
|
+
aria-label=${ifDefined(this.ariaLabel ?? undefined)}
|
|
179
281
|
>
|
|
180
282
|
<slot></slot>
|
|
181
283
|
</button>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, css, nothing } from "lit";
|
|
2
2
|
import { customElement, property, state } from "lit/decorators.js";
|
|
3
|
+
import "../../styles/vars-v2.css";
|
|
3
4
|
|
|
4
5
|
interface CalendarDay {
|
|
5
6
|
date: Date;
|
|
@@ -69,16 +70,16 @@ export class RelCalendar extends LitElement {
|
|
|
69
70
|
align-items: center;
|
|
70
71
|
justify-content: center;
|
|
71
72
|
cursor: pointer;
|
|
72
|
-
color: var(--rel-
|
|
73
|
+
color: var(--rel-color-text-primary);
|
|
73
74
|
transition: background-color 0.15s ease;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
.nav-button:hover {
|
|
77
|
-
background: var(--rel-
|
|
78
|
+
background: var(--rel-color-bg-secondary);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
.nav-button:focus-visible {
|
|
81
|
-
outline: 2px solid var(--rel-
|
|
82
|
+
outline: 2px solid var(--rel-color-border-focus);
|
|
82
83
|
outline-offset: 2px;
|
|
83
84
|
}
|
|
84
85
|
|
|
@@ -92,7 +93,7 @@ export class RelCalendar extends LitElement {
|
|
|
92
93
|
text-align: center;
|
|
93
94
|
font-size: var(--rel-fontSizes-xs);
|
|
94
95
|
font-weight: var(--rel-fontWeights-semibold);
|
|
95
|
-
color: var(--rel-
|
|
96
|
+
color: var(--rel-gray-text-placeholder);
|
|
96
97
|
padding: var(--rel-spacing-space-xs);
|
|
97
98
|
text-transform: uppercase;
|
|
98
99
|
}
|
|
@@ -116,23 +117,23 @@ export class RelCalendar extends LitElement {
|
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
.day-button:focus-visible {
|
|
119
|
-
outline: 2px solid var(--rel-
|
|
120
|
+
outline: 2px solid var(--rel-color-border-focus);
|
|
120
121
|
outline-offset: -2px;
|
|
121
122
|
z-index: 1;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
.day-button.today:not(.selected) {
|
|
125
|
-
border: 2px solid var(--rel-
|
|
126
|
+
border: 2px solid var(--rel-color-brand);
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
.day-button.selected {
|
|
129
|
-
background: var(--rel-
|
|
130
|
-
color:
|
|
130
|
+
background: var(--rel-color-brand);
|
|
131
|
+
color: #000000;
|
|
131
132
|
font-weight: var(--rel-fontWeights-semibold);
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
.day-button.other-month {
|
|
135
|
-
color: var(--rel-
|
|
136
|
+
color: var(--rel-gray-text-placeholder);
|
|
136
137
|
opacity: 0.5;
|
|
137
138
|
}
|
|
138
139
|
|
|
@@ -145,6 +146,12 @@ export class RelCalendar extends LitElement {
|
|
|
145
146
|
.day-button:disabled:hover {
|
|
146
147
|
background: transparent;
|
|
147
148
|
}
|
|
149
|
+
|
|
150
|
+
:host-context([data-theme="dark"]) :host,
|
|
151
|
+
:host-context(.dark) :host {
|
|
152
|
+
background: var(--rel-color-bg-primary);
|
|
153
|
+
border-color: var(--rel-color-border-default);
|
|
154
|
+
}
|
|
148
155
|
`;
|
|
149
156
|
|
|
150
157
|
connectedCallback() {
|