react-better-html 1.1.89 → 1.1.90
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/index.d.mts +40 -38
- package/dist/index.d.ts +40 -38
- package/dist/index.js +76 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +78 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WebTarget } from 'styled-components';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ComponentType, ComponentProps, ReactNode } from 'react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
type PluginName = "react-router-dom";
|
|
@@ -36,7 +36,7 @@ type DeepPartialRecord<T> = {
|
|
|
36
36
|
type PickAllRequired<T, K extends keyof T> = Required<Pick<T, K>>;
|
|
37
37
|
type AnyOtherString = Omit<string & {}, "">;
|
|
38
38
|
|
|
39
|
-
type DivProps<Value> = {
|
|
39
|
+
type DivProps<Value = unknown> = {
|
|
40
40
|
value?: Value;
|
|
41
41
|
/** @default "div" */
|
|
42
42
|
as?: WebTarget;
|
|
@@ -66,14 +66,14 @@ declare const Div: typeof DivComponent & {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
type TextAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "label";
|
|
69
|
-
type TextProps = {
|
|
69
|
+
type TextProps<As extends TextAs = "p"> = {
|
|
70
70
|
/** @default "p" */
|
|
71
|
-
as?:
|
|
72
|
-
} & OmitProps<React.ComponentProps<
|
|
71
|
+
as?: As;
|
|
72
|
+
} & OmitProps<React.ComponentProps<As>, "style"> & ComponentStyle & ComponentHoverStyle;
|
|
73
73
|
type TextComponentType = {
|
|
74
|
-
(props: ComponentPropWithRef<HTMLParagraphElement, TextProps
|
|
75
|
-
unknown: (props: ComponentPropWithRef<HTMLParagraphElement, TextProps
|
|
76
|
-
oneLine: (props: ComponentPropWithRef<HTMLParagraphElement, TextProps
|
|
74
|
+
<As extends TextAs>(props: ComponentPropWithRef<HTMLParagraphElement, TextProps<As>>): React.ReactElement;
|
|
75
|
+
unknown: <As extends TextAs>(props: ComponentPropWithRef<HTMLParagraphElement, TextProps<As>>) => React.ReactElement;
|
|
76
|
+
oneLine: <As extends TextAs>(props: ComponentPropWithRef<HTMLParagraphElement, TextProps<As>>) => React.ReactElement;
|
|
77
77
|
};
|
|
78
78
|
declare const TextComponent: TextComponentType;
|
|
79
79
|
declare const Text: typeof TextComponent & {
|
|
@@ -110,7 +110,7 @@ type LoaderProps = {
|
|
|
110
110
|
width?: number;
|
|
111
111
|
/** @default false */
|
|
112
112
|
disabled?: boolean;
|
|
113
|
-
} & OmitProps<DivProps
|
|
113
|
+
} & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName">;
|
|
114
114
|
type LoaderComponentType = {
|
|
115
115
|
(props: LoaderProps): React.ReactElement;
|
|
116
116
|
box: (props: OmitProps<LoaderProps, "size"> & {
|
|
@@ -254,8 +254,8 @@ type HorizontalDividerProps = DividerProps & {
|
|
|
254
254
|
textColor?: string;
|
|
255
255
|
};
|
|
256
256
|
declare const _default$6: {
|
|
257
|
-
vertical:
|
|
258
|
-
horizontal:
|
|
257
|
+
vertical: react.NamedExoticComponent<VerticalDividerProps>;
|
|
258
|
+
horizontal: react.NamedExoticComponent<HorizontalDividerProps>;
|
|
259
259
|
};
|
|
260
260
|
|
|
261
261
|
type ModalProps = {
|
|
@@ -307,22 +307,22 @@ type PageHolderProps = {
|
|
|
307
307
|
children?: React.ReactNode;
|
|
308
308
|
} & ComponentPaddingProps;
|
|
309
309
|
declare function PageHolder({ noMaxContentWidth, children, ...props }: PageHolderProps): react_jsx_runtime.JSX.Element;
|
|
310
|
-
declare const _default$5:
|
|
310
|
+
declare const _default$5: react.MemoExoticComponent<typeof PageHolder>;
|
|
311
311
|
|
|
312
312
|
type PageHeaderProps = {
|
|
313
313
|
imageUrl?: string;
|
|
314
314
|
imageSize?: number;
|
|
315
315
|
title?: string;
|
|
316
316
|
titleAs?: TextAs;
|
|
317
|
-
titleRightElement?:
|
|
317
|
+
titleRightElement?: React.ReactNode;
|
|
318
318
|
description?: string;
|
|
319
|
-
textAlign?:
|
|
320
|
-
rightElement?:
|
|
319
|
+
textAlign?: React.CSSProperties["textAlign"];
|
|
320
|
+
rightElement?: React.ReactNode;
|
|
321
321
|
/** @default false */
|
|
322
322
|
lightMode?: boolean;
|
|
323
323
|
} & Pick<ComponentMarginProps, "marginBottom">;
|
|
324
324
|
declare function PageHeader({ imageUrl, imageSize, title, titleAs, titleRightElement, description, textAlign, rightElement, lightMode, marginBottom, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
325
|
-
declare const _default$4:
|
|
325
|
+
declare const _default$4: react.MemoExoticComponent<typeof PageHeader>;
|
|
326
326
|
|
|
327
327
|
type ChipProps = {
|
|
328
328
|
text: string;
|
|
@@ -334,7 +334,7 @@ type ChipProps = {
|
|
|
334
334
|
borderRadius?: number;
|
|
335
335
|
/** @default false */
|
|
336
336
|
isCircle?: boolean;
|
|
337
|
-
} & Pick<DivProps
|
|
337
|
+
} & Pick<DivProps, "border" | "borderColor" | "borderWidth" | "borderStyle"> & Pick<TextProps, "fontFamily" | "fontSize" | "fontWeight" | "fontStyle">;
|
|
338
338
|
type ChipComponentType = {
|
|
339
339
|
(props: ComponentPropWithRef<HTMLDivElement, ChipProps>): React.ReactElement;
|
|
340
340
|
colored: (props: ComponentPropWithRef<HTMLDivElement, OmitProps<ChipProps, "color" | "backgroundColor"> & {
|
|
@@ -353,32 +353,32 @@ type InputFieldProps = {
|
|
|
353
353
|
infoText?: string;
|
|
354
354
|
leftIcon?: IconName | AnyOtherString;
|
|
355
355
|
rightIcon?: IconName | AnyOtherString;
|
|
356
|
-
insideInputFieldComponent?:
|
|
356
|
+
insideInputFieldComponent?: React.ReactNode;
|
|
357
357
|
/** @default false */
|
|
358
358
|
withDebounce?: boolean;
|
|
359
359
|
/** @default 0.5s */
|
|
360
360
|
debounceDelay?: number;
|
|
361
361
|
onChangeValue?: (value: string) => void;
|
|
362
362
|
onClickRightIcon?: () => void;
|
|
363
|
-
holderRef?:
|
|
364
|
-
} & OmitProps<
|
|
365
|
-
type TextareaFieldProps = OmitProps<InputFieldProps, "type"> & OmitProps<
|
|
363
|
+
holderRef?: React.ForwardedRef<HTMLDivElement>;
|
|
364
|
+
} & OmitProps<React.ComponentProps<"input">, "style" | "ref"> & ComponentStyle & ComponentHoverStyle;
|
|
365
|
+
type TextareaFieldProps = OmitProps<InputFieldProps, "type"> & OmitProps<React.ComponentProps<"textarea">, "style" | "ref">;
|
|
366
366
|
type InputFieldComponentType = {
|
|
367
|
-
(props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>):
|
|
368
|
-
multiline: (props: ComponentPropWithRef<HTMLTextAreaElement, TextareaFieldProps>) =>
|
|
369
|
-
email: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) =>
|
|
370
|
-
password: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) =>
|
|
371
|
-
search: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) =>
|
|
372
|
-
phoneNumber: (props: ComponentPropWithRef<HTMLInputElement, OmitProps<InputFieldProps, "type">>) =>
|
|
367
|
+
(props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>): React.ReactElement;
|
|
368
|
+
multiline: (props: ComponentPropWithRef<HTMLTextAreaElement, TextareaFieldProps>) => React.ReactElement;
|
|
369
|
+
email: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
370
|
+
password: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
371
|
+
search: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
372
|
+
phoneNumber: (props: ComponentPropWithRef<HTMLInputElement, OmitProps<InputFieldProps, "type">>) => React.ReactElement;
|
|
373
373
|
date: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps & {
|
|
374
374
|
minDate?: Date;
|
|
375
375
|
maxDate?: Date;
|
|
376
|
-
}>) =>
|
|
376
|
+
}>) => React.ReactElement;
|
|
377
377
|
dateTime: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps & {
|
|
378
378
|
minDate?: Date;
|
|
379
379
|
maxDate?: Date;
|
|
380
|
-
}>) =>
|
|
381
|
-
time: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) =>
|
|
380
|
+
}>) => React.ReactElement;
|
|
381
|
+
time: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
382
382
|
};
|
|
383
383
|
declare const InputFieldComponent: InputFieldComponentType;
|
|
384
384
|
declare const InputField: typeof InputFieldComponent & {
|
|
@@ -407,6 +407,7 @@ type DropdownProps<Value, Data = unknown> = {
|
|
|
407
407
|
infoText?: string;
|
|
408
408
|
/** @default false */
|
|
409
409
|
required?: boolean;
|
|
410
|
+
name?: string;
|
|
410
411
|
/** @default false */
|
|
411
412
|
disabled?: boolean;
|
|
412
413
|
options: DropdownOption<Value, Data>[];
|
|
@@ -429,7 +430,7 @@ type DropdownProps<Value, Data = unknown> = {
|
|
|
429
430
|
onChange?: (value: Value | undefined) => void;
|
|
430
431
|
onChangeSearch?: (query: string) => void;
|
|
431
432
|
renderOption?: (option: DropdownOption<Value, Data>, index: number, isSelected: boolean) => React.ReactNode;
|
|
432
|
-
} & OmitProps<DivProps
|
|
433
|
+
} & OmitProps<DivProps, "onChange" | "defaultChecked">;
|
|
433
434
|
type DropdownComponentType = {
|
|
434
435
|
<Value, Data>(props: ComponentPropWithRef<HTMLDivElement, DropdownProps<Value, Data>>): React.ReactElement;
|
|
435
436
|
};
|
|
@@ -501,7 +502,7 @@ declare function useForm<FormFields extends Record<string | number, string | num
|
|
|
501
502
|
setFieldsValue: (values: Partial<FormFields>) => void;
|
|
502
503
|
getInputFieldProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<HTMLInputElement, InputFieldProps>;
|
|
503
504
|
getTextAreaProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<HTMLTextAreaElement, TextareaFieldProps>;
|
|
504
|
-
getDropdownFieldProps: <FieldName extends keyof FormFields>(field: FieldName) => OmitProps<ComponentPropWithRef<HTMLDivElement, DropdownProps<FormFields[FieldName]
|
|
505
|
+
getDropdownFieldProps: <FieldName extends keyof FormFields>(field: FieldName) => OmitProps<ComponentPropWithRef<HTMLDivElement, DropdownProps<FormFields[FieldName]>>, "options">;
|
|
505
506
|
getCheckboxProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<ToggleInputRef, ToggleInputProps<FormFields[FieldName]>>;
|
|
506
507
|
getRadioButtonProps: <FieldName extends keyof FormFields>(field: FieldName, value: FormFields[FieldName]) => ComponentPropWithRef<ToggleInputRef, ToggleInputProps<FormFields[FieldName]>>;
|
|
507
508
|
getSwitchProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<ToggleInputRef, ToggleInputProps<FormFields[FieldName]>>;
|
|
@@ -538,7 +539,7 @@ type FormProps = {
|
|
|
538
539
|
children?: React.ReactNode;
|
|
539
540
|
} & ComponentMarginProps;
|
|
540
541
|
declare function Form({ form, submitButtonText, submitButtonLoaderName, submitButtonId, submitButtonIsDisabled, actionButtonsLocation, gap, isSubmitting, isDestructive, onClickCancel, onSubmit, children, ...props }: FormProps): react_jsx_runtime.JSX.Element;
|
|
541
|
-
declare const _default$2:
|
|
542
|
+
declare const _default$2: react.MemoExoticComponent<typeof Form>;
|
|
542
543
|
|
|
543
544
|
type LabelProps = {
|
|
544
545
|
text?: string;
|
|
@@ -547,9 +548,10 @@ type LabelProps = {
|
|
|
547
548
|
/** @default false */
|
|
548
549
|
isError?: boolean;
|
|
549
550
|
color?: string;
|
|
551
|
+
htmlFor?: string;
|
|
550
552
|
};
|
|
551
|
-
declare function Label({ text, required, isError, color }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
552
|
-
declare const _default$1:
|
|
553
|
+
declare function Label({ text, required, isError, color, htmlFor }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
554
|
+
declare const _default$1: react.MemoExoticComponent<typeof Label>;
|
|
553
555
|
|
|
554
556
|
type FormRowProps = {
|
|
555
557
|
oneItemOnly?: boolean;
|
|
@@ -680,7 +682,7 @@ type FoldableProps = {
|
|
|
680
682
|
renderHeader?: (isOpen: boolean, toggleOpen: () => void) => React.ReactNode;
|
|
681
683
|
onOpenChange?: (isOpen: boolean) => void;
|
|
682
684
|
children?: React.ReactNode;
|
|
683
|
-
} & DivProps
|
|
685
|
+
} & DivProps;
|
|
684
686
|
type FoldableRef = {
|
|
685
687
|
isOpen: boolean;
|
|
686
688
|
open: () => void;
|
|
@@ -731,7 +733,7 @@ type BetterHtmlProviderProps = {
|
|
|
731
733
|
children?: React.ReactNode;
|
|
732
734
|
};
|
|
733
735
|
declare function BetterHtmlProvider({ value, plugins: pluginsToUse, children }: BetterHtmlProviderProps): react_jsx_runtime.JSX.Element;
|
|
734
|
-
declare const _default:
|
|
736
|
+
declare const _default: react.MemoExoticComponent<typeof BetterHtmlProvider>;
|
|
735
737
|
|
|
736
738
|
type BrowserName = "firefox" | "chrome" | "safari" | "edge" | "opera";
|
|
737
739
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WebTarget } from 'styled-components';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ComponentType, ComponentProps, ReactNode } from 'react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
type PluginName = "react-router-dom";
|
|
@@ -36,7 +36,7 @@ type DeepPartialRecord<T> = {
|
|
|
36
36
|
type PickAllRequired<T, K extends keyof T> = Required<Pick<T, K>>;
|
|
37
37
|
type AnyOtherString = Omit<string & {}, "">;
|
|
38
38
|
|
|
39
|
-
type DivProps<Value> = {
|
|
39
|
+
type DivProps<Value = unknown> = {
|
|
40
40
|
value?: Value;
|
|
41
41
|
/** @default "div" */
|
|
42
42
|
as?: WebTarget;
|
|
@@ -66,14 +66,14 @@ declare const Div: typeof DivComponent & {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
type TextAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "label";
|
|
69
|
-
type TextProps = {
|
|
69
|
+
type TextProps<As extends TextAs = "p"> = {
|
|
70
70
|
/** @default "p" */
|
|
71
|
-
as?:
|
|
72
|
-
} & OmitProps<React.ComponentProps<
|
|
71
|
+
as?: As;
|
|
72
|
+
} & OmitProps<React.ComponentProps<As>, "style"> & ComponentStyle & ComponentHoverStyle;
|
|
73
73
|
type TextComponentType = {
|
|
74
|
-
(props: ComponentPropWithRef<HTMLParagraphElement, TextProps
|
|
75
|
-
unknown: (props: ComponentPropWithRef<HTMLParagraphElement, TextProps
|
|
76
|
-
oneLine: (props: ComponentPropWithRef<HTMLParagraphElement, TextProps
|
|
74
|
+
<As extends TextAs>(props: ComponentPropWithRef<HTMLParagraphElement, TextProps<As>>): React.ReactElement;
|
|
75
|
+
unknown: <As extends TextAs>(props: ComponentPropWithRef<HTMLParagraphElement, TextProps<As>>) => React.ReactElement;
|
|
76
|
+
oneLine: <As extends TextAs>(props: ComponentPropWithRef<HTMLParagraphElement, TextProps<As>>) => React.ReactElement;
|
|
77
77
|
};
|
|
78
78
|
declare const TextComponent: TextComponentType;
|
|
79
79
|
declare const Text: typeof TextComponent & {
|
|
@@ -110,7 +110,7 @@ type LoaderProps = {
|
|
|
110
110
|
width?: number;
|
|
111
111
|
/** @default false */
|
|
112
112
|
disabled?: boolean;
|
|
113
|
-
} & OmitProps<DivProps
|
|
113
|
+
} & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName">;
|
|
114
114
|
type LoaderComponentType = {
|
|
115
115
|
(props: LoaderProps): React.ReactElement;
|
|
116
116
|
box: (props: OmitProps<LoaderProps, "size"> & {
|
|
@@ -254,8 +254,8 @@ type HorizontalDividerProps = DividerProps & {
|
|
|
254
254
|
textColor?: string;
|
|
255
255
|
};
|
|
256
256
|
declare const _default$6: {
|
|
257
|
-
vertical:
|
|
258
|
-
horizontal:
|
|
257
|
+
vertical: react.NamedExoticComponent<VerticalDividerProps>;
|
|
258
|
+
horizontal: react.NamedExoticComponent<HorizontalDividerProps>;
|
|
259
259
|
};
|
|
260
260
|
|
|
261
261
|
type ModalProps = {
|
|
@@ -307,22 +307,22 @@ type PageHolderProps = {
|
|
|
307
307
|
children?: React.ReactNode;
|
|
308
308
|
} & ComponentPaddingProps;
|
|
309
309
|
declare function PageHolder({ noMaxContentWidth, children, ...props }: PageHolderProps): react_jsx_runtime.JSX.Element;
|
|
310
|
-
declare const _default$5:
|
|
310
|
+
declare const _default$5: react.MemoExoticComponent<typeof PageHolder>;
|
|
311
311
|
|
|
312
312
|
type PageHeaderProps = {
|
|
313
313
|
imageUrl?: string;
|
|
314
314
|
imageSize?: number;
|
|
315
315
|
title?: string;
|
|
316
316
|
titleAs?: TextAs;
|
|
317
|
-
titleRightElement?:
|
|
317
|
+
titleRightElement?: React.ReactNode;
|
|
318
318
|
description?: string;
|
|
319
|
-
textAlign?:
|
|
320
|
-
rightElement?:
|
|
319
|
+
textAlign?: React.CSSProperties["textAlign"];
|
|
320
|
+
rightElement?: React.ReactNode;
|
|
321
321
|
/** @default false */
|
|
322
322
|
lightMode?: boolean;
|
|
323
323
|
} & Pick<ComponentMarginProps, "marginBottom">;
|
|
324
324
|
declare function PageHeader({ imageUrl, imageSize, title, titleAs, titleRightElement, description, textAlign, rightElement, lightMode, marginBottom, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
325
|
-
declare const _default$4:
|
|
325
|
+
declare const _default$4: react.MemoExoticComponent<typeof PageHeader>;
|
|
326
326
|
|
|
327
327
|
type ChipProps = {
|
|
328
328
|
text: string;
|
|
@@ -334,7 +334,7 @@ type ChipProps = {
|
|
|
334
334
|
borderRadius?: number;
|
|
335
335
|
/** @default false */
|
|
336
336
|
isCircle?: boolean;
|
|
337
|
-
} & Pick<DivProps
|
|
337
|
+
} & Pick<DivProps, "border" | "borderColor" | "borderWidth" | "borderStyle"> & Pick<TextProps, "fontFamily" | "fontSize" | "fontWeight" | "fontStyle">;
|
|
338
338
|
type ChipComponentType = {
|
|
339
339
|
(props: ComponentPropWithRef<HTMLDivElement, ChipProps>): React.ReactElement;
|
|
340
340
|
colored: (props: ComponentPropWithRef<HTMLDivElement, OmitProps<ChipProps, "color" | "backgroundColor"> & {
|
|
@@ -353,32 +353,32 @@ type InputFieldProps = {
|
|
|
353
353
|
infoText?: string;
|
|
354
354
|
leftIcon?: IconName | AnyOtherString;
|
|
355
355
|
rightIcon?: IconName | AnyOtherString;
|
|
356
|
-
insideInputFieldComponent?:
|
|
356
|
+
insideInputFieldComponent?: React.ReactNode;
|
|
357
357
|
/** @default false */
|
|
358
358
|
withDebounce?: boolean;
|
|
359
359
|
/** @default 0.5s */
|
|
360
360
|
debounceDelay?: number;
|
|
361
361
|
onChangeValue?: (value: string) => void;
|
|
362
362
|
onClickRightIcon?: () => void;
|
|
363
|
-
holderRef?:
|
|
364
|
-
} & OmitProps<
|
|
365
|
-
type TextareaFieldProps = OmitProps<InputFieldProps, "type"> & OmitProps<
|
|
363
|
+
holderRef?: React.ForwardedRef<HTMLDivElement>;
|
|
364
|
+
} & OmitProps<React.ComponentProps<"input">, "style" | "ref"> & ComponentStyle & ComponentHoverStyle;
|
|
365
|
+
type TextareaFieldProps = OmitProps<InputFieldProps, "type"> & OmitProps<React.ComponentProps<"textarea">, "style" | "ref">;
|
|
366
366
|
type InputFieldComponentType = {
|
|
367
|
-
(props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>):
|
|
368
|
-
multiline: (props: ComponentPropWithRef<HTMLTextAreaElement, TextareaFieldProps>) =>
|
|
369
|
-
email: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) =>
|
|
370
|
-
password: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) =>
|
|
371
|
-
search: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) =>
|
|
372
|
-
phoneNumber: (props: ComponentPropWithRef<HTMLInputElement, OmitProps<InputFieldProps, "type">>) =>
|
|
367
|
+
(props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>): React.ReactElement;
|
|
368
|
+
multiline: (props: ComponentPropWithRef<HTMLTextAreaElement, TextareaFieldProps>) => React.ReactElement;
|
|
369
|
+
email: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
370
|
+
password: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
371
|
+
search: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
372
|
+
phoneNumber: (props: ComponentPropWithRef<HTMLInputElement, OmitProps<InputFieldProps, "type">>) => React.ReactElement;
|
|
373
373
|
date: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps & {
|
|
374
374
|
minDate?: Date;
|
|
375
375
|
maxDate?: Date;
|
|
376
|
-
}>) =>
|
|
376
|
+
}>) => React.ReactElement;
|
|
377
377
|
dateTime: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps & {
|
|
378
378
|
minDate?: Date;
|
|
379
379
|
maxDate?: Date;
|
|
380
|
-
}>) =>
|
|
381
|
-
time: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) =>
|
|
380
|
+
}>) => React.ReactElement;
|
|
381
|
+
time: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
382
382
|
};
|
|
383
383
|
declare const InputFieldComponent: InputFieldComponentType;
|
|
384
384
|
declare const InputField: typeof InputFieldComponent & {
|
|
@@ -407,6 +407,7 @@ type DropdownProps<Value, Data = unknown> = {
|
|
|
407
407
|
infoText?: string;
|
|
408
408
|
/** @default false */
|
|
409
409
|
required?: boolean;
|
|
410
|
+
name?: string;
|
|
410
411
|
/** @default false */
|
|
411
412
|
disabled?: boolean;
|
|
412
413
|
options: DropdownOption<Value, Data>[];
|
|
@@ -429,7 +430,7 @@ type DropdownProps<Value, Data = unknown> = {
|
|
|
429
430
|
onChange?: (value: Value | undefined) => void;
|
|
430
431
|
onChangeSearch?: (query: string) => void;
|
|
431
432
|
renderOption?: (option: DropdownOption<Value, Data>, index: number, isSelected: boolean) => React.ReactNode;
|
|
432
|
-
} & OmitProps<DivProps
|
|
433
|
+
} & OmitProps<DivProps, "onChange" | "defaultChecked">;
|
|
433
434
|
type DropdownComponentType = {
|
|
434
435
|
<Value, Data>(props: ComponentPropWithRef<HTMLDivElement, DropdownProps<Value, Data>>): React.ReactElement;
|
|
435
436
|
};
|
|
@@ -501,7 +502,7 @@ declare function useForm<FormFields extends Record<string | number, string | num
|
|
|
501
502
|
setFieldsValue: (values: Partial<FormFields>) => void;
|
|
502
503
|
getInputFieldProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<HTMLInputElement, InputFieldProps>;
|
|
503
504
|
getTextAreaProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<HTMLTextAreaElement, TextareaFieldProps>;
|
|
504
|
-
getDropdownFieldProps: <FieldName extends keyof FormFields>(field: FieldName) => OmitProps<ComponentPropWithRef<HTMLDivElement, DropdownProps<FormFields[FieldName]
|
|
505
|
+
getDropdownFieldProps: <FieldName extends keyof FormFields>(field: FieldName) => OmitProps<ComponentPropWithRef<HTMLDivElement, DropdownProps<FormFields[FieldName]>>, "options">;
|
|
505
506
|
getCheckboxProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<ToggleInputRef, ToggleInputProps<FormFields[FieldName]>>;
|
|
506
507
|
getRadioButtonProps: <FieldName extends keyof FormFields>(field: FieldName, value: FormFields[FieldName]) => ComponentPropWithRef<ToggleInputRef, ToggleInputProps<FormFields[FieldName]>>;
|
|
507
508
|
getSwitchProps: <FieldName extends keyof FormFields>(field: FieldName) => ComponentPropWithRef<ToggleInputRef, ToggleInputProps<FormFields[FieldName]>>;
|
|
@@ -538,7 +539,7 @@ type FormProps = {
|
|
|
538
539
|
children?: React.ReactNode;
|
|
539
540
|
} & ComponentMarginProps;
|
|
540
541
|
declare function Form({ form, submitButtonText, submitButtonLoaderName, submitButtonId, submitButtonIsDisabled, actionButtonsLocation, gap, isSubmitting, isDestructive, onClickCancel, onSubmit, children, ...props }: FormProps): react_jsx_runtime.JSX.Element;
|
|
541
|
-
declare const _default$2:
|
|
542
|
+
declare const _default$2: react.MemoExoticComponent<typeof Form>;
|
|
542
543
|
|
|
543
544
|
type LabelProps = {
|
|
544
545
|
text?: string;
|
|
@@ -547,9 +548,10 @@ type LabelProps = {
|
|
|
547
548
|
/** @default false */
|
|
548
549
|
isError?: boolean;
|
|
549
550
|
color?: string;
|
|
551
|
+
htmlFor?: string;
|
|
550
552
|
};
|
|
551
|
-
declare function Label({ text, required, isError, color }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
552
|
-
declare const _default$1:
|
|
553
|
+
declare function Label({ text, required, isError, color, htmlFor }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
554
|
+
declare const _default$1: react.MemoExoticComponent<typeof Label>;
|
|
553
555
|
|
|
554
556
|
type FormRowProps = {
|
|
555
557
|
oneItemOnly?: boolean;
|
|
@@ -680,7 +682,7 @@ type FoldableProps = {
|
|
|
680
682
|
renderHeader?: (isOpen: boolean, toggleOpen: () => void) => React.ReactNode;
|
|
681
683
|
onOpenChange?: (isOpen: boolean) => void;
|
|
682
684
|
children?: React.ReactNode;
|
|
683
|
-
} & DivProps
|
|
685
|
+
} & DivProps;
|
|
684
686
|
type FoldableRef = {
|
|
685
687
|
isOpen: boolean;
|
|
686
688
|
open: () => void;
|
|
@@ -731,7 +733,7 @@ type BetterHtmlProviderProps = {
|
|
|
731
733
|
children?: React.ReactNode;
|
|
732
734
|
};
|
|
733
735
|
declare function BetterHtmlProvider({ value, plugins: pluginsToUse, children }: BetterHtmlProviderProps): react_jsx_runtime.JSX.Element;
|
|
734
|
-
declare const _default:
|
|
736
|
+
declare const _default: react.MemoExoticComponent<typeof BetterHtmlProvider>;
|
|
735
737
|
|
|
736
738
|
type BrowserName = "firefox" | "chrome" | "safari" | "edge" | "opera";
|
|
737
739
|
|