@ostack.tech/ui-kform 0.1.1 → 0.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 (103) hide show
  1. package/dist/chunks/en-C1hDoCmB.js +135 -0
  2. package/dist/chunks/en-C1hDoCmB.js.map +1 -0
  3. package/dist/locales/en-GB.js +10 -0
  4. package/dist/locales/en-GB.js.map +1 -0
  5. package/dist/locales/en-US.js +10 -0
  6. package/dist/locales/en-US.js.map +1 -0
  7. package/dist/locales/fr.js +137 -0
  8. package/dist/locales/fr.js.map +1 -0
  9. package/dist/locales/pt.js +137 -0
  10. package/dist/locales/pt.js.map +1 -0
  11. package/dist/ostack-ui-kform.css +309 -309
  12. package/dist/ostack-ui-kform.js +1129 -1472
  13. package/dist/ostack-ui-kform.js.map +1 -1
  14. package/dist/types/components/Annexes/Annex.d.ts +5 -5
  15. package/dist/types/components/Annexes/Annexes.d.ts +10 -10
  16. package/dist/types/components/Annexes/AnnexesContext.d.ts +5 -5
  17. package/dist/types/components/Annexes/AnnexesManager.d.ts +15 -15
  18. package/dist/types/components/Annexes/AnnexesMenu.d.ts +4 -4
  19. package/dist/types/components/Annexes/AnnexesTabList.d.ts +3 -3
  20. package/dist/types/components/CheckboxControl/CheckboxControl.d.ts +6 -6
  21. package/dist/types/components/CheckboxGroupControl/CheckboxGroupControl.d.ts +9 -9
  22. package/dist/types/components/ControlField/ControlField.d.ts +3 -3
  23. package/dist/types/components/ControlField/ControlFieldContext.d.ts +1 -2
  24. package/dist/types/components/DateControl/DateControl.d.ts +6 -6
  25. package/dist/types/components/DateRangeControl/DateRangeControl.d.ts +9 -9
  26. package/dist/types/components/FileControl/FileControl.d.ts +9 -9
  27. package/dist/types/components/FormApp/FormApp.d.ts +23 -15
  28. package/dist/types/components/FormApp/FormAppAutoFocus.d.ts +2 -0
  29. package/dist/types/components/FormApp/FormAppContext.d.ts +11 -13
  30. package/dist/types/components/FormApp/FormAppElement.d.ts +9 -0
  31. package/dist/types/components/FormApp/FormAppIssueMessages.d.ts +3 -3
  32. package/dist/types/components/FormApp/FormAppStatus.d.ts +2 -2
  33. package/dist/types/components/FormPages/FormPage.d.ts +17 -17
  34. package/dist/types/components/FormPages/FormPageHeader.d.ts +3 -3
  35. package/dist/types/components/FormPages/FormPages.d.ts +7 -7
  36. package/dist/types/components/FormPages/FormPagesContext.d.ts +4 -4
  37. package/dist/types/components/FormPages/FormPagesNavigation.d.ts +5 -5
  38. package/dist/types/components/FormPages/FormPagesSelect.d.ts +3 -3
  39. package/dist/types/components/FormPages/FormPagesSidebar.d.ts +3 -3
  40. package/dist/types/components/FormStepper/FormStepContent.d.ts +5 -5
  41. package/dist/types/components/FormStepper/FormStepList.d.ts +3 -3
  42. package/dist/types/components/FormStepper/FormStepper.d.ts +5 -5
  43. package/dist/types/components/FormStepper/FormStepperContext.d.ts +3 -3
  44. package/dist/types/components/IssueAlert/IssueAlert.d.ts +4 -4
  45. package/dist/types/components/IssueMessage/IssueMessage.d.ts +4 -4
  46. package/dist/types/components/IssueMessages/IssueMessages.d.ts +6 -6
  47. package/dist/types/components/IssuesPanel/IssuesPanel.d.ts +25 -25
  48. package/dist/types/components/IssuesPanel/IssuesPanelMessagesCard.d.ts +4 -4
  49. package/dist/types/components/IssuesPanel/IssuesPanelSummaryCard.d.ts +4 -4
  50. package/dist/types/components/IssuesPopover/IssuesPopover.d.ts +3 -3
  51. package/dist/types/components/LoadAction/LoadAction.d.ts +2 -2
  52. package/dist/types/components/NumericControl/NumericControl.d.ts +6 -6
  53. package/dist/types/components/PathLink/PathLink.d.ts +2 -2
  54. package/dist/types/components/RadioGroupControl/RadioGroupControl.d.ts +9 -9
  55. package/dist/types/components/SaveAction/SaveAction.d.ts +6 -6
  56. package/dist/types/components/SelectControl/SelectControl.d.ts +6 -6
  57. package/dist/types/components/SelectMultipleControl/SelectMultipleControl.d.ts +6 -6
  58. package/dist/types/components/SubmitAction/SubmitAction.d.ts +20 -20
  59. package/dist/types/components/TableControl/TableControl.d.ts +7 -7
  60. package/dist/types/components/TableControl/TableControlAddRowTrigger.d.ts +4 -4
  61. package/dist/types/components/TableControl/TableControlApi.d.ts +2 -2
  62. package/dist/types/components/TableControl/TableControlCell.d.ts +3 -3
  63. package/dist/types/components/TableControl/TableControlColumn.d.ts +3 -3
  64. package/dist/types/components/TableControl/TableControlContent.d.ts +3 -3
  65. package/dist/types/components/TableControl/TableControlContext.d.ts +4 -4
  66. package/dist/types/components/TableControl/TableControlRemoveRowTrigger.d.ts +9 -9
  67. package/dist/types/components/TableControl/TableControlRow.d.ts +3 -3
  68. package/dist/types/components/TextControl/TextControl.d.ts +8 -8
  69. package/dist/types/components/TopBar/TopBar.d.ts +3 -3
  70. package/dist/types/components/TopBar/TopBarActions.d.ts +3 -3
  71. package/dist/types/components/ValidateAction/ValidateAction.d.ts +2 -2
  72. package/dist/types/index.d.ts +1 -1
  73. package/dist/types/locales/en-GB.d.ts +3 -0
  74. package/dist/types/locales/en-US.d.ts +3 -0
  75. package/dist/types/{locale → locales}/en.d.ts +2 -2
  76. package/dist/types/locales/fr.d.ts +3 -0
  77. package/dist/types/locales/index.d.ts +4 -0
  78. package/dist/types/locales/pt.d.ts +3 -0
  79. package/dist/types/providers/LocalizationProvider/LocalizationContext.d.ts +6 -4
  80. package/dist/types/{locale → providers/LocalizationProvider}/LocalizationObject.d.ts +14 -15
  81. package/dist/types/providers/LocalizationProvider/LocalizationProvider.d.ts +17 -6
  82. package/dist/types/providers/LocalizationProvider/index.d.ts +1 -0
  83. package/dist/types/providers/LocalizationProvider/useLocale.d.ts +6 -3
  84. package/dist/types/providers/PrefixSuffixProvider/PrefixSuffixContext.d.ts +1 -4
  85. package/dist/types/providers/PrefixSuffixProvider/PrefixSuffixProvider.d.ts +3 -3
  86. package/dist/types/providers/PrefixSuffixProvider/defaultPrefixSuffix.d.ts +12 -0
  87. package/dist/types/providers/PrefixSuffixProvider/index.d.ts +1 -0
  88. package/dist/types/utils/options.d.ts +4 -4
  89. package/dist/types/utils/selectionTransformations.d.ts +2 -1
  90. package/dist/types/utils/useControlAutofocus.d.ts +2 -2
  91. package/dist/types/utils/useControlIssues.d.ts +3 -3
  92. package/dist/types/utils/useFormLoader.d.ts +3 -3
  93. package/dist/types/utils/useFormSaver.d.ts +3 -3
  94. package/dist/types/utils/useRegisterControl.d.ts +6 -6
  95. package/package.json +26 -10
  96. package/dist/ostack-ui-kform.cjs +0 -7534
  97. package/dist/ostack-ui-kform.cjs.map +0 -1
  98. package/dist/types/locale/defaultLocale.d.ts +0 -3
  99. package/dist/types/locale/en-GB.d.ts +0 -3
  100. package/dist/types/locale/en-US.d.ts +0 -3
  101. package/dist/types/locale/fr-FR.d.ts +0 -3
  102. package/dist/types/locale/index.d.ts +0 -6
  103. package/dist/types/locale/pt-PT.d.ts +0 -3
@@ -1,6 +1,6 @@
1
1
  import { AbsolutePath, type Path, PathMultimap, type PathMultimapEntryId } from "@ostack.tech/kform";
2
2
  import { type Controller } from "@ostack.tech/kform-react";
3
- import * as React from "react";
3
+ import { type ReactNode } from "react";
4
4
  import { type IssueMessagesByCode, type IssueMessageValue } from "../IssueMessages";
5
5
  import { type IssuesDisplayMode } from "./FormApp.tsx";
6
6
  /** Value of the form app context. */
@@ -31,19 +31,17 @@ export interface FormAppState<T> {
31
31
  }>
32
32
  ];
33
33
  deferredIssueMessageRemovalEntryIds: PathMultimapEntryId[];
34
- registeredLabels: [
35
- PathMultimap<{
36
- label: React.ReactNode;
37
- priority: number;
38
- }>
39
- ];
34
+ registeredLabels: [PathMultimap<{
35
+ label: ReactNode;
36
+ priority: number;
37
+ }>];
40
38
  deferredLabelRemovalEntryIds: PathMultimapEntryId[];
41
39
  actions: FormAppActions;
42
40
  }
43
41
  /** Item of a breadcrumb. */
44
42
  export interface BreadcrumbItem {
45
43
  path: AbsolutePath;
46
- label: React.ReactNode;
44
+ label: ReactNode;
47
45
  }
48
46
  /** Actions of the form app. */
49
47
  export interface FormAppActions {
@@ -55,8 +53,8 @@ export interface FormAppActions {
55
53
  setActivePath: (path: AbsolutePath) => void;
56
54
  registerIssueMessages: (basePath: AbsolutePath, issueMessages?: Record<string, IssueMessagesByCode>, priority?: number) => (() => void) | void;
57
55
  getRegisteredIssueMessage: (path: AbsolutePath, code: string) => IssueMessageValue | null;
58
- registerLabel: (path: AbsolutePath, label: React.ReactNode, priority?: number) => (() => void) | void;
59
- getRegisteredLabel: (path: AbsolutePath) => React.ReactNode;
56
+ registerLabel: (path: AbsolutePath, label: ReactNode, priority?: number) => (() => void) | void;
57
+ getRegisteredLabel: (path: AbsolutePath) => ReactNode;
60
58
  getActiveIssuesPanelBreadcrumb: () => BreadcrumbItem[] | null;
61
59
  startIssuesNavigation: (options?: {
62
60
  validate?: boolean;
@@ -66,7 +64,7 @@ export interface FormAppActions {
66
64
  /** Form app store. */
67
65
  export type FormAppStore<T> = ReturnType<typeof useCreateFormAppContext<T>>["store"];
68
66
  /** Form app context. */
69
- export declare const FormAppContext: React.Context<FormAppContextValue<unknown> | null>;
67
+ export declare const FormAppContext: import("react").Context<FormAppContextValue<unknown> | null>;
70
68
  /** Options used to create the data table context value. */
71
69
  export interface UseCreateFormAppContextOptions<T> extends Omit<FormAppContextValue<T>, "store"> {
72
70
  controller: Controller<T>;
@@ -121,7 +119,7 @@ export declare function useSetLeftSidebarWidth(): (width?: number) => void;
121
119
  export declare function useSetBottomPanelHeight(): (height?: number) => void;
122
120
  /**
123
121
  * Returns the current active path of the form app and a function that can be
124
- * used to set it, ala React.useState.
122
+ * used to set it, ala `useState`.
125
123
  */
126
124
  export declare function useIssuesPanelPath(): [
127
125
  AbsolutePath | null,
@@ -147,7 +145,7 @@ export declare function useRegisterIssueMessages(path: AbsolutePath | null | und
147
145
  /** Hook used to get the issue message value for the provided path and code. */
148
146
  export declare function useRegisteredIssueMessage(path: AbsolutePath | null | undefined, code: string): IssueMessageValue | null;
149
147
  /** Hook used to register a label within the form app. */
150
- export declare function useRegisterLabel(path: AbsolutePath | null | undefined, label: React.ReactNode, priority?: number): void;
148
+ export declare function useRegisterLabel(path: AbsolutePath | null | undefined, label: ReactNode, priority?: number): void;
151
149
  /**
152
150
  * Hook used to get the label parts associated with the active issues panel
153
151
  * path.
@@ -0,0 +1,9 @@
1
+ import { type ComponentPropsWithoutRef, type Dispatch, type SetStateAction } from "react";
2
+ import { type FormAppProps } from "./FormApp.tsx";
3
+ /** Properties of the form application element component. */
4
+ export interface FormAppElementProps extends Omit<ComponentPropsWithoutRef<"form">, "onSubmit" | "onReset">, Pick<FormAppProps, "minHeight"> {
5
+ formAppElement: HTMLFormElement | null;
6
+ setFormAppElement: Dispatch<SetStateAction<HTMLFormElement | null>>;
7
+ }
8
+ /** Form application element. */
9
+ export declare const FormAppElement: import("react").ForwardRefExoticComponent<FormAppElementProps & import("react").RefAttributes<HTMLFormElement>>;
@@ -1,5 +1,5 @@
1
1
  import { type Path } from "@ostack.tech/kform";
2
- import type * as React from "react";
2
+ import { type ReactNode } from "react";
3
3
  import { type IssueMessagesByCode } from "../IssueMessages";
4
4
  /** Properties of the form app issue messages component. */
5
5
  export interface FormAppIssueMessagesProps {
@@ -39,7 +39,7 @@ export interface FormAppIssueMessagesProps {
39
39
  * @default 0
40
40
  */
41
41
  priority?: number;
42
- children: React.ReactNode;
42
+ children: ReactNode;
43
43
  }
44
44
  /** Component used to register new issue messages within the form app. */
45
- export declare function FormAppIssueMessages({ path, issueMessages, priority, children, }: FormAppIssueMessagesProps): React.ReactNode;
45
+ export declare function FormAppIssueMessages({ path, issueMessages, priority, children, }: FormAppIssueMessagesProps): ReactNode;
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import { type ReactNode } from "react";
2
2
  /** Properties of the form app status component. */
3
3
  export interface FormAppStatusProps {
4
4
  /**
@@ -17,7 +17,7 @@ export interface FormAppStatusProps {
17
17
  * @default false
18
18
  */
19
19
  readOnly?: boolean;
20
- children: React.ReactNode;
20
+ children: ReactNode;
21
21
  }
22
22
  /** Component used to apply a different form app status to part of the form. */
23
23
  export declare function FormAppStatus({ disabled, readOnly, children, }: FormAppStatusProps): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,10 @@
1
1
  import { type Path } from "@ostack.tech/kform";
2
2
  import { Container, ErrorBoundary, type IconButton, type Popover, type PopoverContent, type Stack } from "@ostack.tech/ui";
3
- import * as React from "react";
3
+ import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
4
4
  import { type IssueMessages, type IssueMessagesByCode } from "../IssueMessages";
5
5
  import { type IssuesPopover } from "../IssuesPopover";
6
6
  /** Properties of the form page component. */
7
- export interface FormPageProps extends Omit<React.ComponentPropsWithoutRef<"div">, "children"> {
7
+ export interface FormPageProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
8
8
  /**
9
9
  * Form page path. This should match the path of the page provided to
10
10
  * `FormPages`.
@@ -15,7 +15,7 @@ export interface FormPageProps extends Omit<React.ComponentPropsWithoutRef<"div"
15
15
  /** Sets the form page as read-only. */
16
16
  readOnly?: boolean;
17
17
  /** Form page helper text, displayed as a popover triggered by an icon button. */
18
- helperText?: React.ReactNode;
18
+ helperText?: ReactNode;
19
19
  /**
20
20
  * Mapping of issue messages from the path of the field with issues to the
21
21
  * issue messages of said field (which are themselves grouped by their code).
@@ -52,35 +52,35 @@ export interface FormPageProps extends Omit<React.ComponentPropsWithoutRef<"div"
52
52
  */
53
53
  ownIssueMessages?: IssueMessagesByCode;
54
54
  /** Properties to pass to the header element. */
55
- headerProps?: React.ComponentPropsWithRef<"div">;
55
+ headerProps?: ComponentPropsWithRef<"div">;
56
56
  /** Label of the helper button announced to assistive technologies. */
57
57
  helperButtonLabel?: string;
58
58
  /** Properties to pass to the code element. */
59
- codeProps?: React.ComponentPropsWithRef<"div">;
59
+ codeProps?: ComponentPropsWithRef<"div">;
60
60
  /** Properties to pass to the title element. */
61
- titleProps?: React.ComponentPropsWithRef<"h2">;
61
+ titleProps?: ComponentPropsWithRef<"h2">;
62
62
  /**
63
63
  * Properties to pass to the element containing the popover components in the
64
64
  * header.
65
65
  */
66
- headerPopoverContainerProps?: React.ComponentPropsWithRef<typeof Stack>;
66
+ headerPopoverContainerProps?: ComponentPropsWithRef<typeof Stack>;
67
67
  /** Properties to pass to the form page's issues popover component. */
68
- issuesPopoverProps?: React.ComponentPropsWithRef<typeof IssuesPopover>;
68
+ issuesPopoverProps?: ComponentPropsWithRef<typeof IssuesPopover>;
69
69
  /** Properties to pass to the form page's issue messages component. */
70
- issueMessagesProps?: Omit<React.ComponentPropsWithRef<typeof IssueMessages>, "messages">;
70
+ issueMessagesProps?: Omit<ComponentPropsWithRef<typeof IssueMessages>, "messages">;
71
71
  /** Properties to pass to the content element. */
72
- contentProps?: React.ComponentPropsWithRef<"div">;
72
+ contentProps?: ComponentPropsWithRef<"div">;
73
73
  /** Properties to pass to the container component. */
74
- containerProps?: React.ComponentPropsWithRef<typeof Container>;
74
+ containerProps?: ComponentPropsWithRef<typeof Container>;
75
75
  /** Properties to pass to the `ErrorBoundary` component. */
76
- errorBoundaryProps?: React.ComponentPropsWithRef<typeof ErrorBoundary>;
76
+ errorBoundaryProps?: ComponentPropsWithRef<typeof ErrorBoundary>;
77
77
  /** Properties to pass to the helper button component. */
78
- helperButtonProps?: Omit<React.ComponentPropsWithRef<typeof IconButton>, "icon">;
78
+ helperButtonProps?: Omit<ComponentPropsWithRef<typeof IconButton>, "icon">;
79
79
  /** Properties to pass to the helper popover component. */
80
- helperPopoverProps?: React.ComponentPropsWithRef<typeof Popover>;
80
+ helperPopoverProps?: ComponentPropsWithRef<typeof Popover>;
81
81
  /** Properties to pass to the helper popover content component. */
82
- helperPopoverContentProps?: React.ComponentPropsWithRef<typeof PopoverContent>;
83
- children?: React.ReactNode;
82
+ helperPopoverContentProps?: ComponentPropsWithRef<typeof PopoverContent>;
83
+ children?: ReactNode;
84
84
  }
85
85
  /** Form page component. */
86
- export declare const FormPage: React.ForwardRefExoticComponent<FormPageProps & React.RefAttributes<HTMLDivElement>>;
86
+ export declare const FormPage: import("react").ForwardRefExoticComponent<FormPageProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,7 +1,7 @@
1
- import * as React from "react";
1
+ import { type ComponentPropsWithoutRef } from "react";
2
2
  import { type FormPageProps } from "./FormPage.tsx";
3
3
  /** Properties of the form page header. */
4
- export interface FormPageHeaderProps extends React.ComponentPropsWithoutRef<"div">, Pick<FormPageProps, "helperText" | "helperButtonLabel" | "ownIssueMessages" | "codeProps" | "titleProps" | "headerPopoverContainerProps" | "issuesPopoverProps" | "issueMessagesProps" | "helperButtonProps" | "helperPopoverProps" | "helperPopoverContentProps"> {
4
+ export interface FormPageHeaderProps extends ComponentPropsWithoutRef<"div">, Pick<FormPageProps, "helperText" | "helperButtonLabel" | "ownIssueMessages" | "codeProps" | "titleProps" | "headerPopoverContainerProps" | "issuesPopoverProps" | "issueMessagesProps" | "helperButtonProps" | "helperPopoverProps" | "helperPopoverContentProps"> {
5
5
  }
6
6
  /** Form page header. */
7
- export declare const FormPageHeader: React.ForwardRefExoticComponent<FormPageHeaderProps & React.RefAttributes<HTMLDivElement>>;
7
+ export declare const FormPageHeader: import("react").ForwardRefExoticComponent<FormPageHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,7 +1,7 @@
1
1
  import { type AbsolutePath, Path } from "@ostack.tech/kform";
2
- import * as React from "react";
2
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
3
3
  /** Properties of the form page component. */
4
- export interface FormPagesProps extends React.ComponentPropsWithoutRef<"div"> {
4
+ export interface FormPagesProps extends ComponentPropsWithoutRef<"div"> {
5
5
  /** Base path for all declared form pages. */
6
6
  path?: string | Path;
7
7
  /** List of all form pages. */
@@ -16,14 +16,14 @@ export interface FormPagesProps extends React.ComponentPropsWithoutRef<"div"> {
16
16
  * @param activePagePath Path of the new active form page.
17
17
  */
18
18
  onActivePageChange?: (activePagePath: AbsolutePath | null) => void;
19
- children?: React.ReactNode;
19
+ children?: ReactNode;
20
20
  }
21
21
  /** Object representation of a form page. */
22
22
  export interface FormPageObject<T = any> {
23
23
  /** Form page path. */
24
24
  path?: string | Path;
25
25
  /** Form page's title */
26
- title: React.ReactNode | ((value: T) => React.ReactNode);
26
+ title: ReactNode | ((value: T) => ReactNode);
27
27
  /**
28
28
  * Title of the form page as a string to display in the document's title.
29
29
  *
@@ -32,9 +32,9 @@ export interface FormPageObject<T = any> {
32
32
  */
33
33
  documentTitle?: string | null | ((value: T) => string | null);
34
34
  /** Form page's code. */
35
- code?: React.ReactNode;
35
+ code?: ReactNode;
36
36
  /** Form page's label in the issues panel. The `title` is used by default. */
37
- issuesPanelLabel?: React.ReactNode | ((value: T) => React.ReactNode);
37
+ issuesPanelLabel?: ReactNode | ((value: T) => ReactNode);
38
38
  }
39
39
  /** Root component used to render form pages. */
40
- export declare const FormPages: React.ForwardRefExoticComponent<FormPagesProps & React.RefAttributes<HTMLDivElement>>;
40
+ export declare const FormPages: import("react").ForwardRefExoticComponent<FormPagesProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,5 +1,5 @@
1
1
  import { AbsolutePath, type DisplayStatus, type Path, type SealedValidationIssue } from "@ostack.tech/kform";
2
- import * as React from "react";
2
+ import { type ReactNode } from "react";
3
3
  import { type FormPageObject, type FormPagesProps } from "./FormPages.tsx";
4
4
  /** Value of the form pages context. */
5
5
  export type FormPagesContextValue = FormPagesStore;
@@ -13,9 +13,9 @@ export interface FormPageState {
13
13
  exists: boolean;
14
14
  deferredDisplayStatus: DisplayStatus | undefined;
15
15
  deferredIssuesToDisplay: SealedValidationIssue[];
16
- title?: React.ReactNode;
16
+ title?: ReactNode;
17
17
  documentTitle?: string | null;
18
- code?: React.ReactNode;
18
+ code?: ReactNode;
19
19
  }
20
20
  /** State of the form pages. */
21
21
  export interface FormPagesState {
@@ -39,7 +39,7 @@ export interface FormPagesActions {
39
39
  /** Form pages store. */
40
40
  export type FormPagesStore = ReturnType<typeof useCreateFormPagesContext>;
41
41
  /** Form pages context. */
42
- export declare const FormPagesContext: React.Context<(Omit<import("zustand").StoreApi<FormPagesState>, "subscribe"> & {
42
+ export declare const FormPagesContext: import("react").Context<(Omit<import("zustand").StoreApi<FormPagesState>, "subscribe"> & {
43
43
  subscribe: {
44
44
  (listener: (selectedState: FormPagesState, previousSelectedState: FormPagesState) => void): () => void;
45
45
  <U>(selector: (state: FormPagesState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -1,12 +1,12 @@
1
- import * as React from "react";
1
+ import { type ComponentPropsWithoutRef, type ComponentPropsWithRef } from "react";
2
2
  import { FormPagesSelect } from "./FormPagesSelect.tsx";
3
3
  import { FormPagesSidebar } from "./FormPagesSidebar.tsx";
4
4
  /** Properties of the form pages navigation component. */
5
- export interface FormPagesNavigationProps extends React.ComponentPropsWithoutRef<"nav"> {
5
+ export interface FormPagesNavigationProps extends ComponentPropsWithoutRef<"nav"> {
6
6
  /** Properties to pass to the sidebar component. */
7
- sidebarProps?: React.ComponentPropsWithRef<typeof FormPagesSidebar>;
7
+ sidebarProps?: ComponentPropsWithRef<typeof FormPagesSidebar>;
8
8
  /** Properties to pass to the select component. */
9
- selectProps?: React.ComponentPropsWithRef<typeof FormPagesSelect>;
9
+ selectProps?: ComponentPropsWithRef<typeof FormPagesSelect>;
10
10
  }
11
11
  /** Component allowing the navigation between form pages. */
12
- export declare const FormPagesNavigation: React.ForwardRefExoticComponent<FormPagesNavigationProps & React.RefAttributes<HTMLElement>>;
12
+ export declare const FormPagesNavigation: import("react").ForwardRefExoticComponent<FormPagesNavigationProps & import("react").RefAttributes<HTMLElement>>;
@@ -1,7 +1,7 @@
1
1
  import { Select } from "@ostack.tech/ui";
2
- import * as React from "react";
2
+ import { type ComponentPropsWithoutRef } from "react";
3
3
  /** Properties of the form pages select component. */
4
- export interface FormPagesSelectProps extends Omit<React.ComponentPropsWithoutRef<typeof Select>, "multiple" | "defaultValue" | "value" | "onValueChange" | "showClearButton"> {
4
+ export interface FormPagesSelectProps extends Omit<ComponentPropsWithoutRef<typeof Select>, "multiple" | "defaultValue" | "value" | "onValueChange" | "showClearButton"> {
5
5
  }
6
6
  /** Select component allowing the navigation between form pages. */
7
- export declare const FormPagesSelect: React.ForwardRefExoticComponent<FormPagesSelectProps & React.RefAttributes<HTMLButtonElement>>;
7
+ export declare const FormPagesSelect: import("react").ForwardRefExoticComponent<FormPagesSelectProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,6 +1,6 @@
1
- import * as React from "react";
1
+ import { type ComponentPropsWithoutRef } from "react";
2
2
  /** Properties of the form pages sidebar component. */
3
- export interface FormPagesSidebarProps extends React.ComponentPropsWithoutRef<"aside"> {
3
+ export interface FormPagesSidebarProps extends ComponentPropsWithoutRef<"aside"> {
4
4
  }
5
5
  /** Sidebar component allowing the navigation between form pages. */
6
- export declare const FormPagesSidebar: React.ForwardRefExoticComponent<FormPagesSidebarProps & React.RefAttributes<HTMLElement>>;
6
+ export declare const FormPagesSidebar: import("react").ForwardRefExoticComponent<FormPagesSidebarProps & import("react").RefAttributes<HTMLElement>>;
@@ -1,8 +1,8 @@
1
1
  import { type Path } from "@ostack.tech/kform";
2
2
  import { ErrorBoundary, StepContent } from "@ostack.tech/ui";
3
- import * as React from "react";
3
+ import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
4
4
  /** Properties of the form step content component. */
5
- export interface FormStepContentProps extends Omit<React.ComponentPropsWithoutRef<typeof StepContent>, "index" | "children"> {
5
+ export interface FormStepContentProps extends Omit<ComponentPropsWithoutRef<typeof StepContent>, "index" | "children"> {
6
6
  /**
7
7
  * Step path. This should match the path of the step provided to
8
8
  * `FormStepper`.
@@ -13,8 +13,8 @@ export interface FormStepContentProps extends Omit<React.ComponentPropsWithoutRe
13
13
  /** Sets the step as read-only. */
14
14
  readOnly?: boolean;
15
15
  /** Properties to pass to the `ErrorBoundary` component. */
16
- errorBoundaryProps?: React.ComponentPropsWithRef<typeof ErrorBoundary>;
17
- children?: React.ReactNode;
16
+ errorBoundaryProps?: ComponentPropsWithRef<typeof ErrorBoundary>;
17
+ children?: ReactNode;
18
18
  }
19
19
  /** Component containing the content of a form step. */
20
- export declare const FormStepContent: React.ForwardRefExoticComponent<FormStepContentProps & React.RefAttributes<HTMLDivElement>>;
20
+ export declare const FormStepContent: import("react").ForwardRefExoticComponent<FormStepContentProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,7 +1,7 @@
1
1
  import { StepList } from "@ostack.tech/ui";
2
- import * as React from "react";
2
+ import { type ComponentPropsWithoutRef } from "react";
3
3
  /** Properties of the form steps sidebar component. */
4
- export interface FormStepListProps extends React.ComponentPropsWithoutRef<typeof StepList> {
4
+ export interface FormStepListProps extends ComponentPropsWithoutRef<typeof StepList> {
5
5
  }
6
6
  /** Component displaying all form steps in a list. */
7
- export declare const FormStepList: React.ForwardRefExoticComponent<FormStepListProps & React.RefAttributes<HTMLDivElement>>;
7
+ export declare const FormStepList: import("react").ForwardRefExoticComponent<FormStepListProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,8 +1,8 @@
1
1
  import { type AbsolutePath, Path, type SealedLocatedValidationIssue } from "@ostack.tech/kform";
2
2
  import { Stepper } from "@ostack.tech/ui";
3
- import * as React from "react";
3
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
4
4
  /** Properties of the form stepper component. */
5
- export interface FormStepperProps extends Omit<React.ComponentPropsWithoutRef<typeof Stepper>, "defaultActiveStep" | "activeStep" | "onActiveStepChange"> {
5
+ export interface FormStepperProps extends Omit<ComponentPropsWithoutRef<typeof Stepper>, "defaultActiveStep" | "activeStep" | "onActiveStepChange"> {
6
6
  /** Base path for all declared form steps. */
7
7
  path?: string | Path;
8
8
  /** List of all form steps. */
@@ -56,7 +56,7 @@ export interface FormStepObject<T = any> {
56
56
  /** Form step path. */
57
57
  path?: string | Path;
58
58
  /** Form step's title. */
59
- title: React.ReactNode | ((value: T) => React.ReactNode);
59
+ title: ReactNode | ((value: T) => ReactNode);
60
60
  /**
61
61
  * Title of the form step as a string to display in the document's title.
62
62
  *
@@ -65,7 +65,7 @@ export interface FormStepObject<T = any> {
65
65
  */
66
66
  documentTitle?: string | null | ((value: T) => string | null);
67
67
  /** Label of the form step in the issues panel. Uses the `title` by default. */
68
- issuesPanelLabel?: React.ReactNode | ((value: T) => React.ReactNode);
68
+ issuesPanelLabel?: ReactNode | ((value: T) => ReactNode);
69
69
  }
70
70
  /** Root component used to render form steps. */
71
- export declare const FormStepper: React.ForwardRefExoticComponent<FormStepperProps & React.RefAttributes<HTMLDivElement>>;
71
+ export declare const FormStepper: import("react").ForwardRefExoticComponent<FormStepperProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,5 +1,5 @@
1
1
  import { type AbsolutePath, type DisplayStatus, type FormManager } from "@ostack.tech/kform";
2
- import * as React from "react";
2
+ import { type ReactNode } from "react";
3
3
  import { type FormStepObject, type FormStepperProps } from "./FormStepper.tsx";
4
4
  /** Value of the form stepper context. */
5
5
  export type FormStepperContextValue = FormStepperStore;
@@ -14,7 +14,7 @@ export interface FormStepState {
14
14
  index: number;
15
15
  exists: boolean;
16
16
  deferredDisplayStatus: DisplayStatus | undefined;
17
- title?: React.ReactNode;
17
+ title?: ReactNode;
18
18
  documentTitle?: string | null;
19
19
  }
20
20
  /** State of the form stepper. */
@@ -36,7 +36,7 @@ export interface FormStepperActions {
36
36
  /** Form stepper store. */
37
37
  export type FormStepperStore = ReturnType<typeof useCreateFormStepperContext>;
38
38
  /** Form stepper context. */
39
- export declare const FormStepperContext: React.Context<(Omit<import("zustand").StoreApi<FormStepperState>, "subscribe"> & {
39
+ export declare const FormStepperContext: import("react").Context<(Omit<import("zustand").StoreApi<FormStepperState>, "subscribe"> & {
40
40
  subscribe: {
41
41
  (listener: (selectedState: FormStepperState, previousSelectedState: FormStepperState) => void): () => void;
42
42
  <U>(selector: (state: FormStepperState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -1,13 +1,13 @@
1
1
  import { type Path, type ValidationIssueData } from "@ostack.tech/kform";
2
2
  import { Alert } from "@ostack.tech/ui";
3
- import * as React from "react";
3
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
4
4
  /** Properties of the issue alert component. */
5
- export interface IssueAlertProps extends Omit<React.ComponentPropsWithoutRef<typeof Alert>, "severity" | "children"> {
5
+ export interface IssueAlertProps extends Omit<ComponentPropsWithoutRef<typeof Alert>, "severity" | "children"> {
6
6
  /** Path of the value with the issue in question. */
7
7
  path?: string | Path;
8
8
  /** Code of the issue in question. */
9
9
  code: string;
10
- children?: React.ReactNode | ((issueData: ValidationIssueData) => React.ReactNode);
10
+ children?: ReactNode | ((issueData: ValidationIssueData) => ReactNode);
11
11
  }
12
12
  /** Component used to display an issue alert. */
13
- export declare const IssueAlert: React.ForwardRefExoticComponent<IssueAlertProps & React.RefAttributes<HTMLDivElement>>;
13
+ export declare const IssueAlert: import("react").ForwardRefExoticComponent<IssueAlertProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,14 +1,14 @@
1
1
  import { type AbsolutePath, type Schema, type SealedValidationIssue } from "@ostack.tech/kform";
2
- import * as React from "react";
2
+ import { type ComponentPropsWithRef, type ReactNode } from "react";
3
3
  /** Properties of the issue message component. */
4
4
  export interface IssueMessageProps {
5
5
  displayIssueCode?: boolean;
6
- unknownErrorMessage?: React.ReactNode;
7
- unknownWarningMessage?: React.ReactNode;
6
+ unknownErrorMessage?: ReactNode;
7
+ unknownWarningMessage?: ReactNode;
8
8
  path: AbsolutePath;
9
9
  issue: SealedValidationIssue;
10
10
  schema: Schema;
11
- issueCodeProps?: React.ComponentPropsWithRef<"span">;
11
+ issueCodeProps?: ComponentPropsWithRef<"span">;
12
12
  }
13
13
  /** Single issue message within the issue messages or issues panel components. */
14
14
  export declare function IssueMessage({ path, issue, schema, displayIssueCode, unknownErrorMessage, unknownWarningMessage, issueCodeProps, }: IssueMessageProps): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,12 @@
1
1
  import { type AbsolutePath, type Path, type Schema, type SealedValidationIssue, type ValidationIssueData } from "@ostack.tech/kform";
2
2
  import { FeedbackList } from "@ostack.tech/ui";
3
- import * as React from "react";
3
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
4
4
  /** Value of an issue message. */
5
- export type IssueMessageValue = React.ReactNode | ((issueData: ValidationIssueData, schema: Schema, path: AbsolutePath) => React.ReactNode);
5
+ export type IssueMessageValue = ReactNode | ((issueData: ValidationIssueData, schema: Schema, path: AbsolutePath) => ReactNode);
6
6
  /** Mapping of issue message codes to their respective message. */
7
7
  export type IssueMessagesByCode = Record<string, IssueMessageValue>;
8
8
  /** Properties of the issue messages component. */
9
- export interface IssueMessagesProps extends React.ComponentPropsWithoutRef<typeof FeedbackList> {
9
+ export interface IssueMessagesProps extends ComponentPropsWithoutRef<typeof FeedbackList> {
10
10
  /** Path of the value for which to show issues. */
11
11
  path?: string | Path;
12
12
  /**
@@ -29,14 +29,14 @@ export interface IssueMessagesProps extends React.ComponentPropsWithoutRef<typeo
29
29
  * This message will always automatically include the code of the issue in
30
30
  * question.
31
31
  */
32
- unknownErrorMessage?: React.ReactNode;
32
+ unknownErrorMessage?: ReactNode;
33
33
  /**
34
34
  * Message to show for a warning that does not have an associated message.
35
35
  *
36
36
  * This message will always automatically include the code of the issue in
37
37
  * question.
38
38
  */
39
- unknownWarningMessage?: React.ReactNode;
39
+ unknownWarningMessage?: ReactNode;
40
40
  /**
41
41
  * Whether to render the issue messages "unwrapped", i.e. outside a containing
42
42
  * `FeedbackList`.
@@ -67,4 +67,4 @@ export interface IssueMessagesProps extends React.ComponentPropsWithoutRef<typeo
67
67
  * If `path` contains an issue without an associated issue message, a generic
68
68
  * message is displayed together with a console warning.
69
69
  */
70
- export declare const IssueMessages: React.ForwardRefExoticComponent<IssueMessagesProps & React.RefAttributes<HTMLUListElement>>;
70
+ export declare const IssueMessages: import("react").ForwardRefExoticComponent<IssueMessagesProps & import("react").RefAttributes<HTMLUListElement>>;
@@ -1,8 +1,8 @@
1
1
  import { type IssuesTrackerOptions } from "@ostack.tech/kform-react";
2
2
  import { type Card, type CardBody, type CardHeader, type CardTitle, type CloseButton, type Icon, type IconButton, type Spinner } from "@ostack.tech/ui";
3
- import * as React from "react";
3
+ import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from "react";
4
4
  /** Properties of the issues navigation component. */
5
- export interface IssuesPanelProps extends Pick<IssuesTrackerOptions, "issuesOrderCompareFn">, Omit<React.ComponentPropsWithoutRef<typeof Card>, "children" | "variant" | "color"> {
5
+ export interface IssuesPanelProps extends Pick<IssuesTrackerOptions, "issuesOrderCompareFn">, Omit<ComponentPropsWithoutRef<typeof Card>, "children" | "variant" | "color"> {
6
6
  /** Default open state of the issues navigation panel. */
7
7
  defaultOpen?: boolean;
8
8
  /** Controlled open state of the issues navigation panel. */
@@ -27,28 +27,28 @@ export interface IssuesPanelProps extends Pick<IssuesTrackerOptions, "issuesOrde
27
27
  * This message will always automatically include the code of the issue in
28
28
  * question.
29
29
  */
30
- unknownErrorMessage?: React.ReactNode;
30
+ unknownErrorMessage?: ReactNode;
31
31
  /**
32
32
  * Message to show for a warning that does not have an associated message.
33
33
  *
34
34
  * This message will always automatically include the code of the issue in
35
35
  * question.
36
36
  */
37
- unknownWarningMessage?: React.ReactNode;
37
+ unknownWarningMessage?: ReactNode;
38
38
  /**
39
39
  * Errors label.
40
40
  *
41
41
  * @param errors Number of errors. If undefined, the function should return a
42
42
  * generic label with no number.
43
43
  */
44
- errorsLabel?: (errors?: number) => React.ReactNode;
44
+ errorsLabel?: (errors?: number) => ReactNode;
45
45
  /**
46
46
  * Warnings label.
47
47
  *
48
48
  * @param warnings Number of warnings. If undefined, the function should
49
49
  * return a generic label with no number.
50
50
  */
51
- warningsLabel?: (warnings?: number) => React.ReactNode;
51
+ warningsLabel?: (warnings?: number) => ReactNode;
52
52
  /** Label of the focus button. */
53
53
  focusButtonLabel?: string;
54
54
  /** Label of the "previous issue" button. */
@@ -66,41 +66,41 @@ export interface IssuesPanelProps extends Pick<IssuesTrackerOptions, "issuesOrde
66
66
  * @param currentPage Current page.
67
67
  * @param totalPages Total number of pages.
68
68
  */
69
- paginationLabel?: (currentPage: number, totalPages: number) => React.ReactNode;
69
+ paginationLabel?: (currentPage: number, totalPages: number) => ReactNode;
70
70
  /** Message to display when there are no issues to report. */
71
- noIssuesMessage?: React.ReactNode;
71
+ noIssuesMessage?: ReactNode;
72
72
  /** Title to display when all issues of the active path have been resolved. */
73
- resolvedTitle?: React.ReactNode;
73
+ resolvedTitle?: ReactNode;
74
74
  /** Message to display when all issues of the active path have been resolved. */
75
- resolvedMessage?: React.ReactNode;
75
+ resolvedMessage?: ReactNode;
76
76
  /** Properties to pass to the container element. */
77
- containerProps?: React.ComponentPropsWithRef<"div">;
77
+ containerProps?: ComponentPropsWithRef<"div">;
78
78
  /** Properties to pass to the card header component. */
79
- headerProps?: React.ComponentPropsWithRef<typeof CardHeader>;
79
+ headerProps?: ComponentPropsWithRef<typeof CardHeader>;
80
80
  /** Properties to pass to the card body component. */
81
- bodyProps?: React.ComponentPropsWithRef<typeof CardBody>;
81
+ bodyProps?: ComponentPropsWithRef<typeof CardBody>;
82
82
  /** Properties to pass to the loading `Spinner` component. */
83
- loadingSpinnerProps?: React.ComponentPropsWithRef<typeof Spinner>;
83
+ loadingSpinnerProps?: ComponentPropsWithRef<typeof Spinner>;
84
84
  /** Properties to pass to the validating `Spinner` component. */
85
- validatingSpinnerProps?: React.ComponentPropsWithRef<typeof Spinner>;
85
+ validatingSpinnerProps?: ComponentPropsWithRef<typeof Spinner>;
86
86
  /** Properties to pass to the pagination element. */
87
- paginationProps?: React.ComponentPropsWithRef<"div">;
87
+ paginationProps?: ComponentPropsWithRef<"div">;
88
88
  /** Properties to pass to the "focus" button component. */
89
- focusButtonProps?: Omit<React.ComponentPropsWithRef<typeof IconButton>, "label">;
89
+ focusButtonProps?: Omit<ComponentPropsWithRef<typeof IconButton>, "label">;
90
90
  /** Properties to pass to the "previous issue" button component. */
91
- previousIssueButtonProps?: Omit<React.ComponentPropsWithRef<typeof IconButton>, "label">;
91
+ previousIssueButtonProps?: Omit<ComponentPropsWithRef<typeof IconButton>, "label">;
92
92
  /** Properties to pass to the "next issue" button component. */
93
- nextIssueButtonProps?: Omit<React.ComponentPropsWithRef<typeof IconButton>, "label">;
93
+ nextIssueButtonProps?: Omit<ComponentPropsWithRef<typeof IconButton>, "label">;
94
94
  /** Properties to pass to the "first issue" button component. */
95
- firstIssueButtonProps?: Omit<React.ComponentPropsWithRef<typeof IconButton>, "label">;
95
+ firstIssueButtonProps?: Omit<ComponentPropsWithRef<typeof IconButton>, "label">;
96
96
  /** Properties to pass to the "last issue" button component. */
97
- lastIssueButtonProps?: Omit<React.ComponentPropsWithRef<typeof IconButton>, "label">;
97
+ lastIssueButtonProps?: Omit<ComponentPropsWithRef<typeof IconButton>, "label">;
98
98
  /** Properties to pass to the icon component. */
99
- iconProps?: Omit<React.ComponentPropsWithRef<typeof Icon>, "icon">;
99
+ iconProps?: Omit<ComponentPropsWithRef<typeof Icon>, "icon">;
100
100
  /** Properties to pass to the title component. */
101
- titleProps?: React.ComponentPropsWithRef<typeof CardTitle>;
101
+ titleProps?: ComponentPropsWithRef<typeof CardTitle>;
102
102
  /** Properties to pass to the close button component. */
103
- closeButtonProps?: React.ComponentPropsWithRef<typeof CloseButton>;
103
+ closeButtonProps?: ComponentPropsWithRef<typeof CloseButton>;
104
104
  }
105
105
  /** Component used to navigate through the issues of the form. */
106
- export declare const IssuesPanel: React.ForwardRefExoticComponent<IssuesPanelProps & React.RefAttributes<HTMLDivElement>>;
106
+ export declare const IssuesPanel: import("react").ForwardRefExoticComponent<IssuesPanelProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,13 +1,13 @@
1
1
  import { type AbsolutePath } from "@ostack.tech/kform";
2
2
  import { type Controller, type IssuesTrackerResult } from "@ostack.tech/kform-react";
3
3
  import { Card, type IconButtonColor } from "@ostack.tech/ui";
4
- import * as React from "react";
4
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
5
5
  import { type IssuesPanelProps } from "./IssuesPanel.tsx";
6
- export interface IssuesPanelMessagesCardProps extends React.ComponentPropsWithoutRef<typeof Card>, Pick<IssuesPanelProps, "displayIssueCodes" | "unknownErrorMessage" | "unknownWarningMessage" | "errorsLabel" | "warningsLabel" | "noIssuesMessage" | "resolvedTitle" | "resolvedMessage" | "headerProps" | "bodyProps" | "loadingSpinnerProps" | "titleProps" | "iconProps"> {
6
+ export interface IssuesPanelMessagesCardProps extends ComponentPropsWithoutRef<typeof Card>, Pick<IssuesPanelProps, "displayIssueCodes" | "unknownErrorMessage" | "unknownWarningMessage" | "errorsLabel" | "warningsLabel" | "noIssuesMessage" | "resolvedTitle" | "resolvedMessage" | "headerProps" | "bodyProps" | "loadingSpinnerProps" | "titleProps" | "iconProps"> {
7
7
  currentPagePath: AbsolutePath | null;
8
8
  currentPageController: Controller;
9
9
  issuesTrackerResult: IssuesTrackerResult;
10
10
  currentPageIndex: number;
11
- renderControls: (buttonsColor?: IconButtonColor) => React.ReactNode;
11
+ renderControls: (buttonsColor?: IconButtonColor) => ReactNode;
12
12
  }
13
- export declare const IssuesPanelMessagesCard: React.ForwardRefExoticComponent<IssuesPanelMessagesCardProps & React.RefAttributes<HTMLDivElement>>;
13
+ export declare const IssuesPanelMessagesCard: import("react").ForwardRefExoticComponent<IssuesPanelMessagesCardProps & import("react").RefAttributes<HTMLDivElement>>;