@theroutingcompany/components 0.0.71-alpha.6 → 0.0.71-alpha.8
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/dist/trc-components.es.js +1537 -1500
- package/dist/trc-components.es.js.map +1 -1
- package/dist/trc-components.umd.js +264 -264
- package/dist/trc-components.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/types/components/Drawer/Drawer.d.ts +0 -3
- package/types/components/Modal/Modal.d.ts +30 -3
- package/types/hooks/useModal.d.ts +0 -7
package/package.json
CHANGED
|
@@ -26,9 +26,6 @@ declare const Drawer: ForwardRefExoticComponent<DrawerProps> & {
|
|
|
26
26
|
Header: typeof Header;
|
|
27
27
|
};
|
|
28
28
|
export default Drawer;
|
|
29
|
-
/**
|
|
30
|
-
* Reusable hook to be used with the Drawer component
|
|
31
|
-
*/
|
|
32
29
|
type UseDrawerProps = {
|
|
33
30
|
initialOpen?: boolean;
|
|
34
31
|
triggerToggle?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ForwardRefExoticComponent, type ReactNode } from 'react';
|
|
2
2
|
import { type MaxWidthProps } from 'styled-system';
|
|
3
3
|
import { type PortalProps } from '../Portal';
|
|
4
4
|
import Content from './Content';
|
|
@@ -11,7 +11,7 @@ export declare const dialogWidths: {
|
|
|
11
11
|
};
|
|
12
12
|
export type DialogWidth = keyof typeof dialogWidths;
|
|
13
13
|
export type ModalProps = {
|
|
14
|
-
children?:
|
|
14
|
+
children?: ReactNode;
|
|
15
15
|
className?: string;
|
|
16
16
|
closeOnEscape?: boolean;
|
|
17
17
|
closeOnOutsideClick?: boolean;
|
|
@@ -21,9 +21,36 @@ export type ModalProps = {
|
|
|
21
21
|
size?: 'small' | 'medium' | 'large';
|
|
22
22
|
maxWidth?: string;
|
|
23
23
|
} & MaxWidthProps;
|
|
24
|
-
declare const Modal:
|
|
24
|
+
declare const Modal: ForwardRefExoticComponent<ModalProps> & {
|
|
25
25
|
Header: typeof Header;
|
|
26
26
|
Content: typeof Content;
|
|
27
27
|
Footer: typeof Footer;
|
|
28
28
|
};
|
|
29
29
|
export default Modal;
|
|
30
|
+
export type UseModalProps = {
|
|
31
|
+
initialOpen?: boolean;
|
|
32
|
+
id?: string;
|
|
33
|
+
};
|
|
34
|
+
export type UseModalState = {
|
|
35
|
+
isOpen: boolean;
|
|
36
|
+
toggleModal: () => void;
|
|
37
|
+
openModal: () => void;
|
|
38
|
+
closeModal: () => void;
|
|
39
|
+
getActivatorProps: (additionalProps?: {
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
}) => {
|
|
42
|
+
'aria-controls': UseModalProps['id'];
|
|
43
|
+
onClick: () => void;
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
getModalProps: (props?: {
|
|
47
|
+
[k: string]: unknown;
|
|
48
|
+
}) => {
|
|
49
|
+
id: UseModalProps['id'];
|
|
50
|
+
onClose: () => void;
|
|
51
|
+
open: boolean;
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
declare const useModal: ({ initialOpen, id, }?: UseModalProps) => UseModalState;
|
|
56
|
+
export { useModal };
|