@synergy-design-system/mcp 2.13.0 → 2.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.13.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1227](https://github.com/synergy-design-system/synergy-design-system/pull/1227) [`c827385`](https://github.com/synergy-design-system/synergy-design-system/commit/c82738594731dc3c2a5041695741f099393068de) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-03-10
8
+
9
+ fix: 🐛 `<syn-select>` may throw an error when configured to be `readonly` and `multiple` (#1225)
10
+
11
+ ## 2.13.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1224](https://github.com/synergy-design-system/synergy-design-system/pull/1224) [`7defd03`](https://github.com/synergy-design-system/synergy-design-system/commit/7defd0349dc50d4f9549eda59c4b6bcc96c4612c) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-03-09
16
+
17
+ fix: 🐛 `<syn-range>` content may bleed into the label when rendering a prefix or suffix slot and using ticks (#1143)
18
+
19
+ This release fixes an issue with `<syn-range>` that caused a layout miscalculation when using prefix and suffix slots in combination with slots.
20
+
3
21
  ## 2.13.0
4
22
 
5
23
  ### Minor Changes
@@ -1 +1 @@
1
- b5565f36f2815ac2f4d88413d20e1172
1
+ 6cc0ea87c5efe56b0cf4977b5b228a7f
@@ -241,8 +241,9 @@ export default css`
241
241
  /* Ticks */
242
242
  .ticks {
243
243
  cursor: pointer;
244
- margin: 1px 0;
245
- position: relative;
244
+ inset-inline: 0;
245
+ position: absolute;
246
+ top: 100%;
246
247
  user-select: none;
247
248
  }
248
249
 
@@ -165,6 +165,8 @@ export default class SynRange extends SynergyElement implements SynergyFormContr
165
165
 
166
166
  @query('.input__wrapper') baseDiv: HTMLDivElement;
167
167
 
168
+ @query('.base') baseControl: HTMLDivElement;
169
+
168
170
  @query('.active-track') activeTrack: HTMLDivElement;
169
171
 
170
172
  @query('.ticks') ticks: HTMLDivElement;
@@ -179,6 +181,8 @@ export default class SynRange extends SynergyElement implements SynergyFormContr
179
181
 
180
182
  private localize = new LocalizeController(this);
181
183
 
184
+ private ticksResizeObserver: ResizeObserver;
185
+
182
186
  private visibilityObserver: IntersectionObserver;
183
187
 
184
188
  #value: readonly number[] = [0];
@@ -204,22 +208,31 @@ export default class SynRange extends SynergyElement implements SynergyFormContr
204
208
 
205
209
  disconnectedCallback() {
206
210
  super.disconnectedCallback();
211
+ this?.ticksResizeObserver?.disconnect();
207
212
  this?.visibilityObserver?.disconnect();
208
213
  }
209
214
 
210
215
  firstUpdated() {
211
- // #727: Check if the ticks are visible and update the prefix and suffix position when they are.
216
+ this.ticksResizeObserver = new ResizeObserver(() => {
217
+ this.#updateTicksHeight();
218
+ });
219
+ this.ticksResizeObserver.observe(this.ticks);
220
+ // Also observe .base so that a runtime change to the prefix/suffix slot
221
+ // (e.g. swapping in a taller <syn-input size="large">) re-triggers the
222
+ // overflow calculation — the formula reads baseControl.offsetHeight, which
223
+ // would otherwise be stale until the next ticks resize.
224
+ this.ticksResizeObserver.observe(this.baseControl);
225
+
226
+ // #727: If the range starts hidden (e.g. inside inactive tabs), update once it becomes visible.
212
227
  this.visibilityObserver = new IntersectionObserver((entries) => {
213
228
  const entry = entries.at(0);
214
- if (entry && entry.isIntersecting && entry.target.checkVisibility()) {
215
- this.#updatePrefixSuffixPosition(entry.boundingClientRect.height);
229
+ if (entry && entry.isIntersecting) {
230
+ this.#updateTicksHeight();
216
231
  }
217
- }, {
218
- // We bind the root to the parent element of the ticks to make sure we are only called
219
- // when the ticks are visible, not when the ticks are scrolled out of the viewport.
220
- root: this.ticks.parentElement,
221
232
  });
222
- this.visibilityObserver.observe(this.ticks);
233
+ this.visibilityObserver.observe(this);
234
+
235
+ this.#updateTicksHeight();
223
236
 
224
237
  this.formControlController.updateValidity();
225
238
  // initialize the lastChangeValue with the initial value
@@ -700,35 +713,65 @@ export default class SynRange extends SynergyElement implements SynergyFormContr
700
713
  this.formControlController.emitInvalidEvent(event);
701
714
  }
702
715
 
703
- #updatePrefixSuffixPosition(height?: number) {
704
- const hasTicksSlot = this.hasSlotController.test('ticks');
705
- const hasPrefixSlot = this.hasSlotController.test('prefix');
706
- const hasSuffixSlot = this.hasSlotController.test('suffix');
707
-
708
- if (!hasTicksSlot) {
716
+ #updateTicksHeight() {
717
+ if (!this.hasSlotController.test('ticks')) {
718
+ this.baseControl.style.marginBottom = '';
709
719
  return;
710
720
  }
711
721
 
712
- let ticksHeight = height || this.shadowRoot?.querySelector('.ticks')?.clientHeight;
713
- if (ticksHeight) {
714
- // Add two pixels as the 1px margin on top and bottom are not included in the clientHeight
715
- ticksHeight += 2;
716
-
717
- ticksHeight /= 2;
722
+ /**
723
+ * Why this calculation is needed (#1143):
724
+ *
725
+ * `.ticks` is `position: absolute; top: 100%` inside `.input__wrapper`.
726
+ * This means the ticks render *below* `.input__wrapper` but are taken out of
727
+ * normal flow, so they do not affect `.base`'s intrinsic height. Without
728
+ * correction the ticks would visually overlap whatever comes after `.base`
729
+ * (e.g. the help-text or the next form field).
730
+ *
731
+ * A naive fix — `margin-bottom = ticks.clientHeight` — over-corrects when a
732
+ * tall prefix/suffix slot is present. Because `.base` uses `align-items:
733
+ * center`, `.input__wrapper` (which contains `.ticks`) is vertically centred
734
+ * inside `.base`. The bottom edge of the ticks therefore sits at:
735
+ *
736
+ * ticksBottom = (baseHeight + inputWrapperHeight) / 2 + ticksHeight
737
+ *
738
+ * The amount by which the ticks actually *protrude below* `.base` is:
739
+ *
740
+ * overflow = ticksBottom - baseHeight
741
+ * = ticksHeight - (baseHeight - inputWrapperHeight) / 2
742
+ *
743
+ * When the prefix/suffix content is taller than the ticks, the vertical
744
+ * space already available below `.input__wrapper` absorbs all of the ticks,
745
+ * so the overflow is zero (or negative — in which case no extra margin is
746
+ * needed).
747
+ *
748
+ * We therefore apply:
749
+ * margin-bottom = max(0, ticksHeight - availableSpaceBelow)
750
+ *
751
+ * where:
752
+ * availableSpaceBelow = (baseHeight - inputWrapperHeight) / 2
753
+ *
754
+ * All three heights are read via getBoundingClientRect().height rather than
755
+ * offsetHeight / clientHeight. The latter return integers and can differ in
756
+ * rounding direction, causing (baseHeight - inputWrapperHeight) to be ±1 px
757
+ * off even when the two elements have the same real height. With fractional
758
+ * measurements the subtraction is exact. We then Math.ceil the overflow so
759
+ * we always apply enough margin and never leave the ticks 1 px short.
760
+ */
761
+ const ticksHeight = this.ticks.getBoundingClientRect().height;
762
+ const baseHeight = this.baseControl.getBoundingClientRect().height;
763
+ const inputWrapperHeight = this.baseDiv.getBoundingClientRect().height;
718
764
 
719
- if (hasPrefixSlot) {
720
- const prefix = this.shadowRoot?.querySelector('.input__prefix') as HTMLElement;
721
- prefix.style.transform = `translateY(-${ticksHeight}px)`;
722
- }
765
+ // Vertical space that already exists between the bottom of .input__wrapper
766
+ // and the bottom edge of .base (due to a taller prefix/suffix).
767
+ const availableSpaceBelow = (baseHeight - inputWrapperHeight) / 2;
723
768
 
724
- if (hasSuffixSlot) {
725
- const suffix = this.shadowRoot?.querySelector('.input__suffix') as HTMLElement;
726
- suffix.style.transform = `translateY(-${ticksHeight}px)`;
727
- }
728
- }
769
+ // Only add a margin for the portion of the ticks that protrudes beyond .base.
770
+ // Math.ceil ensures we never undershoot by a sub-pixel fraction.
771
+ const overflow = Math.ceil(Math.max(0, ticksHeight - availableSpaceBelow));
772
+ this.baseControl.style.marginBottom = overflow > 0 ? `${overflow}px` : '';
729
773
  }
730
774
 
731
- /* eslint-disable @typescript-eslint/unbound-method */
732
775
  private renderThumbs(hasLabel: boolean) {
733
776
  // Aria special handling:
734
777
  // 1. When there is only one label: Use the provided label as the aria-label for the thumb
@@ -759,6 +802,7 @@ export default class SynRange extends SynergyElement implements SynergyFormContr
759
802
  }
760
803
  }
761
804
 
805
+ /* eslint-disable @typescript-eslint/unbound-method */
762
806
  return html`
763
807
  <syn-tooltip
764
808
  exportparts="base:tooltip__base, base__arrow:tooltip__arrow, base__popup:tooltip__popup, body:tooltip__body"
@@ -790,11 +834,10 @@ export default class SynRange extends SynergyElement implements SynergyFormContr
790
834
  ></div>
791
835
  </syn-tooltip>
792
836
  `;
837
+ /* eslint-enable @typescript-eslint/unbound-method */
793
838
  });
794
839
  }
795
- /* eslint-enable @typescript-eslint/unbound-method */
796
840
 
797
- /* eslint-disable @typescript-eslint/unbound-method */
798
841
  override render() {
799
842
  const hasLabelSlot = this.hasSlotController.test('label');
800
843
  const hasHelpTextSlot = this.hasSlotController.test('help-text');
@@ -803,6 +846,7 @@ export default class SynRange extends SynergyElement implements SynergyFormContr
803
846
  const hasLabel = this.label ? true : !!hasLabelSlot;
804
847
  const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
805
848
 
849
+ /* eslint-disable @typescript-eslint/unbound-method */
806
850
  return html`
807
851
  <div
808
852
  part="form-control"
@@ -884,6 +928,6 @@ export default class SynRange extends SynergyElement implements SynergyFormContr
884
928
  </div>
885
929
  </div>
886
930
  `;
931
+ /* eslint-enable @typescript-eslint/unbound-method */
887
932
  }
888
- /* eslint-enable @typescript-eslint/unbound-method */
889
933
  }
@@ -236,7 +236,7 @@ export default class SynSelect extends SynergyElement implements SynergyFormCont
236
236
 
237
237
 
238
238
  private enableResizeObserver() {
239
- if (this.multiple) {
239
+ if (this.multiple && !this.readonly && this.tagContainer) {
240
240
  this.resizeObserver = new ResizeObserver(entries => {
241
241
  const entry = entries.at(0)!;
242
242
  this.tagContainer.style.setProperty('--syn-select-tag-max-width', `${entry.contentRect.width}px`);
@@ -726,10 +726,10 @@ export default class SynSelect extends SynergyElement implements SynergyFormCont
726
726
 
727
727
  protected updated(changedProperties: PropertyValues<this>) {
728
728
  super.updated(changedProperties);
729
- if (changedProperties.has('multiple')) {
730
- if (!this.multiple) {
731
- this.resizeObserver?.disconnect();
732
- } else {
729
+ if (changedProperties.has('multiple') || changedProperties.has('readonly')) {
730
+ this.resizeObserver?.disconnect();
731
+
732
+ if (this.multiple && !this.readonly) {
733
733
  this.enableResizeObserver();
734
734
  }
735
735
  }
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.10.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1227](https://github.com/synergy-design-system/synergy-design-system/pull/1227) [`c827385`](https://github.com/synergy-design-system/synergy-design-system/commit/c82738594731dc3c2a5041695741f099393068de) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-03-10
8
+
9
+ fix: 🐛 `<syn-select>` may throw an error when configured to be `readonly` and `multiple` (#1225)
10
+
11
+ - Updated dependencies []:
12
+ - @synergy-design-system/tokens@3.10.3
13
+
14
+ ## 3.10.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [#1224](https://github.com/synergy-design-system/synergy-design-system/pull/1224) [`7defd03`](https://github.com/synergy-design-system/synergy-design-system/commit/7defd0349dc50d4f9549eda59c4b6bcc96c4612c) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-03-09
19
+
20
+ fix: 🐛 `<syn-range>` content may bleed into the label when rendering a prefix or suffix slot and using ticks (#1143)
21
+
22
+ This release fixes an issue with `<syn-range>` that caused a layout miscalculation when using prefix and suffix slots in combination with slots.
23
+
24
+ - Updated dependencies []:
25
+ - @synergy-design-system/tokens@3.10.2
26
+
3
27
  ## 3.10.1
4
28
 
5
29
  ### Patch Changes
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.10.3
4
+
5
+ ## 3.10.2
6
+
3
7
  ## 3.10.1
4
8
 
5
9
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @synergy-design-system/tokens version 3.10.1
2
+ * @synergy-design-system/tokens version 3.10.2
3
3
  * SICK Global UX Foundation
4
4
  * Do not edit directly, this file was auto-generated.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @synergy-design-system/tokens version 3.10.1
2
+ * @synergy-design-system/tokens version 3.10.2
3
3
  * SICK Global UX Foundation
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @synergy-design-system/tokens version 3.10.1
2
+ * @synergy-design-system/tokens version 3.10.2
3
3
  * SICK Global UX Foundation
4
4
  * Do not edit directly, this file was auto-generated.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @synergy-design-system/tokens version 3.10.1
2
+ * @synergy-design-system/tokens version 3.10.2
3
3
  * SICK Global UX Foundation
4
4
  * Do not edit directly, this file was auto-generated.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @synergy-design-system/tokens version 3.10.1
2
+ * @synergy-design-system/tokens version 3.10.2
3
3
  * SICK Global UX Foundation
4
4
  * Do not edit directly, this file was auto-generated.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @synergy-design-system/tokens version 3.10.1
2
+ * @synergy-design-system/tokens version 3.10.2
3
3
  * SICK Global UX Foundation
4
4
  * Do not edit directly, this file was auto-generated.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @synergy-design-system/tokens version 3.10.1
2
+ * @synergy-design-system/tokens version 3.10.2
3
3
  * SICK Global UX Foundation
4
4
  * Do not edit directly, this file was auto-generated.
5
5
  */
package/package.json CHANGED
@@ -28,12 +28,12 @@
28
28
  "serve-handler": "^6.1.7",
29
29
  "ts-jest": "^29.4.6",
30
30
  "typescript": "^5.9.3",
31
+ "@synergy-design-system/docs": "0.1.0",
31
32
  "@synergy-design-system/eslint-config-syn": "^0.1.0",
33
+ "@synergy-design-system/components": "3.10.3",
32
34
  "@synergy-design-system/fonts": "1.0.4",
33
- "@synergy-design-system/components": "3.10.1",
34
35
  "@synergy-design-system/styles": "2.0.2",
35
- "@synergy-design-system/tokens": "^3.10.1",
36
- "@synergy-design-system/docs": "0.1.0"
36
+ "@synergy-design-system/tokens": "^3.10.3"
37
37
  },
38
38
  "exports": {
39
39
  ".": {
@@ -67,7 +67,7 @@
67
67
  "directory": "packages/mcp"
68
68
  },
69
69
  "type": "module",
70
- "version": "2.13.0",
70
+ "version": "2.13.2",
71
71
  "scripts": {
72
72
  "build": "pnpm run build:ts && pnpm run build:metadata && pnpm build:hash",
73
73
  "build:all": "pnpm run build && pnpm run build:storybook",