universal-modal-monorepo 1.0.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/AUTHORS +5 -0
- package/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/NOTICE +6 -0
- package/README.md +239 -0
- package/SECURITY.md +21 -0
- package/docs/ACCESSIBILITY.md +43 -0
- package/docs/API.md +56 -0
- package/docs/THEMING.md +65 -0
- package/examples/angular/app.component.html +137 -0
- package/examples/angular/app.component.ts +53 -0
- package/examples/angular/index.html +99 -0
- package/examples/angular/main.js +121 -0
- package/examples/angular/styles.css +25 -0
- package/examples/index.html +53 -0
- package/examples/react/App.tsx +242 -0
- package/examples/react/index.html +26 -0
- package/examples/react/main.js +144 -0
- package/examples/react/styles.css +1 -0
- package/examples/shared/gallery.css +177 -0
- package/examples/vanilla/index.html +89 -0
- package/examples/vanilla/main.js +174 -0
- package/examples/vanilla/styles.css +1 -0
- package/examples/vue/App.vue +190 -0
- package/examples/vue/index.html +23 -0
- package/examples/vue/main.js +174 -0
- package/examples/vue/styles.css +1 -0
- package/examples/web-component/index.html +190 -0
- package/examples/web-component/main.js +58 -0
- package/examples/web-component/styles.css +11 -0
- package/package.json +36 -0
- package/packages/universal-modal/AUTHORS +5 -0
- package/packages/universal-modal/CHANGELOG.md +10 -0
- package/packages/universal-modal/LICENSE +21 -0
- package/packages/universal-modal/NOTICE +6 -0
- package/packages/universal-modal/README.md +29 -0
- package/packages/universal-modal/package.json +83 -0
- package/packages/universal-modal/scripts/copy-styles.mjs +11 -0
- package/packages/universal-modal/src/core/constants.ts +50 -0
- package/packages/universal-modal/src/core/event-emitter.ts +46 -0
- package/packages/universal-modal/src/core/focus-trap.ts +101 -0
- package/packages/universal-modal/src/core/index.ts +39 -0
- package/packages/universal-modal/src/core/modal-engine.ts +410 -0
- package/packages/universal-modal/src/core/modal-stack.ts +68 -0
- package/packages/universal-modal/src/core/scroll-lock.ts +78 -0
- package/packages/universal-modal/src/core/theme.ts +50 -0
- package/packages/universal-modal/src/core/types.ts +196 -0
- package/packages/universal-modal/src/core/utils.ts +114 -0
- package/packages/universal-modal/src/dom/index.ts +1 -0
- package/packages/universal-modal/src/dom/modal-renderer.ts +191 -0
- package/packages/universal-modal/src/index.ts +2 -0
- package/packages/universal-modal/src/styles/modal.css +368 -0
- package/packages/universal-modal/tsconfig.json +24 -0
- package/packages/universal-modal/tsup.config.ts +12 -0
- package/packages/universal-modal-angular/AUTHORS +5 -0
- package/packages/universal-modal-angular/CHANGELOG.md +9 -0
- package/packages/universal-modal-angular/LICENSE +21 -0
- package/packages/universal-modal-angular/NOTICE +6 -0
- package/packages/universal-modal-angular/README.md +12 -0
- package/packages/universal-modal-angular/package.json +85 -0
- package/packages/universal-modal-angular/src/index.ts +10 -0
- package/packages/universal-modal-angular/src/universal-modal.component.ts +275 -0
- package/packages/universal-modal-angular/tsconfig.json +20 -0
- package/packages/universal-modal-angular/tsup.config.ts +10 -0
- package/packages/universal-modal-react/AUTHORS +5 -0
- package/packages/universal-modal-react/CHANGELOG.md +9 -0
- package/packages/universal-modal-react/LICENSE +21 -0
- package/packages/universal-modal-react/NOTICE +6 -0
- package/packages/universal-modal-react/README.md +12 -0
- package/packages/universal-modal-react/package.json +87 -0
- package/packages/universal-modal-react/src/UniversalModal.tsx +340 -0
- package/packages/universal-modal-react/src/index.ts +10 -0
- package/packages/universal-modal-react/tsconfig.json +19 -0
- package/packages/universal-modal-react/tsup.config.ts +13 -0
- package/packages/universal-modal-vanilla/AUTHORS +5 -0
- package/packages/universal-modal-vanilla/CHANGELOG.md +9 -0
- package/packages/universal-modal-vanilla/LICENSE +21 -0
- package/packages/universal-modal-vanilla/NOTICE +6 -0
- package/packages/universal-modal-vanilla/README.md +12 -0
- package/packages/universal-modal-vanilla/package.json +79 -0
- package/packages/universal-modal-vanilla/src/create-modal.ts +125 -0
- package/packages/universal-modal-vanilla/src/index.ts +14 -0
- package/packages/universal-modal-vanilla/tsconfig.json +18 -0
- package/packages/universal-modal-vanilla/tsup.config.ts +10 -0
- package/packages/universal-modal-vue/AUTHORS +5 -0
- package/packages/universal-modal-vue/CHANGELOG.md +9 -0
- package/packages/universal-modal-vue/LICENSE +21 -0
- package/packages/universal-modal-vue/NOTICE +6 -0
- package/packages/universal-modal-vue/README.md +12 -0
- package/packages/universal-modal-vue/package.json +83 -0
- package/packages/universal-modal-vue/src/UniversalModal.ts +342 -0
- package/packages/universal-modal-vue/src/index.ts +10 -0
- package/packages/universal-modal-vue/tsconfig.json +18 -0
- package/packages/universal-modal-vue/tsup.config.ts +10 -0
- package/packages/universal-modal-web-component/AUTHORS +5 -0
- package/packages/universal-modal-web-component/CHANGELOG.md +9 -0
- package/packages/universal-modal-web-component/LICENSE +21 -0
- package/packages/universal-modal-web-component/NOTICE +6 -0
- package/packages/universal-modal-web-component/README.md +12 -0
- package/packages/universal-modal-web-component/package.json +83 -0
- package/packages/universal-modal-web-component/src/index.ts +11 -0
- package/packages/universal-modal-web-component/src/universal-modal-element.ts +424 -0
- package/packages/universal-modal-web-component/tsconfig.json +18 -0
- package/packages/universal-modal-web-component/tsup.config.ts +10 -0
- package/scripts/copy-styles.mjs +11 -0
- package/scripts/serve-examples.mjs +48 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
2
|
+
import {
|
|
3
|
+
AfterViewInit,
|
|
4
|
+
Component,
|
|
5
|
+
ElementRef,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
Inject,
|
|
8
|
+
Input,
|
|
9
|
+
OnChanges,
|
|
10
|
+
OnDestroy,
|
|
11
|
+
Output,
|
|
12
|
+
SimpleChanges,
|
|
13
|
+
ViewChild,
|
|
14
|
+
} from '@angular/core';
|
|
15
|
+
import {
|
|
16
|
+
CSS_CLASSES,
|
|
17
|
+
ModalEngine,
|
|
18
|
+
type CloseReason,
|
|
19
|
+
type ModalPlacement,
|
|
20
|
+
type ModalRole,
|
|
21
|
+
type ModalSize,
|
|
22
|
+
type ModalTheme,
|
|
23
|
+
} from '@poluru-labs/universal-modal';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Angular standalone adapter around the framework-agnostic ModalEngine.
|
|
27
|
+
*/
|
|
28
|
+
@Component({
|
|
29
|
+
selector: 'universal-modal',
|
|
30
|
+
standalone: true,
|
|
31
|
+
imports: [CommonModule],
|
|
32
|
+
template: `
|
|
33
|
+
<div
|
|
34
|
+
#root
|
|
35
|
+
[class]="rootClass"
|
|
36
|
+
[ngStyle]="style"
|
|
37
|
+
[attr.hidden]="!(visible || open) ? true : null"
|
|
38
|
+
[attr.aria-hidden]="!(visible || open)"
|
|
39
|
+
>
|
|
40
|
+
<div #backdrop [class]="classes.backdrop" data-um-backdrop></div>
|
|
41
|
+
<div #dialog [class]="classes.dialog">
|
|
42
|
+
<div #panel [class]="classes.panel" [attr.data-size]="size" [attr.data-placement]="placement">
|
|
43
|
+
<button
|
|
44
|
+
*ngIf="showCloseIcon"
|
|
45
|
+
#closeBtn
|
|
46
|
+
type="button"
|
|
47
|
+
[class]="classes.close"
|
|
48
|
+
aria-label="Close dialog"
|
|
49
|
+
>
|
|
50
|
+
<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false">
|
|
51
|
+
<path
|
|
52
|
+
d="M6.4 6.4l11.2 11.2M17.6 6.4L6.4 17.6"
|
|
53
|
+
stroke="currentColor"
|
|
54
|
+
stroke-width="2"
|
|
55
|
+
stroke-linecap="round"
|
|
56
|
+
/>
|
|
57
|
+
</svg>
|
|
58
|
+
</button>
|
|
59
|
+
|
|
60
|
+
<div [class]="classes.header">
|
|
61
|
+
<ng-content select="[modalHeader]"></ng-content>
|
|
62
|
+
<h2 *ngIf="title" [id]="titleId" [class]="classes.title">{{ title }}</h2>
|
|
63
|
+
<p *ngIf="description" [id]="descId" [class]="classes.description">{{ description }}</p>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div [class]="classes.body">
|
|
67
|
+
<ng-content></ng-content>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div [class]="classes.footer">
|
|
71
|
+
<ng-content select="[modalFooter]"></ng-content>
|
|
72
|
+
<div *ngIf="!hideActions" [class]="classes.actions">
|
|
73
|
+
<button #cancelBtn type="button" [class]="classes.cancel" [disabled]="loading">
|
|
74
|
+
{{ cancelText }}
|
|
75
|
+
</button>
|
|
76
|
+
<button
|
|
77
|
+
#confirmBtn
|
|
78
|
+
type="button"
|
|
79
|
+
[class]="classes.confirm"
|
|
80
|
+
[disabled]="loading"
|
|
81
|
+
[attr.aria-busy]="loading"
|
|
82
|
+
>
|
|
83
|
+
{{ confirmText }}
|
|
84
|
+
<span [class]="classes.spinner" aria-hidden="true"></span>
|
|
85
|
+
</button>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
`,
|
|
92
|
+
})
|
|
93
|
+
export class UniversalModalComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
94
|
+
readonly classes = CSS_CLASSES;
|
|
95
|
+
|
|
96
|
+
@Input() open = false;
|
|
97
|
+
@Input() size: ModalSize = 'md';
|
|
98
|
+
@Input() placement: ModalPlacement = 'center';
|
|
99
|
+
@Input() title?: string;
|
|
100
|
+
@Input() description?: string;
|
|
101
|
+
@Input() persistent = false;
|
|
102
|
+
@Input() closeOnEsc = true;
|
|
103
|
+
@Input() closeOnBackdrop = true;
|
|
104
|
+
@Input() showCloseIcon = true;
|
|
105
|
+
@Input() role: ModalRole = 'dialog';
|
|
106
|
+
@Input() confirmText = 'Confirm';
|
|
107
|
+
@Input() cancelText = 'Cancel';
|
|
108
|
+
@Input() hideActions = false;
|
|
109
|
+
@Input() loading = false;
|
|
110
|
+
@Input() zIndexBase?: number;
|
|
111
|
+
@Input() className = '';
|
|
112
|
+
@Input() style: Record<string, string> | null = null;
|
|
113
|
+
@Input() theme?: ModalTheme;
|
|
114
|
+
@Input() ariaLabel?: string;
|
|
115
|
+
|
|
116
|
+
@Output() openChange = new EventEmitter<boolean>();
|
|
117
|
+
@Output() beforeOpen = new EventEmitter<void>();
|
|
118
|
+
@Output() afterOpen = new EventEmitter<void>();
|
|
119
|
+
@Output() beforeClose = new EventEmitter<CloseReason>();
|
|
120
|
+
@Output() afterClose = new EventEmitter<CloseReason>();
|
|
121
|
+
@Output() confirm = new EventEmitter<void>();
|
|
122
|
+
@Output() cancel = new EventEmitter<void>();
|
|
123
|
+
|
|
124
|
+
@ViewChild('root') rootRef?: ElementRef<HTMLDivElement>;
|
|
125
|
+
@ViewChild('backdrop') backdropRef?: ElementRef<HTMLDivElement>;
|
|
126
|
+
@ViewChild('dialog') dialogRef?: ElementRef<HTMLDivElement>;
|
|
127
|
+
@ViewChild('panel') panelRef?: ElementRef<HTMLDivElement>;
|
|
128
|
+
@ViewChild('closeBtn') closeRef?: ElementRef<HTMLButtonElement>;
|
|
129
|
+
@ViewChild('confirmBtn') confirmRef?: ElementRef<HTMLButtonElement>;
|
|
130
|
+
@ViewChild('cancelBtn') cancelRef?: ElementRef<HTMLButtonElement>;
|
|
131
|
+
|
|
132
|
+
visible = false;
|
|
133
|
+
readonly titleId: string;
|
|
134
|
+
readonly descId: string;
|
|
135
|
+
|
|
136
|
+
private engine: ModalEngine | null = null;
|
|
137
|
+
private unsubs: Array<() => void> = [];
|
|
138
|
+
private readonly hostId: string;
|
|
139
|
+
|
|
140
|
+
constructor(@Inject(DOCUMENT) private readonly documentRef: Document) {
|
|
141
|
+
this.hostId = `um-ng-${Math.random().toString(36).slice(2, 9)}`;
|
|
142
|
+
this.titleId = `${this.hostId}-title`;
|
|
143
|
+
this.descId = `${this.hostId}-description`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
get rootClass(): string {
|
|
147
|
+
return [
|
|
148
|
+
CSS_CLASSES.root,
|
|
149
|
+
this.visible || this.open ? CSS_CLASSES.open : '',
|
|
150
|
+
this.loading ? CSS_CLASSES.loading : '',
|
|
151
|
+
this.className,
|
|
152
|
+
]
|
|
153
|
+
.filter(Boolean)
|
|
154
|
+
.join(' ');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
ngAfterViewInit(): void {
|
|
158
|
+
const root = this.rootRef?.nativeElement;
|
|
159
|
+
if (root && root.parentElement !== this.documentRef.body) {
|
|
160
|
+
this.documentRef.body.appendChild(root);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
this.engine = new ModalEngine({
|
|
164
|
+
id: this.hostId,
|
|
165
|
+
size: this.size,
|
|
166
|
+
placement: this.placement,
|
|
167
|
+
title: this.title,
|
|
168
|
+
description: this.description,
|
|
169
|
+
persistent: this.persistent,
|
|
170
|
+
closeOnEsc: this.closeOnEsc,
|
|
171
|
+
closeOnBackdrop: this.closeOnBackdrop,
|
|
172
|
+
showCloseIcon: this.showCloseIcon,
|
|
173
|
+
role: this.role,
|
|
174
|
+
confirmText: this.confirmText,
|
|
175
|
+
cancelText: this.cancelText,
|
|
176
|
+
hideActions: this.hideActions,
|
|
177
|
+
zIndexBase: this.zIndexBase,
|
|
178
|
+
className: this.className,
|
|
179
|
+
theme: this.theme,
|
|
180
|
+
ariaLabel: this.ariaLabel,
|
|
181
|
+
ariaLabelledBy: this.title ? this.titleId : undefined,
|
|
182
|
+
ariaDescribedBy: this.description ? this.descId : undefined,
|
|
183
|
+
beforeOpen: () => {
|
|
184
|
+
this.beforeOpen.emit();
|
|
185
|
+
},
|
|
186
|
+
afterOpen: () => this.afterOpen.emit(),
|
|
187
|
+
beforeClose: (reason) => {
|
|
188
|
+
this.beforeClose.emit(reason);
|
|
189
|
+
},
|
|
190
|
+
afterClose: (reason) => this.afterClose.emit(reason),
|
|
191
|
+
onConfirm: async () => {
|
|
192
|
+
this.confirm.emit();
|
|
193
|
+
},
|
|
194
|
+
onCancel: async () => {
|
|
195
|
+
this.cancel.emit();
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
this.attachHost();
|
|
200
|
+
this.bindEngineEvents();
|
|
201
|
+
|
|
202
|
+
if (this.open) {
|
|
203
|
+
void this.engine.open();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
208
|
+
if (!this.engine) return;
|
|
209
|
+
|
|
210
|
+
this.engine.updateOptions({
|
|
211
|
+
size: this.size,
|
|
212
|
+
placement: this.placement,
|
|
213
|
+
title: this.title,
|
|
214
|
+
description: this.description,
|
|
215
|
+
persistent: this.persistent,
|
|
216
|
+
closeOnEsc: this.closeOnEsc,
|
|
217
|
+
closeOnBackdrop: this.closeOnBackdrop,
|
|
218
|
+
showCloseIcon: this.showCloseIcon,
|
|
219
|
+
role: this.role,
|
|
220
|
+
confirmText: this.confirmText,
|
|
221
|
+
cancelText: this.cancelText,
|
|
222
|
+
hideActions: this.hideActions,
|
|
223
|
+
zIndexBase: this.zIndexBase,
|
|
224
|
+
className: this.className,
|
|
225
|
+
theme: this.theme,
|
|
226
|
+
ariaLabel: this.ariaLabel,
|
|
227
|
+
ariaLabelledBy: this.title ? this.titleId : undefined,
|
|
228
|
+
ariaDescribedBy: this.description ? this.descId : undefined,
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
this.engine.setLoading(this.loading);
|
|
232
|
+
|
|
233
|
+
if (changes['open']) {
|
|
234
|
+
if (this.open && !this.engine.isOpen) void this.engine.open();
|
|
235
|
+
if (!this.open && this.engine.isOpen) void this.engine.close('programmatic');
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
ngOnDestroy(): void {
|
|
240
|
+
for (const off of this.unsubs) off();
|
|
241
|
+
this.unsubs = [];
|
|
242
|
+
this.engine?.destroy();
|
|
243
|
+
this.engine = null;
|
|
244
|
+
this.rootRef?.nativeElement.remove();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
private attachHost(): void {
|
|
248
|
+
if (!this.engine || !this.rootRef || !this.backdropRef || !this.dialogRef || !this.panelRef) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
this.engine.attach({
|
|
253
|
+
root: this.rootRef.nativeElement,
|
|
254
|
+
backdrop: this.backdropRef.nativeElement,
|
|
255
|
+
dialog: this.dialogRef.nativeElement,
|
|
256
|
+
panel: this.panelRef.nativeElement,
|
|
257
|
+
closeButton: this.closeRef?.nativeElement ?? null,
|
|
258
|
+
confirmButton: this.confirmRef?.nativeElement ?? null,
|
|
259
|
+
cancelButton: this.cancelRef?.nativeElement ?? null,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
private bindEngineEvents(): void {
|
|
264
|
+
if (!this.engine) return;
|
|
265
|
+
this.unsubs.push(
|
|
266
|
+
this.engine.on('openChange', (isOpen) => {
|
|
267
|
+
this.visible = isOpen;
|
|
268
|
+
this.openChange.emit(isOpen);
|
|
269
|
+
}),
|
|
270
|
+
this.engine.on('loadingChange', (loading) => {
|
|
271
|
+
this.loading = loading;
|
|
272
|
+
}),
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"strict": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"noUnusedLocals": true,
|
|
10
|
+
"noUnusedParameters": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"experimentalDecorators": true,
|
|
14
|
+
"useDefineForClassFields": false,
|
|
15
|
+
"rootDir": "src",
|
|
16
|
+
"outDir": "dist"
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/**/*"],
|
|
19
|
+
"exclude": ["node_modules", "dist"]
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: { index: 'src/index.ts' },
|
|
5
|
+
format: ['esm', 'cjs'],
|
|
6
|
+
dts: true,
|
|
7
|
+
sourcemap: true,
|
|
8
|
+
clean: true,
|
|
9
|
+
external: ['@angular/core', '@angular/common', '@poluru-labs/universal-modal'],
|
|
10
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Subrahmanyam Poluru
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# @poluru-labs/universal-modal-react
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
npm install @poluru-labs/universal-modal-react
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { UniversalModal } from '@poluru-labs/universal-modal-react';
|
|
9
|
+
import '@poluru-labs/universal-modal/styles.css';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Author: Subrahmanyam Poluru · mail.polurus@gmail.com
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@poluru-labs/universal-modal-react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React adapter for @poluru-labs/universal-modal",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Subrahmanyam Poluru",
|
|
7
|
+
"email": "mail.polurus@gmail.com",
|
|
8
|
+
"url": "https://polurus.com"
|
|
9
|
+
},
|
|
10
|
+
"contributors": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Subrahmanyam Poluru",
|
|
13
|
+
"email": "mail.polurus@gmail.com",
|
|
14
|
+
"url": "https://www.linkedin.com/in/polurus/"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"homepage": "https://github.com/poluru-labs/universal-modal#readme",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/poluru-labs/universal-modal.git",
|
|
22
|
+
"directory": "packages/universal-modal-react"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/poluru-labs/universal-modal/issues",
|
|
26
|
+
"email": "mail.polurus@gmail.com"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public",
|
|
30
|
+
"registry": "https://registry.npmjs.org/"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"modal",
|
|
34
|
+
"dialog",
|
|
35
|
+
"react",
|
|
36
|
+
"poluru-labs",
|
|
37
|
+
"accessibility"
|
|
38
|
+
],
|
|
39
|
+
"type": "module",
|
|
40
|
+
"main": "./dist/index.cjs",
|
|
41
|
+
"module": "./dist/index.js",
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"import": "./dist/index.js",
|
|
47
|
+
"require": "./dist/index.cjs"
|
|
48
|
+
},
|
|
49
|
+
"./package.json": "./package.json"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"dist",
|
|
53
|
+
"LICENSE",
|
|
54
|
+
"AUTHORS",
|
|
55
|
+
"NOTICE",
|
|
56
|
+
"README.md",
|
|
57
|
+
"CHANGELOG.md"
|
|
58
|
+
],
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsup",
|
|
61
|
+
"typecheck": "tsc --noEmit",
|
|
62
|
+
"clean": "rm -rf dist *.tgz",
|
|
63
|
+
"prepublishOnly": "npm run clean && npm run typecheck && npm run build"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@poluru-labs/universal-modal": "1.0.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"react": ">=18.0.0",
|
|
70
|
+
"react-dom": ">=18.0.0"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@types/react": "^19.0.0",
|
|
74
|
+
"@types/react-dom": "^19.0.0",
|
|
75
|
+
"react": "^19.0.0",
|
|
76
|
+
"react-dom": "^19.0.0",
|
|
77
|
+
"tsup": "^8.3.5",
|
|
78
|
+
"typescript": "^5.7.2"
|
|
79
|
+
},
|
|
80
|
+
"engines": {
|
|
81
|
+
"node": ">=18"
|
|
82
|
+
},
|
|
83
|
+
"funding": {
|
|
84
|
+
"type": "individual",
|
|
85
|
+
"url": "https://polurus.com"
|
|
86
|
+
}
|
|
87
|
+
}
|