@mcp-b/web-components 0.2.22 → 0.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 (159) hide show
  1. package/README.md +93 -30
  2. package/dist/{alert-dialog-D25Oi_TS.js → alert-dialog-CGUwj_0U.js} +1 -1
  3. package/dist/{button-gg3JJxQZ.js → button-BbabhtKj.js} +121 -77
  4. package/dist/{button-BQofnUt4.d.ts → button-c5YKsC69.d.ts} +6 -3
  5. package/dist/{checkbox-DoFcDEKB.d.ts → checkbox-BtoypUxD.d.ts} +0 -6
  6. package/dist/{checkbox-C96lUDIM.js → checkbox-C97tlcf2.js} +11 -43
  7. package/dist/{color-input-Gae_-9w-.js → color-input-Dtp1v7A-.js} +14 -54
  8. package/dist/{color-input-Bky89xg_.d.ts → color-input-S29ZHwHE.d.ts} +0 -5
  9. package/dist/{color-picker-BYyZavkT.js → color-picker-Mnpc5u6E.js} +8 -4
  10. package/dist/{combobox-iERnTD3A.js → combobox-D4ji7M2B.js} +12 -33
  11. package/dist/{combobox-item-D2H1CMxC.d.ts → combobox-item-BnBtZyhw.d.ts} +3 -6
  12. package/dist/{comparison-B1-nMwmp.d.ts → comparison-CRvbwS7X.d.ts} +1 -0
  13. package/dist/{comparison-HJ1Zedhs.js → comparison-DQUpvkmg.js} +11 -3
  14. package/dist/components/alert-dialog/alert-dialog.js +1 -1
  15. package/dist/components/button/button.d.ts +1 -1
  16. package/dist/components/button/button.js +1 -1
  17. package/dist/components/carousel/carousel.js +1 -1
  18. package/dist/components/checkbox/checkbox.d.ts +1 -1
  19. package/dist/components/checkbox/checkbox.js +1 -1
  20. package/dist/components/color-input/color-input.d.ts +1 -1
  21. package/dist/components/color-input/color-input.js +1 -1
  22. package/dist/components/color-picker/color-picker.js +1 -1
  23. package/dist/components/combobox/combobox.d.ts +1 -1
  24. package/dist/components/combobox/combobox.js +1 -1
  25. package/dist/components/combobox-item/combobox-item.d.ts +1 -1
  26. package/dist/components/comparison/comparison.d.ts +1 -1
  27. package/dist/components/comparison/comparison.js +1 -1
  28. package/dist/components/copy/copy.js +4 -20
  29. package/dist/components/date/date.d.ts +1 -1
  30. package/dist/components/date/date.js +1 -1
  31. package/dist/components/dialog/dialog.js +1 -1
  32. package/dist/components/dropdown/dropdown.d.ts +1 -1
  33. package/dist/components/dropdown/dropdown.js +1 -1
  34. package/dist/components/expander/expander.js +1 -1
  35. package/dist/components/file-input/file-input.d.ts +1 -1
  36. package/dist/components/file-input/file-input.js +1 -1
  37. package/dist/components/filter-bar/filter-bar.js +1 -1
  38. package/dist/components/index.d.ts +24 -24
  39. package/dist/components/index.js +44 -44
  40. package/dist/components/infinite-scroller/infinite-scroller.js +1 -1
  41. package/dist/components/listbox/listbox.d.ts +1 -1
  42. package/dist/components/listbox/listbox.js +1 -1
  43. package/dist/components/navicon/navicon.js +1 -1
  44. package/dist/components/number/number.js +1 -1
  45. package/dist/components/number-field/number-field.d.ts +1 -1
  46. package/dist/components/number-field/number-field.js +1 -1
  47. package/dist/components/pagination/pagination.js +1 -1
  48. package/dist/components/popover/popover.js +1 -1
  49. package/dist/components/preview-card/preview-card.js +1 -1
  50. package/dist/components/radio/radio.d.ts +1 -1
  51. package/dist/components/radio/radio.js +1 -1
  52. package/dist/components/radio-item/radio-item.js +1 -1
  53. package/dist/components/rating/rating.d.ts +1 -1
  54. package/dist/components/rating/rating.js +1 -1
  55. package/dist/components/scroller/scroller.js +1 -1
  56. package/dist/components/search-list/search-list.d.ts +1 -1
  57. package/dist/components/search-list/search-list.js +1 -1
  58. package/dist/components/select/select.d.ts +1 -1
  59. package/dist/components/select/select.js +1 -1
  60. package/dist/components/share/share.js +1 -1
  61. package/dist/components/slide-activator/slide-activator.d.ts +1 -1
  62. package/dist/components/slide-activator/slide-activator.js +1 -1
  63. package/dist/components/slider/slider.d.ts +1 -1
  64. package/dist/components/slider/slider.js +1 -1
  65. package/dist/components/spinner/spinner.js +1 -1
  66. package/dist/components/splitter/splitter.d.ts +1 -1
  67. package/dist/components/splitter/splitter.js +1 -1
  68. package/dist/components/switch/switch.d.ts +1 -1
  69. package/dist/components/switch/switch.js +1 -1
  70. package/dist/components/tab-list/tab-list.js +1 -1
  71. package/dist/components/text-area/text-area.d.ts +1 -1
  72. package/dist/components/text-area/text-area.js +1 -1
  73. package/dist/components/text-field/text-field.d.ts +1 -1
  74. package/dist/components/text-field/text-field.js +1 -1
  75. package/dist/components/toast/toast.d.ts +1 -1
  76. package/dist/components/toast/toast.js +1 -1
  77. package/dist/components/toast-item/toast-item.js +1 -1
  78. package/dist/components/toggle-icon/toggle-icon.d.ts +1 -1
  79. package/dist/components/toggle-icon/toggle-icon.js +1 -1
  80. package/dist/components/toggle-tag/toggle-tag.d.ts +1 -1
  81. package/dist/components/toggle-tag/toggle-tag.js +1 -1
  82. package/dist/components/tooltip/tooltip.js +1 -1
  83. package/dist/components/transition-group/transition-group.d.ts +1 -1
  84. package/dist/components/transition-group/transition-group.js +1 -1
  85. package/dist/components/zoomable-frame/zoomable-frame.js +1 -1
  86. package/dist/{date-6M6wfa8L.d.ts → date-DtaTBM71.d.ts} +1 -1
  87. package/dist/docs/custom-elements.json +126 -171
  88. package/dist/{dropdown-DM4tlF_p.js → dropdown-BPOpCp59.js} +58 -34
  89. package/dist/{dropdown-Bo00Vlr5.d.ts → dropdown-C5ldJu4g.d.ts} +5 -1
  90. package/dist/{localize-322EtXNX.d.ts → en-ss05iPjS.d.ts} +4 -1
  91. package/dist/{file-input-vZFm22Lo.js → file-input-B4VfcfTD.js} +17 -33
  92. package/dist/{file-input-D2D6YC0B.d.ts → file-input-CgsTcC1R.d.ts} +0 -5
  93. package/dist/{filter-bar-DJuDlx5f.js → filter-bar-DhQSMr3S.js} +1 -1
  94. package/dist/index.d.ts +25 -27
  95. package/dist/index.js +45 -48
  96. package/dist/{infinite-scroller-BmmtnWNt.js → infinite-scroller-DjeMswwE.js} +2 -2
  97. package/dist/{listbox-B0geidHW.js → listbox-BGHw-rUd.js} +13 -28
  98. package/dist/{listbox-DD4ujIJe.d.ts → listbox-DKoMIQA6.d.ts} +3 -5
  99. package/dist/{number-field-odk4lKXM.d.ts → number-field-T0rzObq9.d.ts} +0 -5
  100. package/dist/{number-field-BGH7JtNf.js → number-field-yME3rRZT.js} +44 -55
  101. package/dist/{popover-DJBrJ0za.js → popover-lsI6gqNk.js} +9 -32
  102. package/dist/{preview-card-C7H1FPfd.js → preview-card-D1msvOWP.js} +1 -1
  103. package/dist/{radio-8UZAUYXt.js → radio-4Cok4gJI.js} +11 -28
  104. package/dist/{radio-CieMa4zU.d.ts → radio-B4fz924Q.d.ts} +1 -4
  105. package/dist/{radio-item-BlhFgXsU.js → radio-item-DpP3GBPV.js} +2 -3
  106. package/dist/{rating-4xNsWumY.d.ts → rating-8BLXhAVl.d.ts} +1 -3
  107. package/dist/{rating-C1BcJDIO.js → rating-CSn-nU2R.js} +24 -34
  108. package/dist/{search-list-Clmrg8EV.js → search-list-BffPIgnw.js} +19 -10
  109. package/dist/{search-list-n0GYO7rh.d.ts → search-list-Cd3--X7Q.d.ts} +11 -1
  110. package/dist/{select-CkZK2jJn.d.ts → select-6H_sN4A2.d.ts} +0 -5
  111. package/dist/{select-DLIaRnA4.js → select-B6nkY6E-.js} +7 -43
  112. package/dist/{share-bsgXZCl7.js → share-C7dB9NYf.js} +3 -19
  113. package/dist/{slide-activator-D7bBz69E.d.ts → slide-activator-CB0Ztk_u.d.ts} +1 -0
  114. package/dist/{slide-activator-Dm1EvZtL.js → slide-activator-Dkv5_KPl.js} +10 -3
  115. package/dist/{slider-B90Il7x3.js → slider-DY-GuC8T.js} +35 -46
  116. package/dist/{slider-B0FVsV1o.d.ts → slider-uQQ-T_kn.d.ts} +2 -3
  117. package/dist/{splitter-MnD4In9H.js → splitter-DzC0hXGN.js} +14 -3
  118. package/dist/{splitter-DBDJAzsp.d.ts → splitter-KQVgGdvP.d.ts} +1 -0
  119. package/dist/{switch-Cief9M59.d.ts → switch-BUfFo074.d.ts} +0 -6
  120. package/dist/{switch-D0hWr37A.js → switch-Chij-EaQ.js} +11 -43
  121. package/dist/{tab-list-B_Ye_Oj9.js → tab-list-CVOUSpAh.js} +2 -2
  122. package/dist/{text-area-B_mjCE9W.d.ts → text-area-DFMKyk8y.d.ts} +0 -3
  123. package/dist/{text-area-Czixaz-_.js → text-area-DZVghSkO.js} +14 -51
  124. package/dist/{text-field-BClWMp6q.d.ts → text-field-DepP1gei.d.ts} +0 -5
  125. package/dist/{text-field-Cznb4Afc.js → text-field-gX5RovkE.js} +11 -52
  126. package/dist/{toast-cEBVK9NQ.d.ts → toast-CpyA3GYM.d.ts} +1 -1
  127. package/dist/{toast-DgkBQzQC.js → toast-CxfaWFY_.js} +2 -2
  128. package/dist/{toggle-icon-4oLDeEt4.js → toggle-icon-B3fZuslO.js} +9 -31
  129. package/dist/{toggle-icon-DlwMMWZL.d.ts → toggle-icon-sTLCOruF.d.ts} +0 -5
  130. package/dist/{toggle-tag-1sfTFJtg.js → toggle-tag--Gkp-CJJ.js} +7 -35
  131. package/dist/{toggle-tag-IVvMGT4R.d.ts → toggle-tag-DDBa6hAg.d.ts} +0 -5
  132. package/dist/{tooltip-DbyoPFNe.js → tooltip-bSXNhG9l.js} +9 -32
  133. package/dist/{transition-group-3hnAnwSd.js → transition-group-8PmQx0A5.js} +23 -4
  134. package/dist/{transition-group-DD_CjSNC.d.ts → transition-group-D134iT1k.d.ts} +8 -0
  135. package/dist/translations/en.d.ts +1 -5
  136. package/dist/translations/en.js +3 -6
  137. package/dist/translations/es.d.ts +1 -1
  138. package/dist/translations/es.js +2 -5
  139. package/dist/types/custom-element-jsx.d.ts +26 -10
  140. package/dist/utilities/anchored-surface.d.ts +36 -0
  141. package/dist/utilities/anchored-surface.js +46 -0
  142. package/dist/utilities/copy-feedback.d.ts +16 -0
  143. package/dist/utilities/copy-feedback.js +33 -0
  144. package/dist/utilities/form-validity.d.ts +28 -0
  145. package/dist/utilities/form-validity.js +33 -0
  146. package/dist/utilities/localize.d.ts +1 -1
  147. package/dist/utilities/localize.js +1 -0
  148. package/package.json +3 -2
  149. package/dist/{carousel-XopKISBQ.js → carousel-DpIqPTuO.js} +1 -1
  150. package/dist/{date-CJPmOdi9.js → date-CFIR88pX.js} +1 -1
  151. package/dist/{dialog-Cx46HMaZ.js → dialog-Ddvyn2d_.js} +1 -1
  152. package/dist/{expander-Bwvxj6Oa.js → expander-CMV4QCha.js} +1 -1
  153. package/dist/{navicon-_yMHY27-.js → navicon-B-5pY9gq.js} +1 -1
  154. package/dist/{number-BNtNXNF3.js → number-BYBxfOGw.js} +1 -1
  155. package/dist/{pagination-CrTQnuNW.js → pagination-VOzVTV8p.js} +1 -1
  156. package/dist/{scroller-LYgBVyfY.js → scroller-DZATZlDa.js} +1 -1
  157. package/dist/{spinner-C04Dmc0H.js → spinner-C9lQARtQ.js} +1 -1
  158. package/dist/{toast-item-CGvz92Qk.js → toast-item-DzSPG25R.js} +1 -1
  159. package/dist/{zoomable-frame-DxcjLGcF.js → zoomable-frame-BrjVkNMX.js} +1 -1
@@ -1,6 +1,6 @@
1
- import { Localize } from "./utilities/localize.js";
2
1
  import { t as __decorate } from "./decorate-DcF3lt7P.js";
3
- import "./tooltip-DbyoPFNe.js";
2
+ import { Localize } from "./utilities/localize.js";
3
+ import "./tooltip-bSXNhG9l.js";
4
4
  import { css, html } from "lit";
5
5
  import { property, query, state } from "lit/decorators.js";
6
6
  import hostStyles from "@mcp-b/wc-support/styles/host.styles";
@@ -1087,11 +1087,10 @@ var SigveloSlider = class extends SigveloFormControlElement {
1087
1087
  }
1088
1088
  connectedCallback() {
1089
1089
  super.connectedCallback();
1090
- this.addEventListener("invalid", this.handleHostInvalid);
1090
+ if (this.hasUpdated) this.setupDragging();
1091
1091
  }
1092
1092
  disconnectedCallback() {
1093
1093
  super.disconnectedCallback();
1094
- this.removeEventListener("invalid", this.handleHostInvalid);
1095
1094
  this.stopDragging();
1096
1095
  }
1097
1096
  firstUpdated() {
@@ -1233,10 +1232,26 @@ var SigveloSlider = class extends SigveloFormControlElement {
1233
1232
  this.valueWhenDraggingStarted = void 0;
1234
1233
  }
1235
1234
  });
1236
- const enabled = !(this.disabled || this.readonly);
1235
+ this.updateDragging();
1236
+ }
1237
+ formDisabledCallback() {
1238
+ super.formDisabledCallback();
1239
+ this.updateDragging();
1240
+ }
1241
+ updateDragging() {
1242
+ const enabled = !(this.effectiveDisabled || this.readonly);
1237
1243
  this.draggableTrack?.toggle(enabled);
1238
1244
  this.draggableThumbMin?.toggle(enabled);
1239
1245
  this.draggableThumbMax?.toggle(enabled);
1246
+ if (!enabled) {
1247
+ this.customStates.set("dragging", false);
1248
+ this.valueWhenDraggingStarted = void 0;
1249
+ this.activeThumb = null;
1250
+ this.lastTrackPosition = null;
1251
+ if (this.tooltip) this.tooltip.open = false;
1252
+ if (this.tooltipMin) this.tooltipMin.open = false;
1253
+ if (this.tooltipMax) this.tooltipMax.open = false;
1254
+ }
1240
1255
  }
1241
1256
  updated(changedProperties) {
1242
1257
  this.updateValidity();
@@ -1257,33 +1272,13 @@ var SigveloSlider = class extends SigveloFormControlElement {
1257
1272
  if (value !== this.singleValue) this.singleValue = value;
1258
1273
  else this.internals.setFormValue(String(value));
1259
1274
  }
1260
- if (changedProperties.has("disabled")) this.customStates.set("disabled", this.disabled);
1261
- if (changedProperties.has("disabled") || changedProperties.has("readonly")) {
1262
- const enabled = !(this.disabled || this.readonly);
1263
- if (this.isRange) {
1264
- if (this.draggableThumbMin) this.draggableThumbMin.toggle(enabled);
1265
- if (this.draggableThumbMax) this.draggableThumbMax.toggle(enabled);
1266
- }
1267
- if (this.draggableTrack) this.draggableTrack.toggle(enabled);
1268
- }
1269
- if (this.hadUserInteraction || this.wasSubmitted) {
1270
- this.customStates.set("user-invalid", this.isInvalid);
1271
- this.customStates.set("user-valid", !this.isInvalid);
1272
- } else {
1273
- this.customStates.set("user-invalid", false);
1274
- this.customStates.set("user-valid", false);
1275
- }
1276
- }
1277
- /** @internal Called when a containing fieldset is disabled. */
1278
- formDisabledCallback(isDisabled) {
1279
- this.disabled = isDisabled;
1275
+ if (changedProperties.has("disabled")) this.customStates.set("disabled", this.effectiveDisabled);
1276
+ if (changedProperties.has("disabled") || changedProperties.has("readonly")) this.updateDragging();
1280
1277
  }
1281
1278
  /** @internal Called when the form is reset. */
1282
1279
  formResetCallback() {
1283
1280
  this.value = Array.isArray(this.defaultValue) ? [...this.defaultValue] : this.defaultValue;
1284
- this.isInvalid = false;
1285
- this.hadUserInteraction = false;
1286
- this.wasSubmitted = false;
1281
+ super.formResetCallback();
1287
1282
  }
1288
1283
  /** Clamps a number to min/max while ensuring it's a valid step interval. */
1289
1284
  clampAndRoundToStep(value) {
@@ -1333,13 +1328,10 @@ var SigveloSlider = class extends SigveloFormControlElement {
1333
1328
  this.customStates.set("focused", true);
1334
1329
  this.dispatchEvent(new SigveloFocusEvent());
1335
1330
  }
1336
- handleHostInvalid() {
1337
- this.wasSubmitted = true;
1338
- }
1339
1331
  handleKeyDown(event) {
1340
1332
  const isRtl = this.localize.dir() === "rtl";
1341
1333
  const target = event.target;
1342
- if (this.disabled || this.readonly) return;
1334
+ if (this.effectiveDisabled || this.readonly) return;
1343
1335
  if (this.isRange) {
1344
1336
  if (target === this.thumbMin) this.activeThumb = "min";
1345
1337
  else if (target === this.thumbMax) this.activeThumb = "max";
@@ -1377,12 +1369,7 @@ var SigveloSlider = class extends SigveloFormControlElement {
1377
1369
  newValue = this.clampAndRoundToStep(stepDown);
1378
1370
  break;
1379
1371
  case "Enter":
1380
- if (this.internals.form) {
1381
- const submitter = [...this.internals.form.elements].find((el) => {
1382
- return ["button", "input"].includes(el.localName) && el.type === "submit";
1383
- });
1384
- this.internals.form.requestSubmit(submitter);
1385
- }
1372
+ this.submitAssociatedForm();
1386
1373
  return;
1387
1374
  }
1388
1375
  if (newValue === current) return;
@@ -1407,10 +1394,11 @@ var SigveloSlider = class extends SigveloFormControlElement {
1407
1394
  }
1408
1395
  handleLabelPointerDown(event) {
1409
1396
  event.preventDefault();
1410
- if (!this.disabled) if (this.isRange) this.thumbMin?.focus();
1397
+ if (!this.effectiveDisabled) if (this.isRange) this.thumbMin?.focus();
1411
1398
  else this.slider.focus();
1412
1399
  }
1413
1400
  setValueFromCoordinates(x, y) {
1401
+ if (this.effectiveDisabled || this.readonly) return;
1414
1402
  const oldValue = this.singleValue;
1415
1403
  this.singleValue = this.getValueFromCoordinates(x, y);
1416
1404
  if (this.singleValue !== oldValue) {
@@ -1419,6 +1407,7 @@ var SigveloSlider = class extends SigveloFormControlElement {
1419
1407
  }
1420
1408
  }
1421
1409
  setThumbValueFromCoordinates(x, y, thumb) {
1410
+ if (this.effectiveDisabled || this.readonly) return;
1422
1411
  const value = this.getValueFromCoordinates(x, y);
1423
1412
  const oldValue = thumb === "min" ? this.rangeStart : this.rangeEnd;
1424
1413
  if (thumb === "min") if (value > this.rangeEnd) this.value = [value, value];
@@ -1532,7 +1521,7 @@ var SigveloSlider = class extends SigveloFormControlElement {
1532
1521
  xl: this.size === "xl",
1533
1522
  horizontal: this.orientation === "horizontal",
1534
1523
  vertical: this.orientation === "vertical",
1535
- disabled: this.disabled
1524
+ disabled: this.effectiveDisabled
1536
1525
  });
1537
1526
  const markers = [];
1538
1527
  if (this.withMarkers) for (let i = this.min; i <= this.max; i += this.step) markers.push(this.getPercentageFromValue(i));
@@ -1610,9 +1599,9 @@ var SigveloSlider = class extends SigveloFormControlElement {
1610
1599
  aria-label="${this.label ? `${this.label} (minimum value)` : "Minimum value"}"
1611
1600
  aria-describedby="description"
1612
1601
  aria-orientation=${this.orientation}
1613
- aria-disabled=${this.disabled ? "true" : "false"}
1602
+ aria-disabled=${this.effectiveDisabled ? "true" : "false"}
1614
1603
  aria-readonly=${this.readonly ? "true" : "false"}
1615
- tabindex=${this.disabled ? -1 : 0}
1604
+ tabindex=${this.effectiveDisabled ? -1 : 0}
1616
1605
  @blur=${this.handleBlur}
1617
1606
  @focus=${this.handleFocus}
1618
1607
  @keydown=${this.handleKeyDown}
@@ -1630,9 +1619,9 @@ var SigveloSlider = class extends SigveloFormControlElement {
1630
1619
  aria-label="${this.label ? `${this.label} (maximum value)` : "Maximum value"}"
1631
1620
  aria-describedby="description"
1632
1621
  aria-orientation=${this.orientation}
1633
- aria-disabled=${this.disabled ? "true" : "false"}
1622
+ aria-disabled=${this.effectiveDisabled ? "true" : "false"}
1634
1623
  aria-readonly=${this.readonly ? "true" : "false"}
1635
- tabindex=${this.disabled ? -1 : 0}
1624
+ tabindex=${this.effectiveDisabled ? -1 : 0}
1636
1625
  @blur=${this.handleBlur}
1637
1626
  @focus=${this.handleFocus}
1638
1627
  @keydown=${this.handleKeyDown}
@@ -1655,7 +1644,7 @@ var SigveloSlider = class extends SigveloFormControlElement {
1655
1644
  part="slider"
1656
1645
  class=${sliderClasses}
1657
1646
  role="slider"
1658
- aria-disabled=${this.disabled ? "true" : "false"}
1647
+ aria-disabled=${this.effectiveDisabled ? "true" : "false"}
1659
1648
  aria-readonly=${this.readonly ? "true" : "false"}
1660
1649
  aria-orientation=${this.orientation}
1661
1650
  aria-valuemin=${this.min}
@@ -1664,7 +1653,7 @@ var SigveloSlider = class extends SigveloFormControlElement {
1664
1653
  aria-valuemax=${this.max}
1665
1654
  aria-labelledby="label"
1666
1655
  aria-describedby="description"
1667
- tabindex=${this.disabled ? -1 : 0}
1656
+ tabindex=${this.effectiveDisabled ? -1 : 0}
1668
1657
  @blur=${this.handleBlur}
1669
1658
  @focus=${this.handleFocus}
1670
1659
  @keydown=${this.handleKeyDown}
@@ -870,9 +870,9 @@ declare class SigveloSlider extends SigveloFormControlElement {
870
870
  firstUpdated(): void;
871
871
  private stopDragging;
872
872
  private setupDragging;
873
+ formDisabledCallback(): void;
874
+ private updateDragging;
873
875
  updated(changedProperties: PropertyValues<this>): void;
874
- /** @internal Called when a containing fieldset is disabled. */
875
- formDisabledCallback(isDisabled: boolean): void;
876
876
  /** @internal Called when the form is reset. */
877
877
  formResetCallback(): void;
878
878
  /** Clamps a number to min/max while ensuring it's a valid step interval. */
@@ -883,7 +883,6 @@ declare class SigveloSlider extends SigveloFormControlElement {
883
883
  private getValueFromCoordinates;
884
884
  private handleBlur;
885
885
  private handleFocus;
886
- private handleHostInvalid;
887
886
  private handleKeyDown;
888
887
  private handleLabelPointerDown;
889
888
  private setValueFromCoordinates;
@@ -1,5 +1,5 @@
1
- import { Localize } from "./utilities/localize.js";
2
1
  import { t as __decorate } from "./decorate-DcF3lt7P.js";
2
+ import { Localize } from "./utilities/localize.js";
3
3
  import { css, html } from "lit";
4
4
  import { property, query, state } from "lit/decorators.js";
5
5
  import hostStyles from "@mcp-b/wc-support/styles/host.styles";
@@ -446,6 +446,10 @@ var SigveloSplitter = class extends SigveloElement {
446
446
  static {
447
447
  this.styles = [hostStyles, splitter_styles_default];
448
448
  }
449
+ connectedCallback() {
450
+ super.connectedCallback();
451
+ if (this.hasUpdated) this.setupDragging();
452
+ }
449
453
  firstUpdated() {
450
454
  this.setupDragging();
451
455
  this.updateGridTemplate();
@@ -460,11 +464,16 @@ var SigveloSplitter = class extends SigveloElement {
460
464
  this.updateGridTemplate();
461
465
  this.updateAriaValue();
462
466
  }
463
- if (changedProperties.has("disabled")) this.customStates.set("disabled", this.disabled);
467
+ if (changedProperties.has("disabled")) {
468
+ this.customStates.set("disabled", this.disabled);
469
+ this.setupDragging();
470
+ }
464
471
  if (changedProperties.has("isDragging")) this.customStates.set("dragging", this.isDragging);
465
472
  }
466
473
  disconnectedCallback() {
467
474
  this.dragHandler?.stop();
475
+ this.isDragging = false;
476
+ this.customStates.set("dragging", false);
468
477
  super.disconnectedCallback();
469
478
  }
470
479
  handleFocus() {
@@ -504,7 +513,9 @@ var SigveloSplitter = class extends SigveloElement {
504
513
  }
505
514
  setupDragging() {
506
515
  this.dragHandler?.stop();
507
- if (this.disabled) return;
516
+ this.isDragging = false;
517
+ this.customStates.set("dragging", false);
518
+ if (this.disabled || !this.isConnected) return;
508
519
  this.dragHandler = new DraggableElement(this.divider, {
509
520
  start: (clientX, clientY) => {
510
521
  this.isDragging = true;
@@ -301,6 +301,7 @@ declare class SigveloSplitter extends SigveloElement {
301
301
  snap: string;
302
302
  /** The maximum distance (in pixels) within which the divider will snap to a specified snap point. */
303
303
  snapThreshold: number;
304
+ connectedCallback(): void;
304
305
  firstUpdated(): void;
305
306
  updated(changedProperties: PropertyValues<this>): void;
306
307
  disconnectedCallback(): void;
@@ -217,20 +217,14 @@ declare class SigveloSwitch extends SigveloFormControlElement {
217
217
  * Makes the switch required. Form submission will not be allowed until the switch is checked.
218
218
  */
219
219
  required: boolean;
220
- connectedCallback(): void;
221
- disconnectedCallback(): void;
222
220
  updated(changedProperties: PropertyValues<this>): void;
223
- /** @internal Called when a containing fieldset is disabled. */
224
- formDisabledCallback(isDisabled: boolean): void;
225
221
  /** @internal Called when the form is reset. */
226
222
  formResetCallback(): void;
227
- private handleClick;
228
223
  private handleBlur;
229
224
  private handleChange;
230
225
  private handleInput;
231
226
  private handleKeyUp;
232
227
  private handleFocus;
233
- private handleHostInvalid;
234
228
  /** Sets the form control's validity */
235
229
  private updateValidity;
236
230
  /** Sets focus to the switch. */
@@ -1,5 +1,6 @@
1
1
  import "./icon-Df0H7LYB.js";
2
2
  import { t as __decorate } from "./decorate-DcF3lt7P.js";
3
+ import { mirrorNativeValidity } from "./utilities/form-validity.js";
3
4
  import { css, html } from "lit";
4
5
  import { property, query, state } from "lit/decorators.js";
5
6
  import hostStyles from "@mcp-b/wc-support/styles/host.styles";
@@ -74,9 +75,8 @@ var switch_styles_default = css`
74
75
  }
75
76
 
76
77
  &:has(:focus-visible) {
77
- outline: var(--sigvelo-border-style) calc(var(--sigvelo-border-width) + 1px)
78
- var(--sigvelo-color-focus);
79
- outline-offset: var(--sigvelo-border-width);
78
+ outline: var(--sigvelo-focus-ring);
79
+ outline-offset: var(--sigvelo-focus-offset);
80
80
  }
81
81
 
82
82
  /* Thumb */
@@ -429,40 +429,16 @@ var SigveloSwitch = class extends SigveloFormControlElement {
429
429
  get focusableAnchor() {
430
430
  return this.switch;
431
431
  }
432
- connectedCallback() {
433
- super.connectedCallback();
434
- this.addEventListener("invalid", this.handleHostInvalid);
435
- }
436
- disconnectedCallback() {
437
- super.disconnectedCallback();
438
- this.removeEventListener("invalid", this.handleHostInvalid);
439
- }
440
432
  updated(changedProperties) {
441
433
  this.updateValidity();
442
434
  if (changedProperties.has("checked") || changedProperties.has("value")) this.internals.setFormValue(this.checked ? this.value : null);
443
- if (changedProperties.has("disabled")) this.customStates.set("disabled", this.disabled);
444
- if (this.hadUserInteraction || this.wasSubmitted) {
445
- this.customStates.set("user-invalid", this.isInvalid);
446
- this.customStates.set("user-valid", !this.isInvalid);
447
- } else {
448
- this.customStates.set("user-invalid", false);
449
- this.customStates.set("user-valid", false);
450
- }
451
- }
452
- /** @internal Called when a containing fieldset is disabled. */
453
- formDisabledCallback(isDisabled) {
454
- this.disabled = isDisabled;
435
+ if (changedProperties.has("disabled")) this.customStates.set("disabled", this.effectiveDisabled);
455
436
  }
456
437
  /** @internal Called when the form is reset. */
457
438
  formResetCallback() {
458
- this.isInvalid = false;
459
- this.hadUserInteraction = false;
460
- this.wasSubmitted = false;
439
+ super.formResetCallback();
461
440
  this.checked = this.hasAttribute("checked");
462
441
  }
463
- handleClick() {
464
- this.checked = !this.checked;
465
- }
466
442
  handleBlur() {
467
443
  this.customStates.set("focused", false);
468
444
  this.dispatchEvent(new SigveloBlurEvent());
@@ -476,28 +452,21 @@ var SigveloSwitch = class extends SigveloFormControlElement {
476
452
  }));
477
453
  }
478
454
  handleInput() {
455
+ this.checked = this.switch.checked;
479
456
  this.dispatchEvent(new SigveloInputEvent());
480
457
  }
481
458
  handleKeyUp(event) {
482
- if (event.key === "Enter" && !this.disabled) this.handleClick();
459
+ if (event.key === "Enter" && !this.effectiveDisabled) this.switch.click();
483
460
  }
484
461
  handleFocus() {
485
462
  this.customStates.set("focused", true);
486
463
  this.dispatchEvent(new SigveloFocusEvent());
487
464
  }
488
- handleHostInvalid() {
489
- this.wasSubmitted = true;
490
- }
491
465
  /** Sets the form control's validity */
492
466
  async updateValidity() {
493
467
  await this.updateComplete;
494
- const hasCustomValidity = this.getCustomValidity().length > 0;
495
- const validationMessage = hasCustomValidity ? this.getCustomValidity() : this.switch.validationMessage;
496
- const flags = {
497
- customError: hasCustomValidity,
498
- valueMissing: this.switch.validity.valueMissing
499
- };
500
- this.isInvalid = hasCustomValidity ? true : !this.switch.validity.valid;
468
+ const { flags, validationMessage, isInvalid } = mirrorNativeValidity(this.switch, this.getCustomValidity());
469
+ this.isInvalid = isInvalid;
501
470
  this.internals.setValidity(flags, validationMessage, this.focusableAnchor);
502
471
  }
503
472
  /** Sets focus to the switch. */
@@ -522,7 +491,7 @@ var SigveloSwitch = class extends SigveloFormControlElement {
522
491
  lg: this.size === "lg",
523
492
  xl: this.size === "xl",
524
493
  checked: this.checked,
525
- disabled: this.disabled,
494
+ disabled: this.effectiveDisabled,
526
495
  required: this.required
527
496
  })}
528
497
  >
@@ -535,10 +504,9 @@ var SigveloSwitch = class extends SigveloFormControlElement {
535
504
  aria-checked=${this.checked ? "true" : "false"}
536
505
  aria-describedby="description"
537
506
  .checked=${live(this.checked)}
538
- .disabled=${this.disabled}
507
+ .disabled=${this.effectiveDisabled}
539
508
  .required=${this.required}
540
509
  @change=${this.handleChange}
541
- @click=${this.handleClick}
542
510
  @input=${this.handleInput}
543
511
  @keyup=${this.handleKeyUp}
544
512
  @focus=${this.handleFocus}
@@ -1,6 +1,6 @@
1
- import { Localize } from "./utilities/localize.js";
2
1
  import { t as __decorate } from "./decorate-DcF3lt7P.js";
3
- import "./scroller-LYgBVyfY.js";
2
+ import { Localize } from "./utilities/localize.js";
3
+ import "./scroller-DZATZlDa.js";
4
4
  import "./tab-C-FtuNmh.js";
5
5
  import "./tab-panel-BaBl6eep.js";
6
6
  import { css, html } from "lit";
@@ -293,14 +293,11 @@ declare class SigveloTextArea extends SigveloFormControlElement {
293
293
  connectedCallback(): void;
294
294
  disconnectedCallback(): void;
295
295
  updated(changedProperties: PropertyValues<this>): void;
296
- /** @internal Called when a containing fieldset is disabled. */
297
- formDisabledCallback(isDisabled: boolean): void;
298
296
  /** @internal Called when the form is reset. */
299
297
  formResetCallback(): void;
300
298
  private handleBlur;
301
299
  private handleChange;
302
300
  private handleFocus;
303
- private handleHostInvalid;
304
301
  private handleInput;
305
302
  /** Updates the height of the text area based on its content and settings. */
306
303
  private updateHeight;
@@ -1,4 +1,5 @@
1
1
  import { t as __decorate } from "./decorate-DcF3lt7P.js";
2
+ import { mirrorNativeValidity } from "./utilities/form-validity.js";
2
3
  import { css, html } from "lit";
3
4
  import { property, query, state } from "lit/decorators.js";
4
5
  import hostStyles from "@mcp-b/wc-support/styles/host.styles";
@@ -10,42 +11,35 @@ import { live } from "lit/directives/live.js";
10
11
  import formControlStyles from "@mcp-b/wc-support/styles/form-control.styles";
11
12
  //#region src/components/text-area/text-area.styles.ts
12
13
  var text_area_styles_default = css`
13
- /* Normal */
14
- #visual-box.normal {
15
- padding-inline: 0;
16
-
17
- #text-box {
18
- padding-inline: 0.75em;
19
- }
20
- }
21
-
22
- /* Filled */
14
+ /* Keep the resize handle at the border; padding belongs to the textarea. */
15
+ #visual-box.normal,
23
16
  #visual-box.filled {
24
17
  padding-inline: 0;
25
-
26
- #text-box {
27
- padding-inline: 0.75em;
28
- }
29
18
  }
30
19
 
31
20
  /* Sizes */
32
21
  #visual-box.xs #text-box {
22
+ padding-inline: var(--sigvelo-control-padding-inline-xs);
33
23
  padding-block: 0.2em;
34
24
  }
35
25
 
36
26
  #visual-box.sm #text-box {
27
+ padding-inline: var(--sigvelo-control-padding-inline-sm);
37
28
  padding-block: 0.35em;
38
29
  }
39
30
 
40
31
  #visual-box.md #text-box {
32
+ padding-inline: var(--sigvelo-control-padding-inline-md);
41
33
  padding-block: 0.7em;
42
34
  }
43
35
 
44
36
  #visual-box.lg #text-box {
37
+ padding-inline: var(--sigvelo-control-padding-inline-lg);
45
38
  padding-block: 0.5em;
46
39
  }
47
40
 
48
41
  #visual-box.xl #text-box {
42
+ padding-inline: var(--sigvelo-control-padding-inline-xl);
49
43
  padding-block: 0.55em;
50
44
  }
51
45
 
@@ -313,7 +307,6 @@ var SigveloTextArea = class extends SigveloFormControlElement {
313
307
  }
314
308
  connectedCallback() {
315
309
  super.connectedCallback();
316
- this.addEventListener("invalid", this.handleHostInvalid);
317
310
  this.resizeObserver = new ResizeObserver(() => this.updateHeight());
318
311
  this.updateComplete.then(() => {
319
312
  this.updateHeight();
@@ -322,7 +315,6 @@ var SigveloTextArea = class extends SigveloFormControlElement {
322
315
  }
323
316
  disconnectedCallback() {
324
317
  super.disconnectedCallback();
325
- this.removeEventListener("invalid", this.handleHostInvalid);
326
318
  if (this.textBox) this.resizeObserver.unobserve(this.textBox);
327
319
  }
328
320
  updated(changedProperties) {
@@ -331,25 +323,12 @@ var SigveloTextArea = class extends SigveloFormControlElement {
331
323
  this.customStates.set("blank", this.value === "");
332
324
  this.internals.setFormValue(this.value);
333
325
  }
334
- if (changedProperties.has("disabled")) this.customStates.set("disabled", this.disabled);
326
+ if (changedProperties.has("disabled")) this.customStates.set("disabled", this.effectiveDisabled);
335
327
  if (changedProperties.has("value") || changedProperties.has("rows")) this.updateHeight();
336
- if (this.hadUserInteraction || this.wasSubmitted) {
337
- this.customStates.set("user-invalid", this.isInvalid);
338
- this.customStates.set("user-valid", !this.isInvalid);
339
- } else {
340
- this.customStates.set("user-invalid", false);
341
- this.customStates.set("user-valid", false);
342
- }
343
- }
344
- /** @internal Called when a containing fieldset is disabled. */
345
- formDisabledCallback(isDisabled) {
346
- this.disabled = isDisabled;
347
328
  }
348
329
  /** @internal Called when the form is reset. */
349
330
  formResetCallback() {
350
- this.isInvalid = false;
351
- this.hadUserInteraction = false;
352
- this.wasSubmitted = false;
331
+ super.formResetCallback();
353
332
  this.value = this.getAttribute("value") ?? "";
354
333
  }
355
334
  handleBlur() {
@@ -368,9 +347,6 @@ var SigveloTextArea = class extends SigveloFormControlElement {
368
347
  this.customStates.set("focused", true);
369
348
  this.dispatchEvent(new SigveloFocusEvent());
370
349
  }
371
- handleHostInvalid() {
372
- this.wasSubmitted = true;
373
- }
374
350
  async handleInput() {
375
351
  this.value = this.textBox.value;
376
352
  await this.updateComplete;
@@ -407,21 +383,8 @@ var SigveloTextArea = class extends SigveloFormControlElement {
407
383
  /** Sets the form control's validity */
408
384
  async updateValidity() {
409
385
  await this.updateComplete;
410
- const hasCustomValidity = this.getCustomValidity().length > 0;
411
- const validationMessage = hasCustomValidity ? this.getCustomValidity() : this.textBox.validationMessage;
412
- const flags = {
413
- badInput: this.textBox.validity.badInput,
414
- customError: hasCustomValidity,
415
- patternMismatch: this.textBox.validity.patternMismatch,
416
- rangeOverflow: this.textBox.validity.rangeOverflow,
417
- rangeUnderflow: this.textBox.validity.rangeUnderflow,
418
- stepMismatch: this.textBox.validity.stepMismatch,
419
- tooLong: this.textBox.validity.tooLong,
420
- tooShort: this.textBox.validity.tooShort,
421
- typeMismatch: this.textBox.validity.typeMismatch,
422
- valueMissing: this.textBox.validity.valueMissing
423
- };
424
- this.isInvalid = hasCustomValidity ? true : !this.textBox.validity.valid;
386
+ const { flags, validationMessage, isInvalid } = mirrorNativeValidity(this.textBox, this.getCustomValidity());
387
+ this.isInvalid = isInvalid;
425
388
  this.internals.setValidity(flags, validationMessage, this.focusableAnchor);
426
389
  }
427
390
  /** Sets focus to the text area. */
@@ -472,14 +435,14 @@ var SigveloTextArea = class extends SigveloFormControlElement {
472
435
  "resize-vertical": this.resize === "vertical",
473
436
  "resize-auto": this.resize === "auto",
474
437
  "resize-none": this.resize === "none",
475
- disabled: this.disabled
438
+ disabled: this.effectiveDisabled
476
439
  })}
477
440
  >
478
441
  <textarea
479
442
  id="text-box"
480
443
  part="text-box"
481
444
  ?autofocus=${this.autofocus}
482
- ?disabled=${this.disabled}
445
+ ?disabled=${this.effectiveDisabled}
483
446
  ?readonly=${this.readonly}
484
447
  ?required=${this.required}
485
448
  placeholder=${ifDefined(this.placeholder)}
@@ -369,19 +369,14 @@ declare class SigveloTextField extends SigveloFormControlElement {
369
369
  inputmode: "none" | "text" | "decimal" | "numeric" | "tel" | "search" | "email" | "url";
370
370
  /** Turns spell checking on or off in supported browsers. */
371
371
  spellcheck: boolean;
372
- connectedCallback(): void;
373
- disconnectedCallback(): void;
374
372
  firstUpdated(): void;
375
373
  updated(changedProperties: PropertyValues<this>): void;
376
- /** @internal Called when a containing fieldset is disabled. */
377
- formDisabledCallback(isDisabled: boolean): void;
378
374
  /** @internal Called when the form is reset. */
379
375
  formResetCallback(): void;
380
376
  private handleBlur;
381
377
  private handleChange;
382
378
  private handleClearClick;
383
379
  private handleFocus;
384
- private handleHostInvalid;
385
380
  private handleInput;
386
381
  private handleKeyDown;
387
382
  private handlePasswordToggleClick;