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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export interface
|
|
2
|
+
export interface DialogActionsProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
}
|
|
6
|
-
declare const DialogActions: React.FC<
|
|
6
|
+
declare const DialogActions: React.FC<DialogActionsProps>;
|
|
7
7
|
export default DialogActions;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export interface
|
|
2
|
+
export interface DialogTitleProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
closeDisable?: boolean;
|
|
6
6
|
onClose?: (() => void);
|
|
7
7
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
8
|
+
declare const DialogTitle: React.FC<DialogTitleProps>;
|
|
9
|
+
export default DialogTitle;
|
package/lib/esm/Input/Input.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ControlPosition } from 'leaflet';
|
|
1
|
+
import { ControlPosition, DrawEvents } from 'leaflet';
|
|
2
2
|
export declare const DrawTools: (props: DrawToolsProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export type DrawToolsProps = {
|
|
4
4
|
position?: ControlPosition | undefined;
|
|
5
|
-
handleOnCreated?: (v:
|
|
6
|
-
handleOnDeleted?: (v:
|
|
7
|
-
handleOnEdited?: (v:
|
|
5
|
+
handleOnCreated?: (v: DrawEvents.Created) => void;
|
|
6
|
+
handleOnDeleted?: (v: DrawEvents.Deleted) => void;
|
|
7
|
+
handleOnEdited?: (v: DrawEvents.Edited) => void;
|
|
8
8
|
draw?: drawType;
|
|
9
9
|
editable?: boolean;
|
|
10
10
|
};
|
|
@@ -2,13 +2,13 @@ import React from 'react';
|
|
|
2
2
|
export interface AuthDownloadLinkProps {
|
|
3
3
|
url: string;
|
|
4
4
|
queryParams?: {
|
|
5
|
-
[key: string]:
|
|
5
|
+
[key: string]: string | number | boolean;
|
|
6
6
|
};
|
|
7
7
|
token: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
onStart?: (event: React.MouseEvent<HTMLButtonElement> | undefined) => void;
|
|
10
10
|
onCompleted?: () => void;
|
|
11
|
-
onError?: (error:
|
|
11
|
+
onError?: (error: Error) => void;
|
|
12
12
|
}
|
|
13
13
|
declare const AuthDownloadLink: React.FC<AuthDownloadLinkProps>;
|
|
14
14
|
export default AuthDownloadLink;
|
|
@@ -4,7 +4,7 @@ export interface TextFieldInputProps {
|
|
|
4
4
|
value?: string;
|
|
5
5
|
onFocus?: () => void;
|
|
6
6
|
onBlur?: () => void;
|
|
7
|
-
onChange?: (value:
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
8
|
}
|
|
9
9
|
declare const TextFieldInput: React.FC<TextFieldInputProps>;
|
|
10
10
|
export default TextFieldInput;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -19,3 +19,5 @@ export { default as MenuGroup } from './Menu/MenuGroup';
|
|
|
19
19
|
export { default as AuthDownloadLink } from './Menu/AuthDownloadLink';
|
|
20
20
|
export { default as Dialog, DialogContent, DialogHeader, DialogFooter, ConfirmDialog, ErrorDialog, WarningDialog, DialogActions, DialogTitle } from './Dialog';
|
|
21
21
|
export { ChevronDownIcon, ChevronRightIcon, ChevronLeftIcon, CrossIcon } from './Icons';
|
|
22
|
+
export { forwardRef } from './utils/forwardRef';
|
|
23
|
+
export type { ForwardRefProps, ForwardRefRenderFunction } from './utils/forwardRef';
|