@svar-ui/react-core 2.5.1 → 2.6.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/types/index.d.ts CHANGED
@@ -5,9 +5,11 @@ export declare const TextArea: FC<{
5
5
  id?: string | number;
6
6
  placeholder?: string;
7
7
  title?: string;
8
+ tooltip?: string;
8
9
  disabled?: boolean;
9
10
  error?: boolean;
10
11
  readonly?: boolean;
12
+ css?: string;
11
13
  onChange?: (ev: { value: string; input?: boolean }) => void;
12
14
  }>;
13
15
 
@@ -25,6 +27,7 @@ export declare const Button: FC<{
25
27
  icon?: string;
26
28
  disabled?: boolean;
27
29
  title?: string;
30
+ tooltip?: string;
28
31
  text?: string;
29
32
  children?: ReactNode;
30
33
  onClick?: (ev: MouseEvent) => void;
@@ -35,8 +38,8 @@ export declare const Checkbox: FC<{
35
38
  label?: string;
36
39
  inputValue?: string | number;
37
40
  value?: boolean;
38
- style?: string;
39
41
  disabled?: boolean;
42
+ css?: string;
40
43
  onChange?: (ev: { value: boolean; inputValue: string | number }) => void;
41
44
  }>;
42
45
 
@@ -44,6 +47,7 @@ export declare const CheckboxGroup: FC<{
44
47
  options?: { id: string | number; label: string }[];
45
48
  value?: (string | number)[];
46
49
  type?: 'inline' | 'grid';
50
+ css?: string;
47
51
  onChange?: (ev: { value: (string | number)[] }) => void;
48
52
  }>;
49
53
 
@@ -54,14 +58,18 @@ export declare const ColorSelect: FC<{
54
58
  clear?: boolean;
55
59
  placeholder?: string;
56
60
  title?: string;
61
+ tooltip?: string;
57
62
  disabled?: boolean;
58
63
  error?: boolean;
64
+ css?: string;
65
+ dropdown?: DropdownOptions;
59
66
  onChange?: (ev: { value: string }) => void;
60
67
  }>;
61
68
 
62
69
  export declare const ColorBoard: FC<{
63
70
  value?: string;
64
71
  button?: boolean;
72
+ css?: string;
65
73
  onChange?: (ev: { value: string; input?: boolean }) => void;
66
74
  }>;
67
75
 
@@ -70,9 +78,11 @@ export declare const ColorPicker: FC<{
70
78
  id?: string | number;
71
79
  placeholder?: string;
72
80
  title?: string;
81
+ tooltip?: string;
73
82
  disabled?: boolean;
74
83
  error?: boolean;
75
84
  clear?: boolean;
85
+ css?: string;
76
86
  dropdown?: DropdownOptions;
77
87
  onChange?: (ev: { value: string }) => void;
78
88
  }>;
@@ -85,9 +95,11 @@ export declare const Combo: FC<{
85
95
  textField?: string;
86
96
  placeholder?: string;
87
97
  title?: string;
98
+ tooltip?: string;
88
99
  disabled?: boolean;
89
100
  error?: boolean;
90
101
  clear?: boolean;
102
+ css?: string;
91
103
  dropdown?: DropdownOptions & {
92
104
  virtualized?: boolean;
93
105
  };
@@ -100,13 +112,12 @@ export declare const DatePicker: FC<{
100
112
  id?: string | number;
101
113
  disabled?: boolean;
102
114
  error?: boolean;
103
- width?: string;
104
- align?: 'start' | 'center' | 'end';
105
115
  placeholder?: string;
106
116
  format?: string | ((value: Date) => string);
107
117
  buttons?: boolean | ('clear' | 'today')[];
108
118
  css?: string;
109
119
  title?: string;
120
+ tooltip?: string;
110
121
  editable?: boolean | ((value: string) => Date | null);
111
122
  clear?: boolean;
112
123
  dropdown?: DropdownOptions;
@@ -118,11 +129,10 @@ export declare const DateRangePicker: FC<{
118
129
  id?: string | number;
119
130
  disabled?: boolean;
120
131
  error?: boolean;
121
- width?: string;
122
- align?: 'start' | 'center' | 'end';
123
132
  placeholder?: string;
124
133
  css?: string;
125
134
  title?: string;
135
+ tooltip?: string;
126
136
  format?: string | ((date: Date) => string);
127
137
  months?: 1 | 2;
128
138
  buttons?: boolean | ('clear' | 'today' | 'done')[];
@@ -135,6 +145,7 @@ export declare const DateRangePicker: FC<{
135
145
  export declare const Icon: FC<{
136
146
  css?: string;
137
147
  title?: string;
148
+ tooltip?: string;
138
149
  children?: ReactNode;
139
150
  onClick?: (ev: MouseEvent) => void;
140
151
  }>;
@@ -145,11 +156,14 @@ export declare const MultiCombo: FC<{
145
156
  options?: { id: string | number; label: string }[];
146
157
  textOptions?: { id: string | number; label: string }[];
147
158
  textField?: string;
159
+ keepText?: boolean;
148
160
  placeholder?: string;
149
161
  title?: string;
162
+ tooltip?: string;
150
163
  disabled?: boolean;
151
164
  error?: boolean;
152
165
  checkboxes?: boolean;
166
+ css?: string;
153
167
  dropdown?: DropdownOptions & {
154
168
  virtualized?: boolean;
155
169
  };
@@ -162,6 +176,9 @@ export declare const Popup: FC<{
162
176
  top?: number;
163
177
  at?: string;
164
178
  parent?: HTMLElement;
179
+ width?: string;
180
+ css?: string;
181
+ trackScroll?: boolean;
165
182
  mount?: any;
166
183
  children?: ReactNode;
167
184
  onCancel?: (ev: MouseEvent) => void;
@@ -178,6 +195,7 @@ export declare const Pager: FC<{
178
195
  total?: number;
179
196
  pageSize?: number;
180
197
  value?: number;
198
+ css?: string;
181
199
  onChange?: (ev: { value: number; from: number; to: number }) => void;
182
200
  }>;
183
201
 
@@ -188,6 +206,7 @@ export declare const RadioButton: FC<{
188
206
  name?: string;
189
207
  inputValue?: string | number;
190
208
  disabled?: boolean;
209
+ css?: string;
191
210
  onChange?: (ev: { value: boolean; inputValue: string | number }) => void;
192
211
  }>;
193
212
 
@@ -195,6 +214,7 @@ export declare const RadioButtonGroup: FC<{
195
214
  options?: { id: string | number; label: string }[];
196
215
  value?: string | number;
197
216
  type?: 'inline' | 'grid';
217
+ css?: string;
198
218
  onChange?: (ev: { value: string | number }) => void;
199
219
  }>;
200
220
 
@@ -206,8 +226,10 @@ export declare const RichSelect: FC<{
206
226
  disabled?: boolean;
207
227
  error?: boolean;
208
228
  title?: string;
229
+ tooltip?: string;
209
230
  textField?: string;
210
231
  clear?: boolean;
232
+ css?: string;
211
233
  dropdown?: DropdownOptions & {
212
234
  virtualized?: boolean;
213
235
  };
@@ -221,6 +243,7 @@ export declare const Segmented: FC<{
221
243
  label: string;
222
244
  icon?: string;
223
245
  title?: string;
246
+ tooltip?: string;
224
247
  }[];
225
248
  value?: string | number;
226
249
  css?: string;
@@ -233,11 +256,13 @@ export declare const Select: FC<{
233
256
  options?: { id: string | number; label: string }[];
234
257
  placeholder?: string;
235
258
  title?: string;
259
+ tooltip?: string;
236
260
  disabled?: boolean;
237
261
  error?: boolean;
238
262
  textField?: string;
239
263
  clear?: boolean;
240
264
  id?: string | number;
265
+ css?: string;
241
266
  onChange?: (ev: { value: string | number }) => void;
242
267
  }>;
243
268
 
@@ -250,7 +275,9 @@ export declare const Slider: FC<{
250
275
  value?: number;
251
276
  step?: number;
252
277
  title?: string;
278
+ tooltip?: string;
253
279
  disabled?: boolean;
280
+ css?: string;
254
281
  onChange?: (ev: { value: number; previous: number; input?: boolean }) => void;
255
282
  }>;
256
283
 
@@ -258,6 +285,7 @@ export declare const Switch: FC<{
258
285
  id?: string | number;
259
286
  value?: boolean;
260
287
  disabled?: boolean;
288
+ css?: string;
261
289
  onChange?: (ev: { value: boolean }) => void;
262
290
  }>;
263
291
 
@@ -266,10 +294,12 @@ export declare const Tabs: FC<{
266
294
  id: string | number;
267
295
  label?: string;
268
296
  title?: string;
297
+ tooltip?: string;
269
298
  icon?: string;
270
299
  }[];
271
300
  value?: string | number;
272
301
  type?: 'top' | 'bottom';
302
+ css?: string;
273
303
  onChange?: (ev: { value: string | number }) => void;
274
304
  }>;
275
305
 
@@ -283,8 +313,8 @@ export declare const Text: FC<{
283
313
  placeholder?: string;
284
314
  disabled?: boolean;
285
315
  error?: boolean;
286
- inputStyle?: string;
287
316
  title?: string;
317
+ tooltip?: string;
288
318
  css?: string;
289
319
  icon?: string;
290
320
  clear?: boolean;
@@ -300,6 +330,8 @@ export declare const Counter: FC<{
300
330
  error?: boolean;
301
331
  disabled?: boolean;
302
332
  readonly?: boolean;
333
+ css?: string;
334
+ tooltip?: string;
303
335
  onChange?: (ev: { value: number; input?: boolean }) => void;
304
336
  }>;
305
337
 
@@ -310,6 +342,8 @@ export declare const Field: FC<{
310
342
  error?: boolean;
311
343
  type?: 'checkbox' | 'slider' | 'switch';
312
344
  required?: boolean;
345
+ id?: string | number;
346
+ css?: string;
313
347
  children?: ReactNode;
314
348
  }>;
315
349
 
@@ -318,6 +352,7 @@ export declare const Calendar: FC<{
318
352
  current?: Date;
319
353
  markers?: (date: Date) => string;
320
354
  buttons?: boolean | ('clear' | 'today')[];
355
+ css?: string;
321
356
  onChange?: (ev: { value: Date | null }) => void;
322
357
  }>;
323
358
 
@@ -337,6 +372,7 @@ export declare const RangeCalendar: FC<{
337
372
  months?: 1 | 2;
338
373
  markers?: (date: Date) => string;
339
374
  buttons?: boolean | ('clear' | 'today' | 'done')[];
375
+ css?: string;
340
376
  onChange?: (ev: { start: Date | null; end: Date | null }) => void;
341
377
  }>;
342
378
 
@@ -344,6 +380,7 @@ export declare const TimePicker: FC<{
344
380
  value?: Date;
345
381
  id?: string | number;
346
382
  title?: string;
383
+ tooltip?: string;
347
384
  css?: string;
348
385
  disabled?: boolean;
349
386
  error?: boolean;
@@ -366,6 +403,7 @@ export declare const TwoState: FC<{
366
403
  disabled?: boolean;
367
404
  iconActive?: string;
368
405
  title?: string;
406
+ tooltip?: string;
369
407
  css?: string;
370
408
  text?: string;
371
409
  textActive?: string;
@@ -380,6 +418,7 @@ export declare const Modal: FC<{
380
418
  buttons?: boolean | string[];
381
419
  header?: ReactNode;
382
420
  footer?: ReactNode;
421
+ css?: string;
383
422
  children?: ReactNode;
384
423
  onConfirm?: (ev: { button?: string; event: MouseEvent }) => void;
385
424
  onCancel?: (ev: { button?: string; event: MouseEvent }) => void;
@@ -391,6 +430,7 @@ export declare const ModalArea: FC<{
391
430
 
392
431
  export declare const SideArea: FC<{
393
432
  position?: 'right';
433
+ css?: string;
394
434
  children?: ReactNode;
395
435
  onCancel?: () => void;
396
436
  }>;
@@ -430,12 +470,14 @@ export declare const Avatar: FC<{
430
470
  value?: IUser | IUser[];
431
471
  size?: number;
432
472
  limit?: number;
473
+ css?: string;
433
474
  }>;
434
475
 
435
476
  export interface DropdownOptions {
436
477
  inline?: boolean;
437
478
  position?: 'top' | 'right' | 'bottom' | 'left';
438
479
  align?: 'start' | 'center' | 'end';
480
+ autoFit?: boolean;
439
481
  css?: string;
440
482
  width?: string | 'unset' | 'auto';
441
483
  trackScroll?: boolean;
@@ -466,6 +508,29 @@ export declare const SuggestDropdown: FC<
466
508
  }
467
509
  >;
468
510
 
469
- export type { ILocale, Terms } from '@svar-ui/lib-dom';
511
+ export type { ILocale, Terms, TPosition } from '@svar-ui/lib-dom';
512
+ import type { TPosition } from '@svar-ui/lib-dom';
470
513
 
471
514
  export declare function popupContainer(node: HTMLElement): void;
515
+
516
+ export type TPositionNoFit = Exclude<
517
+ TPosition,
518
+ 'bottom-fit' | 'top-fit' | 'center-fit'
519
+ >;
520
+
521
+ export type TooltipResolver = (
522
+ element: HTMLElement,
523
+ event: MouseEvent,
524
+ ) => Record<string, any> | string | null;
525
+
526
+ export declare const Tooltip: FC<{
527
+ at?: TPositionNoFit;
528
+ arrow?: boolean;
529
+ touch?: boolean;
530
+ overflow?: boolean;
531
+ delay?: number;
532
+ content?: FC<Record<string, any>> | null;
533
+ resolver?: TooltipResolver;
534
+ children?: ReactNode;
535
+ css?: string;
536
+ }>;