@tempots/beatui 0.53.0 → 0.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2019-BiSy3dQP.cjs → 2019-5RIscTOv.cjs} +1 -1
- package/dist/{2019-Djx2f_nO.js → 2019-i1LHsYdK.js} +2 -2
- package/dist/{2020-BgJxYgaO.cjs → 2020-DeCezjWf.cjs} +1 -1
- package/dist/{2020-C1wOj1GM.js → 2020-S7qY95wq.js} +2 -2
- package/dist/{ar-BEbbig_x.cjs → ar-BqnDsD9v.cjs} +1 -1
- package/dist/{ar-Djuleurf.js → ar-DrBp_VwJ.js} +7 -12
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +353 -360
- package/dist/{de-E8u7Hbc0.js → de-B5oZoraI.js} +5 -10
- package/dist/{de-Br3MCGtv.cjs → de-C_N0wtxQ.cjs} +1 -1
- package/dist/{es-BN0iaBgJ.js → es-DRc5dc_G.js} +1 -6
- package/dist/{es-CAwGEj_N.cjs → es-JnLMDtzg.cjs} +1 -1
- package/dist/{fa-3Qfo8ZXh.js → fa-B0VDVs5B.js} +6 -11
- package/dist/{fa-CEz8tGnY.cjs → fa-BC16IdRL.cjs} +1 -1
- package/dist/{fr-Dbn62iEL.cjs → fr-BupZ6YnU.cjs} +1 -1
- package/dist/{fr-D1ndk0A5.js → fr-DXlfWwI6.js} +8 -13
- package/dist/{he-CIV7rntE.js → he-BX-Az8As.js} +8 -13
- package/dist/{he-OtaTg9wg.cjs → he-C-aQ2yoO.cjs} +1 -1
- package/dist/{hi-CnbarThz.cjs → hi-L3y3Aedb.cjs} +1 -1
- package/dist/{hi-tzWREPMb.js → hi-w4uL7LN1.js} +8 -13
- package/dist/{index-nRXzduHm.cjs → index-B7gVxeO9.cjs} +1 -1
- package/dist/{index-CBT2SLat.js → index-BI5w0jSz.js} +223 -224
- package/dist/{index-B9y4N11q.js → index-BnQvOXw8.js} +3019 -3004
- package/dist/{index-ClFVnBUS.cjs → index-Bv2gn_kV.cjs} +3 -3
- package/dist/{index-BjQW8AsK.cjs → index-CFOxIBGJ.cjs} +12 -12
- package/dist/{index-KPHFBjQB.cjs → index-CKyH3jwP.cjs} +1 -1
- package/dist/{index-TiMfhF1U.cjs → index-C_71zSeN.cjs} +1 -1
- package/dist/index-CkNcU-jd.cjs +8 -0
- package/dist/{index-qWS4IYZX.js → index-CyoxPiTg.js} +1 -1
- package/dist/{index-UMbs0jPr.js → index-DKwuTFYj.js} +377 -378
- package/dist/{index-DDhLWdaz.js → index-DNUXf4K4.js} +1 -1
- package/dist/{index-CAeOFdez.js → index-DjShJtXp.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2413 -2522
- package/dist/{it-1Hy_Ay2j.js → it-BCKQ5Tu8.js} +6 -11
- package/dist/{it-FOaX_rku.cjs → it-CnHaoq-X.cjs} +1 -1
- package/dist/{ja-C7_PK2VE.js → ja-DC47Nkza.js} +13 -18
- package/dist/{ja-DW4_3EWp.cjs → ja-DpDF4IgX.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-C-jXKweM.cjs → ko-BMmVJHzm.cjs} +1 -1
- package/dist/{ko-BDOp6dFE.js → ko-ejUHA0Sw.js} +8 -13
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +1 -1
- package/dist/{modal-BBaPJhi-.js → modal-CKyUdeEz.js} +54 -58
- package/dist/modal-rou7pM0r.cjs +1 -0
- package/dist/{nl-CF5W2Rt4.js → nl-WjgpPUel.js} +6 -11
- package/dist/{nl-Ui8TT45t.cjs → nl-viDlnQWK.cjs} +1 -1
- package/dist/{notice-DTTyRbwh.js → notice-BS0d903Q.js} +385 -387
- package/dist/notice-MF7whf3_.cjs +2 -0
- package/dist/{pl-oLzT5Ole.js → pl-Cw4CYjK_.js} +3 -8
- package/dist/{pl-8PM7rn2L.cjs → pl-Vrfv_fGt.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-Bb0T3Cx1.js → pt-B4Rh_ZBF.js} +10 -15
- package/dist/{pt-kRRsG9-4.cjs → pt-CxQV74vS.cjs} +1 -1
- package/dist/{ru-C5AMF9a6.cjs → ru-BB3GRr_J.cjs} +1 -1
- package/dist/{ru-DwLv1myc.js → ru-DFHsLJ9b.js} +14 -19
- package/dist/{toolbar-D_LSJCtv.js → toolbar-D2J_NkKD.js} +1 -1
- package/dist/{toolbar-D6_MB1QI.cjs → toolbar-DRdm9W7H.cjs} +1 -1
- package/dist/{tr-DBQNjaPN.js → tr-Dbktyawl.js} +7 -12
- package/dist/{tr-BwgU2BAj.cjs → tr-mBiHcEl1.cjs} +1 -1
- package/dist/{translations-CG5-f9U8.js → translations-CaTkLRHu.js} +85 -93
- package/dist/{translations-t57jdjWu.js → translations-CpTeFtvW.js} +1 -1
- package/dist/{translations-D77sU1Wl.cjs → translations-ggnrzaCG.cjs} +1 -1
- package/dist/translations-h_OJS1Ut.cjs +1 -0
- package/dist/types/components/data/icon.d.ts +1 -1
- package/dist/types/components/data/page-drop-zone.d.ts +1 -1
- package/dist/types/components/data/unstyled-drop-zone.d.ts +1 -1
- package/dist/types/components/form/input/create-nullable-string-input.d.ts +24 -0
- package/dist/types/components/form/input/create-temporal-input.d.ts +54 -0
- package/dist/types/components/form/input/nullable-email-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-password-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-plain-date-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-time-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-text-area.d.ts +6 -4
- package/dist/types/components/form/input/nullable-text-input.d.ts +3 -4
- package/dist/types/components/form/input/nullable-url-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +1 -2
- package/dist/types/components/form/input/plain-date-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-date-time-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-time-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-year-month-input.d.ts +19 -3
- package/dist/types/components/json-schema/controls/shared-utils.d.ts +8 -0
- package/dist/types/components/json-schema/schema-conditionals.d.ts +26 -0
- package/dist/types/components/json-schema/schema-context.d.ts +4 -107
- package/dist/types/components/json-schema/schema-merge.d.ts +9 -0
- package/dist/types/components/json-schema/schema-types.d.ts +85 -0
- package/dist/{ur-s32jv4mP.cjs → ur-CZ5sgUP1.cjs} +1 -1
- package/dist/{ur-BmK_ieRn.js → ur-Cqh7AYnd.js} +9 -14
- package/dist/utils-U1aNOU3o.cjs +1 -0
- package/dist/utils-w_vUChhV.js +2454 -0
- package/dist/{vi-DK0Fj95H.js → vi-CLBp2oaY.js} +11 -16
- package/dist/{vi-B4qRKlRd.cjs → vi-Ki_Urj_E.cjs} +1 -1
- package/dist/{zh-CUEpc9yf.cjs → zh-C78OkbS0.cjs} +1 -1
- package/dist/{zh-Db8COSme.js → zh-CT4aGkgD.js} +8 -13
- package/package.json +5 -4
- package/dist/index-ClqyVDXY.cjs +0 -8
- package/dist/modal-O7QoP7Zv.cjs +0 -1
- package/dist/notice-DLDzwKkw.cjs +0 -2
- package/dist/translations-BAk3j4bi.cjs +0 -1
- package/dist/utils-CYMdxKSM.js +0 -2516
- package/dist/utils-DI_H4_Gm.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { makeProviderMark as
|
|
2
|
-
import { WhenInViewport as
|
|
3
|
-
import { b as
|
|
4
|
-
function
|
|
1
|
+
import { makeProviderMark as V, localStorageProp as j, computedOf as p, Use as R, html as f, attr as i, When as w, Fragment as y, aria as g, coalesce as H, style as D, prop as _, on as I, Value as $, Empty as L, WithElement as z, OnDispose as G, input as K, emitValue as S } from "@tempots/dom";
|
|
2
|
+
import { WhenInViewport as W, Query as J, ElementRect as Q } from "@tempots/ui";
|
|
3
|
+
import { b as Y, g as Z } from "./colors-BW19rWA1.js";
|
|
4
|
+
function X(t, {
|
|
5
5
|
units: e = ["B", "KB", "MB", "GB", "TB"],
|
|
6
6
|
decimalPlaces: n = 0,
|
|
7
7
|
locale: o
|
|
@@ -29,7 +29,7 @@ function E(t, {
|
|
|
29
29
|
maximumFractionDigits: a === 0 ? 0 : n
|
|
30
30
|
}).format(r).replace("byte", e[a]);
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const O = {
|
|
33
33
|
loadingExtended: "Loading, please wait",
|
|
34
34
|
loadingShort: "Loading...",
|
|
35
35
|
locale: "Locale",
|
|
@@ -92,17 +92,12 @@ const N = {
|
|
|
92
92
|
if (t || e) {
|
|
93
93
|
const a = [];
|
|
94
94
|
if (t != null && t > 1 && a.push(`up to ${t} files`), e && n) {
|
|
95
|
-
const r =
|
|
95
|
+
const r = X(e, {
|
|
96
96
|
units: n
|
|
97
97
|
});
|
|
98
98
|
a.push(`max ${r} each`);
|
|
99
99
|
}
|
|
100
100
|
a.length > 0 && (o += ` (${a.join(", ")})`);
|
|
101
|
-
} else if (e && n) {
|
|
102
|
-
const a = E(e, {
|
|
103
|
-
units: n
|
|
104
|
-
});
|
|
105
|
-
o += ` (max ${a})`;
|
|
106
101
|
}
|
|
107
102
|
return o;
|
|
108
103
|
},
|
|
@@ -123,8 +118,8 @@ const N = {
|
|
|
123
118
|
}
|
|
124
119
|
}, tt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
125
120
|
__proto__: null,
|
|
126
|
-
default:
|
|
127
|
-
}, Symbol.toStringTag, { value: "Module" })), et =
|
|
121
|
+
default: O
|
|
122
|
+
}, Symbol.toStringTag, { value: "Module" })), et = O, ot = "en", nt = (t, e, n) => {
|
|
128
123
|
const o = t[e];
|
|
129
124
|
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((a, r) => {
|
|
130
125
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(r.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + e + (e.split("/").length !== n ? ". Note that variables only represent file names one level deep." : ""))));
|
|
@@ -155,19 +150,19 @@ const N = {
|
|
|
155
150
|
"in"
|
|
156
151
|
// Indonesian (deprecated, but sometimes confused)
|
|
157
152
|
]);
|
|
158
|
-
function
|
|
153
|
+
function A(t) {
|
|
159
154
|
if (!t) return "ltr";
|
|
160
155
|
const e = t.split(/[-_]/)[0].toLowerCase();
|
|
161
156
|
return rt.has(e) ? "rtl" : "ltr";
|
|
162
157
|
}
|
|
163
158
|
function at(t, e) {
|
|
164
|
-
return t === "auto" ?
|
|
159
|
+
return t === "auto" ? A(e) : t;
|
|
165
160
|
}
|
|
166
161
|
function jt(t) {
|
|
167
162
|
return `b-${t}`;
|
|
168
163
|
}
|
|
169
164
|
function Tt(t) {
|
|
170
|
-
return
|
|
165
|
+
return A(t) === "rtl";
|
|
171
166
|
}
|
|
172
167
|
function Et(t) {
|
|
173
168
|
return t === "ltr" ? "rtl" : "ltr";
|
|
@@ -190,12 +185,12 @@ function Vt(t, e) {
|
|
|
190
185
|
return st[e][t];
|
|
191
186
|
}
|
|
192
187
|
const lt = {
|
|
193
|
-
mark:
|
|
188
|
+
mark: V("Locale"),
|
|
194
189
|
create: (t) => {
|
|
195
|
-
const e =
|
|
190
|
+
const e = j({
|
|
196
191
|
defaultValue: navigator.language ?? "en-US",
|
|
197
192
|
key: "beatui-locale"
|
|
198
|
-
}), n =
|
|
193
|
+
}), n = j({
|
|
199
194
|
defaultValue: "auto",
|
|
200
195
|
key: "beatui-direction-preference"
|
|
201
196
|
}), o = p(
|
|
@@ -220,8 +215,8 @@ const lt = {
|
|
|
220
215
|
}, {
|
|
221
216
|
variants: it,
|
|
222
217
|
special: ct,
|
|
223
|
-
overrides:
|
|
224
|
-
} =
|
|
218
|
+
overrides: M
|
|
219
|
+
} = Y;
|
|
225
220
|
function k(t, e) {
|
|
226
221
|
switch (t) {
|
|
227
222
|
case "white":
|
|
@@ -231,26 +226,26 @@ function k(t, e) {
|
|
|
231
226
|
case "transparent":
|
|
232
227
|
return "transparent";
|
|
233
228
|
default:
|
|
234
|
-
return
|
|
229
|
+
return Z(t, e);
|
|
235
230
|
}
|
|
236
231
|
}
|
|
237
|
-
function
|
|
232
|
+
function N(t, e) {
|
|
238
233
|
const n = ct[t];
|
|
239
234
|
if (!n) return;
|
|
240
235
|
if (e === "light")
|
|
241
236
|
return n;
|
|
242
|
-
const o =
|
|
237
|
+
const o = M[t];
|
|
243
238
|
return o ? o[e] : n;
|
|
244
239
|
}
|
|
245
240
|
function x(t, e, n) {
|
|
246
|
-
const o =
|
|
241
|
+
const o = M[t];
|
|
247
242
|
if (o) {
|
|
248
243
|
const r = o[n];
|
|
249
244
|
if (r)
|
|
250
245
|
return { backgroundColor: r.backgroundColor, textColor: r.color };
|
|
251
246
|
}
|
|
252
247
|
if (e === "solid") {
|
|
253
|
-
const r =
|
|
248
|
+
const r = N(t, n);
|
|
254
249
|
if (r)
|
|
255
250
|
return {
|
|
256
251
|
backgroundColor: r.backgroundColor,
|
|
@@ -274,14 +269,14 @@ const ut = {
|
|
|
274
269
|
dark: { shade: 600, textColor: "var(--text-normal-dark)" }
|
|
275
270
|
};
|
|
276
271
|
function m(t, e, n) {
|
|
277
|
-
const o =
|
|
272
|
+
const o = M[t];
|
|
278
273
|
if (o) {
|
|
279
274
|
const r = o[n];
|
|
280
275
|
if (r)
|
|
281
276
|
return { backgroundColor: r.backgroundColor, textColor: r.color };
|
|
282
277
|
}
|
|
283
278
|
if (e === "solid") {
|
|
284
|
-
const r =
|
|
279
|
+
const r = N(t, n);
|
|
285
280
|
if (r)
|
|
286
281
|
return {
|
|
287
282
|
backgroundColor: r.backgroundColor,
|
|
@@ -299,7 +294,7 @@ function m(t, e, n) {
|
|
|
299
294
|
textColor: a.textColor
|
|
300
295
|
};
|
|
301
296
|
}
|
|
302
|
-
function
|
|
297
|
+
function T(t, e) {
|
|
303
298
|
const n = e === "light" ? 500 : 600;
|
|
304
299
|
switch (t) {
|
|
305
300
|
case "white":
|
|
@@ -315,10 +310,10 @@ function V(t, e) {
|
|
|
315
310
|
function C(t, e) {
|
|
316
311
|
return t === "white" ? "var(--color-white)" : t === "black" ? "var(--color-black)" : t === "transparent" ? "inherit" : k(t, e === "light" ? 800 : 200);
|
|
317
312
|
}
|
|
318
|
-
function
|
|
313
|
+
function E(t, e, n) {
|
|
319
314
|
return e === "soft" ? k(t, n === "light" ? 300 : 700) : k(t, n === "light" ? 500 : 600);
|
|
320
315
|
}
|
|
321
|
-
const bt = "bui-icons", B = /* @__PURE__ */ new Map(),
|
|
316
|
+
const bt = "bui-icons", B = /* @__PURE__ */ new Map(), q = (() => {
|
|
322
317
|
try {
|
|
323
318
|
return typeof indexedDB < "u" && indexedDB !== null;
|
|
324
319
|
} catch {
|
|
@@ -326,7 +321,7 @@ const bt = "bui-icons", B = /* @__PURE__ */ new Map(), H = (() => {
|
|
|
326
321
|
}
|
|
327
322
|
})();
|
|
328
323
|
function gt() {
|
|
329
|
-
return
|
|
324
|
+
return q ? new Promise((t, e) => {
|
|
330
325
|
const n = indexedDB.open(bt, 1);
|
|
331
326
|
n.onupgradeneeded = function(o) {
|
|
332
327
|
const a = o.target.result;
|
|
@@ -338,34 +333,36 @@ function gt() {
|
|
|
338
333
|
};
|
|
339
334
|
}) : Promise.reject(new Error("IndexedDB not available"));
|
|
340
335
|
}
|
|
341
|
-
const P =
|
|
342
|
-
function ft(t, e) {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
r.
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
351
|
-
B.set(t, e)
|
|
352
|
-
|
|
353
|
-
|
|
336
|
+
const P = q ? gt() : null;
|
|
337
|
+
async function ft(t, e) {
|
|
338
|
+
try {
|
|
339
|
+
if (P) {
|
|
340
|
+
const n = await P;
|
|
341
|
+
return new Promise((o, a) => {
|
|
342
|
+
const r = n.transaction("icons", "readwrite");
|
|
343
|
+
r.objectStore("icons").put(e, t), r.oncomplete = () => o(), r.onerror = a;
|
|
344
|
+
});
|
|
345
|
+
} else
|
|
346
|
+
B.set(t, e);
|
|
347
|
+
} catch {
|
|
348
|
+
B.set(t, e);
|
|
349
|
+
}
|
|
354
350
|
}
|
|
355
|
-
function pt(t) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
351
|
+
async function pt(t) {
|
|
352
|
+
try {
|
|
353
|
+
if (P) {
|
|
354
|
+
const e = await P;
|
|
355
|
+
return new Promise((n, o) => {
|
|
356
|
+
const s = e.transaction("icons", "readonly").objectStore("icons").get(t);
|
|
360
357
|
s.onsuccess = function() {
|
|
361
|
-
|
|
362
|
-
}, s.onerror =
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
358
|
+
n(s.result);
|
|
359
|
+
}, s.onerror = o;
|
|
360
|
+
});
|
|
361
|
+
} else
|
|
362
|
+
return B.get(t) || null;
|
|
363
|
+
} catch {
|
|
364
|
+
return B.get(t) || null;
|
|
365
|
+
}
|
|
369
366
|
}
|
|
370
367
|
async function mt(t) {
|
|
371
368
|
const e = `https://api.iconify.design/${t}.svg`;
|
|
@@ -387,10 +384,10 @@ function vt(t) {
|
|
|
387
384
|
}
|
|
388
385
|
function xt(t, e = "solid") {
|
|
389
386
|
if (!t) return "";
|
|
390
|
-
const n =
|
|
387
|
+
const n = E(t, e, "light"), o = E(t, e, "dark");
|
|
391
388
|
return `--icon-color: ${n}; --icon-color-dark: ${o}`;
|
|
392
389
|
}
|
|
393
|
-
function
|
|
390
|
+
function U({
|
|
394
391
|
icon: t,
|
|
395
392
|
size: e = "md",
|
|
396
393
|
color: n,
|
|
@@ -402,7 +399,7 @@ function G({
|
|
|
402
399
|
a,
|
|
403
400
|
o
|
|
404
401
|
)((l, u) => l === "decorative" ? !1 : l === "informative" ? !0 : u != null && u !== "");
|
|
405
|
-
return
|
|
402
|
+
return R(
|
|
406
403
|
F,
|
|
407
404
|
(l) => f.span(
|
|
408
405
|
i.class(
|
|
@@ -421,13 +418,13 @@ function G({
|
|
|
421
418
|
c,
|
|
422
419
|
() => y(
|
|
423
420
|
i.role("img"),
|
|
424
|
-
g.label(
|
|
421
|
+
g.label(H(o, l.$.iconDescription))
|
|
425
422
|
),
|
|
426
423
|
() => g.hidden(!0)
|
|
427
424
|
),
|
|
428
|
-
|
|
425
|
+
W(
|
|
429
426
|
{ once: !0 },
|
|
430
|
-
() =>
|
|
427
|
+
() => J({
|
|
431
428
|
request: t,
|
|
432
429
|
load: ({ request: u }) => kt(u),
|
|
433
430
|
convertError: String,
|
|
@@ -510,7 +507,7 @@ function wt(t, e, n) {
|
|
|
510
507
|
break;
|
|
511
508
|
}
|
|
512
509
|
case "outline": {
|
|
513
|
-
o.set("--button-bg", "transparent"), o.set("--button-bg-dark", "transparent"), o.set("--button-border",
|
|
510
|
+
o.set("--button-bg", "transparent"), o.set("--button-bg-dark", "transparent"), o.set("--button-border", T(e, "light")), o.set("--button-border-dark", T(e, "dark")), o.set("--button-text", C(e, "light")), o.set("--button-text-dark", C(e, "dark")), o.set(
|
|
514
511
|
"--button-text-shadow",
|
|
515
512
|
"var(--text-shadow-button-light, var(--text-shadow-xs))"
|
|
516
513
|
), o.set(
|
|
@@ -563,8 +560,8 @@ function Rt({
|
|
|
563
560
|
},
|
|
564
561
|
fullWidth: l = !1
|
|
565
562
|
}, ...u) {
|
|
566
|
-
const b =
|
|
567
|
-
return
|
|
563
|
+
const b = _(null);
|
|
564
|
+
return R(
|
|
568
565
|
F,
|
|
569
566
|
(h) => f.button(
|
|
570
567
|
i.type(t),
|
|
@@ -590,7 +587,7 @@ function Rt({
|
|
|
590
587
|
D.height(
|
|
591
588
|
b.map((d) => d == null ? "" : `${d.height}px`)
|
|
592
589
|
),
|
|
593
|
-
|
|
590
|
+
U({ icon: "line-md:loading-twotone-loop", size: a ?? "md" }),
|
|
594
591
|
// Hidden live region for screen reader announcements
|
|
595
592
|
f.span(
|
|
596
593
|
i.class("sr-only"),
|
|
@@ -602,13 +599,9 @@ function Rt({
|
|
|
602
599
|
),
|
|
603
600
|
w(
|
|
604
601
|
n != null,
|
|
605
|
-
() =>
|
|
606
|
-
(
|
|
607
|
-
|
|
608
|
-
L.get(n ?? !1) || b.set(v);
|
|
609
|
-
})
|
|
610
|
-
)
|
|
611
|
-
)
|
|
602
|
+
() => Q((d) => (d.on((v) => {
|
|
603
|
+
$.get(n ?? !1) || b.set(v);
|
|
604
|
+
}), L))
|
|
612
605
|
)
|
|
613
606
|
)
|
|
614
607
|
);
|
|
@@ -638,14 +631,13 @@ const Lt = ({
|
|
|
638
631
|
growInput: c = !0,
|
|
639
632
|
size: l
|
|
640
633
|
}, ...u) => {
|
|
641
|
-
const b =
|
|
634
|
+
const b = $.map(e ?? !1, (h) => h);
|
|
642
635
|
return f.div(
|
|
643
|
-
|
|
644
|
-
K((h) => {
|
|
636
|
+
z((h) => {
|
|
645
637
|
const d = () => {
|
|
646
638
|
h.querySelector(s)?.focus();
|
|
647
639
|
};
|
|
648
|
-
return h.addEventListener("click", d),
|
|
640
|
+
return h.addEventListener("click", d), G(() => h.removeEventListener("click", d));
|
|
649
641
|
}),
|
|
650
642
|
i.class(
|
|
651
643
|
p(
|
|
@@ -677,7 +669,7 @@ const Lt = ({
|
|
|
677
669
|
),
|
|
678
670
|
// attr.class('bc-input-container__input'),
|
|
679
671
|
i.class(
|
|
680
|
-
|
|
672
|
+
$.map(
|
|
681
673
|
c,
|
|
682
674
|
(h) => h ? "bc-input-container__input--grow" : ""
|
|
683
675
|
)
|
|
@@ -695,7 +687,7 @@ function Ot({
|
|
|
695
687
|
}) {
|
|
696
688
|
return f.span(
|
|
697
689
|
i.class("bc-input-container__icon"),
|
|
698
|
-
|
|
690
|
+
U({ icon: t, size: e, color: n })
|
|
699
691
|
);
|
|
700
692
|
}
|
|
701
693
|
const Dt = ({
|
|
@@ -726,13 +718,13 @@ const Dt = ({
|
|
|
726
718
|
const { value: e, onBlur: n, onChange: o, onInput: a } = t;
|
|
727
719
|
return Lt({
|
|
728
720
|
...t,
|
|
729
|
-
input:
|
|
721
|
+
input: K.text(
|
|
730
722
|
Dt(t),
|
|
731
723
|
i.value(e),
|
|
732
724
|
i.class("bc-input"),
|
|
733
|
-
n != null ? I.blur(
|
|
734
|
-
o != null ? I.change(
|
|
735
|
-
a != null ? I.input(
|
|
725
|
+
n != null ? I.blur(S(n)) : L,
|
|
726
|
+
o != null ? I.change(S(o)) : L,
|
|
727
|
+
a != null ? I.input(S(a)) : L
|
|
736
728
|
)
|
|
737
729
|
});
|
|
738
730
|
};
|
|
@@ -746,7 +738,7 @@ function Pt({
|
|
|
746
738
|
defaultMessages: n,
|
|
747
739
|
localeLoader: o
|
|
748
740
|
}) {
|
|
749
|
-
const a =
|
|
741
|
+
const a = _(e), r = _(n), s = t.on(async (c) => {
|
|
750
742
|
if (c === a.value) return;
|
|
751
743
|
a.set(c);
|
|
752
744
|
const l = Bt(c);
|
|
@@ -787,7 +779,7 @@ function St({
|
|
|
787
779
|
providerName: o = "I18nProvider"
|
|
788
780
|
}) {
|
|
789
781
|
return {
|
|
790
|
-
mark:
|
|
782
|
+
mark: V(o),
|
|
791
783
|
create: (a, r) => {
|
|
792
784
|
const {
|
|
793
785
|
value: { locale: s }
|
|
@@ -807,13 +799,13 @@ function St({
|
|
|
807
799
|
const F = St({
|
|
808
800
|
defaultLocale: ot,
|
|
809
801
|
defaultMessages: et,
|
|
810
|
-
localeLoader: async (t) => (await nt(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./ar-
|
|
802
|
+
localeLoader: async (t) => (await nt(/* @__PURE__ */ Object.assign({ "./locales/ar.ts": () => import("./ar-DrBp_VwJ.js"), "./locales/de.ts": () => import("./de-B5oZoraI.js"), "./locales/en.ts": () => Promise.resolve().then(() => tt), "./locales/es.ts": () => import("./es-DRc5dc_G.js"), "./locales/fa.ts": () => import("./fa-B0VDVs5B.js"), "./locales/fr.ts": () => import("./fr-DXlfWwI6.js"), "./locales/he.ts": () => import("./he-BX-Az8As.js"), "./locales/hi.ts": () => import("./hi-w4uL7LN1.js"), "./locales/it.ts": () => import("./it-BCKQ5Tu8.js"), "./locales/ja.ts": () => import("./ja-DC47Nkza.js"), "./locales/ko.ts": () => import("./ko-ejUHA0Sw.js"), "./locales/nl.ts": () => import("./nl-WjgpPUel.js"), "./locales/pl.ts": () => import("./pl-Cw4CYjK_.js"), "./locales/pt.ts": () => import("./pt-B4Rh_ZBF.js"), "./locales/ru.ts": () => import("./ru-DFHsLJ9b.js"), "./locales/tr.ts": () => import("./tr-Dbktyawl.js"), "./locales/ur.ts": () => import("./ur-Cqh7AYnd.js"), "./locales/vi.ts": () => import("./vi-CLBp2oaY.js"), "./locales/zh.ts": () => import("./zh-CT4aGkgD.js") }), `./locales/${t}.ts`, 3)).default,
|
|
811
803
|
providerName: "BeatUII18n"
|
|
812
804
|
});
|
|
813
805
|
export {
|
|
814
806
|
Rt as B,
|
|
815
807
|
Dt as C,
|
|
816
|
-
|
|
808
|
+
U as I,
|
|
817
809
|
lt as L,
|
|
818
810
|
At as T,
|
|
819
811
|
nt as _,
|
|
@@ -822,18 +814,18 @@ export {
|
|
|
822
814
|
Ot as c,
|
|
823
815
|
et as d,
|
|
824
816
|
x as e,
|
|
825
|
-
|
|
817
|
+
X as f,
|
|
826
818
|
It as g,
|
|
827
|
-
|
|
819
|
+
T as h,
|
|
828
820
|
m as i,
|
|
829
821
|
Ct as j,
|
|
830
822
|
wt as k,
|
|
831
823
|
ot as l,
|
|
832
824
|
St as m,
|
|
833
|
-
|
|
825
|
+
q as n,
|
|
834
826
|
pt as o,
|
|
835
827
|
Pt as p,
|
|
836
|
-
q,
|
|
828
|
+
A as q,
|
|
837
829
|
at as r,
|
|
838
830
|
ft as s,
|
|
839
831
|
C as t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./translations-h_OJS1Ut.cjs"),s={signInTitle:"Sign In",signInButton:"Sign In",emailLabel:"Email",passwordLabel:"Password",rememberMeLabel:"Remember me",forgotPasswordLink:"Forgot password?",noAccountLink:"Don't have an account? Sign up",signUpTitle:"Sign Up",signUpButton:"Sign Up",nameLabel:"Name",confirmPasswordLabel:"Confirm Password",acceptTermsLabel:"I accept the terms and conditions",hasAccountLink:"Already have an account? Sign in",resetPasswordTitle:"Reset Password",resetPasswordButton:"Reset Password",resetPasswordDescription:"Enter your email to reset your password.",backToSignInLink:"Back to sign in",continueWithProvider:e=>`Continue with ${e}`,passwordStrengthWeak:"Weak",passwordStrengthFair:"Fair",passwordStrengthGood:"Good",passwordStrengthStrong:"Strong",orDivider:"or",error:"An error occurred",required:"Required",authenticationTitle:"Authentication"},o=Object.freeze(Object.defineProperty({__proto__:null,default:s},Symbol.toStringTag,{value:"Module"})),t=s,n="en",i=r.makeI18nProvider({defaultLocale:n,defaultMessages:t,localeLoader:async e=>(await r.__variableDynamicImportRuntimeHelper(Object.assign({"./locales/ar.ts":()=>Promise.resolve().then(()=>require("./ar-BsUm-TCn.cjs")),"./locales/de.ts":()=>Promise.resolve().then(()=>require("./de-BUFLEyKr.cjs")),"./locales/en.ts":()=>Promise.resolve().then(()=>o),"./locales/es.ts":()=>Promise.resolve().then(()=>require("./es-BxBeTRCv.cjs")),"./locales/fa.ts":()=>Promise.resolve().then(()=>require("./fa-DxPseW3g.cjs")),"./locales/fr.ts":()=>Promise.resolve().then(()=>require("./fr-Cdyopuz3.cjs")),"./locales/he.ts":()=>Promise.resolve().then(()=>require("./he-DarDNPn0.cjs")),"./locales/hi.ts":()=>Promise.resolve().then(()=>require("./hi-tATwsXJ6.cjs")),"./locales/it.ts":()=>Promise.resolve().then(()=>require("./it-BmFag7j0.cjs")),"./locales/ja.ts":()=>Promise.resolve().then(()=>require("./ja-Dj-bAKLf.cjs")),"./locales/ko.ts":()=>Promise.resolve().then(()=>require("./ko-BomUE-yQ.cjs")),"./locales/nl.ts":()=>Promise.resolve().then(()=>require("./nl-Dr-l6zUy.cjs")),"./locales/pl.ts":()=>Promise.resolve().then(()=>require("./pl-BK0i_yvq.cjs")),"./locales/pt.ts":()=>Promise.resolve().then(()=>require("./pt-oBMmVYcu.cjs")),"./locales/ru.ts":()=>Promise.resolve().then(()=>require("./ru-CtxMmoa6.cjs")),"./locales/tr.ts":()=>Promise.resolve().then(()=>require("./tr-CgJ8uhZu.cjs")),"./locales/ur.ts":()=>Promise.resolve().then(()=>require("./ur-DvqAg9gW.cjs")),"./locales/vi.ts":()=>Promise.resolve().then(()=>require("./vi-D5R3YcU0.cjs")),"./locales/zh.ts":()=>Promise.resolve().then(()=>require("./zh-CCGXcj5r.cjs"))}),`./locales/${e}.ts`,3)).default,providerName:"AuthI18n"});exports.AuthI18n=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("@tempots/dom"),C=require("@tempots/ui"),S=require("./colors-tmKn7dR5.cjs");function q(t,{units:e=["B","KB","MB","GB","TB"],decimalPlaces:n=0,locale:o}={}){if(t===0||t===0n)return new Intl.NumberFormat(o,{style:"unit",unit:"byte",unitDisplay:"short",maximumFractionDigits:0}).format(0).replace("byte",e[0]);let s,a;if(typeof t=="bigint"){let i=t<0n?-t:t;for(s=0;i>=1024n&&s<e.length-1;)i=i/1024n,s++;a=Number(t)/Math.pow(1024,s)}else s=Math.floor(Math.log(Math.abs(t))/Math.log(1024)),s=Math.min(s,e.length-1),a=t/Math.pow(1024,s);return new Intl.NumberFormat(o,{style:"unit",unit:"byte",unitDisplay:"short",minimumFractionDigits:s===0?0:n,maximumFractionDigits:s===0?0:n}).format(a).replace("byte",e[s])}const _={loadingExtended:"Loading, please wait",loadingShort:"Loading...",locale:"Locale",iconDescription:"Icon",loadingIcon:"Loading icon",failedToLoadIcon:"Failed to load icon",editLabel:"Edit",selectOne:"Select one",selectMany:"Select many",noResults:"No results",passwordPlaceholderText:"Secret Password",togglePasswordVisibility:"Toggle password visibility",toggleMenu:"Toggle menu",toggleAside:"Toggle aside",mainNavigation:"Main navigation",sidebar:"Sidebar",closeDrawer:"Close drawer",closeModal:"Close modal",confirm:"Confirm",cancel:"Cancel",addLabel:"Add",removeItem:"Remove item",currentLocale:"English",ar:"Arabic",de:"German",en:"English",es:"Spanish",fr:"French",hi:"Hindi",it:"Italian",ja:"Japanese",ko:"Korean",nl:"Dutch",pl:"Polish",pt:"Portuguese",ru:"Russian",tr:"Turkish",vi:"Vietnamese",zh:"Chinese",he:"Hebrew",fa:"Persian",ur:"Urdu",emailPlaceholderText:"Enter your email",incrementValue:"Increment value",decrementValue:"Decrement value",dropZoneInstructions:t=>t?"Click to choose or drag files here, or press Enter or Space to open file selector":"Drag files here",fileSizeUnits:["Bytes","KB","MB","GB","TB"],removeFile:"Remove file",clearAllFiles:"Clear all files",clearValue:"Reset",unknownType:"Unknown type",filesInputInstructions:(t,e,n)=>{let o=t==null||t>1?"Click to choose or drag files here":"Click to choose or drag a file here";if(t||e){const s=[];if(t!=null&&t>1&&s.push(`up to ${t} files`),e&&n){const a=q(e,{units:n});s.push(`max ${a} each`)}s.length>0&&(o+=` (${s.join(", ")})`)}return o},prosemirror:{bold:"Bold",italic:"Italic",code:"Inline code",link:"Insert link",removeLink:"Remove link",heading:t=>`Heading ${t}`,bulletList:"Bullet list",orderedList:"Ordered list",blockquote:"Blockquote",codeBlock:"Code block",horizontalRule:"Horizontal rule",linkUrlPlaceholder:"https://example.com"}},K=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"})),M=_,V="en",$=(t,e,n)=>{const o=t[e];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((s,a)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(a.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},Y=new Set(["ar","he","fa","ur","ps","sd","ku","dv","yi","ji","iw","in"]);function y(t){if(!t)return"ltr";const e=t.split(/[-_]/)[0].toLowerCase();return Y.has(e)?"rtl":"ltr"}function O(t,e){return t==="auto"?y(e):t}function J(t){return`b-${t}`}function Q(t){return y(t)==="rtl"}function Z(t){return t==="ltr"?"rtl":"ltr"}const E={ltr:{"inline-start":"left","inline-end":"right","block-start":"top","block-end":"bottom"},rtl:{"inline-start":"right","inline-end":"left","block-start":"top","block-end":"bottom"}};function X(t,e){return E[e][t]}const T={mark:r.makeProviderMark("Locale"),create:t=>{const e=r.localStorageProp({defaultValue:navigator.language??"en-US",key:"beatui-locale"}),n=r.localStorageProp({defaultValue:"auto",key:"beatui-direction-preference"}),o=r.computedOf(e,n)((a,l)=>O(l,a));return{value:{locale:e,setLocale:a=>e.set(a),direction:o,directionPreference:n,setDirectionPreference:a=>n.set(a)},dispose:()=>{e.dispose(),n.dispose(),o.dispose()}}}},{variants:tt,special:et,overrides:I}=S.backgroundConfig;function m(t,e){switch(t){case"white":return"var(--color-white)";case"black":return"var(--color-black)";case"transparent":return"transparent";default:return S.getColorVar(t,e)}}function j(t,e){const n=et[t];if(!n)return;if(e==="light")return n;const o=I[t];return o?o[e]:n}function f(t,e,n){const o=I[t];if(o){const a=o[n];if(a)return{backgroundColor:a.backgroundColor,textColor:a.color}}if(e==="solid"){const a=j(t,n);if(a)return{backgroundColor:a.backgroundColor,textColor:a.color}}const s=tt[e][n];return{backgroundColor:m(t,s.bgShade),textColor:s.textColor}}const rt={light:{shade:600,textColor:"var(--color-white)"},dark:{shade:600,textColor:"var(--text-inverted-dark)"}},ot={light:{shade:300,textColor:"var(--text-normal-light)"},dark:{shade:700,textColor:"var(--text-normal-dark)"}},nt={light:{shade:400,textColor:"var(--text-normal-light)"},dark:{shade:600,textColor:"var(--text-normal-dark)"}};function b(t,e,n){const o=I[t];if(o){const a=o[n];if(a)return{backgroundColor:a.backgroundColor,textColor:a.color}}if(e==="solid"){const a=j(t,n);if(a)return{backgroundColor:a.backgroundColor,textColor:a.color};const l=rt[n];return{backgroundColor:m(t,l.shade),textColor:l.textColor}}const s=e==="light"?ot[n]:nt[n];return{backgroundColor:m(t,s.shade),textColor:s.textColor}}function w(t,e){const n=e==="light"?500:600;switch(t){case"white":return e==="light"?"var(--text-inverse-light)":"var(--text-inverted-dark)";case"black":return"var(--color-black)";case"transparent":return"transparent";default:return m(t,n)}}function p(t,e){return t==="white"?"var(--color-white)":t==="black"?"var(--color-black)":t==="transparent"?"inherit":m(t,e==="light"?800:200)}function B(t,e,n){return e==="soft"?m(t,n==="light"?300:700):m(t,n==="light"?500:600)}const at="bui-icons",k=new Map,P=(()=>{try{return typeof indexedDB<"u"&&indexedDB!==null}catch{return!1}})();function st(){return P?new Promise((t,e)=>{const n=indexedDB.open(at,1);n.onupgradeneeded=function(o){const s=o.target.result;s.objectStoreNames.contains("icons")||s.createObjectStore("icons")},n.onsuccess=function(){t(n.result)},n.onerror=function(){e(n.error)}}):Promise.reject(new Error("IndexedDB not available"))}const x=P?st():null;async function R(t,e){try{if(x){const n=await x;return new Promise((o,s)=>{const a=n.transaction("icons","readwrite");a.objectStore("icons").put(e,t),a.oncomplete=()=>o(),a.onerror=s})}else k.set(t,e)}catch{k.set(t,e)}}async function A(t){try{if(x){const e=await x;return new Promise((n,o)=>{const l=e.transaction("icons","readonly").objectStore("icons").get(t);l.onsuccess=function(){n(l.result)},l.onerror=o})}else return k.get(t)||null}catch{return k.get(t)||null}}async function lt(t){const e=`https://api.iconify.design/${t}.svg`;return fetch(e).then(n=>{if(n.status===200)return n.text();throw new Error(`Failed to load icon: ${t}`)})}async function it(t){const e=t.replace(":","/"),n=await A(e);if(n)return n;const o=await lt(e);return await R(e,o),o}function ct(t){return["bc-icon",`bc-icon--${t}`].join(" ")}function ut(t,e="solid"){if(!t)return"";const n=B(t,e,"light"),o=B(t,e,"dark");return`--icon-color: ${n}; --icon-color-dark: ${o}`}function L({icon:t,size:e="md",color:n,title:o,accessibility:s="auto",tone:a="solid"},...l){const c=r.computedOf(s,o)((i,u)=>i==="decorative"?!1:i==="informative"?!0:u!=null&&u!=="");return r.Use(D,i=>r.html.span(r.attr.class(r.computedOf(e,n)(u=>ct(u??"md"))),r.attr.style(r.computedOf(n,a)((u,g)=>ut(u??void 0,g??"solid"))),r.When(c,()=>r.Fragment(r.attr.role("img"),r.aria.label(r.coalesce(o,i.$.iconDescription))),()=>r.aria.hidden(!0)),C.WhenInViewport({once:!0},()=>C.Query({request:t,load:({request:u})=>it(u),convertError:String,success:({value:u})=>r.html.span(r.style.width("100%"),r.style.height("100%"),r.attr.innerHTML(u)),pending:()=>r.html.span(r.attr.class("animate-spin"),r.When(c,()=>r.Fragment(r.attr.role("img"),r.aria.label(i.$.loadingIcon)),()=>r.aria.hidden(!0)),"↻"),failure:({error:u})=>r.html.span(r.attr.title(u),r.attr.class("text-red-500"),r.When(c,()=>r.Fragment(r.attr.role("img"),r.aria.label(i.$.failedToLoadIcon)),()=>r.aria.hidden(!0)),"🚫")})),...l))}function F(t,e,n,o){const s=["bc-button",`bc-button--size-${t}`,`bc-control--padding-${t}`,`bc-control--rounded-${e}`];return n&&s.push("bc-button--loading"),o&&s.push("bc-button--full-width"),s.join(" ")}function N(t,e,n){const o=new Map;o.set("--button-text-shadow","var(--text-shadow-none)"),o.set("--button-text-shadow-dark","var(--text-shadow-none)");const s=(a,l,c,i)=>{n||(o.set("--button-bg-hover",a),o.set("--button-text-hover",c),o.set("--button-bg-hover-dark",l),o.set("--button-text-hover-dark",i))};switch(t){case"filled":{const a=f(e,"solid","light"),l=f(e,"solid","dark");o.set("--button-bg",a.backgroundColor),o.set("--button-text",a.textColor),o.set("--button-bg-dark",l.backgroundColor),o.set("--button-text-dark",l.textColor),o.set("--button-text-shadow","var(--text-shadow-button-filled, var(--text-shadow-sm))"),o.set("--button-text-shadow-dark","var(--text-shadow-button-filled, var(--text-shadow-sm))");const c=b(e,"solid","light"),i=b(e,"solid","dark");s(c.backgroundColor,i.backgroundColor,c.textColor,i.textColor);break}case"light":{const a=f(e,"light","light"),l=f(e,"light","dark");o.set("--button-bg",a.backgroundColor),o.set("--button-text",a.textColor),o.set("--button-bg-dark",l.backgroundColor),o.set("--button-text-dark",l.textColor);const c=b(e,"light","light"),i=b(e,"light","dark");s(c.backgroundColor,i.backgroundColor,c.textColor,i.textColor);break}case"outline":{o.set("--button-bg","transparent"),o.set("--button-bg-dark","transparent"),o.set("--button-border",w(e,"light")),o.set("--button-border-dark",w(e,"dark")),o.set("--button-text",p(e,"light")),o.set("--button-text-dark",p(e,"dark")),o.set("--button-text-shadow","var(--text-shadow-button-light, var(--text-shadow-xs))"),o.set("--button-text-shadow-dark","var(--text-shadow-button-light, var(--text-shadow-xs))");const a=b(e,"light","light"),l=b(e,"light","dark");s(a.backgroundColor,l.backgroundColor,a.textColor,l.textColor);break}case"default":{const a=f("neutral","light","light"),l=f("neutral","light","dark");o.set("--button-bg",a.backgroundColor),o.set("--button-text",p(e,"light")),o.set("--button-bg-dark",l.backgroundColor),o.set("--button-text-dark",p(e,"dark")),o.set("--button-text-shadow","var(--text-shadow-button-default, var(--text-shadow-2xs))"),o.set("--button-text-shadow-dark","var(--text-shadow-button-default, var(--text-shadow-2xs))");const c=b("base","light","light"),i=b("base","light","dark");s(c.backgroundColor,i.backgroundColor,o.get("--button-text")??a.textColor,o.get("--button-text-dark")??l.textColor);break}case"text":{o.set("--button-bg","transparent"),o.set("--button-bg-dark","transparent"),o.set("--button-text",p(e,"light")),o.set("--button-text-dark",p(e,"dark")),n||o.set("--button-hover-decoration","underline");break}}return Array.from(o.entries()).map(([a,l])=>`${a}: ${l}`).join("; ")}function dt({type:t="button",disabled:e=!1,loading:n=!1,variant:o="filled",size:s="md",color:a="base",roundedness:l="sm",onClick:c=()=>{},fullWidth:i=!1},...u){const g=r.prop(null);return r.Use(D,h=>r.html.button(r.attr.type(t),r.attr.disabled(r.computedOf(e,n)((d,v)=>d||v)),r.aria.busy(n??!1),r.When(n??!1,()=>r.aria.label(h.$.loadingExtended)),r.attr.class(r.computedOf(s,l,n,i)(F)),r.attr.style(r.computedOf(o,a,e)(N)),r.When(n??!1,()=>r.Fragment(r.style.width(g.map(d=>d==null?"":`${d.width}px`)),r.style.height(g.map(d=>d==null?"":`${d.height}px`)),L({icon:"line-md:loading-twotone-loop",size:s??"md"}),r.html.span(r.attr.class("sr-only"),r.aria.live("polite"),h.$.loadingExtended)),()=>r.Fragment(r.on.click(c),...u)),r.When(n!=null,()=>C.ElementRect(d=>(d.on(v=>{r.Value.get(n??!1)||g.set(v)}),r.Empty)))))}function ht(t,e,n){const o=[t?"bc-base-input-container":"bc-input-container"];return e?o.push(t?"bc-base-input-container--disabled":"bc-input-container--disabled"):o.push(t?"bc-base-input-container--default":"bc-input-container--default"),n&&o.push("bc-input-container--error"),o.join(" ")}function U(t,e){const n=["bc-input-container__input"];return t||(n.push(`bc-control--padding-${e}`),n.push(`bc-control--text-size-${e}`)),n.join(" ")}const H=({baseContainer:t,disabled:e,input:n,before:o,after:s,hasError:a,focusableSelector:l="input, select, textarea",growInput:c=!0,size:i},...u)=>{const g=r.Value.map(e??!1,h=>h);return r.html.div(r.WithElement(h=>{const d=()=>{h.querySelector(l)?.focus()};return h.addEventListener("click",d),r.OnDispose(()=>h.removeEventListener("click",d))}),r.attr.class(r.computedOf(t,g,a??!1)((h,d,v)=>ht(h??!1,d??!1,v??!1))),o!=null?r.html.span(r.attr.class("bc-input-container__before"),o):null,r.html.div(r.attr.class(r.computedOf(t,i??"md")((h,d)=>U(h??!1,d??"md"))),r.attr.class(r.Value.map(c,h=>h?"bc-input-container__input--grow":"")),n),s!=null?r.html.span(r.attr.class("bc-input-container__after"),s):null,...u)};function gt({icon:t,size:e="md",color:n="neutral"}){return r.html.span(r.attr.class("bc-input-container__icon"),L({icon:t,size:e,color:n}))}const W=({autocomplete:t,autofocus:e,class:n,disabled:o,name:s,placeholder:a,id:l,required:c,tabIndex:i,hasError:u})=>r.Fragment(r.attr.autocomplete(t),r.attr.autofocus(e),r.attr.class(n),r.attr.disabled(o),r.attr.name(s??l),r.attr.placeholder(a),r.attr.id(l),r.aria.required(c),r.attr.tabindex(i),u!=null?r.aria.invalid(u??!1):null),bt=t=>{const{value:e,onBlur:n,onChange:o,onInput:s}=t;return H({...t,input:r.input.text(W(t),r.attr.value(e),r.attr.class("bc-input"),n!=null?r.on.blur(r.emitValue(n)):r.Empty,o!=null?r.on.change(r.emitValue(o)):r.Empty,s!=null?r.on.input(r.emitValue(s)):r.Empty)})};function ft(t){const e=t.split("-"),n=[t];return e.length>1&&n.push(e[0]),n}function z({locale:t,defaultLocale:e="en-US",defaultMessages:n,localeLoader:o}){const s=r.prop(e),a=r.prop(n),l=t.on(async c=>{if(c===s.value)return;s.set(c);const i=ft(c);for(const u of i)try{const g=await o(u);if(typeof g.default=="object"&&Object.keys(g).length===1){console.error("It appears that you are trying to load a translation module without referencing the default export. Please use `(await import(...)).default` in your loader function.");return}if(c===s.value){a.set(g);return}}catch{continue}console.warn(`No locale found for "${t.value}", using fallback`),c===s.value&&a.set(n)});return{dispose:()=>{l(),s.dispose(),a.dispose()},t:a}}function G({defaultLocale:t,defaultMessages:e,localeLoader:n,providerName:o="I18nProvider"}){return{mark:r.makeProviderMark(o),create:(s,a)=>{const{value:{locale:l}}=a.getProvider(T.mark),{t:c,dispose:i}=z({locale:l,defaultMessages:e,defaultLocale:t,localeLoader:n});return{value:c,dispose:i}}}}const D=G({defaultLocale:V,defaultMessages:M,localeLoader:async t=>(await $(Object.assign({"./locales/ar.ts":()=>Promise.resolve().then(()=>require("./ar-BqnDsD9v.cjs")),"./locales/de.ts":()=>Promise.resolve().then(()=>require("./de-C_N0wtxQ.cjs")),"./locales/en.ts":()=>Promise.resolve().then(()=>K),"./locales/es.ts":()=>Promise.resolve().then(()=>require("./es-JnLMDtzg.cjs")),"./locales/fa.ts":()=>Promise.resolve().then(()=>require("./fa-BC16IdRL.cjs")),"./locales/fr.ts":()=>Promise.resolve().then(()=>require("./fr-BupZ6YnU.cjs")),"./locales/he.ts":()=>Promise.resolve().then(()=>require("./he-C-aQ2yoO.cjs")),"./locales/hi.ts":()=>Promise.resolve().then(()=>require("./hi-L3y3Aedb.cjs")),"./locales/it.ts":()=>Promise.resolve().then(()=>require("./it-CnHaoq-X.cjs")),"./locales/ja.ts":()=>Promise.resolve().then(()=>require("./ja-DpDF4IgX.cjs")),"./locales/ko.ts":()=>Promise.resolve().then(()=>require("./ko-BMmVJHzm.cjs")),"./locales/nl.ts":()=>Promise.resolve().then(()=>require("./nl-viDlnQWK.cjs")),"./locales/pl.ts":()=>Promise.resolve().then(()=>require("./pl-Vrfv_fGt.cjs")),"./locales/pt.ts":()=>Promise.resolve().then(()=>require("./pt-CxQV74vS.cjs")),"./locales/ru.ts":()=>Promise.resolve().then(()=>require("./ru-BB3GRr_J.cjs")),"./locales/tr.ts":()=>Promise.resolve().then(()=>require("./tr-mBiHcEl1.cjs")),"./locales/ur.ts":()=>Promise.resolve().then(()=>require("./ur-CZ5sgUP1.cjs")),"./locales/vi.ts":()=>Promise.resolve().then(()=>require("./vi-Ki_Urj_E.cjs")),"./locales/zh.ts":()=>Promise.resolve().then(()=>require("./zh-C78OkbS0.cjs"))}),`./locales/${t}.ts`,3)).default,providerName:"BeatUII18n"});exports.BeatUII18n=D;exports.Button=dt;exports.CommonInputAttributes=W;exports.Icon=L;exports.InputContainer=H;exports.InputIcon=gt;exports.LOGICAL_PROPERTY_MAP=E;exports.Locale=T;exports.TextInput=bt;exports.__variableDynamicImportRuntimeHelper=$;exports.backgroundValue=f;exports.borderColorValue=w;exports.defaultLocale=V;exports.defaultMessages=M;exports.formatFileSize=q;exports.generateButtonClasses=F;exports.generateButtonStyles=N;exports.generateInputContainerInputClasses=U;exports.getDirectionClassName=J;exports.getDirectionFromLocale=y;exports.getIconLocally=A;exports.getOppositeDirection=Z;exports.getPhysicalProperty=X;exports.hoverBackgroundValue=b;exports.isIndexedDBAvailable=P;exports.isRTLLocale=Q;exports.makeI18nProvider=G;exports.makeMessages=z;exports.resolveDirection=O;exports.storeIconLocally=R;exports.textColorValue=p;
|
|
@@ -3,7 +3,7 @@ import { IconSize } from '../theme';
|
|
|
3
3
|
import { ThemeColorName } from '@/tokens';
|
|
4
4
|
import { ForegroundTone } from '../theme/style-utils';
|
|
5
5
|
export declare const isIndexedDBAvailable: boolean;
|
|
6
|
-
export declare function storeIconLocally(id: string, svgString: string): Promise<
|
|
6
|
+
export declare function storeIconLocally(id: string, svgString: string): Promise<void>;
|
|
7
7
|
export declare function getIconLocally(id: string): Promise<string | null>;
|
|
8
8
|
export interface IconOptions {
|
|
9
9
|
icon: Value<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TNode, Value, Signal } from '@tempots/dom';
|
|
2
2
|
export type PageDropZoneOptions = {
|
|
3
|
-
onChange: (files: File[]) => void;
|
|
3
|
+
onChange: (files: File[], via: 'dragdrop' | 'click') => void;
|
|
4
4
|
accept?: Value<string>;
|
|
5
5
|
onDragContent?: (options: {
|
|
6
6
|
files: Signal<File[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TNode, Value, Signal } from '@tempots/dom';
|
|
2
2
|
export type DropZoneOptions = {
|
|
3
|
-
onChange: (files: File[]) => void;
|
|
3
|
+
onChange: (files: File[], via: 'dragdrop' | 'click') => void;
|
|
4
4
|
value?: Value<File[]>;
|
|
5
5
|
accept?: Value<string>;
|
|
6
6
|
enableClick?: Value<boolean>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Renderable } from '@tempots/dom';
|
|
2
|
+
import { InputOptions } from './input-options';
|
|
3
|
+
/**
|
|
4
|
+
* Converts empty string to null, preserving non-empty strings.
|
|
5
|
+
*/
|
|
6
|
+
export declare const emptyToNull: (value: string | null) => string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Converts null to empty string, preserving non-null strings.
|
|
9
|
+
*/
|
|
10
|
+
export declare const nullToEmpty: (value: null | string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Factory function to create nullable string input components.
|
|
13
|
+
* Eliminates duplication across nullable text-based inputs.
|
|
14
|
+
*
|
|
15
|
+
* @param BaseInput - The base input component (e.g., TextInput, EmailInput, PasswordInput)
|
|
16
|
+
* @returns A nullable version of the input component
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* export const NullableTextInput = createNullableStringInput(TextInput)
|
|
21
|
+
* export const NullableEmailInput = createNullableStringInput(EmailInput)
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function createNullableStringInput(BaseInput: (options: InputOptions<string>) => Renderable): (options: InputOptions<null | string>) => Renderable;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Renderable } from '@tempots/dom';
|
|
2
|
+
import { InputOptions } from './input-options';
|
|
3
|
+
import type { BeatUITemporal } from '@/temporal';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for creating a Temporal input component.
|
|
6
|
+
*/
|
|
7
|
+
export type TemporalInputConfig<T> = {
|
|
8
|
+
/**
|
|
9
|
+
* The HTML input type (e.g., 'date', 'time', 'datetime-local', 'month')
|
|
10
|
+
*/
|
|
11
|
+
inputType: 'date' | 'time' | 'datetime-local' | 'month';
|
|
12
|
+
/**
|
|
13
|
+
* Function to convert the Temporal value to a string for the input
|
|
14
|
+
*/
|
|
15
|
+
valueToString: (value: T) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Function to parse the input string value using Temporal API
|
|
18
|
+
*/
|
|
19
|
+
parseValue: (temporal: BeatUITemporal, value: string) => T;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Factory function to create Temporal input components.
|
|
23
|
+
* Eliminates duplication across PlainDate, PlainTime, PlainDateTime, PlainYearMonth, etc.
|
|
24
|
+
*
|
|
25
|
+
* @param config - Configuration for the Temporal input
|
|
26
|
+
* @returns A Temporal input component
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* export const PlainDateInput = createTemporalInput<PlainDate>({
|
|
31
|
+
* inputType: 'date',
|
|
32
|
+
* valueToString: v => v.toString(),
|
|
33
|
+
* parseValue: (T, v) => T.PlainDate.from(v),
|
|
34
|
+
* })
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function createTemporalInput<T>(config: TemporalInputConfig<T>): (options: InputOptions<T>) => Renderable;
|
|
38
|
+
/**
|
|
39
|
+
* Factory function to create nullable Temporal input components.
|
|
40
|
+
* Eliminates duplication across nullable Temporal inputs.
|
|
41
|
+
*
|
|
42
|
+
* @param config - Configuration for the Temporal input
|
|
43
|
+
* @returns A nullable Temporal input component
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* export const NullablePlainDateInput = createNullableTemporalInput<PlainDate>({
|
|
48
|
+
* inputType: 'date',
|
|
49
|
+
* valueToString: v => v.toString(),
|
|
50
|
+
* parseValue: (T, v) => T.PlainDate.from(v),
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function createNullableTemporalInput<T>(config: TemporalInputConfig<T>): (options: InputOptions<T | null>) => Renderable;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const NullableEmailInput: (options: InputOptions<null | string>) => import("@tempots/dom").Renderable;
|
|
1
|
+
export declare const NullableEmailInput: (options: import("./input-options").InputOptions<null | string>) => import("@tempots/dom").Renderable;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const NullablePasswordInput: (options: InputOptions<null | string>) => import("@tempots/dom").Renderable;
|
|
1
|
+
export declare const NullablePasswordInput: (options: import("./input-options").InputOptions<null | string>) => import("@tempots/dom").Renderable;
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
export declare const NullablePlainDateInput: (options: {
|
|
2
|
+
autocomplete?: import("@tempots/dom").Value<string> | undefined;
|
|
3
|
+
autofocus?: import("@tempots/dom").Value<boolean> | undefined;
|
|
4
|
+
class?: import("@tempots/dom").Value<string> | undefined;
|
|
5
|
+
disabled?: import("@tempots/dom").Value<boolean> | undefined;
|
|
6
|
+
hasError?: import("@tempots/dom").Value<boolean> | undefined;
|
|
7
|
+
name?: import("@tempots/dom").Value<string> | undefined;
|
|
8
|
+
placeholder?: import("@tempots/dom").Value<string> | undefined;
|
|
9
|
+
id?: import("@tempots/dom").Value<string> | undefined;
|
|
10
|
+
required?: import("@tempots/dom").Value<boolean> | undefined;
|
|
11
|
+
tabIndex?: import("@tempots/dom").Value<number> | undefined;
|
|
12
|
+
size?: import("@tempots/dom").Value<import("../../theme").ControlSize> | undefined;
|
|
13
|
+
value: import("@tempots/dom").Value<import("@js-temporal/polyfill").Temporal.PlainDate | null>;
|
|
14
|
+
before?: import("@tempots/dom").TNode;
|
|
15
|
+
after?: import("@tempots/dom").TNode;
|
|
16
|
+
onChange?: ((value: import("@js-temporal/polyfill").Temporal.PlainDate | null) => void) | undefined;
|
|
17
|
+
onInput?: ((value: import("@js-temporal/polyfill").Temporal.PlainDate | null) => void) | undefined;
|
|
18
|
+
onBlur?: (() => void) | undefined;
|
|
19
|
+
}) => import("@tempots/dom").Renderable;
|