cortex-react-ui 0.2.15 → 0.2.17
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/lib/cjs/Dialog/DialogActions.d.ts +2 -2
- package/lib/cjs/Dialog/DialogTitle.d.ts +3 -3
- package/lib/cjs/Input/Input.d.ts +1 -1
- package/lib/cjs/Map/components/DrawTools.d.ts +4 -4
- package/lib/cjs/Menu/AuthDownloadLink.d.ts +2 -2
- package/lib/cjs/TextField/TextFieldInput.d.ts +1 -1
- package/lib/cjs/Tooltip/Tooltip.d.ts +1 -1
- package/lib/cjs/Transition/CSSTransition.d.ts +1 -1
- package/lib/cjs/Transition/Fade.d.ts +1 -1
- package/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +7 -7
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils/forwardRef.d.ts +35 -0
- package/lib/cjs/utils/setRef.d.ts +9 -2
- package/lib/cjs/utils/useForkRef.d.ts +9 -1
- package/lib/esm/Dialog/DialogActions.d.ts +2 -2
- package/lib/esm/Dialog/DialogTitle.d.ts +3 -3
- package/lib/esm/Input/Input.d.ts +1 -1
- package/lib/esm/Map/components/DrawTools.d.ts +4 -4
- package/lib/esm/Menu/AuthDownloadLink.d.ts +2 -2
- package/lib/esm/TextField/TextFieldInput.d.ts +1 -1
- package/lib/esm/Tooltip/Tooltip.d.ts +1 -1
- package/lib/esm/Transition/CSSTransition.d.ts +1 -1
- package/lib/esm/Transition/Fade.d.ts +1 -1
- package/lib/esm/index.d.ts +2 -0
- package/lib/esm/index.js +7 -7
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/utils/forwardRef.d.ts +35 -0
- package/lib/esm/utils/setRef.d.ts +9 -2
- package/lib/esm/utils/useForkRef.d.ts +9 -1
- package/lib/index.d.ts +115 -80
- package/package.json +9 -9
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Utility type pour créer des props avec ref pour la compatibilité React 18/19
|
|
4
|
+
* En React 19, ref est passé directement dans les props
|
|
5
|
+
* En React 18, ref est passé séparément via forwardRef
|
|
6
|
+
*/
|
|
7
|
+
export type ForwardRefProps<T, P = object> = P & {
|
|
8
|
+
ref?: React.Ref<T>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Type pour la fonction de rendu compatible React 18/19
|
|
12
|
+
*/
|
|
13
|
+
export type ForwardRefRenderFunction<T, P> = (props: P, ref: React.ForwardedRef<T>) => React.ReactElement | null;
|
|
14
|
+
/**
|
|
15
|
+
* Composant wrapper compatible React 18 et React 19
|
|
16
|
+
*
|
|
17
|
+
* Utilise la signature standard de React.forwardRef qui est compatible
|
|
18
|
+
* avec les deux versions de React.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* interface MyComponentProps {
|
|
23
|
+
* className?: string;
|
|
24
|
+
* children?: React.ReactNode;
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* const MyComponent = forwardRef<HTMLDivElement, MyComponentProps>(
|
|
28
|
+
* (props, ref) => (
|
|
29
|
+
* <div ref={ref} className={props.className}>{props.children}</div>
|
|
30
|
+
* )
|
|
31
|
+
* );
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function forwardRef<T, P>(render: ForwardRefRenderFunction<T, P>): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>;
|
|
35
|
+
export default forwardRef;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Helper pour assigner une valeur à une ref React
|
|
4
|
+
* Compatible avec React 18 et React 19
|
|
5
|
+
*
|
|
6
|
+
* @param ref - La ref React (callback ref, MutableRefObject, ou RefObject)
|
|
7
|
+
* @param value - La valeur à assigner
|
|
8
|
+
*/
|
|
9
|
+
export default function setRef<T>(ref: React.Ref<T> | null | undefined, value: T | null): void;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Hook pour combiner plusieurs refs en une seule
|
|
4
|
+
* Compatible avec React 18 et React 19
|
|
5
|
+
*
|
|
6
|
+
* @param refA - Première ref
|
|
7
|
+
* @param refB - Seconde ref
|
|
8
|
+
* @returns Une ref qui met à jour les deux refs
|
|
9
|
+
*/
|
|
10
|
+
export default function useForkRef<Instance>(refA: React.Ref<Instance> | null | undefined, refB: React.Ref<Instance> | null | undefined): React.RefCallback<Instance> | null;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import React$1
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import React__default, { CSSProperties } from 'react';
|
|
3
4
|
import { IDetectedBarcode, IScannerProps } from '@yudiel/react-qr-scanner';
|
|
4
5
|
import { WebcamProps } from 'react-webcam';
|
|
5
6
|
import { MapContainerProps } from 'react-leaflet';
|
|
6
|
-
import { ControlPosition, LatLngTuple } from 'leaflet';
|
|
7
|
+
import { ControlPosition, DrawEvents, LatLngTuple } from 'leaflet';
|
|
7
8
|
|
|
8
9
|
declare const PopperPlacement: {
|
|
9
10
|
readonly Center: "center";
|
|
@@ -21,7 +22,7 @@ declare const PopperPlacement: {
|
|
|
21
22
|
readonly RightCenter: "right-center";
|
|
22
23
|
};
|
|
23
24
|
type Props$5 = {
|
|
24
|
-
anchorEl?: string | HTMLElement |
|
|
25
|
+
anchorEl?: string | HTMLElement | React__default.RefObject<HTMLElement>;
|
|
25
26
|
anchorPosition?: {
|
|
26
27
|
top: number;
|
|
27
28
|
left: number;
|
|
@@ -29,30 +30,30 @@ type Props$5 = {
|
|
|
29
30
|
placement?: ObjectValues<typeof PopperPlacement>;
|
|
30
31
|
open?: boolean;
|
|
31
32
|
role?: string;
|
|
32
|
-
children?:
|
|
33
|
+
children?: React__default.ReactNode;
|
|
33
34
|
className?: string;
|
|
34
35
|
overflow?: boolean;
|
|
35
|
-
onMouseEnter?:
|
|
36
|
-
onMouseLeave?:
|
|
37
|
-
onMouseMove?:
|
|
38
|
-
onMouseOut?:
|
|
39
|
-
onMouseOver?:
|
|
40
|
-
onTouchStart?:
|
|
41
|
-
onTouchEnd?:
|
|
36
|
+
onMouseEnter?: React__default.MouseEventHandler<HTMLDivElement>;
|
|
37
|
+
onMouseLeave?: React__default.MouseEventHandler<HTMLDivElement>;
|
|
38
|
+
onMouseMove?: React__default.MouseEventHandler<HTMLDivElement>;
|
|
39
|
+
onMouseOut?: React__default.MouseEventHandler<HTMLDivElement>;
|
|
40
|
+
onMouseOver?: React__default.MouseEventHandler<HTMLDivElement>;
|
|
41
|
+
onTouchStart?: React__default.TouchEventHandler<HTMLDivElement>;
|
|
42
|
+
onTouchEnd?: React__default.TouchEventHandler<HTMLDivElement>;
|
|
42
43
|
};
|
|
43
|
-
declare const Popper:
|
|
44
|
+
declare const Popper: React__default.ForwardRefExoticComponent<Props$5 & React__default.RefAttributes<HTMLElement>>;
|
|
44
45
|
|
|
45
46
|
type Props$4 = {
|
|
46
|
-
children?:
|
|
47
|
+
children?: React__default.ReactNode;
|
|
47
48
|
container?: HTMLElement | (() => HTMLElement);
|
|
48
49
|
};
|
|
49
|
-
declare const DomContainer:
|
|
50
|
+
declare const DomContainer: React__default.ForwardRefExoticComponent<Props$4 & React__default.RefAttributes<HTMLElement>>;
|
|
50
51
|
|
|
51
52
|
interface SpinnerProps {
|
|
52
53
|
className?: string;
|
|
53
54
|
variant?: 'indeterminate' | 'determinate';
|
|
54
55
|
}
|
|
55
|
-
declare const Spinner:
|
|
56
|
+
declare const Spinner: React__default.FC<SpinnerProps>;
|
|
56
57
|
|
|
57
58
|
interface BarLoaderProps {
|
|
58
59
|
title?: string;
|
|
@@ -60,24 +61,24 @@ interface BarLoaderProps {
|
|
|
60
61
|
className?: string;
|
|
61
62
|
isComplete: boolean;
|
|
62
63
|
}
|
|
63
|
-
declare const BarLoader:
|
|
64
|
+
declare const BarLoader: React__default.FC<BarLoaderProps>;
|
|
64
65
|
|
|
65
66
|
interface SelectedProps {
|
|
66
67
|
title?: string;
|
|
67
68
|
data: any[];
|
|
68
69
|
onClick: (elt: any) => void;
|
|
69
70
|
}
|
|
70
|
-
declare const Selected:
|
|
71
|
+
declare const Selected: React__default.FC<SelectedProps>;
|
|
71
72
|
|
|
72
73
|
interface ButtonProps {
|
|
73
74
|
variant?: 'text' | 'contained' | 'outlined';
|
|
74
75
|
color?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
|
|
75
76
|
className?: string;
|
|
76
77
|
disable?: boolean;
|
|
77
|
-
children?:
|
|
78
|
-
onClick?: (event:
|
|
78
|
+
children?: React__default.ReactNode;
|
|
79
|
+
onClick?: (event: React__default.MouseEvent<HTMLButtonElement>) => void;
|
|
79
80
|
}
|
|
80
|
-
declare const Button:
|
|
81
|
+
declare const Button: React__default.FC<ButtonProps>;
|
|
81
82
|
|
|
82
83
|
type TScanConfirmDialogLabels = {
|
|
83
84
|
title?: string;
|
|
@@ -125,21 +126,21 @@ interface ToggleButtonProps {
|
|
|
125
126
|
value?: string;
|
|
126
127
|
className?: string;
|
|
127
128
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
128
|
-
children?:
|
|
129
|
+
children?: React__default.ReactNode;
|
|
129
130
|
onChange?: (value: string | undefined) => void;
|
|
130
131
|
}
|
|
131
|
-
declare const ToggleButton:
|
|
132
|
+
declare const ToggleButton: React__default.FC<ToggleButtonProps>;
|
|
132
133
|
|
|
133
134
|
interface TooltipProps$1 {
|
|
134
|
-
children?:
|
|
135
|
-
anchorEl?: string | HTMLElement |
|
|
136
|
-
title:
|
|
135
|
+
children?: React__default.ReactElement;
|
|
136
|
+
anchorEl?: string | HTMLElement | React__default.RefObject<HTMLElement>;
|
|
137
|
+
title: React__default.ReactNode;
|
|
137
138
|
enterDelay?: number;
|
|
138
139
|
leaveDelay?: number;
|
|
139
140
|
className?: string;
|
|
140
141
|
disabled?: boolean;
|
|
141
142
|
}
|
|
142
|
-
declare const Tooltip:
|
|
143
|
+
declare const Tooltip: React__default.FC<TooltipProps$1>;
|
|
143
144
|
|
|
144
145
|
declare namespace Cortex {
|
|
145
146
|
type Tag = {
|
|
@@ -164,7 +165,7 @@ interface TooltipProps {
|
|
|
164
165
|
onTextChange?: (text: string) => void;
|
|
165
166
|
onChange?: (tags: Cortex.Tag[]) => void;
|
|
166
167
|
}
|
|
167
|
-
declare const TagInput:
|
|
168
|
+
declare const TagInput: React__default.FC<TooltipProps>;
|
|
168
169
|
|
|
169
170
|
declare class Point {
|
|
170
171
|
id: number;
|
|
@@ -205,9 +206,9 @@ type MapFullscreenControlProps = {
|
|
|
205
206
|
|
|
206
207
|
type DrawToolsProps = {
|
|
207
208
|
position?: ControlPosition | undefined;
|
|
208
|
-
handleOnCreated?: (v:
|
|
209
|
-
handleOnDeleted?: (v:
|
|
210
|
-
handleOnEdited?: (v:
|
|
209
|
+
handleOnCreated?: (v: DrawEvents.Created) => void;
|
|
210
|
+
handleOnDeleted?: (v: DrawEvents.Deleted) => void;
|
|
211
|
+
handleOnEdited?: (v: DrawEvents.Edited) => void;
|
|
211
212
|
draw?: drawType;
|
|
212
213
|
editable?: boolean;
|
|
213
214
|
};
|
|
@@ -235,7 +236,7 @@ type MapsProps = {
|
|
|
235
236
|
onChange?: (locations: Location[]) => void;
|
|
236
237
|
};
|
|
237
238
|
|
|
238
|
-
declare const Map:
|
|
239
|
+
declare const Map: React__default.FC<AppProps>;
|
|
239
240
|
type AppProps = MapsProps & {
|
|
240
241
|
onClose?: (() => void);
|
|
241
242
|
onSave?: ((locations: Location[]) => void);
|
|
@@ -247,76 +248,76 @@ type AppProps = MapsProps & {
|
|
|
247
248
|
};
|
|
248
249
|
|
|
249
250
|
interface MenuProps {
|
|
250
|
-
containerRef:
|
|
251
|
+
containerRef: React__default.RefObject<HTMLElement>;
|
|
251
252
|
className?: string;
|
|
252
|
-
children?:
|
|
253
|
+
children?: React__default.ReactNode;
|
|
253
254
|
onClose?: () => void;
|
|
254
|
-
onClick?: (event:
|
|
255
|
+
onClick?: (event: React__default.MouseEvent<HTMLUListElement> | undefined) => void;
|
|
255
256
|
}
|
|
256
|
-
declare const Menu:
|
|
257
|
+
declare const Menu: React__default.FC<MenuProps>;
|
|
257
258
|
|
|
258
259
|
interface ContextMenuProps {
|
|
259
260
|
className?: string;
|
|
260
|
-
children?:
|
|
261
|
+
children?: React__default.ReactNode;
|
|
261
262
|
open?: boolean;
|
|
262
263
|
placement?: ObjectValues<typeof PopperPlacement>;
|
|
263
|
-
container?: string | HTMLElement |
|
|
264
|
+
container?: string | HTMLElement | React__default.RefObject<HTMLElement>;
|
|
264
265
|
onOpen?: () => void;
|
|
265
266
|
onClose?: () => void;
|
|
266
267
|
}
|
|
267
|
-
declare const ContextMenu:
|
|
268
|
+
declare const ContextMenu: React__default.FC<ContextMenuProps>;
|
|
268
269
|
|
|
269
270
|
interface DividerProps {
|
|
270
271
|
className?: string;
|
|
271
272
|
}
|
|
272
|
-
declare const Divider:
|
|
273
|
+
declare const Divider: React__default.FC<DividerProps>;
|
|
273
274
|
|
|
274
275
|
interface MenuItemProps {
|
|
275
276
|
className?: string;
|
|
276
277
|
style?: CSSProperties | undefined;
|
|
277
|
-
children?:
|
|
278
|
+
children?: React__default.ReactNode;
|
|
278
279
|
label?: string;
|
|
279
|
-
icon?:
|
|
280
|
+
icon?: React__default.ReactNode;
|
|
280
281
|
active?: boolean;
|
|
281
282
|
disable?: boolean;
|
|
282
|
-
itemTemplate?:
|
|
283
|
-
onClick?: (event:
|
|
283
|
+
itemTemplate?: React__default.ReactNode;
|
|
284
|
+
onClick?: (event: React__default.MouseEvent<HTMLButtonElement> | undefined) => void;
|
|
284
285
|
}
|
|
285
|
-
declare const MenuItem:
|
|
286
|
+
declare const MenuItem: React__default.FC<MenuItemProps>;
|
|
286
287
|
|
|
287
288
|
interface PopupMenuProps {
|
|
288
289
|
className?: string;
|
|
289
|
-
children?:
|
|
290
|
+
children?: React__default.ReactNode;
|
|
290
291
|
open?: boolean;
|
|
291
292
|
placement?: ObjectValues<typeof PopperPlacement>;
|
|
292
293
|
anchorPosition?: {
|
|
293
294
|
top: number;
|
|
294
295
|
left: number;
|
|
295
296
|
};
|
|
296
|
-
anchorEl?: string | HTMLElement |
|
|
297
|
+
anchorEl?: string | HTMLElement | React__default.RefObject<HTMLElement>;
|
|
297
298
|
onClose?: () => void;
|
|
298
299
|
}
|
|
299
|
-
declare const PopupMenu:
|
|
300
|
+
declare const PopupMenu: React__default.FC<PopupMenuProps>;
|
|
300
301
|
|
|
301
302
|
interface MenuGroupProps {
|
|
302
303
|
title?: string;
|
|
303
304
|
className?: string;
|
|
304
|
-
children?:
|
|
305
|
+
children?: React__default.ReactNode;
|
|
305
306
|
}
|
|
306
|
-
declare const MenuGroup:
|
|
307
|
+
declare const MenuGroup: React__default.FC<MenuGroupProps>;
|
|
307
308
|
|
|
308
309
|
interface AuthDownloadLinkProps {
|
|
309
310
|
url: string;
|
|
310
311
|
queryParams?: {
|
|
311
|
-
[key: string]:
|
|
312
|
+
[key: string]: string | number | boolean;
|
|
312
313
|
};
|
|
313
314
|
token: string;
|
|
314
315
|
label?: string;
|
|
315
|
-
onStart?: (event:
|
|
316
|
+
onStart?: (event: React__default.MouseEvent<HTMLButtonElement> | undefined) => void;
|
|
316
317
|
onCompleted?: () => void;
|
|
317
|
-
onError?: (error:
|
|
318
|
+
onError?: (error: Error) => void;
|
|
318
319
|
}
|
|
319
|
-
declare const AuthDownloadLink:
|
|
320
|
+
declare const AuthDownloadLink: React__default.FC<AuthDownloadLinkProps>;
|
|
320
321
|
|
|
321
322
|
interface DialogProps {
|
|
322
323
|
open: boolean;
|
|
@@ -324,89 +325,123 @@ interface DialogProps {
|
|
|
324
325
|
fullWidth?: boolean;
|
|
325
326
|
fullHeight?: boolean;
|
|
326
327
|
className?: string;
|
|
327
|
-
children?:
|
|
328
|
+
children?: React__default.ReactNode;
|
|
328
329
|
onClose?: (() => void);
|
|
329
330
|
}
|
|
330
|
-
declare const Dialog:
|
|
331
|
+
declare const Dialog: React__default.FC<DialogProps>;
|
|
331
332
|
|
|
332
|
-
interface DialogContentProps
|
|
333
|
+
interface DialogContentProps {
|
|
333
334
|
className?: string;
|
|
334
|
-
children?:
|
|
335
|
+
children?: React__default.ReactNode;
|
|
335
336
|
}
|
|
336
|
-
declare const DialogContent
|
|
337
|
+
declare const DialogContent: React__default.FC<DialogContentProps>;
|
|
337
338
|
|
|
338
339
|
interface DialogFooterProps {
|
|
339
340
|
className?: string;
|
|
340
|
-
children?:
|
|
341
|
+
children?: React__default.ReactNode;
|
|
341
342
|
}
|
|
342
|
-
declare const DialogFooter:
|
|
343
|
+
declare const DialogFooter: React__default.FC<DialogFooterProps>;
|
|
343
344
|
|
|
344
345
|
interface DialogHeaderProps {
|
|
345
346
|
className?: string;
|
|
346
|
-
children?:
|
|
347
|
+
children?: React__default.ReactNode;
|
|
347
348
|
}
|
|
348
|
-
declare const DialogHeader:
|
|
349
|
+
declare const DialogHeader: React__default.FC<DialogHeaderProps>;
|
|
349
350
|
|
|
350
|
-
interface
|
|
351
|
+
interface DialogTitleProps {
|
|
351
352
|
className?: string;
|
|
352
|
-
children?:
|
|
353
|
+
children?: React__default.ReactNode;
|
|
353
354
|
closeDisable?: boolean;
|
|
354
355
|
onClose?: (() => void);
|
|
355
356
|
}
|
|
356
|
-
declare const
|
|
357
|
+
declare const DialogTitle: React__default.FC<DialogTitleProps>;
|
|
357
358
|
|
|
358
|
-
interface
|
|
359
|
+
interface DialogActionsProps {
|
|
359
360
|
className?: string;
|
|
360
|
-
children?:
|
|
361
|
+
children?: React__default.ReactNode;
|
|
361
362
|
}
|
|
362
|
-
declare const DialogActions:
|
|
363
|
+
declare const DialogActions: React__default.FC<DialogActionsProps>;
|
|
363
364
|
|
|
364
365
|
interface ConfirmDialogProps {
|
|
365
366
|
title: string;
|
|
366
367
|
ok?: string;
|
|
367
368
|
cancel?: string;
|
|
368
|
-
children?:
|
|
369
|
+
children?: React__default.ReactNode;
|
|
369
370
|
className?: string;
|
|
370
371
|
onClose?: (isOk: boolean) => void;
|
|
371
372
|
}
|
|
372
|
-
declare const ConfirmDialog:
|
|
373
|
+
declare const ConfirmDialog: React__default.FC<ConfirmDialogProps>;
|
|
373
374
|
|
|
374
375
|
interface ErrorDialogProps {
|
|
375
376
|
title: string;
|
|
376
377
|
ok?: string;
|
|
377
|
-
children?:
|
|
378
|
+
children?: React__default.ReactNode;
|
|
378
379
|
className?: string;
|
|
379
380
|
onClose?: (isOk: boolean) => void;
|
|
380
381
|
}
|
|
381
|
-
declare const ErrorDialog:
|
|
382
|
+
declare const ErrorDialog: React__default.FC<ErrorDialogProps>;
|
|
382
383
|
|
|
383
384
|
interface WarningDialogProps {
|
|
384
385
|
title: string;
|
|
385
386
|
ok?: string;
|
|
386
|
-
children?:
|
|
387
|
+
children?: React__default.ReactNode;
|
|
387
388
|
className?: string;
|
|
388
389
|
onClose?: (isOk: boolean) => void;
|
|
389
390
|
}
|
|
390
|
-
declare const WarningDialog:
|
|
391
|
+
declare const WarningDialog: React__default.FC<WarningDialogProps>;
|
|
391
392
|
|
|
392
393
|
interface Props$3 {
|
|
393
394
|
className?: string;
|
|
394
395
|
}
|
|
395
|
-
declare const ChevronDownIcon:
|
|
396
|
+
declare const ChevronDownIcon: React__default.FC<Props$3>;
|
|
396
397
|
|
|
397
398
|
interface Props$2 {
|
|
398
399
|
className?: string;
|
|
399
400
|
}
|
|
400
|
-
declare const ChevronRightIcon:
|
|
401
|
+
declare const ChevronRightIcon: React__default.FC<Props$2>;
|
|
401
402
|
|
|
402
403
|
interface Props$1 {
|
|
403
404
|
className?: string;
|
|
404
405
|
}
|
|
405
|
-
declare const ChevronLeftIcon:
|
|
406
|
+
declare const ChevronLeftIcon: React__default.FC<Props$1>;
|
|
406
407
|
|
|
407
408
|
interface Props {
|
|
408
409
|
className?: string;
|
|
409
410
|
}
|
|
410
|
-
declare const CrossIcon:
|
|
411
|
-
|
|
412
|
-
|
|
411
|
+
declare const CrossIcon: React__default.FC<Props>;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Utility type pour créer des props avec ref pour la compatibilité React 18/19
|
|
415
|
+
* En React 19, ref est passé directement dans les props
|
|
416
|
+
* En React 18, ref est passé séparément via forwardRef
|
|
417
|
+
*/
|
|
418
|
+
type ForwardRefProps<T, P = object> = P & {
|
|
419
|
+
ref?: React$1.Ref<T>;
|
|
420
|
+
};
|
|
421
|
+
/**
|
|
422
|
+
* Type pour la fonction de rendu compatible React 18/19
|
|
423
|
+
*/
|
|
424
|
+
type ForwardRefRenderFunction<T, P> = (props: P, ref: React$1.ForwardedRef<T>) => React$1.ReactElement | null;
|
|
425
|
+
/**
|
|
426
|
+
* Composant wrapper compatible React 18 et React 19
|
|
427
|
+
*
|
|
428
|
+
* Utilise la signature standard de React.forwardRef qui est compatible
|
|
429
|
+
* avec les deux versions de React.
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```tsx
|
|
433
|
+
* interface MyComponentProps {
|
|
434
|
+
* className?: string;
|
|
435
|
+
* children?: React.ReactNode;
|
|
436
|
+
* }
|
|
437
|
+
*
|
|
438
|
+
* const MyComponent = forwardRef<HTMLDivElement, MyComponentProps>(
|
|
439
|
+
* (props, ref) => (
|
|
440
|
+
* <div ref={ref} className={props.className}>{props.children}</div>
|
|
441
|
+
* )
|
|
442
|
+
* );
|
|
443
|
+
* ```
|
|
444
|
+
*/
|
|
445
|
+
declare function forwardRef<T, P>(render: ForwardRefRenderFunction<T, P>): React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<P> & React$1.RefAttributes<T>>;
|
|
446
|
+
|
|
447
|
+
export { AuthDownloadLink, BarLoader, Button, Camera, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ConfirmDialog, ContextMenu, CrossIcon, Dialog, DialogActions, DialogContent, DialogFooter, DialogHeader, DialogTitle, Divider, DomContainer, ErrorDialog, ForwardRefProps, ForwardRefRenderFunction, Map, Menu, MenuGroup, MenuItem, Popper, PopupMenu, Scanner, Selected, Spinner, TagInput, ToggleButton, Tooltip, WarningDialog, forwardRef };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortex-react-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
4
4
|
"description": "React UI",
|
|
5
5
|
"author": "Anthony",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@dateam/ark": "^0.2.19",
|
|
55
|
-
"react": "
|
|
56
|
-
"react-dom": "
|
|
55
|
+
"react": ">=18 <20",
|
|
56
|
+
"react-dom": ">=18 <20"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@babel/core": "^7.26.0",
|
|
@@ -81,15 +81,15 @@
|
|
|
81
81
|
"@storybook/react": "^8.4.7",
|
|
82
82
|
"@storybook/react-webpack5": "8.4.7",
|
|
83
83
|
"@testing-library/jest-dom": "^5.11.4",
|
|
84
|
-
"@testing-library/react": "^
|
|
85
|
-
"@testing-library/user-event": "^
|
|
84
|
+
"@testing-library/react": "^14.0.0",
|
|
85
|
+
"@testing-library/user-event": "^14.0.0",
|
|
86
86
|
"@types/jest": "^26.0.15",
|
|
87
87
|
"@types/leaflet": "^1.7.10",
|
|
88
88
|
"@types/leaflet-draw": "^1.0.11",
|
|
89
89
|
"@types/leaflet.fullscreen": "^1.6.1",
|
|
90
90
|
"@types/node": "^22.10.5",
|
|
91
|
-
"@types/react": "^
|
|
92
|
-
"@types/react-dom": "^
|
|
91
|
+
"@types/react": "^18.2.0",
|
|
92
|
+
"@types/react-dom": "^18.2.0",
|
|
93
93
|
"@yudiel/react-qr-scanner": "2.1.0",
|
|
94
94
|
"css-loader": "5.2.6",
|
|
95
95
|
"eslint-config-airbnb": "^18.2.1",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"eslint-plugin-react": "^7.26.1",
|
|
100
100
|
"file-loader": "^6.2.0",
|
|
101
101
|
"lodash": "^4.17.21",
|
|
102
|
-
"react": "
|
|
103
|
-
"react-dom": "
|
|
102
|
+
"react": "19",
|
|
103
|
+
"react-dom": "19",
|
|
104
104
|
"react-icons": "^5.3.0",
|
|
105
105
|
"react-scripts": "^5.0.1",
|
|
106
106
|
"rollup": "^2.60.2",
|