stratosphere-ui 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import { HTMLProps } from 'react';
2
+ export interface FormLabelTextProps extends HTMLProps<HTMLSpanElement> {
3
+ isRequired?: boolean;
4
+ }
5
+ export declare const FormLabelText: import("react").ForwardRefExoticComponent<Omit<FormLabelTextProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
@@ -3,7 +3,7 @@ export * from './FormCheckbox';
3
3
  export * from './FormControl';
4
4
  export * from './FormError';
5
5
  export * from './FormFileInput';
6
- export * from './FormLabel';
6
+ export * from './FormLabelText';
7
7
  export * from './FormRadio';
8
8
  export * from './FormRadioGroup';
9
9
  export * from './FormRadioGroupOption';
@@ -1,9 +1,9 @@
1
1
  import { URLSearchParamsInit } from 'react-router-dom';
2
- import { DefaultValues, FieldPath, FieldValues, Path, PathValue, UseFormProps, UseFormReturn } from 'react-hook-form';
2
+ import { DefaultValues, FieldPath, FieldPathValues, FieldValues, UseFormProps, UseFormReturn } from 'react-hook-form';
3
3
  export type QueryParamValues<FormValues extends FieldValues> = Partial<Record<keyof FormValues, string | null>>;
4
- export interface UseFormWithQueryParamsOptions<FormValues extends FieldValues, FormContext = any> extends Omit<UseFormProps<FormValues, FormContext>, 'defaultValues'> {
4
+ export interface UseFormWithQueryParamsOptions<FormValues extends FieldValues = FieldValues, FieldNames extends readonly FieldPath<FormValues>[] = readonly FieldPath<FormValues>[], FormContext = any> extends Omit<UseFormProps<FormValues, FormContext>, 'defaultValues'> {
5
5
  getDefaultValues: (searchParamValues: QueryParamValues<FormValues>) => DefaultValues<FormValues>;
6
- getSearchParams: (formValues: PathValue<FormValues, Path<FormValues>>[]) => URLSearchParamsInit | ((prev: URLSearchParams) => URLSearchParamsInit);
7
- includeKeys: readonly FieldPath<FormValues>[];
6
+ getSearchParams: (formValues: FieldPathValues<FormValues, FieldNames>) => URLSearchParamsInit | ((prev: URLSearchParams) => URLSearchParamsInit);
7
+ includeKeys: readonly [...FieldNames];
8
8
  }
9
- export declare const useFormWithQueryParams: <FormValues extends FieldValues, FormContext = any, TransformedValues extends FieldValues | undefined = undefined>({ getDefaultValues, getSearchParams, includeKeys, ...useFormOptions }: UseFormWithQueryParamsOptions<FormValues, FormContext>) => UseFormReturn<FormValues, FormContext, TransformedValues>;
9
+ export declare const useFormWithQueryParams: <FormValues extends FieldValues = FieldValues, FieldNames extends readonly FieldPath<FormValues>[] = readonly FieldPath<FormValues>[], FormContext = any, TransformedValues extends FieldValues | undefined = undefined>({ getDefaultValues, getSearchParams, includeKeys, ...useFormOptions }: UseFormWithQueryParamsOptions<FormValues, FieldNames, FormContext>) => UseFormReturn<FormValues, FormContext, TransformedValues>;