@seatlayer/core 0.28.1 → 0.28.3

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/dist/index.cjs CHANGED
@@ -1369,9 +1369,10 @@ function compositeHexOver(foreground, background, opacity) {
1369
1369
  const channels = front.map((value, index) => Math.round(value * alpha + back[index] * (1 - alpha)));
1370
1370
  return `#${channels.map((value) => value.toString(16).padStart(2, "0")).join("")}`;
1371
1371
  }
1372
- function stateAwareBookableLabelInk(fill, preferred) {
1372
+ var AUTHORED_LABEL_MIN_CONTRAST = 3;
1373
+ function stateAwareBookableLabelInk(fill, preferred, minContrast = SMALL_TEXT_CONTRAST) {
1373
1374
  const preferredContrast = renderedTextContrast(preferred, fill);
1374
- if (preferredContrast != null && preferredContrast >= SMALL_TEXT_CONTRAST) return preferred;
1375
+ if (preferredContrast != null && preferredContrast >= minContrast) return preferred;
1375
1376
  const darkContrast = renderedTextContrast(DARK_BOOKABLE_LABEL_INK, fill) ?? 0;
1376
1377
  const lightContrast = renderedTextContrast(LIGHT_BOOKABLE_LABEL_INK, fill) ?? 0;
1377
1378
  if (darkContrast === 0 && lightContrast === 0) return preferred;
@@ -4786,7 +4787,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
4786
4787
  * authored per-seat colour through the same auto-contrast rule as sections. */
4787
4788
  seatLabelInk(seat, shape) {
4788
4789
  const fill = shape.fill();
4789
- return stateAwareBookableLabelInk(typeof fill === "string" ? fill : "", this.seatPreferredLabelInk(seat));
4790
+ return stateAwareBookableLabelInk(typeof fill === "string" ? fill : "", this.seatPreferredLabelInk(seat), AUTHORED_LABEL_MIN_CONTRAST);
4790
4791
  }
4791
4792
  /** Apply fill/stroke/opacity for a seat's current status + selection. */
4792
4793
  paintSeat(c, id) {
@@ -4881,7 +4882,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
4881
4882
  const accessGlyph = this.accessGlyphById.get(id);
4882
4883
  if (accessGlyph) {
4883
4884
  const fill = c.fill();
4884
- accessGlyph.fill(stateAwareBookableLabelInk(typeof fill === "string" ? fill : "", "#ffffff"));
4885
+ accessGlyph.fill(accessGlyphInk(typeof fill === "string" ? fill : ""));
4885
4886
  accessGlyph.opacity(c.opacity());
4886
4887
  accessGlyph.visible(this.accessGlyphShouldShow(id));
4887
4888
  }
@@ -6954,7 +6955,8 @@ var _SeatmapRenderer = class _SeatmapRenderer {
6954
6955
  const labelStyle = presentation?.labelStyle;
6955
6956
  const ink = stateAwareBookableLabelInk(
6956
6957
  background,
6957
- labelStyle?.color ?? this.theme.rowLabelColor ?? this.theme.textColor ?? "#e6e9f0"
6958
+ labelStyle?.color ?? this.theme.rowLabelColor ?? this.theme.textColor ?? "#e6e9f0",
6959
+ AUTHORED_LABEL_MIN_CONTRAST
6958
6960
  );
6959
6961
  const fontSize = labelStyle?.size ?? 12;
6960
6962
  const rotation = presentation?.rotation ?? 0;