@dloizides/ui-forms 1.30.1 → 1.31.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
@@ -909,6 +909,12 @@ interface DateFieldProps {
909
909
  max?: string;
910
910
  }
911
911
  type DateTimeFieldProps = DateFieldProps;
912
+ interface DateInputProps {
913
+ /** The same props a `DateField` takes; `label` is the accessible name only. */
914
+ fieldProps: DateFieldProps;
915
+ /** The context `Field` hands its render-prop child. */
916
+ context: FieldChildContext;
917
+ }
912
918
 
913
919
  /** A labelled calendar date: takes and emits `YYYY-MM-DD`, empty is `''`. */
914
920
  declare function DateField(props: DateFieldProps): React.ReactElement;
@@ -916,6 +922,9 @@ declare function DateField(props: DateFieldProps): React.ReactElement;
916
922
  /** A labelled local date and time: takes and emits `YYYY-MM-DDTHH:mm`, empty is `''`. */
917
923
  declare function DateTimeField(props: DateTimeFieldProps): React.ReactElement;
918
924
 
925
+ /** A calendar date control with no label row, for a `Field` render-prop child whose caller owns the label. */
926
+ declare function DateInput({ fieldProps, context }: DateInputProps): React.ReactElement;
927
+
919
928
  /**
920
929
  * `AnchoredMenu` — the floating option list shared by `SelectControl` and `TypeaheadControl`.
921
930
  *
@@ -1235,4 +1244,4 @@ interface UploadWithLinkFieldProps {
1235
1244
  /** An image field: preview, an upload control, and a link input revealed on request. */
1236
1245
  declare const UploadWithLinkField: ({ value, onChange, labels, uploadControl, testID, disabled, previewSize, }: UploadWithLinkFieldProps) => React.ReactElement;
1237
1246
 
1238
- export { AlignToControl, type AlignToControlProps, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, controlStyles, groupAriaChecked, inlineFieldRowLayout, isUnmatched, isWideFormLayout, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
1247
+ export { AlignToControl, type AlignToControlProps, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, controlStyles, groupAriaChecked, inlineFieldRowLayout, isUnmatched, isWideFormLayout, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
package/dist/index.d.ts CHANGED
@@ -909,6 +909,12 @@ interface DateFieldProps {
909
909
  max?: string;
910
910
  }
911
911
  type DateTimeFieldProps = DateFieldProps;
912
+ interface DateInputProps {
913
+ /** The same props a `DateField` takes; `label` is the accessible name only. */
914
+ fieldProps: DateFieldProps;
915
+ /** The context `Field` hands its render-prop child. */
916
+ context: FieldChildContext;
917
+ }
912
918
 
913
919
  /** A labelled calendar date: takes and emits `YYYY-MM-DD`, empty is `''`. */
914
920
  declare function DateField(props: DateFieldProps): React.ReactElement;
@@ -916,6 +922,9 @@ declare function DateField(props: DateFieldProps): React.ReactElement;
916
922
  /** A labelled local date and time: takes and emits `YYYY-MM-DDTHH:mm`, empty is `''`. */
917
923
  declare function DateTimeField(props: DateTimeFieldProps): React.ReactElement;
918
924
 
925
+ /** A calendar date control with no label row, for a `Field` render-prop child whose caller owns the label. */
926
+ declare function DateInput({ fieldProps, context }: DateInputProps): React.ReactElement;
927
+
919
928
  /**
920
929
  * `AnchoredMenu` — the floating option list shared by `SelectControl` and `TypeaheadControl`.
921
930
  *
@@ -1235,4 +1244,4 @@ interface UploadWithLinkFieldProps {
1235
1244
  /** An image field: preview, an upload control, and a link input revealed on request. */
1236
1245
  declare const UploadWithLinkField: ({ value, onChange, labels, uploadControl, testID, disabled, previewSize, }: UploadWithLinkFieldProps) => React.ReactElement;
1237
1246
 
1238
- export { AlignToControl, type AlignToControlProps, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, controlStyles, groupAriaChecked, inlineFieldRowLayout, isUnmatched, isWideFormLayout, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
1247
+ export { AlignToControl, type AlignToControlProps, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, controlStyles, groupAriaChecked, inlineFieldRowLayout, isUnmatched, isWideFormLayout, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
package/dist/index.js CHANGED
@@ -914,7 +914,6 @@ function useThemedInput(options = {}) {
914
914
  colors.border,
915
915
  colors.surface,
916
916
  colors.surfaceElevated,
917
- colors.background,
918
917
  colors.textSecondary,
919
918
  editable,
920
919
  primary,
@@ -2172,7 +2171,8 @@ function WebDateInput({ fieldProps, context, webInputType }) {
2172
2171
  );
2173
2172
  }
2174
2173
  var IS_WEB7 = reactNative.Platform.OS === "web";
2175
- function renderNativeInput(fieldProps, context) {
2174
+ function TemporalInput({ fieldProps, context, webInputType }) {
2175
+ if (IS_WEB7) return /* @__PURE__ */ jsxRuntime.jsx(WebDateInput, { context, fieldProps, webInputType });
2176
2176
  return /* @__PURE__ */ jsxRuntime.jsx(
2177
2177
  ThemedTextInput,
2178
2178
  {
@@ -2192,7 +2192,7 @@ function renderNativeInput(fieldProps, context) {
2192
2192
  }
2193
2193
  function TemporalField({ fieldProps, webInputType }) {
2194
2194
  const { label, required, hint, error } = fieldProps;
2195
- return /* @__PURE__ */ jsxRuntime.jsx(Field, { error, hint, label, required, children: (context) => IS_WEB7 ? /* @__PURE__ */ jsxRuntime.jsx(WebDateInput, { context, fieldProps, webInputType }) : renderNativeInput(fieldProps, context) });
2195
+ return /* @__PURE__ */ jsxRuntime.jsx(Field, { error, hint, label, required, children: (context) => /* @__PURE__ */ jsxRuntime.jsx(TemporalInput, { context, fieldProps, webInputType }) });
2196
2196
  }
2197
2197
  function DateField(props) {
2198
2198
  return /* @__PURE__ */ jsxRuntime.jsx(TemporalField, { fieldProps: props, webInputType: "date" });
@@ -2236,6 +2236,9 @@ function DateRangeControl({
2236
2236
  function DateTimeField(props) {
2237
2237
  return /* @__PURE__ */ jsxRuntime.jsx(TemporalField, { fieldProps: props, webInputType: "datetime-local" });
2238
2238
  }
2239
+ function DateInput({ fieldProps, context }) {
2240
+ return /* @__PURE__ */ jsxRuntime.jsx(TemporalInput, { context, fieldProps, webInputType: "date" });
2241
+ }
2239
2242
 
2240
2243
  // src/groupSelection/groupSelection.ts
2241
2244
  var NONE = 0;
@@ -2484,6 +2487,7 @@ exports.DEFAULT_OPTIONAL_LABEL = DEFAULT_OPTIONAL_LABEL;
2484
2487
  exports.DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS = DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS;
2485
2488
  exports.DEFAULT_TYPEAHEAD_MIN_CHARS = DEFAULT_TYPEAHEAD_MIN_CHARS;
2486
2489
  exports.DateField = DateField;
2490
+ exports.DateInput = DateInput;
2487
2491
  exports.DateRangeControl = DateRangeControl;
2488
2492
  exports.DateTimeField = DateTimeField;
2489
2493
  exports.Field = Field;