@politiet/sheriff-web-components 1.1.0 → 1.3.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 (44) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/sds-button/sds-button.d.ts +5 -0
  6. package/dist/sds-button/sds-button.d.ts.map +1 -1
  7. package/dist/sds-button/sds-button.js +19 -0
  8. package/dist/sds-button/sds-button.js.map +1 -1
  9. package/dist/sds-button/sds-button.spec.js +36 -0
  10. package/dist/sds-button/sds-button.spec.js.map +1 -1
  11. package/dist/sds-button/sds-button.styles.d.ts.map +1 -1
  12. package/dist/sds-button/sds-button.styles.js +11 -7
  13. package/dist/sds-button/sds-button.styles.js.map +1 -1
  14. package/dist/sds-checkbox-group/sds-checkbox-group.d.ts.map +1 -1
  15. package/dist/sds-checkbox-group/sds-checkbox-group.js +3 -13
  16. package/dist/sds-checkbox-group/sds-checkbox-group.js.map +1 -1
  17. package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -1
  18. package/dist/sds-radio-group/sds-radio-group.js +3 -13
  19. package/dist/sds-radio-group/sds-radio-group.js.map +1 -1
  20. package/dist/sds-textarea/sds-textarea.d.ts +77 -0
  21. package/dist/sds-textarea/sds-textarea.d.ts.map +1 -0
  22. package/dist/sds-textarea/sds-textarea.js +240 -0
  23. package/dist/sds-textarea/sds-textarea.js.map +1 -0
  24. package/dist/sds-textarea/sds-textarea.spec.d.ts +2 -0
  25. package/dist/sds-textarea/sds-textarea.spec.d.ts.map +1 -0
  26. package/dist/sds-textarea/sds-textarea.spec.js +171 -0
  27. package/dist/sds-textarea/sds-textarea.spec.js.map +1 -0
  28. package/dist/sds-textarea/sds-textarea.styles.d.ts +2 -0
  29. package/dist/sds-textarea/sds-textarea.styles.d.ts.map +1 -0
  30. package/dist/sds-textarea/sds-textarea.styles.js +118 -0
  31. package/dist/sds-textarea/sds-textarea.styles.js.map +1 -0
  32. package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
  33. package/dist/sds-textfield/sds-textfield.js +2 -12
  34. package/dist/sds-textfield/sds-textfield.js.map +1 -1
  35. package/dist/sheriff-web-components.js +589 -241
  36. package/dist/utils/renderErrorMessage.d.ts +3 -0
  37. package/dist/utils/renderErrorMessage.d.ts.map +1 -0
  38. package/dist/utils/renderErrorMessage.js +9 -0
  39. package/dist/utils/renderErrorMessage.js.map +1 -0
  40. package/dist/utils/types.d.ts +2 -0
  41. package/dist/utils/types.d.ts.map +1 -0
  42. package/dist/utils/types.js +2 -0
  43. package/dist/utils/types.js.map +1 -0
  44. 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;
@@ -679,6 +679,12 @@ const styles$h = i$4`
679
679
  border: 2px solid var(--sds-color-semantic-surface-action-hover);
680
680
  }
681
681
 
682
+ &:focus {
683
+ background-color: var(--sds-color-semantic-surface-action-default);
684
+ outline: 2px solid var(--sds-color-semantic-surface-action-default);
685
+ outline-offset: 1px;
686
+ }
687
+
682
688
  &:active {
683
689
  background-color: var(--sds-color-semantic-surface-action-active);
684
690
  border: 2px solid var(--sds-color-semantic-surface-action-active);
@@ -693,13 +699,6 @@ const styles$h = i$4`
693
699
  }
694
700
  }
695
701
 
696
- .sds-button:focus,
697
- :host(:focus) .give-focus {
698
- background-color: var(--sds-color-semantic-surface-action-default);
699
- outline: 2px solid var(--sds-color-semantic-surface-action-default);
700
- outline-offset: 1px;
701
- }
702
-
703
702
  .sds-button--secondary {
704
703
  background-color: var(--sds-color-semantic-surface-action-inverted);
705
704
  border: 2px solid var(--sds-color-semantic-border-action);
@@ -793,15 +792,20 @@ const styles$h = i$4`
793
792
  font-size: 0.875rem;
794
793
  padding: 0 var(--sds-spacing-3);
795
794
  }
795
+
796
+ .sds-button--as-link {
797
+ inline-size: auto;
798
+ text-decoration: none;
799
+ }
796
800
  `;
797
- var __defProp$h = Object.defineProperty;
798
- var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
799
- var __decorateClass$h = (decorators, target, key, kind) => {
800
- 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;
801
805
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
802
806
  if (decorator = decorators[i3])
803
807
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
804
- if (kind && result) __defProp$h(target, key, result);
808
+ if (kind && result) __defProp$i(target, key, result);
805
809
  return result;
806
810
  };
807
811
  let SDSButton = class extends i$1 {
@@ -882,8 +886,21 @@ let SDSButton = class extends i$1 {
882
886
  "sds-button--tertiary": this.variant === "tertiary",
883
887
  "sds-button--critical": this.variant === "critical",
884
888
  "sds-button--medium": this.size === "medium",
885
- "sds-button--small": this.size === "small"
889
+ "sds-button--small": this.size === "small",
890
+ "sds-button--as-link": !!this.href
886
891
  };
892
+ if (this.href) {
893
+ return x` <a
894
+ id="link"
895
+ class="${e$1(buttonClasses)}"
896
+ href="${this.href}"
897
+ target="${o$1(this.target)}"
898
+ >
899
+ <slot name="before"></slot>
900
+ <slot></slot>
901
+ <slot name="after"></slot>
902
+ </a>`;
903
+ }
887
904
  return x`
888
905
  <button
889
906
  id="control"
@@ -902,33 +919,39 @@ let SDSButton = class extends i$1 {
902
919
  `;
903
920
  }
904
921
  };
905
- SDSButton.styles = [styles$h];
922
+ SDSButton.styles = [styles$i];
906
923
  SDSButton.formAssociated = true;
907
- __decorateClass$h([
924
+ __decorateClass$i([
908
925
  n2({ type: String, reflect: true })
909
926
  ], SDSButton.prototype, "type", 2);
910
- __decorateClass$h([
927
+ __decorateClass$i([
911
928
  n2({ type: String, reflect: true })
912
929
  ], SDSButton.prototype, "variant", 2);
913
- __decorateClass$h([
930
+ __decorateClass$i([
914
931
  n2({ type: String, reflect: true })
915
932
  ], SDSButton.prototype, "size", 2);
916
- __decorateClass$h([
933
+ __decorateClass$i([
917
934
  n2({ type: Boolean, reflect: true })
918
935
  ], SDSButton.prototype, "disabled", 2);
919
- __decorateClass$h([
936
+ __decorateClass$i([
920
937
  n2({ type: String, reflect: true })
921
938
  ], SDSButton.prototype, "name", 2);
922
- __decorateClass$h([
939
+ __decorateClass$i([
923
940
  n2({ type: String, reflect: true })
924
941
  ], SDSButton.prototype, "value", 2);
925
- __decorateClass$h([
942
+ __decorateClass$i([
926
943
  n2({ type: String, reflect: true })
927
944
  ], SDSButton.prototype, "form", 2);
928
- SDSButton = __decorateClass$h([
945
+ __decorateClass$i([
946
+ n2({ type: String, reflect: true })
947
+ ], SDSButton.prototype, "href", 2);
948
+ __decorateClass$i([
949
+ n2({ type: String, reflect: true })
950
+ ], SDSButton.prototype, "target", 2);
951
+ SDSButton = __decorateClass$i([
929
952
  guardedCustomElement("sds-button")
930
953
  ], SDSButton);
931
- const styles$g = i$4`
954
+ const styles$h = i$4`
932
955
  :host {
933
956
  flex: 0 0 auto;
934
957
  }
@@ -1037,14 +1060,14 @@ const styles$g = i$4`
1037
1060
  padding-top: 2px;
1038
1061
  }
1039
1062
  `;
1040
- var __defProp$g = Object.defineProperty;
1041
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
1042
- var __decorateClass$g = (decorators, target, key, kind) => {
1043
- 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;
1044
1067
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1045
1068
  if (decorator = decorators[i3])
1046
1069
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1047
- if (kind && result) __defProp$g(target, key, result);
1070
+ if (kind && result) __defProp$h(target, key, result);
1048
1071
  return result;
1049
1072
  };
1050
1073
  let SDSCheckbox = class extends i$1 {
@@ -1180,36 +1203,36 @@ let SDSCheckbox = class extends i$1 {
1180
1203
  `;
1181
1204
  }
1182
1205
  };
1183
- SDSCheckbox.styles = [styles$g];
1206
+ SDSCheckbox.styles = [styles$h];
1184
1207
  SDSCheckbox.formAssociated = true;
1185
- __decorateClass$g([
1208
+ __decorateClass$h([
1186
1209
  n2({ type: String, reflect: true })
1187
1210
  ], SDSCheckbox.prototype, "name", 2);
1188
- __decorateClass$g([
1211
+ __decorateClass$h([
1189
1212
  n2({ type: String, reflect: true })
1190
1213
  ], SDSCheckbox.prototype, "label", 2);
1191
- __decorateClass$g([
1214
+ __decorateClass$h([
1192
1215
  n2({ type: String })
1193
1216
  ], SDSCheckbox.prototype, "value", 2);
1194
- __decorateClass$g([
1217
+ __decorateClass$h([
1195
1218
  n2({ type: Boolean, reflect: true })
1196
1219
  ], SDSCheckbox.prototype, "checked", 2);
1197
- __decorateClass$g([
1220
+ __decorateClass$h([
1198
1221
  n2({ type: Boolean, reflect: true })
1199
1222
  ], SDSCheckbox.prototype, "disabled", 2);
1200
- __decorateClass$g([
1223
+ __decorateClass$h([
1201
1224
  n2({ type: Boolean, reflect: true })
1202
1225
  ], SDSCheckbox.prototype, "error", 2);
1203
- __decorateClass$g([
1226
+ __decorateClass$h([
1204
1227
  n2({ type: Boolean, reflect: true })
1205
1228
  ], SDSCheckbox.prototype, "required", 2);
1206
- __decorateClass$g([
1229
+ __decorateClass$h([
1207
1230
  e$3("#control")
1208
1231
  ], SDSCheckbox.prototype, "control", 2);
1209
- SDSCheckbox = __decorateClass$g([
1232
+ SDSCheckbox = __decorateClass$h([
1210
1233
  guardedCustomElement("sds-checkbox")
1211
1234
  ], SDSCheckbox);
1212
- const styles$f = i$4`
1235
+ const styles$g = i$4`
1213
1236
  :host {
1214
1237
  display: block;
1215
1238
  contain: layout style;
@@ -1334,7 +1357,7 @@ class SDSIconLoader {
1334
1357
  return this.resolver;
1335
1358
  }
1336
1359
  }
1337
- const styles$e = i$4`
1360
+ const styles$f = i$4`
1338
1361
  :host {
1339
1362
  --icon-size: var(--sds-icon-size-m);
1340
1363
  display: inline-block;
@@ -1347,14 +1370,14 @@ const styles$e = i$4`
1347
1370
  --icon-size: var(--sds-icon-size-s);
1348
1371
  }
1349
1372
  `;
1350
- var __defProp$f = Object.defineProperty;
1351
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
1352
- var __decorateClass$f = (decorators, target, key, kind) => {
1353
- 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;
1354
1377
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1355
1378
  if (decorator = decorators[i3])
1356
1379
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1357
- if (kind && result) __defProp$f(target, key, result);
1380
+ if (kind && result) __defProp$g(target, key, result);
1358
1381
  return result;
1359
1382
  };
1360
1383
  let SDSIcon = class extends i$1 {
@@ -1406,34 +1429,41 @@ let SDSIcon = class extends i$1 {
1406
1429
  }
1407
1430
  }
1408
1431
  };
1409
- SDSIcon.styles = [styles$e];
1432
+ SDSIcon.styles = [styles$f];
1410
1433
  SDSIcon.iconLoader = new SDSIconLoader();
1411
- __decorateClass$f([
1434
+ __decorateClass$g([
1412
1435
  n2({ type: String, reflect: true })
1413
1436
  ], SDSIcon.prototype, "name", 2);
1414
- __decorateClass$f([
1437
+ __decorateClass$g([
1415
1438
  n2({ type: String, reflect: true })
1416
1439
  ], SDSIcon.prototype, "size", 2);
1417
- __decorateClass$f([
1440
+ __decorateClass$g([
1418
1441
  n2({ type: String, reflect: true })
1419
1442
  ], SDSIcon.prototype, "color", 2);
1420
- __decorateClass$f([
1443
+ __decorateClass$g([
1421
1444
  n2({ type: String, reflect: true })
1422
1445
  ], SDSIcon.prototype, "label", 2);
1423
- __decorateClass$f([
1446
+ __decorateClass$g([
1424
1447
  r()
1425
1448
  ], SDSIcon.prototype, "svg", 2);
1426
- SDSIcon = __decorateClass$f([
1449
+ SDSIcon = __decorateClass$g([
1427
1450
  guardedCustomElement("sds-icon")
1428
1451
  ], SDSIcon);
1429
- var __defProp$e = Object.defineProperty;
1430
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
1431
- var __decorateClass$e = (decorators, target, key, kind) => {
1432
- 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;
1433
1463
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1434
1464
  if (decorator = decorators[i3])
1435
1465
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1436
- if (kind && result) __defProp$e(target, key, result);
1466
+ if (kind && result) __defProp$f(target, key, result);
1437
1467
  return result;
1438
1468
  };
1439
1469
  let SDSCheckboxGroup = class extends i$1 {
@@ -1468,35 +1498,28 @@ let SDSCheckboxGroup = class extends i$1 {
1468
1498
  <div class="sds-checkbox-group__checkboxes">
1469
1499
  <slot @change=${this._handleCheckboxChange}></slot>
1470
1500
  </div>
1471
- ${this.errorMessage ? x`<p class="sds-checkbox-group__error-message">
1472
- <sds-icon
1473
- name="warning-material-filled"
1474
- size="m"
1475
- color="var(--sds-color-semantic-icon-critical)"
1476
- ></sds-icon>
1477
- ${this.errorMessage}
1478
- </p>` : E}
1501
+ ${renderErrorMessage(this.errorMessage, "sds-checkbox-group__error-message")}
1479
1502
  </fieldset>
1480
1503
  `;
1481
1504
  }
1482
1505
  };
1483
- SDSCheckboxGroup.styles = [styles$f];
1484
- __decorateClass$e([
1506
+ SDSCheckboxGroup.styles = [styles$g];
1507
+ __decorateClass$f([
1485
1508
  n2({ type: String, reflect: true })
1486
1509
  ], SDSCheckboxGroup.prototype, "legend", 2);
1487
- __decorateClass$e([
1510
+ __decorateClass$f([
1488
1511
  n2({ type: String, attribute: "help-text", reflect: true })
1489
1512
  ], SDSCheckboxGroup.prototype, "helpText", 2);
1490
- __decorateClass$e([
1513
+ __decorateClass$f([
1491
1514
  n2({ type: String, attribute: "error-message", reflect: true })
1492
1515
  ], SDSCheckboxGroup.prototype, "errorMessage", 2);
1493
- __decorateClass$e([
1516
+ __decorateClass$f([
1494
1517
  r()
1495
1518
  ], SDSCheckboxGroup.prototype, "_selectedValues", 2);
1496
- SDSCheckboxGroup = __decorateClass$e([
1519
+ SDSCheckboxGroup = __decorateClass$f([
1497
1520
  guardedCustomElement("sds-checkbox-group")
1498
1521
  ], SDSCheckboxGroup);
1499
- const styles$d = i$4`
1522
+ const styles$e = i$4`
1500
1523
  .sds-chip {
1501
1524
  align-items: center;
1502
1525
  display: inline-flex;
@@ -1571,14 +1594,14 @@ const styles$d = i$4`
1571
1594
  }
1572
1595
  }
1573
1596
  `;
1574
- var __defProp$d = Object.defineProperty;
1575
- var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
1576
- var __decorateClass$d = (decorators, target, key, kind) => {
1577
- 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;
1578
1601
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1579
1602
  if (decorator = decorators[i3])
1580
1603
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1581
- if (kind && result) __defProp$d(target, key, result);
1604
+ if (kind && result) __defProp$e(target, key, result);
1582
1605
  return result;
1583
1606
  };
1584
1607
  let SDSChip = class extends i$1 {
@@ -1662,36 +1685,36 @@ let SDSChip = class extends i$1 {
1662
1685
  </label>`;
1663
1686
  }
1664
1687
  };
1665
- SDSChip.styles = [styles$d];
1688
+ SDSChip.styles = [styles$e];
1666
1689
  SDSChip.formAssociated = true;
1667
- __decorateClass$d([
1690
+ __decorateClass$e([
1668
1691
  n2({ type: String, reflect: true })
1669
1692
  ], SDSChip.prototype, "variant", 2);
1670
- __decorateClass$d([
1693
+ __decorateClass$e([
1671
1694
  n2({ type: String, reflect: true })
1672
1695
  ], SDSChip.prototype, "size", 2);
1673
- __decorateClass$d([
1696
+ __decorateClass$e([
1674
1697
  n2({ type: Boolean, reflect: true })
1675
1698
  ], SDSChip.prototype, "checked", 2);
1676
- __decorateClass$d([
1699
+ __decorateClass$e([
1677
1700
  n2({ type: String, reflect: true })
1678
1701
  ], SDSChip.prototype, "name", 2);
1679
- __decorateClass$d([
1702
+ __decorateClass$e([
1680
1703
  n2({ type: String })
1681
1704
  ], SDSChip.prototype, "value", 2);
1682
- __decorateClass$d([
1705
+ __decorateClass$e([
1683
1706
  n2({ type: Boolean, reflect: true })
1684
1707
  ], SDSChip.prototype, "disabled", 2);
1685
- __decorateClass$d([
1708
+ __decorateClass$e([
1686
1709
  n2({ type: Boolean, reflect: true })
1687
1710
  ], SDSChip.prototype, "readonly", 2);
1688
- __decorateClass$d([
1711
+ __decorateClass$e([
1689
1712
  e$3("#control")
1690
1713
  ], SDSChip.prototype, "control", 2);
1691
- SDSChip = __decorateClass$d([
1714
+ SDSChip = __decorateClass$e([
1692
1715
  guardedCustomElement("sds-chip")
1693
1716
  ], SDSChip);
1694
- const styles$c = i$4`
1717
+ const styles$d = i$4`
1695
1718
  :host {
1696
1719
  display: block;
1697
1720
  }
@@ -1714,14 +1737,14 @@ const styles$c = i$4`
1714
1737
  font-weight: 500;
1715
1738
  }
1716
1739
  `;
1717
- var __defProp$c = Object.defineProperty;
1718
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
1719
- var __decorateClass$c = (decorators, target, key, kind) => {
1720
- 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;
1721
1744
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1722
1745
  if (decorator = decorators[i3])
1723
1746
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1724
- if (kind && result) __defProp$c(target, key, result);
1747
+ if (kind && result) __defProp$d(target, key, result);
1725
1748
  return result;
1726
1749
  };
1727
1750
  let SDSDetail = class extends i$1 {
@@ -1739,14 +1762,14 @@ let SDSDetail = class extends i$1 {
1739
1762
  return x`<p class=${classes}><slot></slot></p>`;
1740
1763
  }
1741
1764
  };
1742
- SDSDetail.styles = [styles$c];
1743
- __decorateClass$c([
1765
+ SDSDetail.styles = [styles$d];
1766
+ __decorateClass$d([
1744
1767
  n2({ type: String })
1745
1768
  ], SDSDetail.prototype, "variation", 2);
1746
- SDSDetail = __decorateClass$c([
1769
+ SDSDetail = __decorateClass$d([
1747
1770
  guardedCustomElement("sds-detail")
1748
1771
  ], SDSDetail);
1749
- const styles$b = i$4`
1772
+ const styles$c = i$4`
1750
1773
  :host {
1751
1774
  --_heading-text-align: left;
1752
1775
  display: inline-block;
@@ -1849,14 +1872,14 @@ const styles$b = i$4`
1849
1872
  }
1850
1873
  }
1851
1874
  `;
1852
- var __defProp$b = Object.defineProperty;
1853
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
1854
- var __decorateClass$b = (decorators, target, key, kind) => {
1855
- 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;
1856
1879
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1857
1880
  if (decorator = decorators[i3])
1858
1881
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1859
- if (kind && result) __defProp$b(target, key, result);
1882
+ if (kind && result) __defProp$c(target, key, result);
1860
1883
  return result;
1861
1884
  };
1862
1885
  let SDSHeading = class extends i$1 {
@@ -1892,17 +1915,17 @@ let SDSHeading = class extends i$1 {
1892
1915
  }
1893
1916
  }
1894
1917
  };
1895
- SDSHeading.styles = [styles$b];
1896
- __decorateClass$b([
1918
+ SDSHeading.styles = [styles$c];
1919
+ __decorateClass$c([
1897
1920
  n2({ type: String })
1898
1921
  ], SDSHeading.prototype, "level", 2);
1899
- __decorateClass$b([
1922
+ __decorateClass$c([
1900
1923
  n2({ type: String })
1901
1924
  ], SDSHeading.prototype, "as", 2);
1902
- SDSHeading = __decorateClass$b([
1925
+ SDSHeading = __decorateClass$c([
1903
1926
  guardedCustomElement("sds-heading")
1904
1927
  ], SDSHeading);
1905
- const styles$a = i$4`
1928
+ const styles$b = i$4`
1906
1929
  :host {
1907
1930
  display: block;
1908
1931
  }
@@ -1931,14 +1954,14 @@ const styles$a = i$4`
1931
1954
  line-height: 1.428;
1932
1955
  }
1933
1956
  `;
1934
- var __defProp$a = Object.defineProperty;
1935
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
1936
- var __decorateClass$a = (decorators, target, key, kind) => {
1937
- 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;
1938
1961
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
1939
1962
  if (decorator = decorators[i3])
1940
1963
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1941
- if (kind && result) __defProp$a(target, key, result);
1964
+ if (kind && result) __defProp$b(target, key, result);
1942
1965
  return result;
1943
1966
  };
1944
1967
  let SDSLabel = class extends i$1 {
@@ -1957,17 +1980,17 @@ let SDSLabel = class extends i$1 {
1957
1980
  return x`<label for="${o$1(this.for)}" class=${classes}><slot></slot></label>`;
1958
1981
  }
1959
1982
  };
1960
- SDSLabel.styles = [styles$a];
1961
- __decorateClass$a([
1983
+ SDSLabel.styles = [styles$b];
1984
+ __decorateClass$b([
1962
1985
  n2({ type: String })
1963
1986
  ], SDSLabel.prototype, "size", 2);
1964
- __decorateClass$a([
1987
+ __decorateClass$b([
1965
1988
  n2({ type: String })
1966
1989
  ], SDSLabel.prototype, "for", 2);
1967
- SDSLabel = __decorateClass$a([
1990
+ SDSLabel = __decorateClass$b([
1968
1991
  guardedCustomElement("sds-label")
1969
1992
  ], SDSLabel);
1970
- const styles$9 = i$4`
1993
+ const styles$a = i$4`
1971
1994
  :host {
1972
1995
  display: inline;
1973
1996
  }
@@ -2039,14 +2062,14 @@ const styles$9 = i$4`
2039
2062
  font-size: 0.875rem;
2040
2063
  }
2041
2064
  `;
2042
- var __defProp$9 = Object.defineProperty;
2043
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
2044
- var __decorateClass$9 = (decorators, target, key, kind) => {
2045
- 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;
2046
2069
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2047
2070
  if (decorator = decorators[i3])
2048
2071
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2049
- if (kind && result) __defProp$9(target, key, result);
2072
+ if (kind && result) __defProp$a(target, key, result);
2050
2073
  return result;
2051
2074
  };
2052
2075
  let SDSLink = class extends i$1 {
@@ -2067,20 +2090,20 @@ let SDSLink = class extends i$1 {
2067
2090
  ></a>`;
2068
2091
  }
2069
2092
  };
2070
- SDSLink.styles = [styles$9];
2071
- __decorateClass$9([
2093
+ SDSLink.styles = [styles$a];
2094
+ __decorateClass$a([
2072
2095
  n2({ type: String })
2073
2096
  ], SDSLink.prototype, "href", 2);
2074
- __decorateClass$9([
2097
+ __decorateClass$a([
2075
2098
  n2({ type: String })
2076
2099
  ], SDSLink.prototype, "size", 2);
2077
- __decorateClass$9([
2100
+ __decorateClass$a([
2078
2101
  n2({ type: String })
2079
2102
  ], SDSLink.prototype, "target", 2);
2080
- SDSLink = __decorateClass$9([
2103
+ SDSLink = __decorateClass$a([
2081
2104
  guardedCustomElement("sds-link")
2082
2105
  ], SDSLink);
2083
- const styles$8 = i$4`
2106
+ const styles$9 = i$4`
2084
2107
  :host {
2085
2108
  line-height: 0;
2086
2109
  }
@@ -2117,14 +2140,14 @@ const styles$8 = i$4`
2117
2140
  }
2118
2141
  }
2119
2142
  `;
2120
- var __defProp$8 = Object.defineProperty;
2121
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
2122
- var __decorateClass$8 = (decorators, target, key, kind) => {
2123
- 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;
2124
2147
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2125
2148
  if (decorator = decorators[i3])
2126
2149
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2127
- if (kind && result) __defProp$8(target, key, result);
2150
+ if (kind && result) __defProp$9(target, key, result);
2128
2151
  return result;
2129
2152
  };
2130
2153
  let SDSLoader = class extends i$1 {
@@ -2142,17 +2165,17 @@ let SDSLoader = class extends i$1 {
2142
2165
  return x`<span class="${e$1(loaderClasses)}" style="${`color:${this.color}`}"></span>`;
2143
2166
  }
2144
2167
  };
2145
- SDSLoader.styles = [styles$8];
2146
- __decorateClass$8([
2168
+ SDSLoader.styles = [styles$9];
2169
+ __decorateClass$9([
2147
2170
  n2({ type: String, reflect: true })
2148
2171
  ], SDSLoader.prototype, "size", 2);
2149
- __decorateClass$8([
2172
+ __decorateClass$9([
2150
2173
  n2({ type: String, reflect: true })
2151
2174
  ], SDSLoader.prototype, "color", 2);
2152
- SDSLoader = __decorateClass$8([
2175
+ SDSLoader = __decorateClass$9([
2153
2176
  guardedCustomElement("sds-loader")
2154
2177
  ], SDSLoader);
2155
- const styles$7 = i$4`
2178
+ const styles$8 = i$4`
2156
2179
  :host {
2157
2180
  display: block;
2158
2181
  box-sizing: border-box;
@@ -2300,14 +2323,14 @@ const styles$7 = i$4`
2300
2323
  }
2301
2324
  }
2302
2325
  `;
2303
- var __defProp$7 = Object.defineProperty;
2304
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
2305
- var __decorateClass$7 = (decorators, target, key, kind) => {
2306
- 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;
2307
2330
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2308
2331
  if (decorator = decorators[i3])
2309
2332
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2310
- if (kind && result) __defProp$7(target, key, result);
2333
+ if (kind && result) __defProp$8(target, key, result);
2311
2334
  return result;
2312
2335
  };
2313
2336
  let SDSNavCard = class extends i$1 {
@@ -2373,29 +2396,29 @@ let SDSNavCard = class extends i$1 {
2373
2396
  `;
2374
2397
  }
2375
2398
  };
2376
- SDSNavCard.styles = [styles$7];
2377
- __decorateClass$7([
2399
+ SDSNavCard.styles = [styles$8];
2400
+ __decorateClass$8([
2378
2401
  n2({ type: String, reflect: true })
2379
2402
  ], SDSNavCard.prototype, "size", 2);
2380
- __decorateClass$7([
2403
+ __decorateClass$8([
2381
2404
  n2({ type: String, reflect: true })
2382
2405
  ], SDSNavCard.prototype, "heading", 2);
2383
- __decorateClass$7([
2406
+ __decorateClass$8([
2384
2407
  n2({ type: String, reflect: true })
2385
2408
  ], SDSNavCard.prototype, "level", 2);
2386
- __decorateClass$7([
2409
+ __decorateClass$8([
2387
2410
  n2({ type: String, reflect: true })
2388
2411
  ], SDSNavCard.prototype, "link", 2);
2389
- __decorateClass$7([
2412
+ __decorateClass$8([
2390
2413
  r()
2391
2414
  ], SDSNavCard.prototype, "hasIcon", 2);
2392
- __decorateClass$7([
2415
+ __decorateClass$8([
2393
2416
  e$3("slot")
2394
2417
  ], SDSNavCard.prototype, "iconSlot", 2);
2395
- SDSNavCard = __decorateClass$7([
2418
+ SDSNavCard = __decorateClass$8([
2396
2419
  guardedCustomElement("sds-nav-card")
2397
2420
  ], SDSNavCard);
2398
- const styles$6 = i$4`
2421
+ const styles$7 = i$4`
2399
2422
  :host {
2400
2423
  display: block;
2401
2424
  box-sizing: border-box;
@@ -2553,14 +2576,14 @@ const styles$6 = i$4`
2553
2576
  }
2554
2577
  }
2555
2578
  `;
2556
- var __defProp$6 = Object.defineProperty;
2557
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
2558
- var __decorateClass$6 = (decorators, target, key, kind) => {
2559
- 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;
2560
2583
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2561
2584
  if (decorator = decorators[i3])
2562
2585
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2563
- if (kind && result) __defProp$6(target, key, result);
2586
+ if (kind && result) __defProp$7(target, key, result);
2564
2587
  return result;
2565
2588
  };
2566
2589
  const notificationIcons = {
@@ -2608,17 +2631,17 @@ let SDSNotification = class extends i$1 {
2608
2631
  </div>`;
2609
2632
  }
2610
2633
  };
2611
- SDSNotification.styles = [styles$6];
2612
- __decorateClass$6([
2634
+ SDSNotification.styles = [styles$7];
2635
+ __decorateClass$7([
2613
2636
  n2({ type: String, reflect: true })
2614
2637
  ], SDSNotification.prototype, "variant", 2);
2615
- __decorateClass$6([
2638
+ __decorateClass$7([
2616
2639
  n2({ type: String, attribute: "removable-label", reflect: true })
2617
2640
  ], SDSNotification.prototype, "removableLabel", 2);
2618
- SDSNotification = __decorateClass$6([
2641
+ SDSNotification = __decorateClass$7([
2619
2642
  guardedCustomElement("sds-notification")
2620
2643
  ], SDSNotification);
2621
- const styles$5 = i$4`
2644
+ const styles$6 = i$4`
2622
2645
  :host {
2623
2646
  display: block;
2624
2647
  }
@@ -2653,14 +2676,14 @@ const styles$5 = i$4`
2653
2676
  }
2654
2677
  }
2655
2678
  `;
2656
- var __defProp$5 = Object.defineProperty;
2657
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
2658
- var __decorateClass$5 = (decorators, target, key, kind) => {
2659
- 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;
2660
2683
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2661
2684
  if (decorator = decorators[i3])
2662
2685
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2663
- if (kind && result) __defProp$5(target, key, result);
2686
+ if (kind && result) __defProp$6(target, key, result);
2664
2687
  return result;
2665
2688
  };
2666
2689
  let SDSParagraph = class extends i$1 {
@@ -2679,14 +2702,14 @@ let SDSParagraph = class extends i$1 {
2679
2702
  return x`<p class=${classes}><slot></slot></p>`;
2680
2703
  }
2681
2704
  };
2682
- SDSParagraph.styles = [styles$5];
2683
- __decorateClass$5([
2705
+ SDSParagraph.styles = [styles$6];
2706
+ __decorateClass$6([
2684
2707
  n2({ type: String })
2685
2708
  ], SDSParagraph.prototype, "size", 2);
2686
- SDSParagraph = __decorateClass$5([
2709
+ SDSParagraph = __decorateClass$6([
2687
2710
  guardedCustomElement("sds-paragraph")
2688
2711
  ], SDSParagraph);
2689
- const styles$4 = i$4`
2712
+ const styles$5 = i$4`
2690
2713
  :host {
2691
2714
  flex: 0 0 auto;
2692
2715
  }
@@ -2794,14 +2817,14 @@ const styles$4 = i$4`
2794
2817
  padding-top: 2px;
2795
2818
  }
2796
2819
  `;
2797
- var __defProp$4 = Object.defineProperty;
2798
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
2799
- var __decorateClass$4 = (decorators, target, key, kind) => {
2800
- 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;
2801
2824
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
2802
2825
  if (decorator = decorators[i3])
2803
2826
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2804
- if (kind && result) __defProp$4(target, key, result);
2827
+ if (kind && result) __defProp$5(target, key, result);
2805
2828
  return result;
2806
2829
  };
2807
2830
  let SDSRadio = class extends i$1 {
@@ -3015,39 +3038,39 @@ let SDSRadio = class extends i$1 {
3015
3038
  `;
3016
3039
  }
3017
3040
  };
3018
- SDSRadio.styles = [styles$4];
3041
+ SDSRadio.styles = [styles$5];
3019
3042
  SDSRadio.formAssociated = true;
3020
- __decorateClass$4([
3043
+ __decorateClass$5([
3021
3044
  n2({ type: Boolean, reflect: true })
3022
3045
  ], SDSRadio.prototype, "disabled", 2);
3023
- __decorateClass$4([
3046
+ __decorateClass$5([
3024
3047
  n2({ type: Boolean, reflect: true })
3025
3048
  ], SDSRadio.prototype, "required", 2);
3026
- __decorateClass$4([
3049
+ __decorateClass$5([
3027
3050
  n2({ type: String, reflect: true })
3028
3051
  ], SDSRadio.prototype, "label", 2);
3029
- __decorateClass$4([
3052
+ __decorateClass$5([
3030
3053
  n2({ type: Boolean, reflect: true, attribute: "hide-label" })
3031
3054
  ], SDSRadio.prototype, "hideLabel", 2);
3032
- __decorateClass$4([
3055
+ __decorateClass$5([
3033
3056
  n2({ type: String, reflect: true })
3034
3057
  ], SDSRadio.prototype, "name", 2);
3035
- __decorateClass$4([
3058
+ __decorateClass$5([
3036
3059
  n2({ type: String })
3037
3060
  ], SDSRadio.prototype, "value", 2);
3038
- __decorateClass$4([
3061
+ __decorateClass$5([
3039
3062
  n2({ type: Boolean, reflect: true })
3040
3063
  ], SDSRadio.prototype, "checked", 2);
3041
- __decorateClass$4([
3064
+ __decorateClass$5([
3042
3065
  n2({ type: Boolean, reflect: true })
3043
3066
  ], SDSRadio.prototype, "error", 2);
3044
- __decorateClass$4([
3067
+ __decorateClass$5([
3045
3068
  e$3("#control")
3046
3069
  ], SDSRadio.prototype, "control", 2);
3047
- SDSRadio = __decorateClass$4([
3070
+ SDSRadio = __decorateClass$5([
3048
3071
  guardedCustomElement("sds-radio")
3049
3072
  ], SDSRadio);
3050
- const styles$3 = i$4`
3073
+ const styles$4 = i$4`
3051
3074
  .sds-radio-group {
3052
3075
  border: 0;
3053
3076
  margin: 0;
@@ -3092,14 +3115,14 @@ const styles$3 = i$4`
3092
3115
  gap: var(--sds-spacing-2);
3093
3116
  }
3094
3117
  `;
3095
- var __defProp$3 = Object.defineProperty;
3096
- var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
3097
- var __decorateClass$3 = (decorators, target, key, kind) => {
3098
- 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;
3099
3122
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
3100
3123
  if (decorator = decorators[i3])
3101
3124
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3102
- if (kind && result) __defProp$3(target, key, result);
3125
+ if (kind && result) __defProp$4(target, key, result);
3103
3126
  return result;
3104
3127
  };
3105
3128
  let SDSRadioGroup = class extends i$1 {
@@ -3130,35 +3153,28 @@ let SDSRadioGroup = class extends i$1 {
3130
3153
  <div class="sds-radio-group__radios" @change=${this._handleRadioChange}>
3131
3154
  <slot></slot>
3132
3155
  </div>
3133
- ${this.errorMessage ? x`<p class="sds-radio-group__error-message">
3134
- <sds-icon
3135
- name="warning-material-filled"
3136
- size="m"
3137
- color="var(--sds-color-semantic-icon-critical)"
3138
- ></sds-icon>
3139
- ${this.errorMessage}
3140
- </p>` : E}
3156
+ ${renderErrorMessage(this.errorMessage, "sds-radio-group__error-message")}
3141
3157
  </fieldset>
3142
3158
  `;
3143
3159
  }
3144
3160
  };
3145
- SDSRadioGroup.styles = [styles$3];
3146
- __decorateClass$3([
3161
+ SDSRadioGroup.styles = [styles$4];
3162
+ __decorateClass$4([
3147
3163
  n2({ type: String })
3148
3164
  ], SDSRadioGroup.prototype, "legend", 2);
3149
- __decorateClass$3([
3165
+ __decorateClass$4([
3150
3166
  n2({ type: String, attribute: "help-text" })
3151
3167
  ], SDSRadioGroup.prototype, "helpText", 2);
3152
- __decorateClass$3([
3168
+ __decorateClass$4([
3153
3169
  n2({ type: String, attribute: "error-message" })
3154
3170
  ], SDSRadioGroup.prototype, "errorMessage", 2);
3155
- __decorateClass$3([
3171
+ __decorateClass$4([
3156
3172
  r()
3157
3173
  ], SDSRadioGroup.prototype, "_selectedValue", 2);
3158
- SDSRadioGroup = __decorateClass$3([
3174
+ SDSRadioGroup = __decorateClass$4([
3159
3175
  guardedCustomElement("sds-radio-group")
3160
3176
  ], SDSRadioGroup);
3161
- const styles$2 = i$4`
3177
+ const styles$3 = i$4`
3162
3178
  :host {
3163
3179
  display: inline-flex;
3164
3180
  contain: layout style;
@@ -3281,14 +3297,14 @@ const styles$2 = i$4`
3281
3297
  background-color: var(--sds-color-semantic-surface-default);
3282
3298
  }
3283
3299
  `;
3284
- var __defProp$2 = Object.defineProperty;
3285
- var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
3286
- var __decorateClass$2 = (decorators, target, key, kind) => {
3287
- 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;
3288
3304
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
3289
3305
  if (decorator = decorators[i3])
3290
3306
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3291
- if (kind && result) __defProp$2(target, key, result);
3307
+ if (kind && result) __defProp$3(target, key, result);
3292
3308
  return result;
3293
3309
  };
3294
3310
  let SDSSwitch = class extends i$1 {
@@ -3388,36 +3404,36 @@ let SDSSwitch = class extends i$1 {
3388
3404
  </div>`;
3389
3405
  }
3390
3406
  };
3391
- SDSSwitch.styles = [styles$2];
3407
+ SDSSwitch.styles = [styles$3];
3392
3408
  SDSSwitch.formAssociated = true;
3393
- __decorateClass$2([
3409
+ __decorateClass$3([
3394
3410
  n2({ type: Boolean, reflect: true })
3395
3411
  ], SDSSwitch.prototype, "disabled", 2);
3396
- __decorateClass$2([
3412
+ __decorateClass$3([
3397
3413
  n2({ type: String, reflect: true })
3398
3414
  ], SDSSwitch.prototype, "label", 2);
3399
- __decorateClass$2([
3415
+ __decorateClass$3([
3400
3416
  n2({ type: Boolean, reflect: true, attribute: "hide-label" })
3401
3417
  ], SDSSwitch.prototype, "hideLabel", 2);
3402
- __decorateClass$2([
3418
+ __decorateClass$3([
3403
3419
  n2({ type: String, reflect: true })
3404
3420
  ], SDSSwitch.prototype, "name", 2);
3405
- __decorateClass$2([
3421
+ __decorateClass$3([
3406
3422
  n2({ type: Boolean, reflect: true })
3407
3423
  ], SDSSwitch.prototype, "reverse", 2);
3408
- __decorateClass$2([
3424
+ __decorateClass$3([
3409
3425
  n2({ type: Boolean, reflect: true })
3410
3426
  ], SDSSwitch.prototype, "checked", 2);
3411
- __decorateClass$2([
3427
+ __decorateClass$3([
3412
3428
  n2({ type: String, reflect: true })
3413
3429
  ], SDSSwitch.prototype, "size", 2);
3414
- __decorateClass$2([
3430
+ __decorateClass$3([
3415
3431
  e$3("#control")
3416
3432
  ], SDSSwitch.prototype, "control", 2);
3417
- SDSSwitch = __decorateClass$2([
3433
+ SDSSwitch = __decorateClass$3([
3418
3434
  guardedCustomElement("sds-switch")
3419
3435
  ], SDSSwitch);
3420
- const styles$1 = i$4`
3436
+ const styles$2 = i$4`
3421
3437
  :host {
3422
3438
  display: block;
3423
3439
  }
@@ -3446,14 +3462,14 @@ const styles$1 = i$4`
3446
3462
  line-height: 1.285;
3447
3463
  }
3448
3464
  `;
3449
- var __defProp$1 = Object.defineProperty;
3450
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
3451
- var __decorateClass$1 = (decorators, target, key, kind) => {
3452
- 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;
3453
3469
  for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
3454
3470
  if (decorator = decorators[i3])
3455
3471
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
3456
- if (kind && result) __defProp$1(target, key, result);
3472
+ if (kind && result) __defProp$2(target, key, result);
3457
3473
  return result;
3458
3474
  };
3459
3475
  let SDSText = class extends i$1 {
@@ -3472,13 +3488,351 @@ let SDSText = class extends i$1 {
3472
3488
  return x`<p class=${classes}><slot></slot></p>`;
3473
3489
  }
3474
3490
  };
3475
- SDSText.styles = [styles$1];
3476
- __decorateClass$1([
3491
+ SDSText.styles = [styles$2];
3492
+ __decorateClass$2([
3477
3493
  n2({ type: String })
3478
3494
  ], SDSText.prototype, "size", 2);
3479
- SDSText = __decorateClass$1([
3495
+ SDSText = __decorateClass$2([
3480
3496
  guardedCustomElement("sds-text")
3481
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);
3482
3836
  const styles = i$4`
3483
3837
  :host {
3484
3838
  all: unset;
@@ -3739,14 +4093,7 @@ let SDSTextField = class extends i$1 {
3739
4093
  />
3740
4094
  <slot name="after" @slotchange="${this.handleSlotChange}" aria-hidden="true"></slot>
3741
4095
  </div>
3742
- ${this.errorMessage ? x`<p class="sds-textfield__error-message">
3743
- <sds-icon
3744
- name="warning-material-filled"
3745
- size="m"
3746
- color="${!this.disabled ? `var(--sds-color-semantic-icon-critical)` : `var(--sds-color-semantic-icon-disabled)`}"
3747
- ></sds-icon>
3748
- ${this.errorMessage}
3749
- </p>` : E}
4096
+ ${renderErrorMessage(this.errorMessage, "sds-textfield__error-message", this.disabled)}
3750
4097
  </div>
3751
4098
  `;
3752
4099
  }
@@ -3822,5 +4169,6 @@ export {
3822
4169
  SDSRadioGroup,
3823
4170
  SDSSwitch,
3824
4171
  SDSText,
4172
+ SDSTextArea,
3825
4173
  SDSTextField
3826
4174
  };