@scania/tegel 1.26.0 → 1.27.0-toast-aria-live.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/cjs/index-ca8040ad.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-banner.cjs.entry.js +1 -1
- package/dist/cjs/tds-checkbox.cjs.entry.js +10 -3
- package/dist/cjs/tds-chip.cjs.entry.js +7 -2
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +71 -42
- package/dist/cjs/tds-folder-tab.cjs.entry.js +21 -2
- package/dist/cjs/tds-folder-tabs.cjs.entry.js +4 -2
- package/dist/cjs/tds-icon.cjs.entry.js +1 -1
- package/dist/cjs/tds-inline-tab.cjs.entry.js +21 -2
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +4 -2
- package/dist/cjs/tds-link.cjs.entry.js +17 -3
- package/dist/cjs/tds-message.cjs.entry.js +15 -3
- package/dist/cjs/tds-modal.cjs.entry.js +74 -2
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +21 -2
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +6 -4
- package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/tds-text-field.cjs.entry.js +13 -7
- package/dist/cjs/tds-textarea.cjs.entry.js +21 -9
- package/dist/cjs/tds-toast.cjs.entry.js +11 -4
- package/dist/cjs/tds-toggle.cjs.entry.js +2 -2
- package/dist/cjs/tds-tooltip.cjs.entry.js +14 -4
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/banner/banner.css +1 -1
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js +44 -3
- package/dist/collection/components/chip/chip.js +24 -2
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +2 -2
- package/dist/collection/components/dropdown/dropdown.js +86 -40
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/iconsArray.js +96 -1
- package/dist/collection/components/link/link.js +17 -3
- package/dist/collection/components/message/message.css +44 -26
- package/dist/collection/components/message/message.js +49 -2
- package/dist/collection/components/modal/modal.js +103 -3
- package/dist/collection/components/popover-core/tds-popover-core.css +596 -53
- package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +21 -2
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +40 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.js +21 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +40 -2
- package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.js +21 -2
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +42 -4
- package/dist/collection/components/text-field/text-field.js +31 -8
- package/dist/collection/components/textarea/textarea.css +11 -6
- package/dist/collection/components/textarea/textarea.js +38 -8
- package/dist/collection/components/toast/toast.css +1 -1
- package/dist/collection/components/toast/toast.js +45 -3
- package/dist/collection/components/toggle/toggle.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +40 -4
- package/dist/collection/utils/axeHelpers.js +1 -1
- package/dist/components/{p-c65351ab.js → p-14ab9663.js} +12 -3
- package/dist/components/p-17338bcb.js +115 -0
- package/dist/components/{p-2a43e410.js → p-2d93a742.js} +5 -5
- package/dist/components/p-4487c541.js +65 -0
- package/dist/components/{p-29d19dc8.js → p-60ff84f2.js} +1 -1
- package/dist/components/{p-a64dc22e.js → p-663b8e51.js} +72 -42
- package/dist/components/{p-4c1e3344.js → p-83db8b35.js} +1 -1
- package/dist/components/{p-b1d21573.js → p-a1181b1f.js} +1 -1
- package/dist/components/p-e71e3b2e.js +2052 -0
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-banner.js +2 -2
- package/dist/components/tds-checkbox.js +1 -1
- package/dist/components/tds-chip.js +9 -3
- package/dist/components/tds-datetime.js +1 -1
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-folder-tab.js +21 -2
- package/dist/components/tds-folder-tabs.js +7 -3
- package/dist/components/tds-footer-group.js +1 -1
- package/dist/components/tds-header-cell.js +1 -1
- package/dist/components/tds-header-dropdown.js +3 -3
- package/dist/components/tds-header-hamburger.js +1 -1
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher.js +4 -4
- package/dist/components/tds-icon.js +1 -1
- package/dist/components/tds-inline-tab.js +21 -2
- package/dist/components/tds-inline-tabs.js +7 -3
- package/dist/components/tds-link.js +17 -3
- package/dist/components/tds-message.js +19 -5
- package/dist/components/tds-modal.js +78 -4
- package/dist/components/tds-navigation-tab.js +21 -2
- package/dist/components/tds-navigation-tabs.js +9 -5
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-popover-core.js +1 -1
- package/dist/components/tds-popover-menu.js +1 -1
- package/dist/components/tds-side-menu-close-button.js +1 -1
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-slider.js +1 -1
- package/dist/components/tds-step.js +1 -1
- package/dist/components/tds-table-body-input-wrapper.js +1 -1
- package/dist/components/tds-table-body-row.js +1 -1
- package/dist/components/tds-table-footer.js +4 -4
- package/dist/components/tds-table-header-input-wrapper.js +1 -1
- package/dist/components/tds-table-header.js +1 -1
- package/dist/components/tds-table-toolbar.js +1 -1
- package/dist/components/tds-text-field.js +15 -8
- package/dist/components/tds-textarea.js +36 -11
- package/dist/components/tds-toast.js +14 -5
- package/dist/components/tds-toggle.js +2 -2
- package/dist/components/tds-tooltip.js +1 -102
- package/dist/esm/index-51d04e39.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-banner.entry.js +1 -1
- package/dist/esm/tds-checkbox.entry.js +10 -3
- package/dist/esm/tds-chip.entry.js +7 -2
- package/dist/esm/tds-dropdown_2.entry.js +71 -42
- package/dist/esm/tds-folder-tab.entry.js +22 -3
- package/dist/esm/tds-folder-tabs.entry.js +4 -2
- package/dist/esm/tds-icon.entry.js +1 -1
- package/dist/esm/tds-inline-tab.entry.js +22 -3
- package/dist/esm/tds-inline-tabs.entry.js +4 -2
- package/dist/esm/tds-link.entry.js +17 -3
- package/dist/esm/tds-message.entry.js +15 -3
- package/dist/esm/tds-modal.entry.js +74 -2
- package/dist/esm/tds-navigation-tab.entry.js +22 -3
- package/dist/esm/tds-navigation-tabs.entry.js +6 -4
- package/dist/esm/tds-popover-core.entry.js +1 -1
- package/dist/esm/tds-text-field.entry.js +13 -7
- package/dist/esm/tds-textarea.entry.js +21 -9
- package/dist/esm/tds-toast.entry.js +11 -4
- package/dist/esm/tds-toggle.entry.js +2 -2
- package/dist/esm/tds-tooltip.entry.js +14 -4
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-0f2c9507.entry.js +1 -0
- package/dist/tegel/p-125a6b06.entry.js +1 -0
- package/dist/tegel/p-28517288.entry.js +1 -0
- package/dist/tegel/p-2af57972.entry.js +1 -0
- package/dist/tegel/{p-be1d1345.entry.js → p-4465f687.entry.js} +1 -1
- package/dist/tegel/p-668b7662.entry.js +1 -0
- package/dist/tegel/p-746e2927.entry.js +1 -0
- package/dist/tegel/p-754a4921.entry.js +1 -0
- package/dist/tegel/{p-46205cfb.entry.js → p-769d0503.entry.js} +1 -1
- package/dist/tegel/p-843413ba.entry.js +1 -0
- package/dist/tegel/p-97f10223.entry.js +1 -0
- package/dist/tegel/p-a21250b8.entry.js +1 -0
- package/dist/tegel/p-aadb2553.entry.js +1 -0
- package/dist/tegel/p-ad9a2141.entry.js +1 -0
- package/dist/tegel/p-b08886e3.entry.js +1 -0
- package/dist/tegel/p-b114ec3d.entry.js +1 -0
- package/dist/tegel/p-c3607f10.entry.js +1 -0
- package/dist/tegel/p-ddda64eb.entry.js +1 -0
- package/dist/tegel/p-eaa279dd.entry.js +1 -0
- package/dist/tegel/p-ee960089.entry.js +1 -0
- package/dist/tegel/tegel.css +13 -3
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +5 -0
- package/dist/types/components/chip/chip.d.ts +3 -0
- package/dist/types/components/dropdown/dropdown.d.ts +5 -0
- package/dist/types/components/message/message.d.ts +5 -0
- package/dist/types/components/modal/modal.d.ts +6 -0
- package/dist/types/components/tabs/folder-tabs/folder-tab/folder-tab.d.ts +2 -0
- package/dist/types/components/tabs/folder-tabs/folder-tabs.d.ts +4 -0
- package/dist/types/components/tabs/inline-tabs/inline-tab/inline-tab.d.ts +2 -0
- package/dist/types/components/tabs/inline-tabs/inline-tabs.d.ts +4 -0
- package/dist/types/components/tabs/navigation-tabs/navigation-tab/navigation-tab.d.ts +2 -0
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.d.ts +4 -0
- package/dist/types/components/text-field/text-field.d.ts +4 -1
- package/dist/types/components/textarea/textarea.d.ts +7 -4
- package/dist/types/components/toast/toast.d.ts +5 -0
- package/dist/types/components/tooltip/tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +146 -2
- package/dist/types/types/Icons.d.ts +1 -1
- package/dist/types/utils/axeHelpers.d.ts +1 -2
- package/package.json +1 -1
- package/dist/components/p-4764a1d5.js +0 -2052
- package/dist/components/p-a2b7bdef.js +0 -65
- package/dist/tegel/p-065d6f83.entry.js +0 -1
- package/dist/tegel/p-0c1e632d.entry.js +0 -1
- package/dist/tegel/p-168122a7.entry.js +0 -1
- package/dist/tegel/p-19eb4ae1.entry.js +0 -1
- package/dist/tegel/p-4e298888.entry.js +0 -1
- package/dist/tegel/p-4e33cbda.entry.js +0 -1
- package/dist/tegel/p-4ee344e5.entry.js +0 -1
- package/dist/tegel/p-64c80f14.entry.js +0 -1
- package/dist/tegel/p-72fd0083.entry.js +0 -1
- package/dist/tegel/p-93a4bd11.entry.js +0 -1
- package/dist/tegel/p-9e0b31a1.entry.js +0 -1
- package/dist/tegel/p-a0fc0cc2.entry.js +0 -1
- package/dist/tegel/p-b35e7208.entry.js +0 -1
- package/dist/tegel/p-b6526302.entry.js +0 -1
- package/dist/tegel/p-b686f1ad.entry.js +0 -1
- package/dist/tegel/p-cca85da0.entry.js +0 -1
- package/dist/tegel/p-d0abf078.entry.js +0 -1
- package/dist/tegel/p-dcbc35af.entry.js +0 -1
|
@@ -45,6 +45,8 @@ export class TdsToast {
|
|
|
45
45
|
this.hidden = false;
|
|
46
46
|
this.closable = true;
|
|
47
47
|
this.toastRole = 'alert';
|
|
48
|
+
this.tdsCloseAriaLabel = undefined;
|
|
49
|
+
this.tdsAriaLive = 'polite';
|
|
48
50
|
}
|
|
49
51
|
/** Hides the Toast. */
|
|
50
52
|
async hideToast() {
|
|
@@ -54,16 +56,21 @@ export class TdsToast {
|
|
|
54
56
|
async showToast() {
|
|
55
57
|
this.hidden = false;
|
|
56
58
|
}
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
if (!this.tdsCloseAriaLabel) {
|
|
61
|
+
console.warn('tds-toast: tdsCloseAriaLabel is required');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
57
64
|
render() {
|
|
58
65
|
const usesHeaderSlot = hasSlot('header', this.host);
|
|
59
66
|
const usesSubheaderSlot = hasSlot('subheader', this.host);
|
|
60
67
|
const usesActionsSlot = hasSlot('actions', this.host);
|
|
61
|
-
return (h(Host, { key: '
|
|
68
|
+
return (h(Host, { key: '9ebb217351e9fbdcb0bfef105969785e745bc184', "aria-live": this.tdsAriaLive, toastRole: this.toastRole, "aria-describedby": this.host.getAttribute('aria-describedby'), class: {
|
|
62
69
|
hide: this.hidden,
|
|
63
70
|
show: !this.hidden,
|
|
64
|
-
} }, h("div", { key: '
|
|
71
|
+
} }, h("div", { key: '361405e5f7b34ff4c450499ff5752ef3bb29c21a', class: `
|
|
65
72
|
wrapper
|
|
66
|
-
${this.variant}` }, h("tds-icon", { key: '
|
|
73
|
+
${this.variant}` }, h("tds-icon", { key: 'a905925f5a8825b0d4fdc278e2d958da31f24cc5', name: this.getIconName(), size: "20px" }), h("div", { key: 'c36eaed915074c188796476ccb6b3d48d1598272', class: `content` }, h("div", { key: 'd68b085fa0fd744f7e5b1f34e26fbb72c48ea65b', class: "header-subheader" }, this.header && h("div", { key: '7eb63f483c727f6dd21ea13f794f91daca138418', class: "header" }, this.header), usesHeaderSlot && h("slot", { key: '60393a0dd231897d27d01b2d8e5d0d563e917503', name: "header" }), this.subheader && h("div", { key: '4051a94947a9987f4c645c440de8f8cf4002911b', class: "subheader" }, this.subheader), usesSubheaderSlot && h("slot", { key: '1902bd9666847e51ac7bbc2f74d232f822d35127', name: "subheader" })), usesActionsSlot && (h("div", { key: '13c4debc87ca9b66f3c4155b6ccd7df39b9b98f6', class: `toast-bottom ${usesSubheaderSlot || this.subheader ? 'subheader' : 'no-subheader'}` }, h("slot", { key: '05867f3250802cafe5a63d0583b626a819d5fdd9', name: "actions" })))), this.closable && (h("button", { key: 'da371c19b03e68d35e9a9251768cce8e3b5b23d9', id: "my-button", "aria-label": this.tdsCloseAriaLabel, onClick: this.handleClose, class: "close" }, h("tds-icon", { key: 'c09b9920715bec51cbc9b190e176578a2d1f0627', name: "cross", size: "20px" }))))));
|
|
67
74
|
}
|
|
68
75
|
static get is() { return "tds-toast"; }
|
|
69
76
|
static get encapsulation() { return "shadow"; }
|
|
@@ -202,6 +209,41 @@ export class TdsToast {
|
|
|
202
209
|
"attribute": "toast-role",
|
|
203
210
|
"reflect": false,
|
|
204
211
|
"defaultValue": "'alert'"
|
|
212
|
+
},
|
|
213
|
+
"tdsCloseAriaLabel": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"mutable": false,
|
|
216
|
+
"complexType": {
|
|
217
|
+
"original": "string",
|
|
218
|
+
"resolved": "string",
|
|
219
|
+
"references": {}
|
|
220
|
+
},
|
|
221
|
+
"required": false,
|
|
222
|
+
"optional": false,
|
|
223
|
+
"docs": {
|
|
224
|
+
"tags": [],
|
|
225
|
+
"text": "Provides an accessible name for the components close button"
|
|
226
|
+
},
|
|
227
|
+
"attribute": "tds-close-aria-label",
|
|
228
|
+
"reflect": false
|
|
229
|
+
},
|
|
230
|
+
"tdsAriaLive": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"mutable": false,
|
|
233
|
+
"complexType": {
|
|
234
|
+
"original": "'polite' | 'assertive'",
|
|
235
|
+
"resolved": "\"assertive\" | \"polite\"",
|
|
236
|
+
"references": {}
|
|
237
|
+
},
|
|
238
|
+
"required": false,
|
|
239
|
+
"optional": false,
|
|
240
|
+
"docs": {
|
|
241
|
+
"tags": [],
|
|
242
|
+
"text": "ARIA live for the Toast."
|
|
243
|
+
},
|
|
244
|
+
"attribute": "tds-aria-live",
|
|
245
|
+
"reflect": false,
|
|
246
|
+
"defaultValue": "'polite'"
|
|
205
247
|
}
|
|
206
248
|
};
|
|
207
249
|
}
|
|
@@ -38,10 +38,10 @@ export class TdsToggle {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
|
-
return (h("div", { key: '
|
|
41
|
+
return (h("div", { key: '99809ab8c95f98930769fde49bb128c866fb4288', class: "tds-toggle" }, this.headline && (h("div", { key: '679f7488d0d0ec41e8c1c31234ffcc02fb7c811f', class: {
|
|
42
42
|
'toggle-headline': true,
|
|
43
43
|
'disabled': this.disabled,
|
|
44
|
-
} }, this.headline)), h("input", { key: '
|
|
44
|
+
} }, this.headline)), h("input", { key: 'f08284dc8c171da0694a3b86c6ffb206861080cd', "aria-label": this.tdsAriaLabel, "aria-describedby": this.host.getAttribute('aria-describedby'), "aria-labelledby": this.host.getAttribute('aria-labelledby'), "aria-checked": this.checked, "aria-required": this.required, onChange: () => this.handleToggle(), class: `${this.size}`, checked: this.checked, disabled: this.disabled, required: this.required, type: "checkbox", name: this.name, id: this.toggleId, role: "switch" }), this.labelSlot && (h("label", { key: 'f5d7e6e3ac11cbc7b2eac4fcb2cebcd6f015c2bc', class: { disabled: this.disabled }, htmlFor: this.toggleId }, h("slot", { key: '686d693e4ec91573fe9c40eba7a67e7933f37dde', name: "label" })))));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "tds-toggle"; }
|
|
47
47
|
static get encapsulation() { return "scoped"; }
|
|
@@ -40,6 +40,12 @@ export class TdsTooltip {
|
|
|
40
40
|
this.placement = 'bottom';
|
|
41
41
|
this.offsetSkidding = 0;
|
|
42
42
|
this.offsetDistance = 8;
|
|
43
|
+
this.tdsAriaDescribedby = undefined;
|
|
44
|
+
}
|
|
45
|
+
handleKeyDown(event) {
|
|
46
|
+
if (event.key === 'Escape' && this.show) {
|
|
47
|
+
this.show = false;
|
|
48
|
+
}
|
|
43
49
|
}
|
|
44
50
|
componentWillLoad() {
|
|
45
51
|
this.inheritedAttributes = inheritAttributes(this.host, ['style', 'class']);
|
|
@@ -52,16 +58,20 @@ export class TdsTooltip {
|
|
|
52
58
|
}
|
|
53
59
|
render() {
|
|
54
60
|
var _a;
|
|
55
|
-
return (h(Host, { key: '
|
|
61
|
+
return (h(Host, { key: '366a9ef9c61be66f0bd4559df61959e66df7ccde', role: "tooltip", "aria-describedby": this.tdsAriaDescribedby, "aria-label": this.text }, h("tds-popover-core", Object.assign({ key: 'a3e941deb73b41565f82bfcd972e88f3b3a9a4cc' }, this.inheritedAttributes, { class: {
|
|
56
62
|
'tds-tooltip': true,
|
|
57
63
|
[`tds-tooltip-${this.border}`]: true,
|
|
58
64
|
[(_a = this.inheritedAttributes.class) !== null && _a !== void 0 ? _a : '']: true,
|
|
59
65
|
'tds-tooltip-show': this.show,
|
|
60
|
-
}, selector: this.selector, referenceEl: this.referenceEl, trigger: this.determineTrigger(), modifiers: this.popperjsExtraModifiers, offsetSkidding: this.offsetSkidding, offsetDistance: this.offsetDistance, show: this.show, placement: this.placement, autoHide: false,
|
|
66
|
+
}, selector: this.selector, referenceEl: this.referenceEl, trigger: this.determineTrigger(), modifiers: this.popperjsExtraModifiers, offsetSkidding: this.offsetSkidding, offsetDistance: this.offsetDistance, show: this.show, placement: this.placement, autoHide: false,
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
onInternalTdsShow: () => {
|
|
61
69
|
this.show = true;
|
|
62
|
-
},
|
|
70
|
+
},
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
onInternalTdsClose: () => {
|
|
63
73
|
this.show = false;
|
|
64
|
-
}, defaultShow: this.defaultShow }), this.text, h("slot", { key: '
|
|
74
|
+
}, defaultShow: this.defaultShow }), this.text, h("slot", { key: '33b71eda3f8d5e3c5f711edac7ed7974b09843a8' }))));
|
|
65
75
|
}
|
|
66
76
|
static get is() { return "tds-tooltip"; }
|
|
67
77
|
static get encapsulation() { return "scoped"; }
|
|
@@ -263,8 +273,34 @@ export class TdsTooltip {
|
|
|
263
273
|
"attribute": "offset-distance",
|
|
264
274
|
"reflect": false,
|
|
265
275
|
"defaultValue": "8"
|
|
276
|
+
},
|
|
277
|
+
"tdsAriaDescribedby": {
|
|
278
|
+
"type": "string",
|
|
279
|
+
"mutable": false,
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "string",
|
|
282
|
+
"resolved": "string",
|
|
283
|
+
"references": {}
|
|
284
|
+
},
|
|
285
|
+
"required": false,
|
|
286
|
+
"optional": false,
|
|
287
|
+
"docs": {
|
|
288
|
+
"tags": [],
|
|
289
|
+
"text": "Sets the aria-describedby attribute"
|
|
290
|
+
},
|
|
291
|
+
"attribute": "tds-aria-describedby",
|
|
292
|
+
"reflect": false
|
|
266
293
|
}
|
|
267
294
|
};
|
|
268
295
|
}
|
|
269
296
|
static get elementRef() { return "host"; }
|
|
297
|
+
static get listeners() {
|
|
298
|
+
return [{
|
|
299
|
+
"name": "keydown",
|
|
300
|
+
"method": "handleKeyDown",
|
|
301
|
+
"target": "window",
|
|
302
|
+
"capture": false,
|
|
303
|
+
"passive": false
|
|
304
|
+
}];
|
|
305
|
+
}
|
|
270
306
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import AxeBuilder from "@axe-core/playwright";
|
|
2
|
-
const disabledRules = ['page-has-heading-one', 'landmark-one-main', 'region'];
|
|
2
|
+
const disabledRules = ['page-has-heading-one', 'landmark-one-main', 'region', 'color-contrast'];
|
|
3
3
|
export const tegelAnalyze = async (page) => new AxeBuilder({ page }).disableRules(disabledRules).analyze();
|
|
@@ -28,6 +28,8 @@ const TdsCheckbox = /*@__PURE__*/ proxyCustomElement(class TdsCheckbox extends H
|
|
|
28
28
|
this.checked = false;
|
|
29
29
|
this.indeterminate = false;
|
|
30
30
|
this.value = undefined;
|
|
31
|
+
this.tdsAriaLabel = undefined;
|
|
32
|
+
this.tdsAriaDescribedby = undefined;
|
|
31
33
|
}
|
|
32
34
|
/** Toggles the checked value of the component. */
|
|
33
35
|
async toggleCheckbox() {
|
|
@@ -56,12 +58,17 @@ const TdsCheckbox = /*@__PURE__*/ proxyCustomElement(class TdsCheckbox extends H
|
|
|
56
58
|
this.indeterminate = false;
|
|
57
59
|
}
|
|
58
60
|
}
|
|
61
|
+
connectedCallback() {
|
|
62
|
+
if (!this.tdsAriaLabel) {
|
|
63
|
+
console.warn('Tegel Checkbox component: tdsAriaLabel prop is missing');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
59
66
|
render() {
|
|
60
|
-
return (h("div", { key: '
|
|
67
|
+
return (h("div", { key: '26c1c30edd11f3d1dc76beffa496b93841a7dac5', class: "tds-checkbox" }, h("input", { key: 'ebb9d474d9f726248f7a0c9079c5474431d18104',
|
|
61
68
|
// eslint-disable-next-line no-return-assign
|
|
62
|
-
ref: (inputElement) => (this.inputElement = inputElement), indeterminate: this.indeterminate, "aria-checked": this.checked, "aria-required": this.required, "aria-
|
|
69
|
+
ref: (inputElement) => (this.inputElement = inputElement), indeterminate: this.indeterminate, "aria-checked": this.checked, "aria-required": this.required, "aria-label": this.tdsAriaLabel, "aria-describedby": this.tdsAriaDescribedby, required: this.required, type: "checkbox", name: this.name, value: this.value, id: this.checkboxId, checked: this.checked, disabled: this.disabled, onFocus: (event) => this.handleFocus(event), onBlur: (event) => this.handleBlur(event), onChange: () => {
|
|
63
70
|
this.handleChange();
|
|
64
|
-
} }), h("label", { key: '
|
|
71
|
+
} }), h("label", { key: '68e89bdc35cc5f37756cdbde5f563bf64e334310', htmlFor: this.checkboxId }, h("slot", { key: 'f5122194e84705f82c8f148feadfc2787577c346', name: "label" }))));
|
|
65
72
|
}
|
|
66
73
|
get host() { return this; }
|
|
67
74
|
static get watchers() { return {
|
|
@@ -76,6 +83,8 @@ const TdsCheckbox = /*@__PURE__*/ proxyCustomElement(class TdsCheckbox extends H
|
|
|
76
83
|
"checked": [1540],
|
|
77
84
|
"indeterminate": [1028],
|
|
78
85
|
"value": [1],
|
|
86
|
+
"tdsAriaLabel": [1, "tds-aria-label"],
|
|
87
|
+
"tdsAriaDescribedby": [1, "tds-aria-describedby"],
|
|
79
88
|
"toggleCheckbox": [64]
|
|
80
89
|
}, [[4, "reset", "handleFormReset"]], {
|
|
81
90
|
"indeterminate": ["handleIndeterminateState"]
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
2
|
+
import { i as inheritAttributes } from './p-3fe9cbbf.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './p-e71e3b2e.js';
|
|
4
|
+
|
|
5
|
+
const tooltipCss = ".sc-tds-tooltip-h{position:absolute}.tds-tooltip.sc-tds-tooltip{box-sizing:border-box;font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);color:var(--tds-tooltip-color);background-color:var(--tds-tooltip-background);border-radius:4px;padding:8px;word-wrap:break-word;white-space:normal;max-width:192px;z-index:900;opacity:0;visibility:hidden;transition:opacity 200ms ease-in, visibility 200ms ease-in}.tds-tooltip.sc-tds-tooltip *.sc-tds-tooltip{box-sizing:border-box}.tds-tooltip.tds-tooltip-top-left.sc-tds-tooltip{border-radius:0 4px 4px}.tds-tooltip.tds-tooltip-top-right.sc-tds-tooltip{border-radius:4px 0 4px 4px}.tds-tooltip.tds-tooltip-bottom-right.sc-tds-tooltip{border-radius:4px 4px 0}.tds-tooltip.tds-tooltip-bottom-left.sc-tds-tooltip{border-radius:4px 4px 4px 0}.tds-tooltip-show.sc-tds-tooltip{opacity:1;visibility:visible}";
|
|
6
|
+
const TdsTooltipStyle0 = tooltipCss;
|
|
7
|
+
|
|
8
|
+
const TdsTooltip = /*@__PURE__*/ proxyCustomElement(class TdsTooltip extends H {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.popperjsExtraModifiers = [
|
|
13
|
+
{
|
|
14
|
+
name: 'positionCalc',
|
|
15
|
+
enabled: true,
|
|
16
|
+
phase: 'main',
|
|
17
|
+
fn: ({ state }) => {
|
|
18
|
+
if (state.placement === 'bottom-start' || state.placement === 'right-start') {
|
|
19
|
+
this.border = 'top-left';
|
|
20
|
+
}
|
|
21
|
+
else if (state.placement === 'bottom-end' || state.placement === 'left-start') {
|
|
22
|
+
this.border = 'top-right';
|
|
23
|
+
}
|
|
24
|
+
else if (state.placement === 'top-end' || state.placement === 'left-end') {
|
|
25
|
+
this.border = 'bottom-right';
|
|
26
|
+
}
|
|
27
|
+
else if (state.placement === 'top-start' || state.placement === 'right-end') {
|
|
28
|
+
this.border = 'bottom-left';
|
|
29
|
+
}
|
|
30
|
+
else if (state.placement === 'bottom' || state.placement === 'top') {
|
|
31
|
+
this.border = 'default';
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
this.inheritedAttributes = [];
|
|
37
|
+
this.text = '';
|
|
38
|
+
this.selector = undefined;
|
|
39
|
+
this.referenceEl = undefined;
|
|
40
|
+
this.defaultShow = false;
|
|
41
|
+
this.mouseOverTooltip = false;
|
|
42
|
+
this.trigger = 'hover';
|
|
43
|
+
this.show = null;
|
|
44
|
+
this.placement = 'bottom';
|
|
45
|
+
this.offsetSkidding = 0;
|
|
46
|
+
this.offsetDistance = 8;
|
|
47
|
+
this.tdsAriaDescribedby = undefined;
|
|
48
|
+
}
|
|
49
|
+
handleKeyDown(event) {
|
|
50
|
+
if (event.key === 'Escape' && this.show) {
|
|
51
|
+
this.show = false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
componentWillLoad() {
|
|
55
|
+
this.inheritedAttributes = inheritAttributes(this.host, ['style', 'class']);
|
|
56
|
+
}
|
|
57
|
+
determineTrigger() {
|
|
58
|
+
if (this.trigger === 'hover') {
|
|
59
|
+
return this.mouseOverTooltip ? 'hover-popover' : 'hover';
|
|
60
|
+
}
|
|
61
|
+
return this.trigger;
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
var _a;
|
|
65
|
+
return (h(Host, { key: '366a9ef9c61be66f0bd4559df61959e66df7ccde', role: "tooltip", "aria-describedby": this.tdsAriaDescribedby, "aria-label": this.text }, h("tds-popover-core", Object.assign({ key: 'a3e941deb73b41565f82bfcd972e88f3b3a9a4cc' }, this.inheritedAttributes, { class: {
|
|
66
|
+
'tds-tooltip': true,
|
|
67
|
+
[`tds-tooltip-${this.border}`]: true,
|
|
68
|
+
[(_a = this.inheritedAttributes.class) !== null && _a !== void 0 ? _a : '']: true,
|
|
69
|
+
'tds-tooltip-show': this.show,
|
|
70
|
+
}, selector: this.selector, referenceEl: this.referenceEl, trigger: this.determineTrigger(), modifiers: this.popperjsExtraModifiers, offsetSkidding: this.offsetSkidding, offsetDistance: this.offsetDistance, show: this.show, placement: this.placement, autoHide: false,
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
onInternalTdsShow: () => {
|
|
73
|
+
this.show = true;
|
|
74
|
+
},
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
onInternalTdsClose: () => {
|
|
77
|
+
this.show = false;
|
|
78
|
+
}, defaultShow: this.defaultShow }), this.text, h("slot", { key: '33b71eda3f8d5e3c5f711edac7ed7974b09843a8' }))));
|
|
79
|
+
}
|
|
80
|
+
get host() { return this; }
|
|
81
|
+
static get style() { return TdsTooltipStyle0; }
|
|
82
|
+
}, [6, "tds-tooltip", {
|
|
83
|
+
"text": [1],
|
|
84
|
+
"selector": [1],
|
|
85
|
+
"referenceEl": [16],
|
|
86
|
+
"defaultShow": [4, "default-show"],
|
|
87
|
+
"mouseOverTooltip": [4, "mouse-over-tooltip"],
|
|
88
|
+
"trigger": [1],
|
|
89
|
+
"show": [1028],
|
|
90
|
+
"placement": [1],
|
|
91
|
+
"offsetSkidding": [2, "offset-skidding"],
|
|
92
|
+
"offsetDistance": [2, "offset-distance"],
|
|
93
|
+
"tdsAriaDescribedby": [1, "tds-aria-describedby"]
|
|
94
|
+
}, [[8, "keydown", "handleKeyDown"]]]);
|
|
95
|
+
function defineCustomElement() {
|
|
96
|
+
if (typeof customElements === "undefined") {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const components = ["tds-tooltip", "tds-popover-core"];
|
|
100
|
+
components.forEach(tagName => { switch (tagName) {
|
|
101
|
+
case "tds-tooltip":
|
|
102
|
+
if (!customElements.get(tagName)) {
|
|
103
|
+
customElements.define(tagName, TdsTooltip);
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
case "tds-popover-core":
|
|
107
|
+
if (!customElements.get(tagName)) {
|
|
108
|
+
defineCustomElement$1();
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
} });
|
|
112
|
+
}
|
|
113
|
+
defineCustomElement();
|
|
114
|
+
|
|
115
|
+
export { TdsTooltip as T, defineCustomElement as d };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
|
|
2
|
-
import {
|
|
3
|
-
import { d as defineCustomElement$2 } from './p-
|
|
4
|
-
import { d as defineCustomElement$1 } from './p-
|
|
2
|
+
import { c as convertToString } from './p-a1181b1f.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './p-14ab9663.js';
|
|
4
|
+
import { d as defineCustomElement$1 } from './p-4487c541.js';
|
|
5
5
|
|
|
6
6
|
const dropdownOptionCss = ":host{box-sizing:border-box;display:block;background-color:var(--tds-dropdown-option-background)}:host *{box-sizing:border-box}:host .dropdown-option{color:var(--tds-dropdown-option-color);border-bottom:1px solid var(--tds-dropdown-option-border);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);overflow-wrap:anywhere;transition:background-color var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host .dropdown-option.selected{background-color:var(--tds-dropdown-option-background-selected)}:host .dropdown-option.disabled{color:var(--tds-dropdown-option-color-disabled)}:host .dropdown-option button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .dropdown-option button{all:unset;width:100%}:host .dropdown-option button.lg{padding:19px 0 20px}:host .dropdown-option button.md{padding:15px 0 16px}:host .dropdown-option button.sm{padding:11px 0 12px}:host .dropdown-option button.xs{padding:7px 0 8px}:host .dropdown-option button .single-select{display:flex;align-items:center;justify-content:space-between;padding:0 16px}:host .dropdown-option .multiselect{width:100%;height:100%}:host .dropdown-option .multiselect tds-checkbox{display:flex;height:100%;width:100%}:host .dropdown-option .multiselect tds-checkbox.lg{padding:15px 16px 16px}:host .dropdown-option .multiselect tds-checkbox.md{padding:11px 16px 12px}:host .dropdown-option .multiselect tds-checkbox.sm{padding:7px 16px 8px}:host .dropdown-option .multiselect tds-checkbox.xs{padding:7px 16px 8px}:host .dropdown-option:hover{background-color:var(--tds-dropdown-option-background-hover);cursor:pointer}:host .dropdown-option:hover.disabled{background-color:var(--tds-dropdown-option-background);cursor:not-allowed}:host([hidden]){display:none}";
|
|
7
7
|
const TdsDropdownOptionStyle0 = dropdownOptionCss;
|
|
@@ -89,7 +89,7 @@ const TdsDropdownOption = /*@__PURE__*/ proxyCustomElement(class TdsDropdownOpti
|
|
|
89
89
|
this.internalValue = convertToString(this.value);
|
|
90
90
|
}
|
|
91
91
|
render() {
|
|
92
|
-
return (h(Host, { key: '
|
|
92
|
+
return (h(Host, { key: 'f471d5238869b3a522b36d99d7549c1229cd83a2' }, h("div", { key: 'da9edccba96999b0ee40f8c599325774593de814', class: `dropdown-option
|
|
93
93
|
${this.size}
|
|
94
94
|
${this.selected ? 'selected' : ''}
|
|
95
95
|
${this.disabled ? 'disabled' : ''}
|
|
@@ -101,7 +101,7 @@ const TdsDropdownOption = /*@__PURE__*/ proxyCustomElement(class TdsDropdownOpti
|
|
|
101
101
|
this.handleMultiselect(event);
|
|
102
102
|
}, disabled: this.disabled, checked: this.selected, class: {
|
|
103
103
|
[this.size]: true,
|
|
104
|
-
} }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { onClick: () => {
|
|
104
|
+
} }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected, onClick: () => {
|
|
105
105
|
this.handleSingleSelect();
|
|
106
106
|
}, onFocus: (event) => this.handleFocus(event), onBlur: (event) => this.handleBlur(event), disabled: this.disabled, class: this.size }, h("div", { class: "single-select" }, h("slot", null), this.selected && h("tds-icon", { name: "tick", size: "16px" })))))));
|
|
107
107
|
}
|