@warp-ds/elements 1.3.2-next.1 → 1.3.3-next.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/dist/index.js +73 -212
- package/dist/index.js.map +3 -3
- package/dist/packages/affix/index.js.map +1 -1
- package/dist/packages/alert/index.js +9 -8
- package/dist/packages/alert/index.js.map +2 -2
- package/dist/packages/attention/index.js +7 -28
- package/dist/packages/attention/index.js.map +2 -2
- package/dist/packages/badge/index.js.map +2 -2
- package/dist/packages/box/index.js.map +1 -1
- package/dist/packages/breadcrumbs/index.js +4 -14
- package/dist/packages/breadcrumbs/index.js.map +2 -2
- package/dist/packages/broadcast/index.js +1 -8
- package/dist/packages/broadcast/index.js.map +2 -2
- package/dist/packages/button/index.js +6 -30
- package/dist/packages/button/index.js.map +2 -2
- package/dist/packages/card/index.js +5 -20
- package/dist/packages/card/index.js.map +2 -2
- package/dist/packages/expandable/index.js +4 -12
- package/dist/packages/expandable/index.js.map +2 -2
- package/dist/packages/pill/index.js +4 -16
- package/dist/packages/pill/index.js.map +2 -2
- package/dist/packages/select/index.js +3 -15
- package/dist/packages/select/index.js.map +2 -2
- package/dist/packages/textfield/index.js +2 -24
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/toast/index.js +19 -26
- package/dist/packages/toast/index.js.map +2 -2
- package/package.json +10 -2
package/dist/index.js
CHANGED
|
@@ -2472,9 +2472,7 @@ var WarpAlert = class extends WarpElement2 {
|
|
|
2472
2472
|
connectedCallback() {
|
|
2473
2473
|
super.connectedCallback();
|
|
2474
2474
|
if (!this.variant || !variants[this.variant]) {
|
|
2475
|
-
throw new Error(
|
|
2476
|
-
'Invalid "variant" attribute. Set its value to one of the following:\nnegative, positive, warning, info.'
|
|
2477
|
-
);
|
|
2475
|
+
throw new Error('Invalid "variant" attribute. Set its value to one of the following:\nnegative, positive, warning, info.');
|
|
2478
2476
|
}
|
|
2479
2477
|
}
|
|
2480
2478
|
get _wrapperClasses() {
|
|
@@ -2491,15 +2489,18 @@ var WarpAlert = class extends WarpElement2 {
|
|
|
2491
2489
|
});
|
|
2492
2490
|
}
|
|
2493
2491
|
get _icon() {
|
|
2494
|
-
if (this.variant === variants.info)
|
|
2492
|
+
if (this.variant === variants.info) {
|
|
2495
2493
|
return html8`<w-icon-info-16></w-icon-info-16>`;
|
|
2496
|
-
|
|
2494
|
+
}
|
|
2495
|
+
if (this.variant === variants.warning) {
|
|
2497
2496
|
return html8`<w-icon-warning-16></w-icon-warning-16>`;
|
|
2498
|
-
|
|
2497
|
+
}
|
|
2498
|
+
if (this.variant === variants.negative) {
|
|
2499
2499
|
return html8`<w-icon-error-16></w-icon-error-16>`;
|
|
2500
|
-
|
|
2500
|
+
}
|
|
2501
|
+
if (this.variant === variants.positive) {
|
|
2501
2502
|
return html8`<w-icon-success-16></w-icon-success-16>`;
|
|
2502
|
-
else
|
|
2503
|
+
} else
|
|
2503
2504
|
return "";
|
|
2504
2505
|
}
|
|
2505
2506
|
render() {
|
|
@@ -3020,12 +3021,8 @@ var WarpAttention = class extends kebabCaseAttributes(WarpElement3) {
|
|
|
3020
3021
|
connectedCallback() {
|
|
3021
3022
|
super.connectedCallback();
|
|
3022
3023
|
if (!this.placement || !Object.keys(opposites).includes(this.placement)) {
|
|
3023
|
-
throw new Error(
|
|
3024
|
-
|
|
3025
|
-
${JSON.stringify(
|
|
3026
|
-
Object.keys(opposites)
|
|
3027
|
-
)}`
|
|
3028
|
-
);
|
|
3024
|
+
throw new Error(`Invalid "placement" attribute. Set its value to one of the following:
|
|
3025
|
+
${JSON.stringify(Object.keys(opposites))}`);
|
|
3029
3026
|
}
|
|
3030
3027
|
setTimeout(() => this.requestUpdate(), 0);
|
|
3031
3028
|
}
|
|
@@ -3040,16 +3037,10 @@ ${JSON.stringify(
|
|
|
3040
3037
|
}
|
|
3041
3038
|
updated() {
|
|
3042
3039
|
if (!this.callout) {
|
|
3043
|
-
this._attentionEl.style.setProperty(
|
|
3044
|
-
"--attention-visibility",
|
|
3045
|
-
this.show ? "" : "hidden"
|
|
3046
|
-
);
|
|
3040
|
+
this._attentionEl.style.setProperty("--attention-visibility", this.show ? "" : "hidden");
|
|
3047
3041
|
}
|
|
3048
3042
|
if (!this.tooltip) {
|
|
3049
|
-
this._attentionEl.style.setProperty(
|
|
3050
|
-
"--attention-display",
|
|
3051
|
-
this.show ? "flex" : "none"
|
|
3052
|
-
);
|
|
3043
|
+
this._attentionEl.style.setProperty("--attention-display", this.show ? "flex" : "none");
|
|
3053
3044
|
}
|
|
3054
3045
|
this.attentionState = {
|
|
3055
3046
|
isShowing: this.show,
|
|
@@ -3207,12 +3198,7 @@ ${JSON.stringify(
|
|
|
3207
3198
|
}
|
|
3208
3199
|
get _closeBtnHtml() {
|
|
3209
3200
|
return html9`
|
|
3210
|
-
<button
|
|
3211
|
-
aria-label="${this._ariaClose}"
|
|
3212
|
-
@click="${this.close}"
|
|
3213
|
-
@keydown=${this.keypressed}
|
|
3214
|
-
class="${attention.closeBtn}"
|
|
3215
|
-
>
|
|
3201
|
+
<button aria-label="${this._ariaClose}" @click="${this.close}" @keydown=${this.keypressed} class="${attention.closeBtn}">
|
|
3216
3202
|
<w-icon-close-16 />
|
|
3217
3203
|
</button>
|
|
3218
3204
|
`;
|
|
@@ -3223,12 +3209,7 @@ ${JSON.stringify(
|
|
|
3223
3209
|
${this.placement === "right" || this.placement === "bottom" ? html9`
|
|
3224
3210
|
<slot name="target"></slot>
|
|
3225
3211
|
|
|
3226
|
-
<div
|
|
3227
|
-
id="attention"
|
|
3228
|
-
role="${this.tooltip ? "tooltip" : "img"}"
|
|
3229
|
-
aria-label="${this.defaultAriaLabel()}"
|
|
3230
|
-
class="${this._wrapperClasses}"
|
|
3231
|
-
>
|
|
3212
|
+
<div id="attention" role="${this.tooltip ? "tooltip" : "img"}" aria-label="${this.defaultAriaLabel()}" class="${this._wrapperClasses}">
|
|
3232
3213
|
${this._arrowHtml}
|
|
3233
3214
|
<slot name="message"></slot>
|
|
3234
3215
|
${this.canClose ? this._closeBtnHtml : nothing}
|
|
@@ -3236,8 +3217,7 @@ ${JSON.stringify(
|
|
|
3236
3217
|
` : html9`
|
|
3237
3218
|
<div id="attention" class="${this._wrapperClasses}">
|
|
3238
3219
|
<slot name="message"></slot>
|
|
3239
|
-
${this._arrowHtml}
|
|
3240
|
-
${this.canClose ? this._closeBtnHtml : nothing}
|
|
3220
|
+
${this._arrowHtml} ${this.canClose ? this._closeBtnHtml : nothing}
|
|
3241
3221
|
</div>
|
|
3242
3222
|
<slot name="target"></slot>
|
|
3243
3223
|
`}
|
|
@@ -3398,9 +3378,7 @@ var messages13 = JSON.parse('{"breadcrumbs.ariaLabel":"Her er du"}');
|
|
|
3398
3378
|
var messages14 = JSON.parse('{"breadcrumbs.ariaLabel":"Olet t\xE4ss\xE4"}');
|
|
3399
3379
|
|
|
3400
3380
|
// packages/breadcrumbs/index.js
|
|
3401
|
-
var separator = html12`<span class=${breadcrumbs.separator}
|
|
3402
|
-
>/</span
|
|
3403
|
-
>`;
|
|
3381
|
+
var separator = html12`<span class=${breadcrumbs.separator}>/</span>`;
|
|
3404
3382
|
var WarpBreadcrumbs = class extends kebabCaseAttributes(WarpElement6) {
|
|
3405
3383
|
constructor() {
|
|
3406
3384
|
super();
|
|
@@ -3417,15 +3395,9 @@ var WarpBreadcrumbs = class extends kebabCaseAttributes(WarpElement6) {
|
|
|
3417
3395
|
const styledChildren = flattenedChildren.map((child, index) => {
|
|
3418
3396
|
if (typeof child === "string") {
|
|
3419
3397
|
const isLastEl = index === children.length - 1;
|
|
3420
|
-
return html12`<span
|
|
3421
|
-
class=${breadcrumbs.text}
|
|
3422
|
-
aria-current=${isLastEl ? "page" : void 0}
|
|
3423
|
-
>${child}</span
|
|
3424
|
-
>`;
|
|
3398
|
+
return html12`<span class=${breadcrumbs.text} aria-current=${isLastEl ? "page" : void 0}>${child}</span>`;
|
|
3425
3399
|
}
|
|
3426
|
-
child.classList.add(
|
|
3427
|
-
child.tagName === "A" ? breadcrumbs.link : breadcrumbs.text
|
|
3428
|
-
);
|
|
3400
|
+
child.classList.add(child.tagName === "A" ? breadcrumbs.link : breadcrumbs.text);
|
|
3429
3401
|
return child;
|
|
3430
3402
|
});
|
|
3431
3403
|
this._children = interleave(styledChildren, separator);
|
|
@@ -3433,9 +3405,7 @@ var WarpBreadcrumbs = class extends kebabCaseAttributes(WarpElement6) {
|
|
|
3433
3405
|
render() {
|
|
3434
3406
|
return html12`
|
|
3435
3407
|
<nav aria-labelledby="breadCrumbLabel">
|
|
3436
|
-
<h2 id="breadCrumbLabel" class=${breadcrumbs.a11y}>
|
|
3437
|
-
${this.ariaLabel}
|
|
3438
|
-
</h2>
|
|
3408
|
+
<h2 id="breadCrumbLabel" class=${breadcrumbs.a11y}>${this.ariaLabel}</h2>
|
|
3439
3409
|
<div class=${breadcrumbs.wrapper}>${this._children}</div>
|
|
3440
3410
|
</nav>
|
|
3441
3411
|
`;
|
|
@@ -3498,14 +3468,7 @@ var WarpBroadcast = class extends WarpElement7 {
|
|
|
3498
3468
|
${repeat(
|
|
3499
3469
|
messages43,
|
|
3500
3470
|
({ id }) => `broadcast-${id}`,
|
|
3501
|
-
({ id, message }) => html13`<w-toast
|
|
3502
|
-
id="broadcast-${id}"
|
|
3503
|
-
type="warning"
|
|
3504
|
-
text="${message}"
|
|
3505
|
-
canclose
|
|
3506
|
-
@close=${() => this._del(id)}
|
|
3507
|
-
>
|
|
3508
|
-
</w-toast>`
|
|
3471
|
+
({ id, message }) => html13`<w-toast id="broadcast-${id}" type="warning" text="${message}" canclose @close=${() => this._del(id)}> </w-toast>`
|
|
3509
3472
|
)}
|
|
3510
3473
|
</aside>
|
|
3511
3474
|
`;
|
|
@@ -3551,14 +3514,7 @@ var messages16 = JSON.parse('{"button.aria.loading":"Laster..."}');
|
|
|
3551
3514
|
var messages17 = JSON.parse('{"button.aria.loading":"Ladataan..."}');
|
|
3552
3515
|
|
|
3553
3516
|
// packages/button/index.js
|
|
3554
|
-
var buttonTypes2 = [
|
|
3555
|
-
"primary",
|
|
3556
|
-
"secondary",
|
|
3557
|
-
"negative",
|
|
3558
|
-
"utility",
|
|
3559
|
-
"pill",
|
|
3560
|
-
"link"
|
|
3561
|
-
];
|
|
3517
|
+
var buttonTypes2 = ["primary", "secondary", "negative", "utility", "pill", "link"];
|
|
3562
3518
|
var WarpButton = class extends kebabCaseAttributes(WarpElement8) {
|
|
3563
3519
|
constructor() {
|
|
3564
3520
|
super();
|
|
@@ -3573,12 +3529,8 @@ var WarpButton = class extends kebabCaseAttributes(WarpElement8) {
|
|
|
3573
3529
|
connectedCallback() {
|
|
3574
3530
|
super.connectedCallback();
|
|
3575
3531
|
if (!buttonTypes2.includes(this.variant)) {
|
|
3576
|
-
throw new Error(
|
|
3577
|
-
|
|
3578
|
-
${buttonTypes2.join(
|
|
3579
|
-
", "
|
|
3580
|
-
)}.`
|
|
3581
|
-
);
|
|
3532
|
+
throw new Error(`Invalid "variant" attribute. Set its value to one of the following:
|
|
3533
|
+
${buttonTypes2.join(", ")}.`);
|
|
3582
3534
|
}
|
|
3583
3535
|
}
|
|
3584
3536
|
firstUpdated() {
|
|
@@ -3641,25 +3593,12 @@ ${buttonTypes2.join(
|
|
|
3641
3593
|
);
|
|
3642
3594
|
}
|
|
3643
3595
|
render() {
|
|
3644
|
-
return html14` ${this.href ? html14`<a
|
|
3645
|
-
href=${this.href}
|
|
3646
|
-
target=${this.target}
|
|
3647
|
-
rel=${this.target === "_blank" ? this.rel || "noopener" : void 0}
|
|
3648
|
-
class=${this._classes}
|
|
3649
|
-
>
|
|
3596
|
+
return html14` ${this.href ? html14`<a href=${this.href} target=${this.target} rel=${this.target === "_blank" ? this.rel || "noopener" : void 0} class=${this._classes}>
|
|
3650
3597
|
<slot></slot>
|
|
3651
|
-
</a>` : html14`<button
|
|
3652
|
-
type=${this.type || "button"}
|
|
3653
|
-
class=${this._classes}
|
|
3654
|
-
>
|
|
3598
|
+
</a>` : html14`<button type=${this.type || "button"} class=${this._classes}>
|
|
3655
3599
|
<slot></slot>
|
|
3656
3600
|
</button>`}
|
|
3657
|
-
${this.loading ? html14`<span
|
|
3658
|
-
class="sr-only"
|
|
3659
|
-
role="progressbar"
|
|
3660
|
-
aria-valuenow="{0}"
|
|
3661
|
-
aria-valuetext=${this.ariaValueTextLoading}
|
|
3662
|
-
/>` : null}`;
|
|
3601
|
+
${this.loading ? html14`<span class="sr-only" role="progressbar" aria-valuenow="{0}" aria-valuetext=${this.ariaValueTextLoading} />` : null}`;
|
|
3663
3602
|
}
|
|
3664
3603
|
};
|
|
3665
3604
|
__publicField(WarpButton, "shadowRootOptions", __spreadProps(__spreadValues({}, WarpElement8.shadowRootOptions), {
|
|
@@ -3714,20 +3653,10 @@ var WarpCard = class extends WarpElement9 {
|
|
|
3714
3653
|
});
|
|
3715
3654
|
}
|
|
3716
3655
|
get uuButton() {
|
|
3717
|
-
return html15`<button
|
|
3718
|
-
class="${card.a11y}"
|
|
3719
|
-
aria-pressed="${this.selected}"
|
|
3720
|
-
tabindex="-1"
|
|
3721
|
-
>
|
|
3722
|
-
Velg
|
|
3723
|
-
</button>`;
|
|
3656
|
+
return html15`<button class="${card.a11y}" aria-pressed="${this.selected}" tabindex="-1">Velg</button>`;
|
|
3724
3657
|
}
|
|
3725
3658
|
get uuSpan() {
|
|
3726
|
-
return html15`<span
|
|
3727
|
-
role="checkbox"
|
|
3728
|
-
aria-checked="true"
|
|
3729
|
-
aria-disabled="true"
|
|
3730
|
-
></span>`;
|
|
3659
|
+
return html15`<span role="checkbox" aria-checked="true" aria-disabled="true"></span>`;
|
|
3731
3660
|
}
|
|
3732
3661
|
keypressed(e2) {
|
|
3733
3662
|
if (!this.clickable || e2.altKey || e2.ctrlKey)
|
|
@@ -3739,13 +3668,8 @@ var WarpCard = class extends WarpElement9 {
|
|
|
3739
3668
|
}
|
|
3740
3669
|
render() {
|
|
3741
3670
|
return html15`
|
|
3742
|
-
<div
|
|
3743
|
-
|
|
3744
|
-
class="${this._outerClasses}"
|
|
3745
|
-
@keydown=${this.keypressed}
|
|
3746
|
-
>
|
|
3747
|
-
${this.clickable ? this.uuButton : ""}
|
|
3748
|
-
${!this.clickable && this.selected ? this.uuSpan : ""}
|
|
3671
|
+
<div tabindex=${ifDefined3(this.clickable ? "0" : void 0)} class="${this._outerClasses}" @keydown=${this.keypressed}>
|
|
3672
|
+
${this.clickable ? this.uuButton : ""} ${!this.clickable && this.selected ? this.uuSpan : ""}
|
|
3749
3673
|
<div class="${this._innerClasses}"></div>
|
|
3750
3674
|
<slot></slot>
|
|
3751
3675
|
</div>
|
|
@@ -3756,7 +3680,7 @@ __publicField(WarpCard, "styles", [
|
|
|
3756
3680
|
WarpElement9.styles,
|
|
3757
3681
|
css4`
|
|
3758
3682
|
a::after {
|
|
3759
|
-
content:
|
|
3683
|
+
content: '';
|
|
3760
3684
|
position: absolute;
|
|
3761
3685
|
top: 0;
|
|
3762
3686
|
right: 0;
|
|
@@ -4030,9 +3954,7 @@ var WarpExpandable = class extends kebabCaseAttributes(WarpElement10) {
|
|
|
4030
3954
|
@click=${() => this.expanded = !this.expanded}
|
|
4031
3955
|
>
|
|
4032
3956
|
<div class="${expandable.title}">
|
|
4033
|
-
${this.title ? html18`<span class="${expandable.titleType}"
|
|
4034
|
-
>${this.title}</span
|
|
4035
|
-
>` : html18`<slot name="title"></slot>`}
|
|
3957
|
+
${this.title ? html18`<span class="${expandable.titleType}">${this.title}</span>` : html18`<slot name="title"></slot>`}
|
|
4036
3958
|
${this.noChevron ? "" : html18`<div
|
|
4037
3959
|
class=${fclasses({
|
|
4038
3960
|
[expandable.chevron]: true,
|
|
@@ -4040,18 +3962,12 @@ var WarpExpandable = class extends kebabCaseAttributes(WarpElement10) {
|
|
|
4040
3962
|
[expandable.chevronNonBox]: !this.box
|
|
4041
3963
|
})}
|
|
4042
3964
|
>
|
|
4043
|
-
${this._showChevronUp ? html18`<w-icon-chevron-up-16
|
|
4044
|
-
class="${this._chevronUpClasses}"
|
|
4045
|
-
></w-icon-chevron-up-16>` : html18`<w-icon-chevron-down-16
|
|
4046
|
-
class="${this._chevronDownClasses}"
|
|
4047
|
-
></w-icon-chevron-down-16>`}
|
|
3965
|
+
${this._showChevronUp ? html18`<w-icon-chevron-up-16 class="${this._chevronUpClasses}"></w-icon-chevron-up-16>` : html18`<w-icon-chevron-down-16 class="${this._chevronDownClasses}"></w-icon-chevron-down-16>`}
|
|
4048
3966
|
</div>`}
|
|
4049
3967
|
</div>
|
|
4050
3968
|
</button>
|
|
4051
3969
|
</w-unstyled-heading>` : ""}
|
|
4052
|
-
${this.animated ? html18`<w-expand-transition ?show=${this.expanded}>
|
|
4053
|
-
${this._expandableSlot}
|
|
4054
|
-
</w-expand-transition>` : html18`<div
|
|
3970
|
+
${this.animated ? html18`<w-expand-transition ?show=${this.expanded}> ${this._expandableSlot} </w-expand-transition>` : html18`<div
|
|
4055
3971
|
class=${fclasses({
|
|
4056
3972
|
[expandable.expansion]: true,
|
|
4057
3973
|
[expandable.expansionNotExpanded]: !this.expanded
|
|
@@ -4090,7 +4006,7 @@ __publicField(WarpExpandable, "styles", [
|
|
|
4090
4006
|
::slotted(:last-child) {
|
|
4091
4007
|
margin-bottom: 0px !important;
|
|
4092
4008
|
}
|
|
4093
|
-
|
|
4009
|
+
`
|
|
4094
4010
|
]);
|
|
4095
4011
|
if (!customElements.get("w-expandable")) {
|
|
4096
4012
|
customElements.define("w-expandable", WarpExpandable);
|
|
@@ -4151,24 +4067,12 @@ var WarpPill = class extends kebabCaseAttributes(WarpElement11) {
|
|
|
4151
4067
|
render() {
|
|
4152
4068
|
return html19`
|
|
4153
4069
|
<div class="${pill.pill}">
|
|
4154
|
-
<button
|
|
4155
|
-
|
|
4156
|
-
class="${this._labelClasses}"
|
|
4157
|
-
@click="${this._onClick}"
|
|
4158
|
-
>
|
|
4159
|
-
<span class="${pill.a11y}"
|
|
4160
|
-
>${this.openSrLabel ? this.openSrLabel : this.openFilterSrText}</span
|
|
4161
|
-
>
|
|
4070
|
+
<button type="button" class="${this._labelClasses}" @click="${this._onClick}">
|
|
4071
|
+
<span class="${pill.a11y}">${this.openSrLabel ? this.openSrLabel : this.openFilterSrText}</span>
|
|
4162
4072
|
<slot></slot>
|
|
4163
4073
|
</button>
|
|
4164
|
-
${this.canClose ? html19`<button
|
|
4165
|
-
|
|
4166
|
-
class="${this._closeClasses}"
|
|
4167
|
-
@click="${this._onClose}"
|
|
4168
|
-
>
|
|
4169
|
-
<span class="${pill.a11y}"
|
|
4170
|
-
>${this.closeSrLabel ? this.closeSrLabel : this.removeFilterSrText}</span
|
|
4171
|
-
>
|
|
4074
|
+
${this.canClose ? html19`<button type="button" class="${this._closeClasses}" @click="${this._onClose}">
|
|
4075
|
+
<span class="${pill.a11y}">${this.closeSrLabel ? this.closeSrLabel : this.removeFilterSrText}</span>
|
|
4172
4076
|
<w-icon-close-16></w-icon-close-16>
|
|
4173
4077
|
</button>` : null}
|
|
4174
4078
|
</div>
|
|
@@ -4187,7 +4091,7 @@ if (!customElements.get("w-pill")) {
|
|
|
4187
4091
|
}
|
|
4188
4092
|
|
|
4189
4093
|
// packages/select/index.js
|
|
4190
|
-
import { html as html20
|
|
4094
|
+
import { html as html20 } from "lit";
|
|
4191
4095
|
import WarpElement12 from "@warp-ds/elements-core";
|
|
4192
4096
|
import { ifDefined as ifDefined5 } from "lit/directives/if-defined.js";
|
|
4193
4097
|
import { when } from "lit/directives/when.js";
|
|
@@ -4234,26 +4138,14 @@ var WarpSelect = class extends kebabCaseAttributes(WarpElement12) {
|
|
|
4234
4138
|
>`
|
|
4235
4139
|
)}
|
|
4236
4140
|
<div class="${select.selectWrapper}">
|
|
4237
|
-
<select
|
|
4238
|
-
class="${__privateGet(this, _classes, classes_get)}"
|
|
4239
|
-
id="${__privateGet(this, _id, id_get)}"
|
|
4240
|
-
?autofocus=${this.autoFocus}
|
|
4241
|
-
aria-describedby="${ifDefined5(__privateGet(this, _helpId, helpId_get))}"
|
|
4242
|
-
aria-invalid="${ifDefined5(this.invalid)}"
|
|
4243
|
-
aria-errormessage="${ifDefined5(this.invalid && __privateGet(this, _helpId, helpId_get))}"
|
|
4244
|
-
>
|
|
4141
|
+
<select class="${__privateGet(this, _classes, classes_get)}" id="${__privateGet(this, _id, id_get)}" ?autofocus=${this.autoFocus} aria-describedby="${ifDefined5(__privateGet(this, _helpId, helpId_get))}" aria-invalid="${ifDefined5(this.invalid)}" aria-errormessage="${ifDefined5(this.invalid && __privateGet(this, _helpId, helpId_get))}">
|
|
4245
4142
|
${unsafeHTML(this._options)}
|
|
4246
4143
|
</select>
|
|
4247
4144
|
<div class="${__privateGet(this, _chevronClasses, chevronClasses_get)}">
|
|
4248
4145
|
<w-icon-chevron-down-16></w-icon-chevron-down-16>
|
|
4249
4146
|
</div>
|
|
4250
4147
|
</div>
|
|
4251
|
-
${when(
|
|
4252
|
-
this.always || this.invalid,
|
|
4253
|
-
() => html20`<div id="${__privateGet(this, _helpId, helpId_get)}" class="${__privateGet(this, _helpTextClasses, helpTextClasses_get)}">
|
|
4254
|
-
${this.hint}
|
|
4255
|
-
</div>`
|
|
4256
|
-
)}
|
|
4148
|
+
${when(this.always || this.invalid, () => html20`<div id="${__privateGet(this, _helpId, helpId_get)}" class="${__privateGet(this, _helpTextClasses, helpTextClasses_get)}">${this.hint}</div>`)}
|
|
4257
4149
|
</div>`;
|
|
4258
4150
|
}
|
|
4259
4151
|
};
|
|
@@ -4308,7 +4200,7 @@ if (!customElements.get("w-select")) {
|
|
|
4308
4200
|
}
|
|
4309
4201
|
|
|
4310
4202
|
// packages/textfield/index.js
|
|
4311
|
-
import { css as
|
|
4203
|
+
import { css as css6, html as html21 } from "lit";
|
|
4312
4204
|
import WarpElement13 from "@warp-ds/elements-core";
|
|
4313
4205
|
import { ifDefined as ifDefined6 } from "lit/directives/if-defined.js";
|
|
4314
4206
|
var WarpTextField = class extends WarpElement13 {
|
|
@@ -4379,29 +4271,7 @@ var WarpTextField = class extends WarpElement13 {
|
|
|
4379
4271
|
${this._label}
|
|
4380
4272
|
<div class="${input.wrapper}">
|
|
4381
4273
|
<slot @slotchange="${this.prefixSlotChange}" name="prefix"></slot>
|
|
4382
|
-
<input
|
|
4383
|
-
class="${this._inputStyles}"
|
|
4384
|
-
type="${this.type}"
|
|
4385
|
-
min="${ifDefined6(this.min)}"
|
|
4386
|
-
max="${ifDefined6(this.max)}"
|
|
4387
|
-
size="${ifDefined6(this.size)}"
|
|
4388
|
-
minlength="${ifDefined6(this.minLength)}"
|
|
4389
|
-
maxlength="${ifDefined6(this.maxLength)}"
|
|
4390
|
-
name="${ifDefined6(this.name)}"
|
|
4391
|
-
pattern="${ifDefined6(this.pattern)}"
|
|
4392
|
-
placeholder="${ifDefined6(this.placeholder)}"
|
|
4393
|
-
value="${ifDefined6(this.value)}"
|
|
4394
|
-
aria-describedby="${ifDefined6(this._helpId)}"
|
|
4395
|
-
aria-errormessage="${ifDefined6(this._error)}"
|
|
4396
|
-
aria-invalid="${ifDefined6(this.invalid)}"
|
|
4397
|
-
id="${this._id}"
|
|
4398
|
-
?disabled="${this.disabled}"
|
|
4399
|
-
?readonly="${this.readOnly}"
|
|
4400
|
-
?required="${this.required}"
|
|
4401
|
-
@blur="${this.handler}"
|
|
4402
|
-
@change="${this.handler}"
|
|
4403
|
-
@focus="${this.handler}"
|
|
4404
|
-
/>
|
|
4274
|
+
<input class="${this._inputStyles}" type="${this.type}" min="${ifDefined6(this.min)}" max="${ifDefined6(this.max)}" size="${ifDefined6(this.size)}" minlength="${ifDefined6(this.minLength)}" maxlength="${ifDefined6(this.maxLength)}" name="${ifDefined6(this.name)}" pattern="${ifDefined6(this.pattern)}" placeholder="${ifDefined6(this.placeholder)}" value="${ifDefined6(this.value)}" aria-describedby="${ifDefined6(this._helpId)}" aria-errormessage="${ifDefined6(this._error)}" aria-invalid="${ifDefined6(this.invalid)}" id="${this._id}" ?disabled="${this.disabled}" ?readonly="${this.readOnly}" ?required="${this.required}" @blur="${this.handler}" @change="${this.handler}" @focus="${this.handler}" />
|
|
4405
4275
|
<slot @slotchange="${this.suffixSlotChange}" name="suffix"></slot>
|
|
4406
4276
|
</div>
|
|
4407
4277
|
${this.helpText && html21`<div class="${this._helpTextStyles}" id="${this._helpId}">${this.helpText}</div>`}
|
|
@@ -4435,7 +4305,7 @@ __publicField(WarpTextField, "properties", {
|
|
|
4435
4305
|
// https://stackoverflow.com/a/61631668
|
|
4436
4306
|
__publicField(WarpTextField, "styles", [
|
|
4437
4307
|
WarpElement13.styles,
|
|
4438
|
-
|
|
4308
|
+
css6`
|
|
4439
4309
|
:host {
|
|
4440
4310
|
display: block;
|
|
4441
4311
|
}
|
|
@@ -4443,7 +4313,7 @@ __publicField(WarpTextField, "styles", [
|
|
|
4443
4313
|
margin-bottom: 0px !important;
|
|
4444
4314
|
}
|
|
4445
4315
|
.warp-input-with-prefix {
|
|
4446
|
-
padding-left:var(--w-prefix-width, 40px);
|
|
4316
|
+
padding-left: var(--w-prefix-width, 40px);
|
|
4447
4317
|
}
|
|
4448
4318
|
`
|
|
4449
4319
|
]);
|
|
@@ -4480,7 +4350,7 @@ function updateToast(id, options) {
|
|
|
4480
4350
|
}
|
|
4481
4351
|
|
|
4482
4352
|
// packages/toast/toast-container.js
|
|
4483
|
-
import { css as
|
|
4353
|
+
import { css as css7, html as html22 } from "lit";
|
|
4484
4354
|
import WarpElement14 from "@warp-ds/elements-core";
|
|
4485
4355
|
import { repeat as repeat2 } from "lit/directives/repeat.js";
|
|
4486
4356
|
var WarpToastContainer = class extends WarpElement14 {
|
|
@@ -4505,7 +4375,7 @@ var WarpToastContainer = class extends WarpElement14 {
|
|
|
4505
4375
|
collapseTasks.push(el.collapse());
|
|
4506
4376
|
}
|
|
4507
4377
|
Promise.all(collapseTasks).then(() => {
|
|
4508
|
-
if (keep.length
|
|
4378
|
+
if (keep.length !== this._toasts.size)
|
|
4509
4379
|
this._toasts = new Map(keep);
|
|
4510
4380
|
});
|
|
4511
4381
|
}, 500);
|
|
@@ -4532,12 +4402,11 @@ var WarpToastContainer = class extends WarpElement14 {
|
|
|
4532
4402
|
* @returns {ToastOptions}
|
|
4533
4403
|
*/
|
|
4534
4404
|
get(id) {
|
|
4535
|
-
if (!id)
|
|
4405
|
+
if (!id) {
|
|
4536
4406
|
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
4407
|
+
}
|
|
4537
4408
|
if (typeof id !== "string" && !Number.isInteger(id))
|
|
4538
|
-
throw new Error(
|
|
4539
|
-
'"id" must be number or string when attempting to retrieve toast'
|
|
4540
|
-
);
|
|
4409
|
+
throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
4541
4410
|
return this._toasts.get(id);
|
|
4542
4411
|
}
|
|
4543
4412
|
/**
|
|
@@ -4560,12 +4429,11 @@ var WarpToastContainer = class extends WarpElement14 {
|
|
|
4560
4429
|
* @returns {ToastOptions | false}
|
|
4561
4430
|
*/
|
|
4562
4431
|
async del(id) {
|
|
4563
|
-
if (!id)
|
|
4432
|
+
if (!id) {
|
|
4564
4433
|
throw new Error('undefined "id" given when attempting to retrieve toast');
|
|
4434
|
+
}
|
|
4565
4435
|
if (typeof id !== "string" && !Number.isInteger(id))
|
|
4566
|
-
throw new Error(
|
|
4567
|
-
'"id" must be number or string when attempting to retrieve toast'
|
|
4568
|
-
);
|
|
4436
|
+
throw new Error('"id" must be number or string when attempting to retrieve toast');
|
|
4569
4437
|
const el = this.renderRoot.querySelector(`#${id}`);
|
|
4570
4438
|
if (!this._toasts.has(id))
|
|
4571
4439
|
return false;
|
|
@@ -4581,15 +4449,7 @@ var WarpToastContainer = class extends WarpElement14 {
|
|
|
4581
4449
|
${repeat2(
|
|
4582
4450
|
this._toastsArray,
|
|
4583
4451
|
(toast3) => toast3.id,
|
|
4584
|
-
(toast3) => html22` <w-toast
|
|
4585
|
-
class="${toaster.content}"
|
|
4586
|
-
id="${toast3.id}"
|
|
4587
|
-
type="${toast3.type}"
|
|
4588
|
-
text="${toast3.text}"
|
|
4589
|
-
?canclose=${toast3.canclose}
|
|
4590
|
-
@close=${() => this.del(toast3.id)}
|
|
4591
|
-
>
|
|
4592
|
-
</w-toast>`
|
|
4452
|
+
(toast3) => html22` <w-toast class="${toaster.content}" id="${toast3.id}" type="${toast3.type}" text="${toast3.text}" ?canclose=${toast3.canclose} @close=${() => this.del(toast3.id)}> </w-toast>`
|
|
4593
4453
|
)}
|
|
4594
4454
|
</div>
|
|
4595
4455
|
</aside>
|
|
@@ -4598,7 +4458,7 @@ var WarpToastContainer = class extends WarpElement14 {
|
|
|
4598
4458
|
};
|
|
4599
4459
|
__publicField(WarpToastContainer, "styles", [
|
|
4600
4460
|
WarpElement14.styles,
|
|
4601
|
-
|
|
4461
|
+
css7`
|
|
4602
4462
|
:host {
|
|
4603
4463
|
display: block;
|
|
4604
4464
|
}
|
|
@@ -4612,7 +4472,7 @@ if (!customElements.get("w-toast-container")) {
|
|
|
4612
4472
|
}
|
|
4613
4473
|
|
|
4614
4474
|
// packages/toast/toast.js
|
|
4615
|
-
import { css as
|
|
4475
|
+
import { css as css8, html as html23 } from "lit";
|
|
4616
4476
|
import WarpElement15 from "@warp-ds/elements-core";
|
|
4617
4477
|
import { classMap as classMap2 } from "lit/directives/class-map.js";
|
|
4618
4478
|
import { when as when2 } from "lit/directives/when.js";
|
|
@@ -4744,7 +4604,7 @@ var WarpToast = class extends WarpElement15 {
|
|
|
4744
4604
|
get _iconClasses() {
|
|
4745
4605
|
return classes2({
|
|
4746
4606
|
[toast.icon]: true,
|
|
4747
|
-
[toast.iconPositive]: this.type
|
|
4607
|
+
[toast.iconPositive]: this.type === toastType.success,
|
|
4748
4608
|
[toast.iconWarning]: this.type === toastType.warning,
|
|
4749
4609
|
[toast.iconNegative]: this.type === toastType.error
|
|
4750
4610
|
});
|
|
@@ -4763,23 +4623,26 @@ var WarpToast = class extends WarpElement15 {
|
|
|
4763
4623
|
return this._error || this._warning ? "alert" : "status";
|
|
4764
4624
|
}
|
|
4765
4625
|
get _typeLabel() {
|
|
4766
|
-
if (this._warning)
|
|
4626
|
+
if (this._warning) {
|
|
4767
4627
|
return i18n._({
|
|
4768
4628
|
id: "toast.aria.warning",
|
|
4769
4629
|
message: "Warning",
|
|
4770
4630
|
comment: "Default screenreader message for warning in toast component"
|
|
4771
4631
|
});
|
|
4772
|
-
|
|
4632
|
+
}
|
|
4633
|
+
if (this._error) {
|
|
4773
4634
|
return i18n._({
|
|
4774
4635
|
id: "toast.aria.error",
|
|
4775
4636
|
message: "Error",
|
|
4776
4637
|
comment: "Default screenreader message for error in toast component"
|
|
4777
4638
|
});
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4639
|
+
} else {
|
|
4640
|
+
return i18n._({
|
|
4641
|
+
id: "toast.aria.successful",
|
|
4642
|
+
message: "Successful",
|
|
4643
|
+
comment: "Default screenreader message for successful in toast component"
|
|
4644
|
+
});
|
|
4645
|
+
}
|
|
4783
4646
|
}
|
|
4784
4647
|
get _iconMarkup() {
|
|
4785
4648
|
if (this._warning)
|
|
@@ -4828,7 +4691,7 @@ var WarpToast = class extends WarpElement15 {
|
|
|
4828
4691
|
};
|
|
4829
4692
|
__publicField(WarpToast, "styles", [
|
|
4830
4693
|
WarpElement15.styles,
|
|
4831
|
-
|
|
4694
|
+
css8`
|
|
4832
4695
|
:host {
|
|
4833
4696
|
display: block;
|
|
4834
4697
|
}
|
|
@@ -4845,7 +4708,7 @@ if (!customElements.get("w-toast")) {
|
|
|
4845
4708
|
}
|
|
4846
4709
|
|
|
4847
4710
|
// packages/utils/expand-transition.js
|
|
4848
|
-
import { css as
|
|
4711
|
+
import { css as css9, html as html24 } from "lit";
|
|
4849
4712
|
import WarpElement16 from "@warp-ds/elements-core";
|
|
4850
4713
|
import { ifDefined as ifDefined7 } from "lit/directives/if-defined.js";
|
|
4851
4714
|
var ExpandTransition = class extends WarpElement16 {
|
|
@@ -4881,9 +4744,7 @@ var ExpandTransition = class extends WarpElement16 {
|
|
|
4881
4744
|
return this != null ? this : null;
|
|
4882
4745
|
}
|
|
4883
4746
|
render() {
|
|
4884
|
-
return html24`<div aria-hidden=${ifDefined7(!this.show ? "true" : void 0)}
|
|
4885
|
-
${this._removeElement ? html24`` : html24`<slot></slot>`}
|
|
4886
|
-
</div>`;
|
|
4747
|
+
return html24`<div aria-hidden=${ifDefined7(!this.show ? "true" : void 0)}>${this._removeElement ? html24`` : html24`<slot></slot>`}</div>`;
|
|
4887
4748
|
}
|
|
4888
4749
|
};
|
|
4889
4750
|
__publicField(ExpandTransition, "properties", {
|
|
@@ -4895,7 +4756,7 @@ __publicField(ExpandTransition, "properties", {
|
|
|
4895
4756
|
});
|
|
4896
4757
|
__publicField(ExpandTransition, "styles", [
|
|
4897
4758
|
WarpElement16.styles,
|
|
4898
|
-
|
|
4759
|
+
css9`
|
|
4899
4760
|
:host {
|
|
4900
4761
|
display: block;
|
|
4901
4762
|
}
|