@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.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1463,12 +1463,16 @@ function isFitSize(size) {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
|
|
1465
1465
|
// src/ChipSelector/utils/chipLook.ts
|
|
1466
|
-
function chipFill({ selected, selectedFill, ink, onDarkInk, rest }) {
|
|
1466
|
+
function chipFill({ selected, selectedFill, ink, onDarkInk, lightInk, rest }) {
|
|
1467
1467
|
if (!selected || selectedFill === void 0)
|
|
1468
1468
|
return { ...rest, checkColor: void 0 };
|
|
1469
|
-
const fillInk =
|
|
1469
|
+
const fillInk = isDarkColor(selectedFill) ? darkFillInk(onDarkInk, lightInk, ink) : ink;
|
|
1470
1470
|
return { backgroundColor: selectedFill, textColor: fillInk, checkColor: fillInk };
|
|
1471
1471
|
}
|
|
1472
|
+
function darkFillInk(onDarkInk, lightInk, ink) {
|
|
1473
|
+
if (onDarkInk === void 0) return ink;
|
|
1474
|
+
return isDarkColor(onDarkInk) && lightInk !== void 0 ? lightInk : onDarkInk;
|
|
1475
|
+
}
|
|
1472
1476
|
var HEX_RGB = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;
|
|
1473
1477
|
var FN_RGB = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i;
|
|
1474
1478
|
var DARK_LUMINANCE = 0.4;
|
|
@@ -1569,6 +1573,7 @@ function OutlineChip(props) {
|
|
|
1569
1573
|
selectedFill: props.selectedFill,
|
|
1570
1574
|
ink: colors.textStrong,
|
|
1571
1575
|
onDarkInk: colors.onPrimary,
|
|
1576
|
+
lightInk: colors.surface,
|
|
1572
1577
|
rest: outlineRest(colors, { tone: props.outlineTone, selected, active })
|
|
1573
1578
|
});
|
|
1574
1579
|
const sized = chipSizeLook(props.size);
|
|
@@ -1612,6 +1617,7 @@ function SolidChip(props) {
|
|
|
1612
1617
|
selectedFill: props.selectedFill,
|
|
1613
1618
|
ink: colors.textStrong,
|
|
1614
1619
|
onDarkInk: colors.onPrimary,
|
|
1620
|
+
lightInk: colors.surface,
|
|
1615
1621
|
rest: { backgroundColor: selected ? colors.primary : TRANSPARENT_COLOR, textColor: selected ? colors.onPrimary : colors.textStrong }
|
|
1616
1622
|
});
|
|
1617
1623
|
const sized = chipSizeLook(props.size);
|