@mechane-ai/elements 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.js +43 -43
- package/dist/{categorical-values-Dfe3nkBV.js → categorical-values-BXPE0Cjs.js} +2 -2
- package/dist/{chart-frame-rL7_RAIc.js → chart-frame-Degqwy_z.js} +94 -64
- package/dist/{chart-input-JIyGPusK.js → chart-input-B12En69_.js} +2 -2
- package/dist/charts/cartesian.js +8 -8
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +2 -2
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +3 -3
- package/dist/charts/timeline.js +3 -3
- package/dist/charts.js +1 -1
- package/dist/{code-block-BX51BVe1.js → code-block-B_qJ1JJ3.js} +3 -3
- package/dist/collections.js +224 -211
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-5oRGjDHa.js → content-link-BtaiSKk8.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/elements.css +89 -23
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +1 -1
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +391 -317
- package/dist/navigation/commands.js +1 -1
- package/dist/packages/charts/src/chart-frame.d.ts +6 -4
- package/dist/packages/charts/src/chart-heading.d.ts +9 -0
- package/dist/packages/core/src/actions.d.ts +6 -2
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/feedback/src/control-placeholders.d.ts +11 -4
- package/dist/packages/forms/src/combobox.d.ts +5 -2
- package/dist/packages/forms/src/form-controls.d.ts +9 -4
- package/dist/packages/forms/src/forms.d.ts +3 -1
- package/dist/packages/forms/src/select.d.ts +3 -1
- package/dist/packages/foundations/src/control-density.d.ts +1 -0
- package/dist/packages/foundations/src/control-styles.d.ts +36 -1
- package/dist/packages/foundations/src/header-styles.d.ts +85 -0
- package/dist/packages/foundations/src/tokens.d.ts +1 -1
- package/dist/packages/foundations/src/tokens.stylex.d.ts +7 -0
- package/dist/packages/layout/src/frame.stylex.d.ts +0 -2
- package/dist/{pierre-diff-DOkqEUqx.js → pierre-diff-CaPsfQRo.js} +1 -1
- package/dist/{pierre-theme-DsrSwl5m.js → pierre-theme-BpNaWn1x.js} +30 -30
- package/dist/{pierre-tree-D2kRr4h4.js → pierre-tree-CPhT5CUP.js} +4 -4
- package/dist/src-BPIIuMeE.js +1291 -0
- package/dist/{src-eWcNz_oB.js → src-BjmKVOb2.js} +309 -309
- package/dist/{src-E3Or8tkO.js → src-CALHXF-U.js} +574 -415
- package/dist/{src-DlNMCgVy.js → src-DfPfFOu1.js} +17 -17
- package/dist/tokens.js +1 -1
- package/dist/{tokens.stylex-BoRZ3D8s.js → tokens.stylex-CJbIDPB9.js} +10 -3
- package/package.json +1 -1
- package/packages/foundations/src/tokens.stylex.ts +6 -0
- package/dist/src-BfPaaDxg.js +0 -1193
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { Box as
|
|
9
|
-
import { Meter as
|
|
10
|
-
import { Progress as
|
|
11
|
-
import
|
|
1
|
+
import { A as e, M as t, P as n, i as r, j as i, s as a } from "./src-CALHXF-U.js";
|
|
2
|
+
import { b as o, i as s, u as c, y as l } from "./tokens.stylex-CJbIDPB9.js";
|
|
3
|
+
import { t as u } from "./accessibility-C-aIZ1Yx.js";
|
|
4
|
+
import { mergeProps as d } from "@base-ui/react/merge-props";
|
|
5
|
+
import * as f from "@stylexjs/stylex";
|
|
6
|
+
import p, { createContext as m, useContext as h, useEffect as ee, useRef as g, useState as _ } from "react";
|
|
7
|
+
import { Fragment as te, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
8
|
+
import { Box as ne, CircleCheck as b, CircleX as x, Info as S, LoaderCircle as C, TriangleAlert as w, X as T } from "lucide-react";
|
|
9
|
+
import { Meter as E } from "@base-ui/react/meter";
|
|
10
|
+
import { Progress as D } from "@base-ui/react/progress";
|
|
11
|
+
import O from "react-dom";
|
|
12
12
|
// packages/feedback/src/feedback.tsx
|
|
13
|
-
function
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
...
|
|
13
|
+
function k({ title: e, children: t, action: n, ...i }) {
|
|
14
|
+
return /* @__PURE__ */ y("div", {
|
|
15
|
+
...d({ className: "x78zum5 xdt5ytf x6s0dn4 xl56j7k x2b8uid xeuugli x193iq5w x9f619 x9w77qv xnx3t7k x1n8ia3y x1hz01jw xj57cvi xvmahel xj0a0fe" }, i),
|
|
16
16
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ v(ne, {
|
|
18
18
|
size: 22,
|
|
19
19
|
"aria-hidden": !0,
|
|
20
20
|
className: "x153jb6y x2lah0s"
|
|
21
21
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/* @__PURE__ */ v(a, { children: e }),
|
|
23
|
+
t != null && /* @__PURE__ */ v(r, { children: t }),
|
|
24
|
+
n != null && /* @__PURE__ */ v("div", {
|
|
25
25
|
className: "x78zum5 xl56j7k x1a02dak x1hnptsi xeuugli x193iq5w",
|
|
26
|
-
children:
|
|
26
|
+
children: n
|
|
27
27
|
})
|
|
28
28
|
]
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
function A({ hasError: e = !1, ...t }) {
|
|
32
|
+
return /* @__PURE__ */ v("div", { ...d({ role: e ? "alert" : "status" }, {
|
|
33
33
|
0: { className: "xeuugli x193iq5w x9f619 x1qokhjc x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi x1dqe72f x1f9ixgr xj0a0fe" },
|
|
34
34
|
1: { className: "xeuugli x193iq5w x9f619 x1qokhjc x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi xj0a0fe xr5kp14 xcqwzn" }
|
|
35
35
|
}[!!e | 0], t) });
|
|
36
36
|
}
|
|
37
37
|
// packages/feedback/src/skeleton.tsx
|
|
38
|
-
var
|
|
38
|
+
var j = {
|
|
39
39
|
skeleton: {
|
|
40
40
|
k1xSpc: "x1lliihq",
|
|
41
41
|
ks0D6T: "x193iq5w",
|
|
@@ -73,50 +73,50 @@ var D = {
|
|
|
73
73
|
k7Eaqz: "xeuugli",
|
|
74
74
|
$$css: !0
|
|
75
75
|
}
|
|
76
|
-
},
|
|
77
|
-
rectangle:
|
|
78
|
-
circle:
|
|
76
|
+
}, M = {
|
|
77
|
+
rectangle: j.rectangle,
|
|
78
|
+
circle: j.circle
|
|
79
79
|
};
|
|
80
|
-
function
|
|
81
|
-
return /* @__PURE__ */
|
|
80
|
+
function N({ width: e = "100%", height: t = 8, shape: n = "rectangle" }) {
|
|
81
|
+
return /* @__PURE__ */ v("span", {
|
|
82
82
|
"aria-hidden": !0,
|
|
83
|
-
...
|
|
83
|
+
...f.props(j.skeleton, j.dimensions(e, t), M[n])
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return /* @__PURE__ */
|
|
86
|
+
function P({ lines: e = 1, width: t = "100%" }) {
|
|
87
|
+
return /* @__PURE__ */ v("span", {
|
|
88
88
|
"aria-hidden": !0,
|
|
89
|
-
...
|
|
90
|
-
children: Array.from({ length: e }, (t, n) => /* @__PURE__ */
|
|
89
|
+
...f.props(j.text, j.width(t)),
|
|
90
|
+
children: Array.from({ length: e }, (t, n) => /* @__PURE__ */ v("span", {
|
|
91
91
|
className: "x78zum5 x6s0dn4 xg2ss61",
|
|
92
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ v(N, {
|
|
93
93
|
width: e > 1 && n === e - 1 ? "65%" : "100%",
|
|
94
94
|
height: "0.6em"
|
|
95
95
|
})
|
|
96
96
|
}, `placeholder-${n}`))
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
return /* @__PURE__ */
|
|
99
|
+
function F({ label: e, showLabel: t = !1 }) {
|
|
100
|
+
return /* @__PURE__ */ y("span", {
|
|
101
101
|
role: "status",
|
|
102
102
|
className: "x3nfvp2 x1n2onr6 x6s0dn4 xeuugli x193iq5w x1hnptsi x153jb6y x1hz01jw xtqrqnz x1778rvt xj57cvi xj0a0fe",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ v(C, {
|
|
104
104
|
"aria-hidden": !0,
|
|
105
105
|
className: "xtwnzbg x18utl2x x2lah0s"
|
|
106
|
-
}), /* @__PURE__ */
|
|
107
|
-
...
|
|
106
|
+
}), /* @__PURE__ */ v("span", {
|
|
107
|
+
...f.props(j.label, !t && u.hidden),
|
|
108
108
|
children: e
|
|
109
109
|
})]
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
// packages/feedback/src/control-placeholders.tsx
|
|
113
|
-
var
|
|
113
|
+
var I = {
|
|
114
114
|
ks0D6T: "x193iq5w",
|
|
115
115
|
$$css: !0
|
|
116
|
-
},
|
|
116
|
+
}, L = {
|
|
117
117
|
kZKoxP: "x16ye13r",
|
|
118
118
|
$$css: !0
|
|
119
|
-
},
|
|
119
|
+
}, R = {
|
|
120
120
|
button: {
|
|
121
121
|
kWkggS: "x1r7kqkb",
|
|
122
122
|
kXLuUW: "xxymvpz",
|
|
@@ -128,173 +128,173 @@ var M = {
|
|
|
128
128
|
$$css: !0
|
|
129
129
|
},
|
|
130
130
|
width: (e) => [
|
|
131
|
-
|
|
131
|
+
I,
|
|
132
132
|
{
|
|
133
133
|
kzqmXN: e == null ? e : "x5lhr3w",
|
|
134
134
|
$$css: !0
|
|
135
135
|
},
|
|
136
136
|
{ "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
|
|
137
137
|
],
|
|
138
|
-
rows: (e) => [
|
|
138
|
+
rows: (e) => [L, { "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(`calc(${e} * 1lh + 2 * ${s.paddingBlock} + 2px)`) }]
|
|
139
139
|
};
|
|
140
|
-
function
|
|
141
|
-
return /* @__PURE__ */
|
|
140
|
+
function z({ width: n = "7ch", isIconOnly: r = !1, density: a = "standard", xstyle: o }) {
|
|
141
|
+
return /* @__PURE__ */ v("span", {
|
|
142
142
|
"aria-hidden": !0,
|
|
143
143
|
inert: !0,
|
|
144
|
-
...
|
|
145
|
-
children:
|
|
146
|
-
width:
|
|
147
|
-
height:
|
|
148
|
-
}) : /* @__PURE__ */
|
|
144
|
+
...f.props(t.base, t.button, i[a], e[a], r && t.iconButton, R.button, o),
|
|
145
|
+
children: r ? /* @__PURE__ */ v(N, {
|
|
146
|
+
width: s.iconSize,
|
|
147
|
+
height: s.iconSize
|
|
148
|
+
}) : /* @__PURE__ */ v(P, { width: n })
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
let
|
|
153
|
-
return /* @__PURE__ */
|
|
151
|
+
function re({ label: e, hint: r, isMultiline: a = !1, density: o = "standard", rows: s = 4, width: c = "100%", xstyle: l }) {
|
|
152
|
+
let u = a ? Math.min(s, 6) : 1;
|
|
153
|
+
return /* @__PURE__ */ y("div", {
|
|
154
154
|
"aria-hidden": !0,
|
|
155
|
-
...
|
|
155
|
+
...f.props(t.fieldRoot, R.width(c), l),
|
|
156
156
|
children: [
|
|
157
|
-
e !== void 0 && /* @__PURE__ */
|
|
158
|
-
...
|
|
157
|
+
e !== void 0 && /* @__PURE__ */ v("span", {
|
|
158
|
+
...f.props(t.label),
|
|
159
159
|
children: e
|
|
160
160
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
...
|
|
163
|
-
children: /* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ v("div", {
|
|
162
|
+
...f.props(t.base, t.field, i[o], !a && t.singleLineField, !a && n[o], !a && R.singleLine, a && t.textarea, a && R.rows(s)),
|
|
163
|
+
children: /* @__PURE__ */ v(P, {
|
|
164
164
|
width: "60%",
|
|
165
|
-
lines:
|
|
165
|
+
lines: u
|
|
166
166
|
})
|
|
167
167
|
}),
|
|
168
|
-
|
|
169
|
-
...
|
|
170
|
-
children:
|
|
168
|
+
r !== void 0 && /* @__PURE__ */ v("span", {
|
|
169
|
+
...f.props(t.description),
|
|
170
|
+
children: r
|
|
171
171
|
})
|
|
172
172
|
]
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
// packages/feedback/src/progress.tsx
|
|
176
176
|
function ie({ label: e, value: t, max: n, valueLabel: r }) {
|
|
177
|
-
return /* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ y(D.Root, {
|
|
178
178
|
value: t,
|
|
179
179
|
max: n,
|
|
180
180
|
locale: "en-US",
|
|
181
181
|
getAriaValueText: () => r,
|
|
182
182
|
className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ y("div", {
|
|
184
184
|
className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
185
|
+
children: [/* @__PURE__ */ v(D.Label, {
|
|
186
186
|
className: "xeuugli x193iq5w",
|
|
187
187
|
children: e
|
|
188
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ v("span", {
|
|
189
189
|
className: "xeuugli x193iq5w x153jb6y xss6m8b",
|
|
190
190
|
children: r
|
|
191
191
|
})]
|
|
192
|
-
}), /* @__PURE__ */
|
|
192
|
+
}), /* @__PURE__ */ v(D.Track, {
|
|
193
193
|
...{
|
|
194
194
|
0: { className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr" },
|
|
195
195
|
1: { className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619" }
|
|
196
196
|
}[t === null | 0],
|
|
197
|
-
children: t !== null && /* @__PURE__ */
|
|
197
|
+
children: t !== null && /* @__PURE__ */ v(D.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
|
|
198
198
|
})]
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
return t === null ? /* @__PURE__ */
|
|
201
|
+
function B({ label: e, value: t, max: n, valueLabel: r }) {
|
|
202
|
+
return t === null ? /* @__PURE__ */ y("div", {
|
|
203
203
|
className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ y("div", {
|
|
205
205
|
className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ v("span", {
|
|
207
207
|
className: "xeuugli x193iq5w",
|
|
208
208
|
children: e
|
|
209
|
-
}), /* @__PURE__ */
|
|
209
|
+
}), /* @__PURE__ */ v("span", {
|
|
210
210
|
className: "xeuugli x193iq5w x153jb6y xss6m8b",
|
|
211
211
|
children: r
|
|
212
212
|
})]
|
|
213
|
-
}), /* @__PURE__ */
|
|
213
|
+
}), /* @__PURE__ */ v("div", {
|
|
214
214
|
"aria-hidden": !0,
|
|
215
215
|
className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619"
|
|
216
216
|
})]
|
|
217
|
-
}) : /* @__PURE__ */
|
|
217
|
+
}) : /* @__PURE__ */ y(E.Root, {
|
|
218
218
|
value: t,
|
|
219
219
|
max: n,
|
|
220
220
|
locale: "en-US",
|
|
221
221
|
getAriaValueText: () => r,
|
|
222
222
|
className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ y("div", {
|
|
224
224
|
className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
|
|
225
|
-
children: [/* @__PURE__ */
|
|
225
|
+
children: [/* @__PURE__ */ v(E.Label, {
|
|
226
226
|
className: "xeuugli x193iq5w",
|
|
227
227
|
children: e
|
|
228
|
-
}), /* @__PURE__ */
|
|
228
|
+
}), /* @__PURE__ */ v("span", {
|
|
229
229
|
className: "xeuugli x193iq5w x153jb6y xss6m8b",
|
|
230
230
|
children: r
|
|
231
231
|
})]
|
|
232
|
-
}), /* @__PURE__ */
|
|
232
|
+
}), /* @__PURE__ */ v(E.Track, {
|
|
233
233
|
className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr",
|
|
234
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ v(E.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
|
|
235
235
|
})]
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
238
|
// ../../../node_modules/.pnpm/sonner@2.0.8_@types+react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/sonner/dist/index.mjs
|
|
239
239
|
var ae = (e) => {
|
|
240
240
|
switch (e) {
|
|
241
|
-
case "success": return
|
|
241
|
+
case "success": return V;
|
|
242
242
|
case "info": return le;
|
|
243
|
-
case "warning": return
|
|
244
|
-
case "error": return
|
|
243
|
+
case "warning": return ce;
|
|
244
|
+
case "error": return H;
|
|
245
245
|
default: return null;
|
|
246
246
|
}
|
|
247
|
-
}, oe = Array(12).fill(0), se = ({ visible: e, className: t }) => /*#__PURE__*/
|
|
247
|
+
}, oe = Array(12).fill(0), se = ({ visible: e, className: t }) => /*#__PURE__*/ p.createElement("div", {
|
|
248
248
|
className: ["sonner-loading-wrapper", t].filter(Boolean).join(" "),
|
|
249
249
|
"data-visible": e
|
|
250
|
-
}, /*#__PURE__*/
|
|
250
|
+
}, /*#__PURE__*/ p.createElement("div", { className: "sonner-spinner" }, oe.map((e, t) => /*#__PURE__*/ p.createElement("div", {
|
|
251
251
|
className: "sonner-loading-bar",
|
|
252
252
|
key: `spinner-bar-${t}`
|
|
253
|
-
})))),
|
|
253
|
+
})))), V = /*#__PURE__*/ p.createElement("svg", {
|
|
254
254
|
xmlns: "http://www.w3.org/2000/svg",
|
|
255
255
|
viewBox: "0 0 20 20",
|
|
256
256
|
fill: "currentColor",
|
|
257
257
|
height: "20",
|
|
258
258
|
width: "20",
|
|
259
259
|
"aria-hidden": "true"
|
|
260
|
-
}, /*#__PURE__*/
|
|
260
|
+
}, /*#__PURE__*/ p.createElement("path", {
|
|
261
261
|
fillRule: "evenodd",
|
|
262
262
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
|
|
263
263
|
clipRule: "evenodd"
|
|
264
|
-
})),
|
|
264
|
+
})), ce = /*#__PURE__*/ p.createElement("svg", {
|
|
265
265
|
xmlns: "http://www.w3.org/2000/svg",
|
|
266
266
|
viewBox: "0 0 24 24",
|
|
267
267
|
fill: "currentColor",
|
|
268
268
|
height: "20",
|
|
269
269
|
width: "20",
|
|
270
270
|
"aria-hidden": "true"
|
|
271
|
-
}, /*#__PURE__*/
|
|
271
|
+
}, /*#__PURE__*/ p.createElement("path", {
|
|
272
272
|
fillRule: "evenodd",
|
|
273
273
|
d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
|
|
274
274
|
clipRule: "evenodd"
|
|
275
|
-
})), le = /*#__PURE__*/
|
|
275
|
+
})), le = /*#__PURE__*/ p.createElement("svg", {
|
|
276
276
|
xmlns: "http://www.w3.org/2000/svg",
|
|
277
277
|
viewBox: "0 0 20 20",
|
|
278
278
|
fill: "currentColor",
|
|
279
279
|
height: "20",
|
|
280
280
|
width: "20",
|
|
281
281
|
"aria-hidden": "true"
|
|
282
|
-
}, /*#__PURE__*/
|
|
282
|
+
}, /*#__PURE__*/ p.createElement("path", {
|
|
283
283
|
fillRule: "evenodd",
|
|
284
284
|
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
|
|
285
285
|
clipRule: "evenodd"
|
|
286
|
-
})),
|
|
286
|
+
})), H = /*#__PURE__*/ p.createElement("svg", {
|
|
287
287
|
xmlns: "http://www.w3.org/2000/svg",
|
|
288
288
|
viewBox: "0 0 20 20",
|
|
289
289
|
fill: "currentColor",
|
|
290
290
|
height: "20",
|
|
291
291
|
width: "20",
|
|
292
292
|
"aria-hidden": "true"
|
|
293
|
-
}, /*#__PURE__*/
|
|
293
|
+
}, /*#__PURE__*/ p.createElement("path", {
|
|
294
294
|
fillRule: "evenodd",
|
|
295
295
|
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
|
|
296
296
|
clipRule: "evenodd"
|
|
297
|
-
})), ue = /*#__PURE__*/
|
|
297
|
+
})), ue = /*#__PURE__*/ p.createElement("svg", {
|
|
298
298
|
xmlns: "http://www.w3.org/2000/svg",
|
|
299
299
|
width: "12",
|
|
300
300
|
height: "12",
|
|
@@ -305,25 +305,25 @@ var ae = (e) => {
|
|
|
305
305
|
strokeLinecap: "round",
|
|
306
306
|
strokeLinejoin: "round",
|
|
307
307
|
"aria-hidden": "true"
|
|
308
|
-
}, /*#__PURE__*/
|
|
308
|
+
}, /*#__PURE__*/ p.createElement("line", {
|
|
309
309
|
x1: "18",
|
|
310
310
|
y1: "6",
|
|
311
311
|
x2: "6",
|
|
312
312
|
y2: "18"
|
|
313
|
-
}), /*#__PURE__*/
|
|
313
|
+
}), /*#__PURE__*/ p.createElement("line", {
|
|
314
314
|
x1: "6",
|
|
315
315
|
y1: "6",
|
|
316
316
|
x2: "18",
|
|
317
317
|
y2: "18"
|
|
318
318
|
})), de = () => {
|
|
319
|
-
let [e, t] =
|
|
320
|
-
return
|
|
319
|
+
let [e, t] = p.useState(document.hidden);
|
|
320
|
+
return p.useEffect(() => {
|
|
321
321
|
let e = () => {
|
|
322
322
|
t(document.hidden);
|
|
323
323
|
};
|
|
324
324
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
325
325
|
}, []), e;
|
|
326
|
-
}, fe = 1,
|
|
326
|
+
}, fe = 1, U = 100, pe = (e) => typeof e?.id == "number" || e?.id?.length > 0 ? e.id : fe++, W = new class {
|
|
327
327
|
constructor() {
|
|
328
328
|
this.subscribe = (e) => (this.subscribers.push(e), this.getActiveToasts().forEach((t) => e(t)), () => {
|
|
329
329
|
let t = this.subscribers.indexOf(e);
|
|
@@ -333,10 +333,10 @@ var ae = (e) => {
|
|
|
333
333
|
}, this.addToast = (e) => {
|
|
334
334
|
this.publish(e), this.toasts = [...this.toasts, e], this.trimHistory();
|
|
335
335
|
}, this.trimHistory = () => {
|
|
336
|
-
let e = this.toasts.length -
|
|
336
|
+
let e = this.toasts.length - U;
|
|
337
337
|
e <= 0 || (this.toasts = this.toasts.filter((t) => e > 0 && this.dismissedToasts.has(t.id) ? (this.dismissedToasts.delete(t.id), e--, !1) : !0));
|
|
338
338
|
}, this.create = (e) => {
|
|
339
|
-
let { message: t, ...n } = e, r =
|
|
339
|
+
let { message: t, ...n } = e, r = pe(e), i = this.pendingDismissals.get(r);
|
|
340
340
|
i !== void 0 && (cancelAnimationFrame(i), this.pendingDismissals.delete(r), this.dismissedToasts.delete(r));
|
|
341
341
|
let a = this.dismissedToasts.has(r), o = e.dismissible === void 0 || e.dismissible;
|
|
342
342
|
return a && (this.dismissedToasts.delete(r), this.toasts = this.toasts.filter((e) => e.id !== r)), !a && this.toasts.find((e) => e.id === r) ? this.toasts = this.toasts.map((n) => n.id === r ? (this.publish({
|
|
@@ -406,14 +406,14 @@ var ae = (e) => {
|
|
|
406
406
|
description: typeof t.description == "function" ? void 0 : t.description
|
|
407
407
|
}));
|
|
408
408
|
let r = Promise.resolve(e instanceof Function ? e() : e), i = n !== void 0, a, o = r.then(async (e) => {
|
|
409
|
-
if (a = ["resolve", e],
|
|
409
|
+
if (a = ["resolve", e], p.isValidElement(e)) i = !1, this.create({
|
|
410
410
|
id: n,
|
|
411
411
|
type: "default",
|
|
412
412
|
message: e
|
|
413
413
|
});
|
|
414
414
|
else if (me(e) && !e.ok) {
|
|
415
415
|
i = !1;
|
|
416
|
-
let r = typeof t.error == "function" ? await t.error(`HTTP error! status: ${e.status}`) : t.error, a = typeof t.description == "function" ? await t.description(`HTTP error! status: ${e.status}`) : t.description, o = typeof r == "object" && !
|
|
416
|
+
let r = typeof t.error == "function" ? await t.error(`HTTP error! status: ${e.status}`) : t.error, a = typeof t.description == "function" ? await t.description(`HTTP error! status: ${e.status}`) : t.description, o = typeof r == "object" && !p.isValidElement(r) ? r : { message: r };
|
|
417
417
|
this.create({
|
|
418
418
|
id: n,
|
|
419
419
|
type: "error",
|
|
@@ -422,7 +422,7 @@ var ae = (e) => {
|
|
|
422
422
|
});
|
|
423
423
|
} else if (e instanceof Error) {
|
|
424
424
|
i = !1;
|
|
425
|
-
let r = typeof t.error == "function" ? await t.error(e) : t.error, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !
|
|
425
|
+
let r = typeof t.error == "function" ? await t.error(e) : t.error, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !p.isValidElement(r) ? r : { message: r };
|
|
426
426
|
this.create({
|
|
427
427
|
id: n,
|
|
428
428
|
type: "error",
|
|
@@ -431,7 +431,7 @@ var ae = (e) => {
|
|
|
431
431
|
});
|
|
432
432
|
} else if (t.success !== void 0) {
|
|
433
433
|
i = !1;
|
|
434
|
-
let r = typeof t.success == "function" ? await t.success(e) : t.success, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !
|
|
434
|
+
let r = typeof t.success == "function" ? await t.success(e) : t.success, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !p.isValidElement(r) ? r : { message: r };
|
|
435
435
|
this.create({
|
|
436
436
|
id: n,
|
|
437
437
|
type: "success",
|
|
@@ -442,7 +442,7 @@ var ae = (e) => {
|
|
|
442
442
|
}).catch(async (e) => {
|
|
443
443
|
if (a = ["reject", e], t.error !== void 0) {
|
|
444
444
|
i = !1;
|
|
445
|
-
let r = typeof t.error == "function" ? await t.error(e) : t.error, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !
|
|
445
|
+
let r = typeof t.error == "function" ? await t.error(e) : t.error, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !p.isValidElement(r) ? r : { message: r };
|
|
446
446
|
this.create({
|
|
447
447
|
id: n,
|
|
448
448
|
type: "error",
|
|
@@ -455,7 +455,7 @@ var ae = (e) => {
|
|
|
455
455
|
}), s = () => new Promise((e, t) => o.then(() => a[0] === "reject" ? t(a[1]) : e(a[1])).catch(t));
|
|
456
456
|
return typeof n != "string" && typeof n != "number" ? { unwrap: s } : Object.assign(n, { unwrap: s });
|
|
457
457
|
}, this.custom = (e, t) => {
|
|
458
|
-
let n =
|
|
458
|
+
let n = pe(t);
|
|
459
459
|
return this.create({
|
|
460
460
|
...t,
|
|
461
461
|
jsx: e(n),
|
|
@@ -464,25 +464,25 @@ var ae = (e) => {
|
|
|
464
464
|
}), n;
|
|
465
465
|
}, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set(), this.pendingDismissals = /* @__PURE__ */ new Map();
|
|
466
466
|
}
|
|
467
|
-
}(),
|
|
468
|
-
success:
|
|
469
|
-
info:
|
|
470
|
-
warning:
|
|
471
|
-
error:
|
|
472
|
-
custom:
|
|
473
|
-
message:
|
|
474
|
-
promise:
|
|
475
|
-
dismiss:
|
|
476
|
-
loading:
|
|
467
|
+
}(), G = (e, t) => W.message(e, t), me = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", he = Object.assign(G, {
|
|
468
|
+
success: W.success,
|
|
469
|
+
info: W.info,
|
|
470
|
+
warning: W.warning,
|
|
471
|
+
error: W.error,
|
|
472
|
+
custom: W.custom,
|
|
473
|
+
message: W.message,
|
|
474
|
+
promise: W.promise,
|
|
475
|
+
dismiss: W.dismiss,
|
|
476
|
+
loading: W.loading
|
|
477
477
|
}, {
|
|
478
|
-
getHistory: () =>
|
|
479
|
-
getToasts: () =>
|
|
478
|
+
getHistory: () => W.toasts,
|
|
479
|
+
getToasts: () => W.getActiveToasts()
|
|
480
480
|
});
|
|
481
|
-
function
|
|
481
|
+
function K(e) {
|
|
482
482
|
return e.label !== void 0;
|
|
483
483
|
}
|
|
484
|
-
var
|
|
485
|
-
function
|
|
484
|
+
var q = 3, J = "24px", ge = "16px", _e = 4e3, Y = 356, ve = 14, ye = 45, be = 200;
|
|
485
|
+
function X(...e) {
|
|
486
486
|
return e.filter(Boolean).join(" ");
|
|
487
487
|
}
|
|
488
488
|
function xe(e) {
|
|
@@ -490,27 +490,27 @@ function xe(e) {
|
|
|
490
490
|
return t && r.push(t), n && r.push(n), r;
|
|
491
491
|
}
|
|
492
492
|
var Se = (e) => {
|
|
493
|
-
let { invert: t, toast: n, unstyled: r, interacting: i, setHeights: a, visibleToasts: o, heights: s, index: c, toasts: l, expanded:
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
}, [
|
|
497
|
-
|
|
498
|
-
}, []),
|
|
499
|
-
let e =
|
|
493
|
+
let { invert: t, toast: n, unstyled: r, interacting: i, setHeights: a, visibleToasts: o, heights: s, index: c, toasts: l, expanded: u, removeToast: d, defaultRichColors: f, closeButton: m, style: h, cancelButtonStyle: ee, actionButtonStyle: g, className: _ = "", descriptionClassName: te = "", duration: v, position: y, gap: ne, expandByDefault: b, classNames: x, icons: S, closeButtonAriaLabel: C = "Close toast" } = e, [w, T] = p.useState(null), [E, D] = p.useState(null), [O, k] = p.useState(!1), [A, j] = p.useState(!1), [M, N] = p.useState(!1), [P, F] = p.useState(!1), [I, L] = p.useState(!1), [R, z] = p.useState(0), [re, ie] = p.useState(0), B = p.useRef(n.duration || v || _e), oe = p.useRef(null), V = p.useRef(null), ce = c === 0, le = c + 1 <= o, H = n.type, fe = H ?? "default", U = n.dismissible !== !1, pe = n.className || "", W = n.descriptionClassName || "", G = p.useMemo(() => s.findIndex((e) => e.toastId === n.id) || 0, [s, n.id]), me = p.useMemo(() => n.closeButton ?? m, [n.closeButton, m]), he = p.useMemo(() => n.duration || v || _e, [n.duration, v]), q = p.useRef(0), J = p.useRef(0), ge = p.useRef(0), Y = p.useRef(null), [ve, Se] = y.split("-"), Ce = p.useMemo(() => s.reduce((e, t, n) => n >= G ? e : e + t.height, 0), [s, G]), we = de(), Z = p.useMemo(() => e.swipeDirections ?? xe(y), [e.swipeDirections, y]), Te = n.invert || t, Q = H === "loading";
|
|
494
|
+
J.current = p.useMemo(() => G * ne + Ce, [G, Ce]), p.useEffect(() => {
|
|
495
|
+
B.current = he;
|
|
496
|
+
}, [he]), p.useEffect(() => {
|
|
497
|
+
k(!0);
|
|
498
|
+
}, []), p.useEffect(() => {
|
|
499
|
+
let e = V.current;
|
|
500
500
|
if (e) {
|
|
501
501
|
let t = e.getBoundingClientRect().height;
|
|
502
|
-
return
|
|
502
|
+
return ie(t), a((e) => [{
|
|
503
503
|
toastId: n.id,
|
|
504
504
|
height: t,
|
|
505
505
|
position: n.position
|
|
506
506
|
}, ...e]), () => a((e) => e.filter((e) => e.toastId !== n.id));
|
|
507
507
|
}
|
|
508
|
-
}, [a, n.id]),
|
|
509
|
-
if (!
|
|
510
|
-
let e =
|
|
508
|
+
}, [a, n.id]), p.useLayoutEffect(() => {
|
|
509
|
+
if (!O) return;
|
|
510
|
+
let e = V.current, t = e.style.height;
|
|
511
511
|
e.style.height = "auto";
|
|
512
512
|
let r = e.getBoundingClientRect().height;
|
|
513
|
-
e.style.height = t,
|
|
513
|
+
e.style.height = t, ie(r), a((e) => e.find((e) => e.toastId === n.id) ? e.map((e) => e.toastId === n.id ? {
|
|
514
514
|
...e,
|
|
515
515
|
height: r
|
|
516
516
|
} : e) : [{
|
|
@@ -519,7 +519,7 @@ var Se = (e) => {
|
|
|
519
519
|
position: n.position
|
|
520
520
|
}, ...e]);
|
|
521
521
|
}, [
|
|
522
|
-
|
|
522
|
+
O,
|
|
523
523
|
n.title,
|
|
524
524
|
n.description,
|
|
525
525
|
a,
|
|
@@ -528,173 +528,173 @@ var Se = (e) => {
|
|
|
528
528
|
n.action,
|
|
529
529
|
n.cancel
|
|
530
530
|
]);
|
|
531
|
-
let
|
|
532
|
-
|
|
533
|
-
|
|
531
|
+
let $ = p.useCallback(() => {
|
|
532
|
+
j(!0), z(J.current), a((e) => e.filter((e) => e.toastId !== n.id)), setTimeout(() => {
|
|
533
|
+
d(n);
|
|
534
534
|
}, be);
|
|
535
535
|
}, [
|
|
536
536
|
n,
|
|
537
|
-
|
|
537
|
+
d,
|
|
538
538
|
a,
|
|
539
|
-
|
|
539
|
+
J
|
|
540
540
|
]);
|
|
541
|
-
|
|
542
|
-
if (n.promise &&
|
|
541
|
+
p.useEffect(() => {
|
|
542
|
+
if (n.promise && H === "loading" || n.duration === Infinity || n.type === "loading") return;
|
|
543
543
|
let e;
|
|
544
|
-
return
|
|
545
|
-
if (
|
|
546
|
-
let e = (/* @__PURE__ */ new Date()).getTime() -
|
|
547
|
-
|
|
544
|
+
return u || i || we ? (() => {
|
|
545
|
+
if (ge.current < q.current) {
|
|
546
|
+
let e = (/* @__PURE__ */ new Date()).getTime() - q.current;
|
|
547
|
+
B.current -= e;
|
|
548
548
|
}
|
|
549
|
-
|
|
550
|
-
})() :
|
|
551
|
-
n.onAutoClose == null || n.onAutoClose.call(n, n),
|
|
552
|
-
},
|
|
549
|
+
ge.current = (/* @__PURE__ */ new Date()).getTime();
|
|
550
|
+
})() : B.current !== Infinity && (q.current = (/* @__PURE__ */ new Date()).getTime(), e = setTimeout(() => {
|
|
551
|
+
n.onAutoClose == null || n.onAutoClose.call(n, n), $();
|
|
552
|
+
}, B.current)), () => clearTimeout(e);
|
|
553
553
|
}, [
|
|
554
|
-
|
|
554
|
+
u,
|
|
555
555
|
i,
|
|
556
556
|
n,
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
]),
|
|
561
|
-
n.delete && (
|
|
562
|
-
}, [
|
|
563
|
-
function
|
|
564
|
-
return
|
|
565
|
-
className:
|
|
566
|
-
"data-visible":
|
|
567
|
-
},
|
|
568
|
-
className:
|
|
569
|
-
visible:
|
|
557
|
+
H,
|
|
558
|
+
we,
|
|
559
|
+
$
|
|
560
|
+
]), p.useEffect(() => {
|
|
561
|
+
n.delete && ($(), n.onDismiss == null || n.onDismiss.call(n, n));
|
|
562
|
+
}, [$, n.delete]);
|
|
563
|
+
function Ee() {
|
|
564
|
+
return S?.loading ? /*#__PURE__*/ p.createElement("div", {
|
|
565
|
+
className: X(x?.loader, n?.classNames?.loader, "sonner-loader"),
|
|
566
|
+
"data-visible": H === "loading"
|
|
567
|
+
}, S.loading) : /*#__PURE__*/ p.createElement(se, {
|
|
568
|
+
className: X(x?.loader, n?.classNames?.loader),
|
|
569
|
+
visible: H === "loading"
|
|
570
570
|
});
|
|
571
571
|
}
|
|
572
|
-
let
|
|
573
|
-
return /*#__PURE__*/
|
|
572
|
+
let De = n.icon || S?.[H] || ae(H);
|
|
573
|
+
return /*#__PURE__*/ p.createElement("li", {
|
|
574
574
|
tabIndex: 0,
|
|
575
|
-
ref:
|
|
576
|
-
className:
|
|
575
|
+
ref: V,
|
|
576
|
+
className: X(_, pe, x?.toast, n?.classNames?.toast, x?.[fe], n?.classNames?.[fe]),
|
|
577
577
|
"data-sonner-toast": "",
|
|
578
|
-
"data-rich-colors": n.richColors ??
|
|
578
|
+
"data-rich-colors": n.richColors ?? f,
|
|
579
579
|
"data-styled": !(n.jsx || n.unstyled || r),
|
|
580
|
-
"data-mounted":
|
|
580
|
+
"data-mounted": O,
|
|
581
581
|
"data-promise": !!n.promise,
|
|
582
|
-
"data-swiped":
|
|
583
|
-
"data-removed":
|
|
584
|
-
"data-visible":
|
|
585
|
-
"data-y-position":
|
|
586
|
-
"data-x-position":
|
|
582
|
+
"data-swiped": I,
|
|
583
|
+
"data-removed": A,
|
|
584
|
+
"data-visible": le,
|
|
585
|
+
"data-y-position": ve,
|
|
586
|
+
"data-x-position": Se,
|
|
587
587
|
"data-index": c,
|
|
588
|
-
"data-front":
|
|
589
|
-
"data-swiping":
|
|
590
|
-
"data-dismissible":
|
|
591
|
-
"data-type":
|
|
592
|
-
"data-invert":
|
|
593
|
-
"data-swipe-out":
|
|
594
|
-
"data-swipe-direction":
|
|
595
|
-
"data-expanded": !!(
|
|
588
|
+
"data-front": ce,
|
|
589
|
+
"data-swiping": M,
|
|
590
|
+
"data-dismissible": U,
|
|
591
|
+
"data-type": H,
|
|
592
|
+
"data-invert": Te,
|
|
593
|
+
"data-swipe-out": P,
|
|
594
|
+
"data-swipe-direction": E,
|
|
595
|
+
"data-expanded": !!(u || b && O),
|
|
596
596
|
"data-testid": n.testId,
|
|
597
597
|
style: {
|
|
598
598
|
"--index": c,
|
|
599
599
|
"--toasts-before": c,
|
|
600
600
|
"--z-index": l.length - c,
|
|
601
|
-
"--offset": `${
|
|
602
|
-
"--initial-height":
|
|
601
|
+
"--offset": `${A ? R : J.current}px`,
|
|
602
|
+
"--initial-height": b ? "auto" : `${re}px`,
|
|
603
603
|
...h,
|
|
604
604
|
...n.style
|
|
605
605
|
},
|
|
606
606
|
onDragEnd: () => {
|
|
607
|
-
|
|
607
|
+
N(!1), T(null), Y.current = null;
|
|
608
608
|
},
|
|
609
609
|
onPointerDown: (e) => {
|
|
610
|
-
e.button !== 2 && !
|
|
610
|
+
e.button !== 2 && !Q && U && (oe.current = /* @__PURE__ */ new Date(), z(J.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (N(!0), Y.current = {
|
|
611
611
|
x: e.clientX,
|
|
612
612
|
y: e.clientY
|
|
613
613
|
}));
|
|
614
614
|
},
|
|
615
615
|
onPointerUp: () => {
|
|
616
|
-
if (
|
|
617
|
-
|
|
618
|
-
let e = Number(
|
|
619
|
-
if ((
|
|
616
|
+
if (P || !U) return;
|
|
617
|
+
Y.current = null;
|
|
618
|
+
let e = Number(V.current?.style.getPropertyValue("--swipe-amount-x").replace("px", "") || 0), t = Number(V.current?.style.getPropertyValue("--swipe-amount-y").replace("px", "") || 0), r = (/* @__PURE__ */ new Date()).getTime() - oe.current?.getTime(), i = w === "x" ? e : t, a = Math.abs(i) / r;
|
|
619
|
+
if ((w === "x" ? Z.includes(e > 0 ? "right" : "left") : Z.includes(t > 0 ? "bottom" : "top")) && (Math.abs(i) >= ye || a > .11)) z(J.current), n.onDismiss == null || n.onDismiss.call(n, n), D(w === "x" ? e > 0 ? "right" : "left" : t > 0 ? "down" : "up"), $(), F(!0);
|
|
620
620
|
else {
|
|
621
621
|
var o, s;
|
|
622
|
-
(o =
|
|
622
|
+
(o = V.current) == null || o.style.setProperty("--swipe-amount-x", "0px"), (s = V.current) == null || s.style.setProperty("--swipe-amount-y", "0px"), L(!1), N(!1), T(null);
|
|
623
623
|
}
|
|
624
624
|
},
|
|
625
625
|
onPointerMove: (e) => {
|
|
626
626
|
var t, n;
|
|
627
|
-
if (!
|
|
628
|
-
let r = e.clientY -
|
|
629
|
-
!
|
|
627
|
+
if (!Y.current || !U || window.getSelection()?.toString().length > 0) return;
|
|
628
|
+
let r = e.clientY - Y.current.y, i = e.clientX - Y.current.x;
|
|
629
|
+
!w && (Math.abs(i) > 1 || Math.abs(r) > 1) && T(Math.abs(i) > Math.abs(r) ? "x" : "y");
|
|
630
630
|
let a = {
|
|
631
631
|
x: 0,
|
|
632
632
|
y: 0
|
|
633
633
|
}, o = (e) => 1 / (1.5 + Math.abs(e) / 20);
|
|
634
|
-
if (
|
|
635
|
-
if (
|
|
636
|
-
if (
|
|
634
|
+
if (w === "y") {
|
|
635
|
+
if (Z.includes("top") || Z.includes("bottom")) {
|
|
636
|
+
if (Z.includes("top") && r < 0 || Z.includes("bottom") && r > 0) a.y = r;
|
|
637
637
|
else {
|
|
638
638
|
let e = r * o(r);
|
|
639
639
|
a.y = Math.abs(e) < Math.abs(r) ? e : r;
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
} else if (
|
|
643
|
-
if (
|
|
642
|
+
} else if (w === "x" && (Z.includes("left") || Z.includes("right"))) {
|
|
643
|
+
if (Z.includes("left") && i < 0 || Z.includes("right") && i > 0) a.x = i;
|
|
644
644
|
else {
|
|
645
645
|
let e = i * o(i);
|
|
646
646
|
a.x = Math.abs(e) < Math.abs(i) ? e : i;
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
(Math.abs(a.x) > 0 || Math.abs(a.y) > 0) &&
|
|
649
|
+
(Math.abs(a.x) > 0 || Math.abs(a.y) > 0) && L(!0), (t = V.current) == null || t.style.setProperty("--swipe-amount-x", `${a.x}px`), (n = V.current) == null || n.style.setProperty("--swipe-amount-y", `${a.y}px`);
|
|
650
650
|
}
|
|
651
|
-
},
|
|
652
|
-
"aria-label":
|
|
653
|
-
"data-disabled":
|
|
651
|
+
}, me && !n.jsx && H !== "loading" ? /*#__PURE__*/ p.createElement("button", {
|
|
652
|
+
"aria-label": C,
|
|
653
|
+
"data-disabled": Q,
|
|
654
654
|
"data-close-button": !0,
|
|
655
|
-
onClick:
|
|
656
|
-
|
|
655
|
+
onClick: Q || !U ? () => {} : () => {
|
|
656
|
+
$(), n.onDismiss == null || n.onDismiss.call(n, n);
|
|
657
657
|
},
|
|
658
|
-
className:
|
|
659
|
-
},
|
|
658
|
+
className: X(x?.closeButton, n?.classNames?.closeButton)
|
|
659
|
+
}, S?.close ?? ue) : null, (H || n.icon || n.promise) && n.icon !== null && (S?.[H] !== null || n.icon) ? /*#__PURE__*/ p.createElement("div", {
|
|
660
660
|
"data-icon": "",
|
|
661
|
-
className:
|
|
662
|
-
},
|
|
661
|
+
className: X(x?.icon, n?.classNames?.icon)
|
|
662
|
+
}, H === "loading" ? n.icon || Ee() : n.promise ? Ee() : null, H === "loading" ? null : De) : null, /*#__PURE__*/ p.createElement("div", {
|
|
663
663
|
"data-content": "",
|
|
664
|
-
className:
|
|
665
|
-
}, /*#__PURE__*/
|
|
664
|
+
className: X(x?.content, n?.classNames?.content)
|
|
665
|
+
}, /*#__PURE__*/ p.createElement("div", {
|
|
666
666
|
"data-title": "",
|
|
667
|
-
className:
|
|
668
|
-
}, n.jsx ? n.jsx : typeof n.title == "function" ? n.title() : n.title), n.description ? /*#__PURE__*/
|
|
667
|
+
className: X(x?.title, n?.classNames?.title)
|
|
668
|
+
}, n.jsx ? n.jsx : typeof n.title == "function" ? n.title() : n.title), n.description ? /*#__PURE__*/ p.createElement("div", {
|
|
669
669
|
"data-description": "",
|
|
670
|
-
className:
|
|
671
|
-
}, typeof n.description == "function" ? n.description() : n.description) : null), /*#__PURE__*/
|
|
670
|
+
className: X(te, W, x?.description, n?.classNames?.description)
|
|
671
|
+
}, typeof n.description == "function" ? n.description() : n.description) : null), /*#__PURE__*/ p.isValidElement(n.cancel) ? n.cancel : n.cancel && K(n.cancel) ? /*#__PURE__*/ p.createElement("button", {
|
|
672
672
|
"data-button": !0,
|
|
673
673
|
"data-cancel": !0,
|
|
674
674
|
style: n.cancelButtonStyle || ee,
|
|
675
675
|
onClick: (e) => {
|
|
676
|
-
|
|
676
|
+
K(n.cancel) && U && (n.cancel.onClick == null || n.cancel.onClick.call(n.cancel, e), $());
|
|
677
677
|
},
|
|
678
|
-
className:
|
|
679
|
-
}, n.cancel.label) : null, /*#__PURE__*/
|
|
678
|
+
className: X(x?.cancelButton, n?.classNames?.cancelButton)
|
|
679
|
+
}, n.cancel.label) : null, /*#__PURE__*/ p.isValidElement(n.action) ? n.action : n.action && K(n.action) ? /*#__PURE__*/ p.createElement("button", {
|
|
680
680
|
"data-button": !0,
|
|
681
681
|
"data-action": !0,
|
|
682
682
|
style: n.actionButtonStyle || g,
|
|
683
683
|
onClick: (e) => {
|
|
684
|
-
|
|
684
|
+
K(n.action) && (n.action.onClick == null || n.action.onClick.call(n.action, e), e.defaultPrevented || $());
|
|
685
685
|
},
|
|
686
|
-
className:
|
|
686
|
+
className: X(x?.actionButton, n?.classNames?.actionButton)
|
|
687
687
|
}, n.action.label) : null);
|
|
688
688
|
};
|
|
689
|
-
function
|
|
689
|
+
function Ce() {
|
|
690
690
|
if (typeof window > "u" || typeof document > "u") return "ltr";
|
|
691
691
|
let e = document.documentElement.getAttribute("dir");
|
|
692
692
|
return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function we(e, t) {
|
|
695
695
|
let n = {};
|
|
696
696
|
return [e, t].forEach((e, t) => {
|
|
697
|
-
let r = t === 1, i = r ? "--mobile-offset" : "--offset", a = r ?
|
|
697
|
+
let r = t === 1, i = r ? "--mobile-offset" : "--offset", a = r ? ge : J;
|
|
698
698
|
function o(e) {
|
|
699
699
|
[
|
|
700
700
|
"top",
|
|
@@ -715,19 +715,19 @@ function Ce(e, t) {
|
|
|
715
715
|
}) : o(a);
|
|
716
716
|
}), n;
|
|
717
717
|
}
|
|
718
|
-
var
|
|
719
|
-
let { id: n, invert: r, position: i = "bottom-right", hotkey: a = ["altKey", "KeyT"], expand: o, closeButton: s, className: c, offset: l, mobileOffset:
|
|
720
|
-
|
|
718
|
+
var Z = /*#__PURE__*/ p.forwardRef(function(e, t) {
|
|
719
|
+
let { id: n, invert: r, position: i = "bottom-right", hotkey: a = ["altKey", "KeyT"], expand: o, closeButton: s, className: c, offset: l, mobileOffset: u, theme: d = "light", richColors: f, duration: m, style: h, visibleToasts: ee = q, toastOptions: g, dir: _ = Ce(), gap: te = ve, icons: v, customAriaLabel: y, containerAriaLabel: ne = "Notifications" } = e, [b, x] = p.useState([]), S = p.useMemo(() => n ? b.filter((e) => e.toasterId === n) : b.filter((e) => !e.toasterId), [b, n]), C = p.useMemo(() => Array.from(new Set([i].concat(S.filter((e) => e.position).map((e) => e.position)))), [S, i]), [w, T] = p.useState([]), [E, D] = p.useState(!1), [k, A] = p.useState(!1), [j, M] = p.useState(d === "system" ? typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : d), N = p.useRef(null), P = a.join("+").replace(/Key/g, "").replace(/Digit/g, ""), F = p.useRef(null), I = p.useRef(!1), L = p.useCallback((e) => {
|
|
720
|
+
x((t) => (t.find((t) => t.id === e.id)?.delete || W.dismiss(e.id), t.filter(({ id: t }) => t !== e.id)));
|
|
721
721
|
}, []);
|
|
722
|
-
return
|
|
722
|
+
return p.useEffect(() => W.subscribe((e) => {
|
|
723
723
|
e.dismiss ? requestAnimationFrame(() => {
|
|
724
|
-
|
|
724
|
+
x((t) => t.map((t) => t.id === e.id ? {
|
|
725
725
|
...t,
|
|
726
726
|
delete: !0
|
|
727
727
|
} : t));
|
|
728
728
|
}) : setTimeout(() => {
|
|
729
|
-
|
|
730
|
-
|
|
729
|
+
O.flushSync(() => {
|
|
730
|
+
x((t) => {
|
|
731
731
|
let n = t.findIndex((t) => t.id === e.id);
|
|
732
732
|
return n === -1 ? [e, ...t] : [
|
|
733
733
|
...t.slice(0, n),
|
|
@@ -740,98 +740,98 @@ var we = /*#__PURE__*/ u.forwardRef(function(e, t) {
|
|
|
740
740
|
});
|
|
741
741
|
});
|
|
742
742
|
});
|
|
743
|
-
}), []),
|
|
744
|
-
if (
|
|
745
|
-
|
|
743
|
+
}), []), p.useEffect(() => {
|
|
744
|
+
if (d !== "system") {
|
|
745
|
+
M(d);
|
|
746
746
|
return;
|
|
747
747
|
}
|
|
748
|
-
if (
|
|
748
|
+
if (d === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? M("dark") : M("light")), typeof window > "u") return;
|
|
749
749
|
let e = window.matchMedia("(prefers-color-scheme: dark)");
|
|
750
750
|
try {
|
|
751
751
|
e.addEventListener("change", ({ matches: e }) => {
|
|
752
|
-
|
|
752
|
+
M(e ? "dark" : "light");
|
|
753
753
|
});
|
|
754
754
|
} catch {
|
|
755
755
|
e.addListener(({ matches: e }) => {
|
|
756
756
|
try {
|
|
757
|
-
|
|
757
|
+
M(e ? "dark" : "light");
|
|
758
758
|
} catch (e) {
|
|
759
759
|
console.error(e);
|
|
760
760
|
}
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
|
-
}, [
|
|
764
|
-
|
|
765
|
-
}, [
|
|
763
|
+
}, [d]), p.useEffect(() => {
|
|
764
|
+
b.length <= 1 && D(!1);
|
|
765
|
+
}, [b]), p.useEffect(() => {
|
|
766
766
|
let e = (e) => {
|
|
767
767
|
if (a.length > 0 && a.every((t) => e[t] || e.code === t)) {
|
|
768
768
|
var t;
|
|
769
|
-
D(!0), (t =
|
|
769
|
+
D(!0), (t = N.current) == null || t.focus();
|
|
770
770
|
}
|
|
771
|
-
e.code === "Escape" && (document.activeElement ===
|
|
771
|
+
e.code === "Escape" && (document.activeElement === N.current || N.current?.contains(document.activeElement)) && D(!1);
|
|
772
772
|
};
|
|
773
773
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
774
|
-
}, [a]),
|
|
775
|
-
if (
|
|
776
|
-
|
|
774
|
+
}, [a]), p.useEffect(() => {
|
|
775
|
+
if (N.current) return () => {
|
|
776
|
+
F.current && (F.current.focus({ preventScroll: !0 }), F.current = null, I.current = !1);
|
|
777
777
|
};
|
|
778
|
-
}, [
|
|
778
|
+
}, [N.current]), /*#__PURE__*/ p.createElement("section", {
|
|
779
779
|
ref: t,
|
|
780
|
-
"aria-label":
|
|
780
|
+
"aria-label": y ?? `${ne} ${P}`,
|
|
781
781
|
tabIndex: -1,
|
|
782
782
|
"aria-live": "polite",
|
|
783
783
|
"aria-relevant": "additions text",
|
|
784
784
|
"aria-atomic": "false",
|
|
785
785
|
suppressHydrationWarning: !0,
|
|
786
786
|
"data-react-aria-top-layer": !0
|
|
787
|
-
},
|
|
787
|
+
}, C.map((t, n) => {
|
|
788
788
|
let [i, a] = t.split("-");
|
|
789
|
-
return
|
|
789
|
+
return S.length ? /*#__PURE__*/ p.createElement("ol", {
|
|
790
790
|
key: t,
|
|
791
|
-
dir: _ === "auto" ?
|
|
791
|
+
dir: _ === "auto" ? Ce() : _,
|
|
792
792
|
tabIndex: -1,
|
|
793
|
-
ref:
|
|
793
|
+
ref: N,
|
|
794
794
|
className: c,
|
|
795
795
|
"data-sonner-toaster": !0,
|
|
796
|
-
"data-sonner-theme":
|
|
796
|
+
"data-sonner-theme": j,
|
|
797
797
|
"data-y-position": i,
|
|
798
798
|
"data-x-position": a,
|
|
799
799
|
style: {
|
|
800
|
-
"--front-toast-height": `${
|
|
801
|
-
"--width": `${
|
|
802
|
-
"--gap": `${
|
|
800
|
+
"--front-toast-height": `${w[0]?.height || 0}px`,
|
|
801
|
+
"--width": `${Y}px`,
|
|
802
|
+
"--gap": `${te}px`,
|
|
803
803
|
...h,
|
|
804
|
-
...
|
|
804
|
+
...we(l, u)
|
|
805
805
|
},
|
|
806
806
|
onBlur: (e) => {
|
|
807
|
-
|
|
807
|
+
I.current && !e.currentTarget.contains(e.relatedTarget) && (I.current = !1, F.current &&= (F.current.focus({ preventScroll: !0 }), null));
|
|
808
808
|
},
|
|
809
809
|
onFocus: (e) => {
|
|
810
|
-
e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" ||
|
|
810
|
+
e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || I.current || (I.current = !0, F.current = e.relatedTarget);
|
|
811
811
|
},
|
|
812
812
|
onMouseEnter: () => D(!0),
|
|
813
813
|
onMouseMove: () => D(!0),
|
|
814
814
|
onMouseLeave: () => {
|
|
815
|
-
|
|
815
|
+
k || D(!1);
|
|
816
816
|
},
|
|
817
817
|
onDragEnd: () => D(!1),
|
|
818
818
|
onPointerDown: (e) => {
|
|
819
|
-
e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" ||
|
|
819
|
+
e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || A(!0);
|
|
820
820
|
},
|
|
821
|
-
onPointerUp: () =>
|
|
822
|
-
},
|
|
821
|
+
onPointerUp: () => A(!1)
|
|
822
|
+
}, S.filter((e) => !e.position && n === 0 || e.position === t).map((n, i) => /*#__PURE__*/ p.createElement(Se, {
|
|
823
823
|
key: n.id,
|
|
824
|
-
icons:
|
|
824
|
+
icons: v,
|
|
825
825
|
index: i,
|
|
826
826
|
toast: n,
|
|
827
|
-
defaultRichColors:
|
|
827
|
+
defaultRichColors: f,
|
|
828
828
|
duration: g?.duration ?? m,
|
|
829
829
|
className: g?.className,
|
|
830
830
|
descriptionClassName: g?.descriptionClassName,
|
|
831
831
|
invert: r,
|
|
832
832
|
visibleToasts: ee,
|
|
833
833
|
closeButton: g?.closeButton ?? s,
|
|
834
|
-
interacting:
|
|
834
|
+
interacting: k,
|
|
835
835
|
position: t,
|
|
836
836
|
style: g?.style,
|
|
837
837
|
unstyled: g?.unstyled,
|
|
@@ -839,51 +839,51 @@ var we = /*#__PURE__*/ u.forwardRef(function(e, t) {
|
|
|
839
839
|
cancelButtonStyle: g?.cancelButtonStyle,
|
|
840
840
|
actionButtonStyle: g?.actionButtonStyle,
|
|
841
841
|
closeButtonAriaLabel: g?.closeButtonAriaLabel,
|
|
842
|
-
removeToast:
|
|
843
|
-
toasts:
|
|
844
|
-
heights:
|
|
845
|
-
setHeights:
|
|
842
|
+
removeToast: L,
|
|
843
|
+
toasts: S.filter((e) => e.position == n.position),
|
|
844
|
+
heights: w.filter((e) => e.position == n.position),
|
|
845
|
+
setHeights: T,
|
|
846
846
|
expandByDefault: o,
|
|
847
|
-
gap:
|
|
848
|
-
expanded:
|
|
847
|
+
gap: te,
|
|
848
|
+
expanded: E,
|
|
849
849
|
swipeDirections: e.swipeDirections
|
|
850
850
|
}))) : null;
|
|
851
851
|
}));
|
|
852
852
|
});
|
|
853
853
|
// packages/feedback/src/toast.tsx
|
|
854
|
-
function Te({ closeButton: e = !0, closeButtonAriaLabel: t = "Dismiss notification", offset: n =
|
|
855
|
-
return /* @__PURE__ */
|
|
856
|
-
...
|
|
854
|
+
function Te({ closeButton: e = !0, closeButtonAriaLabel: t = "Dismiss notification", offset: n = c.xl, mobileOffset: r = c.lg, ...i }) {
|
|
855
|
+
return /* @__PURE__ */ v(Z, {
|
|
856
|
+
...i,
|
|
857
857
|
className: "x7kce61 xkwcdv0 x19hn9gq x350ok5 x1dknavn x1qgcmqu x19j7ixz xgam3oh x7s97pk",
|
|
858
858
|
style: {
|
|
859
|
-
zIndex:
|
|
859
|
+
zIndex: l.popup,
|
|
860
860
|
transitionProperty: "opacity, transform"
|
|
861
861
|
},
|
|
862
862
|
offset: n,
|
|
863
863
|
mobileOffset: r,
|
|
864
864
|
closeButton: e,
|
|
865
865
|
icons: {
|
|
866
|
-
success: /* @__PURE__ */
|
|
866
|
+
success: /* @__PURE__ */ v(b, {
|
|
867
867
|
"aria-hidden": !0,
|
|
868
868
|
className: "xtwnzbg x18utl2x x19m34er x7ixh4y"
|
|
869
869
|
}),
|
|
870
|
-
error: /* @__PURE__ */
|
|
870
|
+
error: /* @__PURE__ */ v(x, {
|
|
871
871
|
"aria-hidden": !0,
|
|
872
872
|
className: "xtwnzbg x18utl2x x19m34er xr5kp14"
|
|
873
873
|
}),
|
|
874
|
-
warning: /* @__PURE__ */
|
|
874
|
+
warning: /* @__PURE__ */ v(w, {
|
|
875
875
|
"aria-hidden": !0,
|
|
876
876
|
className: "xtwnzbg x18utl2x x19m34er x1f9ixgr"
|
|
877
877
|
}),
|
|
878
|
-
info: /* @__PURE__ */
|
|
878
|
+
info: /* @__PURE__ */ v(S, {
|
|
879
879
|
"aria-hidden": !0,
|
|
880
880
|
className: "xtwnzbg x18utl2x x19m34er x153jb6y"
|
|
881
881
|
}),
|
|
882
|
-
loading: /* @__PURE__ */
|
|
882
|
+
loading: /* @__PURE__ */ v(C, {
|
|
883
883
|
"aria-hidden": !0,
|
|
884
884
|
className: "xtwnzbg x18utl2x x19m34er x153jb6y"
|
|
885
885
|
}),
|
|
886
|
-
close: /* @__PURE__ */
|
|
886
|
+
close: /* @__PURE__ */ v(T, {
|
|
887
887
|
"aria-hidden": !0,
|
|
888
888
|
className: "xtwnzbg x18utl2x x19m34er"
|
|
889
889
|
})
|
|
@@ -907,7 +907,7 @@ function Te({ closeButton: e = !0, closeButtonAriaLabel: t = "Dismiss notificati
|
|
|
907
907
|
});
|
|
908
908
|
}
|
|
909
909
|
// packages/feedback/src/async-region.tsx
|
|
910
|
-
var
|
|
910
|
+
var Q = m(void 0), $ = m(!1), Ee = o.delaySeconds * 1e3, De = {
|
|
911
911
|
content: {
|
|
912
912
|
k7Eaqz: "xeuugli",
|
|
913
913
|
kAzted: "x2lwn1j",
|
|
@@ -926,26 +926,26 @@ var Y = d(void 0), X = d(!1), Ee = o.delaySeconds * 1e3, Z = {
|
|
|
926
926
|
k44tkh: "x11hm9ij",
|
|
927
927
|
$$css: !0
|
|
928
928
|
}
|
|
929
|
-
},
|
|
929
|
+
}, Oe = {
|
|
930
930
|
content: null,
|
|
931
|
-
image:
|
|
931
|
+
image: De.imageReveal
|
|
932
932
|
};
|
|
933
|
-
function
|
|
934
|
-
let [r, i] =
|
|
933
|
+
function ke({ identity: e, initialStartedAt: t, children: n }) {
|
|
934
|
+
let [r, i] = _(() => ({
|
|
935
935
|
identity: e,
|
|
936
936
|
startedAt: t ?? Date.now()
|
|
937
937
|
})), a = r;
|
|
938
938
|
return r.identity !== e && (a = {
|
|
939
939
|
identity: e,
|
|
940
940
|
startedAt: Date.now()
|
|
941
|
-
}, i(a)), /* @__PURE__ */
|
|
941
|
+
}, i(a)), /* @__PURE__ */ v(Q, {
|
|
942
942
|
value: a,
|
|
943
943
|
children: n
|
|
944
944
|
});
|
|
945
945
|
}
|
|
946
|
-
function
|
|
947
|
-
let r =
|
|
948
|
-
return
|
|
946
|
+
function Ae({ shouldEnter: e, presentation: t = "content", children: n }) {
|
|
947
|
+
let r = h($), [i, a] = _(e && !r), o = g(null);
|
|
948
|
+
return ee(() => {
|
|
949
949
|
let e = o.current;
|
|
950
950
|
if (!i || e === null) return;
|
|
951
951
|
let t = !0;
|
|
@@ -954,24 +954,24 @@ function $({ shouldEnter: e, presentation: t = "content", children: n }) {
|
|
|
954
954
|
}), () => {
|
|
955
955
|
t = !1;
|
|
956
956
|
};
|
|
957
|
-
}, [i]), /* @__PURE__ */
|
|
957
|
+
}, [i]), /* @__PURE__ */ v("div", {
|
|
958
958
|
ref: o,
|
|
959
|
-
...
|
|
960
|
-
children: /* @__PURE__ */
|
|
959
|
+
...f.props(De.content, i && De.reveal, Oe[t]),
|
|
960
|
+
children: /* @__PURE__ */ v($, {
|
|
961
961
|
value: r || i,
|
|
962
962
|
children: n
|
|
963
963
|
})
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
|
-
function
|
|
967
|
-
let [i, a] =
|
|
968
|
-
return
|
|
966
|
+
function je({ label: e, placeholder: t, startedAt: n, presentation: r }) {
|
|
967
|
+
let [i, a] = _(() => Date.now() - n >= Ee ? n : void 0), o = i === n, s = r === "image";
|
|
968
|
+
return ee(() => {
|
|
969
969
|
let e = Math.max(0, Ee - (Date.now() - n)), t = setTimeout(() => a(n), e);
|
|
970
970
|
return () => clearTimeout(t);
|
|
971
|
-
}, [n]), /* @__PURE__ */
|
|
971
|
+
}, [n]), /* @__PURE__ */ y(te, { children: [/* @__PURE__ */ v("div", {
|
|
972
972
|
"aria-busy": !0,
|
|
973
973
|
className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
|
|
974
|
-
children: /* @__PURE__ */
|
|
974
|
+
children: /* @__PURE__ */ v("div", {
|
|
975
975
|
"aria-hidden": !0,
|
|
976
976
|
inert: !0,
|
|
977
977
|
...{
|
|
@@ -979,17 +979,17 @@ function Oe({ label: e, placeholder: t, startedAt: n, presentation: r }) {
|
|
|
979
979
|
2: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xlshs6z x18usnwx" },
|
|
980
980
|
1: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xqcmdr3 x1qme5af x1c3o69q x18usnwx" },
|
|
981
981
|
3: { className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu xlshs6z xqcmdr3 x1qme5af x1c3o69q x18usnwx" }
|
|
982
|
-
}[!(
|
|
982
|
+
}[!(s || o) << 1 | !(s || !o)],
|
|
983
983
|
children: t
|
|
984
984
|
})
|
|
985
|
-
}), o && /* @__PURE__ */
|
|
985
|
+
}), o && /* @__PURE__ */ v("span", {
|
|
986
986
|
role: "status",
|
|
987
|
-
...
|
|
987
|
+
...f.props(u.hidden),
|
|
988
988
|
children: e
|
|
989
989
|
})] });
|
|
990
990
|
}
|
|
991
|
-
function
|
|
992
|
-
let t =
|
|
991
|
+
function Me(e) {
|
|
992
|
+
let t = h(Q), [n, r] = _(() => ({
|
|
993
993
|
state: e.state,
|
|
994
994
|
scope: t,
|
|
995
995
|
startedAt: t?.startedAt ?? Date.now(),
|
|
@@ -1004,21 +1004,21 @@ function ke(e) {
|
|
|
1004
1004
|
wasPending: e.state === "pending" || !a && n.wasPending
|
|
1005
1005
|
}, r(i);
|
|
1006
1006
|
}
|
|
1007
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ v("div", {
|
|
1008
1008
|
className: "x1n2onr6 xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
|
|
1009
|
-
children: e.state === "pending" ? /* @__PURE__ */
|
|
1009
|
+
children: e.state === "pending" ? /* @__PURE__ */ v(je, {
|
|
1010
1010
|
label: e.label,
|
|
1011
1011
|
placeholder: e.placeholder,
|
|
1012
1012
|
startedAt: i.startedAt,
|
|
1013
1013
|
presentation: e.presentation ?? "content"
|
|
1014
|
-
}) : e.state === "failed" ? /* @__PURE__ */
|
|
1014
|
+
}) : e.state === "failed" ? /* @__PURE__ */ v("div", {
|
|
1015
1015
|
className: "xeuugli x2lwn1j x78zum5 xdt5ytf x98rzlu",
|
|
1016
1016
|
children: e.children
|
|
1017
|
-
}) : /* @__PURE__ */
|
|
1017
|
+
}) : /* @__PURE__ */ v(Ae, {
|
|
1018
1018
|
shouldEnter: i.wasPending,
|
|
1019
1019
|
presentation: e.presentation ?? "content",
|
|
1020
1020
|
children: e.children
|
|
1021
1021
|
})
|
|
1022
1022
|
});
|
|
1023
1023
|
}
|
|
1024
|
-
export { he as a,
|
|
1024
|
+
export { he as a, z as c, P as d, F as f, Te as i, re as l, A as m, Ae as n, B as o, k as p, ke as r, ie as s, Me as t, N as u };
|