@mechane-ai/elements 0.11.0 → 0.12.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/README.md +8 -4
- package/dist/ai.js +4 -5
- package/dist/{categorical-values-FYc43JCa.js → categorical-values-CTrHn9jH.js} +2 -2
- package/dist/{chart-frame-Bczk5sWj.js → chart-frame-38ES6kwK.js} +4 -4
- package/dist/{chart-input-CbzVN76m.js → chart-input-C9fu7f1Q.js} +2 -2
- package/dist/charts/cartesian.js +6 -6
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +3 -3
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +2 -2
- package/dist/charts/timeline.js +4 -4
- package/dist/charts.js +1 -1
- package/dist/{code-block-B7xzM3tD.js → code-block-BjV2EFZS.js} +2 -2
- package/dist/collections.js +346 -294
- 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-CatGOrbo.js → content-link-C460m-O7.js} +1 -1
- package/dist/content.js +3 -4
- package/dist/elements.css +133 -80
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +22 -23
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +223 -237
- package/dist/navigation/commands.js +3 -3
- package/dist/overlays.js +1 -1
- package/dist/packages/collections/src/collection-controls.d.ts +1 -1
- package/dist/packages/collections/src/data-table.d.ts +5 -4
- package/dist/packages/collections/src/index.d.ts +1 -1
- package/dist/packages/core/src/actions.d.ts +5 -8
- package/dist/packages/feedback/src/control-placeholders.d.ts +16 -0
- package/dist/packages/feedback/src/index.d.ts +2 -0
- package/dist/packages/forms/src/field-styles.d.ts +2 -74
- package/dist/packages/forms/src/form-actions.d.ts +11 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -1
- package/dist/packages/forms/src/forms.d.ts +3 -3
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/select.d.ts +2 -2
- package/dist/packages/forms/src/selection-styles.d.ts +0 -13
- package/dist/packages/foundations/src/control-styles.d.ts +101 -0
- package/dist/packages/foundations/src/style-composition.d.ts +0 -2
- package/dist/packages/foundations/src/tokens.stylex.d.ts +8 -2
- package/dist/packages/layout/src/frame.stylex.d.ts +0 -1
- package/dist/packages/layout/src/index.d.ts +2 -0
- package/dist/packages/layout/src/page-content.d.ts +5 -0
- package/dist/packages/layout/src/page-toolbar.d.ts +1 -1
- package/dist/packages/layout/src/sidebar.d.ts +3 -3
- package/dist/{pierre-diff--zsiHCCB.js → pierre-diff-sUAU-xeL.js} +1 -1
- package/dist/{pierre-theme-D9hnHv3Z.js → pierre-theme-CBAncKdH.js} +1 -1
- package/dist/{pierre-tree-D47uA7lb.js → pierre-tree-DKN2eGlZ.js} +3 -3
- package/dist/{src-D05isEh_.js → src-3gzujMhN.js} +124 -66
- package/dist/{src-DXsGTJgv.js → src-CI6KtN2w.js} +366 -307
- package/dist/{src-Cs0dRc4X.js → src-CVlgjAlw.js} +1 -1
- package/dist/src-DOzle5d4.js +1199 -0
- package/dist/tokens.js +14 -8
- package/package.json +1 -1
- package/packages/foundations/src/tokens.stylex.ts +13 -5
- package/dist/src-C_heP5kL.js +0 -1264
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { Box as
|
|
9
|
-
import { Meter as
|
|
10
|
-
import { Progress as
|
|
11
|
-
import
|
|
1
|
+
import { O as e, i as t, s as n } from "./src-3gzujMhN.js";
|
|
2
|
+
import { controls as r, layers as i, spacing as a } from "./tokens.js";
|
|
3
|
+
import { t as o } from "./accessibility-C-aIZ1Yx.js";
|
|
4
|
+
import { mergeProps as s } from "@base-ui/react/merge-props";
|
|
5
|
+
import * as c from "@stylexjs/stylex";
|
|
6
|
+
import l, { createContext as ee, useContext as u, useEffect as d, useState as f } from "react";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
|
+
import { Box as h, CircleCheck as g, CircleX as _, Info as v, LoaderCircle as y, TriangleAlert as b, X as te } from "lucide-react";
|
|
9
|
+
import { Meter as x } from "@base-ui/react/meter";
|
|
10
|
+
import { Progress as S } from "@base-ui/react/progress";
|
|
11
|
+
import C from "react-dom";
|
|
12
12
|
// packages/feedback/src/feedback.tsx
|
|
13
|
-
function
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
...
|
|
13
|
+
function w({ title: e, children: r, action: i, ...a }) {
|
|
14
|
+
return /* @__PURE__ */ m("div", {
|
|
15
|
+
...s({ className: "x78zum5 xdt5ytf x6s0dn4 xl56j7k x2b8uid xeuugli x193iq5w x9f619 x9w77qv xnx3t7k x1n8ia3y x1hz01jw xj57cvi xvmahel xj0a0fe" }, a),
|
|
16
16
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ p(h, {
|
|
18
18
|
size: 22,
|
|
19
19
|
"aria-hidden": !0,
|
|
20
20
|
className: "x153jb6y x2lah0s"
|
|
21
21
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
r != null && /* @__PURE__ */
|
|
24
|
-
i != null && /* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ p(n, { children: e }),
|
|
23
|
+
r != null && /* @__PURE__ */ p(t, { children: r }),
|
|
24
|
+
i != null && /* @__PURE__ */ p("div", {
|
|
25
25
|
className: "x78zum5 xl56j7k x1a02dak x1hnptsi xeuugli x193iq5w",
|
|
26
26
|
children: i
|
|
27
27
|
})
|
|
28
28
|
]
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
function T({ error: e = !1, ...t }) {
|
|
32
|
+
return /* @__PURE__ */ p("div", { ...s({ 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 E = {
|
|
39
39
|
skeleton: {
|
|
40
40
|
k1xSpc: "x1lliihq",
|
|
41
41
|
ks0D6T: "x193iq5w",
|
|
@@ -73,23 +73,23 @@ var T = {
|
|
|
73
73
|
k7Eaqz: "xeuugli",
|
|
74
74
|
$$css: !0
|
|
75
75
|
}
|
|
76
|
-
},
|
|
77
|
-
rectangle:
|
|
78
|
-
circle:
|
|
76
|
+
}, ne = {
|
|
77
|
+
rectangle: E.rectangle,
|
|
78
|
+
circle: E.circle
|
|
79
79
|
};
|
|
80
80
|
function D({ width: e = "100%", height: t = 8, shape: n = "rectangle" }) {
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ p("span", {
|
|
82
82
|
"aria-hidden": !0,
|
|
83
|
-
...
|
|
83
|
+
...c.props(E.skeleton, E.dimensions(e, t), ne[n])
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
function O({ lines: e = 1, width: t = "100%" }) {
|
|
87
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ p("span", {
|
|
88
88
|
"aria-hidden": !0,
|
|
89
|
-
...
|
|
90
|
-
children: Array.from({ length: e }, (t, n) => /* @__PURE__ */
|
|
89
|
+
...c.props(E.text, E.width(t)),
|
|
90
|
+
children: Array.from({ length: e }, (t, n) => /* @__PURE__ */ p("span", {
|
|
91
91
|
className: "x78zum5 x6s0dn4 xg2ss61",
|
|
92
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ p(D, {
|
|
93
93
|
width: e > 1 && n === e - 1 ? "65%" : "100%",
|
|
94
94
|
height: "0.6em"
|
|
95
95
|
})
|
|
@@ -97,192 +97,251 @@ function O({ lines: e = 1, width: t = "100%" }) {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
function k({ label: e, showLabel: t = !1 }) {
|
|
100
|
-
return /* @__PURE__ */
|
|
100
|
+
return /* @__PURE__ */ m("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__ */ p(y, {
|
|
104
104
|
"aria-hidden": !0,
|
|
105
105
|
className: "xtwnzbg x18utl2x x2lah0s"
|
|
106
|
-
}), /* @__PURE__ */
|
|
107
|
-
...
|
|
106
|
+
}), /* @__PURE__ */ p("span", {
|
|
107
|
+
...c.props(E.label, !t && o.hidden),
|
|
108
108
|
children: e
|
|
109
109
|
})]
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
+
// packages/feedback/src/control-placeholders.tsx
|
|
113
|
+
var A = {
|
|
114
|
+
ks0D6T: "x193iq5w",
|
|
115
|
+
$$css: !0
|
|
116
|
+
}, re = {
|
|
117
|
+
kZKoxP: "x16ye13r",
|
|
118
|
+
$$css: !0
|
|
119
|
+
}, j = {
|
|
120
|
+
button: {
|
|
121
|
+
kWkggS: "x1r7kqkb",
|
|
122
|
+
kXLuUW: "xxymvpz",
|
|
123
|
+
$$css: !0
|
|
124
|
+
},
|
|
125
|
+
singleLine: {
|
|
126
|
+
k1xSpc: "x78zum5",
|
|
127
|
+
kGNEyG: "x6s0dn4",
|
|
128
|
+
$$css: !0
|
|
129
|
+
},
|
|
130
|
+
width: (e) => [
|
|
131
|
+
A,
|
|
132
|
+
{
|
|
133
|
+
kzqmXN: e == null ? e : "x5lhr3w",
|
|
134
|
+
$$css: !0
|
|
135
|
+
},
|
|
136
|
+
{ "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }
|
|
137
|
+
],
|
|
138
|
+
rows: (e) => [re, { "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(`calc(${e} * 1lh + 2 * ${r.paddingBlock} + 2px)`) }]
|
|
139
|
+
};
|
|
140
|
+
function M({ width: t = "7ch", xstyle: n }) {
|
|
141
|
+
return /* @__PURE__ */ p("span", {
|
|
142
|
+
"aria-hidden": !0,
|
|
143
|
+
...c.props(e.base, e.button, j.button, n),
|
|
144
|
+
children: /* @__PURE__ */ p(O, { width: t })
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function N({ label: t, hint: n, multiline: r = !1, rows: i = 4, width: a = "100%", xstyle: o }) {
|
|
148
|
+
let s = r ? Math.min(i, 6) : 1;
|
|
149
|
+
return /* @__PURE__ */ m("div", {
|
|
150
|
+
"aria-hidden": !0,
|
|
151
|
+
...c.props(e.fieldRoot, j.width(a), o),
|
|
152
|
+
children: [
|
|
153
|
+
t !== void 0 && /* @__PURE__ */ p("span", {
|
|
154
|
+
...c.props(e.label),
|
|
155
|
+
children: t
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ p("div", {
|
|
158
|
+
...c.props(e.base, e.field, !r && j.singleLine, r && e.textarea, r && j.rows(i)),
|
|
159
|
+
children: /* @__PURE__ */ p(O, {
|
|
160
|
+
width: "60%",
|
|
161
|
+
lines: s
|
|
162
|
+
})
|
|
163
|
+
}),
|
|
164
|
+
n !== void 0 && /* @__PURE__ */ p("span", {
|
|
165
|
+
...c.props(e.description),
|
|
166
|
+
children: n
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
});
|
|
170
|
+
}
|
|
112
171
|
// packages/feedback/src/loading.tsx
|
|
113
|
-
function
|
|
114
|
-
return /* @__PURE__ */
|
|
172
|
+
function P({ label: e, shape: t = "rows" }) {
|
|
173
|
+
return /* @__PURE__ */ m("div", {
|
|
115
174
|
role: "status",
|
|
116
175
|
className: "xeuugli x1n2onr6",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
118
|
-
...
|
|
176
|
+
children: [/* @__PURE__ */ p("span", {
|
|
177
|
+
...c.props(o.hidden),
|
|
119
178
|
children: e
|
|
120
|
-
}), t === "rows" ? /* @__PURE__ */
|
|
179
|
+
}), t === "rows" ? /* @__PURE__ */ m("div", {
|
|
121
180
|
"aria-hidden": !0,
|
|
122
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ p("div", {
|
|
123
182
|
className: "xrvj5dj x18zg5m9 x6s0dn4 x9f619 x1hyy85k xso031l x1q0q8m5 x1qndepd",
|
|
124
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ p("div", {
|
|
125
184
|
className: "xeuugli x1m92p3w",
|
|
126
|
-
children: /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ p(D, { width: 54 })
|
|
127
186
|
})
|
|
128
187
|
}), [
|
|
129
188
|
0,
|
|
130
189
|
1,
|
|
131
190
|
2
|
|
132
|
-
].map((e) => /* @__PURE__ */
|
|
191
|
+
].map((e) => /* @__PURE__ */ m("div", {
|
|
133
192
|
className: "xrvj5dj x18zg5m9 x6s0dn4 xb4ss6y x9f619",
|
|
134
193
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ p("div", {
|
|
136
195
|
className: "xeuugli x1m92p3w",
|
|
137
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ p(D, { width: e === 1 ? 108 : 174 })
|
|
138
197
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ p("div", {
|
|
140
199
|
className: "xeuugli x1m92p3w",
|
|
141
|
-
children: /* @__PURE__ */
|
|
200
|
+
children: /* @__PURE__ */ p(D, { width: 54 })
|
|
142
201
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ p("div", {
|
|
144
203
|
className: "xeuugli x1m92p3w",
|
|
145
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ p(D, { width: 108 })
|
|
146
205
|
})
|
|
147
206
|
]
|
|
148
207
|
}, e))]
|
|
149
|
-
}) : /* @__PURE__ */
|
|
208
|
+
}) : /* @__PURE__ */ m("div", {
|
|
150
209
|
"aria-hidden": !0,
|
|
151
210
|
className: "xrvj5dj xaml1ju x1ydxw8w",
|
|
152
211
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ p(D, {
|
|
154
213
|
width: 216,
|
|
155
214
|
height: 24
|
|
156
215
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ p(D, { width: 174 }),
|
|
217
|
+
/* @__PURE__ */ p(D, { width: 108 })
|
|
159
218
|
]
|
|
160
219
|
})]
|
|
161
220
|
});
|
|
162
221
|
}
|
|
163
222
|
// packages/feedback/src/progress.tsx
|
|
164
|
-
function
|
|
165
|
-
return /* @__PURE__ */
|
|
223
|
+
function F({ label: e, value: t, max: n, valueLabel: r }) {
|
|
224
|
+
return /* @__PURE__ */ m(S.Root, {
|
|
166
225
|
value: t,
|
|
167
226
|
max: n,
|
|
168
227
|
locale: "en-US",
|
|
169
228
|
getAriaValueText: () => r,
|
|
170
229
|
className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
|
|
171
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ m("div", {
|
|
172
231
|
className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ p(S.Label, {
|
|
174
233
|
className: "xeuugli x193iq5w",
|
|
175
234
|
children: e
|
|
176
|
-
}), /* @__PURE__ */
|
|
235
|
+
}), /* @__PURE__ */ p("span", {
|
|
177
236
|
className: "xeuugli x193iq5w x153jb6y xss6m8b",
|
|
178
237
|
children: r
|
|
179
238
|
})]
|
|
180
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ p(S.Track, {
|
|
181
240
|
...{
|
|
182
241
|
0: { className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr" },
|
|
183
242
|
1: { className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619" }
|
|
184
243
|
}[t === null | 0],
|
|
185
|
-
children: t !== null && /* @__PURE__ */
|
|
244
|
+
children: t !== null && /* @__PURE__ */ p(S.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
|
|
186
245
|
})]
|
|
187
246
|
});
|
|
188
247
|
}
|
|
189
|
-
function
|
|
190
|
-
return t === null ? /* @__PURE__ */
|
|
248
|
+
function I({ label: e, value: t, max: n, valueLabel: r }) {
|
|
249
|
+
return t === null ? /* @__PURE__ */ m("div", {
|
|
191
250
|
className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ m("div", {
|
|
193
252
|
className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ p("span", {
|
|
195
254
|
className: "xeuugli x193iq5w",
|
|
196
255
|
children: e
|
|
197
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ p("span", {
|
|
198
257
|
className: "xeuugli x193iq5w x153jb6y xss6m8b",
|
|
199
258
|
children: r
|
|
200
259
|
})]
|
|
201
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ p("div", {
|
|
202
261
|
"aria-hidden": !0,
|
|
203
262
|
className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619"
|
|
204
263
|
})]
|
|
205
|
-
}) : /* @__PURE__ */
|
|
264
|
+
}) : /* @__PURE__ */ m(x.Root, {
|
|
206
265
|
value: t,
|
|
207
266
|
max: n,
|
|
208
267
|
locale: "en-US",
|
|
209
268
|
getAriaValueText: () => r,
|
|
210
269
|
className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ m("div", {
|
|
212
271
|
className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ p(x.Label, {
|
|
214
273
|
className: "xeuugli x193iq5w",
|
|
215
274
|
children: e
|
|
216
|
-
}), /* @__PURE__ */
|
|
275
|
+
}), /* @__PURE__ */ p("span", {
|
|
217
276
|
className: "xeuugli x193iq5w x153jb6y xss6m8b",
|
|
218
277
|
children: r
|
|
219
278
|
})]
|
|
220
|
-
}), /* @__PURE__ */
|
|
279
|
+
}), /* @__PURE__ */ p(x.Track, {
|
|
221
280
|
className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr",
|
|
222
|
-
children: /* @__PURE__ */
|
|
281
|
+
children: /* @__PURE__ */ p(x.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
|
|
223
282
|
})]
|
|
224
283
|
});
|
|
225
284
|
}
|
|
226
285
|
// ../../../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
|
|
227
|
-
var
|
|
286
|
+
var ie = (e) => {
|
|
228
287
|
switch (e) {
|
|
229
|
-
case "success": return
|
|
230
|
-
case "info": return
|
|
231
|
-
case "warning": return
|
|
232
|
-
case "error": return
|
|
288
|
+
case "success": return L;
|
|
289
|
+
case "info": return R;
|
|
290
|
+
case "warning": return se;
|
|
291
|
+
case "error": return z;
|
|
233
292
|
default: return null;
|
|
234
293
|
}
|
|
235
|
-
},
|
|
294
|
+
}, ae = Array(12).fill(0), oe = ({ visible: e, className: t }) => /*#__PURE__*/ l.createElement("div", {
|
|
236
295
|
className: ["sonner-loading-wrapper", t].filter(Boolean).join(" "),
|
|
237
296
|
"data-visible": e
|
|
238
|
-
}, /*#__PURE__*/
|
|
297
|
+
}, /*#__PURE__*/ l.createElement("div", { className: "sonner-spinner" }, ae.map((e, t) => /*#__PURE__*/ l.createElement("div", {
|
|
239
298
|
className: "sonner-loading-bar",
|
|
240
299
|
key: `spinner-bar-${t}`
|
|
241
|
-
})))),
|
|
300
|
+
})))), L = /*#__PURE__*/ l.createElement("svg", {
|
|
242
301
|
xmlns: "http://www.w3.org/2000/svg",
|
|
243
302
|
viewBox: "0 0 20 20",
|
|
244
303
|
fill: "currentColor",
|
|
245
304
|
height: "20",
|
|
246
305
|
width: "20",
|
|
247
306
|
"aria-hidden": "true"
|
|
248
|
-
}, /*#__PURE__*/
|
|
307
|
+
}, /*#__PURE__*/ l.createElement("path", {
|
|
249
308
|
fillRule: "evenodd",
|
|
250
309
|
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",
|
|
251
310
|
clipRule: "evenodd"
|
|
252
|
-
})),
|
|
311
|
+
})), se = /*#__PURE__*/ l.createElement("svg", {
|
|
253
312
|
xmlns: "http://www.w3.org/2000/svg",
|
|
254
313
|
viewBox: "0 0 24 24",
|
|
255
314
|
fill: "currentColor",
|
|
256
315
|
height: "20",
|
|
257
316
|
width: "20",
|
|
258
317
|
"aria-hidden": "true"
|
|
259
|
-
}, /*#__PURE__*/
|
|
318
|
+
}, /*#__PURE__*/ l.createElement("path", {
|
|
260
319
|
fillRule: "evenodd",
|
|
261
320
|
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",
|
|
262
321
|
clipRule: "evenodd"
|
|
263
|
-
})),
|
|
322
|
+
})), R = /*#__PURE__*/ l.createElement("svg", {
|
|
264
323
|
xmlns: "http://www.w3.org/2000/svg",
|
|
265
324
|
viewBox: "0 0 20 20",
|
|
266
325
|
fill: "currentColor",
|
|
267
326
|
height: "20",
|
|
268
327
|
width: "20",
|
|
269
328
|
"aria-hidden": "true"
|
|
270
|
-
}, /*#__PURE__*/
|
|
329
|
+
}, /*#__PURE__*/ l.createElement("path", {
|
|
271
330
|
fillRule: "evenodd",
|
|
272
331
|
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",
|
|
273
332
|
clipRule: "evenodd"
|
|
274
|
-
})),
|
|
333
|
+
})), z = /*#__PURE__*/ l.createElement("svg", {
|
|
275
334
|
xmlns: "http://www.w3.org/2000/svg",
|
|
276
335
|
viewBox: "0 0 20 20",
|
|
277
336
|
fill: "currentColor",
|
|
278
337
|
height: "20",
|
|
279
338
|
width: "20",
|
|
280
339
|
"aria-hidden": "true"
|
|
281
|
-
}, /*#__PURE__*/
|
|
340
|
+
}, /*#__PURE__*/ l.createElement("path", {
|
|
282
341
|
fillRule: "evenodd",
|
|
283
342
|
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",
|
|
284
343
|
clipRule: "evenodd"
|
|
285
|
-
})),
|
|
344
|
+
})), ce = /*#__PURE__*/ l.createElement("svg", {
|
|
286
345
|
xmlns: "http://www.w3.org/2000/svg",
|
|
287
346
|
width: "12",
|
|
288
347
|
height: "12",
|
|
@@ -293,25 +352,25 @@ var te = (e) => {
|
|
|
293
352
|
strokeLinecap: "round",
|
|
294
353
|
strokeLinejoin: "round",
|
|
295
354
|
"aria-hidden": "true"
|
|
296
|
-
}, /*#__PURE__*/
|
|
355
|
+
}, /*#__PURE__*/ l.createElement("line", {
|
|
297
356
|
x1: "18",
|
|
298
357
|
y1: "6",
|
|
299
358
|
x2: "6",
|
|
300
359
|
y2: "18"
|
|
301
|
-
}), /*#__PURE__*/
|
|
360
|
+
}), /*#__PURE__*/ l.createElement("line", {
|
|
302
361
|
x1: "6",
|
|
303
362
|
y1: "6",
|
|
304
363
|
x2: "18",
|
|
305
364
|
y2: "18"
|
|
306
|
-
})),
|
|
307
|
-
let [e, t] =
|
|
308
|
-
return
|
|
365
|
+
})), le = () => {
|
|
366
|
+
let [e, t] = l.useState(document.hidden);
|
|
367
|
+
return l.useEffect(() => {
|
|
309
368
|
let e = () => {
|
|
310
369
|
t(document.hidden);
|
|
311
370
|
};
|
|
312
371
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
313
372
|
}, []), e;
|
|
314
|
-
},
|
|
373
|
+
}, B = 1, V = 100, ue = (e) => typeof e?.id == "number" || e?.id?.length > 0 ? e.id : B++, H = new class {
|
|
315
374
|
constructor() {
|
|
316
375
|
this.subscribe = (e) => (this.subscribers.push(e), this.getActiveToasts().forEach((t) => e(t)), () => {
|
|
317
376
|
let t = this.subscribers.indexOf(e);
|
|
@@ -321,10 +380,10 @@ var te = (e) => {
|
|
|
321
380
|
}, this.addToast = (e) => {
|
|
322
381
|
this.publish(e), this.toasts = [...this.toasts, e], this.trimHistory();
|
|
323
382
|
}, this.trimHistory = () => {
|
|
324
|
-
let e = this.toasts.length -
|
|
383
|
+
let e = this.toasts.length - V;
|
|
325
384
|
e <= 0 || (this.toasts = this.toasts.filter((t) => e > 0 && this.dismissedToasts.has(t.id) ? (this.dismissedToasts.delete(t.id), e--, !1) : !0));
|
|
326
385
|
}, this.create = (e) => {
|
|
327
|
-
let { message: t, ...n } = e, r =
|
|
386
|
+
let { message: t, ...n } = e, r = ue(e), i = this.pendingDismissals.get(r);
|
|
328
387
|
i !== void 0 && (cancelAnimationFrame(i), this.pendingDismissals.delete(r), this.dismissedToasts.delete(r));
|
|
329
388
|
let a = this.dismissedToasts.has(r), o = e.dismissible === void 0 || e.dismissible;
|
|
330
389
|
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({
|
|
@@ -394,14 +453,14 @@ var te = (e) => {
|
|
|
394
453
|
description: typeof t.description == "function" ? void 0 : t.description
|
|
395
454
|
}));
|
|
396
455
|
let r = Promise.resolve(e instanceof Function ? e() : e), i = n !== void 0, a, o = r.then(async (e) => {
|
|
397
|
-
if (a = ["resolve", e],
|
|
456
|
+
if (a = ["resolve", e], l.isValidElement(e)) i = !1, this.create({
|
|
398
457
|
id: n,
|
|
399
458
|
type: "default",
|
|
400
459
|
message: e
|
|
401
460
|
});
|
|
402
|
-
else if (
|
|
461
|
+
else if (de(e) && !e.ok) {
|
|
403
462
|
i = !1;
|
|
404
|
-
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" && !
|
|
463
|
+
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" && !l.isValidElement(r) ? r : { message: r };
|
|
405
464
|
this.create({
|
|
406
465
|
id: n,
|
|
407
466
|
type: "error",
|
|
@@ -410,7 +469,7 @@ var te = (e) => {
|
|
|
410
469
|
});
|
|
411
470
|
} else if (e instanceof Error) {
|
|
412
471
|
i = !1;
|
|
413
|
-
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" && !
|
|
472
|
+
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" && !l.isValidElement(r) ? r : { message: r };
|
|
414
473
|
this.create({
|
|
415
474
|
id: n,
|
|
416
475
|
type: "error",
|
|
@@ -419,7 +478,7 @@ var te = (e) => {
|
|
|
419
478
|
});
|
|
420
479
|
} else if (t.success !== void 0) {
|
|
421
480
|
i = !1;
|
|
422
|
-
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" && !
|
|
481
|
+
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" && !l.isValidElement(r) ? r : { message: r };
|
|
423
482
|
this.create({
|
|
424
483
|
id: n,
|
|
425
484
|
type: "success",
|
|
@@ -430,7 +489,7 @@ var te = (e) => {
|
|
|
430
489
|
}).catch(async (e) => {
|
|
431
490
|
if (a = ["reject", e], t.error !== void 0) {
|
|
432
491
|
i = !1;
|
|
433
|
-
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" && !
|
|
492
|
+
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" && !l.isValidElement(r) ? r : { message: r };
|
|
434
493
|
this.create({
|
|
435
494
|
id: n,
|
|
436
495
|
type: "error",
|
|
@@ -440,10 +499,10 @@ var te = (e) => {
|
|
|
440
499
|
}
|
|
441
500
|
}).finally(() => {
|
|
442
501
|
i && (this.dismiss(n), n = void 0), t.finally == null || t.finally.call(t);
|
|
443
|
-
}),
|
|
444
|
-
return typeof n != "string" && typeof n != "number" ? { unwrap:
|
|
502
|
+
}), s = () => new Promise((e, t) => o.then(() => a[0] === "reject" ? t(a[1]) : e(a[1])).catch(t));
|
|
503
|
+
return typeof n != "string" && typeof n != "number" ? { unwrap: s } : Object.assign(n, { unwrap: s });
|
|
445
504
|
}, this.custom = (e, t) => {
|
|
446
|
-
let n =
|
|
505
|
+
let n = ue(t);
|
|
447
506
|
return this.create({
|
|
448
507
|
...t,
|
|
449
508
|
jsx: e(n),
|
|
@@ -452,53 +511,53 @@ var te = (e) => {
|
|
|
452
511
|
}), n;
|
|
453
512
|
}, 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();
|
|
454
513
|
}
|
|
455
|
-
}(),
|
|
456
|
-
success:
|
|
457
|
-
info:
|
|
458
|
-
warning:
|
|
459
|
-
error:
|
|
460
|
-
custom:
|
|
461
|
-
message:
|
|
462
|
-
promise:
|
|
463
|
-
dismiss:
|
|
464
|
-
loading:
|
|
514
|
+
}(), U = (e, t) => H.message(e, t), de = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", W = Object.assign(U, {
|
|
515
|
+
success: H.success,
|
|
516
|
+
info: H.info,
|
|
517
|
+
warning: H.warning,
|
|
518
|
+
error: H.error,
|
|
519
|
+
custom: H.custom,
|
|
520
|
+
message: H.message,
|
|
521
|
+
promise: H.promise,
|
|
522
|
+
dismiss: H.dismiss,
|
|
523
|
+
loading: H.loading
|
|
465
524
|
}, {
|
|
466
|
-
getHistory: () =>
|
|
467
|
-
getToasts: () =>
|
|
525
|
+
getHistory: () => H.toasts,
|
|
526
|
+
getToasts: () => H.getActiveToasts()
|
|
468
527
|
});
|
|
469
|
-
function
|
|
528
|
+
function G(e) {
|
|
470
529
|
return e.label !== void 0;
|
|
471
530
|
}
|
|
472
|
-
var
|
|
473
|
-
function
|
|
531
|
+
var fe = 3, pe = "24px", K = "16px", me = 4e3, he = 356, ge = 14, _e = 45, ve = 200;
|
|
532
|
+
function q(...e) {
|
|
474
533
|
return e.filter(Boolean).join(" ");
|
|
475
534
|
}
|
|
476
|
-
function
|
|
535
|
+
function ye(e) {
|
|
477
536
|
let [t, n] = e.split("-"), r = [];
|
|
478
537
|
return t && r.push(t), n && r.push(n), r;
|
|
479
538
|
}
|
|
480
|
-
var
|
|
481
|
-
let { invert: t, toast: n, unstyled: r, interacting: i, setHeights: a, visibleToasts: o, heights:
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}, [
|
|
485
|
-
|
|
486
|
-
}, []),
|
|
487
|
-
let e =
|
|
539
|
+
var J = (e) => {
|
|
540
|
+
let { invert: t, toast: n, unstyled: r, interacting: i, setHeights: a, visibleToasts: o, heights: s, index: c, toasts: ee, expanded: u, removeToast: d, defaultRichColors: f, closeButton: p, style: m, cancelButtonStyle: h, actionButtonStyle: g, className: _ = "", descriptionClassName: v = "", duration: y, position: b, gap: te, expandByDefault: x, classNames: S, icons: C, closeButtonAriaLabel: w = "Close toast" } = e, [T, E] = l.useState(null), [ne, D] = l.useState(null), [O, k] = l.useState(!1), [A, re] = l.useState(!1), [j, M] = l.useState(!1), [N, P] = l.useState(!1), [F, I] = l.useState(!1), [ae, L] = l.useState(0), [se, R] = l.useState(0), z = l.useRef(n.duration || y || me), B = l.useRef(null), V = l.useRef(null), ue = c === 0, H = c + 1 <= o, U = n.type, de = U ?? "default", W = n.dismissible !== !1, fe = n.className || "", pe = n.descriptionClassName || "", K = l.useMemo(() => s.findIndex((e) => e.toastId === n.id) || 0, [s, n.id]), he = l.useMemo(() => n.closeButton ?? p, [n.closeButton, p]), ge = l.useMemo(() => n.duration || y || me, [n.duration, y]), J = l.useRef(0), Y = l.useRef(0), be = l.useRef(0), X = l.useRef(null), [xe, Se] = b.split("-"), Z = l.useMemo(() => s.reduce((e, t, n) => n >= K ? e : e + t.height, 0), [s, K]), Ce = le(), Q = l.useMemo(() => e.swipeDirections ?? ye(b), [e.swipeDirections, b]), we = n.invert || t, Te = U === "loading";
|
|
541
|
+
Y.current = l.useMemo(() => K * te + Z, [K, Z]), l.useEffect(() => {
|
|
542
|
+
z.current = ge;
|
|
543
|
+
}, [ge]), l.useEffect(() => {
|
|
544
|
+
k(!0);
|
|
545
|
+
}, []), l.useEffect(() => {
|
|
546
|
+
let e = V.current;
|
|
488
547
|
if (e) {
|
|
489
548
|
let t = e.getBoundingClientRect().height;
|
|
490
|
-
return
|
|
549
|
+
return R(t), a((e) => [{
|
|
491
550
|
toastId: n.id,
|
|
492
551
|
height: t,
|
|
493
552
|
position: n.position
|
|
494
553
|
}, ...e]), () => a((e) => e.filter((e) => e.toastId !== n.id));
|
|
495
554
|
}
|
|
496
|
-
}, [a, n.id]),
|
|
497
|
-
if (!
|
|
498
|
-
let e =
|
|
555
|
+
}, [a, n.id]), l.useLayoutEffect(() => {
|
|
556
|
+
if (!O) return;
|
|
557
|
+
let e = V.current, t = e.style.height;
|
|
499
558
|
e.style.height = "auto";
|
|
500
559
|
let r = e.getBoundingClientRect().height;
|
|
501
|
-
e.style.height = t,
|
|
560
|
+
e.style.height = t, R(r), a((e) => e.find((e) => e.toastId === n.id) ? e.map((e) => e.toastId === n.id ? {
|
|
502
561
|
...e,
|
|
503
562
|
height: r
|
|
504
563
|
} : e) : [{
|
|
@@ -507,7 +566,7 @@ var he = (e) => {
|
|
|
507
566
|
position: n.position
|
|
508
567
|
}, ...e]);
|
|
509
568
|
}, [
|
|
510
|
-
|
|
569
|
+
O,
|
|
511
570
|
n.title,
|
|
512
571
|
n.description,
|
|
513
572
|
a,
|
|
@@ -516,110 +575,110 @@ var he = (e) => {
|
|
|
516
575
|
n.action,
|
|
517
576
|
n.cancel
|
|
518
577
|
]);
|
|
519
|
-
let $ =
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
},
|
|
578
|
+
let $ = l.useCallback(() => {
|
|
579
|
+
re(!0), L(Y.current), a((e) => e.filter((e) => e.toastId !== n.id)), setTimeout(() => {
|
|
580
|
+
d(n);
|
|
581
|
+
}, ve);
|
|
523
582
|
}, [
|
|
524
583
|
n,
|
|
525
|
-
|
|
584
|
+
d,
|
|
526
585
|
a,
|
|
527
|
-
|
|
586
|
+
Y
|
|
528
587
|
]);
|
|
529
|
-
|
|
530
|
-
if (n.promise &&
|
|
588
|
+
l.useEffect(() => {
|
|
589
|
+
if (n.promise && U === "loading" || n.duration === Infinity || n.type === "loading") return;
|
|
531
590
|
let e;
|
|
532
|
-
return
|
|
533
|
-
if (
|
|
534
|
-
let e = (/* @__PURE__ */ new Date()).getTime() -
|
|
535
|
-
|
|
591
|
+
return u || i || Ce ? (() => {
|
|
592
|
+
if (be.current < J.current) {
|
|
593
|
+
let e = (/* @__PURE__ */ new Date()).getTime() - J.current;
|
|
594
|
+
z.current -= e;
|
|
536
595
|
}
|
|
537
|
-
|
|
538
|
-
})() :
|
|
596
|
+
be.current = (/* @__PURE__ */ new Date()).getTime();
|
|
597
|
+
})() : z.current !== Infinity && (J.current = (/* @__PURE__ */ new Date()).getTime(), e = setTimeout(() => {
|
|
539
598
|
n.onAutoClose == null || n.onAutoClose.call(n, n), $();
|
|
540
|
-
},
|
|
599
|
+
}, z.current)), () => clearTimeout(e);
|
|
541
600
|
}, [
|
|
542
|
-
|
|
601
|
+
u,
|
|
543
602
|
i,
|
|
544
603
|
n,
|
|
545
|
-
|
|
604
|
+
U,
|
|
546
605
|
Ce,
|
|
547
606
|
$
|
|
548
|
-
]),
|
|
607
|
+
]), l.useEffect(() => {
|
|
549
608
|
n.delete && ($(), n.onDismiss == null || n.onDismiss.call(n, n));
|
|
550
609
|
}, [$, n.delete]);
|
|
551
610
|
function Ee() {
|
|
552
|
-
return
|
|
553
|
-
className:
|
|
554
|
-
"data-visible":
|
|
555
|
-
},
|
|
556
|
-
className:
|
|
557
|
-
visible:
|
|
611
|
+
return C?.loading ? /*#__PURE__*/ l.createElement("div", {
|
|
612
|
+
className: q(S?.loader, n?.classNames?.loader, "sonner-loader"),
|
|
613
|
+
"data-visible": U === "loading"
|
|
614
|
+
}, C.loading) : /*#__PURE__*/ l.createElement(oe, {
|
|
615
|
+
className: q(S?.loader, n?.classNames?.loader),
|
|
616
|
+
visible: U === "loading"
|
|
558
617
|
});
|
|
559
618
|
}
|
|
560
|
-
let De = n.icon ||
|
|
561
|
-
return /*#__PURE__*/
|
|
619
|
+
let De = n.icon || C?.[U] || ie(U);
|
|
620
|
+
return /*#__PURE__*/ l.createElement("li", {
|
|
562
621
|
tabIndex: 0,
|
|
563
|
-
ref:
|
|
564
|
-
className:
|
|
622
|
+
ref: V,
|
|
623
|
+
className: q(_, fe, S?.toast, n?.classNames?.toast, S?.[de], n?.classNames?.[de]),
|
|
565
624
|
"data-sonner-toast": "",
|
|
566
|
-
"data-rich-colors": n.richColors ??
|
|
625
|
+
"data-rich-colors": n.richColors ?? f,
|
|
567
626
|
"data-styled": !(n.jsx || n.unstyled || r),
|
|
568
|
-
"data-mounted":
|
|
627
|
+
"data-mounted": O,
|
|
569
628
|
"data-promise": !!n.promise,
|
|
570
|
-
"data-swiped":
|
|
571
|
-
"data-removed":
|
|
572
|
-
"data-visible":
|
|
573
|
-
"data-y-position":
|
|
574
|
-
"data-x-position":
|
|
575
|
-
"data-index":
|
|
576
|
-
"data-front":
|
|
577
|
-
"data-swiping":
|
|
578
|
-
"data-dismissible":
|
|
579
|
-
"data-type":
|
|
629
|
+
"data-swiped": F,
|
|
630
|
+
"data-removed": A,
|
|
631
|
+
"data-visible": H,
|
|
632
|
+
"data-y-position": xe,
|
|
633
|
+
"data-x-position": Se,
|
|
634
|
+
"data-index": c,
|
|
635
|
+
"data-front": ue,
|
|
636
|
+
"data-swiping": j,
|
|
637
|
+
"data-dismissible": W,
|
|
638
|
+
"data-type": U,
|
|
580
639
|
"data-invert": we,
|
|
581
|
-
"data-swipe-out":
|
|
582
|
-
"data-swipe-direction":
|
|
583
|
-
"data-expanded": !!(
|
|
640
|
+
"data-swipe-out": N,
|
|
641
|
+
"data-swipe-direction": ne,
|
|
642
|
+
"data-expanded": !!(u || x && O),
|
|
584
643
|
"data-testid": n.testId,
|
|
585
644
|
style: {
|
|
586
|
-
"--index":
|
|
587
|
-
"--toasts-before":
|
|
588
|
-
"--z-index":
|
|
589
|
-
"--offset": `${
|
|
590
|
-
"--initial-height":
|
|
591
|
-
...
|
|
645
|
+
"--index": c,
|
|
646
|
+
"--toasts-before": c,
|
|
647
|
+
"--z-index": ee.length - c,
|
|
648
|
+
"--offset": `${A ? ae : Y.current}px`,
|
|
649
|
+
"--initial-height": x ? "auto" : `${se}px`,
|
|
650
|
+
...m,
|
|
592
651
|
...n.style
|
|
593
652
|
},
|
|
594
653
|
onDragEnd: () => {
|
|
595
|
-
|
|
654
|
+
M(!1), E(null), X.current = null;
|
|
596
655
|
},
|
|
597
656
|
onPointerDown: (e) => {
|
|
598
|
-
e.button !== 2 && !Te &&
|
|
657
|
+
e.button !== 2 && !Te && W && (B.current = /* @__PURE__ */ new Date(), L(Y.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (M(!0), X.current = {
|
|
599
658
|
x: e.clientX,
|
|
600
659
|
y: e.clientY
|
|
601
660
|
}));
|
|
602
661
|
},
|
|
603
662
|
onPointerUp: () => {
|
|
604
|
-
if (
|
|
605
|
-
|
|
606
|
-
let e = Number(
|
|
607
|
-
if ((
|
|
663
|
+
if (N || !W) return;
|
|
664
|
+
X.current = null;
|
|
665
|
+
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() - B.current?.getTime(), i = T === "x" ? e : t, a = Math.abs(i) / r;
|
|
666
|
+
if ((T === "x" ? Q.includes(e > 0 ? "right" : "left") : Q.includes(t > 0 ? "bottom" : "top")) && (Math.abs(i) >= _e || a > .11)) L(Y.current), n.onDismiss == null || n.onDismiss.call(n, n), D(T === "x" ? e > 0 ? "right" : "left" : t > 0 ? "down" : "up"), $(), P(!0);
|
|
608
667
|
else {
|
|
609
668
|
var o, s;
|
|
610
|
-
(o =
|
|
669
|
+
(o = V.current) == null || o.style.setProperty("--swipe-amount-x", "0px"), (s = V.current) == null || s.style.setProperty("--swipe-amount-y", "0px"), I(!1), M(!1), E(null);
|
|
611
670
|
}
|
|
612
671
|
},
|
|
613
672
|
onPointerMove: (e) => {
|
|
614
673
|
var t, n;
|
|
615
|
-
if (!
|
|
616
|
-
let r = e.clientY -
|
|
617
|
-
!
|
|
674
|
+
if (!X.current || !W || window.getSelection()?.toString().length > 0) return;
|
|
675
|
+
let r = e.clientY - X.current.y, i = e.clientX - X.current.x;
|
|
676
|
+
!T && (Math.abs(i) > 1 || Math.abs(r) > 1) && E(Math.abs(i) > Math.abs(r) ? "x" : "y");
|
|
618
677
|
let a = {
|
|
619
678
|
x: 0,
|
|
620
679
|
y: 0
|
|
621
680
|
}, o = (e) => 1 / (1.5 + Math.abs(e) / 20);
|
|
622
|
-
if (
|
|
681
|
+
if (T === "y") {
|
|
623
682
|
if (Q.includes("top") || Q.includes("bottom")) {
|
|
624
683
|
if (Q.includes("top") && r < 0 || Q.includes("bottom") && r > 0) a.y = r;
|
|
625
684
|
else {
|
|
@@ -627,62 +686,62 @@ var he = (e) => {
|
|
|
627
686
|
a.y = Math.abs(e) < Math.abs(r) ? e : r;
|
|
628
687
|
}
|
|
629
688
|
}
|
|
630
|
-
} else if (
|
|
689
|
+
} else if (T === "x" && (Q.includes("left") || Q.includes("right"))) {
|
|
631
690
|
if (Q.includes("left") && i < 0 || Q.includes("right") && i > 0) a.x = i;
|
|
632
691
|
else {
|
|
633
692
|
let e = i * o(i);
|
|
634
693
|
a.x = Math.abs(e) < Math.abs(i) ? e : i;
|
|
635
694
|
}
|
|
636
695
|
}
|
|
637
|
-
(Math.abs(a.x) > 0 || Math.abs(a.y) > 0) &&
|
|
696
|
+
(Math.abs(a.x) > 0 || Math.abs(a.y) > 0) && I(!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`);
|
|
638
697
|
}
|
|
639
|
-
},
|
|
640
|
-
"aria-label":
|
|
698
|
+
}, he && !n.jsx && U !== "loading" ? /*#__PURE__*/ l.createElement("button", {
|
|
699
|
+
"aria-label": w,
|
|
641
700
|
"data-disabled": Te,
|
|
642
701
|
"data-close-button": !0,
|
|
643
|
-
onClick: Te || !
|
|
702
|
+
onClick: Te || !W ? () => {} : () => {
|
|
644
703
|
$(), n.onDismiss == null || n.onDismiss.call(n, n);
|
|
645
704
|
},
|
|
646
|
-
className:
|
|
647
|
-
},
|
|
705
|
+
className: q(S?.closeButton, n?.classNames?.closeButton)
|
|
706
|
+
}, C?.close ?? ce) : null, (U || n.icon || n.promise) && n.icon !== null && (C?.[U] !== null || n.icon) ? /*#__PURE__*/ l.createElement("div", {
|
|
648
707
|
"data-icon": "",
|
|
649
|
-
className:
|
|
650
|
-
},
|
|
708
|
+
className: q(S?.icon, n?.classNames?.icon)
|
|
709
|
+
}, U === "loading" ? n.icon || Ee() : n.promise ? Ee() : null, U === "loading" ? null : De) : null, /*#__PURE__*/ l.createElement("div", {
|
|
651
710
|
"data-content": "",
|
|
652
|
-
className:
|
|
653
|
-
}, /*#__PURE__*/
|
|
711
|
+
className: q(S?.content, n?.classNames?.content)
|
|
712
|
+
}, /*#__PURE__*/ l.createElement("div", {
|
|
654
713
|
"data-title": "",
|
|
655
|
-
className:
|
|
656
|
-
}, n.jsx ? n.jsx : typeof n.title == "function" ? n.title() : n.title), n.description ? /*#__PURE__*/
|
|
714
|
+
className: q(S?.title, n?.classNames?.title)
|
|
715
|
+
}, n.jsx ? n.jsx : typeof n.title == "function" ? n.title() : n.title), n.description ? /*#__PURE__*/ l.createElement("div", {
|
|
657
716
|
"data-description": "",
|
|
658
|
-
className:
|
|
659
|
-
}, typeof n.description == "function" ? n.description() : n.description) : null), /*#__PURE__*/
|
|
717
|
+
className: q(v, pe, S?.description, n?.classNames?.description)
|
|
718
|
+
}, typeof n.description == "function" ? n.description() : n.description) : null), /*#__PURE__*/ l.isValidElement(n.cancel) ? n.cancel : n.cancel && G(n.cancel) ? /*#__PURE__*/ l.createElement("button", {
|
|
660
719
|
"data-button": !0,
|
|
661
720
|
"data-cancel": !0,
|
|
662
|
-
style: n.cancelButtonStyle ||
|
|
721
|
+
style: n.cancelButtonStyle || h,
|
|
663
722
|
onClick: (e) => {
|
|
664
|
-
|
|
723
|
+
G(n.cancel) && W && (n.cancel.onClick == null || n.cancel.onClick.call(n.cancel, e), $());
|
|
665
724
|
},
|
|
666
|
-
className:
|
|
667
|
-
}, n.cancel.label) : null, /*#__PURE__*/
|
|
725
|
+
className: q(S?.cancelButton, n?.classNames?.cancelButton)
|
|
726
|
+
}, n.cancel.label) : null, /*#__PURE__*/ l.isValidElement(n.action) ? n.action : n.action && G(n.action) ? /*#__PURE__*/ l.createElement("button", {
|
|
668
727
|
"data-button": !0,
|
|
669
728
|
"data-action": !0,
|
|
670
729
|
style: n.actionButtonStyle || g,
|
|
671
730
|
onClick: (e) => {
|
|
672
|
-
|
|
731
|
+
G(n.action) && (n.action.onClick == null || n.action.onClick.call(n.action, e), e.defaultPrevented || $());
|
|
673
732
|
},
|
|
674
|
-
className:
|
|
733
|
+
className: q(S?.actionButton, n?.classNames?.actionButton)
|
|
675
734
|
}, n.action.label) : null);
|
|
676
735
|
};
|
|
677
|
-
function
|
|
736
|
+
function Y() {
|
|
678
737
|
if (typeof window > "u" || typeof document > "u") return "ltr";
|
|
679
738
|
let e = document.documentElement.getAttribute("dir");
|
|
680
739
|
return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
|
|
681
740
|
}
|
|
682
|
-
function
|
|
741
|
+
function be(e, t) {
|
|
683
742
|
let n = {};
|
|
684
743
|
return [e, t].forEach((e, t) => {
|
|
685
|
-
let r = t === 1, i = r ? "--mobile-offset" : "--offset", a = r ?
|
|
744
|
+
let r = t === 1, i = r ? "--mobile-offset" : "--offset", a = r ? K : pe;
|
|
686
745
|
function o(e) {
|
|
687
746
|
[
|
|
688
747
|
"top",
|
|
@@ -703,19 +762,19 @@ function ge(e, t) {
|
|
|
703
762
|
}) : o(a);
|
|
704
763
|
}), n;
|
|
705
764
|
}
|
|
706
|
-
var
|
|
707
|
-
let { id: n, invert: r, position: i = "bottom-right", hotkey: a = ["altKey", "KeyT"], expand: o, closeButton:
|
|
708
|
-
|
|
765
|
+
var X = /*#__PURE__*/ l.forwardRef(function(e, t) {
|
|
766
|
+
let { id: n, invert: r, position: i = "bottom-right", hotkey: a = ["altKey", "KeyT"], expand: o, closeButton: s, className: c, offset: ee, mobileOffset: u, theme: d = "light", richColors: f, duration: p, style: m, visibleToasts: h = fe, toastOptions: g, dir: _ = Y(), gap: v = ge, icons: y, customAriaLabel: b, containerAriaLabel: te = "Notifications" } = e, [x, S] = l.useState([]), w = l.useMemo(() => n ? x.filter((e) => e.toasterId === n) : x.filter((e) => !e.toasterId), [x, n]), T = l.useMemo(() => Array.from(new Set([i].concat(w.filter((e) => e.position).map((e) => e.position)))), [w, i]), [E, ne] = l.useState([]), [D, O] = l.useState(!1), [k, A] = l.useState(!1), [re, j] = l.useState(d === "system" ? typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : d), M = l.useRef(null), N = a.join("+").replace(/Key/g, "").replace(/Digit/g, ""), P = l.useRef(null), F = l.useRef(!1), I = l.useCallback((e) => {
|
|
767
|
+
S((t) => (t.find((t) => t.id === e.id)?.delete || H.dismiss(e.id), t.filter(({ id: t }) => t !== e.id)));
|
|
709
768
|
}, []);
|
|
710
|
-
return
|
|
769
|
+
return l.useEffect(() => H.subscribe((e) => {
|
|
711
770
|
e.dismiss ? requestAnimationFrame(() => {
|
|
712
|
-
|
|
771
|
+
S((t) => t.map((t) => t.id === e.id ? {
|
|
713
772
|
...t,
|
|
714
773
|
delete: !0
|
|
715
774
|
} : t));
|
|
716
775
|
}) : setTimeout(() => {
|
|
717
|
-
|
|
718
|
-
|
|
776
|
+
C.flushSync(() => {
|
|
777
|
+
S((t) => {
|
|
719
778
|
let n = t.findIndex((t) => t.id === e.id);
|
|
720
779
|
return n === -1 ? [e, ...t] : [
|
|
721
780
|
...t.slice(0, n),
|
|
@@ -728,98 +787,98 @@ var _e = /*#__PURE__*/ s.forwardRef(function(e, t) {
|
|
|
728
787
|
});
|
|
729
788
|
});
|
|
730
789
|
});
|
|
731
|
-
}), []),
|
|
732
|
-
if (
|
|
733
|
-
|
|
790
|
+
}), []), l.useEffect(() => {
|
|
791
|
+
if (d !== "system") {
|
|
792
|
+
j(d);
|
|
734
793
|
return;
|
|
735
794
|
}
|
|
736
|
-
if (
|
|
795
|
+
if (d === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? j("dark") : j("light")), typeof window > "u") return;
|
|
737
796
|
let e = window.matchMedia("(prefers-color-scheme: dark)");
|
|
738
797
|
try {
|
|
739
798
|
e.addEventListener("change", ({ matches: e }) => {
|
|
740
|
-
|
|
799
|
+
j(e ? "dark" : "light");
|
|
741
800
|
});
|
|
742
801
|
} catch {
|
|
743
802
|
e.addListener(({ matches: e }) => {
|
|
744
803
|
try {
|
|
745
|
-
|
|
804
|
+
j(e ? "dark" : "light");
|
|
746
805
|
} catch (e) {
|
|
747
806
|
console.error(e);
|
|
748
807
|
}
|
|
749
808
|
});
|
|
750
809
|
}
|
|
751
|
-
}, [
|
|
752
|
-
|
|
753
|
-
}, [
|
|
810
|
+
}, [d]), l.useEffect(() => {
|
|
811
|
+
x.length <= 1 && O(!1);
|
|
812
|
+
}, [x]), l.useEffect(() => {
|
|
754
813
|
let e = (e) => {
|
|
755
814
|
if (a.length > 0 && a.every((t) => e[t] || e.code === t)) {
|
|
756
815
|
var t;
|
|
757
|
-
|
|
816
|
+
O(!0), (t = M.current) == null || t.focus();
|
|
758
817
|
}
|
|
759
|
-
e.code === "Escape" && (document.activeElement ===
|
|
818
|
+
e.code === "Escape" && (document.activeElement === M.current || M.current?.contains(document.activeElement)) && O(!1);
|
|
760
819
|
};
|
|
761
820
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
762
|
-
}, [a]),
|
|
763
|
-
if (
|
|
764
|
-
|
|
821
|
+
}, [a]), l.useEffect(() => {
|
|
822
|
+
if (M.current) return () => {
|
|
823
|
+
P.current && (P.current.focus({ preventScroll: !0 }), P.current = null, F.current = !1);
|
|
765
824
|
};
|
|
766
|
-
}, [
|
|
825
|
+
}, [M.current]), /*#__PURE__*/ l.createElement("section", {
|
|
767
826
|
ref: t,
|
|
768
|
-
"aria-label": b ?? `${
|
|
827
|
+
"aria-label": b ?? `${te} ${N}`,
|
|
769
828
|
tabIndex: -1,
|
|
770
829
|
"aria-live": "polite",
|
|
771
830
|
"aria-relevant": "additions text",
|
|
772
831
|
"aria-atomic": "false",
|
|
773
832
|
suppressHydrationWarning: !0,
|
|
774
833
|
"data-react-aria-top-layer": !0
|
|
775
|
-
},
|
|
834
|
+
}, T.map((t, n) => {
|
|
776
835
|
let [i, a] = t.split("-");
|
|
777
|
-
return
|
|
836
|
+
return w.length ? /*#__PURE__*/ l.createElement("ol", {
|
|
778
837
|
key: t,
|
|
779
|
-
dir: _ === "auto" ?
|
|
838
|
+
dir: _ === "auto" ? Y() : _,
|
|
780
839
|
tabIndex: -1,
|
|
781
|
-
ref:
|
|
782
|
-
className:
|
|
840
|
+
ref: M,
|
|
841
|
+
className: c,
|
|
783
842
|
"data-sonner-toaster": !0,
|
|
784
|
-
"data-sonner-theme":
|
|
843
|
+
"data-sonner-theme": re,
|
|
785
844
|
"data-y-position": i,
|
|
786
845
|
"data-x-position": a,
|
|
787
846
|
style: {
|
|
788
|
-
"--front-toast-height": `${
|
|
789
|
-
"--width": `${
|
|
847
|
+
"--front-toast-height": `${E[0]?.height || 0}px`,
|
|
848
|
+
"--width": `${he}px`,
|
|
790
849
|
"--gap": `${v}px`,
|
|
791
|
-
...
|
|
792
|
-
...
|
|
850
|
+
...m,
|
|
851
|
+
...be(ee, u)
|
|
793
852
|
},
|
|
794
853
|
onBlur: (e) => {
|
|
795
|
-
|
|
854
|
+
F.current && !e.currentTarget.contains(e.relatedTarget) && (F.current = !1, P.current &&= (P.current.focus({ preventScroll: !0 }), null));
|
|
796
855
|
},
|
|
797
856
|
onFocus: (e) => {
|
|
798
|
-
e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" ||
|
|
857
|
+
e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || F.current || (F.current = !0, P.current = e.relatedTarget);
|
|
799
858
|
},
|
|
800
|
-
onMouseEnter: () =>
|
|
801
|
-
onMouseMove: () =>
|
|
859
|
+
onMouseEnter: () => O(!0),
|
|
860
|
+
onMouseMove: () => O(!0),
|
|
802
861
|
onMouseLeave: () => {
|
|
803
|
-
|
|
862
|
+
k || O(!1);
|
|
804
863
|
},
|
|
805
|
-
onDragEnd: () =>
|
|
864
|
+
onDragEnd: () => O(!1),
|
|
806
865
|
onPointerDown: (e) => {
|
|
807
|
-
e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" ||
|
|
866
|
+
e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || A(!0);
|
|
808
867
|
},
|
|
809
|
-
onPointerUp: () =>
|
|
810
|
-
},
|
|
868
|
+
onPointerUp: () => A(!1)
|
|
869
|
+
}, w.filter((e) => !e.position && n === 0 || e.position === t).map((n, i) => /*#__PURE__*/ l.createElement(J, {
|
|
811
870
|
key: n.id,
|
|
812
871
|
icons: y,
|
|
813
872
|
index: i,
|
|
814
873
|
toast: n,
|
|
815
|
-
defaultRichColors:
|
|
816
|
-
duration: g?.duration ??
|
|
874
|
+
defaultRichColors: f,
|
|
875
|
+
duration: g?.duration ?? p,
|
|
817
876
|
className: g?.className,
|
|
818
877
|
descriptionClassName: g?.descriptionClassName,
|
|
819
878
|
invert: r,
|
|
820
|
-
visibleToasts:
|
|
821
|
-
closeButton: g?.closeButton ??
|
|
822
|
-
interacting:
|
|
879
|
+
visibleToasts: h,
|
|
880
|
+
closeButton: g?.closeButton ?? s,
|
|
881
|
+
interacting: k,
|
|
823
882
|
position: t,
|
|
824
883
|
style: g?.style,
|
|
825
884
|
unstyled: g?.unstyled,
|
|
@@ -827,51 +886,51 @@ var _e = /*#__PURE__*/ s.forwardRef(function(e, t) {
|
|
|
827
886
|
cancelButtonStyle: g?.cancelButtonStyle,
|
|
828
887
|
actionButtonStyle: g?.actionButtonStyle,
|
|
829
888
|
closeButtonAriaLabel: g?.closeButtonAriaLabel,
|
|
830
|
-
removeToast:
|
|
831
|
-
toasts:
|
|
832
|
-
heights:
|
|
833
|
-
setHeights:
|
|
889
|
+
removeToast: I,
|
|
890
|
+
toasts: w.filter((e) => e.position == n.position),
|
|
891
|
+
heights: E.filter((e) => e.position == n.position),
|
|
892
|
+
setHeights: ne,
|
|
834
893
|
expandByDefault: o,
|
|
835
894
|
gap: v,
|
|
836
|
-
expanded:
|
|
895
|
+
expanded: D,
|
|
837
896
|
swipeDirections: e.swipeDirections
|
|
838
897
|
}))) : null;
|
|
839
898
|
}));
|
|
840
899
|
});
|
|
841
900
|
// packages/feedback/src/toast.tsx
|
|
842
|
-
function
|
|
843
|
-
return /* @__PURE__ */
|
|
901
|
+
function xe({ closeButton: e = !0, closeButtonAriaLabel: t = "Dismiss notification", offset: n = a.xl, mobileOffset: r = a.lg, ...o }) {
|
|
902
|
+
return /* @__PURE__ */ p(X, {
|
|
844
903
|
...o,
|
|
845
904
|
className: "x1xzild6 xkwcdv0 x19hn9gq x350ok5 x1dknavn x1qgcmqu x19j7ixz xgam3oh x7s97pk",
|
|
846
905
|
style: {
|
|
847
|
-
zIndex:
|
|
906
|
+
zIndex: i.popup,
|
|
848
907
|
transitionProperty: "opacity, transform"
|
|
849
908
|
},
|
|
850
909
|
offset: n,
|
|
851
|
-
mobileOffset:
|
|
910
|
+
mobileOffset: r,
|
|
852
911
|
closeButton: e,
|
|
853
912
|
icons: {
|
|
854
|
-
success: /* @__PURE__ */
|
|
913
|
+
success: /* @__PURE__ */ p(g, {
|
|
855
914
|
"aria-hidden": !0,
|
|
856
915
|
className: "xtwnzbg x18utl2x x7zct4q x7ixh4y"
|
|
857
916
|
}),
|
|
858
|
-
error: /* @__PURE__ */
|
|
917
|
+
error: /* @__PURE__ */ p(_, {
|
|
859
918
|
"aria-hidden": !0,
|
|
860
919
|
className: "xtwnzbg x18utl2x x7zct4q xr5kp14"
|
|
861
920
|
}),
|
|
862
|
-
warning: /* @__PURE__ */
|
|
921
|
+
warning: /* @__PURE__ */ p(b, {
|
|
863
922
|
"aria-hidden": !0,
|
|
864
923
|
className: "xtwnzbg x18utl2x x7zct4q x1f9ixgr"
|
|
865
924
|
}),
|
|
866
|
-
info: /* @__PURE__ */
|
|
925
|
+
info: /* @__PURE__ */ p(v, {
|
|
867
926
|
"aria-hidden": !0,
|
|
868
927
|
className: "xtwnzbg x18utl2x x7zct4q x153jb6y"
|
|
869
928
|
}),
|
|
870
|
-
loading: /* @__PURE__ */
|
|
929
|
+
loading: /* @__PURE__ */ p(y, {
|
|
871
930
|
"aria-hidden": !0,
|
|
872
931
|
className: "xtwnzbg x18utl2x x7zct4q x153jb6y"
|
|
873
932
|
}),
|
|
874
|
-
close: /* @__PURE__ */
|
|
933
|
+
close: /* @__PURE__ */ p(te, {
|
|
875
934
|
"aria-hidden": !0,
|
|
876
935
|
className: "xtwnzbg x18utl2x x7zct4q"
|
|
877
936
|
})
|
|
@@ -881,45 +940,45 @@ function q({ closeButton: e = !0, closeButtonAriaLabel: t = "Dismiss notificatio
|
|
|
881
940
|
closeButtonAriaLabel: t,
|
|
882
941
|
style: { transitionProperty: "opacity, transform" },
|
|
883
942
|
classNames: {
|
|
884
|
-
toast: { className: "x1bl4301 x78zum5 x1a02dak x6s0dn4 x1hnptsi x1c8xbx5
|
|
943
|
+
toast: { className: "x1bl4301 x78zum5 x1a02dak x6s0dn4 x1hnptsi x1c8xbx5 xx4ccz x7ottyg xmkeg23 x1y0btm7 x1ey3b81 xy32g2j xpvm0e4 xbixft x16hm2kh x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi x1xzild6 xkwcdv0 x19hn9gq x350ok5 x1dknavn x1qgcmqu x19j7ixz xgam3oh x7s97pk x-default-marker" }.className ?? "",
|
|
885
944
|
title: { className: "xk4h15q" }.className ?? "",
|
|
886
945
|
description: { className: "x153jb6y" }.className ?? "",
|
|
887
946
|
content: { className: "x78zum5 xdt5ytf x1slnebi xeuugli xfko13i x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
|
|
888
947
|
icon: { className: "x78zum5 x1n2onr6 x2lah0s xtwnzbg x18utl2x x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
|
|
889
948
|
loader: { className: "x1xzild6 xkwcdv0 x19hn9gq x350ok5 x1dknavn" }.className ?? "",
|
|
890
|
-
actionButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w
|
|
891
|
-
cancelButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w
|
|
892
|
-
closeButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 x193iq5w
|
|
949
|
+
actionButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w x17tes2r xwu7q15 x1hmw7ec x1atzlso xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x1pt885t x1ymx3u3 xbhuexu x1eou8nq x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
|
|
950
|
+
cancelButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w x17tes2r xwu7q15 x1hmw7ec x1atzlso xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x1r7kqkb xbixft xxg5jw2 x1ecmtor x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
|
|
951
|
+
closeButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 x193iq5w x17tes2r xwu7q15 x1hmw7ec xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x10l6tqk x1m7q2ru x1b86y6l x16opp91 xidce53 xnjsko4 xjbqb8w x153jb6y xg54am9 xfkdqyo x1snzz31 xqu5dr6 x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? ""
|
|
893
952
|
}
|
|
894
953
|
}
|
|
895
954
|
});
|
|
896
955
|
}
|
|
897
956
|
// packages/feedback/src/async-region.tsx
|
|
898
|
-
var
|
|
899
|
-
function
|
|
900
|
-
let r =
|
|
901
|
-
return
|
|
957
|
+
var Se = ee(!1);
|
|
958
|
+
function Z({ enter: e, fill: t = !1, children: n }) {
|
|
959
|
+
let r = u(Se), [i] = f(e && !r), [a, o] = f(i);
|
|
960
|
+
return d(() => {
|
|
902
961
|
let e = requestAnimationFrame(() => o(!1));
|
|
903
962
|
return () => cancelAnimationFrame(e);
|
|
904
|
-
}, []), /* @__PURE__ */
|
|
963
|
+
}, []), /* @__PURE__ */ p("div", {
|
|
905
964
|
...{
|
|
906
965
|
0: { className: "xeuugli" },
|
|
907
966
|
2: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf" },
|
|
908
967
|
1: { className: "xeuugli xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
|
|
909
968
|
3: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf xqcmdr3 xcgnenq xwkv4th x1c3o69q" }
|
|
910
969
|
}[!!t << 1 | !!i],
|
|
911
|
-
children: /* @__PURE__ */
|
|
970
|
+
children: /* @__PURE__ */ p(Se, {
|
|
912
971
|
value: a,
|
|
913
972
|
children: n
|
|
914
973
|
})
|
|
915
974
|
});
|
|
916
975
|
}
|
|
917
|
-
function
|
|
918
|
-
let [
|
|
919
|
-
return
|
|
920
|
-
let e = Math.max(0,
|
|
976
|
+
function Ce({ label: e, placeholder: t, fill: n = !1, startedAt: r, delayMs: i = 0 }) {
|
|
977
|
+
let [a] = f(() => r ?? Date.now()), [s, l] = f(i <= 0);
|
|
978
|
+
return d(() => {
|
|
979
|
+
let e = Math.max(0, i - (Date.now() - a)), t = setTimeout(() => l(!0), e);
|
|
921
980
|
return () => clearTimeout(t);
|
|
922
|
-
}, [
|
|
981
|
+
}, [a, i]), /* @__PURE__ */ m("div", {
|
|
923
982
|
...{
|
|
924
983
|
0: { className: "xeuugli" },
|
|
925
984
|
4: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf" },
|
|
@@ -929,41 +988,41 @@ function Y({ label: e, placeholder: t, fill: r = !1, startedAt: i, delayMs: a =
|
|
|
929
988
|
5: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
|
|
930
989
|
3: { className: "xeuugli xlshs6z xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
|
|
931
990
|
7: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf xlshs6z xqcmdr3 xcgnenq xwkv4th x1c3o69q" }
|
|
932
|
-
}[!!
|
|
933
|
-
children: [
|
|
991
|
+
}[!!n << 2 | !s << 1 | !!s],
|
|
992
|
+
children: [s && /* @__PURE__ */ p("span", {
|
|
934
993
|
role: "status",
|
|
935
|
-
...
|
|
994
|
+
...c.props(o.hidden),
|
|
936
995
|
children: e
|
|
937
|
-
}), /* @__PURE__ */
|
|
996
|
+
}), /* @__PURE__ */ p("div", {
|
|
938
997
|
"aria-hidden": "true",
|
|
939
998
|
inert: !0,
|
|
940
999
|
...{
|
|
941
1000
|
0: { className: "xeuugli" },
|
|
942
1001
|
1: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf" }
|
|
943
|
-
}[!!
|
|
1002
|
+
}[!!n | 0],
|
|
944
1003
|
children: t
|
|
945
1004
|
})]
|
|
946
1005
|
});
|
|
947
1006
|
}
|
|
948
|
-
function
|
|
949
|
-
let [s, c] =
|
|
950
|
-
return e && !s && c(!0), /* @__PURE__ */
|
|
1007
|
+
function Q({ pending: e, label: t, placeholder: n, children: r, fill: i = !1, startedAt: a, delayMs: o }) {
|
|
1008
|
+
let [s, c] = f(e);
|
|
1009
|
+
return e && !s && c(!0), /* @__PURE__ */ p("div", {
|
|
951
1010
|
"aria-busy": e,
|
|
952
1011
|
...{
|
|
953
1012
|
0: { className: "x1n2onr6 xeuugli" },
|
|
954
1013
|
1: { className: "x1n2onr6 xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf" }
|
|
955
1014
|
}[!!i | 0],
|
|
956
|
-
children: e ? /* @__PURE__ */
|
|
1015
|
+
children: e ? /* @__PURE__ */ p(Ce, {
|
|
957
1016
|
label: t,
|
|
958
1017
|
placeholder: n,
|
|
959
1018
|
fill: i,
|
|
960
1019
|
startedAt: a,
|
|
961
1020
|
delayMs: o
|
|
962
|
-
}, a) : /* @__PURE__ */
|
|
1021
|
+
}, a) : /* @__PURE__ */ p(Z, {
|
|
963
1022
|
enter: s,
|
|
964
1023
|
fill: i,
|
|
965
1024
|
children: r
|
|
966
1025
|
})
|
|
967
1026
|
});
|
|
968
1027
|
}
|
|
969
|
-
export {
|
|
1028
|
+
export { I as a, M as c, O as d, k as f, W as i, N as l, T as m, Z as n, F as o, w as p, xe as r, P as s, Q as t, D as u };
|