tiny-react-dialog 0.0.1
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 +69 -0
- package/dist/TinyReactDialog.d.ts +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +315 -0
- package/dist/index.umd.js +22 -0
- package/dist/tiny-react-dialog.css +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sebastien Seguin
|
|
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
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## Expanding the ESLint configuration
|
|
11
|
+
|
|
12
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
export default tseslint.config([
|
|
16
|
+
globalIgnores(['dist']),
|
|
17
|
+
{
|
|
18
|
+
files: ['**/*.{ts,tsx}'],
|
|
19
|
+
extends: [
|
|
20
|
+
// Other configs...
|
|
21
|
+
|
|
22
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
23
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
24
|
+
// Alternatively, use this for stricter rules
|
|
25
|
+
...tseslint.configs.strictTypeChecked,
|
|
26
|
+
// Optionally, add this for stylistic rules
|
|
27
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
28
|
+
|
|
29
|
+
// Other configs...
|
|
30
|
+
],
|
|
31
|
+
languageOptions: {
|
|
32
|
+
parserOptions: {
|
|
33
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
34
|
+
tsconfigRootDir: import.meta.dirname,
|
|
35
|
+
},
|
|
36
|
+
// other options...
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
])
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
// eslint.config.js
|
|
46
|
+
import reactX from 'eslint-plugin-react-x'
|
|
47
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
48
|
+
|
|
49
|
+
export default tseslint.config([
|
|
50
|
+
globalIgnores(['dist']),
|
|
51
|
+
{
|
|
52
|
+
files: ['**/*.{ts,tsx}'],
|
|
53
|
+
extends: [
|
|
54
|
+
// Other configs...
|
|
55
|
+
// Enable lint rules for React
|
|
56
|
+
reactX.configs['recommended-typescript'],
|
|
57
|
+
// Enable lint rules for React DOM
|
|
58
|
+
reactDom.configs.recommended,
|
|
59
|
+
],
|
|
60
|
+
languageOptions: {
|
|
61
|
+
parserOptions: {
|
|
62
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
63
|
+
tsconfigRootDir: import.meta.dirname,
|
|
64
|
+
},
|
|
65
|
+
// other options...
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
])
|
|
69
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type TinyReactDialogProps = {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function TinyReactDialog({ visible, onClose, children }: TinyReactDialogProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import re from "react";
|
|
2
|
+
var T = { exports: {} }, v = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var $;
|
|
13
|
+
function te() {
|
|
14
|
+
if ($) return v;
|
|
15
|
+
$ = 1;
|
|
16
|
+
var i = Symbol.for("react.transitional.element"), f = Symbol.for("react.fragment");
|
|
17
|
+
function d(m, a, s) {
|
|
18
|
+
var E = null;
|
|
19
|
+
if (s !== void 0 && (E = "" + s), a.key !== void 0 && (E = "" + a.key), "key" in a) {
|
|
20
|
+
s = {};
|
|
21
|
+
for (var R in a)
|
|
22
|
+
R !== "key" && (s[R] = a[R]);
|
|
23
|
+
} else s = a;
|
|
24
|
+
return a = s.ref, {
|
|
25
|
+
$$typeof: i,
|
|
26
|
+
type: m,
|
|
27
|
+
key: E,
|
|
28
|
+
ref: a !== void 0 ? a : null,
|
|
29
|
+
props: s
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return v.Fragment = f, v.jsx = d, v.jsxs = d, v;
|
|
33
|
+
}
|
|
34
|
+
var b = {};
|
|
35
|
+
/**
|
|
36
|
+
* @license React
|
|
37
|
+
* react-jsx-runtime.development.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
var D;
|
|
45
|
+
function ne() {
|
|
46
|
+
return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
+
function i(e) {
|
|
48
|
+
if (e == null) return null;
|
|
49
|
+
if (typeof e == "function")
|
|
50
|
+
return e.$$typeof === Q ? null : e.displayName || e.name || null;
|
|
51
|
+
if (typeof e == "string") return e;
|
|
52
|
+
switch (e) {
|
|
53
|
+
case k:
|
|
54
|
+
return "Fragment";
|
|
55
|
+
case J:
|
|
56
|
+
return "Profiler";
|
|
57
|
+
case q:
|
|
58
|
+
return "StrictMode";
|
|
59
|
+
case X:
|
|
60
|
+
return "Suspense";
|
|
61
|
+
case B:
|
|
62
|
+
return "SuspenseList";
|
|
63
|
+
case Z:
|
|
64
|
+
return "Activity";
|
|
65
|
+
}
|
|
66
|
+
if (typeof e == "object")
|
|
67
|
+
switch (typeof e.tag == "number" && console.error(
|
|
68
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
+
), e.$$typeof) {
|
|
70
|
+
case U:
|
|
71
|
+
return "Portal";
|
|
72
|
+
case V:
|
|
73
|
+
return (e.displayName || "Context") + ".Provider";
|
|
74
|
+
case z:
|
|
75
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case G:
|
|
77
|
+
var r = e.render;
|
|
78
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
+
case H:
|
|
80
|
+
return r = e.displayName || null, r !== null ? r : i(e.type) || "Memo";
|
|
81
|
+
case S:
|
|
82
|
+
r = e._payload, e = e._init;
|
|
83
|
+
try {
|
|
84
|
+
return i(e(r));
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function f(e) {
|
|
91
|
+
return "" + e;
|
|
92
|
+
}
|
|
93
|
+
function d(e) {
|
|
94
|
+
try {
|
|
95
|
+
f(e);
|
|
96
|
+
var r = !1;
|
|
97
|
+
} catch {
|
|
98
|
+
r = !0;
|
|
99
|
+
}
|
|
100
|
+
if (r) {
|
|
101
|
+
r = console;
|
|
102
|
+
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return t.call(
|
|
104
|
+
r,
|
|
105
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
+
n
|
|
107
|
+
), f(e);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function m(e) {
|
|
111
|
+
if (e === k) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === S)
|
|
113
|
+
return "<...>";
|
|
114
|
+
try {
|
|
115
|
+
var r = i(e);
|
|
116
|
+
return r ? "<" + r + ">" : "<...>";
|
|
117
|
+
} catch {
|
|
118
|
+
return "<...>";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function a() {
|
|
122
|
+
var e = x.A;
|
|
123
|
+
return e === null ? null : e.getOwner();
|
|
124
|
+
}
|
|
125
|
+
function s() {
|
|
126
|
+
return Error("react-stack-top-frame");
|
|
127
|
+
}
|
|
128
|
+
function E(e) {
|
|
129
|
+
if (y.call(e, "key")) {
|
|
130
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
+
if (r && r.isReactWarning) return !1;
|
|
132
|
+
}
|
|
133
|
+
return e.key !== void 0;
|
|
134
|
+
}
|
|
135
|
+
function R(e, r) {
|
|
136
|
+
function t() {
|
|
137
|
+
N || (N = !0, console.error(
|
|
138
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
+
r
|
|
140
|
+
));
|
|
141
|
+
}
|
|
142
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: t,
|
|
144
|
+
configurable: !0
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function M() {
|
|
148
|
+
var e = i(this.type);
|
|
149
|
+
return C[e] || (C[e] = !0, console.error(
|
|
150
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
|
+
}
|
|
153
|
+
function W(e, r, t, n, u, c, h, j) {
|
|
154
|
+
return t = c.ref, e = {
|
|
155
|
+
$$typeof: P,
|
|
156
|
+
type: e,
|
|
157
|
+
key: r,
|
|
158
|
+
props: c,
|
|
159
|
+
_owner: u
|
|
160
|
+
}, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", {
|
|
161
|
+
enumerable: !1,
|
|
162
|
+
get: M
|
|
163
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
164
|
+
configurable: !1,
|
|
165
|
+
enumerable: !1,
|
|
166
|
+
writable: !0,
|
|
167
|
+
value: 0
|
|
168
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
169
|
+
configurable: !1,
|
|
170
|
+
enumerable: !1,
|
|
171
|
+
writable: !0,
|
|
172
|
+
value: null
|
|
173
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
174
|
+
configurable: !1,
|
|
175
|
+
enumerable: !1,
|
|
176
|
+
writable: !0,
|
|
177
|
+
value: h
|
|
178
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
179
|
+
configurable: !1,
|
|
180
|
+
enumerable: !1,
|
|
181
|
+
writable: !0,
|
|
182
|
+
value: j
|
|
183
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
184
|
+
}
|
|
185
|
+
function O(e, r, t, n, u, c, h, j) {
|
|
186
|
+
var o = r.children;
|
|
187
|
+
if (o !== void 0)
|
|
188
|
+
if (n)
|
|
189
|
+
if (K(o)) {
|
|
190
|
+
for (n = 0; n < o.length; n++)
|
|
191
|
+
A(o[n]);
|
|
192
|
+
Object.freeze && Object.freeze(o);
|
|
193
|
+
} else
|
|
194
|
+
console.error(
|
|
195
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
196
|
+
);
|
|
197
|
+
else A(o);
|
|
198
|
+
if (y.call(r, "key")) {
|
|
199
|
+
o = i(e);
|
|
200
|
+
var _ = Object.keys(r).filter(function(ee) {
|
|
201
|
+
return ee !== "key";
|
|
202
|
+
});
|
|
203
|
+
n = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", I[o + n] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
204
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
205
|
+
let props = %s;
|
|
206
|
+
<%s {...props} />
|
|
207
|
+
React keys must be passed directly to JSX without using spread:
|
|
208
|
+
let props = %s;
|
|
209
|
+
<%s key={someKey} {...props} />`,
|
|
210
|
+
n,
|
|
211
|
+
o,
|
|
212
|
+
_,
|
|
213
|
+
o
|
|
214
|
+
), I[o + n] = !0);
|
|
215
|
+
}
|
|
216
|
+
if (o = null, t !== void 0 && (d(t), o = "" + t), E(r) && (d(r.key), o = "" + r.key), "key" in r) {
|
|
217
|
+
t = {};
|
|
218
|
+
for (var w in r)
|
|
219
|
+
w !== "key" && (t[w] = r[w]);
|
|
220
|
+
} else t = r;
|
|
221
|
+
return o && R(
|
|
222
|
+
t,
|
|
223
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
224
|
+
), W(
|
|
225
|
+
e,
|
|
226
|
+
o,
|
|
227
|
+
c,
|
|
228
|
+
u,
|
|
229
|
+
a(),
|
|
230
|
+
t,
|
|
231
|
+
h,
|
|
232
|
+
j
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
function A(e) {
|
|
236
|
+
typeof e == "object" && e !== null && e.$$typeof === P && e._store && (e._store.validated = 1);
|
|
237
|
+
}
|
|
238
|
+
var p = re, P = Symbol.for("react.transitional.element"), U = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), J = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), V = Symbol.for("react.context"), G = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), B = Symbol.for("react.suspense_list"), H = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), Z = Symbol.for("react.activity"), Q = Symbol.for("react.client.reference"), x = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, y = Object.prototype.hasOwnProperty, K = Array.isArray, g = console.createTask ? console.createTask : function() {
|
|
239
|
+
return null;
|
|
240
|
+
};
|
|
241
|
+
p = {
|
|
242
|
+
react_stack_bottom_frame: function(e) {
|
|
243
|
+
return e();
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var N, C = {}, Y = p.react_stack_bottom_frame.bind(
|
|
247
|
+
p,
|
|
248
|
+
s
|
|
249
|
+
)(), F = g(m(s)), I = {};
|
|
250
|
+
b.Fragment = k, b.jsx = function(e, r, t, n, u) {
|
|
251
|
+
var c = 1e4 > x.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return O(
|
|
253
|
+
e,
|
|
254
|
+
r,
|
|
255
|
+
t,
|
|
256
|
+
!1,
|
|
257
|
+
n,
|
|
258
|
+
u,
|
|
259
|
+
c ? Error("react-stack-top-frame") : Y,
|
|
260
|
+
c ? g(m(e)) : F
|
|
261
|
+
);
|
|
262
|
+
}, b.jsxs = function(e, r, t, n, u) {
|
|
263
|
+
var c = 1e4 > x.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return O(
|
|
265
|
+
e,
|
|
266
|
+
r,
|
|
267
|
+
t,
|
|
268
|
+
!0,
|
|
269
|
+
n,
|
|
270
|
+
u,
|
|
271
|
+
c ? Error("react-stack-top-frame") : Y,
|
|
272
|
+
c ? g(m(e)) : F
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
})()), b;
|
|
276
|
+
}
|
|
277
|
+
var L;
|
|
278
|
+
function oe() {
|
|
279
|
+
return L || (L = 1, process.env.NODE_ENV === "production" ? T.exports = te() : T.exports = ne()), T.exports;
|
|
280
|
+
}
|
|
281
|
+
var l = oe();
|
|
282
|
+
function se({ visible: i, onClose: f, children: d = "tiny-react-dialog: children is missing" }) {
|
|
283
|
+
return /* @__PURE__ */ l.jsx(l.Fragment, { children: i && /* @__PURE__ */ l.jsx("div", { className: "tiny-react-dialog__overlay", onClick: f, children: /* @__PURE__ */ l.jsxs("div", { className: "tiny-react-dialog__container", onClick: (m) => m.stopPropagation(), children: [
|
|
284
|
+
/* @__PURE__ */ l.jsx("div", { className: "tiny-react-dialog__content", children: d }),
|
|
285
|
+
/* @__PURE__ */ l.jsx(
|
|
286
|
+
"button",
|
|
287
|
+
{
|
|
288
|
+
className: "tiny-react-dialog__close",
|
|
289
|
+
onClick: f,
|
|
290
|
+
children: /* @__PURE__ */ l.jsxs(
|
|
291
|
+
"svg",
|
|
292
|
+
{
|
|
293
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
294
|
+
width: "16",
|
|
295
|
+
height: "16",
|
|
296
|
+
viewBox: "0 0 24 24",
|
|
297
|
+
fill: "none",
|
|
298
|
+
stroke: "currentColor",
|
|
299
|
+
strokeWidth: "2",
|
|
300
|
+
strokeLinecap: "round",
|
|
301
|
+
strokeLinejoin: "round",
|
|
302
|
+
className: "lucide lucide-x-icon lucide-x",
|
|
303
|
+
children: [
|
|
304
|
+
/* @__PURE__ */ l.jsx("path", { d: "M18 6 6 18" }),
|
|
305
|
+
/* @__PURE__ */ l.jsx("path", { d: "m6 6 12 12" })
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
}
|
|
310
|
+
)
|
|
311
|
+
] }) }) });
|
|
312
|
+
}
|
|
313
|
+
export {
|
|
314
|
+
se as TinyReactDialog
|
|
315
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(function(f,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],R):(f=typeof globalThis<"u"?globalThis:f||self,R(f.TinyReactDialog={},f.React))})(this,(function(f,R){"use strict";var k={exports:{}},b={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var S;function U(){if(S)return b;S=1;var l=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function m(_,a,s){var p=null;if(s!==void 0&&(p=""+s),a.key!==void 0&&(p=""+a.key),"key"in a){s={};for(var T in a)T!=="key"&&(s[T]=a[T])}else s=a;return a=s.ref,{$$typeof:l,type:_,key:p,ref:a!==void 0?a:null,props:s}}return b.Fragment=d,b.jsx=m,b.jsxs=m,b}var v={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var A;function q(){return A||(A=1,process.env.NODE_ENV!=="production"&&(function(){function l(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case H:return"Profiler";case B:return"StrictMode";case ee:return"Suspense";case re:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case X:return"Portal";case Q:return(e.displayName||"Context")+".Provider";case Z:return(e._context.displayName||"Context")+".Consumer";case K:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return r=e.displayName||null,r!==null?r:l(e.type)||"Memo";case D:r=e._payload,e=e._init;try{return l(e(r))}catch{}}return null}function d(e){return""+e}function m(e){try{d(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),d(e)}}function _(e){if(e===h)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===D)return"<...>";try{var r=l(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function a(){var e=x.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function p(e){if(F.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function T(e,r){function t(){I||(I=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function V(){var e=l(this.type);return L[e]||(L[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function G(e,r,t,n,u,i,y,O){return t=i.ref,e={$$typeof:Y,type:e,key:r,props:i,_owner:u},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:V}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:O}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function N(e,r,t,n,u,i,y,O){var o=r.children;if(o!==void 0)if(n)if(ae(o)){for(n=0;n<o.length;n++)C(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else C(o);if(F.call(r,"key")){o=l(e);var E=Object.keys(r).filter(function(se){return se!=="key"});n=0<E.length?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}",W[o+n]||(E=0<E.length?"{"+E.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,n,o,E,o),W[o+n]=!0)}if(o=null,t!==void 0&&(m(t),o=""+t),p(r)&&(m(r.key),o=""+r.key),"key"in r){t={};for(var w in r)w!=="key"&&(t[w]=r[w])}else t=r;return o&&T(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),G(e,o,i,u,a(),t,y,O)}function C(e){typeof e=="object"&&e!==null&&e.$$typeof===Y&&e._store&&(e._store.validated=1)}var g=R,Y=Symbol.for("react.transitional.element"),X=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),x=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,ae=Array.isArray,j=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(e){return e()}};var I,L={},M=g.react_stack_bottom_frame.bind(g,s)(),$=j(_(s)),W={};v.Fragment=h,v.jsx=function(e,r,t,n,u){var i=1e4>x.recentlyCreatedOwnerStacks++;return N(e,r,t,!1,n,u,i?Error("react-stack-top-frame"):M,i?j(_(e)):$)},v.jsxs=function(e,r,t,n,u){var i=1e4>x.recentlyCreatedOwnerStacks++;return N(e,r,t,!0,n,u,i?Error("react-stack-top-frame"):M,i?j(_(e)):$)}})()),v}var P;function J(){return P||(P=1,process.env.NODE_ENV==="production"?k.exports=U():k.exports=q()),k.exports}var c=J();function z({visible:l,onClose:d,children:m="tiny-react-dialog: children is missing"}){return c.jsx(c.Fragment,{children:l&&c.jsx("div",{className:"tiny-react-dialog__overlay",onClick:d,children:c.jsxs("div",{className:"tiny-react-dialog__container",onClick:_=>_.stopPropagation(),children:[c.jsx("div",{className:"tiny-react-dialog__content",children:m}),c.jsx("button",{className:"tiny-react-dialog__close",onClick:d,children:c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-x-icon lucide-x",children:[c.jsx("path",{d:"M18 6 6 18"}),c.jsx("path",{d:"m6 6 12 12"})]})})]})})})}f.TinyReactDialog=z,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.tiny-react-dialog__overlay{position:fixed;inset:0;z-index:50;background-color:#19191980}.tiny-react-dialog__container{background-color:#fdfdfd;position:fixed;top:50%;left:50%;z-index:51;display:grid;width:100%;max-width:calc(100% - 2rem);transform:translate(-50%,-50%);gap:1rem;border-radius:.5rem;border:1px solid oklch(.927 0 0);padding:1.5rem;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}.tiny-react-dialog__content{display:flex;flex-direction:column;gap:.5rem;text-align:center}.tiny-react-dialog__close{position:absolute;top:1rem;right:1rem;border-radius:.125rem;opacity:.7;background:transparent;border:none;cursor:pointer}.tiny-react-dialog__close:hover{opacity:1}.tiny-react-dialog__close:focus{outline:none;box-shadow:0 0 0 2px #a1a1a1;outline-offset:2px}.tiny-react-dialog__close svg{pointer-events:none;flex-shrink:0}@media (min-width: 640px){.tiny-react-dialog__container{max-width:425px}.tiny-react-dialog__content{text-align:left}}
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tiny-react-dialog",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.umd.js",
|
|
6
|
+
"module": "dist/index.es.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "Sebastien Seguin",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/sedomu/tiny-react-dialog.git"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/sedomu/tiny-react-dialog#readme",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/index.es.js",
|
|
21
|
+
"require": "./dist/index.umd.js",
|
|
22
|
+
"types": "./dist/index.d.ts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "vite",
|
|
27
|
+
"build": "tsc -b && vite build",
|
|
28
|
+
"lint": "eslint .",
|
|
29
|
+
"preview": "vite preview"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react": ">=17",
|
|
33
|
+
"react-dom": ">=17"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@eslint/js": "^9.33.0",
|
|
37
|
+
"@types/react": "^19.1.10",
|
|
38
|
+
"@types/react-dom": "^19.1.7",
|
|
39
|
+
"@vitejs/plugin-react": "^5.0.0",
|
|
40
|
+
"eslint": "^9.33.0",
|
|
41
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
42
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
43
|
+
"globals": "^16.3.0",
|
|
44
|
+
"typescript": "~5.8.3",
|
|
45
|
+
"typescript-eslint": "^8.39.1",
|
|
46
|
+
"vite": "^7.1.2",
|
|
47
|
+
"vite-plugin-dts": "^4.5.4"
|
|
48
|
+
}
|
|
49
|
+
}
|