burne-ui 1.7.5 → 1.7.6
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/components/composite/Form/Form.d.ts +4 -4
- package/dist/components/composite/Form/formContext.d.ts +7 -4
- package/dist/components/composite/Form/formParts.d.ts +3 -0
- package/dist/components/composite/Form/formStyles.d.ts +23 -6
- package/dist/components/composite/Form/formTypes.d.ts +16 -3
- package/dist/components/composite/Form/index.d.ts +5 -2
- package/dist/components/composite/Form/useFormRootState.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8985 -8894
- package/dist/ui.css +19 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormActions, FormAnnounce, FormDescription, FormErrorSummary, FormField, FormSection, FormTitle } from './formParts';
|
|
2
|
-
export type { FormProps, FormSectionProps, FormTitleProps, FormDescriptionProps, FormActionsProps, FormErrorSummaryProps, FormAnnounceProps, FormFieldProps, FormClassNames, } from './formTypes';
|
|
1
|
+
import { FormActions, FormAnnounce, FormDescription, FormErrorSummary, FormField, FormHeader, FormSection, FormTitle } from './formParts';
|
|
2
|
+
export type { FormProps, FormSectionProps, FormHeaderProps, FormTitleProps, FormDescriptionProps, FormActionsProps, FormErrorSummaryProps, FormAnnounceProps, FormFieldProps, FormClassNames, FormSize, } from './formTypes';
|
|
3
3
|
export declare const FormRoot: import('react').ForwardRefExoticComponent<Omit<import('react').FormHTMLAttributes<HTMLFormElement>, "onSubmit"> & {
|
|
4
4
|
children?: import('react').ReactNode;
|
|
5
5
|
classNames?: import('../../..').Prettify<import('./formTypes').FormClassNames>;
|
|
@@ -11,9 +11,9 @@ export declare const FormRoot: import('react').ForwardRefExoticComponent<Omit<im
|
|
|
11
11
|
validateMode?: import('./formTypes').FormValidateMode;
|
|
12
12
|
readOnly?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
|
-
size?: import('
|
|
14
|
+
size?: import('./formTypes').FormSize;
|
|
15
15
|
onSubmit?: (values: import('./formTypes').FormValues) => void | Promise<void>;
|
|
16
16
|
onSubmitError?: (errors: Record<string, string>) => void;
|
|
17
17
|
errorSummary?: import('react').ReactNode | ((entries: Array<[string, string]>) => import('react').ReactNode);
|
|
18
18
|
} & import('react').RefAttributes<HTMLFormElement>>;
|
|
19
|
-
export { FormSection, FormTitle, FormDescription, FormActions, FormErrorSummary, FormAnnounce, FormField, };
|
|
19
|
+
export { FormSection, FormHeader, FormTitle, FormDescription, FormActions, FormErrorSummary, FormAnnounce, FormField, };
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Prettify } from '../../../utils/prettify';
|
|
3
|
-
import { FormBindingContextValue, FormClassNames,
|
|
3
|
+
import { FormBindingContextValue, FormClassNames, FormShellValue, FormSize } from './formTypes';
|
|
4
4
|
declare const FormBindingContext: import('react').Context<FormBindingContextValue | null>;
|
|
5
5
|
export declare function FormClassNamesProvider({ classNames, children, }: {
|
|
6
6
|
classNames?: Prettify<FormClassNames>;
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function FormShellProvider({ shellIds, children, }: {
|
|
10
|
-
shellIds:
|
|
9
|
+
export declare function FormShellProvider({ shellIds, size, children, }: {
|
|
10
|
+
shellIds: FormShellValue["shellIds"];
|
|
11
|
+
size?: FormSize;
|
|
11
12
|
children: ReactNode;
|
|
12
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export declare function useFormClassNames(): FormClassNames;
|
|
14
|
-
export declare function
|
|
15
|
+
export declare function useFormShell(): FormShellValue | null;
|
|
16
|
+
export declare function useFormShellIds(): import('./formTypes').FormShellIds | null;
|
|
17
|
+
export declare function useFormSize(): FormSize;
|
|
15
18
|
export declare function useOptionalFormBindingContext(): FormBindingContextValue | null;
|
|
16
19
|
export declare function useFormBindingContext(): FormBindingContextValue;
|
|
17
20
|
export { FormBindingContext };
|
|
@@ -2,6 +2,9 @@ import { FormActionsProps, FormDescriptionProps, FormTitleProps } from './formTy
|
|
|
2
2
|
export declare const FormSection: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
3
3
|
classNames?: import('../../..').Prettify<Pick<import('./formTypes').FormClassNames, "section">>;
|
|
4
4
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const FormHeader: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
classNames?: import('../../..').Prettify<Pick<import('./formTypes').FormClassNames, "header">>;
|
|
7
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
8
|
export declare const FormTitle: import('react').ForwardRefExoticComponent<FormTitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
6
9
|
export declare const FormDescription: import('react').ForwardRefExoticComponent<FormDescriptionProps & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
7
10
|
export declare const FormActions: import('react').ForwardRefExoticComponent<FormActionsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
import { TextVariant } from '../../core/Text';
|
|
1
2
|
import { Prettify } from '../../../utils/prettify';
|
|
2
|
-
import { FormClassNames } from './formTypes';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { FormClassNames, FormSize } from './formTypes';
|
|
4
|
+
export type { FormSize };
|
|
5
|
+
export type FormSizeLayout = {
|
|
6
|
+
rootGap: string;
|
|
7
|
+
headingGap: string;
|
|
8
|
+
sectionGap: string;
|
|
9
|
+
actionsGap: string;
|
|
10
|
+
actionsPaddingTop: string;
|
|
11
|
+
titleVariant: TextVariant;
|
|
12
|
+
titleClassName: string;
|
|
13
|
+
descClassName: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const FORM_SIZE_LAYOUT: Record<FormSize, FormSizeLayout>;
|
|
16
|
+
export declare function resolveFormSize(size?: FormSize): FormSize;
|
|
17
|
+
export declare function formSizeLayout(size?: FormSize): FormSizeLayout;
|
|
18
|
+
export declare function formRootClass(size?: FormSize, className?: string, classNames?: Prettify<FormClassNames>): string;
|
|
19
|
+
export declare function formHeaderClass(size?: FormSize, className?: string, classNames?: Prettify<FormClassNames>): string;
|
|
20
|
+
export declare function formSectionClass(size?: FormSize, className?: string, classNames?: Prettify<FormClassNames>): string;
|
|
21
|
+
export declare function formTitleClass(size?: FormSize, className?: string, classNames?: Prettify<FormClassNames>): string;
|
|
22
|
+
export declare function formTitleVariant(size?: FormSize): TextVariant;
|
|
23
|
+
export declare function formDescriptionClass(size?: FormSize, className?: string, classNames?: Prettify<FormClassNames>): string;
|
|
24
|
+
export declare function formActionsClass(size?: FormSize, className?: string, classNames?: Prettify<FormClassNames>): string;
|
|
8
25
|
export declare function formErrorSummaryClass(className?: string, classNames?: Prettify<FormClassNames>): string;
|
|
9
26
|
export declare function formAnnounceClass(className?: string, classNames?: Prettify<FormClassNames>): string;
|
|
10
27
|
export declare function formFieldClass(className?: string, classNames?: Prettify<FormClassNames>): string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { FormHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { Prettify } from '../../../utils/prettify';
|
|
3
2
|
import { ComponentSize } from '../../core/utils/sizeLayout';
|
|
3
|
+
import { Prettify } from '../../../utils/prettify';
|
|
4
4
|
export type FormValues = Record<string, unknown>;
|
|
5
5
|
export type FormValidateMode = "onSubmit" | "onBlur" | "onChange";
|
|
6
|
+
/** Form chrome size — Header / Title / Description / Section / Actions. Not cascaded to fields. */
|
|
7
|
+
export type FormSize = ComponentSize;
|
|
6
8
|
export type FormFieldRules = {
|
|
7
9
|
required?: boolean | string;
|
|
8
10
|
minLength?: {
|
|
@@ -27,7 +29,6 @@ export type FormResolver<TValues extends FormValues = FormValues> = (values: TVa
|
|
|
27
29
|
export type FormBindingContextValue = {
|
|
28
30
|
disabled: boolean;
|
|
29
31
|
readOnly: boolean;
|
|
30
|
-
size?: ComponentSize;
|
|
31
32
|
validateMode: FormValidateMode;
|
|
32
33
|
isSubmitting: boolean;
|
|
33
34
|
submitCount: number;
|
|
@@ -70,6 +71,7 @@ export type UseFormFieldBindingOptions = {
|
|
|
70
71
|
};
|
|
71
72
|
export type FormClassNames = {
|
|
72
73
|
root?: string;
|
|
74
|
+
header?: string;
|
|
73
75
|
section?: string;
|
|
74
76
|
title?: string;
|
|
75
77
|
description?: string;
|
|
@@ -89,7 +91,11 @@ export type FormProps = Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"> &
|
|
|
89
91
|
validateMode?: FormValidateMode;
|
|
90
92
|
readOnly?: boolean;
|
|
91
93
|
disabled?: boolean;
|
|
92
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Scales Form chrome only (`Header`, `Title`, `Description`, `Section`, `Actions`).
|
|
96
|
+
* Does not cascade into embedded controls (`Input`, `Button`, …) — set their `size` explicitly.
|
|
97
|
+
*/
|
|
98
|
+
size?: FormSize;
|
|
93
99
|
onSubmit?: (values: FormValues) => void | Promise<void>;
|
|
94
100
|
onSubmitError?: (errors: Record<string, string>) => void;
|
|
95
101
|
/** Passed to the auto-rendered `Form.ErrorSummary` (`children` / render prop). */
|
|
@@ -98,6 +104,9 @@ export type FormProps = Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"> &
|
|
|
98
104
|
export type FormSectionProps = HTMLAttributes<HTMLDivElement> & {
|
|
99
105
|
classNames?: Prettify<Pick<FormClassNames, "section">>;
|
|
100
106
|
};
|
|
107
|
+
export type FormHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
108
|
+
classNames?: Prettify<Pick<FormClassNames, "header">>;
|
|
109
|
+
};
|
|
101
110
|
export type FormTitleProps = HTMLAttributes<HTMLHeadingElement>;
|
|
102
111
|
export type FormDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
103
112
|
export type FormActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
@@ -123,3 +132,7 @@ export type FormShellIds = {
|
|
|
123
132
|
errorSummaryId: string;
|
|
124
133
|
announceId: string;
|
|
125
134
|
};
|
|
135
|
+
export type FormShellValue = {
|
|
136
|
+
shellIds: FormShellIds;
|
|
137
|
+
size: FormSize;
|
|
138
|
+
};
|
|
@@ -9,7 +9,7 @@ export declare const Form: import('react').ForwardRefExoticComponent<Omit<import
|
|
|
9
9
|
validateMode?: import('./formTypes').FormValidateMode;
|
|
10
10
|
readOnly?: boolean;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
-
size?: import('
|
|
12
|
+
size?: import('./formTypes').FormSize;
|
|
13
13
|
onSubmit?: (values: import('./formTypes').FormValues) => void | Promise<void>;
|
|
14
14
|
onSubmitError?: (errors: Record<string, string>) => void;
|
|
15
15
|
errorSummary?: import('react').ReactNode | ((entries: Array<[string, string]>) => import('react').ReactNode);
|
|
@@ -17,6 +17,9 @@ export declare const Form: import('react').ForwardRefExoticComponent<Omit<import
|
|
|
17
17
|
Section: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
18
18
|
classNames?: import('../../..').Prettify<Pick<import('./formTypes').FormClassNames, "section">>;
|
|
19
19
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
20
|
+
Header: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
21
|
+
classNames?: import('../../..').Prettify<Pick<import('./formTypes').FormClassNames, "header">>;
|
|
22
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
20
23
|
Title: import('react').ForwardRefExoticComponent<import('./formTypes').FormTitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
21
24
|
Description: import('react').ForwardRefExoticComponent<import('./formTypes').FormDescriptionProps & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
22
25
|
Actions: import('react').ForwardRefExoticComponent<import('./formTypes').FormActionsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -32,7 +35,7 @@ export declare const Form: import('react').ForwardRefExoticComponent<Omit<import
|
|
|
32
35
|
classNames?: import('../../..').Prettify<Pick<import('./formTypes').FormClassNames, "field">>;
|
|
33
36
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
34
37
|
};
|
|
35
|
-
export type { FormProps, FormSectionProps, FormTitleProps, FormDescriptionProps, FormActionsProps, FormErrorSummaryProps, FormAnnounceProps, FormFieldProps, FormClassNames, } from './Form';
|
|
38
|
+
export type { FormProps, FormSectionProps, FormHeaderProps, FormTitleProps, FormDescriptionProps, FormActionsProps, FormErrorSummaryProps, FormAnnounceProps, FormFieldProps, FormClassNames, FormSize, } from './Form';
|
|
36
39
|
export { useFormField, useFormControlProps, } from './useFormControlProps';
|
|
37
40
|
export { useFormFieldBinding } from './useFormFieldBinding';
|
|
38
41
|
export { useOptionalFormBindingContext, useFormBindingContext, } from './formContext';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FormEvent } from 'react';
|
|
2
2
|
import { FormBindingContextValue, FormShellIds, UseFormRootStateProps } from './formTypes';
|
|
3
|
-
export declare function useFormRootState({ defaultValues, values: valuesProp, onValuesChange, rules: rulesProp, resolver, validateMode, disabled, readOnly,
|
|
3
|
+
export declare function useFormRootState({ defaultValues, values: valuesProp, onValuesChange, rules: rulesProp, resolver, validateMode, disabled, readOnly, onSubmit, onSubmitError, }: UseFormRootStateProps): {
|
|
4
4
|
shellIds: FormShellIds;
|
|
5
5
|
bindingValue: FormBindingContextValue;
|
|
6
6
|
handleSubmit: (event: FormEvent<HTMLFormElement>) => Promise<void>;
|