@satoshibits/react-json-schema-builder 1.1.4 → 1.1.5
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/dist/index.cjs.js +1 -1
- package/dist/index.cjs10.js +1 -1
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs11.js +1 -1
- package/dist/index.cjs11.js.map +1 -1
- package/dist/index.cjs12.js +1 -1
- package/dist/index.cjs12.js.map +1 -1
- package/dist/index.cjs13.js +1 -1
- package/dist/index.cjs13.js.map +1 -1
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs14.js.map +1 -1
- package/dist/index.cjs15.js +6 -1
- package/dist/index.cjs15.js.map +1 -1
- package/dist/index.cjs16.js +1 -1
- package/dist/index.cjs16.js.map +1 -1
- package/dist/index.cjs17.js +1 -1
- package/dist/index.cjs17.js.map +1 -1
- package/dist/index.cjs18.js +1 -1
- package/dist/index.cjs18.js.map +1 -1
- package/dist/index.cjs19.js +1 -1
- package/dist/index.cjs19.js.map +1 -1
- package/dist/index.cjs2.js +1 -1
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs20.js.map +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs21.js.map +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs22.js.map +1 -1
- package/dist/index.cjs23.js +1 -6
- package/dist/index.cjs23.js.map +1 -1
- package/dist/index.cjs24.js +1 -6
- package/dist/index.cjs24.js.map +1 -1
- package/dist/index.cjs25.js +1 -6
- package/dist/index.cjs25.js.map +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs26.js.map +1 -1
- package/dist/index.cjs27.js +1 -1
- package/dist/index.cjs27.js.map +1 -1
- package/dist/index.cjs28.js +6 -1
- package/dist/index.cjs28.js.map +1 -1
- package/dist/index.cjs29.js +6 -1
- package/dist/index.cjs29.js.map +1 -1
- package/dist/index.cjs3.js +1 -1
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.cjs30.js +1 -1
- package/dist/index.cjs30.js.map +1 -1
- package/dist/index.cjs31.js +1 -1
- package/dist/index.cjs34.js +1 -1
- package/dist/index.cjs36.js +1 -1
- package/dist/index.cjs37.js +1 -1
- package/dist/index.cjs37.js.map +1 -1
- package/dist/index.cjs38.js +1 -6
- package/dist/index.cjs38.js.map +1 -1
- package/dist/index.cjs39.js +1 -6
- package/dist/index.cjs39.js.map +1 -1
- package/dist/index.cjs4.js +1 -1
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs40.js +1 -6
- package/dist/index.cjs40.js.map +1 -1
- package/dist/index.cjs41.js +1 -1
- package/dist/index.cjs41.js.map +1 -1
- package/dist/index.cjs42.js +1 -1
- package/dist/index.cjs42.js.map +1 -1
- package/dist/index.cjs43.js +1 -1
- package/dist/index.cjs43.js.map +1 -1
- package/dist/index.cjs44.js +6 -1
- package/dist/index.cjs44.js.map +1 -1
- package/dist/index.cjs45.js +6 -1
- package/dist/index.cjs45.js.map +1 -1
- package/dist/index.cjs46.js +6 -1
- package/dist/index.cjs46.js.map +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs5.js +1 -1
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs55.js +1 -5
- package/dist/index.cjs55.js.map +1 -1
- package/dist/index.cjs56.js +1 -1
- package/dist/index.cjs56.js.map +1 -1
- package/dist/index.cjs58.js +1 -1
- package/dist/index.cjs58.js.map +1 -1
- package/dist/index.cjs59.js +1 -1
- package/dist/index.cjs59.js.map +1 -1
- package/dist/index.cjs6.js +1 -1
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs60.js +1 -1
- package/dist/index.cjs60.js.map +1 -1
- package/dist/index.cjs61.js +1 -1
- package/dist/index.cjs61.js.map +1 -1
- package/dist/index.cjs62.js +5 -1
- package/dist/index.cjs62.js.map +1 -1
- package/dist/index.cjs63.js +1 -1
- package/dist/index.cjs63.js.map +1 -1
- package/dist/index.cjs65.js +1 -1
- package/dist/index.cjs67.js +1 -1
- package/dist/index.cjs69.js +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.cjs71.js +1 -1
- package/dist/index.cjs72.js +1 -1
- package/dist/index.cjs75.js +1 -1
- package/dist/index.cjs78.js +1 -1
- package/dist/index.cjs78.js.map +1 -1
- package/dist/index.cjs79.js +1 -1
- package/dist/index.cjs79.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.cjs80.js +1 -1
- package/dist/index.cjs80.js.map +1 -1
- package/dist/index.cjs81.js +1 -1
- package/dist/index.cjs81.js.map +1 -1
- package/dist/index.cjs82.js +1 -1
- package/dist/index.cjs82.js.map +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.cjs9.js.map +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.es.js +18 -28
- package/dist/index.es10.js +22 -22
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es11.js +14 -42
- package/dist/index.es11.js.map +1 -1
- package/dist/index.es12.js +5 -65
- package/dist/index.es12.js.map +1 -1
- package/dist/index.es13.js +43 -24
- package/dist/index.es13.js.map +1 -1
- package/dist/index.es14.js +21 -126
- package/dist/index.es14.js.map +1 -1
- package/dist/index.es15.js +13 -20
- package/dist/index.es15.js.map +1 -1
- package/dist/index.es16.js +129 -130
- package/dist/index.es16.js.map +1 -1
- package/dist/index.es17.js +3 -137
- package/dist/index.es17.js.map +1 -1
- package/dist/index.es18.js +20 -61
- package/dist/index.es18.js.map +1 -1
- package/dist/index.es19.js +65 -10
- package/dist/index.es19.js.map +1 -1
- package/dist/index.es2.js +156 -115
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es20.js +134 -22
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es21.js +131 -421
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es22.js +63 -5
- package/dist/index.es22.js.map +1 -1
- package/dist/index.es23.js +11 -13
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es24.js +23 -16
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es25.js +428 -13
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es26.js +7 -13
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es27.js +9 -3
- package/dist/index.es27.js.map +1 -1
- package/dist/index.es28.js +13 -19
- package/dist/index.es28.js.map +1 -1
- package/dist/index.es29.js +19 -23
- package/dist/index.es29.js.map +1 -1
- package/dist/index.es3.js +129 -340
- package/dist/index.es3.js.map +1 -1
- package/dist/index.es30.js +4 -7
- package/dist/index.es30.js.map +1 -1
- package/dist/index.es31.js +1 -1
- package/dist/index.es34.js +1 -1
- package/dist/index.es36.js +6 -6
- package/dist/index.es37.js +97 -815
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +56 -10
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +24 -10
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es4.js +92 -70
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es40.js +45 -10
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +71 -99
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +56 -52
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +827 -19
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +10 -45
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +10 -86
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +10 -60
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +3 -3
- package/dist/index.es5.js +225 -79
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es55.js +30 -252
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +26 -21
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es58.js +62 -23
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +27 -63
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es6.js +117 -57
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es60.js +5 -29
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +24 -5
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +254 -24
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +21 -32
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es65.js +2 -2
- package/dist/index.es67.js +3 -3
- package/dist/index.es69.js +2 -2
- package/dist/index.es7.js +345 -48
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es71.js +7 -7
- package/dist/index.es72.js +1 -1
- package/dist/index.es75.js +1 -1
- package/dist/index.es78.js +67 -11
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +10 -203
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es8.js +73 -163
- package/dist/index.es8.js.map +1 -1
- package/dist/index.es80.js +203 -20
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +21 -392
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +386 -61
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es9.js +18 -3
- package/dist/index.es9.js.map +1 -1
- package/dist/packages/builder/add-dialog.d.ts +5 -5
- package/package.json +1 -1
package/dist/index.es55.js
CHANGED
|
@@ -1,258 +1,36 @@
|
|
|
1
1
|
import * as s from "react";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
prop: a,
|
|
27
|
-
defaultProp: r,
|
|
28
|
-
onChange: o
|
|
2
|
+
import * as f from "react-dom";
|
|
3
|
+
import { Slot as p } from "./index.es34.js";
|
|
4
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
5
|
+
var c = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"div",
|
|
9
|
+
"form",
|
|
10
|
+
"h2",
|
|
11
|
+
"h3",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"label",
|
|
15
|
+
"li",
|
|
16
|
+
"nav",
|
|
17
|
+
"ol",
|
|
18
|
+
"p",
|
|
19
|
+
"span",
|
|
20
|
+
"svg",
|
|
21
|
+
"ul"
|
|
22
|
+
], v = c.reduce((r, i) => {
|
|
23
|
+
const t = s.forwardRef((o, e) => {
|
|
24
|
+
const { asChild: m, ...a } = o, n = m ? p : i;
|
|
25
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(n, { ...a, ref: e });
|
|
29
26
|
});
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
triggerRef: c,
|
|
35
|
-
contentRef: f,
|
|
36
|
-
contentId: C(),
|
|
37
|
-
titleId: C(),
|
|
38
|
-
descriptionId: C(),
|
|
39
|
-
open: D,
|
|
40
|
-
onOpenChange: v,
|
|
41
|
-
onOpenToggle: s.useCallback(() => v((H) => !H), [v]),
|
|
42
|
-
modal: l,
|
|
43
|
-
children: n
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
x.displayName = h;
|
|
48
|
-
var A = "DialogTrigger", T = s.forwardRef(
|
|
49
|
-
(e, t) => {
|
|
50
|
-
const { __scopeDialog: n, ...a } = e, r = u(A, n), o = R(t, r.triggerRef);
|
|
51
|
-
return /* @__PURE__ */ i(
|
|
52
|
-
g.button,
|
|
53
|
-
{
|
|
54
|
-
type: "button",
|
|
55
|
-
"aria-haspopup": "dialog",
|
|
56
|
-
"aria-expanded": r.open,
|
|
57
|
-
"aria-controls": r.contentId,
|
|
58
|
-
"data-state": P(r.open),
|
|
59
|
-
...a,
|
|
60
|
-
ref: o,
|
|
61
|
-
onClick: p(e.onClick, r.onOpenToggle)
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
T.displayName = A;
|
|
67
|
-
var E = "DialogPortal", [oe, b] = O(E, {
|
|
68
|
-
forceMount: void 0
|
|
69
|
-
}), M = (e) => {
|
|
70
|
-
const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(E, t);
|
|
71
|
-
return /* @__PURE__ */ i(oe, { scope: t, forceMount: n, children: s.Children.map(a, (l) => /* @__PURE__ */ i(_, { present: n || o.open, children: /* @__PURE__ */ i(Z, { asChild: !0, container: r, children: l }) })) });
|
|
72
|
-
};
|
|
73
|
-
M.displayName = E;
|
|
74
|
-
var m = "DialogOverlay", w = s.forwardRef(
|
|
75
|
-
(e, t) => {
|
|
76
|
-
const n = b(m, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(m, e.__scopeDialog);
|
|
77
|
-
return o.modal ? /* @__PURE__ */ i(_, { present: a || o.open, children: /* @__PURE__ */ i(te, { ...r, ref: t }) }) : null;
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
w.displayName = m;
|
|
81
|
-
var te = s.forwardRef(
|
|
82
|
-
(e, t) => {
|
|
83
|
-
const { __scopeDialog: n, ...a } = e, r = u(m, n);
|
|
84
|
-
return (
|
|
85
|
-
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
86
|
-
// ie. when `Overlay` and `Content` are siblings
|
|
87
|
-
/* @__PURE__ */ i(J, { as: X, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
|
|
88
|
-
g.div,
|
|
89
|
-
{
|
|
90
|
-
"data-state": P(r.open),
|
|
91
|
-
...a,
|
|
92
|
-
ref: t,
|
|
93
|
-
style: { pointerEvents: "auto", ...a.style }
|
|
94
|
-
}
|
|
95
|
-
) })
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
), d = "DialogContent", F = s.forwardRef(
|
|
99
|
-
(e, t) => {
|
|
100
|
-
const n = b(d, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(d, e.__scopeDialog);
|
|
101
|
-
return /* @__PURE__ */ i(_, { present: a || o.open, children: o.modal ? /* @__PURE__ */ i(re, { ...r, ref: t }) : /* @__PURE__ */ i(ne, { ...r, ref: t }) });
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
F.displayName = d;
|
|
105
|
-
var re = s.forwardRef(
|
|
106
|
-
(e, t) => {
|
|
107
|
-
const n = u(d, e.__scopeDialog), a = s.useRef(null), r = R(t, n.contentRef, a);
|
|
108
|
-
return s.useEffect(() => {
|
|
109
|
-
const o = a.current;
|
|
110
|
-
if (o) return Q(o);
|
|
111
|
-
}, []), /* @__PURE__ */ i(
|
|
112
|
-
S,
|
|
113
|
-
{
|
|
114
|
-
...e,
|
|
115
|
-
ref: r,
|
|
116
|
-
trapFocus: n.open,
|
|
117
|
-
disableOutsidePointerEvents: !0,
|
|
118
|
-
onCloseAutoFocus: p(e.onCloseAutoFocus, (o) => {
|
|
119
|
-
o.preventDefault(), n.triggerRef.current?.focus();
|
|
120
|
-
}),
|
|
121
|
-
onPointerDownOutside: p(e.onPointerDownOutside, (o) => {
|
|
122
|
-
const l = o.detail.originalEvent, c = l.button === 0 && l.ctrlKey === !0;
|
|
123
|
-
(l.button === 2 || c) && o.preventDefault();
|
|
124
|
-
}),
|
|
125
|
-
onFocusOutside: p(
|
|
126
|
-
e.onFocusOutside,
|
|
127
|
-
(o) => o.preventDefault()
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
), ne = s.forwardRef(
|
|
133
|
-
(e, t) => {
|
|
134
|
-
const n = u(d, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
|
|
135
|
-
return /* @__PURE__ */ i(
|
|
136
|
-
S,
|
|
137
|
-
{
|
|
138
|
-
...e,
|
|
139
|
-
ref: t,
|
|
140
|
-
trapFocus: !1,
|
|
141
|
-
disableOutsidePointerEvents: !1,
|
|
142
|
-
onCloseAutoFocus: (o) => {
|
|
143
|
-
e.onCloseAutoFocus?.(o), o.defaultPrevented || (a.current || n.triggerRef.current?.focus(), o.preventDefault()), a.current = !1, r.current = !1;
|
|
144
|
-
},
|
|
145
|
-
onInteractOutside: (o) => {
|
|
146
|
-
e.onInteractOutside?.(o), o.defaultPrevented || (a.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
147
|
-
const l = o.target;
|
|
148
|
-
n.triggerRef.current?.contains(l) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
), S = s.forwardRef(
|
|
154
|
-
(e, t) => {
|
|
155
|
-
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), D = R(t, f);
|
|
156
|
-
return z(), /* @__PURE__ */ y(I, { children: [
|
|
157
|
-
/* @__PURE__ */ i(
|
|
158
|
-
Y,
|
|
159
|
-
{
|
|
160
|
-
asChild: !0,
|
|
161
|
-
loop: !0,
|
|
162
|
-
trapped: a,
|
|
163
|
-
onMountAutoFocus: r,
|
|
164
|
-
onUnmountAutoFocus: o,
|
|
165
|
-
children: /* @__PURE__ */ i(
|
|
166
|
-
U,
|
|
167
|
-
{
|
|
168
|
-
role: "dialog",
|
|
169
|
-
id: c.contentId,
|
|
170
|
-
"aria-describedby": c.descriptionId,
|
|
171
|
-
"aria-labelledby": c.titleId,
|
|
172
|
-
"data-state": P(c.open),
|
|
173
|
-
...l,
|
|
174
|
-
ref: D,
|
|
175
|
-
onDismiss: () => c.onOpenChange(!1)
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
/* @__PURE__ */ y(I, { children: [
|
|
181
|
-
/* @__PURE__ */ i(ae, { titleId: c.titleId }),
|
|
182
|
-
/* @__PURE__ */ i(se, { contentRef: f, descriptionId: c.descriptionId })
|
|
183
|
-
] })
|
|
184
|
-
] });
|
|
185
|
-
}
|
|
186
|
-
), N = "DialogTitle", W = s.forwardRef(
|
|
187
|
-
(e, t) => {
|
|
188
|
-
const { __scopeDialog: n, ...a } = e, r = u(N, n);
|
|
189
|
-
return /* @__PURE__ */ i(g.h2, { id: r.titleId, ...a, ref: t });
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
W.displayName = N;
|
|
193
|
-
var k = "DialogDescription", G = s.forwardRef(
|
|
194
|
-
(e, t) => {
|
|
195
|
-
const { __scopeDialog: n, ...a } = e, r = u(k, n);
|
|
196
|
-
return /* @__PURE__ */ i(g.p, { id: r.descriptionId, ...a, ref: t });
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
G.displayName = k;
|
|
200
|
-
var L = "DialogClose", $ = s.forwardRef(
|
|
201
|
-
(e, t) => {
|
|
202
|
-
const { __scopeDialog: n, ...a } = e, r = u(L, n);
|
|
203
|
-
return /* @__PURE__ */ i(
|
|
204
|
-
g.button,
|
|
205
|
-
{
|
|
206
|
-
type: "button",
|
|
207
|
-
...a,
|
|
208
|
-
ref: t,
|
|
209
|
-
onClick: p(e.onClick, () => r.onOpenChange(!1))
|
|
210
|
-
}
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
);
|
|
214
|
-
$.displayName = L;
|
|
215
|
-
function P(e) {
|
|
216
|
-
return e ? "open" : "closed";
|
|
27
|
+
return t.displayName = `Primitive.${i}`, { ...r, [i]: t };
|
|
28
|
+
}, {});
|
|
29
|
+
function h(r, i) {
|
|
30
|
+
r && f.flushSync(() => r.dispatchEvent(i));
|
|
217
31
|
}
|
|
218
|
-
var B = "DialogTitleWarning", [Pe, j] = q(B, {
|
|
219
|
-
contentName: d,
|
|
220
|
-
titleName: N,
|
|
221
|
-
docsSlug: "dialog"
|
|
222
|
-
}), ae = ({ titleId: e }) => {
|
|
223
|
-
const t = j(B), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
224
|
-
|
|
225
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
226
|
-
|
|
227
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
228
|
-
return s.useEffect(() => {
|
|
229
|
-
e && (document.getElementById(e) || console.error(n));
|
|
230
|
-
}, [n, e]), null;
|
|
231
|
-
}, ie = "DialogDescriptionWarning", se = ({ contentRef: e, descriptionId: t }) => {
|
|
232
|
-
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${j(ie).contentName}}.`;
|
|
233
|
-
return s.useEffect(() => {
|
|
234
|
-
const r = e.current?.getAttribute("aria-describedby");
|
|
235
|
-
t && r && (document.getElementById(t) || console.warn(a));
|
|
236
|
-
}, [a, e, t]), null;
|
|
237
|
-
}, ye = x, Ie = T, Oe = M, xe = w, Ae = F, Te = W, be = G, Me = $;
|
|
238
32
|
export {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
be as Description,
|
|
242
|
-
x as Dialog,
|
|
243
|
-
$ as DialogClose,
|
|
244
|
-
F as DialogContent,
|
|
245
|
-
G as DialogDescription,
|
|
246
|
-
w as DialogOverlay,
|
|
247
|
-
M as DialogPortal,
|
|
248
|
-
W as DialogTitle,
|
|
249
|
-
T as DialogTrigger,
|
|
250
|
-
xe as Overlay,
|
|
251
|
-
Oe as Portal,
|
|
252
|
-
ye as Root,
|
|
253
|
-
Te as Title,
|
|
254
|
-
Ie as Trigger,
|
|
255
|
-
Pe as WarningProvider,
|
|
256
|
-
Ne as createDialogScope
|
|
33
|
+
v as Primitive,
|
|
34
|
+
h as dispatchDiscreteCustomEvent
|
|
257
35
|
};
|
|
258
36
|
//# sourceMappingURL=index.es55.js.map
|
package/dist/index.es55.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es55.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.6_@types+react-dom@18.3.5_@types+react@18.3.18__@types+react_963ba7435ac590a8053d1db2d26ca164/node_modules/@radix-ui/react-dialog/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/dialog/src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DIALOG_NAME","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","openProp","defaultOpen","onOpenChange","modal","triggerRef","React","contentRef","open","setOpen","useControllableState","jsx","useId","prevOpen","TRIGGER_NAME","DialogTrigger","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","getState","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","DialogPortal","forceMount","container","child","Presence","PortalPrimitive","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","RemoveScroll","Slot","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","DialogContentNonModal","composedRefs","content","hideOthers","DialogContentImpl","event","originalEvent","ctrlLeftClick","hasInteractedOutsideRef","hasPointerDownOutsideRef","target","trapFocus","onOpenAutoFocus","onCloseAutoFocus","useFocusGuards","jsxs","Fragment","FocusScope","DismissableLayer","TitleWarning","DescriptionWarning","TITLE_NAME","DialogTitle","titleProps","DESCRIPTION_NAME","DialogDescription","descriptionProps","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","createContext","titleId","titleWarningContext","MESSAGE","DESCRIPTION_WARNING_NAME","descriptionId","describedById","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAIA,IAAc,UACd,CAACC,GAAqBC,EAAiB,IAAIC,EAAmBH,CAAW,GACzE,CAACI,IAAgBC,CAAgB,IAAIJ,EAAoBD,CAAW,GACpEM,IAAS,CAACC,MAAU;AACtB,QAAM;AAAA,IACJ,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAMC;AAAA,IACN,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,EACZ,IAAMN,GACEO,IAAaC,EAAM,OAAO,IAAI,GAC9BC,IAAaD,EAAM,OAAO,IAAI,GAC9B,CAACE,IAAO,IAAOC,CAAO,IAAIC,EAAqB;AAAA,IACnD,MAAMT;AAAA,IACN,aAAaC;AAAA,IACb,UAAUC;AAAA,EACd,CAAG;AACD,SAAuB,gBAAAQ;AAAA,IACrBhB;AAAA,IACA;AAAA,MACE,O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,4BAC3BjB,KAAqB,CAAC,EAAE,YAAAzD,GAAY,eAAA2E,QAAoB;AAE1D,QAAMF,IAAU,6EADkBJ,EAAkBK,EAAwB,EAC2C,WAAW;AAClI,SAAA3E,EAAM,UAAU,MAAM;AACpB,UAAM6E,IAAgB5E,EAAW,SAAS,aAAa,kBAAkB;AACzE,IAAI2E,KAAiBC,MACI,SAAS,eAAeD,CAAa,KACvC,QAAQ,KAAKF,CAAO;AAAA,EAE5C,GAAE,CAACA,GAASzE,GAAY2E,CAAa,CAAC,GAChC;AACT,GACIE,KAAOvF,GACPwF,KAAUtE,GACVuE,KAAS3D,GACT4D,KAAUrD,GACVsD,KAAU/C,GACVgD,KAAQvB,GACRwB,KAAcrB,GACdsB,KAAQnB;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es55.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-primitive@2.0.2_@types+react-dom@18.3.5_@types+react@18.3.18__@types+re_57431883aeb2c82f4228eaee26b876b0/node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// packages/react/primitive/src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["NODES","Primitive","primitive","node","Node","React","props","forwardedRef","asChild","primitiveProps","Comp","Slot","jsx","dispatchDiscreteCustomEvent","target","event","ReactDOM"],"mappings":";;;;AAKA,IAAIA,IAAQ;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACIC,IAAYD,EAAM,OAAO,CAACE,GAAWC,MAAS;AAChD,QAAMC,IAAOC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACrD,UAAM,EAAE,SAAAC,GAAS,GAAGC,EAAc,IAAKH,GACjCI,IAAOF,IAAUG,IAAOR;AAC9B,WAAI,OAAO,SAAW,QACpB,OAAO,OAAO,IAAI,UAAU,CAAC,IAAI,KAEZ,gBAAAS,EAAIF,GAAM,EAAE,GAAGD,GAAgB,KAAKF,GAAc;AAAA,EAC7E,CAAG;AACD,SAAAH,EAAK,cAAc,aAAaD,CAAI,IAC7B,EAAE,GAAGD,GAAW,CAACC,CAAI,GAAGC,EAAM;AACvC,GAAG,CAAE,CAAA;AACL,SAASS,EAA4BC,GAAQC,GAAO;AAClD,EAAID,KAAQE,EAAS,UAAU,MAAMF,EAAO,cAAcC,CAAK,CAAC;AAClE;","x_google_ignoreList":[0]}
|
package/dist/index.es56.js
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
function l(n, o) {
|
|
3
|
+
if (typeof n == "function")
|
|
4
|
+
return n(o);
|
|
5
|
+
n != null && (n.current = o);
|
|
6
|
+
}
|
|
7
|
+
function i(...n) {
|
|
8
|
+
return (o) => {
|
|
9
|
+
let u = !1;
|
|
10
|
+
const c = n.map((t) => {
|
|
11
|
+
const e = l(t, o);
|
|
12
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
13
|
+
});
|
|
14
|
+
if (u)
|
|
15
|
+
return () => {
|
|
16
|
+
for (let t = 0; t < c.length; t++) {
|
|
17
|
+
const e = c[t];
|
|
18
|
+
typeof e == "function" ? e() : l(n[t], null);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function s(...n) {
|
|
24
|
+
return f.useCallback(i(...n), n);
|
|
19
25
|
}
|
|
20
|
-
var T = i;
|
|
21
26
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
i as composeRefs,
|
|
28
|
+
s as useComposedRefs
|
|
24
29
|
};
|
|
25
30
|
//# sourceMappingURL=index.es56.js.map
|
package/dist/index.es56.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es56.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-
|
|
1
|
+
{"version":3,"file":"index.es56.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs"],"sourcesContent":["// packages/react/compose-refs/src/composeRefs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","useComposedRefs","React"],"mappings":";AAEA,SAASA,EAAOC,GAAKC,GAAO;AAC1B,MAAI,OAAOD,KAAQ;AACjB,WAAOA,EAAIC,CAAK;AACX,EAAID,KAAQ,SACjBA,EAAI,UAAUC;AAElB;AACA,SAASC,KAAeC,GAAM;AAC5B,SAAO,CAACC,MAAS;AACf,QAAIC,IAAa;AACjB,UAAMC,IAAWH,EAAK,IAAI,CAACH,MAAQ;AACjC,YAAMO,IAAUR,EAAOC,GAAKI,CAAI;AAChC,aAAI,CAACC,KAAc,OAAOE,KAAW,eACnCF,IAAa,KAERE;AAAA,IACb,CAAK;AACD,QAAIF;AACF,aAAO,MAAM;AACX,iBAASG,IAAI,GAAGA,IAAIF,EAAS,QAAQE,KAAK;AACxC,gBAAMD,IAAUD,EAASE,CAAC;AAC1B,UAAI,OAAOD,KAAW,aACpBA,EAAS,IAETR,EAAOI,EAAKK,CAAC,GAAG,IAAI;AAAA,QAEhC;AAAA,MACO;AAAA,EAEJ;AACH;AACA,SAASC,KAAmBN,GAAM;AAChC,SAAOO,EAAM,YAAYR,EAAY,GAAGC,CAAI,GAAGA,CAAI;AACrD;","x_google_ignoreList":[0]}
|
package/dist/index.es58.js
CHANGED
|
@@ -1,30 +1,69 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
+
function $(t, c) {
|
|
4
|
+
const n = u.createContext(c), p = (r) => {
|
|
5
|
+
const { children: e, ...o } = r, s = u.useMemo(() => o, Object.values(o));
|
|
6
|
+
return /* @__PURE__ */ f(n.Provider, { value: s, children: e });
|
|
7
|
+
};
|
|
8
|
+
p.displayName = t + "Provider";
|
|
9
|
+
function i(r) {
|
|
10
|
+
const e = u.useContext(n);
|
|
11
|
+
if (e) return e;
|
|
12
|
+
if (c !== void 0) return c;
|
|
13
|
+
throw new Error(`\`${r}\` must be used within \`${t}\``);
|
|
14
|
+
}
|
|
15
|
+
return [p, i];
|
|
6
16
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
function w(t, c = []) {
|
|
18
|
+
let n = [];
|
|
19
|
+
function p(r, e) {
|
|
20
|
+
const o = u.createContext(e), s = n.length;
|
|
21
|
+
n = [...n, e];
|
|
22
|
+
const d = (x) => {
|
|
23
|
+
const { scope: m, children: v, ...a } = x, S = m?.[t]?.[s] || o, h = u.useMemo(() => a, Object.values(a));
|
|
24
|
+
return /* @__PURE__ */ f(S.Provider, { value: h, children: v });
|
|
25
|
+
};
|
|
26
|
+
d.displayName = r + "Provider";
|
|
27
|
+
function C(x, m) {
|
|
28
|
+
const v = m?.[t]?.[s] || o, a = u.useContext(v);
|
|
29
|
+
if (a) return a;
|
|
30
|
+
if (e !== void 0) return e;
|
|
31
|
+
throw new Error(`\`${x}\` must be used within \`${r}\``);
|
|
32
|
+
}
|
|
33
|
+
return [d, C];
|
|
34
|
+
}
|
|
35
|
+
const i = () => {
|
|
36
|
+
const r = n.map((e) => u.createContext(e));
|
|
37
|
+
return function(o) {
|
|
38
|
+
const s = o?.[t] || r;
|
|
39
|
+
return u.useMemo(
|
|
40
|
+
() => ({ [`__scope${t}`]: { ...o, [t]: s } }),
|
|
41
|
+
[o, s]
|
|
42
|
+
);
|
|
43
|
+
};
|
|
21
44
|
};
|
|
45
|
+
return i.scopeName = t, [p, P(i, ...c)];
|
|
22
46
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
47
|
+
function P(...t) {
|
|
48
|
+
const c = t[0];
|
|
49
|
+
if (t.length === 1) return c;
|
|
50
|
+
const n = () => {
|
|
51
|
+
const p = t.map((i) => ({
|
|
52
|
+
useScope: i(),
|
|
53
|
+
scopeName: i.scopeName
|
|
54
|
+
}));
|
|
55
|
+
return function(r) {
|
|
56
|
+
const e = p.reduce((o, { useScope: s, scopeName: d }) => {
|
|
57
|
+
const x = s(r)[`__scope${d}`];
|
|
58
|
+
return { ...o, ...x };
|
|
59
|
+
}, {});
|
|
60
|
+
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: e }), [e]);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
return n.scopeName = c.scopeName, n;
|
|
25
64
|
}
|
|
26
65
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
66
|
+
$ as createContext,
|
|
67
|
+
w as createContextScope
|
|
29
68
|
};
|
|
30
69
|
//# sourceMappingURL=index.es58.js.map
|
package/dist/index.es58.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es58.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-
|
|
1
|
+
{"version":3,"file":"index.es58.js","sources":["../../../node_modules/.pnpm/@radix-ui+react-context@1.1.1_@types+react@18.3.18_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// packages/react/context/src/createContext.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n const Provider = (props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createContext2","rootComponentName","defaultContext","Context","React","Provider","props","children","context","value","jsx","useContext2","consumerName","createContextScope","scopeName","createContextScopeDeps","defaultContexts","createContext3","BaseContext","index","scope","createScope","scopeContexts","contexts","composeContextScopes","scopes","baseScope","scopeHooks","createScope2","overrideScopes","nextScopes","nextScopes2","useScope","currentScope"],"mappings":";;AAGA,SAASA,EAAeC,GAAmBC,GAAgB;AACzD,QAAMC,IAAUC,EAAM,cAAcF,CAAc,GAC5CG,IAAW,CAACC,MAAU;AAC1B,UAAM,EAAE,UAAAC,GAAU,GAAGC,EAAO,IAAKF,GAC3BG,IAAQL,EAAM,QAAQ,MAAMI,GAAS,OAAO,OAAOA,CAAO,CAAC;AACjE,WAAuB,gBAAAE,EAAIP,EAAQ,UAAU,EAAE,OAAAM,GAAO,UAAAF,EAAQ,CAAE;AAAA,EACjE;AACD,EAAAF,EAAS,cAAcJ,IAAoB;AAC3C,WAASU,EAAYC,GAAc;AACjC,UAAMJ,IAAUJ,EAAM,WAAWD,CAAO;AACxC,QAAIK,EAAS,QAAOA;AACpB,QAAIN,MAAmB,OAAQ,QAAOA;AACtC,UAAM,IAAI,MAAM,KAAKU,CAAY,4BAA4BX,CAAiB,IAAI;AAAA,EACtF;AACE,SAAO,CAACI,GAAUM,CAAW;AAC/B;AACA,SAASE,EAAmBC,GAAWC,IAAyB,IAAI;AAClE,MAAIC,IAAkB,CAAE;AACxB,WAASC,EAAehB,GAAmBC,GAAgB;AACzD,UAAMgB,IAAcd,EAAM,cAAcF,CAAc,GAChDiB,IAAQH,EAAgB;AAC9B,IAAAA,IAAkB,CAAC,GAAGA,GAAiBd,CAAc;AACrD,UAAMG,IAAW,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,MAC/C,UAAUA,EAAc;AAAA,MACxB,WAAWA,EAAa;AAAA,IAC9B,EAAM;AACF,WAAO,SAA2BC,GAAgB;AAChD,YAAMC,IAAaH,EAAW,OAAO,CAACI,GAAa,EAAE,UAAAC,GAAU,WAAAlB,QAAgB;AAE7E,cAAMmB,IADaD,EAASH,CAAc,EACV,UAAUf,CAAS,EAAE;AACrD,eAAO,EAAE,GAAGiB,GAAa,GAAGE,EAAc;AAAA,MAC3C,GAAE,EAAE;AACL,aAAO7B,EAAM,QAAQ,OAAO,EAAE,CAAC,UAAUsB,EAAU,SAAS,EAAE,GAAGI,EAAU,IAAK,CAACA,CAAU,CAAC;AAAA,IAC7F;AAAA,EACF;AACD,SAAAT,EAAY,YAAYK,EAAU,WAC3BL;AACT;","x_google_ignoreList":[0]}
|
package/dist/index.es59.js
CHANGED
|
@@ -1,69 +1,33 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
p.displayName = t + "Provider";
|
|
9
|
-
function i(r) {
|
|
10
|
-
const e = u.useContext(n);
|
|
11
|
-
if (e) return e;
|
|
12
|
-
if (c !== void 0) return c;
|
|
13
|
-
throw new Error(`\`${r}\` must be used within \`${t}\``);
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { useCallbackRef as f } from "./index.es73.js";
|
|
3
|
+
function R({
|
|
4
|
+
prop: t,
|
|
5
|
+
defaultProp: r,
|
|
6
|
+
onChange: s = () => {
|
|
14
7
|
}
|
|
15
|
-
|
|
8
|
+
}) {
|
|
9
|
+
const [e, n] = v({ defaultProp: r, onChange: s }), o = t !== void 0, i = o ? t : e, u = f(s), d = l.useCallback(
|
|
10
|
+
(c) => {
|
|
11
|
+
if (o) {
|
|
12
|
+
const a = typeof c == "function" ? c(t) : c;
|
|
13
|
+
a !== t && u(a);
|
|
14
|
+
} else
|
|
15
|
+
n(c);
|
|
16
|
+
},
|
|
17
|
+
[o, t, n, u]
|
|
18
|
+
);
|
|
19
|
+
return [i, d];
|
|
16
20
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
d.displayName = r + "Provider";
|
|
27
|
-
function C(x, m) {
|
|
28
|
-
const v = m?.[t]?.[s] || o, a = u.useContext(v);
|
|
29
|
-
if (a) return a;
|
|
30
|
-
if (e !== void 0) return e;
|
|
31
|
-
throw new Error(`\`${x}\` must be used within \`${r}\``);
|
|
32
|
-
}
|
|
33
|
-
return [d, C];
|
|
34
|
-
}
|
|
35
|
-
const i = () => {
|
|
36
|
-
const r = n.map((e) => u.createContext(e));
|
|
37
|
-
return function(o) {
|
|
38
|
-
const s = o?.[t] || r;
|
|
39
|
-
return u.useMemo(
|
|
40
|
-
() => ({ [`__scope${t}`]: { ...o, [t]: s } }),
|
|
41
|
-
[o, s]
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
return i.scopeName = t, [p, P(i, ...c)];
|
|
46
|
-
}
|
|
47
|
-
function P(...t) {
|
|
48
|
-
const c = t[0];
|
|
49
|
-
if (t.length === 1) return c;
|
|
50
|
-
const n = () => {
|
|
51
|
-
const p = t.map((i) => ({
|
|
52
|
-
useScope: i(),
|
|
53
|
-
scopeName: i.scopeName
|
|
54
|
-
}));
|
|
55
|
-
return function(r) {
|
|
56
|
-
const e = p.reduce((o, { useScope: s, scopeName: d }) => {
|
|
57
|
-
const x = s(r)[`__scope${d}`];
|
|
58
|
-
return { ...o, ...x };
|
|
59
|
-
}, {});
|
|
60
|
-
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: e }), [e]);
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
return n.scopeName = c.scopeName, n;
|
|
21
|
+
function v({
|
|
22
|
+
defaultProp: t,
|
|
23
|
+
onChange: r
|
|
24
|
+
}) {
|
|
25
|
+
const s = l.useState(t), [e] = s, n = l.useRef(e), o = f(r);
|
|
26
|
+
return l.useEffect(() => {
|
|
27
|
+
n.current !== e && (o(e), n.current = e);
|
|
28
|
+
}, [e, n, o]), s;
|
|
64
29
|
}
|
|
65
30
|
export {
|
|
66
|
-
|
|
67
|
-
w as createContextScope
|
|
31
|
+
R as useControllableState
|
|
68
32
|
};
|
|
69
33
|
//# sourceMappingURL=index.es59.js.map
|