@soyfri/shared-library 1.2.2 → 1.3.0
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/components/Modal/index.ts +1 -0
- package/esm/components/Modal/Modal.d.ts +28 -0
- package/esm/components/Modal/Modal.stories.d.ts +12 -0
- package/esm/components/Modal/ModalBody.d.ts +6 -0
- package/esm/components/Modal/ModalFooter.d.ts +19 -0
- package/esm/components/Modal/ModalHeader.d.ts +6 -0
- package/esm/components/Modal/index.d.ts +4 -0
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../esm/components/Modal';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DialogProps } from '@mui/material/Dialog';
|
|
3
|
+
import { ModalAction, ModalFooter } from './ModalFooter';
|
|
4
|
+
import { ModalHeader } from './ModalHeader';
|
|
5
|
+
import { ModalBody } from './ModalBody';
|
|
6
|
+
export interface ModalRef {
|
|
7
|
+
open: () => void;
|
|
8
|
+
close: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface ModalProps {
|
|
11
|
+
open?: boolean;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
title?: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
showCloseButton?: boolean;
|
|
16
|
+
closeButtonText?: string;
|
|
17
|
+
closeButtonDisabled?: boolean;
|
|
18
|
+
actions?: ModalAction[];
|
|
19
|
+
maxWidth?: DialogProps['maxWidth'];
|
|
20
|
+
}
|
|
21
|
+
export declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<ModalRef>>;
|
|
22
|
+
type ModalComponent = React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<ModalRef>> & {
|
|
23
|
+
Header: typeof ModalHeader;
|
|
24
|
+
Body: typeof ModalBody;
|
|
25
|
+
Footer: typeof ModalFooter;
|
|
26
|
+
};
|
|
27
|
+
declare const ModalWithStatics: ModalComponent;
|
|
28
|
+
export default ModalWithStatics;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Modal from './Modal';
|
|
3
|
+
declare const meta: Meta<typeof Modal>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Modal>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const ImperativeControl: Story;
|
|
8
|
+
export declare const CompleteStructure: Story;
|
|
9
|
+
export declare const NoDefaultCloseButton: Story;
|
|
10
|
+
export declare const DisabledCloseButton: Story;
|
|
11
|
+
export declare const Sizing: Story;
|
|
12
|
+
export declare const LongContent: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
+
export interface ModalAction {
|
|
4
|
+
text: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
variant?: ButtonProps['variant'];
|
|
8
|
+
color?: ButtonProps['color'];
|
|
9
|
+
}
|
|
10
|
+
export interface ModalFooterProps {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
showCloseButton?: boolean;
|
|
13
|
+
closeButtonText?: string;
|
|
14
|
+
closeButtonDisabled?: boolean;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
actions?: ModalAction[];
|
|
17
|
+
}
|
|
18
|
+
export declare const ModalFooter: React.FC<ModalFooterProps>;
|
|
19
|
+
export default ModalFooter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soyfri/shared-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -60,6 +60,11 @@
|
|
|
60
60
|
"require": "./cjs/components/Select.cjs",
|
|
61
61
|
"types": "./esm/components/Select/Select.d.ts"
|
|
62
62
|
},
|
|
63
|
+
"./components/Modal": {
|
|
64
|
+
"import": "./esm/components/Modal.js",
|
|
65
|
+
"require": "./cjs/components/Modal.cjs",
|
|
66
|
+
"types": "./esm/components/Modal/Modal.d.ts"
|
|
67
|
+
},
|
|
63
68
|
"./components/MenuButton": {
|
|
64
69
|
"import": "./esm/components/MenuButton.js",
|
|
65
70
|
"require": "./cjs/components/MenuButton.cjs",
|