@banzamel/mineralui 0.1.0 → 0.2.1
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/README.md +114 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +563 -0
- package/dist/index.js +2904 -173
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +15 -146
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,83 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { CSSProperties } from 'react';
|
|
3
|
+
import { Dispatch } from 'react';
|
|
3
4
|
import { FocusEvent as FocusEvent_2 } from 'react';
|
|
4
5
|
import { ForwardRefExoticComponent } from 'react';
|
|
5
6
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
6
7
|
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
7
8
|
import { ReactNode } from 'react';
|
|
9
|
+
import { ReactPortal } from 'react';
|
|
8
10
|
import { RefAttributes } from 'react';
|
|
11
|
+
import { RefObject } from 'react';
|
|
12
|
+
import { SetStateAction } from 'react';
|
|
13
|
+
|
|
14
|
+
export declare function addMonths(date: Date, count: number): Date;
|
|
15
|
+
|
|
16
|
+
export declare function addYears(date: Date, count: number): Date;
|
|
17
|
+
|
|
18
|
+
export declare function adjustCursorAfterFormat(oldValue: string, newValue: string, oldCursor: number): number;
|
|
19
|
+
|
|
20
|
+
export declare function Autocomplete<T = string>({ options, value, onChange, getOptionLabel, getOptionValue, filterOptions, multiple, freeSolo, debounceMs, onInputChange, loading, loadingText, noOptionsText, placeholder, disabled, name, id, variant, size, fullWidth, label, helperText, errorText, error, required, clearable, maxHeight, renderOption, renderTags, className, style, }: AutocompleteProps<T>): JSX_2.Element;
|
|
21
|
+
|
|
22
|
+
export declare interface AutocompleteProps<T = string> {
|
|
23
|
+
options: T[];
|
|
24
|
+
value?: T | T[];
|
|
25
|
+
onChange?: (value: T | T[]) => void;
|
|
26
|
+
getOptionLabel?: (option: T) => string;
|
|
27
|
+
getOptionValue?: (option: T) => string;
|
|
28
|
+
filterOptions?: (options: T[], inputValue: string) => T[];
|
|
29
|
+
multiple?: boolean;
|
|
30
|
+
freeSolo?: boolean;
|
|
31
|
+
debounceMs?: number;
|
|
32
|
+
onInputChange?: (value: string) => void;
|
|
33
|
+
loading?: boolean;
|
|
34
|
+
loadingText?: string;
|
|
35
|
+
noOptionsText?: string;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
name?: string;
|
|
39
|
+
id?: string;
|
|
40
|
+
variant?: AutocompleteVariant;
|
|
41
|
+
size?: MineralSize;
|
|
42
|
+
color?: MineralColor;
|
|
43
|
+
fullWidth?: boolean;
|
|
44
|
+
label?: string;
|
|
45
|
+
helperText?: string;
|
|
46
|
+
errorText?: string;
|
|
47
|
+
error?: boolean;
|
|
48
|
+
required?: boolean;
|
|
49
|
+
clearable?: boolean;
|
|
50
|
+
maxHeight?: number;
|
|
51
|
+
renderOption?: (option: T, isActive: boolean) => ReactNode;
|
|
52
|
+
renderTags?: (selected: T[], onRemove: (index: number) => void) => ReactNode;
|
|
53
|
+
className?: string;
|
|
54
|
+
style?: CSSProperties;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export declare type AutocompleteVariant = 'outlined' | 'filled' | 'underlined';
|
|
58
|
+
|
|
59
|
+
export declare function capitalizeWords(value: string): string;
|
|
60
|
+
|
|
61
|
+
export declare const Checkbox: ForwardRefExoticComponent<CheckboxProps & RefAttributes<HTMLInputElement>>;
|
|
62
|
+
|
|
63
|
+
export declare interface CheckboxProps {
|
|
64
|
+
checked?: boolean;
|
|
65
|
+
defaultChecked?: boolean;
|
|
66
|
+
indeterminate?: boolean;
|
|
67
|
+
name?: string;
|
|
68
|
+
id?: string;
|
|
69
|
+
value?: string;
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
size?: MineralSize;
|
|
72
|
+
color?: MineralColor;
|
|
73
|
+
label?: ReactNode;
|
|
74
|
+
labelPosition?: 'right' | 'left';
|
|
75
|
+
error?: boolean;
|
|
76
|
+
errorText?: string;
|
|
77
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
78
|
+
className?: string;
|
|
79
|
+
style?: CSSProperties;
|
|
80
|
+
}
|
|
9
81
|
|
|
10
82
|
/**
|
|
11
83
|
* Łączy klasy CSS, odfiltrowując falsy wartości.
|
|
@@ -13,8 +85,194 @@ import { RefAttributes } from 'react';
|
|
|
13
85
|
*/
|
|
14
86
|
export declare function cn(...classes: (string | undefined | null | false)[]): string;
|
|
15
87
|
|
|
88
|
+
export declare function composeValidators(...validators: ValidatorFn[]): ValidatorFn;
|
|
89
|
+
|
|
90
|
+
export declare interface CurrencyFormatOptions {
|
|
91
|
+
decimalSeparator?: '.' | ',';
|
|
92
|
+
thousandSeparator?: ' ' | '.' | ',' | '';
|
|
93
|
+
precision?: number;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export declare function DatePicker({ value, defaultValue, onChange, format, locale, min, max, disabledDates, placeholder, disabled, readOnly, name, id, variant, size, label, helperText, errorText, error, required, clearable, inline, showTodayButton, firstDayOfWeek, fullWidth, className, style, }: DatePickerProps): JSX_2.Element;
|
|
97
|
+
|
|
98
|
+
export declare interface DatePickerProps {
|
|
99
|
+
value?: Date | string;
|
|
100
|
+
defaultValue?: Date | string;
|
|
101
|
+
onChange?: (date: Date | null) => void;
|
|
102
|
+
format?: string;
|
|
103
|
+
locale?: 'pl' | 'en';
|
|
104
|
+
min?: Date | string;
|
|
105
|
+
max?: Date | string;
|
|
106
|
+
disabledDates?: Date[] | ((date: Date) => boolean);
|
|
107
|
+
placeholder?: string;
|
|
108
|
+
disabled?: boolean;
|
|
109
|
+
readOnly?: boolean;
|
|
110
|
+
name?: string;
|
|
111
|
+
id?: string;
|
|
112
|
+
variant?: DatePickerVariant;
|
|
113
|
+
size?: MineralSize;
|
|
114
|
+
label?: string;
|
|
115
|
+
helperText?: string;
|
|
116
|
+
errorText?: string;
|
|
117
|
+
error?: boolean;
|
|
118
|
+
required?: boolean;
|
|
119
|
+
clearable?: boolean;
|
|
120
|
+
inline?: boolean;
|
|
121
|
+
showTodayButton?: boolean;
|
|
122
|
+
firstDayOfWeek?: 0 | 1;
|
|
123
|
+
fullWidth?: boolean;
|
|
124
|
+
className?: string;
|
|
125
|
+
style?: CSSProperties;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export declare type DatePickerVariant = 'outlined' | 'filled' | 'underlined';
|
|
129
|
+
|
|
130
|
+
export declare function daysInMonth(year: number, month: number): number;
|
|
131
|
+
|
|
132
|
+
export declare interface FieldRegistration {
|
|
133
|
+
name: string;
|
|
134
|
+
validate?: ValidatorFn[];
|
|
135
|
+
required?: boolean;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export declare function firstDayOfMonth(year: number, month: number): number;
|
|
139
|
+
|
|
140
|
+
export declare function Form({ initialValues, onSubmit, onChange, validationMode, children, className, style, noValidate, }: FormProps): JSX_2.Element;
|
|
141
|
+
|
|
142
|
+
export declare function formatCurrency(value: string, options?: CurrencyFormatOptions): string;
|
|
143
|
+
|
|
144
|
+
export declare function formatDate(date: Date, format?: string): string;
|
|
145
|
+
|
|
146
|
+
export declare function formatIBAN(value: string): string;
|
|
147
|
+
|
|
148
|
+
export declare function formatNIP(value: string): string;
|
|
149
|
+
|
|
150
|
+
export declare function formatPhone(value: string, options?: PhoneFormatOptions): string;
|
|
151
|
+
|
|
152
|
+
export declare function formatTime(hours: number, minutes: number, seconds?: number, showSeconds?: boolean): string;
|
|
153
|
+
|
|
154
|
+
export declare interface FormContextValue {
|
|
155
|
+
values: Record<string, unknown>;
|
|
156
|
+
errors: Record<string, string>;
|
|
157
|
+
touched: Record<string, boolean>;
|
|
158
|
+
registerField: (reg: FieldRegistration) => void;
|
|
159
|
+
unregisterField: (name: string) => void;
|
|
160
|
+
setFieldValue: (name: string, value: unknown) => void;
|
|
161
|
+
setFieldError: (name: string, error: string) => void;
|
|
162
|
+
setFieldTouched: (name: string, touched: boolean) => void;
|
|
163
|
+
validateField: (name: string) => ValidationResult;
|
|
164
|
+
validateAll: () => boolean;
|
|
165
|
+
resetForm: () => void;
|
|
166
|
+
isSubmitting: boolean;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export declare interface FormFieldProps {
|
|
170
|
+
name: string;
|
|
171
|
+
validate?: ValidatorFn[];
|
|
172
|
+
required?: boolean;
|
|
173
|
+
children: ReactNode;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare interface FormHelpers {
|
|
177
|
+
setSubmitting: (isSubmitting: boolean) => void;
|
|
178
|
+
resetForm: () => void;
|
|
179
|
+
setFieldError: (name: string, error: string) => void;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export declare interface FormProps {
|
|
183
|
+
initialValues?: Record<string, unknown>;
|
|
184
|
+
onSubmit?: (values: Record<string, unknown>, helpers: FormHelpers) => void | Promise<void>;
|
|
185
|
+
onChange?: (values: Record<string, unknown>) => void;
|
|
186
|
+
validationMode?: 'onSubmit' | 'onBlur' | 'onChange';
|
|
187
|
+
children: ReactNode | ((ctx: FormContextValue) => ReactNode);
|
|
188
|
+
className?: string;
|
|
189
|
+
style?: CSSProperties;
|
|
190
|
+
noValidate?: boolean;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export declare function getDayNames(locale?: 'pl' | 'en'): string[];
|
|
194
|
+
|
|
195
|
+
export declare function getMonthNames(locale?: 'pl' | 'en'): string[];
|
|
196
|
+
|
|
16
197
|
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
17
198
|
|
|
199
|
+
export declare const InputCurrency: ForwardRefExoticComponent<InputCurrencyProps & RefAttributes<HTMLInputElement>>;
|
|
200
|
+
|
|
201
|
+
export declare interface InputCurrencyProps extends Omit<InputProps, 'type'> {
|
|
202
|
+
currency?: string;
|
|
203
|
+
currencySymbol?: string;
|
|
204
|
+
currencyPosition?: 'start' | 'end';
|
|
205
|
+
decimalSeparator?: '.' | ',';
|
|
206
|
+
thousandSeparator?: ' ' | '.' | ',' | '';
|
|
207
|
+
precision?: number;
|
|
208
|
+
min?: number;
|
|
209
|
+
max?: number;
|
|
210
|
+
allowNegative?: boolean;
|
|
211
|
+
onValueChange?: (value: number | null) => void;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export declare const InputEmail: ForwardRefExoticComponent<InputEmailProps & RefAttributes<HTMLInputElement>>;
|
|
215
|
+
|
|
216
|
+
export declare interface InputEmailProps extends Omit<InputProps, 'type'> {
|
|
217
|
+
validateOnBlur?: boolean;
|
|
218
|
+
validateOnChange?: boolean;
|
|
219
|
+
showValidIcon?: boolean;
|
|
220
|
+
onValidationChange?: (result: ValidationResult) => void;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export declare const InputIBAN: ForwardRefExoticComponent<InputIBANProps & RefAttributes<HTMLInputElement>>;
|
|
224
|
+
|
|
225
|
+
export declare interface InputIBANProps extends Omit<InputProps, 'type'> {
|
|
226
|
+
countryCode?: string;
|
|
227
|
+
formatOnChange?: boolean;
|
|
228
|
+
validateOnBlur?: boolean;
|
|
229
|
+
showValidIcon?: boolean;
|
|
230
|
+
onValidationChange?: (result: ValidationResult) => void;
|
|
231
|
+
onValueChange?: (rawValue: string, formattedValue: string) => void;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export declare const InputName: ForwardRefExoticComponent<InputNameProps & RefAttributes<HTMLInputElement>>;
|
|
235
|
+
|
|
236
|
+
export declare interface InputNameProps extends Omit<InputProps, 'type'> {
|
|
237
|
+
autoCapitalize?: boolean;
|
|
238
|
+
allowNumbers?: boolean;
|
|
239
|
+
allowSpecialChars?: boolean;
|
|
240
|
+
minWords?: number;
|
|
241
|
+
validateOnBlur?: boolean;
|
|
242
|
+
onValidationChange?: (result: ValidationResult) => void;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export declare const InputNumber: ForwardRefExoticComponent<InputNumberProps & RefAttributes<HTMLInputElement>>;
|
|
246
|
+
|
|
247
|
+
export declare interface InputNumberProps extends Omit<InputProps, 'type'> {
|
|
248
|
+
min?: number;
|
|
249
|
+
max?: number;
|
|
250
|
+
step?: number;
|
|
251
|
+
showStepper?: boolean;
|
|
252
|
+
precision?: number;
|
|
253
|
+
allowNegative?: boolean;
|
|
254
|
+
onValueChange?: (value: number | null) => void;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export declare const InputPassword: ForwardRefExoticComponent<InputPasswordProps & RefAttributes<HTMLInputElement>>;
|
|
258
|
+
|
|
259
|
+
export declare interface InputPasswordProps extends Omit<InputProps, 'type' | 'endIcon'> {
|
|
260
|
+
showToggle?: boolean;
|
|
261
|
+
showStrength?: boolean;
|
|
262
|
+
onStrengthChange?: (strength: PasswordStrength) => void;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export declare const InputPhone: ForwardRefExoticComponent<InputPhoneProps & RefAttributes<HTMLInputElement>>;
|
|
266
|
+
|
|
267
|
+
export declare interface InputPhoneProps extends Omit<InputProps, 'type'> {
|
|
268
|
+
countryCode?: string;
|
|
269
|
+
showCountryCode?: boolean;
|
|
270
|
+
formatOnChange?: boolean;
|
|
271
|
+
validateOnBlur?: boolean;
|
|
272
|
+
onValidationChange?: (result: ValidationResult) => void;
|
|
273
|
+
onValueChange?: (rawValue: string, formattedValue: string) => void;
|
|
274
|
+
}
|
|
275
|
+
|
|
18
276
|
export declare interface InputProps {
|
|
19
277
|
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'datetime-local' | 'time';
|
|
20
278
|
value?: string | number;
|
|
@@ -27,6 +285,7 @@ export declare interface InputProps {
|
|
|
27
285
|
required?: boolean;
|
|
28
286
|
autoFocus?: boolean;
|
|
29
287
|
autoComplete?: string;
|
|
288
|
+
inputMode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
30
289
|
variant?: InputVariant;
|
|
31
290
|
size?: MineralSize;
|
|
32
291
|
color?: MineralColor;
|
|
@@ -54,8 +313,30 @@ export declare interface InputProps {
|
|
|
54
313
|
labelClassName?: string;
|
|
55
314
|
}
|
|
56
315
|
|
|
316
|
+
export declare const InputSearch: ForwardRefExoticComponent<InputSearchProps & RefAttributes<HTMLInputElement>>;
|
|
317
|
+
|
|
318
|
+
export declare interface InputSearchProps extends Omit<InputProps, 'type' | 'startIcon'> {
|
|
319
|
+
debounceMs?: number;
|
|
320
|
+
onSearch?: (value: string) => void;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export declare const InputTaxId: ForwardRefExoticComponent<InputTaxIdProps & RefAttributes<HTMLInputElement>>;
|
|
324
|
+
|
|
325
|
+
export declare interface InputTaxIdProps extends Omit<InputProps, 'type'> {
|
|
326
|
+
taxIdType: TaxIdType;
|
|
327
|
+
formatOnChange?: boolean;
|
|
328
|
+
validateOnBlur?: boolean;
|
|
329
|
+
showValidIcon?: boolean;
|
|
330
|
+
onValidationChange?: (result: ValidationResult) => void;
|
|
331
|
+
onValueChange?: (rawValue: string) => void;
|
|
332
|
+
}
|
|
333
|
+
|
|
57
334
|
export declare type InputVariant = 'outlined' | 'filled' | 'underlined';
|
|
58
335
|
|
|
336
|
+
export declare function isDateInRange(date: Date, min?: Date | null, max?: Date | null): boolean;
|
|
337
|
+
|
|
338
|
+
export declare function isSameDay(a: Date, b: Date): boolean;
|
|
339
|
+
|
|
59
340
|
export declare type MineralColor = 'primary' | 'success' | 'error' | 'warning' | 'info';
|
|
60
341
|
|
|
61
342
|
export declare type MineralSize = 'sm' | 'md' | 'lg';
|
|
@@ -90,6 +371,288 @@ declare interface MineralThemeProviderProps {
|
|
|
90
371
|
children: ReactNode;
|
|
91
372
|
}
|
|
92
373
|
|
|
374
|
+
export declare function parseCurrencyToNumber(formatted: string, thousandSeparator?: string, decimalSeparator?: string): number | null;
|
|
375
|
+
|
|
376
|
+
export declare function parseDate(value: string, format?: string): Date | null;
|
|
377
|
+
|
|
378
|
+
export declare function parseTime(value: string): {
|
|
379
|
+
hours: number;
|
|
380
|
+
minutes: number;
|
|
381
|
+
seconds: number;
|
|
382
|
+
} | null;
|
|
383
|
+
|
|
384
|
+
export declare type PasswordStrength = 'weak' | 'fair' | 'good' | 'strong';
|
|
385
|
+
|
|
386
|
+
export declare interface PhoneFormatOptions {
|
|
387
|
+
countryCode?: string;
|
|
388
|
+
groupPattern?: number[];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export declare function Popover({ open, anchorRef, onClose, placement, matchWidth, offset, children, className, style, }: PopoverProps): JSX_2.Element | null;
|
|
392
|
+
|
|
393
|
+
export declare type PopoverPlacement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
|
|
394
|
+
|
|
395
|
+
export declare interface PopoverProps {
|
|
396
|
+
open: boolean;
|
|
397
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
398
|
+
onClose: () => void;
|
|
399
|
+
placement?: PopoverPlacement;
|
|
400
|
+
matchWidth?: boolean;
|
|
401
|
+
offset?: number;
|
|
402
|
+
children: ReactNode;
|
|
403
|
+
className?: string;
|
|
404
|
+
style?: CSSProperties;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export declare function Portal({ children, container }: PortalProps): ReactPortal | null;
|
|
408
|
+
|
|
409
|
+
export declare interface PortalProps {
|
|
410
|
+
children: ReactNode;
|
|
411
|
+
container?: HTMLElement;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
export declare const Radio: ForwardRefExoticComponent<RadioProps & RefAttributes<HTMLInputElement>>;
|
|
415
|
+
|
|
416
|
+
export declare function RadioGroup({ name, value, defaultValue, onChange, direction, children, disabled, size, color, error, errorText, label, className, style, }: RadioGroupProps): JSX_2.Element;
|
|
417
|
+
|
|
418
|
+
export declare interface RadioGroupProps {
|
|
419
|
+
name: string;
|
|
420
|
+
value?: string;
|
|
421
|
+
defaultValue?: string;
|
|
422
|
+
onChange?: (value: string) => void;
|
|
423
|
+
direction?: 'horizontal' | 'vertical';
|
|
424
|
+
children: ReactNode;
|
|
425
|
+
disabled?: boolean;
|
|
426
|
+
size?: MineralSize;
|
|
427
|
+
color?: MineralColor;
|
|
428
|
+
error?: boolean;
|
|
429
|
+
errorText?: string;
|
|
430
|
+
label?: string;
|
|
431
|
+
className?: string;
|
|
432
|
+
style?: CSSProperties;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export declare interface RadioProps {
|
|
436
|
+
checked?: boolean;
|
|
437
|
+
defaultChecked?: boolean;
|
|
438
|
+
name?: string;
|
|
439
|
+
id?: string;
|
|
440
|
+
value?: string;
|
|
441
|
+
disabled?: boolean;
|
|
442
|
+
size?: MineralSize;
|
|
443
|
+
color?: MineralColor;
|
|
444
|
+
label?: ReactNode;
|
|
445
|
+
labelPosition?: 'right' | 'left';
|
|
446
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
447
|
+
className?: string;
|
|
448
|
+
style?: CSSProperties;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export declare function Select({ options, value, defaultValue, onChange, multiple, searchable, placeholder, disabled, name, id, variant, size, color, fullWidth, label, helperText, errorText, error, required, loading, clearable, maxHeight, noOptionsText, renderOption, renderValue, className, style, }: SelectProps): JSX_2.Element;
|
|
452
|
+
|
|
453
|
+
export declare interface SelectOption {
|
|
454
|
+
value: string;
|
|
455
|
+
label: string;
|
|
456
|
+
disabled?: boolean;
|
|
457
|
+
group?: string;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export declare interface SelectProps {
|
|
461
|
+
options: SelectOption[];
|
|
462
|
+
value?: string | string[];
|
|
463
|
+
defaultValue?: string | string[];
|
|
464
|
+
onChange?: (value: string | string[]) => void;
|
|
465
|
+
multiple?: boolean;
|
|
466
|
+
searchable?: boolean;
|
|
467
|
+
placeholder?: string;
|
|
468
|
+
disabled?: boolean;
|
|
469
|
+
name?: string;
|
|
470
|
+
id?: string;
|
|
471
|
+
variant?: SelectVariant;
|
|
472
|
+
size?: MineralSize;
|
|
473
|
+
color?: MineralColor;
|
|
474
|
+
fullWidth?: boolean;
|
|
475
|
+
label?: string;
|
|
476
|
+
helperText?: string;
|
|
477
|
+
errorText?: string;
|
|
478
|
+
error?: boolean;
|
|
479
|
+
required?: boolean;
|
|
480
|
+
loading?: boolean;
|
|
481
|
+
clearable?: boolean;
|
|
482
|
+
maxHeight?: number;
|
|
483
|
+
noOptionsText?: string;
|
|
484
|
+
renderOption?: (option: SelectOption, isActive: boolean, isSelected: boolean) => ReactNode;
|
|
485
|
+
renderValue?: (selected: SelectOption | SelectOption[]) => ReactNode;
|
|
486
|
+
className?: string;
|
|
487
|
+
style?: CSSProperties;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export declare type SelectVariant = 'outlined' | 'filled' | 'underlined';
|
|
491
|
+
|
|
492
|
+
export declare function stripNonAlphanumeric(value: string): string;
|
|
493
|
+
|
|
494
|
+
export declare function stripNonDigits(value: string): string;
|
|
495
|
+
|
|
496
|
+
export declare function stripTime(date: Date): Date;
|
|
497
|
+
|
|
498
|
+
export declare type TaxIdType = 'NIP' | 'PESEL' | 'REGON';
|
|
499
|
+
|
|
500
|
+
export declare const Textarea: ForwardRefExoticComponent<TextareaProps & RefAttributes<HTMLTextAreaElement>>;
|
|
501
|
+
|
|
502
|
+
export declare interface TextareaProps {
|
|
503
|
+
value?: string;
|
|
504
|
+
defaultValue?: string;
|
|
505
|
+
name?: string;
|
|
506
|
+
id?: string;
|
|
507
|
+
placeholder?: string;
|
|
508
|
+
disabled?: boolean;
|
|
509
|
+
readOnly?: boolean;
|
|
510
|
+
required?: boolean;
|
|
511
|
+
autoFocus?: boolean;
|
|
512
|
+
rows?: number;
|
|
513
|
+
autoResize?: boolean;
|
|
514
|
+
minRows?: number;
|
|
515
|
+
maxRows?: number;
|
|
516
|
+
variant?: TextareaVariant;
|
|
517
|
+
size?: MineralSize;
|
|
518
|
+
color?: MineralColor;
|
|
519
|
+
fullWidth?: boolean;
|
|
520
|
+
label?: string;
|
|
521
|
+
helperText?: string;
|
|
522
|
+
errorText?: string;
|
|
523
|
+
error?: boolean;
|
|
524
|
+
success?: boolean;
|
|
525
|
+
maxLength?: number;
|
|
526
|
+
showCharCount?: boolean;
|
|
527
|
+
loading?: boolean;
|
|
528
|
+
onChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
529
|
+
onFocus?: (e: FocusEvent_2<HTMLTextAreaElement>) => void;
|
|
530
|
+
onBlur?: (e: FocusEvent_2<HTMLTextAreaElement>) => void;
|
|
531
|
+
className?: string;
|
|
532
|
+
style?: CSSProperties;
|
|
533
|
+
textareaClassName?: string;
|
|
534
|
+
labelClassName?: string;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export declare type TextareaVariant = 'outlined' | 'filled' | 'underlined';
|
|
538
|
+
|
|
539
|
+
export declare function TimePicker({ value, defaultValue, onChange, format, showSeconds, minuteStep, min, max, placeholder, disabled, readOnly, name, id, variant, size, label, helperText, errorText, error, required, clearable, fullWidth, className, style, }: TimePickerProps): JSX_2.Element;
|
|
540
|
+
|
|
541
|
+
export declare interface TimePickerProps {
|
|
542
|
+
value?: string;
|
|
543
|
+
defaultValue?: string;
|
|
544
|
+
onChange?: (time: string) => void;
|
|
545
|
+
format?: '24h' | '12h';
|
|
546
|
+
showSeconds?: boolean;
|
|
547
|
+
minuteStep?: number;
|
|
548
|
+
min?: string;
|
|
549
|
+
max?: string;
|
|
550
|
+
placeholder?: string;
|
|
551
|
+
disabled?: boolean;
|
|
552
|
+
readOnly?: boolean;
|
|
553
|
+
name?: string;
|
|
554
|
+
id?: string;
|
|
555
|
+
variant?: TimePickerVariant;
|
|
556
|
+
size?: MineralSize;
|
|
557
|
+
label?: string;
|
|
558
|
+
helperText?: string;
|
|
559
|
+
errorText?: string;
|
|
560
|
+
error?: boolean;
|
|
561
|
+
required?: boolean;
|
|
562
|
+
clearable?: boolean;
|
|
563
|
+
fullWidth?: boolean;
|
|
564
|
+
className?: string;
|
|
565
|
+
style?: CSSProperties;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export declare type TimePickerVariant = 'outlined' | 'filled' | 'underlined';
|
|
569
|
+
|
|
570
|
+
export declare const Toggle: ForwardRefExoticComponent<ToggleProps & RefAttributes<HTMLInputElement>>;
|
|
571
|
+
|
|
572
|
+
export declare interface ToggleProps {
|
|
573
|
+
checked?: boolean;
|
|
574
|
+
defaultChecked?: boolean;
|
|
575
|
+
name?: string;
|
|
576
|
+
id?: string;
|
|
577
|
+
disabled?: boolean;
|
|
578
|
+
size?: MineralSize;
|
|
579
|
+
color?: MineralColor;
|
|
580
|
+
label?: ReactNode;
|
|
581
|
+
labelPosition?: 'right' | 'left';
|
|
582
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
583
|
+
className?: string;
|
|
584
|
+
style?: CSSProperties;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export declare function unformatIBAN(value: string): string;
|
|
588
|
+
|
|
589
|
+
export declare function useClickOutside(ref: RefObject<HTMLElement | null>, handler: () => void): void;
|
|
590
|
+
|
|
591
|
+
export declare function useDebounce<T>(value: T, delay: number): T;
|
|
592
|
+
|
|
593
|
+
export declare function useDebouncedCallback<T extends (...args: any[]) => void>(callback: T, delay: number): T;
|
|
594
|
+
|
|
595
|
+
export declare function useFormContext(): FormContextValue | null;
|
|
596
|
+
|
|
597
|
+
export declare function useFormField(name: string, options?: UseFormFieldOptions): UseFormFieldReturn;
|
|
598
|
+
|
|
599
|
+
export declare interface UseFormFieldOptions {
|
|
600
|
+
validate?: ValidatorFn[];
|
|
601
|
+
required?: boolean;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
export declare interface UseFormFieldReturn {
|
|
605
|
+
value: unknown;
|
|
606
|
+
error: string | undefined;
|
|
607
|
+
touched: boolean;
|
|
608
|
+
onChange: (value: unknown) => void;
|
|
609
|
+
onBlur: () => void;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export declare function useKeyboardNav({ itemCount, onSelect, onClose, isOpen, loop, }: UseKeyboardNavOptions): {
|
|
613
|
+
activeIndex: number;
|
|
614
|
+
setActiveIndex: Dispatch<SetStateAction<number>>;
|
|
615
|
+
resetIndex: () => void;
|
|
616
|
+
onKeyDown: (e: KeyboardEvent_2) => void;
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
export declare interface UseKeyboardNavOptions {
|
|
620
|
+
itemCount: number;
|
|
621
|
+
onSelect: (index: number) => void;
|
|
622
|
+
onClose: () => void;
|
|
623
|
+
isOpen: boolean;
|
|
624
|
+
loop?: boolean;
|
|
625
|
+
}
|
|
626
|
+
|
|
93
627
|
export declare function useTheme(): MineralTheme;
|
|
94
628
|
|
|
629
|
+
export declare function validateEmail(value: string): ValidationResult;
|
|
630
|
+
|
|
631
|
+
export declare function validateIBAN(value: string): ValidationResult;
|
|
632
|
+
|
|
633
|
+
export declare function validateMaxLength(max: number): ValidatorFn;
|
|
634
|
+
|
|
635
|
+
export declare function validateMinLength(min: number): ValidatorFn;
|
|
636
|
+
|
|
637
|
+
export declare function validateNIP(value: string): ValidationResult;
|
|
638
|
+
|
|
639
|
+
export declare function validatePattern(pattern: RegExp, message?: string): ValidatorFn;
|
|
640
|
+
|
|
641
|
+
export declare function validatePESEL(value: string): ValidationResult;
|
|
642
|
+
|
|
643
|
+
export declare function validatePhone(value: string, countryCode?: string): ValidationResult;
|
|
644
|
+
|
|
645
|
+
export declare function validateRange(min?: number, max?: number): ValidatorFn;
|
|
646
|
+
|
|
647
|
+
export declare function validateREGON(value: string): ValidationResult;
|
|
648
|
+
|
|
649
|
+
export declare function validateRequired(value: string): ValidationResult;
|
|
650
|
+
|
|
651
|
+
export declare interface ValidationResult {
|
|
652
|
+
valid: boolean;
|
|
653
|
+
error?: string;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
export declare type ValidatorFn = (value: string) => ValidationResult;
|
|
657
|
+
|
|
95
658
|
export { }
|