react-confirm-lite 1.2.3 → 1.2.4
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/LICENSE +21 -0
- package/README.md +270 -196
- package/dist/LICENSE +21 -0
- package/dist/README.md +378 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +229 -1
- package/dist/index.js.map +1 -1
- package/package.json +27 -50
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Saad Nasir
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
# react-confirm-lite
|
|
2
2
|
|
|
3
|
-
**A lightweight, promise-based confirm dialog for React with built-in
|
|
3
|
+
**A lightweight, promise-based confirm dialog for React with built-in styling**
|
|
4
4
|
|
|
5
5
|
✨ **Features:**
|
|
6
6
|
- Promise-based API like window.confirm
|
|
7
|
-
- Built-in
|
|
7
|
+
- Built-in styling with multiple color schemes
|
|
8
8
|
- Zero dependencies
|
|
9
9
|
- Fully customizable
|
|
10
10
|
- TypeScript support
|
|
11
11
|
- Queue system for multiple dialogs
|
|
12
|
+
- Works with Next.js App Router (no 'use client' needed)
|
|
13
|
+
- Automatic CSS injection (no separate imports needed)
|
|
12
14
|
---
|
|
13
15
|
|
|
14
|
-
##
|
|
15
|
-
-
|
|
16
|
-
- If you face any
|
|
16
|
+
## Recommendations
|
|
17
|
+
- Always use the latest version for bug fixes and improvements
|
|
18
|
+
- If you face any issues, please report them on [GitHub](https://github.com/SaadNasir-git/react-confirm-lite/issues)
|
|
17
19
|
|
|
18
20
|
## Quick Comparison
|
|
19
21
|
|
|
20
22
|
| Feature | react-confirm-lite | react-confirm | react-confirm-toast |
|
|
21
23
|
|---------|-------------------|---------------|---------------------|
|
|
22
|
-
| Built-in styling | ✅
|
|
24
|
+
| Built-in styling | ✅ Multiple color schemes | ❌ None | ✅ Toast style |
|
|
23
25
|
| Promise-based | ✅ | ✅ | ✅ |
|
|
24
26
|
| Zero dependencies | ✅ | ✅ | ✅ |
|
|
25
27
|
| Queue system | ✅ | ❌ | ❌ |
|
|
26
|
-
|
|
|
28
|
+
| Automatic CSS | ✅ No separate imports | ❌ | ❌ |
|
|
29
|
+
| Next.js App Router | ✅ Works out of the box | ❌ Needs 'use client' | ✅ |
|
|
27
30
|
|
|
28
31
|
## Why Choose react-confirm-lite?
|
|
29
32
|
|
|
30
|
-
If you
|
|
31
|
-
|
|
32
|
-

|
|
33
|
+
If you want a **simple, lightweight** confirm dialog that **just works** without any configuration, `react-confirm-lite` is perfect. No separate CSS imports, no 'use client' directives needed in Next.js App Router, and fully customizable when you need it.
|
|
33
34
|
|
|
34
35
|
## 🔗 Live Demo
|
|
35
36
|
|
|
@@ -42,263 +43,336 @@ If you're using **Tailwind CSS** and want a **simple, lightweight** confirm dial
|
|
|
42
43
|
npm install react-confirm-lite
|
|
43
44
|
```
|
|
44
45
|
|
|
45
|
-
### Step 2:
|
|
46
|
-
```
|
|
47
|
-
import { confirm, ConfirmContainer } from 'react-confirm-lite'
|
|
46
|
+
### Step 2: Import in your component:
|
|
47
|
+
```tsx
|
|
48
|
+
import { confirm, ConfirmContainer } from 'react-confirm-lite';
|
|
48
49
|
```
|
|
49
|
-
|
|
50
|
+
|
|
51
|
+
### Step 3: Add ConfirmContainer to your component tree:
|
|
50
52
|
```jsx
|
|
51
|
-
|
|
53
|
+
function App() {
|
|
54
|
+
return (
|
|
52
55
|
<>
|
|
53
56
|
<ConfirmContainer />
|
|
57
|
+
{/* Your app content */}
|
|
54
58
|
</>
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
### Step 4: Use confirm function
|
|
58
|
-
```ts
|
|
59
|
-
const main = async () => {
|
|
60
|
-
const isConfirmed = await confirm('Are you sure');
|
|
61
|
-
if (isConfirmed) {
|
|
62
|
-
console.log('you are confirmed')
|
|
63
|
-
}
|
|
64
|
-
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
65
61
|
```
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
colorSchema:'dark'
|
|
75
|
-
});
|
|
76
|
-
if (isConfirmed) {
|
|
77
|
-
console.log('you are confirmed')
|
|
78
|
-
}
|
|
62
|
+
|
|
63
|
+
### Step 4: Use the confirm function:
|
|
64
|
+
```tsx
|
|
65
|
+
const handleAction = async () => {
|
|
66
|
+
const isConfirmed = await confirm('Are you sure?');
|
|
67
|
+
if (isConfirmed) {
|
|
68
|
+
// Perform action
|
|
69
|
+
console.log('Confirmed!');
|
|
79
70
|
}
|
|
71
|
+
};
|
|
80
72
|
```
|
|
81
|
-
|
|
73
|
+
|
|
74
|
+
### Complete Example:
|
|
82
75
|
|
|
83
76
|
```tsx
|
|
84
|
-
|
|
85
|
-
import { confirm, ConfirmContainer } from 'react-confirm-lite'
|
|
77
|
+
import { confirm, ConfirmContainer } from 'react-confirm-lite';
|
|
86
78
|
|
|
87
|
-
|
|
79
|
+
function App() {
|
|
88
80
|
const handleDelete = async () => {
|
|
89
|
-
const isConfirmed = await confirm('Are you sure you want to delete?')
|
|
81
|
+
const isConfirmed = await confirm('Are you sure you want to delete this item?');
|
|
90
82
|
if (isConfirmed) {
|
|
91
|
-
//
|
|
92
|
-
console.log('Item deleted')
|
|
83
|
+
// Delete logic here
|
|
84
|
+
console.log('Item deleted');
|
|
93
85
|
}
|
|
94
|
-
}
|
|
86
|
+
};
|
|
95
87
|
|
|
96
88
|
return (
|
|
97
89
|
<div>
|
|
98
90
|
<button onClick={handleDelete}>Delete Item</button>
|
|
99
91
|
<ConfirmContainer />
|
|
100
92
|
</div>
|
|
101
|
-
)
|
|
93
|
+
);
|
|
102
94
|
}
|
|
103
95
|
```
|
|
104
|
-
## How to customize
|
|
105
|
-
If you just want to change the colorSchema then you can do this
|
|
106
|
-
```jsx
|
|
107
|
-
<ConfirmContainer defaultColorSchema='light'/>
|
|
108
|
-
```
|
|
109
|
-
There are multiple color schemas which are
|
|
110
96
|
|
|
111
|
-
|
|
112
|
-
- dark
|
|
113
|
-
- blue
|
|
114
|
-
- red
|
|
115
|
-
- green
|
|
116
|
-
- purple
|
|
97
|
+
## Advanced Usage
|
|
117
98
|
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<p className="text-gray-500 text-center mb-6">
|
|
135
|
-
{confirm.message}
|
|
136
|
-
</p>
|
|
137
|
-
|
|
138
|
-
<div className="flex gap-3 w-full">
|
|
139
|
-
<button
|
|
140
|
-
className="flex-1 py-2 px-4 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
|
141
|
-
onClick={handleCancel}
|
|
142
|
-
>
|
|
143
|
-
{confirm.cancelText || 'Cancel'}
|
|
144
|
-
</button>
|
|
145
|
-
<button
|
|
146
|
-
className="flex-1 py-2 px-4 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors"
|
|
147
|
-
onClick={handleOk}
|
|
148
|
-
>
|
|
149
|
-
{confirm.okText || 'Ok'}
|
|
150
|
-
</button>
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
)}
|
|
154
|
-
</ConfirmContainer>
|
|
155
|
-
</div>
|
|
156
|
-
)
|
|
99
|
+
### Custom Options:
|
|
100
|
+
```tsx
|
|
101
|
+
const handleCustomConfirm = async () => {
|
|
102
|
+
const isConfirmed = await confirm({
|
|
103
|
+
title: "Delete Item",
|
|
104
|
+
message: "This action cannot be undone. Are you sure?",
|
|
105
|
+
cancelText: 'No, keep it',
|
|
106
|
+
okText: 'Yes, delete',
|
|
107
|
+
colorSchema: 'red',
|
|
108
|
+
isDestructive: true
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
if (isConfirmed) {
|
|
112
|
+
// Delete item
|
|
113
|
+
}
|
|
114
|
+
};
|
|
157
115
|
```
|
|
158
|
-
Use `isVisible` parameter if you want your custom animation.
|
|
159
116
|
|
|
160
|
-
|
|
161
|
-
If you will directly add the ConfirmContainer in layout.tsx then it will throw an error this problem can be solve easily.
|
|
162
|
-
Make the client side component and then add the ConfirmContainer in this client side component like this.
|
|
117
|
+
### Custom Color Scheme:
|
|
163
118
|
```jsx
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const ClientSideConfirm = () => {
|
|
168
|
-
return (
|
|
169
|
-
<>
|
|
170
|
-
<ConfirmContainer />
|
|
171
|
-
</>
|
|
172
|
-
)
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export default ClientSideConfirm
|
|
119
|
+
<ConfirmContainer defaultColorSchema="light" />
|
|
120
|
+
// Available options: 'light', 'dark', 'blue', 'red', 'green', 'purple'
|
|
176
121
|
```
|
|
177
|
-
and then simply use this component in layout.tsx
|
|
178
|
-
|
|
179
|
-
## Installation
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
npm install react-confirm-lite
|
|
183
|
-
# or
|
|
184
|
-
yarn add react-confirm-lite
|
|
185
|
-
# or
|
|
186
|
-
pnpm add react-confirm-lite
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
## Props
|
|
190
|
-
|
|
191
|
-
### ConfirmContainer
|
|
192
|
-
- `animationDuration` (optional): Animation duration in milliseconds. Default: `300`
|
|
193
|
-
- `defaultColorSchema` (optional): To change color schema. Default: `dark`
|
|
194
|
-
- `classes` (optional): Custom CSS classes for styling
|
|
195
|
-
- `children` (optional): Render prop for complete customization
|
|
196
|
-
|
|
197
|
-
## TypeScript Support
|
|
198
122
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
### Custom Styling with Classes
|
|
204
|
-
```tsx
|
|
205
|
-
<ConfirmContainer
|
|
123
|
+
### Custom Styling:
|
|
124
|
+
```jsx
|
|
125
|
+
<ConfirmContainer
|
|
206
126
|
classes={{
|
|
207
|
-
overlay: "bg-black/
|
|
208
|
-
wrapper: "rounded-xl
|
|
209
|
-
title: "font-bold
|
|
127
|
+
overlay: "bg-black/50",
|
|
128
|
+
wrapper: "rounded-xl shadow-2xl",
|
|
129
|
+
title: "text-2xl font-bold",
|
|
210
130
|
message: "text-gray-600",
|
|
211
|
-
button: "px-6 py-
|
|
212
|
-
cancel: "
|
|
213
|
-
ok: "bg-
|
|
131
|
+
button: "px-6 py-3 rounded-lg font-medium",
|
|
132
|
+
cancel: "border border-gray-300 hover:bg-gray-50",
|
|
133
|
+
ok: "bg-blue-600 hover:bg-blue-700 text-white"
|
|
214
134
|
}}
|
|
215
135
|
/>
|
|
216
136
|
```
|
|
137
|
+
|
|
138
|
+
### Fully Custom UI with Render Prop:
|
|
217
139
|
```jsx
|
|
218
|
-
<ConfirmContainer>
|
|
140
|
+
<ConfirmContainer animationDuration={500}>
|
|
219
141
|
{({ isVisible, confirm, handleCancel, handleOk }) => (
|
|
220
|
-
<div className={`
|
|
221
|
-
<div className="
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
142
|
+
<div className={`modal ${isVisible ? 'show' : 'hide'}`}>
|
|
143
|
+
<div className="modal-content">
|
|
144
|
+
<h2>{confirm.title}</h2>
|
|
145
|
+
<p>{confirm.message}</p>
|
|
146
|
+
<div className="modal-actions">
|
|
147
|
+
<button onClick={handleCancel}>
|
|
148
|
+
{confirm.cancelText || 'Cancel'}
|
|
149
|
+
</button>
|
|
150
|
+
<button onClick={handleOk}>
|
|
151
|
+
{confirm.okText || 'OK'}
|
|
152
|
+
</button>
|
|
153
|
+
</div>
|
|
227
154
|
</div>
|
|
228
155
|
</div>
|
|
229
156
|
)}
|
|
230
157
|
</ConfirmContainer>
|
|
231
158
|
```
|
|
159
|
+
|
|
160
|
+
## Next.js App Router Support
|
|
161
|
+
|
|
162
|
+
Works automatically! No 'use client' directive needed for the library. The library handles everything internally.
|
|
163
|
+
|
|
164
|
+
### Server Components Example:
|
|
165
|
+
```tsx
|
|
166
|
+
// app/layout.tsx
|
|
167
|
+
import { ConfirmContainer } from 'react-confirm-lite';
|
|
168
|
+
|
|
169
|
+
export default function RootLayout({
|
|
170
|
+
children,
|
|
171
|
+
}: {
|
|
172
|
+
children: React.ReactNode;
|
|
173
|
+
}) {
|
|
174
|
+
return (
|
|
175
|
+
<html lang="en">
|
|
176
|
+
<body>
|
|
177
|
+
{children}
|
|
178
|
+
<ConfirmContainer />
|
|
179
|
+
</body>
|
|
180
|
+
</html>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
```tsx
|
|
185
|
+
// app/page.tsx (server component)
|
|
186
|
+
import { confirm } from 'react-confirm-lite';
|
|
187
|
+
|
|
188
|
+
export default async function Page() {
|
|
189
|
+
// Server-side logic here
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<form action={async () => {
|
|
193
|
+
'use server';
|
|
194
|
+
const isConfirmed = await confirm('Are you sure?');
|
|
195
|
+
if (isConfirmed) {
|
|
196
|
+
// Server action
|
|
197
|
+
}
|
|
198
|
+
}}>
|
|
199
|
+
<button>Submit</button>
|
|
200
|
+
</form>
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Client Component Example:
|
|
206
|
+
```tsx
|
|
207
|
+
'use client';
|
|
208
|
+
import { confirm, ConfirmContainer } from 'react-confirm-lite';
|
|
209
|
+
|
|
210
|
+
export default function ClientComponent() {
|
|
211
|
+
const handleClick = async () => {
|
|
212
|
+
const result = await confirm('Confirm action?');
|
|
213
|
+
if (result) {
|
|
214
|
+
// Handle confirmation
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
<div>
|
|
220
|
+
<button onClick={handleClick}>Click me</button>
|
|
221
|
+
<ConfirmContainer />
|
|
222
|
+
</div>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
232
227
|
## API Reference
|
|
233
228
|
|
|
234
229
|
### `confirm(message: string | ConfirmOptions): Promise<boolean>`
|
|
235
230
|
|
|
236
|
-
Displays a confirmation dialog
|
|
231
|
+
Displays a confirmation dialog. Returns a promise that resolves to `true` if confirmed, `false` if cancelled.
|
|
237
232
|
|
|
238
|
-
**
|
|
239
|
-
- `message`: String or object with `title` and `message` properties
|
|
240
|
-
**Examples:**
|
|
233
|
+
**String usage:**
|
|
241
234
|
```ts
|
|
242
|
-
|
|
243
|
-
|
|
235
|
+
await confirm('Simple message');
|
|
236
|
+
// Equivalent to: { title: 'Confirm', message: 'Simple message' }
|
|
237
|
+
```
|
|
244
238
|
|
|
245
|
-
|
|
239
|
+
**Object usage:**
|
|
240
|
+
```ts
|
|
246
241
|
await confirm({
|
|
247
242
|
title: 'Warning',
|
|
248
243
|
message: 'This action cannot be undone',
|
|
249
|
-
cancelText:'
|
|
250
|
-
okText:'
|
|
251
|
-
colorSchema:'
|
|
252
|
-
|
|
244
|
+
cancelText: 'Cancel',
|
|
245
|
+
okText: 'Delete',
|
|
246
|
+
colorSchema: 'red',
|
|
247
|
+
isDestructive: true
|
|
248
|
+
});
|
|
253
249
|
```
|
|
254
|
-
## Types
|
|
255
|
-
You can also import types which I think you may need some times these are following:
|
|
256
250
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
251
|
+
### `ConfirmContainer` Props:
|
|
252
|
+
|
|
253
|
+
| Prop | Type | Default | Description |
|
|
254
|
+
|------|------|---------|-------------|
|
|
255
|
+
| `defaultColorSchema` | `ColorSchema` | `'dark'` | Default color scheme |
|
|
256
|
+
| `animationDuration` | `number` | `300` | Animation duration in ms |
|
|
257
|
+
| `classes` | `ConfirmClasses` | `{}` | Custom CSS classes |
|
|
258
|
+
| `children` | Render function | - | For complete UI customization |
|
|
259
|
+
|
|
260
|
+
### Types:
|
|
261
|
+
```ts
|
|
262
|
+
type ColorSchema = 'light' | 'dark' | 'blue' | 'red' | 'green' | 'purple';
|
|
263
|
+
|
|
264
|
+
interface ConfirmClasses {
|
|
265
|
+
overlay?: string;
|
|
266
|
+
wrapper?: string;
|
|
267
|
+
title?: string;
|
|
268
|
+
message?: string;
|
|
269
|
+
button?: string;
|
|
270
|
+
cancel?: string;
|
|
271
|
+
ok?: string;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
interface ConfirmOptions {
|
|
275
|
+
title?: string;
|
|
276
|
+
message: string;
|
|
277
|
+
cancelText?: string;
|
|
278
|
+
okText?: string;
|
|
279
|
+
colorSchema?: ColorSchema;
|
|
280
|
+
isDestructive?: boolean;
|
|
281
|
+
}
|
|
282
|
+
```
|
|
261
283
|
|
|
262
284
|
## Troubleshooting
|
|
263
285
|
|
|
264
|
-
### Dialog not
|
|
265
|
-
Make sure
|
|
286
|
+
### ❌ Dialog not appearing?
|
|
287
|
+
- Make sure `<ConfirmContainer />` is rendered in your component tree
|
|
288
|
+
- Check that you're not conditionally rendering it in a way that unmounts it
|
|
266
289
|
|
|
267
|
-
### Multiple
|
|
268
|
-
The library
|
|
290
|
+
### ❌ Multiple dialogs overlapping?
|
|
291
|
+
- The library has a built-in queue system that handles multiple confirm requests sequentially
|
|
269
292
|
|
|
270
|
-
###
|
|
271
|
-
|
|
293
|
+
### ❌ Styling not working?
|
|
294
|
+
- If using custom classes, ensure they have proper CSS specificity
|
|
295
|
+
- Try using `!important` flag for custom styles if needed
|
|
296
|
+
- Make sure you're on the latest version
|
|
272
297
|
|
|
273
|
-
###
|
|
274
|
-
|
|
298
|
+
### ❌ Animation issues with custom UI?
|
|
299
|
+
- When using the `children` render prop, use the `isVisible` prop for animations
|
|
300
|
+
- Set appropriate `animationDuration` to match your CSS transitions
|
|
275
301
|
|
|
276
|
-
###
|
|
277
|
-
|
|
302
|
+
### ❌ Next.js hydration errors?
|
|
303
|
+
- The library is designed to work with Next.js App Router
|
|
304
|
+
- If using in a layout, ensure it's placed after dynamic content
|
|
278
305
|
|
|
279
|
-
|
|
280
|
-
This problem exists in old version so, make sure that you are using the latest version and if you are on latest version but it is not working yet then use !important flag in your css file
|
|
306
|
+
## Features in Detail
|
|
281
307
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
308
|
+
### 🎨 Multiple Color Schemes
|
|
309
|
+
Six built-in color schemes: light, dark, blue, red, green, purple. Set globally or per confirm dialog.
|
|
310
|
+
|
|
311
|
+
### 🔄 Queue System
|
|
312
|
+
Multiple confirm requests are queued and shown one at a time, preventing overlapping dialogs.
|
|
313
|
+
|
|
314
|
+
### 🎯 Zero Configuration
|
|
315
|
+
Works out of the box with default styling. No CSS imports needed.
|
|
316
|
+
|
|
317
|
+
### 🔧 Fully Customizable
|
|
318
|
+
From simple class overrides to complete UI replacement with render props.
|
|
319
|
+
|
|
320
|
+
### 📱 Responsive Design
|
|
321
|
+
Built-in responsive styling that works on all screen sizes.
|
|
322
|
+
|
|
323
|
+
### 🔒 Type Safety
|
|
324
|
+
Full TypeScript support with comprehensive type definitions.
|
|
325
|
+
|
|
326
|
+
## Performance
|
|
327
|
+
|
|
328
|
+
- **Zero dependencies**: Only React as a peer dependency
|
|
329
|
+
- **Tree-shakeable**: Only imports what you use
|
|
330
|
+
- **Small bundle size**: ~5KB gzipped (including styles)
|
|
331
|
+
- **Optimized renders**: Minimal re-renders with React.memo
|
|
332
|
+
|
|
333
|
+
## Migration from Older Versions
|
|
334
|
+
|
|
335
|
+
If you're upgrading from version <1.3.0:
|
|
336
|
+
|
|
337
|
+
1. **'use client' not needed**: The library handles this internally
|
|
338
|
+
2. **Simpler API**: Same functions, better internals
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
## Contributing
|
|
342
|
+
|
|
343
|
+
Contributions are welcome! Please:
|
|
344
|
+
|
|
345
|
+
1. Fork the repository
|
|
346
|
+
2. Create a feature branch
|
|
347
|
+
3. Add tests for your changes
|
|
348
|
+
4. Submit a pull request
|
|
287
349
|
|
|
288
350
|
## Author
|
|
289
351
|
|
|
290
|
-
|
|
352
|
+
**Saad Nasir** - Full Stack Developer
|
|
291
353
|
- GitHub: [@SaadNasir-git](https://github.com/SaadNasir-git)
|
|
292
|
-
-
|
|
293
|
-
|
|
354
|
+
- For support: Open an issue on GitHub
|
|
355
|
+
|
|
356
|
+
## License
|
|
294
357
|
|
|
295
|
-
|
|
358
|
+
MIT © Saad Nasir
|
|
296
359
|
|
|
360
|
+
---
|
|
297
361
|
|
|
298
362
|

|
|
299
363
|

|
|
300
364
|

|
|
301
365
|

|
|
302
366
|

|
|
303
|
-

|
|
368
|
+

|
|
369
|
+
|
|
370
|
+
## Support
|
|
371
|
+
|
|
372
|
+
If you find this library helpful, please consider:
|
|
373
|
+
- ⭐ Starring the repository on GitHub
|
|
374
|
+
- 📢 Sharing with your network
|
|
375
|
+
- 🐛 Reporting issues you encounter
|
|
376
|
+
- 💡 Suggesting new features
|
|
377
|
+
|
|
378
|
+
Happy coding! 🚀
|
package/dist/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Saad Nasir
|
|
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.
|