@ostack.tech/ui-kform 1.2.0-beta.0 → 1.2.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.
Files changed (97) hide show
  1. package/dist/chunks/{en-D4xMcf6Q.js → en-BHlLXSzh.js} +4 -16
  2. package/dist/chunks/en-BHlLXSzh.js.map +1 -0
  3. package/dist/locales/en-GB.js +1 -1
  4. package/dist/locales/en-US.js +1 -1
  5. package/dist/locales/fr-FR.js +5 -17
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +3 -15
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui-kform.js +15299 -4434
  10. package/dist/ostack-ui-kform.js.map +1 -1
  11. package/package.json +16 -14
  12. package/scss/components/Annexes/_Annexes-variables.scss +4 -9
  13. package/scss/components/Annexes/_Annexes.scss +9 -15
  14. package/scss/components/FormApp/_FormApp.scss +1 -4
  15. package/scss/components/FormPages/_FormPages-variables.scss +8 -27
  16. package/scss/components/FormPages/_FormPages.scss +11 -33
  17. package/scss/components/IssuesPanel/_IssuesPanel-variables.scss +3 -8
  18. package/scss/components/IssuesPanel/_IssuesPanel.scss +3 -8
  19. package/types/components/Annexes/Annex.d.ts +26 -37
  20. package/types/components/Annexes/Annexes.d.ts +8 -10
  21. package/types/components/Annexes/AnnexesContext.d.ts +1 -1
  22. package/types/components/Annexes/AnnexesManager.d.ts +8 -12
  23. package/types/components/CheckboxControl/CheckboxControl.d.ts +9 -19
  24. package/types/components/CheckboxGroupControl/CheckboxGroupControl.d.ts +14 -31
  25. package/types/components/CheckboxGroupControl/CheckboxGroupControlItem.d.ts +1 -2
  26. package/types/components/ControlField/ControlField.d.ts +6 -6
  27. package/types/components/DateControl/DateControl.d.ts +13 -18
  28. package/types/components/DateRangeControl/DateRangeControl.d.ts +16 -22
  29. package/types/components/DebugInfo/DebugInfo.d.ts +3 -4
  30. package/types/components/DebugInfo/DebugInfoControlAddonTrigger.d.ts +1 -1
  31. package/types/components/FileControl/FileControl.d.ts +16 -22
  32. package/types/components/FileControl/FileControlDownloadAddon.d.ts +2 -2
  33. package/types/components/FileControl/FileControlViewAddon.d.ts +1 -1
  34. package/types/components/FormApp/FormApp.d.ts +25 -34
  35. package/types/components/FormApp/FormAppContext.d.ts +20 -44
  36. package/types/components/FormApp/FormAppIssueMessages.d.ts +6 -8
  37. package/types/components/FormApp/FormAppStatus.d.ts +1 -1
  38. package/types/components/FormPages/FormPage.d.ts +12 -20
  39. package/types/components/FormPages/FormPages.d.ts +8 -17
  40. package/types/components/FormPages/FormPagesContext.d.ts +1 -1
  41. package/types/components/FormPages/FormPagesNavigation.d.ts +3 -3
  42. package/types/components/FormStepper/FormStep.d.ts +8 -9
  43. package/types/components/FormStepper/FormStepper.d.ts +14 -18
  44. package/types/components/FormStepper/FormStepperContext.d.ts +1 -1
  45. package/types/components/IssueMessage/IssueMessage.d.ts +1 -1
  46. package/types/components/IssueMessages/IssueMessages.d.ts +17 -25
  47. package/types/components/IssuesPanel/IssuesPanel.d.ts +11 -15
  48. package/types/components/IssuesPanel/IssuesPanelControls.d.ts +1 -1
  49. package/types/components/IssuesPopover/IssuesPopover.d.ts +4 -4
  50. package/types/components/LoadAction/LoadAction.d.ts +7 -10
  51. package/types/components/NumericControl/NumericControl.d.ts +15 -21
  52. package/types/components/PathLink/PathLink.d.ts +4 -5
  53. package/types/components/PrintAction/PrintAction.d.ts +7 -11
  54. package/types/components/RadioGroupControl/RadioGroupControl.d.ts +12 -21
  55. package/types/components/RadioGroupControl/RadioGroupControlItem.d.ts +2 -2
  56. package/types/components/ResetOnChange/ResetOnChange.d.ts +6 -14
  57. package/types/components/ResetOnChange/index.d.ts +1 -1
  58. package/types/components/ResetOnChange/useResetOnChange.d.ts +22 -32
  59. package/types/components/SaveAction/SaveAction.d.ts +22 -30
  60. package/types/components/SelectControl/SelectControl.d.ts +11 -21
  61. package/types/components/SelectControl/SelectControlItem.d.ts +2 -2
  62. package/types/components/SelectControl/SelectControlItemGroup.d.ts +2 -3
  63. package/types/components/SelectMultipleControl/SelectMultipleControl.d.ts +17 -35
  64. package/types/components/SelectMultipleControl/SelectMultipleControlItem.d.ts +1 -2
  65. package/types/components/SelectMultipleControl/SelectMultipleControlItemGroup.d.ts +2 -2
  66. package/types/components/SubmitAction/SubmitAction.d.ts +19 -33
  67. package/types/components/TableControl/TableControl.d.ts +27 -41
  68. package/types/components/TableControl/TableControlActionsColumn.d.ts +3 -5
  69. package/types/components/TableControl/TableControlAddRowTrigger.d.ts +7 -13
  70. package/types/components/TableControl/TableControlApi.d.ts +4 -4
  71. package/types/components/TableControl/TableControlColumn.d.ts +5 -8
  72. package/types/components/TableControl/TableControlColumnFns.d.ts +21 -31
  73. package/types/components/TableControl/TableControlColumnGroup.d.ts +3 -6
  74. package/types/components/TableControl/TableControlColumns.d.ts +4 -4
  75. package/types/components/TableControl/TableControlContent.d.ts +1 -1
  76. package/types/components/TableControl/TableControlIndexColumn.d.ts +2 -2
  77. package/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +9 -16
  78. package/types/components/TextControl/TextControl.d.ts +7 -13
  79. package/types/components/UnknownValue/UnknownValue.d.ts +1 -1
  80. package/types/components/ValidateAction/ValidateAction.d.ts +7 -10
  81. package/types/providers/ActivePathProvider/ActivePathProvider.d.ts +4 -7
  82. package/types/providers/LocalizationProvider/LocalizationProvider.d.ts +1 -4
  83. package/types/providers/LocalizationProvider/useLocale.d.ts +1 -4
  84. package/types/providers/PrefixSuffixProvider/PrefixSuffixProvider.d.ts +1 -1
  85. package/types/providers/PrefixSuffixProvider/defaultPrefixSuffix.d.ts +3 -3
  86. package/types/providers/PrefixSuffixProvider/usePrefix.d.ts +1 -4
  87. package/types/utils/mostSpecificPath.d.ts +4 -6
  88. package/types/utils/pathSpecificity.d.ts +7 -8
  89. package/types/utils/selectionTransformations.d.ts +2 -8
  90. package/types/utils/useControlAutofocus.d.ts +6 -8
  91. package/types/utils/useControlIssues.d.ts +4 -4
  92. package/types/utils/useFormLoader.d.ts +24 -31
  93. package/types/utils/useFormSaver.d.ts +29 -34
  94. package/types/utils/useFormValidator.d.ts +13 -20
  95. package/types/utils/useRegisterControl.d.ts +1 -1
  96. package/types/utils/useTemporalStringTransformer.d.ts +4 -10
  97. package/dist/chunks/en-D4xMcf6Q.js.map +0 -1
@@ -27,12 +27,10 @@ export interface FormAppState<T> {
27
27
  startIssuesNavigation?: () => void;
28
28
  latestInteraction: AbsolutePath;
29
29
  registeredControllers: [PathMultimap<Controller>];
30
- registeredIssueMessages: [
31
- PathMultimap<{
32
- messages: IssueMessagesByCode;
33
- priority: number;
34
- }>
35
- ];
30
+ registeredIssueMessages: [PathMultimap<{
31
+ messages: IssueMessagesByCode;
32
+ priority: number;
33
+ }>];
36
34
  deferredIssueMessageRemovalEntryIds: PathMultimapEntryId[];
37
35
  registeredLabels: [PathMultimap<{
38
36
  label: ReactNode;
@@ -103,45 +101,30 @@ export declare function useFormIsDisabled(): boolean;
103
101
  export declare function useFormIsReadOnly(): boolean;
104
102
  /** Returns the form app's display mode for issue messages. */
105
103
  export declare function useIssuesDisplayMode(): IssuesDisplayMode;
106
- /**
107
- * Returns whether issue codes should be displayed (by default) within issue
108
- * messages.
109
- */
104
+ /** Returns whether issue codes should be displayed (by default) within issue messages. */
110
105
  export declare function useDisplayIssueCodesInIssueMessages(): boolean;
111
106
  /** Hook providing access to the form app's HTML form element. */
112
107
  export declare function useFormAppElement(): HTMLFormElement;
113
108
  /** Returns whether the form is in debug mode. */
114
109
  export declare function useFormInDebugMode(): boolean;
115
- /**
116
- * Hook exposing a function that can be used to specify the height of the form
117
- * app's top bar.
118
- */
110
+ /** Hook exposing a function that can be used to specify the height of the form app's top bar. */
119
111
  export declare function useSetTopBarHeight(): (height?: number) => void;
120
- /**
121
- * Hook exposing a function that can be used to specify the width of the form
122
- * app's left panel.
123
- */
112
+ /** Hook exposing a function that can be used to specify the width of the form app's left panel. */
124
113
  export declare function useSetLeftSidebarWidth(): (width?: number) => void;
125
- /**
126
- * Hook exposing a function that can be used to specify the height of the form
127
- * app's bottom panel.
128
- */
114
+ /** Hook exposing a function that can be used to specify the height of the form app's bottom panel. */
129
115
  export declare function useSetBottomPanelHeight(): (height?: number) => void;
130
116
  /**
131
- * Returns the current issues panel path of the form app and a function that can
132
- * be used to set it, ala `useState`.
117
+ * Returns the current issues panel path of the form app and a function that can be used to set it,
118
+ * ala `useState`.
133
119
  */
134
- export declare function useIssuesPanelPath(): [
135
- AbsolutePath | null,
136
- FormAppActions["setIssuesPanelPath"]
137
- ];
120
+ export declare function useIssuesPanelPath(): [AbsolutePath | null, FormAppActions["setIssuesPanelPath"]];
138
121
  /** Hook exposing a function that can be used to focus a path within a form app. */
139
122
  export declare function useFocus(): FormAppActions["focus"];
140
123
  /** Hook exposing a function that can be used to reset the focus. */
141
124
  export declare function useResetFocus(): FormAppActions["resetFocus"];
142
125
  /**
143
- * Hook used to register a controller within the form app. This makes the form
144
- * app aware that a controller of a certain path is currently being rendered.
126
+ * Hook used to register a controller within the form app. This makes the form app aware that a
127
+ * controller of a certain path is currently being rendered.
145
128
  */
146
129
  export declare function useRegisterController(controller: Controller<any>): void;
147
130
  /** Hook to check whether there is a registered controller for the provided path. */
@@ -156,15 +139,9 @@ export declare function useRegisterIssueMessages(path: AbsolutePath | null | und
156
139
  export declare function useRegisteredIssueMessage(path: AbsolutePath | null | undefined, code: string): IssueMessageValue;
157
140
  /** Hook used to register a label within the form app. */
158
141
  export declare function useRegisterLabel(path: AbsolutePath | null | undefined, label: ReactNode, priority?: number): void;
159
- /**
160
- * Hook used to get the label parts associated with the active issues panel
161
- * path.
162
- */
142
+ /** Hook used to get the label parts associated with the active issues panel path. */
163
143
  export declare function useActiveIssuesPanelBreadcrumb(): BreadcrumbItem[] | null;
164
- /**
165
- * Hook exposing a function that can be used to start navigating through the
166
- * form app's issues.
167
- */
144
+ /** Hook exposing a function that can be used to start navigating through the form app's issues. */
168
145
  export declare function useStartIssuesNavigation(): FormAppActions["startIssuesNavigation"];
169
146
  /** Options available to the {@link useOnPathFocus} hook. */
170
147
  export interface UseOnFocusedPathChangeOptions {
@@ -182,14 +159,13 @@ export interface UseOnFocusedPathChangeOptions {
182
159
  fireImmediately?: boolean;
183
160
  }
184
161
  /**
185
- * Hook used to run a given function whenever the form app's focused path
186
- * changes.
162
+ * Hook used to run a given function whenever the form app's focused path changes.
187
163
  *
188
- * @param cb Function to run when the focused path changes. This function should
189
- * hopefully not change on every render (i.e. it should be memoised via
190
- * `useCallback` or be defined externally).
164
+ * @param cb Function to run when the focused path changes. This function should hopefully not
165
+ * change on every render (i.e. it should be memoised via `useCallback` or be defined
166
+ * externally).
191
167
  * @param options Hook options.
192
168
  */
193
- export declare function useOnPathFocus(cb: (focusedPath: AbsolutePath) => void, { enabled, fireImmediately, }?: UseOnFocusedPathChangeOptions): void;
169
+ export declare function useOnPathFocus(cb: (focusedPath: AbsolutePath) => void, { enabled, fireImmediately }?: UseOnFocusedPathChangeOptions): void;
194
170
  /** Hook used to set the function which starts issue navigation. */
195
171
  export declare function useSetStartIssuesNavigation(fn: () => void): void;
@@ -6,14 +6,12 @@ export interface FormAppIssueMessagesProps {
6
6
  /** Base path for the paths used in `messages`. */
7
7
  path?: string | Path;
8
8
  /**
9
- * Mapping of issue messages from the path of the field with issues to the
10
- * issue messages of said field (which are themselves grouped by their code).
9
+ * Mapping of issue messages from the path of the field with issues to the issue messages of said
10
+ * field (which are themselves grouped by their code).
11
11
  *
12
- * Provided paths may contain wildcards, which will have a lower priority when
13
- * matched against.
12
+ * Provided paths may contain wildcards, which will have a lower priority when matched against.
14
13
  *
15
- * These messages are used by the `IssueMessages` and `IssuesPanel`
16
- * components.
14
+ * These messages are used by the `IssueMessages` and `IssuesPanel` components.
17
15
  *
18
16
  * Example value:
19
17
  *
@@ -33,8 +31,8 @@ export interface FormAppIssueMessagesProps {
33
31
  /**
34
32
  * Priority to use when registering issue messages.
35
33
  *
36
- * When multiple issue messages are associated with the same path, then the
37
- * one registered with the highest priority "wins".
34
+ * When multiple issue messages are associated with the same path, then the one registered with
35
+ * the highest priority "wins".
38
36
  *
39
37
  * @default 0
40
38
  */
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from "react";
1
+ import type { ReactNode } from "react";
2
2
  /** Properties of the form app status component. */
3
3
  export interface FormAppStatusProps {
4
4
  /**
@@ -12,8 +12,8 @@ export interface FormPageObject<T = any> {
12
12
  /**
13
13
  * Title of the form page as a string to display in the document's title.
14
14
  *
15
- * Defaults to `title` when it is a string. A warning is printed if `title` is
16
- * not a string and `documentTitle` is not provided.
15
+ * Defaults to `title` when it is a string. A warning is printed if `title` is not a string and
16
+ * `documentTitle` is not provided.
17
17
  */
18
18
  documentTitle?: string | null | ((value: T) => string | null);
19
19
  /** Form page's code. */
@@ -30,17 +30,16 @@ export interface FormPageProps extends FormPageObject, Omit<ComponentProps<"sect
30
30
  /** Form page helper text, displayed as a popover triggered by an icon button. */
31
31
  helperText?: ReactNode;
32
32
  /**
33
- * Mapping of issue messages from the path of the field with issues to the
34
- * issue messages of said field (which are themselves grouped by their code).
33
+ * Mapping of issue messages from the path of the field with issues to the issue messages of said
34
+ * field (which are themselves grouped by their code).
35
35
  *
36
- * Provided paths are relative to the form page's path and may contain
37
- * wildcards, which will have a lower priority when matched against.
36
+ * Provided paths are relative to the form page's path and may contain wildcards, which will have
37
+ * a lower priority when matched against.
38
38
  *
39
39
  * These messages are used by the `IssueMessages` component.
40
40
  *
41
- * > **Note:** Changes to `issueMessages` are handled correctly, but are not
42
- * > efficient. Please make sure that the identity of the provided value doesn't
43
- * > change at every render.
41
+ * > **Note:** Changes to `issueMessages` are handled correctly, but are not efficient. Please make
42
+ * > sure that the identity of the provided value doesn't change at every render.
44
43
  *
45
44
  * Example value:
46
45
  *
@@ -60,27 +59,20 @@ export interface FormPageProps extends FormPageObject, Omit<ComponentProps<"sect
60
59
  /**
61
60
  * Issue messages of the form page itself.
62
61
  *
63
- * These messages can also be provided via the `issueMessages` property using
64
- * a path of "`.`".
62
+ * These messages can also be provided via the `issueMessages` property using a path of "`.`".
65
63
  */
66
64
  ownIssueMessages?: IssueMessagesByCode;
67
65
  /** Properties to pass to the header element. */
68
66
  headerProps?: ComponentProps<"div">;
69
67
  /** Label of the helper button announced to assistive technologies. */
70
68
  helperButtonLabel?: string;
71
- /**
72
- * Visually hidden prefix added to the form page code announced to assistive
73
- * technologies.
74
- */
69
+ /** Visually hidden prefix added to the form page code announced to assistive technologies. */
75
70
  visuallyHiddenCodePrefix?: ReactNode;
76
71
  /** Properties to pass to the code element. */
77
72
  codeProps?: ComponentProps<"div">;
78
73
  /** Properties to pass to the title element. */
79
74
  titleProps?: ComponentProps<"h2">;
80
- /**
81
- * Properties to pass to the element containing the popover components in the
82
- * header.
83
- */
75
+ /** Properties to pass to the element containing the popover components in the header. */
84
76
  headerPopoverContainerProps?: StackProps;
85
77
  /** Properties to pass to the form page's issues popover component. */
86
78
  issuesPopoverProps?: IssuesPopoverProps;
@@ -101,4 +93,4 @@ export interface FormPageProps extends FormPageObject, Omit<ComponentProps<"sect
101
93
  children?: ReactNode;
102
94
  }
103
95
  /** Component representing a single form page. */
104
- export declare function FormPage({ path, title: _title, documentTitle: _documentTitle, code: _code, issuesPanelLabel: _issuesPanelLabel, disabled, readOnly, className, helperText, helperButtonLabel, visuallyHiddenCodePrefix: _visuallyHiddenCodePrefix, issueMessages, ownIssueMessages, headerProps, codeProps, titleProps, headerPopoverContainerProps, issuesPopoverProps, issueMessagesProps, contentProps, containerProps, errorBoundaryProps, helperButtonProps, helperPopoverProps, helperPopoverContentProps, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...otherProps }: FormPageProps): import("react").JSX.Element | null;
96
+ export declare function FormPage({ path, title: _title, documentTitle: _documentTitle, code: _code, issuesPanelLabel: _issuesPanelLabel, disabled, readOnly, className, helperText, helperButtonLabel: helperButtonLabelProp, visuallyHiddenCodePrefix: _visuallyHiddenCodePrefix, issueMessages, ownIssueMessages, headerProps, codeProps, titleProps, headerPopoverContainerProps, issuesPopoverProps, issueMessagesProps, contentProps, containerProps, errorBoundaryProps, helperButtonProps, helperPopoverProps, helperPopoverContentProps, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...otherProps }: FormPageProps): import("react").JSX.Element | null;
@@ -6,8 +6,8 @@ export interface FormPagesProps extends ComponentProps<"div"> {
6
6
  /** Base path for all declared form pages. */
7
7
  path?: string | Path;
8
8
  /**
9
- * List of all form pages. When not provided, the list of pages is obtained
10
- * from the direct children `FormPage` components.
9
+ * List of all form pages. When not provided, the list of pages is obtained from the direct
10
+ * children `FormPage` components.
11
11
  */
12
12
  pages?: FormPageObject[];
13
13
  /** Default path of the active form page. */
@@ -23,10 +23,9 @@ export interface FormPagesProps extends ComponentProps<"div"> {
23
23
  children?: ReactNode;
24
24
  }
25
25
  /**
26
- * The form pages component can be used to split parts of a form into separate
27
- * pages, while providing means of navigating between them. Although not
28
- * strictly mandatory, each page is typically represented by its own class, with
29
- * its own schema and distinct path.
26
+ * The form pages component can be used to split parts of a form into separate pages, while
27
+ * providing means of navigating between them. Although not strictly mandatory, each page is
28
+ * typically represented by its own class, with its own schema and distinct path.
30
29
  *
31
30
  * It composes the following subcomponents:
32
31
  *
@@ -36,11 +35,7 @@ export interface FormPagesProps extends ComponentProps<"div"> {
36
35
  * Example usage:
37
36
  *
38
37
  * ```tsx
39
- * import {
40
- * FormPage,
41
- * FormPages,
42
- * FormPagesNavigation,
43
- * } from "@ostack.tech/ui-kform";
38
+ * import { FormPage, FormPages, FormPagesNavigation } from "@ostack.tech/ui-kform";
44
39
  *
45
40
  * function TaxWithholdingPages() {
46
41
  * return (
@@ -49,11 +44,7 @@ export interface FormPagesProps extends ComponentProps<"div"> {
49
44
  * <FormPage path="/fillingInfo" title="Filing information" code="0">
50
45
  * Filing information page…
51
46
  * </FormPage>
52
- * <FormPage
53
- * path="/exemptions"
54
- * title="Exemptions & declarations"
55
- * code="1"
56
- * >
47
+ * <FormPage path="/exemptions" title="Exemptions & declarations" code="1">
57
48
  * Exemptions & declarations page…
58
49
  * </FormPage>
59
50
  * </FormPages>
@@ -61,4 +52,4 @@ export interface FormPagesProps extends ComponentProps<"div"> {
61
52
  * }
62
53
  * ```
63
54
  */
64
- export declare function FormPages({ path, pages, defaultActivePage, activePage, onActivePageChange, className, children, ref, ...otherProps }: FormPagesProps): import("react").JSX.Element;
55
+ export declare function FormPages({ path, pages: pagesProp, defaultActivePage, activePage, onActivePageChange, className, children, ref, ...otherProps }: FormPagesProps): import("react").JSX.Element;
@@ -57,7 +57,7 @@ export interface UseCreateFormPagesContextOptions extends Pick<FormPagesProps, "
57
57
  resolvedPages: ResolvedFormPageObject[];
58
58
  }
59
59
  /** Hook used to create the form pages context. */
60
- export declare function useCreateFormPagesContext({ basePath, resolvedPages, defaultActivePage, activePage, onActivePageChange, }: UseCreateFormPagesContextOptions): Omit<import("zustand").StoreApi<FormPagesState>, "subscribe"> & {
60
+ export declare function useCreateFormPagesContext({ basePath, resolvedPages, defaultActivePage, activePage: activePageProp, onActivePageChange, }: UseCreateFormPagesContextOptions): Omit<import("zustand").StoreApi<FormPagesState>, "subscribe"> & {
61
61
  subscribe: {
62
62
  (listener: (selectedState: FormPagesState, previousSelectedState: FormPagesState) => void): () => void;
63
63
  <U>(selector: (state: FormPagesState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -9,7 +9,7 @@ export interface FormPagesNavigationProps extends ComponentProps<"nav"> {
9
9
  selectProps?: FormPagesSelectProps;
10
10
  }
11
11
  /**
12
- * Component allowing navigation between form pages. Renders as a sidebar in
13
- * large screens and as a select for smaller ones.
12
+ * Component allowing navigation between form pages. Renders as a sidebar in large screens and as a
13
+ * select for smaller ones.
14
14
  */
15
- export declare function FormPagesNavigation({ sidebarProps, selectProps, className, "aria-label": ariaLabel, ...otherProps }: FormPagesNavigationProps): import("react").JSX.Element;
15
+ export declare function FormPagesNavigation({ sidebarProps, selectProps, className, "aria-label": ariaLabelProp, ...otherProps }: FormPagesNavigationProps): import("react").JSX.Element;
@@ -11,8 +11,8 @@ export interface FormStepObject<T = any> {
11
11
  /**
12
12
  * Title of the form step as a string to display in the document's title.
13
13
  *
14
- * Defaults to `title` when it is a string. A warning is printed if `title` is
15
- * not a string and `documentTitle` is not provided.
14
+ * Defaults to `title` when it is a string. A warning is printed if `title` is not a string and
15
+ * `documentTitle` is not provided.
16
16
  */
17
17
  documentTitle?: string | null | ((value: T) => string | null);
18
18
  /** Label of the form step in the issues panel. Uses the `title` by default. */
@@ -25,17 +25,16 @@ export interface FormStepProps extends FormStepObject, Omit<StepContentProps, "i
25
25
  /** Sets the step as read-only. */
26
26
  readOnly?: boolean;
27
27
  /**
28
- * Mapping of issue messages from the path of the field with issues to the
29
- * issue messages of said field (which are themselves grouped by their code).
28
+ * Mapping of issue messages from the path of the field with issues to the issue messages of said
29
+ * field (which are themselves grouped by their code).
30
30
  *
31
- * Provided paths are relative to the form step's path and may contain
32
- * wildcards, which will have a lower priority when matched against.
31
+ * Provided paths are relative to the form step's path and may contain wildcards, which will have
32
+ * a lower priority when matched against.
33
33
  *
34
34
  * These messages are used by the `IssueMessages` component.
35
35
  *
36
- * > **Note:** Changes to `issueMessages` are handled correctly, but are not
37
- * > efficient. Please make sure that the identity of the provided value doesn't
38
- * > change at every render.
36
+ * > **Note:** Changes to `issueMessages` are handled correctly, but are not efficient. Please make
37
+ * > sure that the identity of the provided value doesn't change at every render.
39
38
  *
40
39
  * Example value:
41
40
  *
@@ -19,44 +19,40 @@ export interface FormStepperProps extends Omit<StepperProps, "defaultActiveStep"
19
19
  */
20
20
  onActiveStepChange?: (activeStepPath: AbsolutePath | null, activeStepIndex: number) => void;
21
21
  /**
22
- * Function called when a step is touched and validated due to a navigation to
23
- * a following step. This function is never called when
24
- * `skipStepValidationOnForwardNavigation` is `true`.
22
+ * Function called when a step is touched and validated due to a navigation to a following step.
23
+ * This function is never called when `skipStepValidationOnForwardNavigation` is `true`.
25
24
  *
26
25
  * @param issues Issues present in the step.
27
26
  */
28
27
  onStepValidation?: (issues: SealedLocatedValidationIssue[]) => void;
29
28
  /**
30
- * Whether to skip marking a step as touched and validating it when navigating
31
- * to a following step.
29
+ * Whether to skip marking a step as touched and validating it when navigating to a following
30
+ * step.
32
31
  *
33
32
  * @default false
34
33
  */
35
34
  skipStepValidationOnForwardNavigation?: boolean;
36
35
  /**
37
- * Whether to allow navigation to a following step when a previous step
38
- * contains errors. This is always `true` when
39
- * `skipStepValidationOnForwardNavigation` is also `true`.
36
+ * Whether to allow navigation to a following step when a previous step contains errors. This is
37
+ * always `true` when `skipStepValidationOnForwardNavigation` is also `true`.
40
38
  *
41
39
  * @default false
42
40
  */
43
41
  allowForwardNavigationOnError?: boolean;
44
42
  /**
45
- * Whether to prevent the focus of an invalid field when a step was validated
46
- * and an error was found. This is always `true` if either
47
- * `skipStepValidationOnForwardNavigation` or `allowForwardNavigationOnError`
48
- * are `true`.
43
+ * Whether to prevent the focus of an invalid field when a step was validated and an error was
44
+ * found. This is always `true` if either `skipStepValidationOnForwardNavigation` or
45
+ * `allowForwardNavigationOnError` are `true`.
49
46
  *
50
47
  * @default false
51
48
  */
52
49
  preventFocusOnError?: boolean;
53
50
  }
54
51
  /**
55
- * The form stepper component can be used to split parts of a form into separate
56
- * steps. It is built on top of the
57
- * [`Stepper`](/docs/ostack-ui-disclosure-stepper--docs) component. Although not
58
- * strictly mandatory, each page is typically represented by its own class, with
59
- * its own schema and distinct path.
52
+ * The form stepper component can be used to split parts of a form into separate steps. It is built
53
+ * on top of the [`Stepper`](/docs/ostack-ui-disclosure-stepper--docs) component. Although not
54
+ * strictly mandatory, each page is typically represented by its own class, with its own schema and
55
+ * distinct path.
60
56
  *
61
57
  * It composes the following subcomponents:
62
58
  *
@@ -99,4 +95,4 @@ export interface FormStepperProps extends Omit<StepperProps, "defaultActiveStep"
99
95
  * }
100
96
  * ```
101
97
  */
102
- export declare function FormStepper({ path, steps, defaultActiveStep, activeStep, onActiveStepChange, onStepValidation, skipStepValidationOnForwardNavigation, allowForwardNavigationOnError, preventFocusOnError, className, children, ...otherProps }: FormStepperProps): import("react").JSX.Element;
98
+ export declare function FormStepper({ path, steps: stepsProp, defaultActiveStep, activeStep, onActiveStepChange, onStepValidation, skipStepValidationOnForwardNavigation, allowForwardNavigationOnError, preventFocusOnError, className, children, ...otherProps }: FormStepperProps): import("react").JSX.Element;
@@ -53,7 +53,7 @@ export interface UseCreateFormStepperContextOptions extends Pick<FormStepperProp
53
53
  resolvedSteps: ResolvedFormStepObject[];
54
54
  }
55
55
  /** Hook used to create the form stepper context. */
56
- export declare function useCreateFormStepperContext({ formManager, basePath, resolvedSteps, defaultActiveStep, activeStep, onActiveStepChange, onStepValidation, skipStepValidationOnForwardNavigation, allowForwardNavigationOnError, preventFocusOnError, }: UseCreateFormStepperContextOptions): Omit<import("zustand").StoreApi<FormStepperState>, "subscribe"> & {
56
+ export declare function useCreateFormStepperContext({ formManager, basePath, resolvedSteps, defaultActiveStep, activeStep: activeStepProp, onActiveStepChange, onStepValidation, skipStepValidationOnForwardNavigation, allowForwardNavigationOnError, preventFocusOnError, }: UseCreateFormStepperContextOptions): Omit<import("zustand").StoreApi<FormStepperState>, "subscribe"> & {
57
57
  subscribe: {
58
58
  (listener: (selectedState: FormStepperState, previousSelectedState: FormStepperState) => void): () => void;
59
59
  <U>(selector: (state: FormStepperState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -13,4 +13,4 @@ export interface IssueMessageProps extends Pick<IssueMessagesProps, "visuallyHid
13
13
  issueCodeProps?: ComponentProps<"span">;
14
14
  }
15
15
  /** Single issue message within the issue messages or issues panel components. */
16
- export declare function IssueMessage({ path, issue, schema, displayIssueCode, messageDataKey, visuallyHiddenErrorCodePrefix, visuallyHiddenWarningCodePrefix, unknownErrorMessage, unknownWarningMessage, issueCodeProps, }: IssueMessageProps): import("react").JSX.Element;
16
+ export declare function IssueMessage({ path, issue, schema, displayIssueCode: displayIssueCodeProp, messageDataKey: messageDataKeyProp, visuallyHiddenErrorCodePrefix: visuallyHiddenErrorCodePrefixProp, visuallyHiddenWarningCodePrefix: visuallyHiddenWarningCodePrefixProp, unknownErrorMessage: unknownErrorMessageProp, unknownWarningMessage: unknownWarningMessageProp, issueCodeProps, }: IssueMessageProps): import("react").JSX.Element;
@@ -10,13 +10,13 @@ export interface IssueMessagesProps extends FeedbackListProps {
10
10
  /** Path of the value for which to show issues. */
11
11
  path?: string | Path;
12
12
  /**
13
- * Issues to show, associated with the provided path. If not provided, the
14
- * component will query the issues from the form manager.
13
+ * Issues to show, associated with the provided path. If not provided, the component will query
14
+ * the issues from the form manager.
15
15
  */
16
16
  issues?: SealedValidationIssue[];
17
17
  /**
18
- * Schema associated with the issues. If not provided, the component will
19
- * query the schema from the form manager.
18
+ * Schema associated with the issues. If not provided, the component will query the schema from
19
+ * the form manager.
20
20
  */
21
21
  schema?: Schema;
22
22
  /** Mapping from an issue's code to its message. */
@@ -24,14 +24,12 @@ export interface IssueMessagesProps extends FeedbackListProps {
24
24
  /**
25
25
  * Whether to display issue codes together with each issue message.
26
26
  *
27
- * This property can also be set globally via the `displayIssueCodes` property
28
- * of the `FormApp`.
27
+ * This property can also be set globally via the `displayIssueCodes` property of the `FormApp`.
29
28
  */
30
29
  displayIssueCodes?: boolean;
31
30
  /**
32
- * Name of the key in a validation issue's data object that possibly contains
33
- * the issue message. This message is only used if no matching message is
34
- * otherwise found.
31
+ * Name of the key in a validation issue's data object that possibly contains the issue message.
32
+ * This message is only used if no matching message is otherwise found.
35
33
  *
36
34
  * @default "message"
37
35
  */
@@ -43,24 +41,20 @@ export interface IssueMessagesProps extends FeedbackListProps {
43
41
  /**
44
42
  * Message to show for an error that does not have an associated message.
45
43
  *
46
- * This message will always automatically include the code of the issue in
47
- * question.
44
+ * This message will always automatically include the code of the issue in question.
48
45
  */
49
46
  unknownErrorMessage?: ReactNode;
50
47
  /**
51
48
  * Message to show for a warning that does not have an associated message.
52
49
  *
53
- * This message will always automatically include the code of the issue in
54
- * question.
50
+ * This message will always automatically include the code of the issue in question.
55
51
  */
56
52
  unknownWarningMessage?: ReactNode;
57
53
  /**
58
- * Whether to render the issue messages "unwrapped", i.e. outside a containing
59
- * `FeedbackList`.
54
+ * Whether to render the issue messages "unwrapped", i.e. outside a containing `FeedbackList`.
60
55
  *
61
- * This is useful together with components such as the `DateRangeControl`
62
- * where you might want to show issues for multiple paths, all within the same
63
- * `FeedbackList`:
56
+ * This is useful together with components such as the `DateRangeControl` where you might want to
57
+ * show issues for multiple paths, all within the same `FeedbackList`:
64
58
  *
65
59
  * ```tsx
66
60
  * <FeedbackList>
@@ -74,14 +68,12 @@ export interface IssueMessagesProps extends FeedbackListProps {
74
68
  /**
75
69
  * Component used to display all issues associated with the relevant path.
76
70
  *
77
- * Issue messages are automatically read from the scope (typically provided by
78
- * setting the `issueMessages` property of a `FormApp`, `Annex`, or
79
- * `FormPage`).
71
+ * Issue messages are automatically read from the scope (typically provided by setting the
72
+ * `issueMessages` property of a `FormApp`, `Annex`, or `FormPage`).
80
73
  *
81
- * Messages may also be passed directly to this component via the `messages`
82
- * property.
74
+ * Messages may also be passed directly to this component via the `messages` property.
83
75
  *
84
- * If `path` contains an issue without an associated issue message, a generic
85
- * message is displayed together with a console warning.
76
+ * If `path` contains an issue without an associated issue message, a generic message is displayed
77
+ * together with a console warning.
86
78
  */
87
79
  export declare function IssueMessages({ path, issues, schema, messages, displayIssueCodes, messagesDataKey, visuallyHiddenErrorCodePrefix, visuallyHiddenWarningCodePrefix, unknownErrorMessage, unknownWarningMessage, unwrapped, ...otherProps }: IssueMessagesProps): import("react").JSX.Element;
@@ -18,8 +18,7 @@ export interface IssuesPanelProps extends Pick<IssuesTrackerOptions, "issuesOrde
18
18
  /** Controlled open state of the issues navigation panel. */
19
19
  open?: boolean;
20
20
  /**
21
- * Function called whenever the open state of the issues navigation panel
22
- * changes.
21
+ * Function called whenever the open state of the issues navigation panel changes.
23
22
  *
24
23
  * @param open New open state.
25
24
  */
@@ -27,36 +26,33 @@ export interface IssuesPanelProps extends Pick<IssuesTrackerOptions, "issuesOrde
27
26
  /**
28
27
  * Whether to display issue codes together with each issue message.
29
28
  *
30
- * This property can also be set globally via the `displayIssueCodes` property
31
- * of the `FormApp`.
29
+ * This property can also be set globally via the `displayIssueCodes` property of the `FormApp`.
32
30
  */
33
31
  displayIssueCodes?: boolean;
34
32
  /**
35
33
  * Message to show for an error that does not have an associated message.
36
34
  *
37
- * This message will always automatically include the code of the issue in
38
- * question.
35
+ * This message will always automatically include the code of the issue in question.
39
36
  */
40
37
  unknownErrorMessage?: ReactNode;
41
38
  /**
42
39
  * Message to show for a warning that does not have an associated message.
43
40
  *
44
- * This message will always automatically include the code of the issue in
45
- * question.
41
+ * This message will always automatically include the code of the issue in question.
46
42
  */
47
43
  unknownWarningMessage?: ReactNode;
48
44
  /**
49
45
  * Errors label.
50
46
  *
51
- * @param errors Number of errors. If undefined, the function should return a
52
- * generic label with no number.
47
+ * @param errors Number of errors. If undefined, the function should return a generic label with
48
+ * no number.
53
49
  */
54
50
  errorsLabel?: (errors?: number) => ReactNode;
55
51
  /**
56
52
  * Warnings label.
57
53
  *
58
- * @param warnings Number of warnings. If undefined, the function should
59
- * return a generic label with no number.
54
+ * @param warnings Number of warnings. If undefined, the function should return a generic label
55
+ * with no number.
60
56
  */
61
57
  warningsLabel?: (warnings?: number) => ReactNode;
62
58
  /** Label of the focus button. */
@@ -80,8 +76,8 @@ export interface IssuesPanelProps extends Pick<IssuesTrackerOptions, "issuesOrde
80
76
  /** Keybinds to trigger the "last issue" button. */
81
77
  lastIssueKeybinds?: string | string[] | null;
82
78
  /**
83
- * Text announced to assistive technologies with the current page out of the
84
- * total number of pages.
79
+ * Text announced to assistive technologies with the current page out of the total number of
80
+ * pages.
85
81
  *
86
82
  * @param currentPage Current page.
87
83
  * @param totalPages Total number of pages.
@@ -123,4 +119,4 @@ export interface IssuesPanelProps extends Pick<IssuesTrackerOptions, "issuesOrde
123
119
  closeButtonProps?: CloseButtonProps;
124
120
  }
125
121
  /** Component used to navigate through the issues of the form. */
126
- export declare function IssuesPanel({ defaultOpen, open: controlledOpen, onOpenChange, displayIssueCodes, issuesOrderCompareFn, unknownErrorMessage, unknownWarningMessage, errorsLabel, warningsLabel, focusButtonLabel, focusKeybinds: focusKeybindsProp, previousIssueButtonLabel, previousIssueKeybinds: previousIssueKeybindsProp, nextIssueButtonLabel, nextIssueKeybinds: nextIssueKeybindsProp, firstIssueButtonLabel, firstIssueKeybinds: firstIssueKeybindsProp, lastIssueButtonLabel, lastIssueKeybinds: lastIssueKeybindsProp, paginationLabel, noIssuesMessage, resolvedTitle, resolvedMessage, containerProps, headerProps, bodyProps, loadingSpinnerProps, validatingSpinnerProps, paginationProps, focusButtonProps, previousIssueButtonProps, nextIssueButtonProps, firstIssueButtonProps, lastIssueButtonProps, titleProps, iconProps, closeButtonProps, ...otherProps }: IssuesPanelProps): false | import("react").JSX.Element;
122
+ export declare function IssuesPanel({ defaultOpen, open: controlledOpen, onOpenChange, displayIssueCodes, issuesOrderCompareFn, unknownErrorMessage, unknownWarningMessage, errorsLabel: errorsLabelProp, warningsLabel: warningsLabelProp, focusButtonLabel: focusButtonLabelProp, focusKeybinds: focusKeybindsProp, previousIssueButtonLabel: previousIssueButtonLabelProp, previousIssueKeybinds: previousIssueKeybindsProp, nextIssueButtonLabel: nextIssueButtonLabelProp, nextIssueKeybinds: nextIssueKeybindsProp, firstIssueButtonLabel: firstIssueButtonLabelProp, firstIssueKeybinds: firstIssueKeybindsProp, lastIssueButtonLabel: lastIssueButtonLabelProp, lastIssueKeybinds: lastIssueKeybindsProp, paginationLabel: paginationLabelProp, noIssuesMessage: noIssuesMessageProp, resolvedTitle: resolvedTitleProp, resolvedMessage: resolvedMessageProp, containerProps, headerProps, bodyProps, loadingSpinnerProps, validatingSpinnerProps, paginationProps, focusButtonProps, previousIssueButtonProps, nextIssueButtonProps, firstIssueButtonProps, lastIssueButtonProps, titleProps, iconProps, closeButtonProps, ...otherProps }: IssuesPanelProps): false | import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import type { AbsolutePath } from "@ostack.tech/kform";
2
- import type { Controller } from "@ostack.tech/kform-react";
2
+ import { type Controller } from "@ostack.tech/kform-react";
3
3
  import { type IconButtonColor } from "@ostack.tech/ui";
4
4
  import type { IssuesPanelProps } from "./IssuesPanel.tsx";
5
5
  /** Properties of the issues panel controls component. */
@@ -4,11 +4,11 @@ import { type FeedbackPopoverProps } from "@ostack.tech/ui";
4
4
  export interface IssuesPopoverProps extends FeedbackPopoverProps {
5
5
  path?: string | Path;
6
6
  /**
7
- * Paths relevant to this issues popover. When one of the relevant paths
8
- * becomes active, the popover will automatically open. Defaults to `[path]`
9
- * (or `[<current path>]` if no `path` is provided).
7
+ * Paths relevant to this issues popover. When one of the relevant paths becomes active, the
8
+ * popover will automatically open. Defaults to `[path]` (or `[<current path>]` if no `path` is
9
+ * provided).
10
10
  */
11
11
  relevantPaths?: (string | Path)[];
12
12
  }
13
13
  /** Component used to display issues within a popover. */
14
- export declare function IssuesPopover({ path, relevantPaths, defaultOpen, open: controlledOpen, onOpenChange, label, ...otherProps }: IssuesPopoverProps): import("react").JSX.Element;
14
+ export declare function IssuesPopover({ path, relevantPaths, defaultOpen, open: controlledOpen, onOpenChange, label: labelProp, ...otherProps }: IssuesPopoverProps): import("react").JSX.Element;