@dloizides/ui-forms 1.60.0 → 1.61.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/dist/index.mjs CHANGED
@@ -1456,12 +1456,16 @@ function isFitSize(size) {
1456
1456
  }
1457
1457
 
1458
1458
  // src/ChipSelector/utils/chipLook.ts
1459
- function chipFill({ selected, selectedFill, ink, onDarkInk, rest }) {
1459
+ function chipFill({ selected, selectedFill, ink, onDarkInk, lightInk, rest }) {
1460
1460
  if (!selected || selectedFill === void 0)
1461
1461
  return { ...rest, checkColor: void 0 };
1462
- const fillInk = onDarkInk !== void 0 && isDarkColor(selectedFill) ? onDarkInk : ink;
1462
+ const fillInk = isDarkColor(selectedFill) ? darkFillInk(onDarkInk, lightInk, ink) : ink;
1463
1463
  return { backgroundColor: selectedFill, textColor: fillInk, checkColor: fillInk };
1464
1464
  }
1465
+ function darkFillInk(onDarkInk, lightInk, ink) {
1466
+ if (onDarkInk === void 0) return ink;
1467
+ return isDarkColor(onDarkInk) && lightInk !== void 0 ? lightInk : onDarkInk;
1468
+ }
1465
1469
  var HEX_RGB = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;
1466
1470
  var FN_RGB = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i;
1467
1471
  var DARK_LUMINANCE = 0.4;
@@ -1562,6 +1566,7 @@ function OutlineChip(props) {
1562
1566
  selectedFill: props.selectedFill,
1563
1567
  ink: colors.textStrong,
1564
1568
  onDarkInk: colors.onPrimary,
1569
+ lightInk: colors.surface,
1565
1570
  rest: outlineRest(colors, { tone: props.outlineTone, selected, active })
1566
1571
  });
1567
1572
  const sized = chipSizeLook(props.size);
@@ -1605,6 +1610,7 @@ function SolidChip(props) {
1605
1610
  selectedFill: props.selectedFill,
1606
1611
  ink: colors.textStrong,
1607
1612
  onDarkInk: colors.onPrimary,
1613
+ lightInk: colors.surface,
1608
1614
  rest: { backgroundColor: selected ? colors.primary : TRANSPARENT_COLOR, textColor: selected ? colors.onPrimary : colors.textStrong }
1609
1615
  });
1610
1616
  const sized = chipSizeLook(props.size);