@tempots/beatui 0.82.0 → 0.82.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/_commonjsHelpers-DKOUU3wS.cjs +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +63 -1351
- package/dist/auth-divider-BqZPH1-z.cjs +1 -0
- package/dist/auth-divider-Wr-S16kF.js +1355 -0
- package/dist/beatui.css +1347 -0
- package/dist/beatui.tailwind.css +1347 -0
- package/dist/better-auth/index.cjs.js +1 -0
- package/dist/better-auth/index.es.js +754 -0
- package/dist/{deep-merge-CiOwVWn8.js → deep-merge-BYm0y62g.js} +34 -33
- package/dist/deep-merge-d7sf0xmN.cjs +1 -0
- package/dist/duration-input-B9UNmUCh.cjs +1 -0
- package/dist/{duration-input-B3vnnwBZ.js → duration-input-DqcJbxKD.js} +23 -22
- package/dist/editor-toolbar-group--a-xgsJw.cjs +1 -0
- package/dist/editor-toolbar-group-CVpl5mxF.js +31 -0
- package/dist/{hls.light.min-Bhrf47iR.cjs → hls.light.min-C6xKDzRR.cjs} +1 -1
- package/dist/{hls.light.min-C6VwviEa.js → hls.light.min-hEMf_E8u.js} +1 -1
- package/dist/{index-C5YCCgnn.cjs → index-05UbKOYe.cjs} +1 -1
- package/dist/{index-ChsRjiIp.cjs → index-Bt7FYl80.cjs} +19 -19
- package/dist/{index-DT6-HMMz.js → index-C2Lq1m45.js} +1432 -1462
- package/dist/{index-CiAVfKIZ.js → index-lYhXnu6I.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2326 -2680
- package/dist/input-container-C6qEIjcA.cjs +1 -0
- package/dist/input-container-DiCjOzR2.js +247 -0
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +33 -32
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +542 -700
- package/dist/lexical/index.cjs.js +46 -0
- package/dist/lexical/index.es.js +21370 -0
- package/dist/lexical.css +1124 -0
- package/dist/menu-CZzRsQP_.js +372 -0
- package/dist/menu-ClrU72xH.cjs +1 -0
- package/dist/modal-I5srcntN.cjs +1 -0
- package/dist/modal-v3u2Fpnd.js +488 -0
- package/dist/{notice-CZHWWwOQ.js → notice-BuZvdvZh.js} +48 -47
- package/dist/notice-CLDdy1MW.cjs +1 -0
- package/dist/{oneof-branch-detection-C8g3eWnx.cjs → oneof-branch-detection-DsM1K5xc.cjs} +1 -1
- package/dist/{oneof-branch-detection-BVNoKU9d.js → oneof-branch-detection-Dt8ss9lc.js} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/session-id-3KiilioY.js +8 -0
- package/dist/session-id-B5lJMzbB.cjs +1 -0
- package/dist/styles-url-B2dzXrYt.cjs +1 -0
- package/dist/styles-url-Cw_mxshe.js +4 -0
- package/dist/text-input-B3VBat1k.js +44 -0
- package/dist/text-input-Ds8e7Z1G.cjs +1 -0
- package/dist/{toolbar-DR2Zd4Oo.js → toolbar-D994_E_s.js} +4 -4
- package/dist/toolbar-x0_8lmKu.cjs +1 -0
- package/dist/types/better-auth/bridge.d.ts +2 -0
- package/dist/types/better-auth/callbacks.d.ts +6 -0
- package/dist/types/better-auth/components/authenticated.d.ts +4 -0
- package/dist/types/better-auth/components/better-auth-container.d.ts +4 -0
- package/dist/types/better-auth/components/better-auth-modal.d.ts +4 -0
- package/dist/types/better-auth/components/magic-link-form.d.ts +7 -0
- package/dist/types/better-auth/components/passkey-management.d.ts +6 -0
- package/dist/types/better-auth/components/passkey-signin.d.ts +12 -0
- package/dist/types/better-auth/components/two-factor-setup.d.ts +8 -0
- package/dist/types/better-auth/components/two-factor-verify.d.ts +10 -0
- package/dist/types/better-auth/i18n/default.d.ts +29 -0
- package/dist/types/better-auth/i18n/locales/en.d.ts +28 -0
- package/dist/types/better-auth/i18n/translations.d.ts +27 -0
- package/dist/types/better-auth/index.d.ts +22 -0
- package/dist/types/better-auth/provider.d.ts +6 -0
- package/dist/types/better-auth/session.d.ts +14 -0
- package/dist/types/better-auth/social-mapping.d.ts +2 -0
- package/dist/types/better-auth/types.d.ts +164 -0
- package/dist/types/components/auth/auth-container.d.ts +1 -1
- package/dist/types/components/auth/social-providers.d.ts +1 -1
- package/dist/types/components/auth/types.d.ts +2 -0
- package/dist/types/components/editor-toolbar/editor-toolbar-button.d.ts +16 -0
- package/dist/types/components/editor-toolbar/editor-toolbar-group.d.ts +9 -0
- package/dist/types/components/editor-toolbar/index.d.ts +2 -0
- package/dist/types/components/json-structure/controls/control-utils.d.ts +19 -0
- package/dist/types/components/json-structure/controls/index.d.ts +1 -0
- package/dist/types/components/lexical/bare-editor.d.ts +29 -0
- package/dist/types/components/lexical/code/index.d.ts +1 -0
- package/dist/types/components/lexical/code/language-selector.d.ts +13 -0
- package/dist/types/components/lexical/contextual-editor.d.ts +22 -0
- package/dist/types/components/lexical/docked-editor.d.ts +23 -0
- package/dist/types/components/lexical/floating/block-handle.d.ts +16 -0
- package/dist/types/components/lexical/floating/floating-toolbar.d.ts +12 -0
- package/dist/types/components/lexical/floating/index.d.ts +6 -0
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +20 -0
- package/dist/types/components/lexical/index.d.ts +8 -0
- package/dist/types/components/lexical/lexical-editor-input.d.ts +30 -0
- package/dist/types/components/lexical/table/index.d.ts +1 -0
- package/dist/types/components/lexical/table/table-controls.d.ts +12 -0
- package/dist/types/components/lexical/toolbar/index.d.ts +6 -0
- package/dist/types/components/lexical/toolbar/lexical-toolbar.d.ts +12 -0
- package/dist/types/components/lexical/toolbar/toolbar-button.d.ts +1 -0
- package/dist/types/components/lexical/toolbar/toolbar-group.d.ts +1 -0
- package/dist/types/components/lexical/toolbar/toolbar-helpers.d.ts +30 -0
- package/dist/types/components/prosemirror/etoolbar-button.d.ts +1 -11
- package/dist/types/components/prosemirror/etoolbar-group.d.ts +1 -4
- package/dist/types/lexical/commands/index.d.ts +17 -0
- package/dist/types/lexical/headless.d.ts +39 -0
- package/dist/types/lexical/horizontal-rule-node.d.ts +20 -0
- package/dist/types/lexical/index.d.ts +20 -0
- package/dist/types/lexical/lazy-loader.d.ts +35 -0
- package/dist/types/lexical/nodes.d.ts +29 -0
- package/dist/types/lexical/plugins/auto-link.d.ts +7 -0
- package/dist/types/lexical/plugins/clipboard.d.ts +11 -0
- package/dist/types/lexical/plugins/code-shiki.d.ts +11 -0
- package/dist/types/lexical/plugins/code.d.ts +7 -0
- package/dist/types/lexical/plugins/dragon.d.ts +6 -0
- package/dist/types/lexical/plugins/file-io.d.ts +10 -0
- package/dist/types/lexical/plugins/hashtag.d.ts +7 -0
- package/dist/types/lexical/plugins/history.d.ts +7 -0
- package/dist/types/lexical/plugins/horizontal-rule.d.ts +12 -0
- package/dist/types/lexical/plugins/html-io.d.ts +9 -0
- package/dist/types/lexical/plugins/index.d.ts +24 -0
- package/dist/types/lexical/plugins/link.d.ts +6 -0
- package/dist/types/lexical/plugins/list.d.ts +6 -0
- package/dist/types/lexical/plugins/mark.d.ts +15 -0
- package/dist/types/lexical/plugins/markdown-io.d.ts +13 -0
- package/dist/types/lexical/plugins/offset.d.ts +6 -0
- package/dist/types/lexical/plugins/overflow.d.ts +7 -0
- package/dist/types/lexical/plugins/plain-text.d.ts +6 -0
- package/dist/types/lexical/plugins/rich-text.d.ts +6 -0
- package/dist/types/lexical/plugins/selection.d.ts +6 -0
- package/dist/types/lexical/plugins/slash-commands.d.ts +26 -0
- package/dist/types/lexical/plugins/table.d.ts +11 -0
- package/dist/types/lexical/plugins/text.d.ts +13 -0
- package/dist/types/lexical/plugins/yjs.d.ts +9 -0
- package/dist/types/lexical/styles-url.d.ts +2 -0
- package/dist/types/lexical/styles.d.ts +2 -0
- package/dist/types/lexical/types.d.ts +634 -0
- package/dist/types/lexical-i18n/default.d.ts +92 -0
- package/dist/types/lexical-i18n/index.d.ts +21 -0
- package/dist/types/lexical-i18n/locales/ar.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/de.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/en.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/es.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/fa.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/fr.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/he.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/hi.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/it.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/ja.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/ko.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/nl.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/pl.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/pt.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/ru.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/tr.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/ur.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/vi.d.ts +91 -0
- package/dist/types/lexical-i18n/locales/zh.d.ts +91 -0
- package/dist/types/lexical-i18n/translations.d.ts +21 -0
- package/dist/use-animated-toggle-ChycsEoj.js +175 -0
- package/dist/use-animated-toggle-DR6CyMac.cjs +1 -0
- package/dist/{use-form-CgZyrACX.js → use-form-B56E_x5Y.js} +83 -88
- package/dist/use-form-Cnp3XQ5X.cjs +2 -0
- package/dist/widget-customization-Dk7XcVly.cjs +1 -0
- package/dist/{widget-customization-DRA7E9Zf.js → widget-customization-Ds9sicAg.js} +106 -105
- package/package.json +48 -3
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +0 -1
- package/dist/deep-merge-DxZqCkE5.cjs +0 -1
- package/dist/duration-input-Dg5SX3lM.cjs +0 -1
- package/dist/modal-D2xE47kr.cjs +0 -1
- package/dist/modal-hkQD1bqZ.js +0 -655
- package/dist/notice-C0SmlheE.cjs +0 -1
- package/dist/text-input-CByq5OIo.cjs +0 -1
- package/dist/text-input-CFJntP7G.js +0 -287
- package/dist/toolbar-TPWYzoiF.cjs +0 -1
- package/dist/use-form-JjeKCINk.cjs +0 -2
- package/dist/widget-customization-G-QLB1rw.cjs +0 -1
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import { WithElement as q, OnDispose as W, WithBrowserCtx as z, Value as j, render as R, html as E, dataAttr as F, attr as f, computedOf as A, prop as U, aria as B, on as H, When as O, Use as _, Fragment as K, coalesce as S } from "@tempots/dom";
|
|
2
|
+
import { u as G } from "./use-animated-toggle-ChycsEoj.js";
|
|
3
|
+
import { g as J } from "./timer-Rd2sKnvH.js";
|
|
4
|
+
import { s as N } from "./session-id-3KiilioY.js";
|
|
5
|
+
import { B as P } from "./translations-Cq8bUKJP.js";
|
|
6
|
+
import { C as Q } from "./use-form-B56E_x5Y.js";
|
|
7
|
+
import { B as D } from "./input-container-DiCjOzR2.js";
|
|
8
|
+
const X = [
|
|
9
|
+
"a[href]",
|
|
10
|
+
"button:not([disabled])",
|
|
11
|
+
"input:not([disabled])",
|
|
12
|
+
"select:not([disabled])",
|
|
13
|
+
"textarea:not([disabled])",
|
|
14
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
15
|
+
'[contenteditable="true"]',
|
|
16
|
+
"audio[controls]",
|
|
17
|
+
"video[controls]",
|
|
18
|
+
"details > summary:first-of-type",
|
|
19
|
+
"details[open]"
|
|
20
|
+
].join(", ");
|
|
21
|
+
function Y(c) {
|
|
22
|
+
return Array.from(c.querySelectorAll(X)).filter(
|
|
23
|
+
(e) => {
|
|
24
|
+
const s = e;
|
|
25
|
+
return s.offsetWidth > 0 && s.offsetHeight > 0 && !s.hasAttribute("inert") && window.getComputedStyle(s).visibility !== "hidden";
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function $(c = {}) {
|
|
30
|
+
const {
|
|
31
|
+
active: e = !0,
|
|
32
|
+
escapeDeactivates: s = !0,
|
|
33
|
+
onEscape: t,
|
|
34
|
+
initialFocus: n,
|
|
35
|
+
returnFocus: r,
|
|
36
|
+
clickOutsideDeactivates: l = !1,
|
|
37
|
+
onClickOutside: u
|
|
38
|
+
} = c;
|
|
39
|
+
return q((g) => {
|
|
40
|
+
let h = e, m = null, i = [], b = null, p = null, d = null;
|
|
41
|
+
typeof document < "u" && (m = document.activeElement);
|
|
42
|
+
const y = () => {
|
|
43
|
+
i = Y(g);
|
|
44
|
+
}, x = (a) => {
|
|
45
|
+
if (h) {
|
|
46
|
+
if (s && a.key === "Escape") {
|
|
47
|
+
a.preventDefault(), t?.();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (a.key === "Tab") {
|
|
51
|
+
if (y(), i.length === 0) {
|
|
52
|
+
a.preventDefault();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const o = i.indexOf(
|
|
56
|
+
document.activeElement
|
|
57
|
+
);
|
|
58
|
+
a.shiftKey ? o <= 0 && (a.preventDefault(), i[i.length - 1]?.focus()) : o >= i.length - 1 && (a.preventDefault(), i[0]?.focus());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, v = (a) => {
|
|
62
|
+
if (!h || !l) return;
|
|
63
|
+
const o = a.target;
|
|
64
|
+
g.contains(o) || u?.();
|
|
65
|
+
}, k = () => {
|
|
66
|
+
if (!h) return;
|
|
67
|
+
y();
|
|
68
|
+
let a = null;
|
|
69
|
+
typeof n == "function" ? a = n() : n ? a = n : i.length > 0 && (a = i[0]), a && (p = setTimeout(() => {
|
|
70
|
+
p = null, a?.focus();
|
|
71
|
+
}, 50)), document.addEventListener("keydown", x, !0), l && document.addEventListener("click", v, !0);
|
|
72
|
+
}, w = () => {
|
|
73
|
+
h = !1, document.removeEventListener("keydown", x, !0), document.removeEventListener("click", v, !0);
|
|
74
|
+
let a = null;
|
|
75
|
+
typeof r == "function" ? a = r() : r ? a = r : m && (a = m), a && document.body.contains(a) && (d = setTimeout(() => {
|
|
76
|
+
d = null, a?.focus();
|
|
77
|
+
}, 0));
|
|
78
|
+
};
|
|
79
|
+
return b = setTimeout(() => {
|
|
80
|
+
b = null, k();
|
|
81
|
+
}, 0), W(() => {
|
|
82
|
+
b != null && clearTimeout(b), p != null && clearTimeout(p), d != null && clearTimeout(d), w();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function de(c = {}) {
|
|
87
|
+
return {
|
|
88
|
+
activate: () => $({ ...c, active: !0 }),
|
|
89
|
+
deactivate: () => $({ ...c, active: !1 })
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function Z(c) {
|
|
93
|
+
return {
|
|
94
|
+
"~standard": {
|
|
95
|
+
version: 1,
|
|
96
|
+
vendor: "beatui-custom",
|
|
97
|
+
validate: (s) => {
|
|
98
|
+
const t = c.validate(s);
|
|
99
|
+
return t.success ? { value: t.data } : {
|
|
100
|
+
issues: t.errors.map((n) => ({
|
|
101
|
+
message: n.message,
|
|
102
|
+
path: n.path
|
|
103
|
+
}))
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
types: void 0
|
|
107
|
+
},
|
|
108
|
+
safeParse: (s) => {
|
|
109
|
+
const t = c.validate(s);
|
|
110
|
+
return t.success ? { success: !0, data: t.data } : {
|
|
111
|
+
success: !1,
|
|
112
|
+
error: {
|
|
113
|
+
errors: t.errors.map((n) => ({
|
|
114
|
+
message: n.message,
|
|
115
|
+
path: n.path?.map(
|
|
116
|
+
(r) => typeof r == "object" && "key" in r ? r.key.toString() : r.toString()
|
|
117
|
+
) || []
|
|
118
|
+
}))
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
class T {
|
|
125
|
+
optional() {
|
|
126
|
+
return new ee(this);
|
|
127
|
+
}
|
|
128
|
+
default(e) {
|
|
129
|
+
return new te(this, e);
|
|
130
|
+
}
|
|
131
|
+
schema() {
|
|
132
|
+
return Z(this);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
class C extends T {
|
|
136
|
+
minLength;
|
|
137
|
+
maxLength;
|
|
138
|
+
pattern;
|
|
139
|
+
customValidations = [];
|
|
140
|
+
validate(e) {
|
|
141
|
+
if (typeof e != "string")
|
|
142
|
+
return { success: !1, errors: [{ message: "Expected string" }] };
|
|
143
|
+
const s = [];
|
|
144
|
+
this.minLength !== void 0 && e.length < this.minLength && s.push({ message: `Must be at least ${this.minLength} characters` }), this.maxLength !== void 0 && e.length > this.maxLength && s.push({ message: `Must be at most ${this.maxLength} characters` }), this.pattern && !this.pattern.test(e) && s.push({ message: "Invalid format" });
|
|
145
|
+
for (const t of this.customValidations) {
|
|
146
|
+
const n = t(e);
|
|
147
|
+
n && s.push({ message: n });
|
|
148
|
+
}
|
|
149
|
+
return s.length > 0 ? { success: !1, errors: s } : { success: !0, data: e };
|
|
150
|
+
}
|
|
151
|
+
min(e, s) {
|
|
152
|
+
const t = new C();
|
|
153
|
+
return t.minLength = e, t.maxLength = this.maxLength, t.pattern = this.pattern, t.customValidations = [...this.customValidations], s && t.customValidations.push(
|
|
154
|
+
(n) => n.length < e ? s : null
|
|
155
|
+
), t;
|
|
156
|
+
}
|
|
157
|
+
max(e, s) {
|
|
158
|
+
const t = new C();
|
|
159
|
+
return t.minLength = this.minLength, t.maxLength = e, t.pattern = this.pattern, t.customValidations = [...this.customValidations], s && t.customValidations.push(
|
|
160
|
+
(n) => n.length > e ? s : null
|
|
161
|
+
), t;
|
|
162
|
+
}
|
|
163
|
+
regex(e, s) {
|
|
164
|
+
const t = new C();
|
|
165
|
+
return t.minLength = this.minLength, t.maxLength = this.maxLength, t.pattern = e, t.customValidations = [...this.customValidations], s && t.customValidations.push(
|
|
166
|
+
(n) => e.test(n) ? null : s
|
|
167
|
+
), t;
|
|
168
|
+
}
|
|
169
|
+
email(e = "Please enter a valid email address") {
|
|
170
|
+
const s = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, t = new C();
|
|
171
|
+
return t.minLength = this.minLength, t.maxLength = this.maxLength, t.pattern = this.pattern, t.customValidations = [
|
|
172
|
+
...this.customValidations,
|
|
173
|
+
(n) => s.test(n) ? null : e
|
|
174
|
+
], t;
|
|
175
|
+
}
|
|
176
|
+
refine(e) {
|
|
177
|
+
const s = new C();
|
|
178
|
+
return s.minLength = this.minLength, s.maxLength = this.maxLength, s.pattern = this.pattern, s.customValidations = [...this.customValidations, e], s;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
class V extends T {
|
|
182
|
+
mustBeTrue = !1;
|
|
183
|
+
trueMessage;
|
|
184
|
+
validate(e) {
|
|
185
|
+
return typeof e != "boolean" ? { success: !1, errors: [{ message: "Expected boolean" }] } : this.mustBeTrue && e !== !0 ? {
|
|
186
|
+
success: !1,
|
|
187
|
+
errors: [{ message: this.trueMessage || "Must be true" }]
|
|
188
|
+
} : { success: !0, data: e };
|
|
189
|
+
}
|
|
190
|
+
refine(e, s) {
|
|
191
|
+
const t = new V();
|
|
192
|
+
t.mustBeTrue = this.mustBeTrue, t.trueMessage = this.trueMessage;
|
|
193
|
+
const n = t.validate.bind(t);
|
|
194
|
+
return t.validate = (r) => {
|
|
195
|
+
const l = n(r);
|
|
196
|
+
return l.success ? e(l.data) ? l : { success: !1, errors: [{ message: s }] } : l;
|
|
197
|
+
}, t;
|
|
198
|
+
}
|
|
199
|
+
literal(e, s) {
|
|
200
|
+
const t = new V();
|
|
201
|
+
return t.mustBeTrue = !0, t.trueMessage = s, t;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
class ee extends T {
|
|
205
|
+
constructor(e) {
|
|
206
|
+
super(), this.inner = e;
|
|
207
|
+
}
|
|
208
|
+
validate(e) {
|
|
209
|
+
if (e === void 0)
|
|
210
|
+
return { success: !0, data: void 0 };
|
|
211
|
+
const s = this.inner.validate(e);
|
|
212
|
+
return s.success ? { success: !0, data: s.data } : { success: !1, errors: s.errors };
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
class te extends T {
|
|
216
|
+
constructor(e, s) {
|
|
217
|
+
super(), this.inner = e, this.defaultValue = s;
|
|
218
|
+
}
|
|
219
|
+
validate(e) {
|
|
220
|
+
return e === void 0 ? { success: !0, data: this.defaultValue } : this.inner.validate(e);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
class I extends T {
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
225
|
+
constructor(e) {
|
|
226
|
+
super(), this.shape = e;
|
|
227
|
+
}
|
|
228
|
+
validate(e) {
|
|
229
|
+
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
230
|
+
return { success: !1, errors: [{ message: "Expected object" }] };
|
|
231
|
+
const s = e, t = {}, n = [];
|
|
232
|
+
for (const [r, l] of Object.entries(this.shape)) {
|
|
233
|
+
const u = l.validate(s[r]);
|
|
234
|
+
if (u.success)
|
|
235
|
+
t[r] = u.data;
|
|
236
|
+
else
|
|
237
|
+
for (const g of u.errors)
|
|
238
|
+
n.push({
|
|
239
|
+
message: g.message,
|
|
240
|
+
path: [r, ...g.path || []]
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
return n.length > 0 ? { success: !1, errors: n } : { success: !0, data: t };
|
|
244
|
+
}
|
|
245
|
+
refine(e, s) {
|
|
246
|
+
const t = new I(this.shape), n = t.validate.bind(t);
|
|
247
|
+
return t.validate = (r) => {
|
|
248
|
+
const l = n(r);
|
|
249
|
+
if (!l.success) return l;
|
|
250
|
+
const u = e(l.data);
|
|
251
|
+
return u ? {
|
|
252
|
+
success: !1,
|
|
253
|
+
errors: [
|
|
254
|
+
{
|
|
255
|
+
message: u,
|
|
256
|
+
path: s?.path
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
} : { success: !0, data: l.data };
|
|
260
|
+
}, t;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const me = () => new C(), fe = () => new V(), he = (c) => new I(c);
|
|
264
|
+
function se(c) {
|
|
265
|
+
return z((e) => {
|
|
266
|
+
const s = [], t = () => s.forEach((r) => r());
|
|
267
|
+
return c(({
|
|
268
|
+
effect: r = "opaque",
|
|
269
|
+
mode: l = "capturing",
|
|
270
|
+
onClickOutside: u,
|
|
271
|
+
onEscape: g,
|
|
272
|
+
content: h,
|
|
273
|
+
container: m = "body"
|
|
274
|
+
}) => {
|
|
275
|
+
m === "body" && (e = e.makePortal("body"));
|
|
276
|
+
const i = G();
|
|
277
|
+
i.listenOnClosed(t);
|
|
278
|
+
let b = () => {
|
|
279
|
+
}, p = () => {
|
|
280
|
+
};
|
|
281
|
+
const d = (a) => {
|
|
282
|
+
a.key === "Escape" && (g?.(), i.close());
|
|
283
|
+
}, y = () => {
|
|
284
|
+
u?.(), i.close();
|
|
285
|
+
}, x = (a) => {
|
|
286
|
+
b(), p(), a === "capturing" ? (document.addEventListener("keydown", d), b = () => document.removeEventListener("keydown", d), e.element.addEventListener("mousedown", y), p = () => e.element.removeEventListener("mousedown", y)) : (b = () => {
|
|
287
|
+
}, p = () => {
|
|
288
|
+
});
|
|
289
|
+
}, v = j.on(l, x);
|
|
290
|
+
s.push(v), s.push(() => {
|
|
291
|
+
i.dispose(), b(), p();
|
|
292
|
+
});
|
|
293
|
+
const w = R((() => {
|
|
294
|
+
const a = /* @__PURE__ */ new Set();
|
|
295
|
+
for (const o of e.element.querySelectorAll(
|
|
296
|
+
":scope > :not([data-overlay])"
|
|
297
|
+
))
|
|
298
|
+
o.hasAttribute("inert") ? a.add(o) : o.setAttribute("inert", "");
|
|
299
|
+
return s.push(() => {
|
|
300
|
+
for (const o of e.element.querySelectorAll(
|
|
301
|
+
":scope > :not([data-overlay])"
|
|
302
|
+
))
|
|
303
|
+
a.has(o) || o.removeAttribute("inert");
|
|
304
|
+
a.clear();
|
|
305
|
+
}), document.activeElement?.blur?.(), E.div(
|
|
306
|
+
q((o) => i.setElement(o)),
|
|
307
|
+
F.status(i.status.map(String)),
|
|
308
|
+
F.overlay("true"),
|
|
309
|
+
f.class(
|
|
310
|
+
A(
|
|
311
|
+
r ?? "opaque",
|
|
312
|
+
l
|
|
313
|
+
)(
|
|
314
|
+
(o, L) => `bc-overlay bc-overlay--effect-${o} bc-overlay--mode-${L}`
|
|
315
|
+
)
|
|
316
|
+
),
|
|
317
|
+
h
|
|
318
|
+
);
|
|
319
|
+
})(), e.element, {
|
|
320
|
+
disposeWithParent: !0,
|
|
321
|
+
clear: !1,
|
|
322
|
+
providers: e.providers
|
|
323
|
+
});
|
|
324
|
+
s.push(w), J(() => i.open());
|
|
325
|
+
}, t);
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
function ne(c, e) {
|
|
329
|
+
const {
|
|
330
|
+
size: s = "md",
|
|
331
|
+
dismissable: t = !0,
|
|
332
|
+
showCloseButton: n = !0,
|
|
333
|
+
onClose: r,
|
|
334
|
+
overlayEffect: l = "opaque",
|
|
335
|
+
container: u = "body",
|
|
336
|
+
position: g = "center"
|
|
337
|
+
} = c;
|
|
338
|
+
return se((h, m) => {
|
|
339
|
+
let i = () => {
|
|
340
|
+
};
|
|
341
|
+
return e((d) => {
|
|
342
|
+
i = m;
|
|
343
|
+
const y = U("capturing");
|
|
344
|
+
j.on(t, (o) => {
|
|
345
|
+
y.set(o ? "capturing" : "non-capturing");
|
|
346
|
+
});
|
|
347
|
+
const x = A(
|
|
348
|
+
d.header != null,
|
|
349
|
+
n
|
|
350
|
+
)((o, L) => o || L), v = N("modal"), k = `${v}-header`, w = `${v}-body`, a = E.div(
|
|
351
|
+
f.class(
|
|
352
|
+
A(
|
|
353
|
+
s,
|
|
354
|
+
g
|
|
355
|
+
)(
|
|
356
|
+
(o, L) => `bc-modal bc-modal--size-${o} bc-modal--container-${u} bc-modal--position-${L}`
|
|
357
|
+
)
|
|
358
|
+
),
|
|
359
|
+
// Essential ARIA attributes for modal dialog
|
|
360
|
+
f.role("dialog"),
|
|
361
|
+
B.modal(!0),
|
|
362
|
+
...d.header ? [B.labelledby(k)] : [],
|
|
363
|
+
B.describedby(w),
|
|
364
|
+
f.tabindex(-1),
|
|
365
|
+
// Make modal focusable for initial focus
|
|
366
|
+
f.id(v),
|
|
367
|
+
F.focusTrap("true"),
|
|
368
|
+
// Mark as focus trap container
|
|
369
|
+
H.mousedown((o) => o.stopPropagation()),
|
|
370
|
+
// Prevent overlay click-outside when clicking modal content
|
|
371
|
+
// Focus trap implementation
|
|
372
|
+
$({
|
|
373
|
+
escapeDeactivates: !1,
|
|
374
|
+
// Let Overlay handle escape key
|
|
375
|
+
initialFocus: () => {
|
|
376
|
+
const o = document.getElementById(v);
|
|
377
|
+
if (!o) return null;
|
|
378
|
+
const L = o.querySelector(
|
|
379
|
+
'[aria-label="Close modal"]'
|
|
380
|
+
);
|
|
381
|
+
if (L) return L;
|
|
382
|
+
const M = o.querySelector(
|
|
383
|
+
'button, input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
384
|
+
);
|
|
385
|
+
return M || o;
|
|
386
|
+
}
|
|
387
|
+
}),
|
|
388
|
+
// Modal content container
|
|
389
|
+
E.div(
|
|
390
|
+
f.class("bc-modal__content"),
|
|
391
|
+
// Header section
|
|
392
|
+
O(
|
|
393
|
+
x,
|
|
394
|
+
() => E.div(
|
|
395
|
+
f.class("bc-modal__header"),
|
|
396
|
+
E.div(
|
|
397
|
+
f.class("bc-modal__title"),
|
|
398
|
+
...d.header ? [f.id(k)] : [],
|
|
399
|
+
d.header
|
|
400
|
+
),
|
|
401
|
+
O(
|
|
402
|
+
n,
|
|
403
|
+
() => _(
|
|
404
|
+
P,
|
|
405
|
+
(o) => Q({
|
|
406
|
+
size: "sm",
|
|
407
|
+
label: o.$.closeModal,
|
|
408
|
+
onClick: () => {
|
|
409
|
+
i(), m();
|
|
410
|
+
}
|
|
411
|
+
})
|
|
412
|
+
)
|
|
413
|
+
)
|
|
414
|
+
)
|
|
415
|
+
),
|
|
416
|
+
// Body section
|
|
417
|
+
E.div(f.class("bc-modal__body"), f.id(w), d.body),
|
|
418
|
+
// Footer section
|
|
419
|
+
d.footer && E.div(f.class("bc-modal__footer"), d.footer)
|
|
420
|
+
)
|
|
421
|
+
);
|
|
422
|
+
h({
|
|
423
|
+
mode: y,
|
|
424
|
+
effect: l ?? "opaque",
|
|
425
|
+
container: u,
|
|
426
|
+
content: a,
|
|
427
|
+
onClickOutside: () => {
|
|
428
|
+
r?.(), m();
|
|
429
|
+
},
|
|
430
|
+
onEscape: () => {
|
|
431
|
+
r?.(), m();
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
}, () => {
|
|
435
|
+
i(), m();
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
function pe(c, e) {
|
|
440
|
+
const { confirmText: s, cancelText: t, onConfirm: n, onCancel: r, ...l } = c;
|
|
441
|
+
return _(
|
|
442
|
+
P,
|
|
443
|
+
(u) => ne({ showCloseButton: !1, ...l }, (g, h) => {
|
|
444
|
+
const m = () => {
|
|
445
|
+
n?.(), h();
|
|
446
|
+
}, i = () => {
|
|
447
|
+
r?.(), h();
|
|
448
|
+
};
|
|
449
|
+
return e((p) => {
|
|
450
|
+
g({
|
|
451
|
+
body: p,
|
|
452
|
+
footer: K(
|
|
453
|
+
f.class("bc-modal__actions"),
|
|
454
|
+
D(
|
|
455
|
+
{
|
|
456
|
+
variant: "outline",
|
|
457
|
+
onClick: i
|
|
458
|
+
},
|
|
459
|
+
S(t, u.$.cancel)
|
|
460
|
+
),
|
|
461
|
+
D(
|
|
462
|
+
{
|
|
463
|
+
color: "primary",
|
|
464
|
+
variant: "filled",
|
|
465
|
+
onClick: m
|
|
466
|
+
},
|
|
467
|
+
S(s, u.$.confirm)
|
|
468
|
+
)
|
|
469
|
+
)
|
|
470
|
+
});
|
|
471
|
+
}, h);
|
|
472
|
+
})
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
export {
|
|
476
|
+
V as B,
|
|
477
|
+
pe as C,
|
|
478
|
+
$ as F,
|
|
479
|
+
ne as M,
|
|
480
|
+
se as O,
|
|
481
|
+
C as S,
|
|
482
|
+
I as a,
|
|
483
|
+
fe as b,
|
|
484
|
+
Z as c,
|
|
485
|
+
he as o,
|
|
486
|
+
me as s,
|
|
487
|
+
de as u
|
|
488
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Use as V, input as
|
|
1
|
+
import { C as z } from "./text-input-B3VBat1k.js";
|
|
2
|
+
import { Use as V, input as j, attr as t, coalesce as A, on as m, Empty as w, emitValue as I, prop as O, computedOf as C, html as p, aria as F, When as P, Fragment as $, Value as g, Unless as M, Ensure as R } from "@tempots/dom";
|
|
3
|
+
import { a as S, I as k } from "./input-container-DiCjOzR2.js";
|
|
3
4
|
import { B as x, I as E } from "./translations-Cq8bUKJP.js";
|
|
4
|
-
import { C as W } from "./use-form-
|
|
5
|
-
const
|
|
5
|
+
import { C as W } from "./use-form-B56E_x5Y.js";
|
|
6
|
+
const X = (n) => {
|
|
6
7
|
const l = {
|
|
7
8
|
name: "email",
|
|
8
9
|
autocomplete: "email",
|
|
9
|
-
...
|
|
10
|
+
...n
|
|
10
11
|
}, {
|
|
11
12
|
value: r,
|
|
12
13
|
before: s,
|
|
@@ -14,28 +15,28 @@ const Q = (t) => {
|
|
|
14
15
|
onChange: d,
|
|
15
16
|
onInput: c,
|
|
16
17
|
placeholder: v
|
|
17
|
-
} = l, b = s ??
|
|
18
|
+
} = l, b = s ?? S({
|
|
18
19
|
icon: "line-md:email",
|
|
19
|
-
size:
|
|
20
|
+
size: n.size,
|
|
20
21
|
color: "neutral"
|
|
21
22
|
});
|
|
22
23
|
return V(
|
|
23
24
|
x,
|
|
24
|
-
(f) =>
|
|
25
|
-
...
|
|
25
|
+
(f) => k({
|
|
26
|
+
...n,
|
|
26
27
|
before: b,
|
|
27
|
-
input:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
input: j.email(
|
|
29
|
+
z(l),
|
|
30
|
+
t.placeholder(A(v, f.$.emailPlaceholderText)),
|
|
31
|
+
t.value(r),
|
|
32
|
+
t.class("bc-input"),
|
|
32
33
|
o != null ? m.blur(I(o)) : w,
|
|
33
34
|
d != null ? m.change(I(d)) : w,
|
|
34
35
|
c != null ? m.input(I(c)) : w
|
|
35
36
|
)
|
|
36
37
|
})
|
|
37
38
|
);
|
|
38
|
-
},
|
|
39
|
+
}, Y = (n) => {
|
|
39
40
|
const {
|
|
40
41
|
value: l,
|
|
41
42
|
onBlur: r,
|
|
@@ -48,11 +49,11 @@ const Q = (t) => {
|
|
|
48
49
|
autocomplete: f,
|
|
49
50
|
placeholder: _,
|
|
50
51
|
...h
|
|
51
|
-
} =
|
|
52
|
+
} = n, T = {
|
|
52
53
|
name: "password",
|
|
53
54
|
disabled: b,
|
|
54
55
|
...h
|
|
55
|
-
}, i =
|
|
56
|
+
}, i = O(!0), a = C(
|
|
56
57
|
i,
|
|
57
58
|
f
|
|
58
59
|
)((e, u) => e ? u ?? "current-password" : "off");
|
|
@@ -62,9 +63,9 @@ const Q = (t) => {
|
|
|
62
63
|
i,
|
|
63
64
|
_
|
|
64
65
|
)((y, N, U) => N ? "•••••••••••••••" : U ?? y), B = p.button(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
t.type("button"),
|
|
67
|
+
t.class("bc-input-container__password-toggle"),
|
|
68
|
+
F.label(e.$.togglePasswordVisibility),
|
|
68
69
|
m.click(() => i.update((y) => !y)),
|
|
69
70
|
P(
|
|
70
71
|
i,
|
|
@@ -72,23 +73,23 @@ const Q = (t) => {
|
|
|
72
73
|
() => E({ icon: "line-md:watch-off" })
|
|
73
74
|
)
|
|
74
75
|
);
|
|
75
|
-
return
|
|
76
|
+
return k({
|
|
76
77
|
before: d,
|
|
77
78
|
disabled: b,
|
|
78
79
|
hasError: v,
|
|
79
80
|
input: p.input(
|
|
80
|
-
|
|
81
|
+
z({
|
|
81
82
|
...T,
|
|
82
83
|
autocomplete: a,
|
|
83
84
|
placeholder: u
|
|
84
85
|
}),
|
|
85
86
|
P(
|
|
86
87
|
i,
|
|
87
|
-
() => $(
|
|
88
|
-
() => $(
|
|
88
|
+
() => $(t.type("password")),
|
|
89
|
+
() => $(t.type("text"))
|
|
89
90
|
),
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
t.class("bc-input"),
|
|
92
|
+
t.value(l),
|
|
92
93
|
r != null ? m.blur(I(r)) : w,
|
|
93
94
|
s != null ? m.change(I(s)) : w,
|
|
94
95
|
o != null ? m.input(I(o)) : w
|
|
@@ -97,8 +98,8 @@ const Q = (t) => {
|
|
|
97
98
|
});
|
|
98
99
|
});
|
|
99
100
|
};
|
|
100
|
-
function q(
|
|
101
|
-
switch (
|
|
101
|
+
function q(n) {
|
|
102
|
+
switch (n) {
|
|
102
103
|
case "success":
|
|
103
104
|
return "material-symbols:check-circle-outline";
|
|
104
105
|
case "warning":
|
|
@@ -110,8 +111,8 @@ function q(t) {
|
|
|
110
111
|
return "material-symbols:info-outline";
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
function D(
|
|
114
|
-
switch (
|
|
114
|
+
function D(n) {
|
|
115
|
+
switch (n) {
|
|
115
116
|
case "success":
|
|
116
117
|
return "success";
|
|
117
118
|
case "warning":
|
|
@@ -123,16 +124,16 @@ function D(t) {
|
|
|
123
124
|
return "info";
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
|
-
function G(
|
|
127
|
+
function G(n, l, r, s) {
|
|
127
128
|
const o = [
|
|
128
129
|
"bc-notice",
|
|
129
|
-
`bc-notice--${
|
|
130
|
+
`bc-notice--${n}`,
|
|
130
131
|
`bc-notice--tone-${l}`
|
|
131
132
|
];
|
|
132
133
|
return r && o.push("bc-notice--dismissible"), s && s.length > 0 && o.push(s), o.join(" ");
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
-
variant:
|
|
135
|
+
function Z({
|
|
136
|
+
variant: n = "info",
|
|
136
137
|
tone: l = "subtle",
|
|
137
138
|
role: r,
|
|
138
139
|
title: s,
|
|
@@ -141,12 +142,12 @@ function Y({
|
|
|
141
142
|
onDismiss: c,
|
|
142
143
|
class: v
|
|
143
144
|
}, ...b) {
|
|
144
|
-
const f =
|
|
145
|
+
const f = O(!0);
|
|
145
146
|
return P(f, () => {
|
|
146
147
|
const _ = g.map(
|
|
147
148
|
d,
|
|
148
149
|
(a) => !!a || c != null
|
|
149
|
-
), h = g.map(
|
|
150
|
+
), h = g.map(n, (a) => a ?? "info"), T = g.map(l, (a) => a ?? "subtle"), i = C(
|
|
150
151
|
r,
|
|
151
152
|
h
|
|
152
153
|
)(
|
|
@@ -155,7 +156,7 @@ function Y({
|
|
|
155
156
|
return V(
|
|
156
157
|
x,
|
|
157
158
|
(a) => p.div(
|
|
158
|
-
|
|
159
|
+
t.class(
|
|
159
160
|
C(
|
|
160
161
|
h,
|
|
161
162
|
T,
|
|
@@ -164,11 +165,11 @@ function Y({
|
|
|
164
165
|
)((e, u, B, y) => G(e, u, B, y))
|
|
165
166
|
),
|
|
166
167
|
// Accessibility role mapping (always defined)
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
t.role(g.map(i, (e) => e)),
|
|
169
|
+
M(
|
|
169
170
|
g.map(o, (e) => e === !1),
|
|
170
171
|
() => p.div(
|
|
171
|
-
|
|
172
|
+
t.class("bc-notice__icon"),
|
|
172
173
|
E({
|
|
173
174
|
icon: C(
|
|
174
175
|
o,
|
|
@@ -182,12 +183,12 @@ function Y({
|
|
|
182
183
|
)
|
|
183
184
|
),
|
|
184
185
|
p.div(
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
t.class("bc-notice__body"),
|
|
187
|
+
R(
|
|
187
188
|
s,
|
|
188
|
-
(e) => p.div(
|
|
189
|
+
(e) => p.div(t.class("bc-notice__title"), e)
|
|
189
190
|
),
|
|
190
|
-
p.div(
|
|
191
|
+
p.div(t.class("bc-notice__content"), ...b)
|
|
191
192
|
),
|
|
192
193
|
P(
|
|
193
194
|
_,
|
|
@@ -204,7 +205,7 @@ function Y({
|
|
|
204
205
|
});
|
|
205
206
|
}
|
|
206
207
|
export {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
X as E,
|
|
209
|
+
Z as N,
|
|
210
|
+
Y as P
|
|
210
211
|
};
|