mui-dialog 1.0.6 → 1.0.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/README.md +39 -10
- package/dist/index.d.ts +2 -2
- package/dist/{fe-vi-dialog.es.js → mui-dialog.es.js} +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ yarn add mui-dialog
|
|
|
28
28
|
## Usage
|
|
29
29
|
|
|
30
30
|
```tsx
|
|
31
|
-
import {
|
|
31
|
+
import { MuiDialog } from "mui-dialog";
|
|
32
32
|
import { MODAL_TYPES, INFORMATION_SUBTYPES } from "mui-dialog";
|
|
33
33
|
|
|
34
34
|
// Basic Information Dialog
|
|
@@ -36,7 +36,7 @@ const MyComponent = () => {
|
|
|
36
36
|
const [open, setOpen] = useState(false);
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
|
-
<
|
|
39
|
+
<MuiDialog
|
|
40
40
|
type={MODAL_TYPES.INFORMATION}
|
|
41
41
|
subtype={INFORMATION_SUBTYPES.ACKNOWLEDGEMENT}
|
|
42
42
|
open={open}
|
|
@@ -52,7 +52,7 @@ const MyComponent = () => {
|
|
|
52
52
|
}}
|
|
53
53
|
>
|
|
54
54
|
{/* Optional content */}
|
|
55
|
-
</
|
|
55
|
+
</MuiDialog>
|
|
56
56
|
);
|
|
57
57
|
};
|
|
58
58
|
```
|
|
@@ -140,10 +140,10 @@ const MyComponent = () => {
|
|
|
140
140
|
## Usage Example
|
|
141
141
|
|
|
142
142
|
```tsx
|
|
143
|
-
import {
|
|
143
|
+
import { MuiDialog } from "mui-dialog";
|
|
144
144
|
|
|
145
145
|
// Input Modal
|
|
146
|
-
<
|
|
146
|
+
<MuiDialog
|
|
147
147
|
type="input"
|
|
148
148
|
subtype="default"
|
|
149
149
|
open={true}
|
|
@@ -159,7 +159,7 @@ import { ViDialog } from "mui-dialog";
|
|
|
159
159
|
}}
|
|
160
160
|
>
|
|
161
161
|
<input type="text" />
|
|
162
|
-
</
|
|
162
|
+
</MuiDialog>;
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
## Modal Configuration
|
|
@@ -181,14 +181,43 @@ yarn install
|
|
|
181
181
|
|
|
182
182
|
# Build package
|
|
183
183
|
yarn build
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Local Development with yarn link
|
|
187
|
+
|
|
188
|
+
To test the package in another project locally:
|
|
184
189
|
|
|
185
|
-
|
|
186
|
-
yarn test
|
|
190
|
+
1. In the `mui-dialog` directory:
|
|
187
191
|
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
```bash
|
|
193
|
+
# Build the package
|
|
194
|
+
yarn build
|
|
195
|
+
|
|
196
|
+
# Create a global symlink
|
|
197
|
+
yarn link
|
|
190
198
|
```
|
|
191
199
|
|
|
200
|
+
2. In your project directory:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Link to the package
|
|
204
|
+
yarn link "mui-dialog"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
3. To unlink when done:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# In your project directory
|
|
211
|
+
yarn unlink "mui-dialog"
|
|
212
|
+
|
|
213
|
+
# In the fe-vi-dialog directory
|
|
214
|
+
yarn unlink
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Note: After making changes to the package, you'll need to:
|
|
218
|
+
|
|
219
|
+
1. Rebuild the package (`yarn build`)
|
|
220
|
+
|
|
192
221
|
## License
|
|
193
222
|
|
|
194
223
|
© [Virtual Internships]
|
package/dist/index.d.ts
CHANGED
|
@@ -111,6 +111,8 @@ declare type ModalTypeConfig = {
|
|
|
111
111
|
[subtype: string]: ModalConfig;
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
+
export declare const MuiDialog: (props: ModalProps) => JSX_2.Element;
|
|
115
|
+
|
|
114
116
|
export declare const SIZE_TO_MAX_WIDTH: Record<ModalSize, Breakpoint>;
|
|
115
117
|
|
|
116
118
|
export declare type SubtypeForType<T extends ModalType> = T extends typeof MODAL_TYPES.INFORMATION ? InformationSubtype : T extends typeof MODAL_TYPES.CONFIRMATION ? ConfirmationSubtype : T extends typeof MODAL_TYPES.INPUT ? InputSubtype : never;
|
|
@@ -120,6 +122,4 @@ export declare const TERTIARY_CTA_TYPES: {
|
|
|
120
122
|
DESTRUCTIVE: string;
|
|
121
123
|
};
|
|
122
124
|
|
|
123
|
-
export declare const ViDialog: (props: ModalProps) => JSX_2.Element;
|
|
124
|
-
|
|
125
125
|
export { }
|
|
@@ -567,7 +567,7 @@ const TransitionUp = forwardRef(
|
|
|
567
567
|
return /* @__PURE__ */ jsx(Slide, { direction: "up", ref, ...props });
|
|
568
568
|
}
|
|
569
569
|
);
|
|
570
|
-
const
|
|
570
|
+
const MuiDialog = (props) => {
|
|
571
571
|
let parentTheme = useTheme();
|
|
572
572
|
parentTheme = {
|
|
573
573
|
...parentTheme,
|
|
@@ -748,4 +748,4 @@ const ViDialog = (props) => {
|
|
|
748
748
|
) });
|
|
749
749
|
};
|
|
750
750
|
|
|
751
|
-
export { CONFIRMATION_SUBTYPES, INFORMATION_SUBTYPES, INPUT_SUBTYPES, MODAL_CONFIGS, MODAL_SIZES, MODAL_SIZE_VS_CLASS_NAMES, MODAL_TYPES, SIZE_TO_MAX_WIDTH, TERTIARY_CTA_TYPES
|
|
751
|
+
export { CONFIRMATION_SUBTYPES, INFORMATION_SUBTYPES, INPUT_SUBTYPES, MODAL_CONFIGS, MODAL_SIZES, MODAL_SIZE_VS_CLASS_NAMES, MODAL_TYPES, MuiDialog, SIZE_TO_MAX_WIDTH, TERTIARY_CTA_TYPES };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mui-dialog",
|
|
3
3
|
"description": "A reusable dialog component for React applications built with Material-UI (MUI).",
|
|
4
|
-
"author": "
|
|
4
|
+
"author": "Bikash Das <bikashdas0108@gmail.com> (https://github.com/bikashdas0108)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/viplatform/mui-dialog/issues"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://github.com/viplatform/mui-dialog#readme",
|
|
10
|
-
"version": "1.0.
|
|
10
|
+
"version": "1.0.8",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist"
|
|
13
13
|
],
|