@platned/ui 1.1.1 → 1.1.2

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/blocks.d.cts CHANGED
@@ -1075,14 +1075,32 @@ type FormResult = {
1075
1075
  };
1076
1076
  /** Field messages by name (or `list.0.item` path). `undefined` means "no message". Client-side only. */
1077
1077
  type FormErrors = Record<string, string | undefined>;
1078
- /** `large` spans both columns of the `grid` layout. Ignored by `stack` and `inline`. */
1078
+ /** `large` spans two columns of the `grid` and `sections` layouts. Ignored by `stack` and `inline`. */
1079
1079
  type FormFieldSize = 'medium' | 'large';
1080
1080
  /**
1081
1081
  * `grid`: two columns from `sm` up, grouped into sections (record forms).
1082
+ * `sections`: each section a card with its title and description, and a section nav beside them that stays in view
1083
+ * (a long record form, or a record's new and edit pages, laid out like its RecordPage with `nav`). New in 1.1.2.
1082
1084
  * `stack`: one column (sign-in and other narrow forms).
1083
1085
  * `inline`: a wrapping row of controls with no sections (filter toolbars).
1084
1086
  */
1085
- type FormLayout = 'grid' | 'stack' | 'inline';
1087
+ type FormLayout = 'grid' | 'sections' | 'stack' | 'inline';
1088
+ /**
1089
+ * A section's heading, description and columns, by the `section` its fields name. Sections show in the order their
1090
+ * fields first appear.
1091
+ */
1092
+ interface FormSection {
1093
+ /** The `section` its fields name. */
1094
+ title: string;
1095
+ /** A line under the title. */
1096
+ description?: ReactNode;
1097
+ /** The anchor the `sections` layout's nav scrolls to. Default: the title in kebab case. */
1098
+ id?: string;
1099
+ /** An icon before the title in the section nav. */
1100
+ icon?: ReactNode;
1101
+ /** Columns from `sm` (`3`: two from `sm`, three from `lg`). Default 2. `sections` layout only. */
1102
+ columns?: 1 | 2 | 3;
1103
+ }
1086
1104
  /** `submit`: on the submit button. `change`: on every change, debounced for typing (filters). */
1087
1105
  type FormSubmitOn = 'submit' | 'change';
1088
1106
  /** What the form reports to `onStateChange` and to an `actions` render function. */
@@ -1245,7 +1263,8 @@ interface FormCheckField<V extends object = FormValues> extends FormFieldBase<V>
1245
1263
  }
1246
1264
  /**
1247
1265
  * Value: an array of rows, each an object holding the row's `fields`. Rows render as a line of
1248
- * controls with a remove button; errors for a row's field use the path `name.index.field`.
1266
+ * controls with a remove button, or as cards (`variant: 'cards'`); errors for a row's field use the
1267
+ * path `name.index.field`.
1249
1268
  */
1250
1269
  interface FormListField<V extends object = FormValues> extends FormFieldBase<V> {
1251
1270
  type: 'list';
@@ -1269,6 +1288,18 @@ interface FormListField<V extends object = FormValues> extends FormFieldBase<V>
1269
1288
  canRemove?: (item: FormValues, index: number) => boolean;
1270
1289
  /** Content above the rows, e.g. column headings. */
1271
1290
  header?: ReactNode;
1291
+ /**
1292
+ * `rows` (default): a line of controls per row, for short rows. `cards`: each row a card with an icon, a title and a
1293
+ * subtitle, a remove button in its corner and its fields in a grid below, for rows like contacts or addresses.
1294
+ * New in 1.1.2.
1295
+ */
1296
+ variant?: 'rows' | 'cards';
1297
+ /** With `cards`: a row's title. Default "<label> <n>". */
1298
+ itemTitle?: (item: FormValues, index: number) => ReactNode;
1299
+ /** With `cards`: a muted line under a row's title. */
1300
+ itemDescription?: (item: FormValues, index: number) => ReactNode;
1301
+ /** With `cards`: an icon in a round tile before a row's title. */
1302
+ itemIcon?: ReactNode | ((item: FormValues, index: number) => ReactNode);
1272
1303
  /** Shown when there are no rows. */
1273
1304
  empty?: ReactNode;
1274
1305
  }
@@ -1466,6 +1497,16 @@ interface FormProps<V extends object = FormValues> extends Omit<FormHTMLAttribut
1466
1497
  validateOn?: 'blur' | 'submit';
1467
1498
  /** Default `grid`. */
1468
1499
  layout?: FormLayout;
1500
+ /**
1501
+ * Descriptions, anchors and columns for the sections the fields name, matched by title. The `sections` layout shows
1502
+ * them in its cards and nav; `grid` shows the descriptions under the headings. New in 1.1.2.
1503
+ */
1504
+ sections?: FormSection[];
1505
+ /**
1506
+ * Content at the top of the form, above the fields: a page header whose buttons save or reset it, say. A function
1507
+ * gets the form's state and `submit`. Pair with `showActions={false}` when it holds the Save button. New in 1.1.2.
1508
+ */
1509
+ header?: ReactNode | ((api: FormActionsApi) => ReactNode);
1469
1510
  /** Default `submit`. `change` submits on every change, with typing debounced. */
1470
1511
  submitOn?: FormSubmitOn;
1471
1512
  /** Debounce for typing with `submitOn="change"`, in ms. Default 300. */
@@ -1517,7 +1558,7 @@ interface FormProps<V extends object = FormValues> extends Omit<FormHTMLAttribut
1517
1558
  * focusable and pressing it shows what is wrong: a disabled look is a signal, not an
1518
1559
  * explanation. Values are held in React state, never read back from the DOM.
1519
1560
  */
1520
- declare function Form<V extends object = FormValues>({ fields: fieldsProp, schema, title, defaultValues, values: valuesProp, onValuesChange, onSubmit, validate, requiredMessage, errors: errorsProp, validateOn, layout, submitOn, debounce, steps, readOnly, disabled, submitLabel, pendingLabel, nextLabel, backLabel, onCancel, cancelLabel, actions, showActions, onStateChange, children, className, noValidate, ...formProps }: FormProps<V>): react.JSX.Element;
1561
+ declare function Form<V extends object = FormValues>({ fields: fieldsProp, schema, title, defaultValues, values: valuesProp, onValuesChange, onSubmit, validate, requiredMessage, errors: errorsProp, validateOn, layout, sections, header, submitOn, debounce, steps, readOnly, disabled, submitLabel, pendingLabel, nextLabel, backLabel, onCancel, cancelLabel, actions, showActions, onStateChange, children, className, noValidate, ...formProps }: FormProps<V>): react.JSX.Element;
1521
1562
 
1522
1563
  interface DependentOptions<T = SelectOption> {
1523
1564
  /** Choices for the parent's current value. Empty while loading, when the parent is empty, or if loading failed. */
@@ -2757,7 +2798,12 @@ interface DetailSection<T = Record<string, unknown>> {
2757
2798
  description?: string;
2758
2799
  /** Buttons in the section header, e.g. Edit. Those with `menu: true` go in a `⋯` menu. */
2759
2800
  actions?: ActionData[];
2760
- fields: DetailField<T>[];
2801
+ /** The labelled values. A section may have none and show only its `footer`, such as a table. */
2802
+ fields?: DetailField<T>[];
2803
+ /** An icon before the title in a RecordPage's section nav, by name from `icons` or as an element. */
2804
+ icon?: IconRef;
2805
+ /** A count after the title in a RecordPage's section nav, e.g. the number of sites. */
2806
+ count?: number;
2761
2807
  /** `grid`: label over value, in columns. `rows`: label beside value. Default `grid`. */
2762
2808
  layout?: 'grid' | 'rows';
2763
2809
  /** Grid columns from the `md` breakpoint. Default 2. */
@@ -2774,6 +2820,11 @@ interface DetailSectionsProps<T = Record<string, unknown>> {
2774
2820
  onAction?: (id: string) => void;
2775
2821
  /** Each section in a card. Default `true`; `false` stacks them with dividers. */
2776
2822
  card?: boolean;
2823
+ /**
2824
+ * Give each section element an id to scroll to: its `id`, else its title in kebab case. RecordPage sets it with
2825
+ * `nav`, for its section nav.
2826
+ */
2827
+ anchors?: boolean;
2777
2828
  /** Placeholder lines while the record loads. */
2778
2829
  loading?: boolean;
2779
2830
  icons?: BlockIcons;
@@ -2781,7 +2832,7 @@ interface DetailSectionsProps<T = Record<string, unknown>> {
2781
2832
  can?: (permission: string) => boolean;
2782
2833
  className?: string;
2783
2834
  }
2784
- declare function DetailSections<T = Record<string, unknown>>({ record, sections, onAction, card, loading, icons, linkComponent: Link, can, className, }: DetailSectionsProps<T>): react.JSX.Element;
2835
+ declare function DetailSections<T = Record<string, unknown>>({ record, sections, onAction, card, anchors, loading, icons, linkComponent: Link, can, className, }: DetailSectionsProps<T>): react.JSX.Element;
2785
2836
 
2786
2837
  /**
2787
2838
  * RecordPage: one record's page from JSON: a header, status banners, tabs with counts, and an
@@ -2849,8 +2900,18 @@ interface RecordPageProps<T = Record<string, unknown>> {
2849
2900
  /** The tab open at first. Default: the first. */
2850
2901
  defaultTab?: string;
2851
2902
  onTabChange?: (key: string) => void;
2852
- /** A side rail beside the tabs from the `lg` breakpoint, under them below it: sections or anything. */
2903
+ /**
2904
+ * A side rail beside the tabs from the `lg` breakpoint, under them below it: sections or anything. With `nav`,
2905
+ * beside the sections from `xl`.
2906
+ */
2853
2907
  aside?: DetailSection<T>[] | ReactNode;
2908
+ /**
2909
+ * A section nav beside the sections, which stays in view while the page scrolls and marks the section in view (a
2910
+ * row of chips above them on phones). Each section gets an anchor: its `id`, else its title in kebab case. Use it
2911
+ * for a record with many sections, and give its new and edit forms `layout="sections"` with the same sections, so
2912
+ * all three views read alike. `true`, or the nav's accessible name. New in 1.1.2.
2913
+ */
2914
+ nav?: boolean | string;
2854
2915
  /** Called with an action's `id` (default its label): header, section and banner actions alike. */
2855
2916
  onAction?: (id: string) => void;
2856
2917
  /** Placeholders while the record loads. */
@@ -2874,7 +2935,54 @@ interface RecordPageProps<T = Record<string, unknown>> {
2874
2935
  can?: (permission: string) => boolean;
2875
2936
  className?: string;
2876
2937
  }
2877
- declare function RecordPage<T = Record<string, unknown>>({ record, header, banners, tabs, sections, tab, defaultTab, onTabChange, aside, onAction, loading, notFound, children, icons, linkComponent: Link, can, className, }: RecordPageProps<T>): react.JSX.Element;
2938
+ declare function RecordPage<T = Record<string, unknown>>({ record, header, banners, tabs, sections, tab, defaultTab, onTabChange, aside, nav, onAction, loading, notFound, children, icons, linkComponent: Link, can, className, }: RecordPageProps<T>): react.JSX.Element;
2939
+
2940
+ /**
2941
+ * SectionNav: a page's sections as a menu that follows the reader. From the `lg` breakpoint it is a
2942
+ * card beside the sections that stays in view while the page scrolls; below it, a row of chips
2943
+ * above them that scrolls sideways. The section in view is marked (scroll-spy), and choosing one
2944
+ * scrolls to it.
2945
+ *
2946
+ * <SectionNavLayout items={[{ id: 'account', label: 'Account' }, { id: 'billing', label: 'Billing' }]}>
2947
+ * <section id="account">…</section>
2948
+ * <section id="billing">…</section>
2949
+ * </SectionNavLayout>
2950
+ *
2951
+ * Each item's `id` is the id of its section element. RecordPage (`nav`) and Form
2952
+ * (`layout="sections"`) build this for you: use these directly for a page of your own.
2953
+ */
2954
+ interface SectionNavItem {
2955
+ /** The id of the section element it scrolls to. */
2956
+ id: string;
2957
+ label: string;
2958
+ icon?: IconRef;
2959
+ /** A count after the label, e.g. the number of sites. */
2960
+ count?: number;
2961
+ }
2962
+ interface SectionNavProps {
2963
+ items: SectionNavItem[];
2964
+ /** The nav's accessible name. Default "Sections". */
2965
+ label?: string;
2966
+ /**
2967
+ * How far below the top of the window a section's top must have scrolled to count as the one
2968
+ * in view, in px: the height of anything fixed above the page, plus some. Default 120.
2969
+ */
2970
+ offset?: number;
2971
+ icons?: BlockIcons;
2972
+ className?: string;
2973
+ }
2974
+ declare function SectionNav({ items, label, offset, icons, className }: SectionNavProps): react.JSX.Element;
2975
+ interface SectionNavLayoutProps extends SectionNavProps {
2976
+ /** The sections, each an element whose `id` is an item's. */
2977
+ children: ReactNode;
2978
+ /** A rail beside the sections from the `xl` breakpoint, under them below it. */
2979
+ aside?: ReactNode;
2980
+ }
2981
+ /**
2982
+ * The SectionNav beside its sections: a two-column grid from `lg` (three with `aside` from `xl`),
2983
+ * the nav above the sections below `lg`.
2984
+ */
2985
+ declare function SectionNavLayout({ children, aside, className, ...nav }: SectionNavLayoutProps): react.JSX.Element;
2878
2986
 
2879
2987
  /**
2880
2988
  * ShortcutsDialog: the keyboard shortcuts of an app, from JSON, in groups.
@@ -3159,4 +3267,4 @@ interface PersonCardsProps<P extends Person = Person> extends PersonViewProps<P>
3159
3267
  }
3160
3268
  declare function PersonCards<P extends Person = Person>({ people, getId, layout, columns, title, description, headerActions, onHeaderAction, emptyText, className, ...view }: PersonCardsProps<P>): react.JSX.Element;
3161
3269
 
3162
- export { type ActionData, AppShell, type AppShellAction, type AppShellChecklistItem, type AppShellGroupAction, type AppShellListItem, type AppShellNavEntry, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, type AppShellSection, type AppShellTreeNode, type AppShellUser, type AppShellWorkspace, type BadgeData, type BlockIcons, type CardBlockAction, type CardBlockProps, ChartCard, type ChartCardProps, type ChartColor, type ChartSegment, type ChartSeries, type ChartView, ConfirmDialog, type ConfirmDialogBlocker, type ConfirmDialogOption, type ConfirmDialogProps, type ConfirmDialogSummaryItem, type ConfirmDialogValues, DASHBOARD_SIZES, Dashboard, type DashboardChartWidget, type DashboardComponents, type DashboardCustomWidget, type DashboardHeatmapWidget, type DashboardHeight, type DashboardLayoutItem, type DashboardMapWidget, type DashboardProps, type DashboardRankedListWidget, type DashboardSize, type DashboardStatWidget, type DashboardTableWidget, type DashboardTier, type DashboardWidget, DashboardWidgetView, type DashboardWidgetViewProps, type DashboardWidth, DataGrid, type DataGridCellState, type DataGridChange, type DataGridColumn, type DataGridNotes, type DataGridOption, type DataGridProps, DataTable, type DataTableColumnDef, DataTableFacetedFilter, type DataTableField, type DataTableProps, type DataTableRowAction, type DependentOptions, type DetailField, type DetailSection, DetailSections, type DetailSectionsProps, type FieldPath, Form, type FormActionsApi, type FormCheckField, type FormComboboxField, type FormCountryField, type FormCustomField, type FormDateField, type FormErrors, type FormField, type FormFieldBase, type FormFieldContext, type FormFieldInput, type FormFieldMap, type FormFieldMapEntry, type FormFieldShort, type FormFieldSize, type FormFieldType, type FormFields, type FormJsonSchema, type FormLayout, type FormListField, type FormOptionInput, type FormProps, type FormRadioField, type FormResult, type FormSchema, type FormSegmentedField, type FormSegmentedOption, type FormSelectField, type FormStandardSchema, type FormState, type FormStep, type FormSubmitOn, type FormTextField, type FormTextType, type FormTextareaField, type FormTimeZoneField, type FormValues, type FormatOptions, FormatProvider, type FormatProviderProps, FullscreenDialog, type FullscreenDialogProps, HEIGHT_ROWS, Heatmap, type HeatmapCell, type HeatmapDay, type HeatmapProps, type IconRef, Kanban, type KanbanAction, type KanbanCardFields, type KanbanChange, type KanbanDrop, type KanbanLane, type KanbanLaneAction, type KanbanPaletteItem, type KanbanProps, type KanbanRequire, type KanbanSwimlanes, ListDetail, type ListDetailItemFields, type ListDetailProps, type MenuItemData, PageHeader, type PageHeaderAvatar, type PageHeaderMeta, type PageHeaderProps, type Person, PersonCard, type PersonCardLayout, type PersonCardProps, PersonCards, type PersonCardsProps, type PersonStat, type Presence, RankedList, type RankedListItem, type RankedListProps, type RecordBanner, RecordPage, type RecordPageProps, type RecordTab, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, type ShortcutData, type ShortcutGroupData, ShortcutsDialog, type ShortcutsDialogProps, type Stat, type StatBreakdownItem, StatCard, type StatCardProps, type StatCardSize, StatCards, type StatCardsProps, type StatPoint, type StatView, TIER_COLUMNS, TableCard, type TableCardProps, Value, type ValueField, type ValueFormat, type ValueProps, type ValueType, chartColor, coerceSize, formatValue, getValueAt, humanize, isEmptyValue, isNumericType, linkAdapter, moveItem, renderValue, resolveIcon, sizeLabel, useDependentOptions, useFormat, widgetSizes, widgetTitle };
3270
+ export { type ActionData, AppShell, type AppShellAction, type AppShellChecklistItem, type AppShellGroupAction, type AppShellListItem, type AppShellNavEntry, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, type AppShellSection, type AppShellTreeNode, type AppShellUser, type AppShellWorkspace, type BadgeData, type BlockIcons, type CardBlockAction, type CardBlockProps, ChartCard, type ChartCardProps, type ChartColor, type ChartSegment, type ChartSeries, type ChartView, ConfirmDialog, type ConfirmDialogBlocker, type ConfirmDialogOption, type ConfirmDialogProps, type ConfirmDialogSummaryItem, type ConfirmDialogValues, DASHBOARD_SIZES, Dashboard, type DashboardChartWidget, type DashboardComponents, type DashboardCustomWidget, type DashboardHeatmapWidget, type DashboardHeight, type DashboardLayoutItem, type DashboardMapWidget, type DashboardProps, type DashboardRankedListWidget, type DashboardSize, type DashboardStatWidget, type DashboardTableWidget, type DashboardTier, type DashboardWidget, DashboardWidgetView, type DashboardWidgetViewProps, type DashboardWidth, DataGrid, type DataGridCellState, type DataGridChange, type DataGridColumn, type DataGridNotes, type DataGridOption, type DataGridProps, DataTable, type DataTableColumnDef, DataTableFacetedFilter, type DataTableField, type DataTableProps, type DataTableRowAction, type DependentOptions, type DetailField, type DetailSection, DetailSections, type DetailSectionsProps, type FieldPath, Form, type FormActionsApi, type FormCheckField, type FormComboboxField, type FormCountryField, type FormCustomField, type FormDateField, type FormErrors, type FormField, type FormFieldBase, type FormFieldContext, type FormFieldInput, type FormFieldMap, type FormFieldMapEntry, type FormFieldShort, type FormFieldSize, type FormFieldType, type FormFields, type FormJsonSchema, type FormLayout, type FormListField, type FormOptionInput, type FormProps, type FormRadioField, type FormResult, type FormSchema, type FormSection, type FormSegmentedField, type FormSegmentedOption, type FormSelectField, type FormStandardSchema, type FormState, type FormStep, type FormSubmitOn, type FormTextField, type FormTextType, type FormTextareaField, type FormTimeZoneField, type FormValues, type FormatOptions, FormatProvider, type FormatProviderProps, FullscreenDialog, type FullscreenDialogProps, HEIGHT_ROWS, Heatmap, type HeatmapCell, type HeatmapDay, type HeatmapProps, type IconRef, Kanban, type KanbanAction, type KanbanCardFields, type KanbanChange, type KanbanDrop, type KanbanLane, type KanbanLaneAction, type KanbanPaletteItem, type KanbanProps, type KanbanRequire, type KanbanSwimlanes, ListDetail, type ListDetailItemFields, type ListDetailProps, type MenuItemData, PageHeader, type PageHeaderAvatar, type PageHeaderMeta, type PageHeaderProps, type Person, PersonCard, type PersonCardLayout, type PersonCardProps, PersonCards, type PersonCardsProps, type PersonStat, type Presence, RankedList, type RankedListItem, type RankedListProps, type RecordBanner, RecordPage, type RecordPageProps, type RecordTab, SectionNav, type SectionNavItem, SectionNavLayout, type SectionNavLayoutProps, type SectionNavProps, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, type ShortcutData, type ShortcutGroupData, ShortcutsDialog, type ShortcutsDialogProps, type Stat, type StatBreakdownItem, StatCard, type StatCardProps, type StatCardSize, StatCards, type StatCardsProps, type StatPoint, type StatView, TIER_COLUMNS, TableCard, type TableCardProps, Value, type ValueField, type ValueFormat, type ValueProps, type ValueType, chartColor, coerceSize, formatValue, getValueAt, humanize, isEmptyValue, isNumericType, linkAdapter, moveItem, renderValue, resolveIcon, sizeLabel, useDependentOptions, useFormat, widgetSizes, widgetTitle };
package/dist/blocks.d.ts CHANGED
@@ -1075,14 +1075,32 @@ type FormResult = {
1075
1075
  };
1076
1076
  /** Field messages by name (or `list.0.item` path). `undefined` means "no message". Client-side only. */
1077
1077
  type FormErrors = Record<string, string | undefined>;
1078
- /** `large` spans both columns of the `grid` layout. Ignored by `stack` and `inline`. */
1078
+ /** `large` spans two columns of the `grid` and `sections` layouts. Ignored by `stack` and `inline`. */
1079
1079
  type FormFieldSize = 'medium' | 'large';
1080
1080
  /**
1081
1081
  * `grid`: two columns from `sm` up, grouped into sections (record forms).
1082
+ * `sections`: each section a card with its title and description, and a section nav beside them that stays in view
1083
+ * (a long record form, or a record's new and edit pages, laid out like its RecordPage with `nav`). New in 1.1.2.
1082
1084
  * `stack`: one column (sign-in and other narrow forms).
1083
1085
  * `inline`: a wrapping row of controls with no sections (filter toolbars).
1084
1086
  */
1085
- type FormLayout = 'grid' | 'stack' | 'inline';
1087
+ type FormLayout = 'grid' | 'sections' | 'stack' | 'inline';
1088
+ /**
1089
+ * A section's heading, description and columns, by the `section` its fields name. Sections show in the order their
1090
+ * fields first appear.
1091
+ */
1092
+ interface FormSection {
1093
+ /** The `section` its fields name. */
1094
+ title: string;
1095
+ /** A line under the title. */
1096
+ description?: ReactNode;
1097
+ /** The anchor the `sections` layout's nav scrolls to. Default: the title in kebab case. */
1098
+ id?: string;
1099
+ /** An icon before the title in the section nav. */
1100
+ icon?: ReactNode;
1101
+ /** Columns from `sm` (`3`: two from `sm`, three from `lg`). Default 2. `sections` layout only. */
1102
+ columns?: 1 | 2 | 3;
1103
+ }
1086
1104
  /** `submit`: on the submit button. `change`: on every change, debounced for typing (filters). */
1087
1105
  type FormSubmitOn = 'submit' | 'change';
1088
1106
  /** What the form reports to `onStateChange` and to an `actions` render function. */
@@ -1245,7 +1263,8 @@ interface FormCheckField<V extends object = FormValues> extends FormFieldBase<V>
1245
1263
  }
1246
1264
  /**
1247
1265
  * Value: an array of rows, each an object holding the row's `fields`. Rows render as a line of
1248
- * controls with a remove button; errors for a row's field use the path `name.index.field`.
1266
+ * controls with a remove button, or as cards (`variant: 'cards'`); errors for a row's field use the
1267
+ * path `name.index.field`.
1249
1268
  */
1250
1269
  interface FormListField<V extends object = FormValues> extends FormFieldBase<V> {
1251
1270
  type: 'list';
@@ -1269,6 +1288,18 @@ interface FormListField<V extends object = FormValues> extends FormFieldBase<V>
1269
1288
  canRemove?: (item: FormValues, index: number) => boolean;
1270
1289
  /** Content above the rows, e.g. column headings. */
1271
1290
  header?: ReactNode;
1291
+ /**
1292
+ * `rows` (default): a line of controls per row, for short rows. `cards`: each row a card with an icon, a title and a
1293
+ * subtitle, a remove button in its corner and its fields in a grid below, for rows like contacts or addresses.
1294
+ * New in 1.1.2.
1295
+ */
1296
+ variant?: 'rows' | 'cards';
1297
+ /** With `cards`: a row's title. Default "<label> <n>". */
1298
+ itemTitle?: (item: FormValues, index: number) => ReactNode;
1299
+ /** With `cards`: a muted line under a row's title. */
1300
+ itemDescription?: (item: FormValues, index: number) => ReactNode;
1301
+ /** With `cards`: an icon in a round tile before a row's title. */
1302
+ itemIcon?: ReactNode | ((item: FormValues, index: number) => ReactNode);
1272
1303
  /** Shown when there are no rows. */
1273
1304
  empty?: ReactNode;
1274
1305
  }
@@ -1466,6 +1497,16 @@ interface FormProps<V extends object = FormValues> extends Omit<FormHTMLAttribut
1466
1497
  validateOn?: 'blur' | 'submit';
1467
1498
  /** Default `grid`. */
1468
1499
  layout?: FormLayout;
1500
+ /**
1501
+ * Descriptions, anchors and columns for the sections the fields name, matched by title. The `sections` layout shows
1502
+ * them in its cards and nav; `grid` shows the descriptions under the headings. New in 1.1.2.
1503
+ */
1504
+ sections?: FormSection[];
1505
+ /**
1506
+ * Content at the top of the form, above the fields: a page header whose buttons save or reset it, say. A function
1507
+ * gets the form's state and `submit`. Pair with `showActions={false}` when it holds the Save button. New in 1.1.2.
1508
+ */
1509
+ header?: ReactNode | ((api: FormActionsApi) => ReactNode);
1469
1510
  /** Default `submit`. `change` submits on every change, with typing debounced. */
1470
1511
  submitOn?: FormSubmitOn;
1471
1512
  /** Debounce for typing with `submitOn="change"`, in ms. Default 300. */
@@ -1517,7 +1558,7 @@ interface FormProps<V extends object = FormValues> extends Omit<FormHTMLAttribut
1517
1558
  * focusable and pressing it shows what is wrong: a disabled look is a signal, not an
1518
1559
  * explanation. Values are held in React state, never read back from the DOM.
1519
1560
  */
1520
- declare function Form<V extends object = FormValues>({ fields: fieldsProp, schema, title, defaultValues, values: valuesProp, onValuesChange, onSubmit, validate, requiredMessage, errors: errorsProp, validateOn, layout, submitOn, debounce, steps, readOnly, disabled, submitLabel, pendingLabel, nextLabel, backLabel, onCancel, cancelLabel, actions, showActions, onStateChange, children, className, noValidate, ...formProps }: FormProps<V>): react.JSX.Element;
1561
+ declare function Form<V extends object = FormValues>({ fields: fieldsProp, schema, title, defaultValues, values: valuesProp, onValuesChange, onSubmit, validate, requiredMessage, errors: errorsProp, validateOn, layout, sections, header, submitOn, debounce, steps, readOnly, disabled, submitLabel, pendingLabel, nextLabel, backLabel, onCancel, cancelLabel, actions, showActions, onStateChange, children, className, noValidate, ...formProps }: FormProps<V>): react.JSX.Element;
1521
1562
 
1522
1563
  interface DependentOptions<T = SelectOption> {
1523
1564
  /** Choices for the parent's current value. Empty while loading, when the parent is empty, or if loading failed. */
@@ -2757,7 +2798,12 @@ interface DetailSection<T = Record<string, unknown>> {
2757
2798
  description?: string;
2758
2799
  /** Buttons in the section header, e.g. Edit. Those with `menu: true` go in a `⋯` menu. */
2759
2800
  actions?: ActionData[];
2760
- fields: DetailField<T>[];
2801
+ /** The labelled values. A section may have none and show only its `footer`, such as a table. */
2802
+ fields?: DetailField<T>[];
2803
+ /** An icon before the title in a RecordPage's section nav, by name from `icons` or as an element. */
2804
+ icon?: IconRef;
2805
+ /** A count after the title in a RecordPage's section nav, e.g. the number of sites. */
2806
+ count?: number;
2761
2807
  /** `grid`: label over value, in columns. `rows`: label beside value. Default `grid`. */
2762
2808
  layout?: 'grid' | 'rows';
2763
2809
  /** Grid columns from the `md` breakpoint. Default 2. */
@@ -2774,6 +2820,11 @@ interface DetailSectionsProps<T = Record<string, unknown>> {
2774
2820
  onAction?: (id: string) => void;
2775
2821
  /** Each section in a card. Default `true`; `false` stacks them with dividers. */
2776
2822
  card?: boolean;
2823
+ /**
2824
+ * Give each section element an id to scroll to: its `id`, else its title in kebab case. RecordPage sets it with
2825
+ * `nav`, for its section nav.
2826
+ */
2827
+ anchors?: boolean;
2777
2828
  /** Placeholder lines while the record loads. */
2778
2829
  loading?: boolean;
2779
2830
  icons?: BlockIcons;
@@ -2781,7 +2832,7 @@ interface DetailSectionsProps<T = Record<string, unknown>> {
2781
2832
  can?: (permission: string) => boolean;
2782
2833
  className?: string;
2783
2834
  }
2784
- declare function DetailSections<T = Record<string, unknown>>({ record, sections, onAction, card, loading, icons, linkComponent: Link, can, className, }: DetailSectionsProps<T>): react.JSX.Element;
2835
+ declare function DetailSections<T = Record<string, unknown>>({ record, sections, onAction, card, anchors, loading, icons, linkComponent: Link, can, className, }: DetailSectionsProps<T>): react.JSX.Element;
2785
2836
 
2786
2837
  /**
2787
2838
  * RecordPage: one record's page from JSON: a header, status banners, tabs with counts, and an
@@ -2849,8 +2900,18 @@ interface RecordPageProps<T = Record<string, unknown>> {
2849
2900
  /** The tab open at first. Default: the first. */
2850
2901
  defaultTab?: string;
2851
2902
  onTabChange?: (key: string) => void;
2852
- /** A side rail beside the tabs from the `lg` breakpoint, under them below it: sections or anything. */
2903
+ /**
2904
+ * A side rail beside the tabs from the `lg` breakpoint, under them below it: sections or anything. With `nav`,
2905
+ * beside the sections from `xl`.
2906
+ */
2853
2907
  aside?: DetailSection<T>[] | ReactNode;
2908
+ /**
2909
+ * A section nav beside the sections, which stays in view while the page scrolls and marks the section in view (a
2910
+ * row of chips above them on phones). Each section gets an anchor: its `id`, else its title in kebab case. Use it
2911
+ * for a record with many sections, and give its new and edit forms `layout="sections"` with the same sections, so
2912
+ * all three views read alike. `true`, or the nav's accessible name. New in 1.1.2.
2913
+ */
2914
+ nav?: boolean | string;
2854
2915
  /** Called with an action's `id` (default its label): header, section and banner actions alike. */
2855
2916
  onAction?: (id: string) => void;
2856
2917
  /** Placeholders while the record loads. */
@@ -2874,7 +2935,54 @@ interface RecordPageProps<T = Record<string, unknown>> {
2874
2935
  can?: (permission: string) => boolean;
2875
2936
  className?: string;
2876
2937
  }
2877
- declare function RecordPage<T = Record<string, unknown>>({ record, header, banners, tabs, sections, tab, defaultTab, onTabChange, aside, onAction, loading, notFound, children, icons, linkComponent: Link, can, className, }: RecordPageProps<T>): react.JSX.Element;
2938
+ declare function RecordPage<T = Record<string, unknown>>({ record, header, banners, tabs, sections, tab, defaultTab, onTabChange, aside, nav, onAction, loading, notFound, children, icons, linkComponent: Link, can, className, }: RecordPageProps<T>): react.JSX.Element;
2939
+
2940
+ /**
2941
+ * SectionNav: a page's sections as a menu that follows the reader. From the `lg` breakpoint it is a
2942
+ * card beside the sections that stays in view while the page scrolls; below it, a row of chips
2943
+ * above them that scrolls sideways. The section in view is marked (scroll-spy), and choosing one
2944
+ * scrolls to it.
2945
+ *
2946
+ * <SectionNavLayout items={[{ id: 'account', label: 'Account' }, { id: 'billing', label: 'Billing' }]}>
2947
+ * <section id="account">…</section>
2948
+ * <section id="billing">…</section>
2949
+ * </SectionNavLayout>
2950
+ *
2951
+ * Each item's `id` is the id of its section element. RecordPage (`nav`) and Form
2952
+ * (`layout="sections"`) build this for you: use these directly for a page of your own.
2953
+ */
2954
+ interface SectionNavItem {
2955
+ /** The id of the section element it scrolls to. */
2956
+ id: string;
2957
+ label: string;
2958
+ icon?: IconRef;
2959
+ /** A count after the label, e.g. the number of sites. */
2960
+ count?: number;
2961
+ }
2962
+ interface SectionNavProps {
2963
+ items: SectionNavItem[];
2964
+ /** The nav's accessible name. Default "Sections". */
2965
+ label?: string;
2966
+ /**
2967
+ * How far below the top of the window a section's top must have scrolled to count as the one
2968
+ * in view, in px: the height of anything fixed above the page, plus some. Default 120.
2969
+ */
2970
+ offset?: number;
2971
+ icons?: BlockIcons;
2972
+ className?: string;
2973
+ }
2974
+ declare function SectionNav({ items, label, offset, icons, className }: SectionNavProps): react.JSX.Element;
2975
+ interface SectionNavLayoutProps extends SectionNavProps {
2976
+ /** The sections, each an element whose `id` is an item's. */
2977
+ children: ReactNode;
2978
+ /** A rail beside the sections from the `xl` breakpoint, under them below it. */
2979
+ aside?: ReactNode;
2980
+ }
2981
+ /**
2982
+ * The SectionNav beside its sections: a two-column grid from `lg` (three with `aside` from `xl`),
2983
+ * the nav above the sections below `lg`.
2984
+ */
2985
+ declare function SectionNavLayout({ children, aside, className, ...nav }: SectionNavLayoutProps): react.JSX.Element;
2878
2986
 
2879
2987
  /**
2880
2988
  * ShortcutsDialog: the keyboard shortcuts of an app, from JSON, in groups.
@@ -3159,4 +3267,4 @@ interface PersonCardsProps<P extends Person = Person> extends PersonViewProps<P>
3159
3267
  }
3160
3268
  declare function PersonCards<P extends Person = Person>({ people, getId, layout, columns, title, description, headerActions, onHeaderAction, emptyText, className, ...view }: PersonCardsProps<P>): react.JSX.Element;
3161
3269
 
3162
- export { type ActionData, AppShell, type AppShellAction, type AppShellChecklistItem, type AppShellGroupAction, type AppShellListItem, type AppShellNavEntry, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, type AppShellSection, type AppShellTreeNode, type AppShellUser, type AppShellWorkspace, type BadgeData, type BlockIcons, type CardBlockAction, type CardBlockProps, ChartCard, type ChartCardProps, type ChartColor, type ChartSegment, type ChartSeries, type ChartView, ConfirmDialog, type ConfirmDialogBlocker, type ConfirmDialogOption, type ConfirmDialogProps, type ConfirmDialogSummaryItem, type ConfirmDialogValues, DASHBOARD_SIZES, Dashboard, type DashboardChartWidget, type DashboardComponents, type DashboardCustomWidget, type DashboardHeatmapWidget, type DashboardHeight, type DashboardLayoutItem, type DashboardMapWidget, type DashboardProps, type DashboardRankedListWidget, type DashboardSize, type DashboardStatWidget, type DashboardTableWidget, type DashboardTier, type DashboardWidget, DashboardWidgetView, type DashboardWidgetViewProps, type DashboardWidth, DataGrid, type DataGridCellState, type DataGridChange, type DataGridColumn, type DataGridNotes, type DataGridOption, type DataGridProps, DataTable, type DataTableColumnDef, DataTableFacetedFilter, type DataTableField, type DataTableProps, type DataTableRowAction, type DependentOptions, type DetailField, type DetailSection, DetailSections, type DetailSectionsProps, type FieldPath, Form, type FormActionsApi, type FormCheckField, type FormComboboxField, type FormCountryField, type FormCustomField, type FormDateField, type FormErrors, type FormField, type FormFieldBase, type FormFieldContext, type FormFieldInput, type FormFieldMap, type FormFieldMapEntry, type FormFieldShort, type FormFieldSize, type FormFieldType, type FormFields, type FormJsonSchema, type FormLayout, type FormListField, type FormOptionInput, type FormProps, type FormRadioField, type FormResult, type FormSchema, type FormSegmentedField, type FormSegmentedOption, type FormSelectField, type FormStandardSchema, type FormState, type FormStep, type FormSubmitOn, type FormTextField, type FormTextType, type FormTextareaField, type FormTimeZoneField, type FormValues, type FormatOptions, FormatProvider, type FormatProviderProps, FullscreenDialog, type FullscreenDialogProps, HEIGHT_ROWS, Heatmap, type HeatmapCell, type HeatmapDay, type HeatmapProps, type IconRef, Kanban, type KanbanAction, type KanbanCardFields, type KanbanChange, type KanbanDrop, type KanbanLane, type KanbanLaneAction, type KanbanPaletteItem, type KanbanProps, type KanbanRequire, type KanbanSwimlanes, ListDetail, type ListDetailItemFields, type ListDetailProps, type MenuItemData, PageHeader, type PageHeaderAvatar, type PageHeaderMeta, type PageHeaderProps, type Person, PersonCard, type PersonCardLayout, type PersonCardProps, PersonCards, type PersonCardsProps, type PersonStat, type Presence, RankedList, type RankedListItem, type RankedListProps, type RecordBanner, RecordPage, type RecordPageProps, type RecordTab, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, type ShortcutData, type ShortcutGroupData, ShortcutsDialog, type ShortcutsDialogProps, type Stat, type StatBreakdownItem, StatCard, type StatCardProps, type StatCardSize, StatCards, type StatCardsProps, type StatPoint, type StatView, TIER_COLUMNS, TableCard, type TableCardProps, Value, type ValueField, type ValueFormat, type ValueProps, type ValueType, chartColor, coerceSize, formatValue, getValueAt, humanize, isEmptyValue, isNumericType, linkAdapter, moveItem, renderValue, resolveIcon, sizeLabel, useDependentOptions, useFormat, widgetSizes, widgetTitle };
3270
+ export { type ActionData, AppShell, type AppShellAction, type AppShellChecklistItem, type AppShellGroupAction, type AppShellListItem, type AppShellNavEntry, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, type AppShellSection, type AppShellTreeNode, type AppShellUser, type AppShellWorkspace, type BadgeData, type BlockIcons, type CardBlockAction, type CardBlockProps, ChartCard, type ChartCardProps, type ChartColor, type ChartSegment, type ChartSeries, type ChartView, ConfirmDialog, type ConfirmDialogBlocker, type ConfirmDialogOption, type ConfirmDialogProps, type ConfirmDialogSummaryItem, type ConfirmDialogValues, DASHBOARD_SIZES, Dashboard, type DashboardChartWidget, type DashboardComponents, type DashboardCustomWidget, type DashboardHeatmapWidget, type DashboardHeight, type DashboardLayoutItem, type DashboardMapWidget, type DashboardProps, type DashboardRankedListWidget, type DashboardSize, type DashboardStatWidget, type DashboardTableWidget, type DashboardTier, type DashboardWidget, DashboardWidgetView, type DashboardWidgetViewProps, type DashboardWidth, DataGrid, type DataGridCellState, type DataGridChange, type DataGridColumn, type DataGridNotes, type DataGridOption, type DataGridProps, DataTable, type DataTableColumnDef, DataTableFacetedFilter, type DataTableField, type DataTableProps, type DataTableRowAction, type DependentOptions, type DetailField, type DetailSection, DetailSections, type DetailSectionsProps, type FieldPath, Form, type FormActionsApi, type FormCheckField, type FormComboboxField, type FormCountryField, type FormCustomField, type FormDateField, type FormErrors, type FormField, type FormFieldBase, type FormFieldContext, type FormFieldInput, type FormFieldMap, type FormFieldMapEntry, type FormFieldShort, type FormFieldSize, type FormFieldType, type FormFields, type FormJsonSchema, type FormLayout, type FormListField, type FormOptionInput, type FormProps, type FormRadioField, type FormResult, type FormSchema, type FormSection, type FormSegmentedField, type FormSegmentedOption, type FormSelectField, type FormStandardSchema, type FormState, type FormStep, type FormSubmitOn, type FormTextField, type FormTextType, type FormTextareaField, type FormTimeZoneField, type FormValues, type FormatOptions, FormatProvider, type FormatProviderProps, FullscreenDialog, type FullscreenDialogProps, HEIGHT_ROWS, Heatmap, type HeatmapCell, type HeatmapDay, type HeatmapProps, type IconRef, Kanban, type KanbanAction, type KanbanCardFields, type KanbanChange, type KanbanDrop, type KanbanLane, type KanbanLaneAction, type KanbanPaletteItem, type KanbanProps, type KanbanRequire, type KanbanSwimlanes, ListDetail, type ListDetailItemFields, type ListDetailProps, type MenuItemData, PageHeader, type PageHeaderAvatar, type PageHeaderMeta, type PageHeaderProps, type Person, PersonCard, type PersonCardLayout, type PersonCardProps, PersonCards, type PersonCardsProps, type PersonStat, type Presence, RankedList, type RankedListItem, type RankedListProps, type RecordBanner, RecordPage, type RecordPageProps, type RecordTab, SectionNav, type SectionNavItem, SectionNavLayout, type SectionNavLayoutProps, type SectionNavProps, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, type ShortcutData, type ShortcutGroupData, ShortcutsDialog, type ShortcutsDialogProps, type Stat, type StatBreakdownItem, StatCard, type StatCardProps, type StatCardSize, StatCards, type StatCardsProps, type StatPoint, type StatView, TIER_COLUMNS, TableCard, type TableCardProps, Value, type ValueField, type ValueFormat, type ValueProps, type ValueType, chartColor, coerceSize, formatValue, getValueAt, humanize, isEmptyValue, isNumericType, linkAdapter, moveItem, renderValue, resolveIcon, sizeLabel, useDependentOptions, useFormat, widgetSizes, widgetTitle };