@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 CHANGED
@@ -1061,6 +1061,8 @@ interface DateRangeControlProps {
1061
1061
  fromPlaceholder?: string;
1062
1062
  /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */
1063
1063
  toPlaceholder?: string;
1064
+ /** Draw the web `<from> – <to>` label; false when the caller already labels the field (default true). */
1065
+ showLabel?: boolean;
1064
1066
  /** PRE-LOCALIZED hint applied to BOTH inputs; defaults to `<fromLabel> – <toLabel>`. */
1065
1067
  accessibilityHint?: string;
1066
1068
  /** Merged LAST onto the row wrapper. */
@@ -1069,7 +1071,7 @@ interface DateRangeControlProps {
1069
1071
  testID: string;
1070
1072
  }
1071
1073
  /** An inclusive from/to date range: one field with a range calendar on web, two `DateField`s on native. */
1072
- declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, accessibilityHint, style, testID, }: DateRangeControlProps): React.ReactElement;
1074
+ declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, accessibilityHint, showLabel, style, testID, }: DateRangeControlProps): React.ReactElement;
1073
1075
 
1074
1076
  interface DateFieldProps {
1075
1077
  /** PRE-LOCALIZED label; also the accessible name. */
package/dist/index.d.ts CHANGED
@@ -1061,6 +1061,8 @@ interface DateRangeControlProps {
1061
1061
  fromPlaceholder?: string;
1062
1062
  /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */
1063
1063
  toPlaceholder?: string;
1064
+ /** Draw the web `<from> – <to>` label; false when the caller already labels the field (default true). */
1065
+ showLabel?: boolean;
1064
1066
  /** PRE-LOCALIZED hint applied to BOTH inputs; defaults to `<fromLabel> – <toLabel>`. */
1065
1067
  accessibilityHint?: string;
1066
1068
  /** Merged LAST onto the row wrapper. */
@@ -1069,7 +1071,7 @@ interface DateRangeControlProps {
1069
1071
  testID: string;
1070
1072
  }
1071
1073
  /** An inclusive from/to date range: one field with a range calendar on web, two `DateField`s on native. */
1072
- declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, accessibilityHint, style, testID, }: DateRangeControlProps): React.ReactElement;
1074
+ declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, accessibilityHint, showLabel, style, testID, }: DateRangeControlProps): React.ReactElement;
1073
1075
 
1074
1076
  interface DateFieldProps {
1075
1077
  /** PRE-LOCALIZED label; also the accessible name. */
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 = onDarkInk !== void 0 && isDarkColor(selectedFill) ? onDarkInk : ink;
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);
@@ -4104,6 +4110,7 @@ function DateRangeControl({
4104
4110
  fromLabel,
4105
4111
  toLabel,
4106
4112
  accessibilityHint,
4113
+ showLabel = true,
4107
4114
  style,
4108
4115
  testID
4109
4116
  }) {
@@ -4113,7 +4120,7 @@ function DateRangeControl({
4113
4120
  if (!IS_WEB9) {
4114
4121
  return /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(NativeDateRange, { fromLabel, hint, style, testID, toLabel, value, onChange, onSubmit }) });
4115
4122
  }
4116
- return /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style, testID: `${testID}-range`, children: /* @__PURE__ */ jsxRuntime.jsx(Field, { error: typedError, label: `${fromLabel}${labels.rangeSeparator}${toLabel}`, children: (context) => /* @__PURE__ */ jsxRuntime.jsx(WebDateRange, { context, fromLabel, hint, testID, toLabel, value, onChange, onSubmit, onTypedError: setTypedError }) }) }) });
4123
+ return /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style, testID: `${testID}-range`, children: /* @__PURE__ */ jsxRuntime.jsx(Field, { error: typedError, label: showLabel ? `${fromLabel}${labels.rangeSeparator}${toLabel}` : void 0, children: (context) => /* @__PURE__ */ jsxRuntime.jsx(WebDateRange, { context, fromLabel, hint, testID, toLabel, value, onChange, onSubmit, onTypedError: setTypedError }) }) }) });
4117
4124
  }
4118
4125
  function DateTimeField(props) {
4119
4126
  return /* @__PURE__ */ jsxRuntime.jsx(TemporalField, { fieldProps: props, webInputType: "datetime-local" });