@dloizides/ui-forms 1.60.0 → 1.62.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.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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 =
|
|
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);
|
|
@@ -4097,6 +4103,7 @@ function DateRangeControl({
|
|
|
4097
4103
|
fromLabel,
|
|
4098
4104
|
toLabel,
|
|
4099
4105
|
accessibilityHint,
|
|
4106
|
+
showLabel = true,
|
|
4100
4107
|
style,
|
|
4101
4108
|
testID
|
|
4102
4109
|
}) {
|
|
@@ -4106,7 +4113,7 @@ function DateRangeControl({
|
|
|
4106
4113
|
if (!IS_WEB9) {
|
|
4107
4114
|
return /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsx(NativeDateRange, { fromLabel, hint, style, testID, toLabel, value, onChange, onSubmit }) });
|
|
4108
4115
|
}
|
|
4109
|
-
return /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsx(View, { style, testID: `${testID}-range`, children: /* @__PURE__ */ jsx(Field, { error: typedError, label: `${fromLabel}${labels.rangeSeparator}${toLabel}
|
|
4116
|
+
return /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsx(View, { style, testID: `${testID}-range`, children: /* @__PURE__ */ jsx(Field, { error: typedError, label: showLabel ? `${fromLabel}${labels.rangeSeparator}${toLabel}` : void 0, children: (context) => /* @__PURE__ */ jsx(WebDateRange, { context, fromLabel, hint, testID, toLabel, value, onChange, onSubmit, onTypedError: setTypedError }) }) }) });
|
|
4110
4117
|
}
|
|
4111
4118
|
function DateTimeField(props) {
|
|
4112
4119
|
return /* @__PURE__ */ jsx(TemporalField, { fieldProps: props, webInputType: "datetime-local" });
|