@reliability-design/web 1.4.0 → 1.4.1
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/CHANGELOG.md +22 -0
- package/dist/components/rel-alert/rel-alert.ts +5 -9
- package/dist/components/rel-calendar/rel-calendar.ts +7 -0
- package/dist/components/rel-drawer/rel-drawer.ts +50 -15
- package/dist/components/rel-textfield/rel-textfield.ts +46 -1
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +91 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +91 -15
- package/dist/index.mjs.map +1 -1
- package/dist/styles/vars.css +213 -0
- package/dist/{vars-WY2XCF5G.css → vars-BYCEEKWJ.css} +213 -0
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
// src/index.ts
|
|
13
|
-
import "./vars-
|
|
13
|
+
import "./vars-BYCEEKWJ.css";
|
|
14
14
|
|
|
15
15
|
// src/components/rel-accordion/rel-accordion.ts
|
|
16
16
|
import "@reliability-design/icons/rel-icon";
|
|
@@ -517,8 +517,7 @@ RelAlert.styles = css2`
|
|
|
517
517
|
color: var(--rel-text-default);
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
-
.alert-info .rel-message1
|
|
521
|
-
.alert-info .rel-message2 {
|
|
520
|
+
.alert-info .rel-message1 {
|
|
522
521
|
color: var(--rel-text-info);
|
|
523
522
|
}
|
|
524
523
|
|
|
@@ -527,8 +526,7 @@ RelAlert.styles = css2`
|
|
|
527
526
|
color: var(--rel-text-default);
|
|
528
527
|
}
|
|
529
528
|
|
|
530
|
-
.alert-success .rel-message1
|
|
531
|
-
.alert-success .rel-message2 {
|
|
529
|
+
.alert-success .rel-message1 {
|
|
532
530
|
color: var(--rel-text-success);
|
|
533
531
|
}
|
|
534
532
|
|
|
@@ -537,18 +535,16 @@ RelAlert.styles = css2`
|
|
|
537
535
|
color: var(--rel-text-default);
|
|
538
536
|
}
|
|
539
537
|
|
|
540
|
-
.alert-warning .rel-message1
|
|
541
|
-
.alert-warning .rel-message2 {
|
|
538
|
+
.alert-warning .rel-message1 {
|
|
542
539
|
color: var(--rel-text-warning);
|
|
543
540
|
}
|
|
544
541
|
|
|
545
542
|
.alert-error {
|
|
546
543
|
background: var(--rel-bg-danger-light);
|
|
547
|
-
color: var(--rel-text-
|
|
544
|
+
color: var(--rel-text-default);
|
|
548
545
|
}
|
|
549
546
|
|
|
550
|
-
.alert-error .rel-message1
|
|
551
|
-
.alert-error .rel-message2 {
|
|
547
|
+
.alert-error .rel-message1 {
|
|
552
548
|
color: var(--rel-text-danger);
|
|
553
549
|
}
|
|
554
550
|
|
|
@@ -1902,6 +1898,13 @@ RelCalendar.styles = css7`
|
|
|
1902
1898
|
|
|
1903
1899
|
:host([disabled]) {
|
|
1904
1900
|
opacity: 0.6;
|
|
1901
|
+
cursor: not-allowed;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
/* Block interaction on the inner controls (JS also guards clicks), but keep
|
|
1905
|
+
pointer-events on the host so its not-allowed cursor shows through. */
|
|
1906
|
+
:host([disabled]) .day-button,
|
|
1907
|
+
:host([disabled]) .nav-button {
|
|
1905
1908
|
pointer-events: none;
|
|
1906
1909
|
}
|
|
1907
1910
|
|
|
@@ -5947,6 +5950,7 @@ var RelDrawer = class extends LitElement18 {
|
|
|
5947
5950
|
this.description = "";
|
|
5948
5951
|
this.isDragging = false;
|
|
5949
5952
|
this.dragOffset = 0;
|
|
5953
|
+
this.settled = false;
|
|
5950
5954
|
this.previousFocus = null;
|
|
5951
5955
|
this.startY = 0;
|
|
5952
5956
|
this.currentY = 0;
|
|
@@ -6046,6 +6050,23 @@ var RelDrawer = class extends LitElement18 {
|
|
|
6046
6050
|
});
|
|
6047
6051
|
}
|
|
6048
6052
|
document.addEventListener("keydown", this.handleKeydown);
|
|
6053
|
+
this.settled = false;
|
|
6054
|
+
this.updateComplete.then(() => {
|
|
6055
|
+
const panel = this.panelElement;
|
|
6056
|
+
if (!panel) return;
|
|
6057
|
+
let done = false;
|
|
6058
|
+
const settle = () => {
|
|
6059
|
+
if (done) return;
|
|
6060
|
+
done = true;
|
|
6061
|
+
this.settled = true;
|
|
6062
|
+
panel.removeEventListener("transitionend", onEnd);
|
|
6063
|
+
};
|
|
6064
|
+
const onEnd = (e) => {
|
|
6065
|
+
if (e.propertyName === "transform") settle();
|
|
6066
|
+
};
|
|
6067
|
+
panel.addEventListener("transitionend", onEnd);
|
|
6068
|
+
setTimeout(settle, 500);
|
|
6069
|
+
});
|
|
6049
6070
|
this.dispatchEvent(
|
|
6050
6071
|
new CustomEvent("rel-open-change", {
|
|
6051
6072
|
detail: { open: true },
|
|
@@ -6055,6 +6076,7 @@ var RelDrawer = class extends LitElement18 {
|
|
|
6055
6076
|
);
|
|
6056
6077
|
}
|
|
6057
6078
|
handleClose() {
|
|
6079
|
+
this.settled = false;
|
|
6058
6080
|
this.unlockScroll();
|
|
6059
6081
|
document.removeEventListener("keydown", this.handleKeydown);
|
|
6060
6082
|
if (this.previousFocus && this.previousFocus.focus) {
|
|
@@ -6152,7 +6174,7 @@ var RelDrawer = class extends LitElement18 {
|
|
|
6152
6174
|
|
|
6153
6175
|
<div
|
|
6154
6176
|
part="panel"
|
|
6155
|
-
class="panel ${this.isDragging ? "dragging" : ""}"
|
|
6177
|
+
class="panel ${this.isDragging ? "dragging" : ""} ${this.settled ? "settled" : ""}"
|
|
6156
6178
|
data-side="${this.side}"
|
|
6157
6179
|
style="${this.width ? `--drawer-width: ${this.width};` : ""}${this.maxHeight ? `--drawer-max-height: ${this.maxHeight};` : ""}${this.getPanelStyle()}"
|
|
6158
6180
|
role="${this.modal ? "dialog" : "region"}"
|
|
@@ -6289,6 +6311,15 @@ RelDrawer.styles = css18`
|
|
|
6289
6311
|
transform: translateX(0);
|
|
6290
6312
|
}
|
|
6291
6313
|
|
|
6314
|
+
/* Once settled open, drop the (now identity) transform on left/right panels
|
|
6315
|
+
so their fixed-position descendants (select dropdowns, popovers, tooltips)
|
|
6316
|
+
escape the transformed containing block instead of being clipped by the
|
|
6317
|
+
panel. Bottom keeps its transform (used for centering). */
|
|
6318
|
+
.drawer-container.open .panel[data-side="left"].settled,
|
|
6319
|
+
.drawer-container.open .panel[data-side="right"].settled {
|
|
6320
|
+
transform: none;
|
|
6321
|
+
}
|
|
6322
|
+
|
|
6292
6323
|
/* Dragging state */
|
|
6293
6324
|
.panel.dragging {
|
|
6294
6325
|
transition: none;
|
|
@@ -6343,8 +6374,6 @@ RelDrawer.styles = css18`
|
|
|
6343
6374
|
}
|
|
6344
6375
|
|
|
6345
6376
|
.title {
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
6377
|
color: var(--rel-text-label);
|
|
6349
6378
|
margin: 0;
|
|
6350
6379
|
|
|
@@ -6361,7 +6390,6 @@ RelDrawer.styles = css18`
|
|
|
6361
6390
|
}
|
|
6362
6391
|
|
|
6363
6392
|
.description {
|
|
6364
|
-
|
|
6365
6393
|
color: var(--rel-text-body);
|
|
6366
6394
|
margin: 0;
|
|
6367
6395
|
opacity: 0.8;
|
|
@@ -6487,6 +6515,9 @@ __decorateClass([
|
|
|
6487
6515
|
__decorateClass([
|
|
6488
6516
|
state6()
|
|
6489
6517
|
], RelDrawer.prototype, "dragOffset", 2);
|
|
6518
|
+
__decorateClass([
|
|
6519
|
+
state6()
|
|
6520
|
+
], RelDrawer.prototype, "settled", 2);
|
|
6490
6521
|
__decorateClass([
|
|
6491
6522
|
query4(".panel")
|
|
6492
6523
|
], RelDrawer.prototype, "panelElement", 2);
|
|
@@ -14882,6 +14913,7 @@ var RelTextfield = class extends LitElement52 {
|
|
|
14882
14913
|
this.placeholder = "";
|
|
14883
14914
|
this.type = "text";
|
|
14884
14915
|
this.value = "";
|
|
14916
|
+
this.clickableRightIcon = false;
|
|
14885
14917
|
this.state = "default";
|
|
14886
14918
|
this.size = "medium";
|
|
14887
14919
|
this.floatingLabel = false;
|
|
@@ -14928,6 +14960,20 @@ var RelTextfield = class extends LitElement52 {
|
|
|
14928
14960
|
this.internalState = "default";
|
|
14929
14961
|
}
|
|
14930
14962
|
}
|
|
14963
|
+
handleRightIconClick(e) {
|
|
14964
|
+
if (!this.clickableRightIcon) return;
|
|
14965
|
+
e.stopPropagation();
|
|
14966
|
+
this.dispatchEvent(
|
|
14967
|
+
new CustomEvent("rel-right-icon-click", { bubbles: true, composed: true })
|
|
14968
|
+
);
|
|
14969
|
+
}
|
|
14970
|
+
handleRightIconKeydown(e) {
|
|
14971
|
+
if (!this.clickableRightIcon) return;
|
|
14972
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
14973
|
+
e.preventDefault();
|
|
14974
|
+
this.handleRightIconClick(e);
|
|
14975
|
+
}
|
|
14976
|
+
}
|
|
14931
14977
|
handleInput(e) {
|
|
14932
14978
|
const input = e.target;
|
|
14933
14979
|
this.value = input.value;
|
|
@@ -15046,7 +15092,17 @@ var RelTextfield = class extends LitElement52 {
|
|
|
15046
15092
|
|
|
15047
15093
|
${inputTemplate}
|
|
15048
15094
|
|
|
15049
|
-
${!this.multiline && this.rightIcon ? html52`<rel-icon
|
|
15095
|
+
${!this.multiline && this.rightIcon ? html52`<rel-icon
|
|
15096
|
+
part="right-icon"
|
|
15097
|
+
name="${this.rightIcon}"
|
|
15098
|
+
size="${this.clickableRightIcon ? "md" : "sm"}"
|
|
15099
|
+
class="icon right ${this.clickableRightIcon ? "clickable" : ""}"
|
|
15100
|
+
role="${this.clickableRightIcon ? "button" : nothing8}"
|
|
15101
|
+
tabindex="${this.clickableRightIcon ? "0" : nothing8}"
|
|
15102
|
+
aria-label="${this.clickableRightIcon ? this.rightIconAriaLabel ?? nothing8 : nothing8}"
|
|
15103
|
+
@click="${(e) => this.handleRightIconClick(e)}"
|
|
15104
|
+
@keydown="${(e) => this.handleRightIconKeydown(e)}"
|
|
15105
|
+
></rel-icon>` : ""}
|
|
15050
15106
|
</div>
|
|
15051
15107
|
|
|
15052
15108
|
${belowTemplate}
|
|
@@ -15256,6 +15312,20 @@ RelTextfield.styles = css49`
|
|
|
15256
15312
|
right: 8px;
|
|
15257
15313
|
}
|
|
15258
15314
|
|
|
15315
|
+
/* Interactive trailing icon (e.g. password show/hide) */
|
|
15316
|
+
.icon.right.clickable {
|
|
15317
|
+
pointer-events: auto;
|
|
15318
|
+
cursor: pointer;
|
|
15319
|
+
border-radius: var(--rel-border-radius-xs, 4px);
|
|
15320
|
+
}
|
|
15321
|
+
.icon.right.clickable:hover {
|
|
15322
|
+
color: var(--rel-text-body);
|
|
15323
|
+
}
|
|
15324
|
+
.icon.right.clickable:focus-visible {
|
|
15325
|
+
outline: 2px solid var(--rel-border-focus);
|
|
15326
|
+
outline-offset: 2px;
|
|
15327
|
+
}
|
|
15328
|
+
|
|
15259
15329
|
.textfield-wrapper.small .textfield-support {
|
|
15260
15330
|
font-weight: var(--rel-body-xs-medium-font-weight);
|
|
15261
15331
|
}
|
|
@@ -15552,6 +15622,12 @@ __decorateClass([
|
|
|
15552
15622
|
__decorateClass([
|
|
15553
15623
|
property46({ type: String })
|
|
15554
15624
|
], RelTextfield.prototype, "rightIcon", 2);
|
|
15625
|
+
__decorateClass([
|
|
15626
|
+
property46({ type: Boolean, attribute: "clickable-right-icon" })
|
|
15627
|
+
], RelTextfield.prototype, "clickableRightIcon", 2);
|
|
15628
|
+
__decorateClass([
|
|
15629
|
+
property46({ type: String, attribute: "right-icon-aria-label" })
|
|
15630
|
+
], RelTextfield.prototype, "rightIconAriaLabel", 2);
|
|
15555
15631
|
__decorateClass([
|
|
15556
15632
|
property46({ type: String })
|
|
15557
15633
|
], RelTextfield.prototype, "supportingText", 2);
|