@dloizides/ui-forms 1.29.0 → 1.30.1

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.30.0
4
+
5
+ FINREG-DATE-2 "Every FinReg date field uses the shared input".
6
+
7
+ - `DateRangeControl` renders the shared `DateField` for From and To (DATE-INPUT-1): on web each side is a real `type="date"` input. Props and testIDs unchanged.
8
+ - `DateField` / `DateTimeField` accept an optional `placeholder` (native text input only).
9
+ - New `FormStack`: a vertical form column whose `gap` owns the rhythm, so nested `Field`s drop their bottom margin.
10
+ - New `ResponsiveFormLayout` (`narrow` / `wide` / `breakpoint`, default 768) and `isWideFormLayout`.
11
+
3
12
  ## 1.29.0
4
13
 
5
14
  FINREG-BRAND-1 "Logo without its background and one palette from the logo": error and status TEXT reads `semanticText` when the theme provides it, readable in dark mode. Unchanged without it.
package/dist/index.d.mts CHANGED
@@ -300,6 +300,27 @@ interface InlineFieldRowLayout {
300
300
  /** Field and action share one row only at `inlineMinWidth` and wider; below it they stack. */
301
301
  declare function inlineFieldRowLayout(windowWidth: number, fieldMaxWidth: number, inlineMinWidth?: number): InlineFieldRowLayout;
302
302
 
303
+ interface FormStackProps {
304
+ children: React.ReactNode;
305
+ gap?: number;
306
+ style?: StyleProp<ViewStyle>;
307
+ testID?: string;
308
+ }
309
+ /** A vertical form column whose `gap` owns the rhythm, so the `Field`s inside drop their own bottom margin. */
310
+ declare const FormStack: ({ children, gap, style, testID, }: FormStackProps) => React.ReactElement;
311
+
312
+ interface ResponsiveFormLayoutProps {
313
+ narrow: React.ReactNode;
314
+ wide: React.ReactNode;
315
+ breakpoint?: number;
316
+ }
317
+ /** Renders `wide` when the window reaches `breakpoint`, else `narrow`, so a form switches layout by width. */
318
+ declare function ResponsiveFormLayout({ narrow, wide, breakpoint, }: ResponsiveFormLayoutProps): React.ReactElement;
319
+
320
+ declare const RESPONSIVE_FORM_DEFAULT_BREAKPOINT = 768;
321
+ /** True when `width` reaches `breakpoint`, so the wide layout applies. */
322
+ declare function isWideFormLayout(width: number, breakpoint?: number): boolean;
323
+
303
324
  /**
304
325
  * `FormSection` — a titled group of fields. The React answer to v1's `<fieldset>` / `<legend>`.
305
326
  *
@@ -847,19 +868,6 @@ interface TypeaheadSearchProps extends TypeaheadCommonProps {
847
868
  }
848
869
  declare const TypeaheadControl: React.ForwardRefExoticComponent<((TypeaheadControlProps | TypeaheadSearchProps) & FieldControlWiring) & React.RefAttributes<TextInput>>;
849
870
 
850
- /**
851
- * `DateRangeControl` — an inclusive from/to pair (aml cases `from`/`to`, kefi audit `from`/`to`).
852
- * Each side is a `YYYY-MM-DD` text input; on web the browser's native date UI is offered via
853
- * `type="date"` (a react-native-web `TextInput` passes unknown props to the DOM input). Editing
854
- * either side patches ONLY that side, so the other survives the edit.
855
- *
856
- * Promoted out of `@dloizides/ui-tables`' private `Filters/fields/DateRangeField`, which is why
857
- * the fleet grew FIVE independent date fields.
858
- *
859
- * Label-free by design — the From/To sub-labels name the two HALVES; wrap in a `Field` for the
860
- * range's own label.
861
- */
862
-
863
871
  interface DateRangeControlProps {
864
872
  value: DateRangeValue;
865
873
  onChange: (value: DateRangeValue) => void;
@@ -869,16 +877,19 @@ interface DateRangeControlProps {
869
877
  fromLabel: string;
870
878
  /** PRE-LOCALIZED sub-label for the TO input (e.g. "To"). Also its accessible name. */
871
879
  toLabel: string;
880
+ /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */
872
881
  fromPlaceholder?: string;
882
+ /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */
873
883
  toPlaceholder?: string;
874
- /** PRE-LOCALIZED hint applied to BOTH inputs. */
884
+ /** PRE-LOCALIZED hint applied to BOTH inputs; defaults to `<fromLabel> – <toLabel>`. */
875
885
  accessibilityHint?: string;
876
886
  /** Merged LAST onto the row wrapper. */
877
887
  style?: StyleProp<ViewStyle>;
878
888
  /** Row is `${testID}-range`, inputs `${testID}-from` / `${testID}-to`. */
879
889
  testID: string;
880
890
  }
881
- declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, fromPlaceholder, toPlaceholder, accessibilityHint, style, testID, }: DateRangeControlProps): React.ReactElement;
891
+ /** An inclusive from/to date pair of two shared `DateField`s; each edit patches only its own side. */
892
+ declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, accessibilityHint, style, testID, }: DateRangeControlProps): React.ReactElement;
882
893
 
883
894
  interface DateFieldProps {
884
895
  /** PRE-LOCALIZED label; also the accessible name. */
@@ -1224,4 +1235,4 @@ interface UploadWithLinkFieldProps {
1224
1235
  /** An image field: preview, an upload control, and a link input revealed on request. */
1225
1236
  declare const UploadWithLinkField: ({ value, onChange, labels, uploadControl, testID, disabled, previewSize, }: UploadWithLinkFieldProps) => React.ReactElement;
1226
1237
 
1227
- 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, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, type RecentValues, 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, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
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 };
package/dist/index.d.ts CHANGED
@@ -300,6 +300,27 @@ interface InlineFieldRowLayout {
300
300
  /** Field and action share one row only at `inlineMinWidth` and wider; below it they stack. */
301
301
  declare function inlineFieldRowLayout(windowWidth: number, fieldMaxWidth: number, inlineMinWidth?: number): InlineFieldRowLayout;
302
302
 
303
+ interface FormStackProps {
304
+ children: React.ReactNode;
305
+ gap?: number;
306
+ style?: StyleProp<ViewStyle>;
307
+ testID?: string;
308
+ }
309
+ /** A vertical form column whose `gap` owns the rhythm, so the `Field`s inside drop their own bottom margin. */
310
+ declare const FormStack: ({ children, gap, style, testID, }: FormStackProps) => React.ReactElement;
311
+
312
+ interface ResponsiveFormLayoutProps {
313
+ narrow: React.ReactNode;
314
+ wide: React.ReactNode;
315
+ breakpoint?: number;
316
+ }
317
+ /** Renders `wide` when the window reaches `breakpoint`, else `narrow`, so a form switches layout by width. */
318
+ declare function ResponsiveFormLayout({ narrow, wide, breakpoint, }: ResponsiveFormLayoutProps): React.ReactElement;
319
+
320
+ declare const RESPONSIVE_FORM_DEFAULT_BREAKPOINT = 768;
321
+ /** True when `width` reaches `breakpoint`, so the wide layout applies. */
322
+ declare function isWideFormLayout(width: number, breakpoint?: number): boolean;
323
+
303
324
  /**
304
325
  * `FormSection` — a titled group of fields. The React answer to v1's `<fieldset>` / `<legend>`.
305
326
  *
@@ -847,19 +868,6 @@ interface TypeaheadSearchProps extends TypeaheadCommonProps {
847
868
  }
848
869
  declare const TypeaheadControl: React.ForwardRefExoticComponent<((TypeaheadControlProps | TypeaheadSearchProps) & FieldControlWiring) & React.RefAttributes<TextInput>>;
849
870
 
850
- /**
851
- * `DateRangeControl` — an inclusive from/to pair (aml cases `from`/`to`, kefi audit `from`/`to`).
852
- * Each side is a `YYYY-MM-DD` text input; on web the browser's native date UI is offered via
853
- * `type="date"` (a react-native-web `TextInput` passes unknown props to the DOM input). Editing
854
- * either side patches ONLY that side, so the other survives the edit.
855
- *
856
- * Promoted out of `@dloizides/ui-tables`' private `Filters/fields/DateRangeField`, which is why
857
- * the fleet grew FIVE independent date fields.
858
- *
859
- * Label-free by design — the From/To sub-labels name the two HALVES; wrap in a `Field` for the
860
- * range's own label.
861
- */
862
-
863
871
  interface DateRangeControlProps {
864
872
  value: DateRangeValue;
865
873
  onChange: (value: DateRangeValue) => void;
@@ -869,16 +877,19 @@ interface DateRangeControlProps {
869
877
  fromLabel: string;
870
878
  /** PRE-LOCALIZED sub-label for the TO input (e.g. "To"). Also its accessible name. */
871
879
  toLabel: string;
880
+ /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */
872
881
  fromPlaceholder?: string;
882
+ /** @deprecated Ignored: a date input shows no typed format hint (DATE-INPUT-1). */
873
883
  toPlaceholder?: string;
874
- /** PRE-LOCALIZED hint applied to BOTH inputs. */
884
+ /** PRE-LOCALIZED hint applied to BOTH inputs; defaults to `<fromLabel> – <toLabel>`. */
875
885
  accessibilityHint?: string;
876
886
  /** Merged LAST onto the row wrapper. */
877
887
  style?: StyleProp<ViewStyle>;
878
888
  /** Row is `${testID}-range`, inputs `${testID}-from` / `${testID}-to`. */
879
889
  testID: string;
880
890
  }
881
- declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, fromPlaceholder, toPlaceholder, accessibilityHint, style, testID, }: DateRangeControlProps): React.ReactElement;
891
+ /** An inclusive from/to date pair of two shared `DateField`s; each edit patches only its own side. */
892
+ declare function DateRangeControl({ value, onChange, onSubmit, fromLabel, toLabel, accessibilityHint, style, testID, }: DateRangeControlProps): React.ReactElement;
882
893
 
883
894
  interface DateFieldProps {
884
895
  /** PRE-LOCALIZED label; also the accessible name. */
@@ -1224,4 +1235,4 @@ interface UploadWithLinkFieldProps {
1224
1235
  /** An image field: preview, an upload control, and a link input revealed on request. */
1225
1236
  declare const UploadWithLinkField: ({ value, onChange, labels, uploadControl, testID, disabled, previewSize, }: UploadWithLinkFieldProps) => React.ReactElement;
1226
1237
 
1227
- 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, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, type RecentValues, 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, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
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 };
package/dist/index.js CHANGED
@@ -363,9 +363,32 @@ var InlineFieldRow = ({
363
363
  /* @__PURE__ */ jsxRuntime.jsx(AlignToControl, { style: styles4.action, children: action })
364
364
  ] });
365
365
  };
366
+ var styles5 = reactNative.StyleSheet.create({
367
+ stack: { flexDirection: "column" }
368
+ });
369
+ var FormStack = ({
370
+ children,
371
+ gap = FORM_GRID_DEFAULT_GAP,
372
+ style,
373
+ testID
374
+ }) => /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles5.stack, { gap }, style], testID, children }) });
375
+
376
+ // src/ResponsiveFormLayout/isWideFormLayout.ts
377
+ var RESPONSIVE_FORM_DEFAULT_BREAKPOINT = 768;
378
+ function isWideFormLayout(width, breakpoint = RESPONSIVE_FORM_DEFAULT_BREAKPOINT) {
379
+ return width >= breakpoint;
380
+ }
381
+ function ResponsiveFormLayout({
382
+ narrow,
383
+ wide,
384
+ breakpoint = RESPONSIVE_FORM_DEFAULT_BREAKPOINT
385
+ }) {
386
+ const { width } = reactNative.useWindowDimensions();
387
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isWideFormLayout(width, breakpoint) ? wide : narrow });
388
+ }
366
389
  var SECTION_GAP = 10;
367
390
  var DESCRIPTION_FONT_SIZE = 12;
368
- var styles5 = reactNative.StyleSheet.create({
391
+ var styles6 = reactNative.StyleSheet.create({
369
392
  section: {
370
393
  gap: SECTION_GAP
371
394
  },
@@ -400,7 +423,7 @@ var FormSection = ({
400
423
  // The section spaces its children with `gap`, so it owns their vertical rhythm exactly as a
401
424
  // `FormGrid` owns a row's — without this a `Field` placed directly in a section would stack its
402
425
  // 16px margin on the section's gap and recreate the F3 bug one level up.
403
- /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { role: "group", style: [styles5.section, style], testID, ...a11y, children: [
426
+ /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { role: "group", style: [styles6.section, style], testID, ...a11y, children: [
404
427
  hasTitle ? /* @__PURE__ */ jsxRuntime.jsx(
405
428
  reactNative.Text,
406
429
  {
@@ -409,13 +432,13 @@ var FormSection = ({
409
432
  children: title
410
433
  }
411
434
  ) : null,
412
- hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles5.description, { color: colors.textSecondary }], children: description }) : null,
435
+ hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles6.description, { color: colors.textSecondary }], children: description }) : null,
413
436
  children
414
437
  ] }) })
415
438
  );
416
439
  };
417
440
  var ACTIONS_GAP = 12;
418
- var styles6 = reactNative.StyleSheet.create({
441
+ var styles7 = reactNative.StyleSheet.create({
419
442
  container: {
420
443
  flexDirection: "row",
421
444
  justifyContent: "flex-end",
@@ -435,7 +458,7 @@ var FormActions = ({
435
458
  saveTestID = "save-button",
436
459
  cancelTestID = "cancel-button",
437
460
  testID
438
- }) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles6.container, containerStyle], testID, children: [
461
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles7.container, containerStyle], testID, children: [
439
462
  typeof onCancel === "function" ? /* @__PURE__ */ jsxRuntime.jsx(
440
463
  uiButtons.Button,
441
464
  {
@@ -556,7 +579,7 @@ var DETAIL_FONT = 12;
556
579
  var DETAIL_GAP = 12;
557
580
  var STACK_GAP = 2;
558
581
  var DETAIL_BESIDE_MIN_MENU_WIDTH = 400;
559
- var styles7 = reactNative.StyleSheet.create({
582
+ var styles8 = reactNative.StyleSheet.create({
560
583
  beside: { alignItems: "baseline", flexDirection: "row", gap: DETAIL_GAP, justifyContent: "space-between" },
561
584
  stacked: { gap: STACK_GAP },
562
585
  shrink: { flexShrink: 1 },
@@ -591,9 +614,9 @@ function OptionRow({ option, isActive, isHighlighted, isListboxRow, menuWidth, h
591
614
  onPress: () => onSelect(option.value),
592
615
  style: [controlStyles.option, isHighlighted ? { backgroundColor: colors.text } : null],
593
616
  testID: `${testID}-option-${option.value}`,
594
- children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: isDetailBesideTitle(menuWidth) ? styles7.beside : styles7.stacked, children: [
595
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [controlStyles.optionText, styles7.shrink, { color: ink.title, fontWeight: isBold ? ACTIVE_WEIGHT : IDLE_WEIGHT }], children: option.label }),
596
- hasDetail ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles7.detail, { color: ink.detail }], children: option.detail }) : null
617
+ children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: isDetailBesideTitle(menuWidth) ? styles8.beside : styles8.stacked, children: [
618
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [controlStyles.optionText, styles8.shrink, { color: ink.title, fontWeight: isBold ? ACTIVE_WEIGHT : IDLE_WEIGHT }], children: option.label }),
619
+ hasDetail ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.detail, { color: ink.detail }], children: option.detail }) : null
597
620
  ] })
598
621
  }
599
622
  );
@@ -1383,7 +1406,7 @@ function chipIdentity(option, selected, config) {
1383
1406
  ariaChecked: isRadio ? selected : void 0
1384
1407
  };
1385
1408
  }
1386
- var styles8 = reactNative.StyleSheet.create({
1409
+ var styles9 = reactNative.StyleSheet.create({
1387
1410
  chipContainer: {
1388
1411
  flexDirection: "row",
1389
1412
  flexWrap: "wrap",
@@ -1469,7 +1492,7 @@ var ChipSelector = ({
1469
1492
  reactNative.View,
1470
1493
  {
1471
1494
  accessibilityRole: isRadioGroup ? "radiogroup" : void 0,
1472
- style: styles8.chipContainer,
1495
+ style: styles9.chipContainer,
1473
1496
  ...webFieldA11y({ describedById, hasError }),
1474
1497
  ...radio.groupProps,
1475
1498
  children: options.map(renderChip)
@@ -1479,7 +1502,7 @@ var ChipSelector = ({
1479
1502
  );
1480
1503
  };
1481
1504
  var DESCRIPTION_FONT_SIZE2 = 12;
1482
- var styles9 = reactNative.StyleSheet.create({
1505
+ var styles10 = reactNative.StyleSheet.create({
1483
1506
  container: {
1484
1507
  flexDirection: "row",
1485
1508
  justifyContent: "space-between",
@@ -1540,15 +1563,15 @@ var FormSwitch = ({
1540
1563
  accessible: false,
1541
1564
  disabled,
1542
1565
  onPress: toggle,
1543
- style: [styles9.container, containerStyle],
1566
+ style: [styles10.container, containerStyle],
1544
1567
  tabIndex: -1,
1545
1568
  testID: `${testID}-row`,
1546
1569
  children: [
1547
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles9.textColumn, children: [
1548
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.label, themeStyles.label], children: label }),
1549
- hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.description, themeStyles.description], children: description }) : null
1570
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles10.textColumn, children: [
1571
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.label, themeStyles.label], children: label }),
1572
+ hasDescription ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.description, themeStyles.description], children: description }) : null
1550
1573
  ] }),
1551
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style: styles9.switchSlot, testID: `${testID}-hitbox`, children: /* @__PURE__ */ jsxRuntime.jsx(
1574
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style: styles10.switchSlot, testID: `${testID}-hitbox`, children: /* @__PURE__ */ jsxRuntime.jsx(
1552
1575
  reactNative.Switch,
1553
1576
  {
1554
1577
  accessibilityHint: accessibilityHint ?? label,
@@ -1577,7 +1600,7 @@ var DISABLED_OPACITY = 0.5;
1577
1600
  var FOCUS_RING_WIDTH = 2;
1578
1601
  var WEB_NO_DEFAULT_OUTLINE = { outlineStyle: "none" };
1579
1602
  var FOCUS_RING_INSET = -6;
1580
- var styles10 = reactNative.StyleSheet.create({
1603
+ var styles11 = reactNative.StyleSheet.create({
1581
1604
  container: {
1582
1605
  flexDirection: "row",
1583
1606
  alignItems: "flex-start",
@@ -1682,8 +1705,8 @@ var FormCheckbox = ({
1682
1705
  onPress: toggle,
1683
1706
  role: "checkbox",
1684
1707
  style: [
1685
- styles10.container,
1686
- hasHint ? null : styles10.centered,
1708
+ styles11.container,
1709
+ hasHint ? null : styles11.centered,
1687
1710
  containerStyle,
1688
1711
  disabled ? { opacity: DISABLED_OPACITY } : null,
1689
1712
  reactNative.Platform.OS === "web" ? WEB_NO_DEFAULT_OUTLINE : null
@@ -1691,13 +1714,13 @@ var FormCheckbox = ({
1691
1714
  testID,
1692
1715
  ...keyboardProps,
1693
1716
  children: [
1694
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles10.box, value ? themeStyles.boxOn : themeStyles.boxOff], testID: `${testID}-box`, children: [
1695
- focused ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style: [styles10.focusRing, themeStyles.ring], testID: `${testID}-focus-ring` }) : null,
1696
- value ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.check, { color: colors.surface }], accessibilityElementsHidden: true, children: "\u2713" }) : null
1717
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles11.box, value ? themeStyles.boxOn : themeStyles.boxOff], testID: `${testID}-box`, children: [
1718
+ focused ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style: [styles11.focusRing, themeStyles.ring], testID: `${testID}-focus-ring` }) : null,
1719
+ value ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.check, { color: colors.surface }], accessibilityElementsHidden: true, children: "\u2713" }) : null
1697
1720
  ] }),
1698
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles10.textColumn, children: [
1699
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.label, themeStyles.label], children: label }),
1700
- hasHint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { nativeID: hintId, style: [styles10.hint, themeStyles.hint], children: hintText }) : null
1721
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles11.textColumn, children: [
1722
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.label, themeStyles.label], children: label }),
1723
+ hasHint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { nativeID: hintId, style: [styles11.hint, themeStyles.hint], children: hintText }) : null
1701
1724
  ] })
1702
1725
  ]
1703
1726
  }
@@ -2097,78 +2120,6 @@ function TypeaheadControlImpl(props, ref) {
2097
2120
  ] });
2098
2121
  }
2099
2122
  var TypeaheadControl = React2.forwardRef(TypeaheadControlImpl);
2100
- var WEB_DATE_PROPS = typeof document !== "undefined" ? { type: "date" } : {};
2101
- function DateInput(p) {
2102
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: controlStyles.dateCol, children: [
2103
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [controlStyles.subLabel, { color: p.muted }], children: p.label }),
2104
- /* @__PURE__ */ jsxRuntime.jsx(
2105
- reactNative.TextInput,
2106
- {
2107
- accessibilityLabel: p.label,
2108
- accessibilityHint: p.hint,
2109
- placeholder: p.placeholder,
2110
- placeholderTextColor: p.muted,
2111
- value: p.value,
2112
- onChangeText: p.onChangeText,
2113
- onSubmitEditing: p.onSubmit,
2114
- style: [controlStyles.input, { borderColor: p.border, backgroundColor: p.surface, color: p.color }],
2115
- testID: `${p.testID}-${p.side}`,
2116
- ...WEB_DATE_PROPS
2117
- }
2118
- )
2119
- ] });
2120
- }
2121
- function DateRangeControl({
2122
- value,
2123
- onChange,
2124
- onSubmit,
2125
- fromLabel,
2126
- toLabel,
2127
- fromPlaceholder,
2128
- toPlaceholder,
2129
- accessibilityHint,
2130
- style,
2131
- testID
2132
- }) {
2133
- const { theme } = uiFeedback.useUi();
2134
- const { colors } = theme;
2135
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [controlStyles.dateRow, style], testID: `${testID}-range`, children: [
2136
- /* @__PURE__ */ jsxRuntime.jsx(
2137
- DateInput,
2138
- {
2139
- side: "from",
2140
- label: fromLabel,
2141
- placeholder: fromPlaceholder,
2142
- value: value.from,
2143
- color: colors.text,
2144
- border: colors.border,
2145
- surface: colors.surface,
2146
- muted: colors.textSecondary,
2147
- hint: accessibilityHint,
2148
- testID,
2149
- onChangeText: (from) => onChange({ from, to: value.to }),
2150
- onSubmit
2151
- }
2152
- ),
2153
- /* @__PURE__ */ jsxRuntime.jsx(
2154
- DateInput,
2155
- {
2156
- side: "to",
2157
- label: toLabel,
2158
- placeholder: toPlaceholder,
2159
- value: value.to,
2160
- color: colors.text,
2161
- border: colors.border,
2162
- surface: colors.surface,
2163
- muted: colors.textSecondary,
2164
- hint: accessibilityHint,
2165
- testID,
2166
- onChangeText: (to) => onChange({ from: value.from, to }),
2167
- onSubmit
2168
- }
2169
- )
2170
- ] });
2171
- }
2172
2123
  var NATIVE_INPUT_BOX = {
2173
2124
  borderStyle: "solid",
2174
2125
  boxSizing: "border-box",
@@ -2246,6 +2197,42 @@ function TemporalField({ fieldProps, webInputType }) {
2246
2197
  function DateField(props) {
2247
2198
  return /* @__PURE__ */ jsxRuntime.jsx(TemporalField, { fieldProps: props, webInputType: "date" });
2248
2199
  }
2200
+ function DateRangeControl({
2201
+ value,
2202
+ onChange,
2203
+ onSubmit,
2204
+ fromLabel,
2205
+ toLabel,
2206
+ accessibilityHint,
2207
+ style,
2208
+ testID
2209
+ }) {
2210
+ const hint = accessibilityHint ?? `${fromLabel} \u2013 ${toLabel}`;
2211
+ return /* @__PURE__ */ jsxRuntime.jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [controlStyles.dateRow, style], testID: `${testID}-range`, children: [
2212
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: controlStyles.dateCol, children: /* @__PURE__ */ jsxRuntime.jsx(
2213
+ DateField,
2214
+ {
2215
+ accessibilityHint: hint,
2216
+ label: fromLabel,
2217
+ testID: `${testID}-from`,
2218
+ value: value.from,
2219
+ onChange: (from) => onChange({ from, to: value.to }),
2220
+ onSubmit
2221
+ }
2222
+ ) }),
2223
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: controlStyles.dateCol, children: /* @__PURE__ */ jsxRuntime.jsx(
2224
+ DateField,
2225
+ {
2226
+ accessibilityHint: hint,
2227
+ label: toLabel,
2228
+ testID: `${testID}-to`,
2229
+ value: value.to,
2230
+ onChange: (to) => onChange({ from: value.from, to }),
2231
+ onSubmit
2232
+ }
2233
+ ) })
2234
+ ] }) });
2235
+ }
2249
2236
  function DateTimeField(props) {
2250
2237
  return /* @__PURE__ */ jsxRuntime.jsx(TemporalField, { fieldProps: props, webInputType: "datetime-local" });
2251
2238
  }
@@ -2277,7 +2264,7 @@ var ROW_GAP = 4;
2277
2264
  var TAB_PADDING = 4;
2278
2265
  var INDICATOR_WIDTH = 2;
2279
2266
  var TAB_FONT_SIZE = 12;
2280
- var styles11 = reactNative.StyleSheet.create({
2267
+ var styles12 = reactNative.StyleSheet.create({
2281
2268
  row: { flexDirection: "row", flexWrap: "nowrap", gap: ROW_GAP },
2282
2269
  tab: {
2283
2270
  borderBottomWidth: INDICATOR_WIDTH,
@@ -2317,13 +2304,13 @@ var StepperTab = ({
2317
2304
  accessibilityRole: "tab",
2318
2305
  accessibilityState: { selected },
2319
2306
  "aria-selected": selected,
2320
- style: [styles11.tab, { borderBottomColor: indicator }, ring.ringStyle],
2307
+ style: [styles12.tab, { borderBottomColor: indicator }, ring.ringStyle],
2321
2308
  testID,
2322
2309
  onBlur: ring.onBlur,
2323
2310
  onFocus: ring.onFocus,
2324
2311
  onPress: () => onStep(step.key),
2325
2312
  ...webKeyProps,
2326
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.text, { color: theme.colors.text }, selected ? styles11.textSelected : void 0], children: step.label })
2313
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles12.text, { color: theme.colors.text }, selected ? styles12.textSelected : void 0], children: step.label })
2327
2314
  }
2328
2315
  );
2329
2316
  };
@@ -2333,7 +2320,7 @@ var StepperTabs = ({
2333
2320
  onStep,
2334
2321
  stepHint,
2335
2322
  testID
2336
- }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityRole: "tablist", style: styles11.row, testID, children: steps.map((step) => /* @__PURE__ */ jsxRuntime.jsx(
2323
+ }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityRole: "tablist", style: styles12.row, testID, children: steps.map((step) => /* @__PURE__ */ jsxRuntime.jsx(
2337
2324
  StepperTab,
2338
2325
  {
2339
2326
  hint: stepHint,
@@ -2352,7 +2339,7 @@ function resolveStepNeighbours(steps, current) {
2352
2339
  return { previous: steps[index - 1] ?? null, next: steps[index + 1] ?? null };
2353
2340
  }
2354
2341
  var ROW_GAP2 = 8;
2355
- var styles12 = reactNative.StyleSheet.create({
2342
+ var styles13 = reactNative.StyleSheet.create({
2356
2343
  cell: { flex: 1, minWidth: 0 },
2357
2344
  row: { flexDirection: "row", gap: ROW_GAP2 }
2358
2345
  });
@@ -2364,8 +2351,8 @@ var StepperNav = ({
2364
2351
  testID
2365
2352
  }) => {
2366
2353
  const { previous, next } = resolveStepNeighbours(steps, current);
2367
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles12.row, testID, children: [
2368
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles12.cell, children: /* @__PURE__ */ jsxRuntime.jsx(
2354
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles13.row, testID, children: [
2355
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles13.cell, children: /* @__PURE__ */ jsxRuntime.jsx(
2369
2356
  uiButtons.Button,
2370
2357
  {
2371
2358
  fullWidth: true,
@@ -2381,7 +2368,7 @@ var StepperNav = ({
2381
2368
  }
2382
2369
  }
2383
2370
  ) }),
2384
- next === null ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles12.cell, children: /* @__PURE__ */ jsxRuntime.jsx(
2371
+ next === null ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles13.cell, children: /* @__PURE__ */ jsxRuntime.jsx(
2385
2372
  uiButtons.Button,
2386
2373
  {
2387
2374
  fullWidth: true,
@@ -2396,13 +2383,13 @@ var StepperNav = ({
2396
2383
  ] });
2397
2384
  };
2398
2385
  var STATUS_FONT = 16;
2399
- var styles13 = reactNative.StyleSheet.create({
2386
+ var styles14 = reactNative.StyleSheet.create({
2400
2387
  line: { fontSize: STATUS_FONT }
2401
2388
  });
2402
2389
  function FormStatusLine({ message, testID, style }) {
2403
2390
  const { theme } = uiFeedback.useUi();
2404
2391
  if (message === null || message === void 0 || message === "") return null;
2405
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [styles13.line, { color: theme.colors.text }, style], testID, children: message });
2392
+ return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { role: "alert", style: [styles14.line, { color: theme.colors.text }, style], testID, children: message });
2406
2393
  }
2407
2394
  function useFocusFirstInvalid(refs) {
2408
2395
  const latest = React2.useRef(refs);
@@ -2429,7 +2416,7 @@ var PREVIEW_RADIUS = 8;
2429
2416
  var GAP = 8;
2430
2417
  var TITLE_FONT_SIZE = 14;
2431
2418
  var HELP_FONT_SIZE = 13;
2432
- var styles14 = reactNative.StyleSheet.create({
2419
+ var styles15 = reactNative.StyleSheet.create({
2433
2420
  help: { flex: 1, fontSize: HELP_FONT_SIZE },
2434
2421
  root: { gap: GAP },
2435
2422
  tile: { alignItems: "center", flexDirection: "row", gap: GAP },
@@ -2451,11 +2438,11 @@ var UploadWithLinkField = ({
2451
2438
  const url = value ?? "";
2452
2439
  const [pasting, setPasting] = React2.useState(url !== "");
2453
2440
  const previewBox = { borderRadius: PREVIEW_RADIUS, height: previewSize, width: previewSize };
2454
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.root, children: [
2455
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.title, { color: theme.colors.text }], children: labels.title }),
2456
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles14.tile, children: [
2441
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.root, children: [
2442
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.title, { color: theme.colors.text }], children: labels.title }),
2443
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles15.tile, children: [
2457
2444
  url === "" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [previewBox, { backgroundColor: theme.colors.border }] }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Image, { accessible: false, source: { uri: url }, style: previewBox, testID: `${testID}-preview` }),
2458
- labels.help === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.help, { color: theme.colors.text }], children: labels.help })
2445
+ labels.help === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.help, { color: theme.colors.text }], children: labels.help })
2459
2446
  ] }),
2460
2447
  uploadControl,
2461
2448
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2466,12 +2453,12 @@ var UploadWithLinkField = ({
2466
2453
  accessibilityRole: "button",
2467
2454
  accessibilityState: { expanded: pasting },
2468
2455
  "aria-expanded": pasting,
2469
- style: [styles14.toggle, ring.ringStyle],
2456
+ style: [styles15.toggle, ring.ringStyle],
2470
2457
  testID: `${testID}-paste`,
2471
2458
  onBlur: ring.onBlur,
2472
2459
  onFocus: ring.onFocus,
2473
2460
  onPress: () => setPasting(!pasting),
2474
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles14.toggleText, { color: theme.colors.text }], children: labels.pasteToggle })
2461
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles15.toggleText, { color: theme.colors.text }], children: labels.pasteToggle })
2475
2462
  }
2476
2463
  ),
2477
2464
  pasting ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -2506,10 +2493,13 @@ exports.FormCheckbox = FormCheckbox;
2506
2493
  exports.FormField = FormField;
2507
2494
  exports.FormGrid = FormGrid;
2508
2495
  exports.FormSection = FormSection;
2496
+ exports.FormStack = FormStack;
2509
2497
  exports.FormStatusLine = FormStatusLine;
2510
2498
  exports.FormSwitch = FormSwitch;
2511
2499
  exports.INLINE_FIELD_ROW_MIN_WIDTH = INLINE_FIELD_ROW_MIN_WIDTH;
2512
2500
  exports.InlineFieldRow = InlineFieldRow;
2501
+ exports.RESPONSIVE_FORM_DEFAULT_BREAKPOINT = RESPONSIVE_FORM_DEFAULT_BREAKPOINT;
2502
+ exports.ResponsiveFormLayout = ResponsiveFormLayout;
2513
2503
  exports.SelectControl = SelectControl;
2514
2504
  exports.SelectField = SelectField;
2515
2505
  exports.StepperNav = StepperNav;
@@ -2521,6 +2511,7 @@ exports.controlStyles = controlStyles;
2521
2511
  exports.groupAriaChecked = groupAriaChecked;
2522
2512
  exports.inlineFieldRowLayout = inlineFieldRowLayout;
2523
2513
  exports.isUnmatched = isUnmatched;
2514
+ exports.isWideFormLayout = isWideFormLayout;
2524
2515
  exports.nextHighlight = nextHighlight;
2525
2516
  exports.resolveGroupSelection = resolveGroupSelection;
2526
2517
  exports.resolveStepNeighbours = resolveStepNeighbours;