@scania/tegel 1.25.0-fix-a11y-checkbox-beta.0 → 1.25.0-header-item-slot.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.
Files changed (55) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tds-badge.cjs.entry.js +9 -5
  3. package/dist/cjs/tds-block.cjs.entry.js +1 -3
  4. package/dist/cjs/tds-card.cjs.entry.js +5 -5
  5. package/dist/cjs/tds-checkbox.cjs.entry.js +3 -13
  6. package/dist/cjs/tds-core-header-item_2.cjs.entry.js +34 -2
  7. package/dist/cjs/tegel.cjs.js +1 -1
  8. package/dist/collection/components/badge/badge.js +9 -24
  9. package/dist/collection/components/block/block.js +2 -27
  10. package/dist/collection/components/card/card.js +5 -5
  11. package/dist/collection/components/checkbox/checkbox.js +3 -30
  12. package/dist/collection/components/header/header-item/header-item.js +34 -2
  13. package/dist/collection/utils/axeHelpers.js +1 -1
  14. package/dist/components/{p-3a7f88ff.js → p-368c544b.js} +34 -2
  15. package/dist/components/{p-96d51054.js → p-6c2d5c85.js} +1 -1
  16. package/dist/components/{p-ece57b20.js → p-eac79032.js} +3 -14
  17. package/dist/components/{p-f1980746.js → p-eef8fec0.js} +1 -1
  18. package/dist/components/tds-badge.js +9 -7
  19. package/dist/components/tds-block.js +2 -5
  20. package/dist/components/tds-card.js +5 -5
  21. package/dist/components/tds-checkbox.js +1 -1
  22. package/dist/components/tds-dropdown-option.js +1 -1
  23. package/dist/components/tds-header-brand-symbol.js +1 -1
  24. package/dist/components/tds-header-dropdown.js +1 -1
  25. package/dist/components/tds-header-hamburger.js +1 -1
  26. package/dist/components/tds-header-item.js +1 -1
  27. package/dist/components/tds-header-launcher-button.js +1 -1
  28. package/dist/components/tds-header-launcher.js +2 -2
  29. package/dist/components/tds-table-body-row.js +1 -1
  30. package/dist/components/tds-table-footer.js +2 -2
  31. package/dist/components/tds-table-header.js +1 -1
  32. package/dist/esm/loader.js +1 -1
  33. package/dist/esm/tds-badge.entry.js +9 -5
  34. package/dist/esm/tds-block.entry.js +1 -3
  35. package/dist/esm/tds-card.entry.js +5 -5
  36. package/dist/esm/tds-checkbox.entry.js +3 -13
  37. package/dist/esm/tds-core-header-item_2.entry.js +34 -2
  38. package/dist/esm/tegel.js +1 -1
  39. package/dist/tegel/p-69b38504.entry.js +1 -0
  40. package/dist/tegel/p-9016758e.entry.js +1 -0
  41. package/dist/tegel/p-d926d075.entry.js +1 -0
  42. package/dist/tegel/p-ddd33cce.entry.js +1 -0
  43. package/dist/tegel/p-ec95f70b.entry.js +1 -0
  44. package/dist/tegel/tegel.esm.js +1 -1
  45. package/dist/types/components/badge/badge.d.ts +0 -3
  46. package/dist/types/components/block/block.d.ts +1 -8
  47. package/dist/types/components/checkbox/checkbox.d.ts +0 -3
  48. package/dist/types/components/header/header-item/header-item.d.ts +7 -0
  49. package/dist/types/components.d.ts +0 -58
  50. package/package.json +1 -1
  51. package/dist/tegel/p-5242a1f6.entry.js +0 -1
  52. package/dist/tegel/p-a5e0f030.entry.js +0 -1
  53. package/dist/tegel/p-d027f6b9.entry.js +0 -1
  54. package/dist/tegel/p-e328e039.entry.js +0 -1
  55. package/dist/tegel/p-f4db0231.entry.js +0 -1
@@ -20,14 +20,13 @@ export class TdsCard {
20
20
  const usesHeaderSlot = hasSlot('header', this.host);
21
21
  const usesSubheaderSlot = hasSlot('subheader', this.host);
22
22
  const usesThumbnailSlot = hasSlot('thumbnail', this.host);
23
- return (h("div", { class: "card-header" }, usesThumbnailSlot && h("slot", { name: "thumbnail" }), h("div", { class: "header-subheader", id: `header-${this.cardId}` }, this.header && h("span", { class: "header" }, this.header), usesHeaderSlot && h("slot", { name: "header" }), this.subheader && h("span", { class: "subheader" }, this.subheader), usesSubheaderSlot && h("slot", { name: "subheader" }))));
23
+ return (h("div", { class: "card-header" }, usesThumbnailSlot && h("slot", { name: "thumbnail" }), h("div", { class: "header-subheader" }, this.header && h("span", { class: "header" }, this.header), usesHeaderSlot && h("slot", { name: "header" }), this.subheader && h("span", { class: "subheader" }, this.subheader), usesSubheaderSlot && h("slot", { name: "subheader" }))));
24
24
  };
25
25
  this.getCardContent = () => {
26
26
  const usesBodySlot = hasSlot('body', this.host);
27
27
  const usesBodyImageSlot = hasSlot('body-image', this.host);
28
28
  const usesActionsSlot = hasSlot('actions', this.host);
29
- const bodyId = `body-${this.cardId}`;
30
- return (h("div", { class: this.stretch && 'stretch', "aria-describedby": usesBodySlot ? bodyId : null }, this.imagePlacement === 'below-header' && this.getCardHeader(), h("div", { class: "card-body", id: bodyId }, usesBodyImageSlot && h("slot", { name: "body-image" }), this.bodyImg && h("img", { class: "card-body-img", src: this.bodyImg, alt: this.bodyImgAlt }), this.imagePlacement === 'above-header' && this.getCardHeader(), this.bodyDivider && h("tds-divider", null), usesBodySlot && h("slot", { name: "body" })), usesActionsSlot && h("slot", { name: `actions` })));
29
+ return (h("div", { class: this.stretch && 'stretch' }, this.imagePlacement === 'below-header' && this.getCardHeader(), h("div", { class: `card-body` }, usesBodyImageSlot && h("slot", { name: "body-image" }), this.bodyImg && h("img", { class: "card-body-img", src: this.bodyImg, alt: this.bodyImgAlt }), this.imagePlacement === 'above-header' && this.getCardHeader(), this.bodyDivider && h("tds-divider", null), usesBodySlot && h("slot", { name: "body" })), usesActionsSlot && h("slot", { name: `actions` })));
31
30
  };
32
31
  this.modeVariant = null;
33
32
  this.imagePlacement = 'below-header';
@@ -47,8 +46,9 @@ export class TdsCard {
47
46
  [this.imagePlacement]: !this.stretch,
48
47
  [`${this.imagePlacement}-stretch`]: this.stretch,
49
48
  };
50
- const ariaLabel = this.header ? this.header : `Card ${this.cardId}`;
51
- return (h(Host, { key: '3386e1f0d6536d31d7207c074a5e0f16ebf18a77', class: this.modeVariant && `tds-mode-variant-${this.modeVariant}` }, this.clickable ? (h("button", { class: cardStyle, onClick: this.handleClick, "aria-label": ariaLabel, "aria-describedby": `header-${this.cardId}` }, this.getCardContent())) : (h("div", { class: cardStyle }, this.getCardContent()))));
49
+ return (h(Host, { key: '03c6bf925c58c0634797f8370c68cc360f54cc0c', class: this.modeVariant && `tds-mode-variant-${this.modeVariant}` }, this.clickable ? (h("button", { class: cardStyle, onClick: () => {
50
+ this.handleClick();
51
+ } }, this.getCardContent())) : (h("div", { class: cardStyle }, this.getCardContent()))));
52
52
  }
53
53
  static get is() { return "tds-card"; }
54
54
  static get encapsulation() { return "shadow"; }
@@ -22,7 +22,6 @@ export class TdsCheckbox {
22
22
  this.checked = false;
23
23
  this.indeterminate = false;
24
24
  this.value = undefined;
25
- this.tdsAriaLabel = undefined;
26
25
  }
27
26
  /** Toggles the checked value of the component. */
28
27
  async toggleCheckbox() {
@@ -51,21 +50,12 @@ export class TdsCheckbox {
51
50
  this.indeterminate = false;
52
51
  }
53
52
  }
54
- connectedCallback() {
55
- const hasLabeledAndDescribedBy = this.host.getAttribute('aria-describedby') && this.host.getAttribute('aria-labelledby');
56
- if (!hasLabeledAndDescribedBy) {
57
- console.warn('Tegel Checkbox component: aria-describedby or aria-labelledby attributes are missing');
58
- }
59
- if (!this.tdsAriaLabel) {
60
- console.warn('Tegel Checkbox component: tdsAriaLabel prop is missing');
61
- }
62
- }
63
53
  render() {
64
- return (h("div", { key: '2e5501c960153741f6362c414f338a2d66ff5c54', class: "tds-checkbox" }, h("input", { key: '02f0f43e0fb2ff6fec330df2ec08b4558f7bbf60',
54
+ return (h("div", { key: '1d0a8257cd1710277e076b4a277dff2c0c89b3d8', class: "tds-checkbox" }, h("input", { key: '689144e40c0be61db6b82aa6eaeb7ff3d09d7d72',
65
55
  // eslint-disable-next-line no-return-assign
66
- ref: (inputElement) => (this.inputElement = inputElement), indeterminate: this.indeterminate, "aria-checked": this.checked, "aria-required": this.required, "aria-describedby": this.host.getAttribute('aria-describedby'), "aria-labelledby": this.host.getAttribute('aria-labelledby'), "aria-label": this.tdsAriaLabel, 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: () => {
56
+ ref: (inputElement) => (this.inputElement = inputElement), indeterminate: this.indeterminate, "aria-checked": this.checked, "aria-required": this.required, "aria-describedby": this.host.getAttribute('aria-describedby'), "aria-labelledby": this.host.getAttribute('aria-labelledby'), 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: () => {
67
57
  this.handleChange();
68
- } }), h("label", { key: '4e8b53749d6f3c88d8b77087773eac500876c0ba', htmlFor: this.checkboxId }, h("slot", { key: 'e595c87bfd340b95651761ee3a7d057e55b70a9b', name: "label" }))));
58
+ } }), h("label", { key: '534eed7aa114861c528be0b776879484a35348bf', htmlFor: this.checkboxId }, h("slot", { key: 'db59bcc78f7f2be94037651b880a5ef149b90747', name: "label" }))));
69
59
  }
70
60
  static get is() { return "tds-checkbox"; }
71
61
  static get encapsulation() { return "scoped"; }
@@ -204,23 +194,6 @@ export class TdsCheckbox {
204
194
  },
205
195
  "attribute": "value",
206
196
  "reflect": false
207
- },
208
- "tdsAriaLabel": {
209
- "type": "string",
210
- "mutable": false,
211
- "complexType": {
212
- "original": "string",
213
- "resolved": "string",
214
- "references": {}
215
- },
216
- "required": false,
217
- "optional": false,
218
- "docs": {
219
- "tags": [],
220
- "text": "Value to be used for the aria-label attribute"
221
- },
222
- "attribute": "tds-aria-label",
223
- "reflect": false
224
197
  }
225
198
  };
226
199
  }
@@ -31,16 +31,48 @@ export class TdsHeaderItem {
31
31
  this.updateSlotted(isImage, addImageClass);
32
32
  }
33
33
  }
34
+ /**
35
+ * Read the native "order" attribute on the host and update the CSS order accordingly.
36
+ * If the attribute "order" has the value "end", the order is set to 1. Otherwise, 0.
37
+ */
38
+ updateOrder() {
39
+ if (this.host.getAttribute('order') === 'end') {
40
+ this.host.style.order = '1';
41
+ }
42
+ else {
43
+ this.host.style.order = '0';
44
+ }
45
+ }
34
46
  componentDidLoad() {
35
47
  this.slotEl = this.host.shadowRoot.querySelector('slot');
36
48
  this.updateSlottedElements();
37
49
  this.slotEl.addEventListener('slotchange', this.updateSlottedElements);
50
+ // Set the order on initial load.
51
+ this.updateOrder();
52
+ // Create a MutationObserver to listen for changes on the "order" attribute.
53
+ this.mutationObserver = new MutationObserver((mutations) => {
54
+ mutations.forEach((mutation) => {
55
+ if (mutation.type === 'attributes' && mutation.attributeName === 'order') {
56
+ this.updateOrder();
57
+ }
58
+ });
59
+ });
60
+ // Start observing the host element for attribute changes (specifically "order").
61
+ this.mutationObserver.observe(this.host, {
62
+ attributes: true,
63
+ attributeFilter: ['order'],
64
+ });
65
+ }
66
+ disconnectedCallback() {
67
+ if (this.mutationObserver) {
68
+ this.mutationObserver.disconnect();
69
+ }
38
70
  }
39
71
  render() {
40
- return (h(Host, { key: '7317ab5668685390e2671908dd41855715267b1c' }, h("tds-core-header-item", { key: 'befc861a437912245c22413bbf774617fa84b289', class: {
72
+ return (h(Host, { key: 'b25cc4090e1352897e28022478961853954a4861' }, h("tds-core-header-item", { key: 'a4b3dea5fd3245485024e2b06f1819d6fc302826', class: {
41
73
  'component-active': this.active,
42
74
  'component-selected': this.selected,
43
- } }, h("slot", { key: 'f4405b3881dc0d6e4b86f96aa90d0b045c7bf2d8' }))));
75
+ } }, h("slot", { key: '4a1693dee4cb3ee71b686178449d6e59bbba65b4' }))));
44
76
  }
45
77
  static get is() { return "tds-header-item"; }
46
78
  static get encapsulation() { return "shadow"; }
@@ -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'];
3
3
  export const tegelAnalyze = async (page) => new AxeBuilder({ page }).disableRules(disabledRules).analyze();
@@ -36,16 +36,48 @@ const TdsHeaderItem = /*@__PURE__*/ proxyCustomElement(class TdsHeaderItem exten
36
36
  this.updateSlotted(isImage, addImageClass);
37
37
  }
38
38
  }
39
+ /**
40
+ * Read the native "order" attribute on the host and update the CSS order accordingly.
41
+ * If the attribute "order" has the value "end", the order is set to 1. Otherwise, 0.
42
+ */
43
+ updateOrder() {
44
+ if (this.host.getAttribute('order') === 'end') {
45
+ this.host.style.order = '1';
46
+ }
47
+ else {
48
+ this.host.style.order = '0';
49
+ }
50
+ }
39
51
  componentDidLoad() {
40
52
  this.slotEl = this.host.shadowRoot.querySelector('slot');
41
53
  this.updateSlottedElements();
42
54
  this.slotEl.addEventListener('slotchange', this.updateSlottedElements);
55
+ // Set the order on initial load.
56
+ this.updateOrder();
57
+ // Create a MutationObserver to listen for changes on the "order" attribute.
58
+ this.mutationObserver = new MutationObserver((mutations) => {
59
+ mutations.forEach((mutation) => {
60
+ if (mutation.type === 'attributes' && mutation.attributeName === 'order') {
61
+ this.updateOrder();
62
+ }
63
+ });
64
+ });
65
+ // Start observing the host element for attribute changes (specifically "order").
66
+ this.mutationObserver.observe(this.host, {
67
+ attributes: true,
68
+ attributeFilter: ['order'],
69
+ });
70
+ }
71
+ disconnectedCallback() {
72
+ if (this.mutationObserver) {
73
+ this.mutationObserver.disconnect();
74
+ }
43
75
  }
44
76
  render() {
45
- return (h(Host, { key: '7317ab5668685390e2671908dd41855715267b1c' }, h("tds-core-header-item", { key: 'befc861a437912245c22413bbf774617fa84b289', class: {
77
+ return (h(Host, { key: 'b25cc4090e1352897e28022478961853954a4861' }, h("tds-core-header-item", { key: 'a4b3dea5fd3245485024e2b06f1819d6fc302826', class: {
46
78
  'component-active': this.active,
47
79
  'component-selected': this.selected,
48
- } }, h("slot", { key: 'f4405b3881dc0d6e4b86f96aa90d0b045c7bf2d8' }))));
80
+ } }, h("slot", { key: '4a1693dee4cb3ee71b686178449d6e59bbba65b4' }))));
49
81
  }
50
82
  get host() { return this; }
51
83
  static get style() { return TdsHeaderItemStyle0; }
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
2
2
  import { a as convertToString } from './p-b1d21573.js';
3
- import { d as defineCustomElement$2 } from './p-ece57b20.js';
3
+ import { d as defineCustomElement$2 } from './p-eac79032.js';
4
4
  import { d as defineCustomElement$1 } from './p-ad77fb02.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}";
@@ -28,7 +28,6 @@ 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
31
  }
33
32
  /** Toggles the checked value of the component. */
34
33
  async toggleCheckbox() {
@@ -57,21 +56,12 @@ const TdsCheckbox = /*@__PURE__*/ proxyCustomElement(class TdsCheckbox extends H
57
56
  this.indeterminate = false;
58
57
  }
59
58
  }
60
- connectedCallback() {
61
- const hasLabeledAndDescribedBy = this.host.getAttribute('aria-describedby') && this.host.getAttribute('aria-labelledby');
62
- if (!hasLabeledAndDescribedBy) {
63
- console.warn('Tegel Checkbox component: aria-describedby or aria-labelledby attributes are missing');
64
- }
65
- if (!this.tdsAriaLabel) {
66
- console.warn('Tegel Checkbox component: tdsAriaLabel prop is missing');
67
- }
68
- }
69
59
  render() {
70
- return (h("div", { key: '2e5501c960153741f6362c414f338a2d66ff5c54', class: "tds-checkbox" }, h("input", { key: '02f0f43e0fb2ff6fec330df2ec08b4558f7bbf60',
60
+ return (h("div", { key: '1d0a8257cd1710277e076b4a277dff2c0c89b3d8', class: "tds-checkbox" }, h("input", { key: '689144e40c0be61db6b82aa6eaeb7ff3d09d7d72',
71
61
  // eslint-disable-next-line no-return-assign
72
- ref: (inputElement) => (this.inputElement = inputElement), indeterminate: this.indeterminate, "aria-checked": this.checked, "aria-required": this.required, "aria-describedby": this.host.getAttribute('aria-describedby'), "aria-labelledby": this.host.getAttribute('aria-labelledby'), "aria-label": this.tdsAriaLabel, 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: () => {
62
+ ref: (inputElement) => (this.inputElement = inputElement), indeterminate: this.indeterminate, "aria-checked": this.checked, "aria-required": this.required, "aria-describedby": this.host.getAttribute('aria-describedby'), "aria-labelledby": this.host.getAttribute('aria-labelledby'), 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: () => {
73
63
  this.handleChange();
74
- } }), h("label", { key: '4e8b53749d6f3c88d8b77087773eac500876c0ba', htmlFor: this.checkboxId }, h("slot", { key: 'e595c87bfd340b95651761ee3a7d057e55b70a9b', name: "label" }))));
64
+ } }), h("label", { key: '534eed7aa114861c528be0b776879484a35348bf', htmlFor: this.checkboxId }, h("slot", { key: 'db59bcc78f7f2be94037651b880a5ef149b90747', name: "label" }))));
75
65
  }
76
66
  get host() { return this; }
77
67
  static get watchers() { return {
@@ -86,7 +76,6 @@ const TdsCheckbox = /*@__PURE__*/ proxyCustomElement(class TdsCheckbox extends H
86
76
  "checked": [1540],
87
77
  "indeterminate": [1028],
88
78
  "value": [1],
89
- "tdsAriaLabel": [1, "tds-aria-label"],
90
79
  "toggleCheckbox": [64]
91
80
  }, [[4, "reset", "handleFormReset"]], {
92
81
  "indeterminate": ["handleIndeterminateState"]
@@ -1,7 +1,7 @@
1
1
  import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
2
2
  import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
3
3
  import { d as defineCustomElement$3 } from './p-707a562e.js';
4
- import { d as defineCustomElement$2 } from './p-3a7f88ff.js';
4
+ import { d as defineCustomElement$2 } from './p-368c544b.js';
5
5
  import { d as defineCustomElement$1 } from './p-ad77fb02.js';
6
6
 
7
7
  const headerLauncherButtonCss = ":host{display:block}:host tds-header-item{display:block}:host .icon{position:relative;margin-left:-6px;left:3px;transition:all 0.2s ease-in-out}";
@@ -11,8 +11,6 @@ const TdsBadge$1 = /*@__PURE__*/ proxyCustomElement(class TdsBadge extends H {
11
11
  this.value = '';
12
12
  this.hidden = false;
13
13
  this.size = 'lg';
14
- this.tdsAriaLive = 'polite';
15
- this.tdsAriaLabel = '';
16
14
  this.shape = '';
17
15
  this.text = '';
18
16
  }
@@ -25,18 +23,24 @@ const TdsBadge$1 = /*@__PURE__*/ proxyCustomElement(class TdsBadge extends H {
25
23
  checkProps() {
26
24
  const valueAsNumber = parseInt(this.value);
27
25
  if (!Number.isNaN(valueAsNumber) && this.size !== 'sm') {
28
- this.shape = this.value.length >= 2 ? 'pill' : '';
26
+ this.shape = this.value.toString().length >= 2 ? 'pill' : '';
29
27
  this.size = 'lg';
30
28
  this.text = valueAsNumber.toString().length >= 3 ? '99+' : valueAsNumber.toString();
31
29
  }
30
+ else {
31
+ // eslint-disable-next-line no-unused-expressions, @typescript-eslint/no-unused-expressions
32
+ if (this.value !== '' && this.size !== 'sm') {
33
+ console.warn('The provided value is either empty or string, please provide value as number.');
34
+ }
35
+ }
32
36
  }
33
37
  render() {
34
- return (h("host", { key: '1bb4a6deafad993e87c934ae2e1fac7d0fa94306', role: "status", class: {
38
+ return (h("host", { key: '4e3c33d01ed9a0da06dd45f6cbb7e3ff55837f65', class: {
35
39
  'tds-badge': true,
36
40
  [`tds-badge-${this.size}`]: true,
37
41
  'tds-badge-pill': this.shape === 'pill',
38
42
  'tds-badge-hidden': this.hidden,
39
- }, "aria-label": this.tdsAriaLabel, "aria-live": this.tdsAriaLive }, h("div", { key: '3a32a1394cebceb7600d39508ab2dd5d91087ead', class: "tds-badge-text", "aria-hidden": "true" }, this.text)));
43
+ } }, h("div", { key: '3a1966458cc39041221082096ef70efc3fd13d9f', class: "tds-badge-text" }, this.text)));
40
44
  }
41
45
  static get watchers() { return {
42
46
  "value": ["watchProps"],
@@ -47,8 +51,6 @@ const TdsBadge$1 = /*@__PURE__*/ proxyCustomElement(class TdsBadge extends H {
47
51
  "value": [1],
48
52
  "hidden": [516],
49
53
  "size": [1],
50
- "tdsAriaLive": [1, "tds-aria-live"],
51
- "tdsAriaLabel": [32],
52
54
  "shape": [32],
53
55
  "text": [32]
54
56
  }, undefined, {
@@ -9,7 +9,6 @@ const TdsBlock$1 = /*@__PURE__*/ proxyCustomElement(class TdsBlock extends H {
9
9
  this.__registerHost();
10
10
  this.__attachShadow();
11
11
  this.modeVariant = null;
12
- this.componentTag = 'div';
13
12
  }
14
13
  getNestingLevel() {
15
14
  let level = 0;
@@ -23,7 +22,6 @@ const TdsBlock$1 = /*@__PURE__*/ proxyCustomElement(class TdsBlock extends H {
23
22
  return level;
24
23
  }
25
24
  render() {
26
- const TagType = this.componentTag;
27
25
  const nestingLevel = this.getNestingLevel();
28
26
  let evenOddClass = '';
29
27
  if (this.modeVariant === null) {
@@ -34,13 +32,12 @@ const TdsBlock$1 = /*@__PURE__*/ proxyCustomElement(class TdsBlock extends H {
34
32
  evenOddClass = 'tds-block-odd';
35
33
  }
36
34
  }
37
- return (h(TagType, { key: '82ac7d3a746ea2fafafd81e5bcbb1d4c0d854ca2', class: `tds-block ${evenOddClass} ${this.modeVariant !== null ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("slot", { key: '6e3930c8b38ac92eb26a6080e16698352865afe8' })));
35
+ return (h("div", { key: 'efd570de70b5c6a313c3334b718cb201c4946251', class: `tds-block ${evenOddClass} ${this.modeVariant !== null ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("slot", { key: '56f2673bc4ae6c6801c52caf465d1bbcf27d8514' })));
38
36
  }
39
37
  get host() { return this; }
40
38
  static get style() { return TdsBlockStyle0; }
41
39
  }, [1, "tds-block", {
42
- "modeVariant": [1, "mode-variant"],
43
- "componentTag": [1, "component-tag"]
40
+ "modeVariant": [1, "mode-variant"]
44
41
  }]);
45
42
  function defineCustomElement$1() {
46
43
  if (typeof customElements === "undefined") {
@@ -21,14 +21,13 @@ const TdsCard$1 = /*@__PURE__*/ proxyCustomElement(class TdsCard extends H {
21
21
  const usesHeaderSlot = hasSlot('header', this.host);
22
22
  const usesSubheaderSlot = hasSlot('subheader', this.host);
23
23
  const usesThumbnailSlot = hasSlot('thumbnail', this.host);
24
- return (h("div", { class: "card-header" }, usesThumbnailSlot && h("slot", { name: "thumbnail" }), h("div", { class: "header-subheader", id: `header-${this.cardId}` }, this.header && h("span", { class: "header" }, this.header), usesHeaderSlot && h("slot", { name: "header" }), this.subheader && h("span", { class: "subheader" }, this.subheader), usesSubheaderSlot && h("slot", { name: "subheader" }))));
24
+ return (h("div", { class: "card-header" }, usesThumbnailSlot && h("slot", { name: "thumbnail" }), h("div", { class: "header-subheader" }, this.header && h("span", { class: "header" }, this.header), usesHeaderSlot && h("slot", { name: "header" }), this.subheader && h("span", { class: "subheader" }, this.subheader), usesSubheaderSlot && h("slot", { name: "subheader" }))));
25
25
  };
26
26
  this.getCardContent = () => {
27
27
  const usesBodySlot = hasSlot('body', this.host);
28
28
  const usesBodyImageSlot = hasSlot('body-image', this.host);
29
29
  const usesActionsSlot = hasSlot('actions', this.host);
30
- const bodyId = `body-${this.cardId}`;
31
- return (h("div", { class: this.stretch && 'stretch', "aria-describedby": usesBodySlot ? bodyId : null }, this.imagePlacement === 'below-header' && this.getCardHeader(), h("div", { class: "card-body", id: bodyId }, usesBodyImageSlot && h("slot", { name: "body-image" }), this.bodyImg && h("img", { class: "card-body-img", src: this.bodyImg, alt: this.bodyImgAlt }), this.imagePlacement === 'above-header' && this.getCardHeader(), this.bodyDivider && h("tds-divider", null), usesBodySlot && h("slot", { name: "body" })), usesActionsSlot && h("slot", { name: `actions` })));
30
+ return (h("div", { class: this.stretch && 'stretch' }, this.imagePlacement === 'below-header' && this.getCardHeader(), h("div", { class: `card-body` }, usesBodyImageSlot && h("slot", { name: "body-image" }), this.bodyImg && h("img", { class: "card-body-img", src: this.bodyImg, alt: this.bodyImgAlt }), this.imagePlacement === 'above-header' && this.getCardHeader(), this.bodyDivider && h("tds-divider", null), usesBodySlot && h("slot", { name: "body" })), usesActionsSlot && h("slot", { name: `actions` })));
32
31
  };
33
32
  this.modeVariant = null;
34
33
  this.imagePlacement = 'below-header';
@@ -48,8 +47,9 @@ const TdsCard$1 = /*@__PURE__*/ proxyCustomElement(class TdsCard extends H {
48
47
  [this.imagePlacement]: !this.stretch,
49
48
  [`${this.imagePlacement}-stretch`]: this.stretch,
50
49
  };
51
- const ariaLabel = this.header ? this.header : `Card ${this.cardId}`;
52
- return (h(Host, { key: '3386e1f0d6536d31d7207c074a5e0f16ebf18a77', class: this.modeVariant && `tds-mode-variant-${this.modeVariant}` }, this.clickable ? (h("button", { class: cardStyle, onClick: this.handleClick, "aria-label": ariaLabel, "aria-describedby": `header-${this.cardId}` }, this.getCardContent())) : (h("div", { class: cardStyle }, this.getCardContent()))));
50
+ return (h(Host, { key: '03c6bf925c58c0634797f8370c68cc360f54cc0c', class: this.modeVariant && `tds-mode-variant-${this.modeVariant}` }, this.clickable ? (h("button", { class: cardStyle, onClick: () => {
51
+ this.handleClick();
52
+ } }, this.getCardContent())) : (h("div", { class: cardStyle }, this.getCardContent()))));
53
53
  }
54
54
  get host() { return this; }
55
55
  static get style() { return TdsCardStyle0; }
@@ -1,4 +1,4 @@
1
- import { T as TdsCheckbox$1, d as defineCustomElement$1 } from './p-ece57b20.js';
1
+ import { T as TdsCheckbox$1, d as defineCustomElement$1 } from './p-eac79032.js';
2
2
 
3
3
  const TdsCheckbox = TdsCheckbox$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { T as TdsDropdownOption$1, d as defineCustomElement$1 } from './p-96d51054.js';
1
+ import { T as TdsDropdownOption$1, d as defineCustomElement$1 } from './p-6c2d5c85.js';
2
2
 
3
3
  const TdsDropdownOption = TdsDropdownOption$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
2
2
  import { d as defineCustomElement$3 } from './p-707a562e.js';
3
- import { d as defineCustomElement$2 } from './p-3a7f88ff.js';
3
+ import { d as defineCustomElement$2 } from './p-368c544b.js';
4
4
 
5
5
  const headerBrandSymbolCss = ":host tds-header-item{display:none}:host tds-header-item ::slotted(*){background-image:var(--tds-background-image-scania-symbol-svg), var(--tds-background-image-scania-symbol-png);background-size:30px auto;background-position:center;background-repeat:no-repeat}@media (min-width: 992px){:host tds-header-item{display:block}}";
6
6
  const TdsHeaderBrandSymbolStyle0 = headerBrandSymbolCss;
@@ -1,7 +1,7 @@
1
1
  import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
2
2
  import { g as generateUniqueId } from './p-11648030.js';
3
3
  import { d as defineCustomElement$6 } from './p-707a562e.js';
4
- import { d as defineCustomElement$5 } from './p-3a7f88ff.js';
4
+ import { d as defineCustomElement$5 } from './p-368c544b.js';
5
5
  import { d as defineCustomElement$4 } from './p-ad77fb02.js';
6
6
  import { d as defineCustomElement$3 } from './p-f0a50868.js';
7
7
  import { d as defineCustomElement$2 } from './p-3351035f.js';
@@ -1,7 +1,7 @@
1
1
  import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
2
2
  import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
3
3
  import { d as defineCustomElement$4 } from './p-707a562e.js';
4
- import { d as defineCustomElement$3 } from './p-3a7f88ff.js';
4
+ import { d as defineCustomElement$3 } from './p-368c544b.js';
5
5
  import { d as defineCustomElement$2 } from './p-ad77fb02.js';
6
6
 
7
7
  const headerHamburgerCss = ":host{color:var(--tds-white)}:host tds-header-item{display:block}:host .icon{position:relative;margin-left:-6px;left:3px;transition:background 0.2s ease-in-out, color 0.2s ease-in-out}@media screen and (min-width: 992px){:host tds-header-item{display:none}:host([persistent]) tds-header-item{display:block}}";
@@ -1,4 +1,4 @@
1
- import { T as TdsHeaderItem$1, d as defineCustomElement$1 } from './p-3a7f88ff.js';
1
+ import { T as TdsHeaderItem$1, d as defineCustomElement$1 } from './p-368c544b.js';
2
2
 
3
3
  const TdsHeaderItem = TdsHeaderItem$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { T as TdsHeaderLauncherButton$1, d as defineCustomElement$1 } from './p-f1980746.js';
1
+ import { T as TdsHeaderLauncherButton$1, d as defineCustomElement$1 } from './p-eef8fec0.js';
2
2
 
3
3
  const TdsHeaderLauncherButton = TdsHeaderLauncherButton$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -2,8 +2,8 @@ import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
2
2
  import { g as generateUniqueId } from './p-11648030.js';
3
3
  import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
4
4
  import { d as defineCustomElement$7 } from './p-707a562e.js';
5
- import { d as defineCustomElement$6 } from './p-3a7f88ff.js';
6
- import { d as defineCustomElement$5 } from './p-f1980746.js';
5
+ import { d as defineCustomElement$6 } from './p-368c544b.js';
6
+ import { d as defineCustomElement$5 } from './p-eef8fec0.js';
7
7
  import { d as defineCustomElement$4 } from './p-ad77fb02.js';
8
8
  import { d as defineCustomElement$3 } from './p-f0a50868.js';
9
9
  import { d as defineCustomElement$2 } from './p-3351035f.js';
@@ -1,5 +1,5 @@
1
1
  import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
2
- import { d as defineCustomElement$2 } from './p-ece57b20.js';
2
+ import { d as defineCustomElement$2 } from './p-eac79032.js';
3
3
 
4
4
  const tableBodyRowCss = ":host(.tds-table__row){box-sizing:border-box;display:table-row;border-bottom:1px solid var(--tds-table-divider);background-color:var(--tds-table-body-row-background);transition:background-color 200ms ease;color:var(--tds-table-color)}:host(.tds-table__row) *{box-sizing:border-box}:host(.tds-table__row) .tds-table__body-cell--checkbox{min-width:48px;width:48px;padding:0}:host(.tds-table__row:hover){background-color:var(--tds-table-body-row-background-hover)}:host(.tds-table__row--selected){background-color:var(--tds-table-body-row-background-selected)}:host(.tds-table__row--selected:hover){background-color:var(--tds-table-body-row-background-selected-hover)}:host(.tds-table__row--hidden){display:none}:host(.tds-table__row--expended){width:100%;background-color:pink}:host .tds-form-label--table{width:100%;height:48px;display:flex;justify-content:center;align-items:center;cursor:pointer}:host(.tds-table__compact) .tds-form-label--table{height:32px}:host(.tds-table--divider) .tds-table__body-cell--checkbox{border-right:1px solid var(--tds-table-divider)}:host(.tds-table__row--clickable){cursor:pointer}:host(.tds-table__row--clickable:focus-visible){outline:var(--focus-outline, 2px solid blue)}";
5
5
  const TdsTableBodyRowStyle0 = tableBodyRowCss;
@@ -1,7 +1,7 @@
1
1
  import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
2
- import { d as defineCustomElement$5 } from './p-ece57b20.js';
2
+ import { d as defineCustomElement$5 } from './p-eac79032.js';
3
3
  import { d as defineCustomElement$4 } from './p-467fe701.js';
4
- import { d as defineCustomElement$3 } from './p-96d51054.js';
4
+ import { d as defineCustomElement$3 } from './p-6c2d5c85.js';
5
5
  import { d as defineCustomElement$2 } from './p-ad77fb02.js';
6
6
 
7
7
  const tableFooterCss = ":host{box-sizing:border-box;display:table-footer-group;height:var(--tds-spacing-element-48)}:host *{box-sizing:border-box}:host .tds-table__footer-row{background-color:var(--tds-table-footer-background);color:var(--tds-table-color)}:host .tds-table__footer-cell{padding:0 var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-48);display:flex;align-items:center;justify-content:space-between}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector{display:flex;align-items:center}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page{display:flex;align-items:center;margin-right:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page p,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page p{margin-right:var(--tds-spacing-element-8)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);background-color:var(--tds-table-footer-page-selector-input-background);color:var(--tds-table-color);width:74px;height:30px;border:none;border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;margin-right:var(--tds-spacing-element-4);padding-left:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:hover{background-color:var(--tds-table-footer-page-selector-input-background-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:disabled{color:var(--tds-table-footer-page-selector-input-color-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input--shake{animation:tds-shake-animation 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;transform:translate3d(0, 0, 0);backface-visibility:hidden;perspective:1000px}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-text{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:1px 8px 0 0}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{display:flex;justify-content:center;align-items:center;border:none;background-color:transparent;cursor:pointer;height:var(--tds-spacing-element-32);width:var(--tds-spacing-element-32);border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;color:var(--tds-table-footer-page-selector-icon)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:hover{background-color:var(--tds-table-footer-btn-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled{cursor:default;color:var(--tds-table-footer-page-selector-icon-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled:hover{background-color:transparent}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn-svg{height:var(--tds-spacing-element-20);width:var(--tds-spacing-element-20);fill:var(--tds-table-color)}:host(.tds-table--compact){height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{height:var(--tds-spacing-element-24)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{height:28px;width:28px}:host(.footer__horizontal-scroll){display:inline-table;position:absolute;margin-top:10px}@keyframes tds-shake-animation{10%,90%{transform:translate3d(-1px, 0, 0)}20%,80%{transform:translate3d(2px, 0, 0)}30%,50%,70%{transform:translate3d(-4px, 0, 0)}40%,60%{transform:translate3d(4px, 0, 0)}}tds-dropdown:focus-within::after{content:\"\";position:absolute;bottom:0;left:0;height:100%;width:100%;background-color:transparent;border-radius:var(--tds-spacing-element-4);pointer-events:none;outline:2px solid var(--tds-blue-400);outline-offset:-2px}";
@@ -1,5 +1,5 @@
1
1
  import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
2
- import { d as defineCustomElement$2 } from './p-ece57b20.js';
2
+ import { d as defineCustomElement$2 } from './p-eac79032.js';
3
3
 
4
4
  const tableHeaderCss = ":host{box-sizing:border-box;display:table-header-group}:host *{box-sizing:border-box}:host .tds-table__header-cell--checkbox{font:var(--tds-headline-07);letter-spacing:var(--tds-headline-07-ls);display:table-cell;text-align:left;color:var(--tds-table-color);background-color:var(--tds-table-header-background);border-bottom:1px solid var(--tds-table-divider);height:48px;box-sizing:border-box;overflow:hidden;transition:background-color 200ms ease;min-width:unset;width:48px;padding:0;border-top-left-radius:4px}:host .tds-form-label--table{width:100%;height:48px;display:flex;justify-content:center;align-items:center;cursor:pointer}:host .tds-table__expand-control-container{display:flex;justify-content:center;align-items:center;height:48px;cursor:pointer}:host .tds-table__expand-control-container .tds-table__expand-input{display:none}:host .tds-table__expand-control-container .tds-expandable-row-icon{height:20px;width:20px;transition:transform 200ms ease;transform:rotate(0)}:host .tds-table__expand-control-container .tds-expandable-row-icon--opened{transform:rotate(180deg)}:host ::slotted(tds-header-cell:hover){background-color:var(--tds-table-header-background-hover)}:host(.tds-table--compact) .tds-table__header-cell--checkbox{height:32px}:host(.tds-table--compact) .tds-form-label--table{height:32px}:host(.tds-table--divider) .tds-table__header-cell--checkbox{border-right:1px solid var(--tds-table-divider)}:host(.tds-table--toolbar-available) .tds-table__header-cell--checkbox{border-top-left-radius:0}";
5
5
  const TdsTableHeaderStyle0 = tableHeaderCss;