@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 +4 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1501,6 +1501,13 @@ function chipBoxFill(size, backgroundColor) {
|
|
|
1501
1501
|
function restBorderColor(colors, tone) {
|
|
1502
1502
|
return tone === "strong" ? colors.borderStrong : colors.border;
|
|
1503
1503
|
}
|
|
1504
|
+
function outlineRest(colors, look) {
|
|
1505
|
+
if (look.selected) return { backgroundColor: colors.tint, textColor: colors.primary };
|
|
1506
|
+
const surface = look.tone === "surface";
|
|
1507
|
+
const backgroundColor = surface ? colors.surface : colors.muted;
|
|
1508
|
+
if (look.active) return { backgroundColor, textColor: colors.primary };
|
|
1509
|
+
return { backgroundColor, textColor: surface ? colors.textStrong : colors.textMuted };
|
|
1510
|
+
}
|
|
1504
1511
|
var SOLID_RADIUS = 20;
|
|
1505
1512
|
var OUTLINE_RADIUS = 999;
|
|
1506
1513
|
var OUTLINE_PAD_H = 12;
|
|
@@ -1555,7 +1562,7 @@ function OutlineChip(props) {
|
|
|
1555
1562
|
selectedFill: props.selectedFill,
|
|
1556
1563
|
ink: colors.textStrong,
|
|
1557
1564
|
onDarkInk: colors.onPrimary,
|
|
1558
|
-
rest: {
|
|
1565
|
+
rest: outlineRest(colors, { tone: props.outlineTone, selected, active })
|
|
1559
1566
|
});
|
|
1560
1567
|
const sized = chipSizeLook(props.size);
|
|
1561
1568
|
const layout = chipLabelLayout(option.labelWrap);
|
|
@@ -1723,6 +1730,7 @@ function buildChipColors(colors, palette) {
|
|
|
1723
1730
|
primary,
|
|
1724
1731
|
onPrimary: onBrandInk(palette),
|
|
1725
1732
|
muted: colors.background,
|
|
1733
|
+
surface: colors.surface ?? colors.background,
|
|
1726
1734
|
tint: withAlpha2(primary, OUTLINE_TINT_ALPHA)
|
|
1727
1735
|
};
|
|
1728
1736
|
}
|