@dloizides/ui-forms 1.52.0 → 1.53.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.53.0
4
+
5
+ - `ChipSelector` `outlineTone="surface"`: an unselected outline chip sits on the theme `surface` fill with strong ink (was the page `background` fill with muted ink), so it reads on a white card (MODC-1 D-MC-749 F1). `default` and `strong` unchanged.
6
+
3
7
  ## [1.51.0] - 2026-11-24
4
8
 
5
9
  ### Added
package/dist/index.d.mts CHANGED
@@ -657,8 +657,8 @@ declare const enum ChipLabelWrap {
657
657
  Truncate = "truncate"
658
658
  }
659
659
 
660
- /** Outline of an unselected chip. `default` = theme `border`; `strong` = theme `textSecondary`, a darker edge. */
661
- type ChipOutlineTone = 'default' | 'strong';
660
+ /** Unselected chip look. `default` = theme `border`; `strong` = theme `textSecondary` edge; `surface` = `border` edge on the surface fill with strong ink. */
661
+ type ChipOutlineTone = 'default' | 'strong' | 'surface';
662
662
 
663
663
  /** Chip size. `default` = 44 px pill; `compact` = 28 px pill in a 44 px hit box; `dense` = `compact` with no row gap; `fit` = 28 px pill that is its own box (wide screens); `tap` = 44 px pill with a 13 px label. */
664
664
  type ChipSize = 'default' | 'compact' | 'dense' | 'fit' | 'tap';
package/dist/index.d.ts CHANGED
@@ -657,8 +657,8 @@ declare const enum ChipLabelWrap {
657
657
  Truncate = "truncate"
658
658
  }
659
659
 
660
- /** Outline of an unselected chip. `default` = theme `border`; `strong` = theme `textSecondary`, a darker edge. */
661
- type ChipOutlineTone = 'default' | 'strong';
660
+ /** Unselected chip look. `default` = theme `border`; `strong` = theme `textSecondary` edge; `surface` = `border` edge on the surface fill with strong ink. */
661
+ type ChipOutlineTone = 'default' | 'strong' | 'surface';
662
662
 
663
663
  /** Chip size. `default` = 44 px pill; `compact` = 28 px pill in a 44 px hit box; `dense` = `compact` with no row gap; `fit` = 28 px pill that is its own box (wide screens); `tap` = 44 px pill with a 13 px label. */
664
664
  type ChipSize = 'default' | 'compact' | 'dense' | 'fit' | 'tap';
package/dist/index.js CHANGED
@@ -1508,6 +1508,13 @@ function chipBoxFill(size, backgroundColor) {
1508
1508
  function restBorderColor(colors, tone) {
1509
1509
  return tone === "strong" ? colors.borderStrong : colors.border;
1510
1510
  }
1511
+ function outlineRest(colors, look) {
1512
+ if (look.selected) return { backgroundColor: colors.tint, textColor: colors.primary };
1513
+ const surface = look.tone === "surface";
1514
+ const backgroundColor = surface ? colors.surface : colors.muted;
1515
+ if (look.active) return { backgroundColor, textColor: colors.primary };
1516
+ return { backgroundColor, textColor: surface ? colors.textStrong : colors.textMuted };
1517
+ }
1511
1518
  var SOLID_RADIUS = 20;
1512
1519
  var OUTLINE_RADIUS = 999;
1513
1520
  var OUTLINE_PAD_H = 12;
@@ -1562,7 +1569,7 @@ function OutlineChip(props) {
1562
1569
  selectedFill: props.selectedFill,
1563
1570
  ink: colors.textStrong,
1564
1571
  onDarkInk: colors.onPrimary,
1565
- rest: { backgroundColor: selected ? colors.tint : colors.muted, textColor: active ? colors.primary : colors.textMuted }
1572
+ rest: outlineRest(colors, { tone: props.outlineTone, selected, active })
1566
1573
  });
1567
1574
  const sized = chipSizeLook(props.size);
1568
1575
  const layout = chipLabelLayout(option.labelWrap);
@@ -1730,6 +1737,7 @@ function buildChipColors(colors, palette) {
1730
1737
  primary,
1731
1738
  onPrimary: onBrandInk(palette),
1732
1739
  muted: colors.background,
1740
+ surface: colors.surface ?? colors.background,
1733
1741
  tint: withAlpha2(primary, OUTLINE_TINT_ALPHA)
1734
1742
  };
1735
1743
  }