@politiet/sheriff-web-components 1.2.0 → 1.3.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.
Files changed (59) hide show
  1. package/dist/frameworks/preact.d.ts +1 -0
  2. package/dist/frameworks/preact.d.ts.map +1 -1
  3. package/dist/frameworks/react.d.ts +1 -0
  4. package/dist/frameworks/react.d.ts.map +1 -1
  5. package/dist/frameworks/solidjs.d.ts +1 -0
  6. package/dist/frameworks/solidjs.d.ts.map +1 -1
  7. package/dist/frameworks/svelte.d.ts +1 -0
  8. package/dist/frameworks/svelte.d.ts.map +1 -1
  9. package/dist/frameworks/vue.d.ts +1 -0
  10. package/dist/frameworks/vue.d.ts.map +1 -1
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/playwright-util/screenshot.d.ts +3 -0
  16. package/dist/playwright-util/screenshot.d.ts.map +1 -0
  17. package/dist/playwright-util/screenshot.js +25 -0
  18. package/dist/playwright-util/screenshot.js.map +1 -0
  19. package/dist/react-wrappers/SDSTextAreaWrapper.d.ts +9 -0
  20. package/dist/react-wrappers/SDSTextAreaWrapper.d.ts.map +1 -0
  21. package/dist/react-wrappers/SDSTextAreaWrapper.js +16 -0
  22. package/dist/react-wrappers/SDSTextAreaWrapper.js.map +1 -0
  23. package/dist/react-wrappers/index.d.ts +1 -0
  24. package/dist/react-wrappers/index.d.ts.map +1 -1
  25. package/dist/react-wrappers/index.js +1 -0
  26. package/dist/react-wrappers/index.js.map +1 -1
  27. package/dist/sds-checkbox-group/sds-checkbox-group.d.ts.map +1 -1
  28. package/dist/sds-checkbox-group/sds-checkbox-group.js +3 -13
  29. package/dist/sds-checkbox-group/sds-checkbox-group.js.map +1 -1
  30. package/dist/sds-radio/sds-radio.spec.js +7 -0
  31. package/dist/sds-radio/sds-radio.spec.js.map +1 -1
  32. package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -1
  33. package/dist/sds-radio-group/sds-radio-group.js +3 -13
  34. package/dist/sds-radio-group/sds-radio-group.js.map +1 -1
  35. package/dist/sds-textarea/sds-textarea.d.ts +77 -0
  36. package/dist/sds-textarea/sds-textarea.d.ts.map +1 -0
  37. package/dist/sds-textarea/sds-textarea.js +240 -0
  38. package/dist/sds-textarea/sds-textarea.js.map +1 -0
  39. package/dist/sds-textarea/sds-textarea.spec.d.ts +2 -0
  40. package/dist/sds-textarea/sds-textarea.spec.d.ts.map +1 -0
  41. package/dist/sds-textarea/sds-textarea.spec.js +171 -0
  42. package/dist/sds-textarea/sds-textarea.spec.js.map +1 -0
  43. package/dist/sds-textarea/sds-textarea.styles.d.ts +2 -0
  44. package/dist/sds-textarea/sds-textarea.styles.d.ts.map +1 -0
  45. package/dist/sds-textarea/sds-textarea.styles.js +118 -0
  46. package/dist/sds-textarea/sds-textarea.styles.js.map +1 -0
  47. package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
  48. package/dist/sds-textfield/sds-textfield.js +2 -12
  49. package/dist/sds-textfield/sds-textfield.js.map +1 -1
  50. package/dist/sheriff-web-components.js +560 -235
  51. package/dist/utils/renderErrorMessage.d.ts +3 -0
  52. package/dist/utils/renderErrorMessage.d.ts.map +1 -0
  53. package/dist/utils/renderErrorMessage.js +9 -0
  54. package/dist/utils/renderErrorMessage.js.map +1 -0
  55. package/dist/utils/types.d.ts +2 -0
  56. package/dist/utils/types.d.ts.map +1 -0
  57. package/dist/utils/types.js +2 -0
  58. package/dist/utils/types.js.map +1 -0
  59. package/package.json +1 -1
@@ -647,7 +647,7 @@ function guardedCustomElement(tagName) {
647
647
  }
648
648
  };
649
649
  }
650
- const styles$h = i$4`
650
+ const styles$i = i$4`
651
651
  :host {
652
652
  --_color-semantic-surface-critical-hover: #b32a23;
653
653
  display: inline-block;
@@ -798,14 +798,14 @@ const styles$h = i$4`
798
798
  text-decoration: none;
799
799
  }
800
800
  `;
801
- var __defProp$h = Object.defineProperty;
802
- var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
803
- var __decorateClass$h = (decorators, target, key, kind) => {
804
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
801
+ var __defProp$i = Object.defineProperty;
802
+ var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
803
+ var __decorateClass$i = (decorators, target, key, kind) => {
804
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
805
805
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
806
806
  if (decorator = decorators[i3])
807
807
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
808
- if (kind && result) __defProp$h(target, key, result);
808
+ if (kind && result) __defProp$i(target, key, result);
809
809
  return result;
810
810
  };
811
811
  let SDSButton = class extends i$1 {
@@ -919,39 +919,39 @@ let SDSButton = class extends i$1 {
919
919
  `;
920
920
  }
921
921
  };
922
- SDSButton.styles = [styles$h];
922
+ SDSButton.styles = [styles$i];
923
923
  SDSButton.formAssociated = true;
924
- __decorateClass$h([
924
+ __decorateClass$i([
925
925
  n2({ type: String, reflect: true })
926
926
  ], SDSButton.prototype, "type", 2);
927
- __decorateClass$h([
927
+ __decorateClass$i([
928
928
  n2({ type: String, reflect: true })
929
929
  ], SDSButton.prototype, "variant", 2);
930
- __decorateClass$h([
930
+ __decorateClass$i([
931
931
  n2({ type: String, reflect: true })
932
932
  ], SDSButton.prototype, "size", 2);
933
- __decorateClass$h([
933
+ __decorateClass$i([
934
934
  n2({ type: Boolean, reflect: true })
935
935
  ], SDSButton.prototype, "disabled", 2);
936
- __decorateClass$h([
936
+ __decorateClass$i([
937
937
  n2({ type: String, reflect: true })
938
938
  ], SDSButton.prototype, "name", 2);
939
- __decorateClass$h([
939
+ __decorateClass$i([
940
940
  n2({ type: String, reflect: true })
941
941
  ], SDSButton.prototype, "value", 2);
942
- __decorateClass$h([
942
+ __decorateClass$i([
943
943
  n2({ type: String, reflect: true })
944
944
  ], SDSButton.prototype, "form", 2);
945
- __decorateClass$h([
945
+ __decorateClass$i([
946
946
  n2({ type: String, reflect: true })
947
947
  ], SDSButton.prototype, "href", 2);
948
- __decorateClass$h([
948
+ __decorateClass$i([
949
949
  n2({ type: String, reflect: true })
950
950
  ], SDSButton.prototype, "target", 2);
951
- SDSButton = __decorateClass$h([
951
+ SDSButton = __decorateClass$i([
952
952
  guardedCustomElement("sds-button")
953
953
  ], SDSButton);
954
- const styles$g = i$4`
954
+ const styles$h = i$4`
955
955
  :host {
956
956
  flex: 0 0 auto;
957
957
  }
@@ -1060,14 +1060,14 @@ const styles$g = i$4`
1060
1060
  padding-top: 2px;
1061
1061
  }
1062
1062
  `;
1063
- var __defProp$g = Object.defineProperty;
1064
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
1065
- var __decorateClass$g = (decorators, target, key, kind) => {
1066
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
1063
+ var __defProp$h = Object.defineProperty;
1064
+ var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
1065
+ var __decorateClass$h = (decorators, target, key, kind) => {
1066
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
1067
1067
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1068
1068
  if (decorator = decorators[i3])
1069
1069
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1070
- if (kind && result) __defProp$g(target, key, result);
1070
+ if (kind && result) __defProp$h(target, key, result);
1071
1071
  return result;
1072
1072
  };
1073
1073
  let SDSCheckbox = class extends i$1 {
@@ -1203,36 +1203,36 @@ let SDSCheckbox = class extends i$1 {
1203
1203
  `;
1204
1204
  }
1205
1205
  };
1206
- SDSCheckbox.styles = [styles$g];
1206
+ SDSCheckbox.styles = [styles$h];
1207
1207
  SDSCheckbox.formAssociated = true;
1208
- __decorateClass$g([
1208
+ __decorateClass$h([
1209
1209
  n2({ type: String, reflect: true })
1210
1210
  ], SDSCheckbox.prototype, "name", 2);
1211
- __decorateClass$g([
1211
+ __decorateClass$h([
1212
1212
  n2({ type: String, reflect: true })
1213
1213
  ], SDSCheckbox.prototype, "label", 2);
1214
- __decorateClass$g([
1214
+ __decorateClass$h([
1215
1215
  n2({ type: String })
1216
1216
  ], SDSCheckbox.prototype, "value", 2);
1217
- __decorateClass$g([
1217
+ __decorateClass$h([
1218
1218
  n2({ type: Boolean, reflect: true })
1219
1219
  ], SDSCheckbox.prototype, "checked", 2);
1220
- __decorateClass$g([
1220
+ __decorateClass$h([
1221
1221
  n2({ type: Boolean, reflect: true })
1222
1222
  ], SDSCheckbox.prototype, "disabled", 2);
1223
- __decorateClass$g([
1223
+ __decorateClass$h([
1224
1224
  n2({ type: Boolean, reflect: true })
1225
1225
  ], SDSCheckbox.prototype, "error", 2);
1226
- __decorateClass$g([
1226
+ __decorateClass$h([
1227
1227
  n2({ type: Boolean, reflect: true })
1228
1228
  ], SDSCheckbox.prototype, "required", 2);
1229
- __decorateClass$g([
1229
+ __decorateClass$h([
1230
1230
  e$3("#control")
1231
1231
  ], SDSCheckbox.prototype, "control", 2);
1232
- SDSCheckbox = __decorateClass$g([
1232
+ SDSCheckbox = __decorateClass$h([
1233
1233
  guardedCustomElement("sds-checkbox")
1234
1234
  ], SDSCheckbox);
1235
- const styles$f = i$4`
1235
+ const styles$g = i$4`
1236
1236
  :host {
1237
1237
  display: block;
1238
1238
  contain: layout style;
@@ -1357,7 +1357,7 @@ class SDSIconLoader {
1357
1357
  return this.resolver;
1358
1358
  }
1359
1359
  }
1360
- const styles$e = i$4`
1360
+ const styles$f = i$4`
1361
1361
  :host {
1362
1362
  --icon-size: var(--sds-icon-size-m);
1363
1363
  display: inline-block;
@@ -1370,14 +1370,14 @@ const styles$e = i$4`
1370
1370
  --icon-size: var(--sds-icon-size-s);
1371
1371
  }
1372
1372
  `;
1373
- var __defProp$f = Object.defineProperty;
1374
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
1375
- var __decorateClass$f = (decorators, target, key, kind) => {
1376
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
1373
+ var __defProp$g = Object.defineProperty;
1374
+ var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
1375
+ var __decorateClass$g = (decorators, target, key, kind) => {
1376
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
1377
1377
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1378
1378
  if (decorator = decorators[i3])
1379
1379
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1380
- if (kind && result) __defProp$f(target, key, result);
1380
+ if (kind && result) __defProp$g(target, key, result);
1381
1381
  return result;
1382
1382
  };
1383
1383
  let SDSIcon = class extends i$1 {
@@ -1429,34 +1429,41 @@ let SDSIcon = class extends i$1 {
1429
1429
  }
1430
1430
  }
1431
1431
  };
1432
- SDSIcon.styles = [styles$e];
1432
+ SDSIcon.styles = [styles$f];
1433
1433
  SDSIcon.iconLoader = new SDSIconLoader();
1434
- __decorateClass$f([
1434
+ __decorateClass$g([
1435
1435
  n2({ type: String, reflect: true })
1436
1436
  ], SDSIcon.prototype, "name", 2);
1437
- __decorateClass$f([
1437
+ __decorateClass$g([
1438
1438
  n2({ type: String, reflect: true })
1439
1439
  ], SDSIcon.prototype, "size", 2);
1440
- __decorateClass$f([
1440
+ __decorateClass$g([
1441
1441
  n2({ type: String, reflect: true })
1442
1442
  ], SDSIcon.prototype, "color", 2);
1443
- __decorateClass$f([
1443
+ __decorateClass$g([
1444
1444
  n2({ type: String, reflect: true })
1445
1445
  ], SDSIcon.prototype, "label", 2);
1446
- __decorateClass$f([
1446
+ __decorateClass$g([
1447
1447
  r()
1448
1448
  ], SDSIcon.prototype, "svg", 2);
1449
- SDSIcon = __decorateClass$f([
1449
+ SDSIcon = __decorateClass$g([
1450
1450
  guardedCustomElement("sds-icon")
1451
1451
  ], SDSIcon);
1452
- var __defProp$e = Object.defineProperty;
1453
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
1454
- var __decorateClass$e = (decorators, target, key, kind) => {
1455
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
1452
+ const renderErrorMessage = (errorMessage, className, disabled = false) => {
1453
+ if (!errorMessage) {
1454
+ return E;
1455
+ }
1456
+ const iconColor = !disabled ? `var(--sds-color-semantic-icon-critical)` : `var(--sds-color-semantic-icon-disabled)`;
1457
+ return x`<p class=${className}><sds-icon name="warning-material-filled" size="m" color=${iconColor}></sds-icon>${errorMessage}</p>`;
1458
+ };
1459
+ var __defProp$f = Object.defineProperty;
1460
+ var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
1461
+ var __decorateClass$f = (decorators, target, key, kind) => {
1462
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
1456
1463
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1457
1464
  if (decorator = decorators[i3])
1458
1465
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1459
- if (kind && result) __defProp$e(target, key, result);
1466
+ if (kind && result) __defProp$f(target, key, result);
1460
1467
  return result;
1461
1468
  };
1462
1469
  let SDSCheckboxGroup = class extends i$1 {
@@ -1491,35 +1498,28 @@ let SDSCheckboxGroup = class extends i$1 {
1491
1498
  <div class="sds-checkbox-group__checkboxes">
1492
1499
  <slot @change=${this._handleCheckboxChange}></slot>
1493
1500
  </div>
1494
- ${this.errorMessage ? x`<p class="sds-checkbox-group__error-message">
1495
- <sds-icon
1496
- name="warning-material-filled"
1497
- size="m"
1498
- color="var(--sds-color-semantic-icon-critical)"
1499
- ></sds-icon>
1500
- ${this.errorMessage}
1501
- </p>` : E}
1501
+ ${renderErrorMessage(this.errorMessage, "sds-checkbox-group__error-message")}
1502
1502
  </fieldset>
1503
1503
  `;
1504
1504
  }
1505
1505
  };
1506
- SDSCheckboxGroup.styles = [styles$f];
1507
- __decorateClass$e([
1506
+ SDSCheckboxGroup.styles = [styles$g];
1507
+ __decorateClass$f([
1508
1508
  n2({ type: String, reflect: true })
1509
1509
  ], SDSCheckboxGroup.prototype, "legend", 2);
1510
- __decorateClass$e([
1510
+ __decorateClass$f([
1511
1511
  n2({ type: String, attribute: "help-text", reflect: true })
1512
1512
  ], SDSCheckboxGroup.prototype, "helpText", 2);
1513
- __decorateClass$e([
1513
+ __decorateClass$f([
1514
1514
  n2({ type: String, attribute: "error-message", reflect: true })
1515
1515
  ], SDSCheckboxGroup.prototype, "errorMessage", 2);
1516
- __decorateClass$e([
1516
+ __decorateClass$f([
1517
1517
  r()
1518
1518
  ], SDSCheckboxGroup.prototype, "_selectedValues", 2);
1519
- SDSCheckboxGroup = __decorateClass$e([
1519
+ SDSCheckboxGroup = __decorateClass$f([
1520
1520
  guardedCustomElement("sds-checkbox-group")
1521
1521
  ], SDSCheckboxGroup);
1522
- const styles$d = i$4`
1522
+ const styles$e = i$4`
1523
1523
  .sds-chip {
1524
1524
  align-items: center;
1525
1525
  display: inline-flex;
@@ -1594,14 +1594,14 @@ const styles$d = i$4`
1594
1594
  }
1595
1595
  }
1596
1596
  `;
1597
- var __defProp$d = Object.defineProperty;
1598
- var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
1599
- var __decorateClass$d = (decorators, target, key, kind) => {
1600
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
1597
+ var __defProp$e = Object.defineProperty;
1598
+ var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
1599
+ var __decorateClass$e = (decorators, target, key, kind) => {
1600
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
1601
1601
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1602
1602
  if (decorator = decorators[i3])
1603
1603
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1604
- if (kind && result) __defProp$d(target, key, result);
1604
+ if (kind && result) __defProp$e(target, key, result);
1605
1605
  return result;
1606
1606
  };
1607
1607
  let SDSChip = class extends i$1 {
@@ -1685,36 +1685,36 @@ let SDSChip = class extends i$1 {
1685
1685
  </label>`;
1686
1686
  }
1687
1687
  };
1688
- SDSChip.styles = [styles$d];
1688
+ SDSChip.styles = [styles$e];
1689
1689
  SDSChip.formAssociated = true;
1690
- __decorateClass$d([
1690
+ __decorateClass$e([
1691
1691
  n2({ type: String, reflect: true })
1692
1692
  ], SDSChip.prototype, "variant", 2);
1693
- __decorateClass$d([
1693
+ __decorateClass$e([
1694
1694
  n2({ type: String, reflect: true })
1695
1695
  ], SDSChip.prototype, "size", 2);
1696
- __decorateClass$d([
1696
+ __decorateClass$e([
1697
1697
  n2({ type: Boolean, reflect: true })
1698
1698
  ], SDSChip.prototype, "checked", 2);
1699
- __decorateClass$d([
1699
+ __decorateClass$e([
1700
1700
  n2({ type: String, reflect: true })
1701
1701
  ], SDSChip.prototype, "name", 2);
1702
- __decorateClass$d([
1702
+ __decorateClass$e([
1703
1703
  n2({ type: String })
1704
1704
  ], SDSChip.prototype, "value", 2);
1705
- __decorateClass$d([
1705
+ __decorateClass$e([
1706
1706
  n2({ type: Boolean, reflect: true })
1707
1707
  ], SDSChip.prototype, "disabled", 2);
1708
- __decorateClass$d([
1708
+ __decorateClass$e([
1709
1709
  n2({ type: Boolean, reflect: true })
1710
1710
  ], SDSChip.prototype, "readonly", 2);
1711
- __decorateClass$d([
1711
+ __decorateClass$e([
1712
1712
  e$3("#control")
1713
1713
  ], SDSChip.prototype, "control", 2);
1714
- SDSChip = __decorateClass$d([
1714
+ SDSChip = __decorateClass$e([
1715
1715
  guardedCustomElement("sds-chip")
1716
1716
  ], SDSChip);
1717
- const styles$c = i$4`
1717
+ const styles$d = i$4`
1718
1718
  :host {
1719
1719
  display: block;
1720
1720
  }
@@ -1737,14 +1737,14 @@ const styles$c = i$4`
1737
1737
  font-weight: 500;
1738
1738
  }
1739
1739
  `;
1740
- var __defProp$c = Object.defineProperty;
1741
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
1742
- var __decorateClass$c = (decorators, target, key, kind) => {
1743
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
1740
+ var __defProp$d = Object.defineProperty;
1741
+ var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
1742
+ var __decorateClass$d = (decorators, target, key, kind) => {
1743
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
1744
1744
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1745
1745
  if (decorator = decorators[i3])
1746
1746
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1747
- if (kind && result) __defProp$c(target, key, result);
1747
+ if (kind && result) __defProp$d(target, key, result);
1748
1748
  return result;
1749
1749
  };
1750
1750
  let SDSDetail = class extends i$1 {
@@ -1762,14 +1762,14 @@ let SDSDetail = class extends i$1 {
1762
1762
  return x`<p class=${classes}><slot></slot></p>`;
1763
1763
  }
1764
1764
  };
1765
- SDSDetail.styles = [styles$c];
1766
- __decorateClass$c([
1765
+ SDSDetail.styles = [styles$d];
1766
+ __decorateClass$d([
1767
1767
  n2({ type: String })
1768
1768
  ], SDSDetail.prototype, "variation", 2);
1769
- SDSDetail = __decorateClass$c([
1769
+ SDSDetail = __decorateClass$d([
1770
1770
  guardedCustomElement("sds-detail")
1771
1771
  ], SDSDetail);
1772
- const styles$b = i$4`
1772
+ const styles$c = i$4`
1773
1773
  :host {
1774
1774
  --_heading-text-align: left;
1775
1775
  display: inline-block;
@@ -1872,14 +1872,14 @@ const styles$b = i$4`
1872
1872
  }
1873
1873
  }
1874
1874
  `;
1875
- var __defProp$b = Object.defineProperty;
1876
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
1877
- var __decorateClass$b = (decorators, target, key, kind) => {
1878
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
1875
+ var __defProp$c = Object.defineProperty;
1876
+ var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
1877
+ var __decorateClass$c = (decorators, target, key, kind) => {
1878
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
1879
1879
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1880
1880
  if (decorator = decorators[i3])
1881
1881
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1882
- if (kind && result) __defProp$b(target, key, result);
1882
+ if (kind && result) __defProp$c(target, key, result);
1883
1883
  return result;
1884
1884
  };
1885
1885
  let SDSHeading = class extends i$1 {
@@ -1915,17 +1915,17 @@ let SDSHeading = class extends i$1 {
1915
1915
  }
1916
1916
  }
1917
1917
  };
1918
- SDSHeading.styles = [styles$b];
1919
- __decorateClass$b([
1918
+ SDSHeading.styles = [styles$c];
1919
+ __decorateClass$c([
1920
1920
  n2({ type: String })
1921
1921
  ], SDSHeading.prototype, "level", 2);
1922
- __decorateClass$b([
1922
+ __decorateClass$c([
1923
1923
  n2({ type: String })
1924
1924
  ], SDSHeading.prototype, "as", 2);
1925
- SDSHeading = __decorateClass$b([
1925
+ SDSHeading = __decorateClass$c([
1926
1926
  guardedCustomElement("sds-heading")
1927
1927
  ], SDSHeading);
1928
- const styles$a = i$4`
1928
+ const styles$b = i$4`
1929
1929
  :host {
1930
1930
  display: block;
1931
1931
  }
@@ -1954,14 +1954,14 @@ const styles$a = i$4`
1954
1954
  line-height: 1.428;
1955
1955
  }
1956
1956
  `;
1957
- var __defProp$a = Object.defineProperty;
1958
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
1959
- var __decorateClass$a = (decorators, target, key, kind) => {
1960
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
1957
+ var __defProp$b = Object.defineProperty;
1958
+ var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
1959
+ var __decorateClass$b = (decorators, target, key, kind) => {
1960
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
1961
1961
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1962
1962
  if (decorator = decorators[i3])
1963
1963
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1964
- if (kind && result) __defProp$a(target, key, result);
1964
+ if (kind && result) __defProp$b(target, key, result);
1965
1965
  return result;
1966
1966
  };
1967
1967
  let SDSLabel = class extends i$1 {
@@ -1980,17 +1980,17 @@ let SDSLabel = class extends i$1 {
1980
1980
  return x`<label for="${o$1(this.for)}" class=${classes}><slot></slot></label>`;
1981
1981
  }
1982
1982
  };
1983
- SDSLabel.styles = [styles$a];
1984
- __decorateClass$a([
1983
+ SDSLabel.styles = [styles$b];
1984
+ __decorateClass$b([
1985
1985
  n2({ type: String })
1986
1986
  ], SDSLabel.prototype, "size", 2);
1987
- __decorateClass$a([
1987
+ __decorateClass$b([
1988
1988
  n2({ type: String })
1989
1989
  ], SDSLabel.prototype, "for", 2);
1990
- SDSLabel = __decorateClass$a([
1990
+ SDSLabel = __decorateClass$b([
1991
1991
  guardedCustomElement("sds-label")
1992
1992
  ], SDSLabel);
1993
- const styles$9 = i$4`
1993
+ const styles$a = i$4`
1994
1994
  :host {
1995
1995
  display: inline;
1996
1996
  }
@@ -2062,14 +2062,14 @@ const styles$9 = i$4`
2062
2062
  font-size: 0.875rem;
2063
2063
  }
2064
2064
  `;
2065
- var __defProp$9 = Object.defineProperty;
2066
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
2067
- var __decorateClass$9 = (decorators, target, key, kind) => {
2068
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
2065
+ var __defProp$a = Object.defineProperty;
2066
+ var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
2067
+ var __decorateClass$a = (decorators, target, key, kind) => {
2068
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
2069
2069
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2070
2070
  if (decorator = decorators[i3])
2071
2071
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2072
- if (kind && result) __defProp$9(target, key, result);
2072
+ if (kind && result) __defProp$a(target, key, result);
2073
2073
  return result;
2074
2074
  };
2075
2075
  let SDSLink = class extends i$1 {
@@ -2090,20 +2090,20 @@ let SDSLink = class extends i$1 {
2090
2090
  ></a>`;
2091
2091
  }
2092
2092
  };
2093
- SDSLink.styles = [styles$9];
2094
- __decorateClass$9([
2093
+ SDSLink.styles = [styles$a];
2094
+ __decorateClass$a([
2095
2095
  n2({ type: String })
2096
2096
  ], SDSLink.prototype, "href", 2);
2097
- __decorateClass$9([
2097
+ __decorateClass$a([
2098
2098
  n2({ type: String })
2099
2099
  ], SDSLink.prototype, "size", 2);
2100
- __decorateClass$9([
2100
+ __decorateClass$a([
2101
2101
  n2({ type: String })
2102
2102
  ], SDSLink.prototype, "target", 2);
2103
- SDSLink = __decorateClass$9([
2103
+ SDSLink = __decorateClass$a([
2104
2104
  guardedCustomElement("sds-link")
2105
2105
  ], SDSLink);
2106
- const styles$8 = i$4`
2106
+ const styles$9 = i$4`
2107
2107
  :host {
2108
2108
  line-height: 0;
2109
2109
  }
@@ -2140,14 +2140,14 @@ const styles$8 = i$4`
2140
2140
  }
2141
2141
  }
2142
2142
  `;
2143
- var __defProp$8 = Object.defineProperty;
2144
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
2145
- var __decorateClass$8 = (decorators, target, key, kind) => {
2146
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
2143
+ var __defProp$9 = Object.defineProperty;
2144
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
2145
+ var __decorateClass$9 = (decorators, target, key, kind) => {
2146
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
2147
2147
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2148
2148
  if (decorator = decorators[i3])
2149
2149
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2150
- if (kind && result) __defProp$8(target, key, result);
2150
+ if (kind && result) __defProp$9(target, key, result);
2151
2151
  return result;
2152
2152
  };
2153
2153
  let SDSLoader = class extends i$1 {
@@ -2165,17 +2165,17 @@ let SDSLoader = class extends i$1 {
2165
2165
  return x`<span class="${e$1(loaderClasses)}" style="${`color:${this.color}`}"></span>`;
2166
2166
  }
2167
2167
  };
2168
- SDSLoader.styles = [styles$8];
2169
- __decorateClass$8([
2168
+ SDSLoader.styles = [styles$9];
2169
+ __decorateClass$9([
2170
2170
  n2({ type: String, reflect: true })
2171
2171
  ], SDSLoader.prototype, "size", 2);
2172
- __decorateClass$8([
2172
+ __decorateClass$9([
2173
2173
  n2({ type: String, reflect: true })
2174
2174
  ], SDSLoader.prototype, "color", 2);
2175
- SDSLoader = __decorateClass$8([
2175
+ SDSLoader = __decorateClass$9([
2176
2176
  guardedCustomElement("sds-loader")
2177
2177
  ], SDSLoader);
2178
- const styles$7 = i$4`
2178
+ const styles$8 = i$4`
2179
2179
  :host {
2180
2180
  display: block;
2181
2181
  box-sizing: border-box;
@@ -2323,14 +2323,14 @@ const styles$7 = i$4`
2323
2323
  }
2324
2324
  }
2325
2325
  `;
2326
- var __defProp$7 = Object.defineProperty;
2327
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
2328
- var __decorateClass$7 = (decorators, target, key, kind) => {
2329
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
2326
+ var __defProp$8 = Object.defineProperty;
2327
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
2328
+ var __decorateClass$8 = (decorators, target, key, kind) => {
2329
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
2330
2330
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2331
2331
  if (decorator = decorators[i3])
2332
2332
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2333
- if (kind && result) __defProp$7(target, key, result);
2333
+ if (kind && result) __defProp$8(target, key, result);
2334
2334
  return result;
2335
2335
  };
2336
2336
  let SDSNavCard = class extends i$1 {
@@ -2396,29 +2396,29 @@ let SDSNavCard = class extends i$1 {
2396
2396
  `;
2397
2397
  }
2398
2398
  };
2399
- SDSNavCard.styles = [styles$7];
2400
- __decorateClass$7([
2399
+ SDSNavCard.styles = [styles$8];
2400
+ __decorateClass$8([
2401
2401
  n2({ type: String, reflect: true })
2402
2402
  ], SDSNavCard.prototype, "size", 2);
2403
- __decorateClass$7([
2403
+ __decorateClass$8([
2404
2404
  n2({ type: String, reflect: true })
2405
2405
  ], SDSNavCard.prototype, "heading", 2);
2406
- __decorateClass$7([
2406
+ __decorateClass$8([
2407
2407
  n2({ type: String, reflect: true })
2408
2408
  ], SDSNavCard.prototype, "level", 2);
2409
- __decorateClass$7([
2409
+ __decorateClass$8([
2410
2410
  n2({ type: String, reflect: true })
2411
2411
  ], SDSNavCard.prototype, "link", 2);
2412
- __decorateClass$7([
2412
+ __decorateClass$8([
2413
2413
  r()
2414
2414
  ], SDSNavCard.prototype, "hasIcon", 2);
2415
- __decorateClass$7([
2415
+ __decorateClass$8([
2416
2416
  e$3("slot")
2417
2417
  ], SDSNavCard.prototype, "iconSlot", 2);
2418
- SDSNavCard = __decorateClass$7([
2418
+ SDSNavCard = __decorateClass$8([
2419
2419
  guardedCustomElement("sds-nav-card")
2420
2420
  ], SDSNavCard);
2421
- const styles$6 = i$4`
2421
+ const styles$7 = i$4`
2422
2422
  :host {
2423
2423
  display: block;
2424
2424
  box-sizing: border-box;
@@ -2576,14 +2576,14 @@ const styles$6 = i$4`
2576
2576
  }
2577
2577
  }
2578
2578
  `;
2579
- var __defProp$6 = Object.defineProperty;
2580
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
2581
- var __decorateClass$6 = (decorators, target, key, kind) => {
2582
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
2579
+ var __defProp$7 = Object.defineProperty;
2580
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
2581
+ var __decorateClass$7 = (decorators, target, key, kind) => {
2582
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
2583
2583
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2584
2584
  if (decorator = decorators[i3])
2585
2585
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2586
- if (kind && result) __defProp$6(target, key, result);
2586
+ if (kind && result) __defProp$7(target, key, result);
2587
2587
  return result;
2588
2588
  };
2589
2589
  const notificationIcons = {
@@ -2631,17 +2631,17 @@ let SDSNotification = class extends i$1 {
2631
2631
  </div>`;
2632
2632
  }
2633
2633
  };
2634
- SDSNotification.styles = [styles$6];
2635
- __decorateClass$6([
2634
+ SDSNotification.styles = [styles$7];
2635
+ __decorateClass$7([
2636
2636
  n2({ type: String, reflect: true })
2637
2637
  ], SDSNotification.prototype, "variant", 2);
2638
- __decorateClass$6([
2638
+ __decorateClass$7([
2639
2639
  n2({ type: String, attribute: "removable-label", reflect: true })
2640
2640
  ], SDSNotification.prototype, "removableLabel", 2);
2641
- SDSNotification = __decorateClass$6([
2641
+ SDSNotification = __decorateClass$7([
2642
2642
  guardedCustomElement("sds-notification")
2643
2643
  ], SDSNotification);
2644
- const styles$5 = i$4`
2644
+ const styles$6 = i$4`
2645
2645
  :host {
2646
2646
  display: block;
2647
2647
  }
@@ -2676,14 +2676,14 @@ const styles$5 = i$4`
2676
2676
  }
2677
2677
  }
2678
2678
  `;
2679
- var __defProp$5 = Object.defineProperty;
2680
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
2681
- var __decorateClass$5 = (decorators, target, key, kind) => {
2682
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
2679
+ var __defProp$6 = Object.defineProperty;
2680
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
2681
+ var __decorateClass$6 = (decorators, target, key, kind) => {
2682
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
2683
2683
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2684
2684
  if (decorator = decorators[i3])
2685
2685
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2686
- if (kind && result) __defProp$5(target, key, result);
2686
+ if (kind && result) __defProp$6(target, key, result);
2687
2687
  return result;
2688
2688
  };
2689
2689
  let SDSParagraph = class extends i$1 {
@@ -2702,14 +2702,14 @@ let SDSParagraph = class extends i$1 {
2702
2702
  return x`<p class=${classes}><slot></slot></p>`;
2703
2703
  }
2704
2704
  };
2705
- SDSParagraph.styles = [styles$5];
2706
- __decorateClass$5([
2705
+ SDSParagraph.styles = [styles$6];
2706
+ __decorateClass$6([
2707
2707
  n2({ type: String })
2708
2708
  ], SDSParagraph.prototype, "size", 2);
2709
- SDSParagraph = __decorateClass$5([
2709
+ SDSParagraph = __decorateClass$6([
2710
2710
  guardedCustomElement("sds-paragraph")
2711
2711
  ], SDSParagraph);
2712
- const styles$4 = i$4`
2712
+ const styles$5 = i$4`
2713
2713
  :host {
2714
2714
  flex: 0 0 auto;
2715
2715
  }
@@ -2817,14 +2817,14 @@ const styles$4 = i$4`
2817
2817
  padding-top: 2px;
2818
2818
  }
2819
2819
  `;
2820
- var __defProp$4 = Object.defineProperty;
2821
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
2822
- var __decorateClass$4 = (decorators, target, key, kind) => {
2823
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
2820
+ var __defProp$5 = Object.defineProperty;
2821
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
2822
+ var __decorateClass$5 = (decorators, target, key, kind) => {
2823
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
2824
2824
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2825
2825
  if (decorator = decorators[i3])
2826
2826
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2827
- if (kind && result) __defProp$4(target, key, result);
2827
+ if (kind && result) __defProp$5(target, key, result);
2828
2828
  return result;
2829
2829
  };
2830
2830
  let SDSRadio = class extends i$1 {
@@ -3038,39 +3038,39 @@ let SDSRadio = class extends i$1 {
3038
3038
  `;
3039
3039
  }
3040
3040
  };
3041
- SDSRadio.styles = [styles$4];
3041
+ SDSRadio.styles = [styles$5];
3042
3042
  SDSRadio.formAssociated = true;
3043
- __decorateClass$4([
3043
+ __decorateClass$5([
3044
3044
  n2({ type: Boolean, reflect: true })
3045
3045
  ], SDSRadio.prototype, "disabled", 2);
3046
- __decorateClass$4([
3046
+ __decorateClass$5([
3047
3047
  n2({ type: Boolean, reflect: true })
3048
3048
  ], SDSRadio.prototype, "required", 2);
3049
- __decorateClass$4([
3049
+ __decorateClass$5([
3050
3050
  n2({ type: String, reflect: true })
3051
3051
  ], SDSRadio.prototype, "label", 2);
3052
- __decorateClass$4([
3052
+ __decorateClass$5([
3053
3053
  n2({ type: Boolean, reflect: true, attribute: "hide-label" })
3054
3054
  ], SDSRadio.prototype, "hideLabel", 2);
3055
- __decorateClass$4([
3055
+ __decorateClass$5([
3056
3056
  n2({ type: String, reflect: true })
3057
3057
  ], SDSRadio.prototype, "name", 2);
3058
- __decorateClass$4([
3058
+ __decorateClass$5([
3059
3059
  n2({ type: String })
3060
3060
  ], SDSRadio.prototype, "value", 2);
3061
- __decorateClass$4([
3061
+ __decorateClass$5([
3062
3062
  n2({ type: Boolean, reflect: true })
3063
3063
  ], SDSRadio.prototype, "checked", 2);
3064
- __decorateClass$4([
3064
+ __decorateClass$5([
3065
3065
  n2({ type: Boolean, reflect: true })
3066
3066
  ], SDSRadio.prototype, "error", 2);
3067
- __decorateClass$4([
3067
+ __decorateClass$5([
3068
3068
  e$3("#control")
3069
3069
  ], SDSRadio.prototype, "control", 2);
3070
- SDSRadio = __decorateClass$4([
3070
+ SDSRadio = __decorateClass$5([
3071
3071
  guardedCustomElement("sds-radio")
3072
3072
  ], SDSRadio);
3073
- const styles$3 = i$4`
3073
+ const styles$4 = i$4`
3074
3074
  .sds-radio-group {
3075
3075
  border: 0;
3076
3076
  margin: 0;
@@ -3115,14 +3115,14 @@ const styles$3 = i$4`
3115
3115
  gap: var(--sds-spacing-2);
3116
3116
  }
3117
3117
  `;
3118
- var __defProp$3 = Object.defineProperty;
3119
- var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
3120
- var __decorateClass$3 = (decorators, target, key, kind) => {
3121
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
3118
+ var __defProp$4 = Object.defineProperty;
3119
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
3120
+ var __decorateClass$4 = (decorators, target, key, kind) => {
3121
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
3122
3122
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
3123
3123
  if (decorator = decorators[i3])
3124
3124
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3125
- if (kind && result) __defProp$3(target, key, result);
3125
+ if (kind && result) __defProp$4(target, key, result);
3126
3126
  return result;
3127
3127
  };
3128
3128
  let SDSRadioGroup = class extends i$1 {
@@ -3153,35 +3153,28 @@ let SDSRadioGroup = class extends i$1 {
3153
3153
  <div class="sds-radio-group__radios" @change=${this._handleRadioChange}>
3154
3154
  <slot></slot>
3155
3155
  </div>
3156
- ${this.errorMessage ? x`<p class="sds-radio-group__error-message">
3157
- <sds-icon
3158
- name="warning-material-filled"
3159
- size="m"
3160
- color="var(--sds-color-semantic-icon-critical)"
3161
- ></sds-icon>
3162
- ${this.errorMessage}
3163
- </p>` : E}
3156
+ ${renderErrorMessage(this.errorMessage, "sds-radio-group__error-message")}
3164
3157
  </fieldset>
3165
3158
  `;
3166
3159
  }
3167
3160
  };
3168
- SDSRadioGroup.styles = [styles$3];
3169
- __decorateClass$3([
3161
+ SDSRadioGroup.styles = [styles$4];
3162
+ __decorateClass$4([
3170
3163
  n2({ type: String })
3171
3164
  ], SDSRadioGroup.prototype, "legend", 2);
3172
- __decorateClass$3([
3165
+ __decorateClass$4([
3173
3166
  n2({ type: String, attribute: "help-text" })
3174
3167
  ], SDSRadioGroup.prototype, "helpText", 2);
3175
- __decorateClass$3([
3168
+ __decorateClass$4([
3176
3169
  n2({ type: String, attribute: "error-message" })
3177
3170
  ], SDSRadioGroup.prototype, "errorMessage", 2);
3178
- __decorateClass$3([
3171
+ __decorateClass$4([
3179
3172
  r()
3180
3173
  ], SDSRadioGroup.prototype, "_selectedValue", 2);
3181
- SDSRadioGroup = __decorateClass$3([
3174
+ SDSRadioGroup = __decorateClass$4([
3182
3175
  guardedCustomElement("sds-radio-group")
3183
3176
  ], SDSRadioGroup);
3184
- const styles$2 = i$4`
3177
+ const styles$3 = i$4`
3185
3178
  :host {
3186
3179
  display: inline-flex;
3187
3180
  contain: layout style;
@@ -3304,14 +3297,14 @@ const styles$2 = i$4`
3304
3297
  background-color: var(--sds-color-semantic-surface-default);
3305
3298
  }
3306
3299
  `;
3307
- var __defProp$2 = Object.defineProperty;
3308
- var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
3309
- var __decorateClass$2 = (decorators, target, key, kind) => {
3310
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
3300
+ var __defProp$3 = Object.defineProperty;
3301
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
3302
+ var __decorateClass$3 = (decorators, target, key, kind) => {
3303
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
3311
3304
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
3312
3305
  if (decorator = decorators[i3])
3313
3306
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3314
- if (kind && result) __defProp$2(target, key, result);
3307
+ if (kind && result) __defProp$3(target, key, result);
3315
3308
  return result;
3316
3309
  };
3317
3310
  let SDSSwitch = class extends i$1 {
@@ -3411,36 +3404,36 @@ let SDSSwitch = class extends i$1 {
3411
3404
  </div>`;
3412
3405
  }
3413
3406
  };
3414
- SDSSwitch.styles = [styles$2];
3407
+ SDSSwitch.styles = [styles$3];
3415
3408
  SDSSwitch.formAssociated = true;
3416
- __decorateClass$2([
3409
+ __decorateClass$3([
3417
3410
  n2({ type: Boolean, reflect: true })
3418
3411
  ], SDSSwitch.prototype, "disabled", 2);
3419
- __decorateClass$2([
3412
+ __decorateClass$3([
3420
3413
  n2({ type: String, reflect: true })
3421
3414
  ], SDSSwitch.prototype, "label", 2);
3422
- __decorateClass$2([
3415
+ __decorateClass$3([
3423
3416
  n2({ type: Boolean, reflect: true, attribute: "hide-label" })
3424
3417
  ], SDSSwitch.prototype, "hideLabel", 2);
3425
- __decorateClass$2([
3418
+ __decorateClass$3([
3426
3419
  n2({ type: String, reflect: true })
3427
3420
  ], SDSSwitch.prototype, "name", 2);
3428
- __decorateClass$2([
3421
+ __decorateClass$3([
3429
3422
  n2({ type: Boolean, reflect: true })
3430
3423
  ], SDSSwitch.prototype, "reverse", 2);
3431
- __decorateClass$2([
3424
+ __decorateClass$3([
3432
3425
  n2({ type: Boolean, reflect: true })
3433
3426
  ], SDSSwitch.prototype, "checked", 2);
3434
- __decorateClass$2([
3427
+ __decorateClass$3([
3435
3428
  n2({ type: String, reflect: true })
3436
3429
  ], SDSSwitch.prototype, "size", 2);
3437
- __decorateClass$2([
3430
+ __decorateClass$3([
3438
3431
  e$3("#control")
3439
3432
  ], SDSSwitch.prototype, "control", 2);
3440
- SDSSwitch = __decorateClass$2([
3433
+ SDSSwitch = __decorateClass$3([
3441
3434
  guardedCustomElement("sds-switch")
3442
3435
  ], SDSSwitch);
3443
- const styles$1 = i$4`
3436
+ const styles$2 = i$4`
3444
3437
  :host {
3445
3438
  display: block;
3446
3439
  }
@@ -3469,14 +3462,14 @@ const styles$1 = i$4`
3469
3462
  line-height: 1.285;
3470
3463
  }
3471
3464
  `;
3472
- var __defProp$1 = Object.defineProperty;
3473
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
3474
- var __decorateClass$1 = (decorators, target, key, kind) => {
3475
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
3465
+ var __defProp$2 = Object.defineProperty;
3466
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
3467
+ var __decorateClass$2 = (decorators, target, key, kind) => {
3468
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
3476
3469
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
3477
3470
  if (decorator = decorators[i3])
3478
3471
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3479
- if (kind && result) __defProp$1(target, key, result);
3472
+ if (kind && result) __defProp$2(target, key, result);
3480
3473
  return result;
3481
3474
  };
3482
3475
  let SDSText = class extends i$1 {
@@ -3495,13 +3488,351 @@ let SDSText = class extends i$1 {
3495
3488
  return x`<p class=${classes}><slot></slot></p>`;
3496
3489
  }
3497
3490
  };
3498
- SDSText.styles = [styles$1];
3499
- __decorateClass$1([
3491
+ SDSText.styles = [styles$2];
3492
+ __decorateClass$2([
3500
3493
  n2({ type: String })
3501
3494
  ], SDSText.prototype, "size", 2);
3502
- SDSText = __decorateClass$1([
3495
+ SDSText = __decorateClass$2([
3503
3496
  guardedCustomElement("sds-text")
3504
3497
  ], SDSText);
3498
+ const styles$1 = i$4`
3499
+ :host {
3500
+ all: unset;
3501
+ display: block;
3502
+ text-align: start;
3503
+ }
3504
+
3505
+ .sds-textarea {
3506
+ display: flex;
3507
+ flex-direction: column;
3508
+ gap: 0.25rem;
3509
+ font-family: var(--sds-typography-font-family);
3510
+
3511
+ .sds-textarea__input-container {
3512
+ max-width: var(--sds-typography-max-line-width);
3513
+ position: relative;
3514
+ }
3515
+
3516
+ .sds-textarea__input {
3517
+ box-sizing: border-box;
3518
+ color: var(--sds-color-semantic-text-default);
3519
+ padding: 0.75rem 1rem;
3520
+ line-height: 1.25rem;
3521
+ font-size: 1rem;
3522
+ justify-content: flex-end;
3523
+ border-radius: var(--sds-radius-4);
3524
+ border: 1px solid var(--sds-color-semantic-border-default);
3525
+ background: var(--sds-color-semantic-surface-default);
3526
+ max-width: var(--sds-typography-max-line-width);
3527
+ width: 100%;
3528
+ min-height: 6rem;
3529
+ resize: vertical;
3530
+ font-family: var(--sds-typography-font-family);
3531
+
3532
+ &:hover {
3533
+ border-color: var(--sds-color-semantic-border-strong);
3534
+ }
3535
+
3536
+ &:focus {
3537
+ outline: 2px solid var(--sds-color-semantic-border-focus);
3538
+ outline-offset: 1px;
3539
+ }
3540
+
3541
+ &:active {
3542
+ border-color: var(--sds-color-semantic-border-action);
3543
+ outline: none;
3544
+ }
3545
+ }
3546
+
3547
+ .sds-textarea__label {
3548
+ color: var(--sds-color-semantic-text-default);
3549
+ display: block;
3550
+ font-size: 1rem;
3551
+ font-weight: 500;
3552
+ line-height: 1.5rem;
3553
+ max-width: var(--sds-typography-max-line-width);
3554
+ }
3555
+
3556
+ .sds-textarea__help-text,
3557
+ .sds-textarea__character-counter {
3558
+ color: var(--sds-color-semantic-text-subtle);
3559
+ font-size: 1rem;
3560
+ font-weight: 400;
3561
+ line-height: 1.25rem;
3562
+ margin: 0;
3563
+ max-width: var(--sds-typography-max-line-width);
3564
+ }
3565
+
3566
+ .sds-textarea__character-counter--error {
3567
+ color: var(--sds-color-semantic-text-warning);
3568
+ }
3569
+
3570
+ .sds-textarea__error-message {
3571
+ margin: 0;
3572
+ max-width: var(--sds-typography-max-line-width);
3573
+ align-items: flex-start;
3574
+ color: var(--sds-color-semantic-text-default);
3575
+ display: flex;
3576
+ line-height: 1.5rem;
3577
+ gap: 0.25rem;
3578
+ }
3579
+ }
3580
+
3581
+ .sds-textarea--error {
3582
+ color: var(--sds-color-semantic-text-default);
3583
+ line-height: 1.5rem;
3584
+
3585
+ .sds-textarea__input,
3586
+ .sds-textarea__input:hover {
3587
+ border-color: var(--sds-color-semantic-border-critical);
3588
+ }
3589
+ }
3590
+
3591
+ .sds-textarea--disabled {
3592
+ pointer-events: none;
3593
+
3594
+ .sds-textarea__label,
3595
+ .sds-textarea__help-text,
3596
+ .sds-textarea__character-counter,
3597
+ .sds-textarea__error-message,
3598
+ .sds-textarea__input {
3599
+ color: var(--sds-color-semantic-text-disabled);
3600
+ }
3601
+
3602
+ .sds-textarea__input {
3603
+ border: 1px solid var(--sds-color-semantic-border-disabled);
3604
+ resize: none;
3605
+ }
3606
+ }
3607
+
3608
+ .sds-textarea--readonly {
3609
+ .sds-textarea__input {
3610
+ resize: none;
3611
+ }
3612
+ }
3613
+ `;
3614
+ var __defProp$1 = Object.defineProperty;
3615
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
3616
+ var __decorateClass$1 = (decorators, target, key, kind) => {
3617
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
3618
+ for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
3619
+ if (decorator = decorators[i3])
3620
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3621
+ if (kind && result) __defProp$1(target, key, result);
3622
+ return result;
3623
+ };
3624
+ let SDSTextArea = class extends i$1 {
3625
+ constructor() {
3626
+ super();
3627
+ this.disabled = false;
3628
+ this.readOnly = false;
3629
+ this.required = false;
3630
+ this._defaultValue = "";
3631
+ this._handleInputChange = (event) => {
3632
+ event.stopImmediatePropagation();
3633
+ if (!this.disabled) {
3634
+ const currentValue = event.target.value;
3635
+ this.value = currentValue;
3636
+ this.internals.setFormValue(currentValue === "" ? null : currentValue);
3637
+ this.updateValidity();
3638
+ this.dispatchEvent(new CustomEvent(event.type, { bubbles: true, composed: true }));
3639
+ }
3640
+ };
3641
+ this._handleSelect = (event) => {
3642
+ event.stopImmediatePropagation();
3643
+ if (!this.disabled) {
3644
+ this.dispatchEvent(new CustomEvent("select", { bubbles: true, composed: true }));
3645
+ }
3646
+ };
3647
+ this._handleFocus = (event) => {
3648
+ event.stopImmediatePropagation();
3649
+ this.dispatchEvent(new CustomEvent("focus", { bubbles: true, composed: true }));
3650
+ };
3651
+ this._handleBlur = (event) => {
3652
+ event.stopImmediatePropagation();
3653
+ this.updateValidity();
3654
+ this.dispatchEvent(new CustomEvent("blur", { bubbles: true, composed: true }));
3655
+ };
3656
+ this.internals = this.attachInternals();
3657
+ this.attachShadow({ mode: "open", delegatesFocus: true });
3658
+ }
3659
+ connectedCallback() {
3660
+ super.connectedCallback();
3661
+ this._defaultValue = this.value ?? "";
3662
+ }
3663
+ updateValidity() {
3664
+ if (this.control.checkValidity()) {
3665
+ this.internals.setValidity({});
3666
+ } else {
3667
+ this.internals.setValidity({ customError: true }, this.control.validationMessage, this.control);
3668
+ }
3669
+ }
3670
+ renderCharacterCounter() {
3671
+ if (this.counter === void 0) return E;
3672
+ const currentLength = this.value?.length || 0;
3673
+ const isOverCounter = currentLength > this.counter;
3674
+ if (isOverCounter) {
3675
+ return x`<p class="sds-textarea__character-counter sds-textarea__character-counter--error">
3676
+ Du har ${currentLength - this.counter} tegn for mye
3677
+ </p>`;
3678
+ }
3679
+ return x`<p class="sds-textarea__character-counter">Du har ${this.counter - currentLength} tegn igjen</p>`;
3680
+ }
3681
+ formResetCallback() {
3682
+ this.control.value = this._defaultValue;
3683
+ this.internals.setFormValue(this._defaultValue === "" ? null : this._defaultValue);
3684
+ this.value = this._defaultValue;
3685
+ this.updateValidity();
3686
+ }
3687
+ select() {
3688
+ if (!this.disabled) this.control.select();
3689
+ }
3690
+ type() {
3691
+ return "textarea";
3692
+ }
3693
+ focus() {
3694
+ if (!this.disabled) this.control.focus();
3695
+ }
3696
+ blur() {
3697
+ if (!this.disabled) this.control.blur();
3698
+ }
3699
+ click() {
3700
+ if (!this.disabled) this.control.click();
3701
+ }
3702
+ get selectionStart() {
3703
+ return this.control ? this.control.selectionStart : null;
3704
+ }
3705
+ set selectionStart(value) {
3706
+ if (this.control && value !== null) {
3707
+ this.control.selectionStart = value;
3708
+ }
3709
+ }
3710
+ get selectionEnd() {
3711
+ return this.control ? this.control.selectionEnd : null;
3712
+ }
3713
+ set selectionEnd(value) {
3714
+ if (this.control && value !== null) {
3715
+ this.control.selectionEnd = value;
3716
+ }
3717
+ }
3718
+ setSelectionRange(start, end, direction) {
3719
+ if (this.control) {
3720
+ this.control.setSelectionRange(start, end, direction);
3721
+ }
3722
+ }
3723
+ checkValidity() {
3724
+ return this.control.checkValidity();
3725
+ }
3726
+ reportValidity() {
3727
+ return this.control.reportValidity();
3728
+ }
3729
+ setCustomValidity(message) {
3730
+ this.control.setCustomValidity(message);
3731
+ this.updateValidity();
3732
+ }
3733
+ render() {
3734
+ const textareaClasses = {
3735
+ "sds-textarea": true,
3736
+ "sds-textarea--error": Boolean(this.errorMessage),
3737
+ "sds-textarea--disabled": Boolean(this.disabled),
3738
+ "sds-textarea--readonly": Boolean(this.readOnly)
3739
+ };
3740
+ return x`
3741
+ <div class="${e$1(textareaClasses)}">
3742
+ ${this.label ? x`<label for="sds-textarea" class="sds-textarea__label">${this.label}</label>` : E}
3743
+ ${this.helpText ? x`<p class="sds-textarea__help-text">${this.helpText}</p>` : E}
3744
+ <div class="sds-textarea__input-container">
3745
+ <textarea
3746
+ class="sds-textarea__input"
3747
+ id="sds-textarea"
3748
+ ?disabled="${this.disabled}"
3749
+ ?readonly="${this.readOnly}"
3750
+ placeholder="${o$1(this.placeholder)}"
3751
+ .value="${this.value ?? ""}"
3752
+ .autocomplete="${this.autocomplete}"
3753
+ name="${o$1(this.name)}"
3754
+ ?required="${this.required}"
3755
+ rows="${o$1(this.rows)}"
3756
+ cols="${o$1(this.cols)}"
3757
+ wrap="${o$1(this.wrap)}"
3758
+ minlength="${o$1(this.minlength)}"
3759
+ maxlength="${o$1(this.maxlength)}"
3760
+ @input="${this._handleInputChange}"
3761
+ @change="${this._handleInputChange}"
3762
+ @select="${this._handleSelect}"
3763
+ @focus="${this._handleFocus}"
3764
+ @blur="${this._handleBlur}"
3765
+ ></textarea>
3766
+ </div>
3767
+ ${this.renderCharacterCounter()}
3768
+ ${this.errorMessage ? x`<p class="sds-textarea__error-message">
3769
+ <sds-icon
3770
+ name="warning-material-filled"
3771
+ size="m"
3772
+ color="${!this.disabled ? `var(--sds-color-semantic-icon-critical)` : `var(--sds-color-semantic-icon-disabled)`}"
3773
+ ></sds-icon>
3774
+ ${this.errorMessage}
3775
+ </p>` : E}
3776
+ </div>
3777
+ `;
3778
+ }
3779
+ };
3780
+ SDSTextArea.styles = [styles$1];
3781
+ SDSTextArea.formAssociated = true;
3782
+ __decorateClass$1([
3783
+ n2({ type: String })
3784
+ ], SDSTextArea.prototype, "value", 2);
3785
+ __decorateClass$1([
3786
+ n2({ type: String, reflect: true })
3787
+ ], SDSTextArea.prototype, "name", 2);
3788
+ __decorateClass$1([
3789
+ n2({ type: String, reflect: true })
3790
+ ], SDSTextArea.prototype, "label", 2);
3791
+ __decorateClass$1([
3792
+ n2({ type: String, reflect: true })
3793
+ ], SDSTextArea.prototype, "placeholder", 2);
3794
+ __decorateClass$1([
3795
+ n2({ type: String, attribute: "help-text", reflect: true })
3796
+ ], SDSTextArea.prototype, "helpText", 2);
3797
+ __decorateClass$1([
3798
+ n2({ type: String, attribute: "error-message", reflect: true })
3799
+ ], SDSTextArea.prototype, "errorMessage", 2);
3800
+ __decorateClass$1([
3801
+ n2({ type: Boolean, reflect: true })
3802
+ ], SDSTextArea.prototype, "disabled", 2);
3803
+ __decorateClass$1([
3804
+ n2({ type: Boolean, attribute: "readonly", reflect: true })
3805
+ ], SDSTextArea.prototype, "readOnly", 2);
3806
+ __decorateClass$1([
3807
+ n2({ type: String, reflect: true })
3808
+ ], SDSTextArea.prototype, "autocomplete", 2);
3809
+ __decorateClass$1([
3810
+ n2({ type: Boolean, reflect: true })
3811
+ ], SDSTextArea.prototype, "required", 2);
3812
+ __decorateClass$1([
3813
+ n2({ type: Number, reflect: true })
3814
+ ], SDSTextArea.prototype, "rows", 2);
3815
+ __decorateClass$1([
3816
+ n2({ type: Number, reflect: true })
3817
+ ], SDSTextArea.prototype, "cols", 2);
3818
+ __decorateClass$1([
3819
+ n2({ type: String, reflect: true })
3820
+ ], SDSTextArea.prototype, "wrap", 2);
3821
+ __decorateClass$1([
3822
+ n2({ type: Number, reflect: true })
3823
+ ], SDSTextArea.prototype, "minlength", 2);
3824
+ __decorateClass$1([
3825
+ n2({ type: Number, reflect: true })
3826
+ ], SDSTextArea.prototype, "maxlength", 2);
3827
+ __decorateClass$1([
3828
+ n2({ type: Number, reflect: true })
3829
+ ], SDSTextArea.prototype, "counter", 2);
3830
+ __decorateClass$1([
3831
+ e$3("#sds-textarea")
3832
+ ], SDSTextArea.prototype, "control", 2);
3833
+ SDSTextArea = __decorateClass$1([
3834
+ guardedCustomElement("sds-textarea")
3835
+ ], SDSTextArea);
3505
3836
  const styles = i$4`
3506
3837
  :host {
3507
3838
  all: unset;
@@ -3762,14 +4093,7 @@ let SDSTextField = class extends i$1 {
3762
4093
  />
3763
4094
  <slot name="after" @slotchange="${this.handleSlotChange}" aria-hidden="true"></slot>
3764
4095
  </div>
3765
- ${this.errorMessage ? x`<p class="sds-textfield__error-message">
3766
- <sds-icon
3767
- name="warning-material-filled"
3768
- size="m"
3769
- color="${!this.disabled ? `var(--sds-color-semantic-icon-critical)` : `var(--sds-color-semantic-icon-disabled)`}"
3770
- ></sds-icon>
3771
- ${this.errorMessage}
3772
- </p>` : E}
4096
+ ${renderErrorMessage(this.errorMessage, "sds-textfield__error-message", this.disabled)}
3773
4097
  </div>
3774
4098
  `;
3775
4099
  }
@@ -3845,5 +4169,6 @@ export {
3845
4169
  SDSRadioGroup,
3846
4170
  SDSSwitch,
3847
4171
  SDSText,
4172
+ SDSTextArea,
3848
4173
  SDSTextField
3849
4174
  };