@cars4ever/public-ui 0.0.80
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/.eslintrc.cjs +637 -0
- package/.husky/pre-push +1 -0
- package/.yarn/install-state.gz +0 -0
- package/.yarnrc.yml +13 -0
- package/debug-storybook.log +34 -0
- package/dist/Poppins-Bold-QAA2AGZS.ttf +0 -0
- package/dist/Poppins-Regular-JNHL4IDV.ttf +0 -0
- package/dist/assets/fonts/Poppins-Bold.ttf +0 -0
- package/dist/assets/fonts/Poppins-Regular.ttf +0 -0
- package/dist/assets/scss/adaptive-utils.scss +14 -0
- package/dist/assets/scss/common-utils.scss +17 -0
- package/dist/assets/scss/globals.scss +96 -0
- package/dist/assets/scss/utils.scss +3 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +516 -0
- package/dist/index.js +1 -0
- package/eslint.config.js +392 -0
- package/package.json +96 -0
- package/tsup.config.ts +66 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import { InputHTMLAttributes, MutableRefObject, FocusEventHandler, TextareaHTMLAttributes, ReactNode, ReactElement, ComponentType, HTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import { IIconProps, IMediaUtilsProviderProps } from '@cars4ever/media-utils';
|
|
3
|
+
export { CloudinaryService, ICloudinaryConfig, IIconProps, IImageNormalizationInfo, IImagePlaceholderProps, IImageSkeletonProps, IOptimizedImageProps, ImageCrop, ImagePlaceholder, ImageSkeleton, OptimizedImage } from '@cars4ever/media-utils';
|
|
4
|
+
import { ReactMaskProps } from 'react-imask';
|
|
5
|
+
import { FactoryOpts, FactoryArg } from 'imask';
|
|
6
|
+
import { TextareaAutosizeProps } from 'react-textarea-autosize';
|
|
7
|
+
import { Validate, FieldValues, UseFormProps } from 'react-hook-form';
|
|
8
|
+
import { SliderProps } from 'rc-slider';
|
|
9
|
+
import { OptionProps } from 'react-select';
|
|
10
|
+
|
|
11
|
+
declare enum Locale {
|
|
12
|
+
DK = "dk",
|
|
13
|
+
SE = "se"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare enum DeviceType {
|
|
17
|
+
Mobile = "mobile",
|
|
18
|
+
Tablet = "tablet",
|
|
19
|
+
Desktop = "desktop"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface IDeviceTypeContext {
|
|
23
|
+
deviceType: DeviceType;
|
|
24
|
+
isMobile: boolean;
|
|
25
|
+
isTablet: boolean;
|
|
26
|
+
isDesktop: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare const useDeviceType: () => IDeviceTypeContext;
|
|
29
|
+
|
|
30
|
+
type DeepPartial<T> = {
|
|
31
|
+
[P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T[P] extends {} ? DeepPartial<T[P]> : T[P];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
interface IUseConfigurationOptions {
|
|
35
|
+
type?: 'decimal' | 'integer' | 'text' | 'date' | 'color' | 'datetime-local' | 'email' | 'tel' | 'time';
|
|
36
|
+
mask?: FactoryOpts['mask'];
|
|
37
|
+
customMaskConfig?: FactoryOpts;
|
|
38
|
+
allowNegative?: boolean;
|
|
39
|
+
toUpperCase?: boolean;
|
|
40
|
+
toLowerCase?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
type TOmittedBaseProps = 'defaultValue' | 'max' | 'min' | 'pattern' | 'onChange' | 'onBlur' | 'onFocus';
|
|
44
|
+
type TInputBaseProps = Omit<InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement>, TOmittedBaseProps>;
|
|
45
|
+
type TMaskInputOverrideProps = Omit<ReactMaskProps<HTMLInputElement | HTMLTextAreaElement>, 'unmask' | 'inputRef' | TOmittedBaseProps> & TInputBaseProps & {
|
|
46
|
+
unmask?: boolean;
|
|
47
|
+
type?: string;
|
|
48
|
+
inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
49
|
+
};
|
|
50
|
+
interface IBaseInputProps extends IUseConfigurationOptions, IValidationTargetProps<string | number | null>, Omit<TMaskInputOverrideProps, 'type' | 'value'> {
|
|
51
|
+
onChange?: (value: string) => void;
|
|
52
|
+
onFocus?: FocusEventHandler;
|
|
53
|
+
onBlur?: FocusEventHandler;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface IMultilineInputProps extends Omit<IBaseInputProps, keyof IUseConfigurationOptions | 'unmask'>, Omit<TextareaAutosizeProps, keyof TextareaHTMLAttributes<HTMLTextAreaElement>> {
|
|
57
|
+
rows?: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type TInputElement$1 = HTMLInputElement | HTMLTextAreaElement;
|
|
61
|
+
type TInputInstance = TInputElement$1 | null;
|
|
62
|
+
type TInnerRef = MutableRefObject<TInputInstance> | ((instance: TInputInstance) => void);
|
|
63
|
+
type IInputProps$1<Multiline extends boolean = false> = {
|
|
64
|
+
isMultiline?: Multiline;
|
|
65
|
+
innerRef?: TInnerRef;
|
|
66
|
+
} & (Multiline extends true ? Omit<IMultilineInputProps, 'onBlur'> : Omit<IBaseInputProps, 'onBlur'>);
|
|
67
|
+
|
|
68
|
+
interface IUseComputedLabelProps {
|
|
69
|
+
label?: string;
|
|
70
|
+
required?: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type TInputElement = HTMLInputElement | HTMLTextAreaElement;
|
|
74
|
+
interface IUseInputProps {
|
|
75
|
+
value?: string | number | null;
|
|
76
|
+
defaultValue?: string | number | null;
|
|
77
|
+
isLoading?: boolean;
|
|
78
|
+
isDisabled?: boolean;
|
|
79
|
+
inputRef?: MutableRefObject<TInputElement | null>;
|
|
80
|
+
onChange?: (value: string | null) => void;
|
|
81
|
+
onBlur?: (value: string | null) => void;
|
|
82
|
+
onFocus?: FocusEventHandler;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
type TInputVariant = 'standard' | 'outlined';
|
|
86
|
+
type IInputProps<Multiline extends boolean = false> = IValidationTargetProps<string | number> & IInputProps$1<Multiline> & Partial<Pick<IUseInputProps, 'isLoading' | 'onChange' | 'onBlur' | 'onFocus'>> & IUseComputedLabelProps & {
|
|
87
|
+
startAdornment?: ReactNode;
|
|
88
|
+
endAdornment?: ReactNode;
|
|
89
|
+
shrinkLabel?: boolean;
|
|
90
|
+
helperText?: ReactNode;
|
|
91
|
+
variant?: TInputVariant;
|
|
92
|
+
};
|
|
93
|
+
declare const Input: <Multiline extends boolean = false>({ isMultiline, error, label, value, defaultValue, helperText, shrinkLabel, isDisabled, startAdornment, endAdornment, onChange, onFocus, onBlur, required, className, innerRef, isLoading, variant, ...rest }: IInputProps<Multiline>) => ReactElement;
|
|
94
|
+
|
|
95
|
+
interface ICheckBoxProps extends IValidationTargetProps<boolean>, Omit<InputHTMLAttributes<HTMLElement>, 'label' | 'onChange' | 'value' | 'disabled' | 'defaultValue' | 'defaultChecked'> {
|
|
96
|
+
label?: ReactNode;
|
|
97
|
+
isDisabled?: boolean;
|
|
98
|
+
isIndeterminate?: boolean;
|
|
99
|
+
helperText?: ReactNode;
|
|
100
|
+
onChange?: (checked: boolean) => void;
|
|
101
|
+
}
|
|
102
|
+
declare const CheckBox: ({ error, className, label, onChange, isDisabled, isIndeterminate, innerRef, value, defaultValue, helperText, ...rest }: ICheckBoxProps) => ReactElement;
|
|
103
|
+
|
|
104
|
+
interface IRadioGroupProps extends IValidationTargetProps<IOption['value']>, Omit<InputHTMLAttributes<HTMLInputElement>, 'disabled' | 'defaultValue' | 'value' | 'onChange'> {
|
|
105
|
+
onChange?: (selected: string) => void;
|
|
106
|
+
options: IOption[];
|
|
107
|
+
helperText?: ReactNode;
|
|
108
|
+
}
|
|
109
|
+
declare const RadioGroup: ({ options, className, defaultValue, value, onChange, helperText, error, ...rest }: IRadioGroupProps) => ReactElement;
|
|
110
|
+
|
|
111
|
+
interface IRadioInputProps extends IValidationTargetProps<string>, Omit<InputHTMLAttributes<HTMLInputElement>, 'disabled' | 'defaultValue' | 'value' | 'onChange'> {
|
|
112
|
+
label?: ReactNode;
|
|
113
|
+
isDisabled?: boolean;
|
|
114
|
+
isChecked?: boolean;
|
|
115
|
+
onChange?: (value: string) => void;
|
|
116
|
+
}
|
|
117
|
+
declare const RadioInput: ({ name, label, value, isChecked, onChange, isDisabled, className, innerRef, ...rest }: IRadioInputProps) => ReactElement;
|
|
118
|
+
|
|
119
|
+
type TSliderType = 'slider' | 'range';
|
|
120
|
+
type TValue<Type extends TSliderType> = Type extends 'range' ? number[] : number;
|
|
121
|
+
type ISliderProps<Type extends TSliderType = TSliderType, Value = TValue<Type>> = Omit<SliderProps, 'value' | 'disabled' | 'min' | 'max'> & IValidationTargetProps<Value> & {
|
|
122
|
+
type?: Type;
|
|
123
|
+
value?: Value;
|
|
124
|
+
min: number;
|
|
125
|
+
max: number;
|
|
126
|
+
onChange?: (value: Value) => void;
|
|
127
|
+
hideDots?: boolean;
|
|
128
|
+
};
|
|
129
|
+
declare const Slider: <Type extends TSliderType, Value = TValue<Type>>({ className, type, value, defaultValue, isDisabled, hideDots, dotStyle, min, max, onChange, ...rest }: ISliderProps<Type, Value>) => ReactElement;
|
|
130
|
+
|
|
131
|
+
declare const sizes$1: {
|
|
132
|
+
small: string;
|
|
133
|
+
medium: string;
|
|
134
|
+
large: string;
|
|
135
|
+
};
|
|
136
|
+
type IOptionProps$1<OptionType extends ISelectorOption> = {
|
|
137
|
+
Icon?: ComponentType<IIconProps>;
|
|
138
|
+
isSelected?: boolean;
|
|
139
|
+
onClick?: (value: OptionType['value']) => void;
|
|
140
|
+
size?: keyof typeof sizes$1;
|
|
141
|
+
className?: string;
|
|
142
|
+
} & OptionType;
|
|
143
|
+
declare const Option$1: <OptionType extends ISelectorOption>({ label, value, size, className, isSelected, Icon, onClick }: IOptionProps$1<OptionType>) => ReactElement;
|
|
144
|
+
|
|
145
|
+
declare const layouts: {
|
|
146
|
+
row: string;
|
|
147
|
+
column: string;
|
|
148
|
+
twoColumns: string;
|
|
149
|
+
fourColumns: string;
|
|
150
|
+
};
|
|
151
|
+
interface ISelectorProps<OptionType extends ISelectorOption> extends IValidationTargetProps<OptionType['value'] | null> {
|
|
152
|
+
className?: string;
|
|
153
|
+
options: OptionType[];
|
|
154
|
+
onChange?: (value: OptionType['value'] | null) => void;
|
|
155
|
+
Option?: ComponentType<IOptionProps$1<OptionType>>;
|
|
156
|
+
size?: IOptionProps$1<OptionType>['size'];
|
|
157
|
+
layout?: keyof typeof layouts;
|
|
158
|
+
}
|
|
159
|
+
declare const Selector: <OptionType extends ISelectorOption>({ value, options, onChange, className, layout, size, Option }: ISelectorProps<OptionType>) => ReactElement;
|
|
160
|
+
|
|
161
|
+
interface IBaseSelectOptionsProps<OptionType extends IOption> {
|
|
162
|
+
options: OptionType[];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface IBaseSelectProps<OptionType extends IOption> extends IBaseSelectOptionsProps<OptionType>, IValidationTargetProps<OptionType['value'] | null>, Partial<Pick<IInputProps, 'className' | 'isLoading' | 'isDisabled' | 'onFocus' | 'variant'>> {
|
|
166
|
+
label: string;
|
|
167
|
+
groupBy?: (option: OptionType) => string;
|
|
168
|
+
onChange?: (value: OptionType['value'] | null) => void;
|
|
169
|
+
onBlur?: (value: OptionType['value'] | null) => void;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
interface IOptionProps<OptionType extends IOption> extends Omit<OptionProps<OptionType, false>, 'data'> {
|
|
173
|
+
data: OptionType;
|
|
174
|
+
}
|
|
175
|
+
declare const Option: <OptionType extends IOption>({ className, innerRef, isSelected, isFocused, innerProps, children }: IOptionProps<OptionType>) => ReactElement;
|
|
176
|
+
|
|
177
|
+
type TBaseProps<OptionType extends IOption> = IValidationTargetProps<OptionType['value'] | null> & IBaseSelectProps<OptionType>;
|
|
178
|
+
interface ICustomSelectProps<OptionType extends IOption> extends TBaseProps<OptionType> {
|
|
179
|
+
filterOption?: ((option: OptionType, rawInput: string) => boolean) | null;
|
|
180
|
+
Option?: ComponentType<IOptionProps<OptionType>>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
type ISelectProps<OptionType extends IOption, Searchable extends boolean = false> = {
|
|
184
|
+
isSearchable?: Searchable;
|
|
185
|
+
} & (Searchable extends true ? ICustomSelectProps<OptionType> : IBaseSelectProps<OptionType>);
|
|
186
|
+
declare const Select: <OptionType extends IOption, Searchable extends boolean = false>({ isSearchable, ...rest }: ISelectProps<OptionType, Searchable>) => ReactElement;
|
|
187
|
+
|
|
188
|
+
interface IGlobalConfigOverrides {
|
|
189
|
+
Input?: Partial<Pick<IInputProps, 'variant'>>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
interface IGlobalConfig {
|
|
193
|
+
locale: Locale;
|
|
194
|
+
overrides?: IGlobalConfigOverrides;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
interface INumberFormat {
|
|
198
|
+
thousandsSeparator: string;
|
|
199
|
+
radix: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
interface IDateTimeFormat {
|
|
203
|
+
date: string;
|
|
204
|
+
time: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
interface IValidationTargetProps<Value> {
|
|
208
|
+
error?: string;
|
|
209
|
+
name?: string;
|
|
210
|
+
value?: Value;
|
|
211
|
+
defaultValue?: Value;
|
|
212
|
+
isDisabled?: boolean;
|
|
213
|
+
innerRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null>;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
interface IOption {
|
|
217
|
+
label: string;
|
|
218
|
+
value: string | number;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
interface ISelectorOption extends Omit<IOption, 'label'> {
|
|
222
|
+
label: ReactNode;
|
|
223
|
+
Icon?: ComponentType<IIconProps>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
interface IThemeProviderProps {
|
|
227
|
+
theme?: string;
|
|
228
|
+
children: ReactNode;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
declare const useGlobalConfig: () => IGlobalConfig;
|
|
232
|
+
|
|
233
|
+
interface IGlobalConfigProps extends IThemeProviderProps, IMediaUtilsProviderProps, DeepPartial<IGlobalConfig> {
|
|
234
|
+
}
|
|
235
|
+
declare const GlobalConfig: ({ theme, children, cloudinaryConfig, ...config }: IGlobalConfigProps) => ReactElement;
|
|
236
|
+
|
|
237
|
+
declare const sizes: {
|
|
238
|
+
small: number;
|
|
239
|
+
medium: number;
|
|
240
|
+
};
|
|
241
|
+
interface IPlaceholderProviderProps {
|
|
242
|
+
showPlaceholder?: boolean;
|
|
243
|
+
children?: ReactNode;
|
|
244
|
+
size?: keyof typeof sizes;
|
|
245
|
+
className?: string;
|
|
246
|
+
}
|
|
247
|
+
declare const PlaceholderProvider: ({ className, showPlaceholder, size, children }: IPlaceholderProviderProps) => ReactElement;
|
|
248
|
+
|
|
249
|
+
declare const variants$3: {
|
|
250
|
+
h1: string;
|
|
251
|
+
subtitle1: string;
|
|
252
|
+
subtitle2: string;
|
|
253
|
+
subtitle3: string;
|
|
254
|
+
subtitle4: string;
|
|
255
|
+
subtitle5: string;
|
|
256
|
+
body1: string;
|
|
257
|
+
body2: string;
|
|
258
|
+
body3: string;
|
|
259
|
+
caption1: string;
|
|
260
|
+
caption2: string;
|
|
261
|
+
overline1: string;
|
|
262
|
+
overline2: string;
|
|
263
|
+
};
|
|
264
|
+
declare const headings: {
|
|
265
|
+
h1: string;
|
|
266
|
+
h2: string;
|
|
267
|
+
h3: string;
|
|
268
|
+
h4: string;
|
|
269
|
+
h5: string;
|
|
270
|
+
h6: string;
|
|
271
|
+
};
|
|
272
|
+
type TComponentProps = HTMLAttributes<HTMLElement>;
|
|
273
|
+
type THeading = keyof typeof headings;
|
|
274
|
+
interface ITypographyProps extends TComponentProps {
|
|
275
|
+
className?: string;
|
|
276
|
+
variant: keyof typeof variants$3;
|
|
277
|
+
component?: THeading | 'div' | 'span';
|
|
278
|
+
}
|
|
279
|
+
declare const Typography: ({ className, component, variant, ...rest }: ITypographyProps) => ReactElement;
|
|
280
|
+
|
|
281
|
+
interface IValueContainerProps {
|
|
282
|
+
className?: string;
|
|
283
|
+
children: ReactNode;
|
|
284
|
+
}
|
|
285
|
+
declare const ValueContainer: ({ children, className }: IValueContainerProps) => ReactElement;
|
|
286
|
+
|
|
287
|
+
interface IHelperTextProps {
|
|
288
|
+
text: ReactNode;
|
|
289
|
+
className?: string;
|
|
290
|
+
}
|
|
291
|
+
declare const HelperText: ({ className, text }: IHelperTextProps) => ReactElement;
|
|
292
|
+
|
|
293
|
+
declare const variants$2: {
|
|
294
|
+
contained: string;
|
|
295
|
+
outlined: string;
|
|
296
|
+
light: string;
|
|
297
|
+
text: string;
|
|
298
|
+
};
|
|
299
|
+
declare const sizeButton: {
|
|
300
|
+
small: string;
|
|
301
|
+
medium: string;
|
|
302
|
+
};
|
|
303
|
+
type TSize$1 = keyof typeof sizeButton;
|
|
304
|
+
interface IButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'> {
|
|
305
|
+
variant?: keyof typeof variants$2;
|
|
306
|
+
size?: TSize$1;
|
|
307
|
+
Icon?: ComponentType<IIconProps>;
|
|
308
|
+
isLoading?: boolean;
|
|
309
|
+
isDisabled?: boolean;
|
|
310
|
+
contentClassName?: string;
|
|
311
|
+
innerRef?: MutableRefObject<HTMLButtonElement | null>;
|
|
312
|
+
}
|
|
313
|
+
declare const Button: ({ className, variant, size, isLoading, Icon, children, innerRef, contentClassName, isDisabled, type, ...rest }: IButtonProps) => ReactElement;
|
|
314
|
+
|
|
315
|
+
declare const buttonSize: {
|
|
316
|
+
large: string;
|
|
317
|
+
standard: undefined;
|
|
318
|
+
};
|
|
319
|
+
type TSize = keyof typeof buttonSize;
|
|
320
|
+
declare const variants$1: {
|
|
321
|
+
contained: string;
|
|
322
|
+
outlined: string;
|
|
323
|
+
light: string;
|
|
324
|
+
};
|
|
325
|
+
interface IButtonTagProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'> {
|
|
326
|
+
variant?: keyof typeof variants$1;
|
|
327
|
+
Icon?: ComponentType<IIconProps>;
|
|
328
|
+
isLoading?: boolean;
|
|
329
|
+
isDisabled?: boolean;
|
|
330
|
+
contentClassName?: string;
|
|
331
|
+
innerRef?: MutableRefObject<HTMLButtonElement | null>;
|
|
332
|
+
EndIcon?: ComponentType<IIconProps>;
|
|
333
|
+
size?: TSize;
|
|
334
|
+
}
|
|
335
|
+
declare const ButtonTag: ({ className, variant, isLoading, Icon, children, innerRef, contentClassName, isDisabled, size, EndIcon, ...rest }: IButtonTagProps) => ReactElement;
|
|
336
|
+
|
|
337
|
+
declare const sizeVariants: Record<'small' | 'medium' | 'large' | 'extraLarge', ITypographyProps['variant']>;
|
|
338
|
+
interface ILinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
339
|
+
EndIcon?: ComponentType<IIconProps>;
|
|
340
|
+
Icon?: ComponentType<IIconProps>;
|
|
341
|
+
size?: keyof typeof sizeVariants;
|
|
342
|
+
variant?: 'simple' | 'underlined';
|
|
343
|
+
color?: 'primary' | 'default';
|
|
344
|
+
isDisabled?: boolean;
|
|
345
|
+
}
|
|
346
|
+
declare const Link: ({ size, className, color, variant, children, Icon, EndIcon, isDisabled, ...rest }: ILinkProps) => ReactElement;
|
|
347
|
+
|
|
348
|
+
interface IBackLinkProps {
|
|
349
|
+
label: ReactNode;
|
|
350
|
+
className?: string;
|
|
351
|
+
onClick: () => void;
|
|
352
|
+
}
|
|
353
|
+
declare const BackLink: ({ className, label, ...rest }: IBackLinkProps) => ReactElement;
|
|
354
|
+
|
|
355
|
+
interface IFormFieldProps<P extends IValidationTargetProps<Value>, Value> {
|
|
356
|
+
Target: ComponentType<P>;
|
|
357
|
+
name: string;
|
|
358
|
+
validate?: Validate<Value, FieldValues> | Record<string, Validate<Value, FieldValues>>;
|
|
359
|
+
}
|
|
360
|
+
declare const FormField: <P extends IValidationTargetProps<Value>, Value>({ validate, Target, name, isDisabled: isFieldDisabled, defaultValue, ...rest }: IFormFieldProps<P, Value> & P) => ReactElement;
|
|
361
|
+
|
|
362
|
+
interface IFormProviderProps<Form extends FieldValues> extends UseFormProps<Form> {
|
|
363
|
+
isDisabled?: boolean;
|
|
364
|
+
children: ReactNode;
|
|
365
|
+
className?: string;
|
|
366
|
+
onSubmit: (form: Form) => void;
|
|
367
|
+
}
|
|
368
|
+
declare const FormProvider: <Form extends FieldValues>({ className, isDisabled, children, onSubmit, ...options }: IFormProviderProps<Form>) => ReactElement;
|
|
369
|
+
|
|
370
|
+
declare const useDateTimeFormat: () => IDateTimeFormat;
|
|
371
|
+
|
|
372
|
+
declare const useFormattedDate: (value?: string) => string;
|
|
373
|
+
|
|
374
|
+
declare const useFormattedDateTime: (value?: string) => string;
|
|
375
|
+
|
|
376
|
+
declare const useFormattedTime: (value?: string) => string;
|
|
377
|
+
|
|
378
|
+
declare const useNumberFormat: () => INumberFormat;
|
|
379
|
+
|
|
380
|
+
type TFormatNumberByLocaleValue = number | null;
|
|
381
|
+
declare const formatNumberByLocale: (value?: TFormatNumberByLocaleValue, options?: Intl.NumberFormatOptions, locale?: Locale) => string;
|
|
382
|
+
|
|
383
|
+
declare const useFormattedNumber: (value?: TFormatNumberByLocaleValue, options?: Intl.NumberFormatOptions) => string;
|
|
384
|
+
|
|
385
|
+
declare const useMaskedValue: (value: string, mask: FactoryArg) => string;
|
|
386
|
+
|
|
387
|
+
declare const severities: {
|
|
388
|
+
info: string;
|
|
389
|
+
warning: string;
|
|
390
|
+
success: string;
|
|
391
|
+
};
|
|
392
|
+
interface IAlertProps {
|
|
393
|
+
severity: keyof typeof severities;
|
|
394
|
+
className?: string;
|
|
395
|
+
children: ReactNode;
|
|
396
|
+
}
|
|
397
|
+
declare const Alert: ({ severity, className, children }: IAlertProps) => ReactElement;
|
|
398
|
+
|
|
399
|
+
declare const variants: {
|
|
400
|
+
accent: string;
|
|
401
|
+
advert: string;
|
|
402
|
+
};
|
|
403
|
+
type TVariant = keyof typeof variants;
|
|
404
|
+
declare const curves: {
|
|
405
|
+
left: string;
|
|
406
|
+
right: string;
|
|
407
|
+
};
|
|
408
|
+
type TCurve = keyof typeof curves;
|
|
409
|
+
interface ILabelProps {
|
|
410
|
+
className?: string;
|
|
411
|
+
curve?: TCurve;
|
|
412
|
+
variant?: TVariant;
|
|
413
|
+
children: ReactNode;
|
|
414
|
+
}
|
|
415
|
+
declare const Label: ({ className, curve, variant, children }: ILabelProps) => ReactElement;
|
|
416
|
+
|
|
417
|
+
interface ISectionProps {
|
|
418
|
+
className?: string;
|
|
419
|
+
title: string;
|
|
420
|
+
children: ReactNode;
|
|
421
|
+
noContentOffset?: boolean;
|
|
422
|
+
}
|
|
423
|
+
declare const Section: ({ className, title, noContentOffset, children }: ISectionProps) => ReactElement;
|
|
424
|
+
|
|
425
|
+
interface IActionButtonProps {
|
|
426
|
+
label: ReactNode;
|
|
427
|
+
onClick: () => void;
|
|
428
|
+
}
|
|
429
|
+
interface ISelectionBoxProps {
|
|
430
|
+
label?: ReactNode;
|
|
431
|
+
description: ReactNode;
|
|
432
|
+
className?: string;
|
|
433
|
+
actionButtonProps?: IActionButtonProps;
|
|
434
|
+
}
|
|
435
|
+
declare const SelectionBox: ({ label, description, actionButtonProps, className }: ISelectionBoxProps) => ReactElement;
|
|
436
|
+
|
|
437
|
+
interface IInfoTableRow {
|
|
438
|
+
title: ReactNode;
|
|
439
|
+
value: ReactNode;
|
|
440
|
+
}
|
|
441
|
+
interface IInfoTableProps {
|
|
442
|
+
rows: IInfoTableRow[];
|
|
443
|
+
className?: string;
|
|
444
|
+
}
|
|
445
|
+
declare const InfoTable: ({ rows, className }: IInfoTableProps) => ReactElement;
|
|
446
|
+
|
|
447
|
+
declare const arrayToMap: <T = any>(array: T[], key: keyof T) => Record<string, T>;
|
|
448
|
+
|
|
449
|
+
declare class LocaleService {
|
|
450
|
+
private _locale;
|
|
451
|
+
get locale(): Locale;
|
|
452
|
+
set locale(locale: Locale);
|
|
453
|
+
}
|
|
454
|
+
declare const _default: LocaleService;
|
|
455
|
+
|
|
456
|
+
declare const formatDate: (value?: string) => string;
|
|
457
|
+
|
|
458
|
+
declare const formatDateByLocale: (value?: string, locale?: Locale) => string;
|
|
459
|
+
|
|
460
|
+
declare const formatDateTime: (value?: string) => string;
|
|
461
|
+
|
|
462
|
+
declare const formatDateTimeByLocale: (value?: string, locale?: Locale) => string;
|
|
463
|
+
|
|
464
|
+
declare const formatTime: (value?: string) => string;
|
|
465
|
+
|
|
466
|
+
declare const formatTimeByLocale: (value?: string, locale?: Locale) => string;
|
|
467
|
+
|
|
468
|
+
declare const formatNumber: (value?: TFormatNumberByLocaleValue, options?: Intl.NumberFormatOptions) => string;
|
|
469
|
+
|
|
470
|
+
declare const maskValue: (value: string | null, mask: FactoryArg) => string;
|
|
471
|
+
|
|
472
|
+
declare const Arrow: (props: IIconProps) => ReactElement;
|
|
473
|
+
|
|
474
|
+
declare const CaretDown: (props: IIconProps) => ReactElement;
|
|
475
|
+
|
|
476
|
+
declare const Done: (props: IIconProps) => ReactElement;
|
|
477
|
+
|
|
478
|
+
declare const EmptyBox: (props: IIconProps) => ReactElement;
|
|
479
|
+
|
|
480
|
+
declare const Info: (props: IIconProps) => ReactElement;
|
|
481
|
+
|
|
482
|
+
declare const Exclamation: (props: IIconProps) => ReactElement;
|
|
483
|
+
|
|
484
|
+
declare const Play: (props: IIconProps) => ReactElement;
|
|
485
|
+
|
|
486
|
+
declare const Subtract: (props: IIconProps) => ReactElement;
|
|
487
|
+
|
|
488
|
+
declare const AlfaRomeo: (props: IIconProps) => ReactElement;
|
|
489
|
+
|
|
490
|
+
declare const Citroen$1: (props: IIconProps) => ReactElement;
|
|
491
|
+
|
|
492
|
+
declare const Ds: (props: IIconProps) => ReactElement;
|
|
493
|
+
|
|
494
|
+
declare const Fiat: (props: IIconProps) => ReactElement;
|
|
495
|
+
|
|
496
|
+
declare const FiatProfessional: (props: IIconProps) => ReactElement;
|
|
497
|
+
|
|
498
|
+
declare const Jeep: (props: IIconProps) => ReactElement;
|
|
499
|
+
|
|
500
|
+
declare const Citroen: (props: IIconProps) => ReactElement;
|
|
501
|
+
|
|
502
|
+
declare const Opel: (props: IIconProps) => ReactElement;
|
|
503
|
+
|
|
504
|
+
declare const Peugeot: (props: IIconProps) => ReactElement;
|
|
505
|
+
|
|
506
|
+
declare const PeugeotInverted: (props: IIconProps) => ReactElement;
|
|
507
|
+
|
|
508
|
+
declare const Hongqi: (props: IIconProps) => ReactElement;
|
|
509
|
+
|
|
510
|
+
declare const Voyah: (props: IIconProps) => ReactElement;
|
|
511
|
+
|
|
512
|
+
declare const Navor: (props: IIconProps) => ReactElement;
|
|
513
|
+
|
|
514
|
+
declare const Leapmotor: (props: IIconProps) => ReactElement;
|
|
515
|
+
|
|
516
|
+
export { Alert, AlfaRomeo, Arrow, BackLink, Button, ButtonTag, CaretDown, CheckBox, Citroen$1 as Citroen, type DeepPartial, DeviceType, Done, Ds, EmptyBox, Exclamation, Fiat, FiatProfessional, FormField, FormProvider, GlobalConfig, HelperText, Hongqi, type IActionButtonProps, type IAlertProps, type IBackLinkProps, type IButtonProps, type IButtonTagProps, type ICheckBoxProps, type IDateTimeFormat, type IFormFieldProps, type IFormProviderProps, type IGlobalConfig, type IGlobalConfigOverrides, type IGlobalConfigProps, type IHelperTextProps, type IInfoTableProps, type IInfoTableRow, type IInputProps, type ILabelProps, type ILinkProps, type INumberFormat, type IOption, type IPlaceholderProviderProps, type IRadioGroupProps, type IRadioInputProps, type ISectionProps, type IOptionProps as ISelectOptionProps, type ISelectProps, type ISelectionBoxProps, type ISelectorOption, type IOptionProps$1 as ISelectorOptionProps, type ISelectorProps, type ISliderProps, type ITypographyProps, type IValidationTargetProps, type IValueContainerProps, Info, InfoTable, Input, Jeep, Label, Leapmotor, Link, Locale, _default as LocaleService, Citroen as Mitsubishi, Navor, Opel, Peugeot, PeugeotInverted, PlaceholderProvider, Play, RadioGroup, RadioInput, Section, Select, Option as SelectOption, SelectionBox, Selector, Option$1 as SelectorOption, Slider, Subtract, type TInputVariant, Typography, ValueContainer, Voyah, arrayToMap, formatDate, formatDateByLocale, formatDateTime, formatDateTimeByLocale, formatNumber, formatNumberByLocale, formatTime, formatTimeByLocale, maskValue, useDateTimeFormat, useDeviceType, useFormattedDate, useFormattedDateTime, useFormattedNumber, useFormattedTime, useGlobalConfig, useMaskedValue, useNumberFormat };
|