@tempots/beatui 0.81.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.
Files changed (237) hide show
  1. package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
  2. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  3. package/dist/{ar-DwHLVgKj.cjs → ar-D7CXDmVZ.cjs} +1 -1
  4. package/dist/{ar-Bo_FZZi7.js → ar-nOSKXpIW.js} +1 -1
  5. package/dist/auth/index.cjs.js +1 -1
  6. package/dist/auth/index.es.js +63 -1349
  7. package/dist/auth-divider-BqZPH1-z.cjs +1 -0
  8. package/dist/auth-divider-Wr-S16kF.js +1355 -0
  9. package/dist/beatui.css +2035 -295
  10. package/dist/beatui.tailwind.css +2036 -296
  11. package/dist/better-auth/index.cjs.js +1 -0
  12. package/dist/better-auth/index.es.js +754 -0
  13. package/dist/{de-zI5mdV4M.cjs → de-WzsOu9Gn.cjs} +1 -1
  14. package/dist/{de-CCqwOkqN.js → de-f2xcEb34.js} +1 -1
  15. package/dist/{deep-merge-1uN6CG6K.js → deep-merge-BYm0y62g.js} +271 -285
  16. package/dist/deep-merge-d7sf0xmN.cjs +1 -0
  17. package/dist/duration-input-B9UNmUCh.cjs +1 -0
  18. package/dist/{duration-input-C9kpsw-t.js → duration-input-DqcJbxKD.js} +31 -29
  19. package/dist/editor-toolbar-group--a-xgsJw.cjs +1 -0
  20. package/dist/editor-toolbar-group-CVpl5mxF.js +31 -0
  21. package/dist/{es-BF02UrPL.js → es-CDqqzpCw.js} +1 -1
  22. package/dist/{es-Cw90CAbu.cjs → es-Ds2Xf3wV.cjs} +1 -1
  23. package/dist/{fa-DPQV4YB8.js → fa-C7tE_hR3.js} +1 -1
  24. package/dist/{fa-B4lssnzR.cjs → fa-Ct1UtDB7.cjs} +1 -1
  25. package/dist/{fr-1Kd6z1F-.cjs → fr-CzAkRFed.cjs} +1 -1
  26. package/dist/{fr-dmxPhwkD.js → fr-yOW_68YY.js} +1 -1
  27. package/dist/{he-BtQbrVt3.js → he-D2oUloCJ.js} +1 -1
  28. package/dist/{he-CJ3XnuPm.cjs → he-DlXALrK7.cjs} +1 -1
  29. package/dist/{hi-BpfnFKHp.cjs → hi-3dBhLwDs.cjs} +1 -1
  30. package/dist/{hi-D_Le4Yka.js → hi-D5ZlZoQq.js} +1 -1
  31. package/dist/{hls.light.min-Bhrf47iR.cjs → hls.light.min-C6xKDzRR.cjs} +1 -1
  32. package/dist/{hls.light.min-C6VwviEa.js → hls.light.min-hEMf_E8u.js} +1 -1
  33. package/dist/{index-CfaWytS2.cjs → index-05UbKOYe.cjs} +1 -1
  34. package/dist/{index-K6u33-GC.cjs → index-Bt7FYl80.cjs} +19 -19
  35. package/dist/{index-YtW7SCWB.js → index-C2Lq1m45.js} +1434 -1463
  36. package/dist/{index-CGEzILlC.js → index-lYhXnu6I.js} +1 -1
  37. package/dist/index.cjs.js +4 -4
  38. package/dist/index.es.js +2389 -2738
  39. package/dist/input-container-C6qEIjcA.cjs +1 -0
  40. package/dist/input-container-DiCjOzR2.js +247 -0
  41. package/dist/{it-DyHjSuHN.js → it-6e6X-4BB.js} +1 -1
  42. package/dist/{it-COCZ9NyB.cjs → it-DohtcWi9.cjs} +1 -1
  43. package/dist/{ja-X43lABza.js → ja-BxNuNo2H.js} +1 -1
  44. package/dist/{ja--NdggLU9.cjs → ja-eyTArrgS.cjs} +1 -1
  45. package/dist/json-schema/index.cjs.js +1 -8
  46. package/dist/json-schema/index.es.js +1359 -7608
  47. package/dist/json-schema-display/index.cjs.js +1 -0
  48. package/dist/json-schema-display/index.es.js +846 -0
  49. package/dist/json-structure/index.cjs.js +1 -1
  50. package/dist/json-structure/index.es.js +542 -698
  51. package/dist/{ko-BUvb0ggK.cjs → ko-BFLCDMMs.cjs} +1 -1
  52. package/dist/{ko-B9g9iw99.js → ko-Ch0jFsBV.js} +1 -1
  53. package/dist/lexical/index.cjs.js +46 -0
  54. package/dist/lexical/index.es.js +21370 -0
  55. package/dist/lexical.css +1124 -0
  56. package/dist/menu-CZzRsQP_.js +372 -0
  57. package/dist/menu-ClrU72xH.cjs +1 -0
  58. package/dist/modal-I5srcntN.cjs +1 -0
  59. package/dist/modal-v3u2Fpnd.js +488 -0
  60. package/dist/{nl-0S25Gsld.cjs → nl-Bx2ACvr4.cjs} +1 -1
  61. package/dist/{nl-Ew5jnSsT.js → nl-NuTdZO1s.js} +1 -1
  62. package/dist/{notice-C-964yaY.js → notice-BuZvdvZh.js} +84 -82
  63. package/dist/notice-CLDdy1MW.cjs +1 -0
  64. package/dist/oneof-branch-detection-DsM1K5xc.cjs +8 -0
  65. package/dist/oneof-branch-detection-Dt8ss9lc.js +6281 -0
  66. package/dist/{pl-C9f6UBSe.js → pl-Bs4nLJ__.js} +1 -1
  67. package/dist/{pl-B3k-K3S4.cjs → pl-QHl6sl8f.cjs} +1 -1
  68. package/dist/prosemirror/index.cjs.js +1 -1
  69. package/dist/prosemirror/index.es.js +1 -1
  70. package/dist/{pt-DYtAvbrw.js → pt-BETjHZrL.js} +1 -1
  71. package/dist/{pt-CKoikRO5.cjs → pt-DZGw2Z-1.cjs} +1 -1
  72. package/dist/{ru-ZexN-b8V.js → ru-Bi1_DEKM.js} +1 -1
  73. package/dist/{ru-COb7RSDt.cjs → ru-D03IuLqh.cjs} +1 -1
  74. package/dist/session-id-3KiilioY.js +8 -0
  75. package/dist/session-id-B5lJMzbB.cjs +1 -0
  76. package/dist/stack-BJgsPJ9A.js +873 -0
  77. package/dist/stack-DcZ_u50f.cjs +1 -0
  78. package/dist/string-B9vVyfq3.cjs +1 -0
  79. package/dist/string-DYyMxBl-.js +19 -0
  80. package/dist/styles-url-B2dzXrYt.cjs +1 -0
  81. package/dist/styles-url-Cw_mxshe.js +4 -0
  82. package/dist/text-input-B3VBat1k.js +44 -0
  83. package/dist/text-input-Ds8e7Z1G.cjs +1 -0
  84. package/dist/{toolbar-DNpBIoJo.js → toolbar-D994_E_s.js} +4 -4
  85. package/dist/toolbar-x0_8lmKu.cjs +1 -0
  86. package/dist/{tr-tO_EH-Y2.cjs → tr-B_-_1wua.cjs} +1 -1
  87. package/dist/{tr-BDvn05-H.js → tr-DiYB-FwX.js} +1 -1
  88. package/dist/translations-B4-Zd2LM.cjs +1 -0
  89. package/dist/translations-Cq8bUKJP.js +584 -0
  90. package/dist/{translations-DwGC_94w.cjs → translations-D62qqNV9.cjs} +1 -1
  91. package/dist/{translations-CfWR4loD.js → translations-DPr6c05Z.js} +1 -1
  92. package/dist/types/better-auth/bridge.d.ts +2 -0
  93. package/dist/types/better-auth/callbacks.d.ts +6 -0
  94. package/dist/types/better-auth/components/authenticated.d.ts +4 -0
  95. package/dist/types/better-auth/components/better-auth-container.d.ts +4 -0
  96. package/dist/types/better-auth/components/better-auth-modal.d.ts +4 -0
  97. package/dist/types/better-auth/components/magic-link-form.d.ts +7 -0
  98. package/dist/types/better-auth/components/passkey-management.d.ts +6 -0
  99. package/dist/types/better-auth/components/passkey-signin.d.ts +12 -0
  100. package/dist/types/better-auth/components/two-factor-setup.d.ts +8 -0
  101. package/dist/types/better-auth/components/two-factor-verify.d.ts +10 -0
  102. package/dist/types/better-auth/i18n/default.d.ts +29 -0
  103. package/dist/types/better-auth/i18n/locales/en.d.ts +28 -0
  104. package/dist/types/better-auth/i18n/translations.d.ts +27 -0
  105. package/dist/types/better-auth/index.d.ts +22 -0
  106. package/dist/types/better-auth/provider.d.ts +6 -0
  107. package/dist/types/better-auth/session.d.ts +14 -0
  108. package/dist/types/better-auth/social-mapping.d.ts +2 -0
  109. package/dist/types/better-auth/types.d.ts +164 -0
  110. package/dist/types/components/auth/auth-container.d.ts +1 -1
  111. package/dist/types/components/auth/social-providers.d.ts +1 -1
  112. package/dist/types/components/auth/types.d.ts +2 -0
  113. package/dist/types/components/editor-toolbar/editor-toolbar-button.d.ts +16 -0
  114. package/dist/types/components/editor-toolbar/editor-toolbar-group.d.ts +9 -0
  115. package/dist/types/components/editor-toolbar/index.d.ts +2 -0
  116. package/dist/types/components/json-schema-display/display-widget-customization.d.ts +61 -0
  117. package/dist/types/components/json-schema-display/display-wrapper.d.ts +14 -0
  118. package/dist/types/components/json-schema-display/displays/any-display.d.ts +14 -0
  119. package/dist/types/components/json-schema-display/displays/array-display.d.ts +13 -0
  120. package/dist/types/components/json-schema-display/displays/boolean-display.d.ts +13 -0
  121. package/dist/types/components/json-schema-display/displays/composition-display.d.ts +14 -0
  122. package/dist/types/components/json-schema-display/displays/enum-const-display.d.ts +13 -0
  123. package/dist/types/components/json-schema-display/displays/generic-display.d.ts +18 -0
  124. package/dist/types/components/json-schema-display/displays/null-display.d.ts +13 -0
  125. package/dist/types/components/json-schema-display/displays/number-display.d.ts +13 -0
  126. package/dist/types/components/json-schema-display/displays/object-display.d.ts +13 -0
  127. package/dist/types/components/json-schema-display/displays/string-display.d.ts +14 -0
  128. package/dist/types/components/json-schema-display/index.d.ts +14 -0
  129. package/dist/types/components/json-schema-display/json-schema-display.d.ts +25 -0
  130. package/dist/types/components/json-schema-display/mismatch.d.ts +14 -0
  131. package/dist/types/components/json-structure/controls/control-utils.d.ts +19 -0
  132. package/dist/types/components/json-structure/controls/index.d.ts +1 -0
  133. package/dist/types/components/lexical/bare-editor.d.ts +29 -0
  134. package/dist/types/components/lexical/code/index.d.ts +1 -0
  135. package/dist/types/components/lexical/code/language-selector.d.ts +13 -0
  136. package/dist/types/components/lexical/contextual-editor.d.ts +22 -0
  137. package/dist/types/components/lexical/docked-editor.d.ts +23 -0
  138. package/dist/types/components/lexical/floating/block-handle.d.ts +16 -0
  139. package/dist/types/components/lexical/floating/floating-toolbar.d.ts +12 -0
  140. package/dist/types/components/lexical/floating/index.d.ts +6 -0
  141. package/dist/types/components/lexical/floating/slash-command-palette.d.ts +20 -0
  142. package/dist/types/components/lexical/index.d.ts +8 -0
  143. package/dist/types/components/lexical/lexical-editor-input.d.ts +30 -0
  144. package/dist/types/components/lexical/table/index.d.ts +1 -0
  145. package/dist/types/components/lexical/table/table-controls.d.ts +12 -0
  146. package/dist/types/components/lexical/toolbar/index.d.ts +6 -0
  147. package/dist/types/components/lexical/toolbar/lexical-toolbar.d.ts +12 -0
  148. package/dist/types/components/lexical/toolbar/toolbar-button.d.ts +1 -0
  149. package/dist/types/components/lexical/toolbar/toolbar-group.d.ts +1 -0
  150. package/dist/types/components/lexical/toolbar/toolbar-helpers.d.ts +30 -0
  151. package/dist/types/components/prosemirror/etoolbar-button.d.ts +1 -11
  152. package/dist/types/components/prosemirror/etoolbar-group.d.ts +1 -4
  153. package/dist/types/json-schema-display/index.d.ts +1 -0
  154. package/dist/types/lexical/commands/index.d.ts +17 -0
  155. package/dist/types/lexical/headless.d.ts +39 -0
  156. package/dist/types/lexical/horizontal-rule-node.d.ts +20 -0
  157. package/dist/types/lexical/index.d.ts +20 -0
  158. package/dist/types/lexical/lazy-loader.d.ts +35 -0
  159. package/dist/types/lexical/nodes.d.ts +29 -0
  160. package/dist/types/lexical/plugins/auto-link.d.ts +7 -0
  161. package/dist/types/lexical/plugins/clipboard.d.ts +11 -0
  162. package/dist/types/lexical/plugins/code-shiki.d.ts +11 -0
  163. package/dist/types/lexical/plugins/code.d.ts +7 -0
  164. package/dist/types/lexical/plugins/dragon.d.ts +6 -0
  165. package/dist/types/lexical/plugins/file-io.d.ts +10 -0
  166. package/dist/types/lexical/plugins/hashtag.d.ts +7 -0
  167. package/dist/types/lexical/plugins/history.d.ts +7 -0
  168. package/dist/types/lexical/plugins/horizontal-rule.d.ts +12 -0
  169. package/dist/types/lexical/plugins/html-io.d.ts +9 -0
  170. package/dist/types/lexical/plugins/index.d.ts +24 -0
  171. package/dist/types/lexical/plugins/link.d.ts +6 -0
  172. package/dist/types/lexical/plugins/list.d.ts +6 -0
  173. package/dist/types/lexical/plugins/mark.d.ts +15 -0
  174. package/dist/types/lexical/plugins/markdown-io.d.ts +13 -0
  175. package/dist/types/lexical/plugins/offset.d.ts +6 -0
  176. package/dist/types/lexical/plugins/overflow.d.ts +7 -0
  177. package/dist/types/lexical/plugins/plain-text.d.ts +6 -0
  178. package/dist/types/lexical/plugins/rich-text.d.ts +6 -0
  179. package/dist/types/lexical/plugins/selection.d.ts +6 -0
  180. package/dist/types/lexical/plugins/slash-commands.d.ts +26 -0
  181. package/dist/types/lexical/plugins/table.d.ts +11 -0
  182. package/dist/types/lexical/plugins/text.d.ts +13 -0
  183. package/dist/types/lexical/plugins/yjs.d.ts +9 -0
  184. package/dist/types/lexical/styles-url.d.ts +2 -0
  185. package/dist/types/lexical/styles.d.ts +2 -0
  186. package/dist/types/lexical/types.d.ts +634 -0
  187. package/dist/types/lexical-i18n/default.d.ts +92 -0
  188. package/dist/types/lexical-i18n/index.d.ts +21 -0
  189. package/dist/types/lexical-i18n/locales/ar.d.ts +91 -0
  190. package/dist/types/lexical-i18n/locales/de.d.ts +91 -0
  191. package/dist/types/lexical-i18n/locales/en.d.ts +91 -0
  192. package/dist/types/lexical-i18n/locales/es.d.ts +91 -0
  193. package/dist/types/lexical-i18n/locales/fa.d.ts +91 -0
  194. package/dist/types/lexical-i18n/locales/fr.d.ts +91 -0
  195. package/dist/types/lexical-i18n/locales/he.d.ts +91 -0
  196. package/dist/types/lexical-i18n/locales/hi.d.ts +91 -0
  197. package/dist/types/lexical-i18n/locales/it.d.ts +91 -0
  198. package/dist/types/lexical-i18n/locales/ja.d.ts +91 -0
  199. package/dist/types/lexical-i18n/locales/ko.d.ts +91 -0
  200. package/dist/types/lexical-i18n/locales/nl.d.ts +91 -0
  201. package/dist/types/lexical-i18n/locales/pl.d.ts +91 -0
  202. package/dist/types/lexical-i18n/locales/pt.d.ts +91 -0
  203. package/dist/types/lexical-i18n/locales/ru.d.ts +91 -0
  204. package/dist/types/lexical-i18n/locales/tr.d.ts +91 -0
  205. package/dist/types/lexical-i18n/locales/ur.d.ts +91 -0
  206. package/dist/types/lexical-i18n/locales/vi.d.ts +91 -0
  207. package/dist/types/lexical-i18n/locales/zh.d.ts +91 -0
  208. package/dist/types/lexical-i18n/translations.d.ts +21 -0
  209. package/dist/{ur-DbEqQgS6.js → ur-B69X-xNs.js} +1 -1
  210. package/dist/{ur-BbnYJ3HS.cjs → ur-DyUSmIbo.cjs} +1 -1
  211. package/dist/use-animated-toggle-ChycsEoj.js +175 -0
  212. package/dist/use-animated-toggle-DR6CyMac.cjs +1 -0
  213. package/dist/use-form-B56E_x5Y.js +859 -0
  214. package/dist/use-form-Cnp3XQ5X.cjs +2 -0
  215. package/dist/utils-DEbsp9Q9.js +129 -0
  216. package/dist/utils-DIUEhA-Z.cjs +1 -0
  217. package/dist/{vi-CpZUeuSj.js → vi-BdzxA60L.js} +1 -1
  218. package/dist/{vi-ByBwvGQY.cjs → vi-CBmPaHxg.cjs} +1 -1
  219. package/dist/widget-customization-Dk7XcVly.cjs +1 -0
  220. package/dist/widget-customization-Ds9sicAg.js +1073 -0
  221. package/dist/{zh-DnxK0ieB.cjs → zh-Cb1b8uik.cjs} +1 -1
  222. package/dist/{zh-DJyhKO0I.js → zh-Dn1UJiZa.js} +1 -1
  223. package/package.json +59 -8
  224. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  225. package/dist/_commonjsHelpers-DwGv2jUC.cjs +0 -1
  226. package/dist/deep-merge-CBIkQM4E.cjs +0 -1
  227. package/dist/duration-input-DHWhQJnn.cjs +0 -1
  228. package/dist/modal-CSHIhHvI.js +0 -654
  229. package/dist/modal-cc8Ehngz.cjs +0 -1
  230. package/dist/notice-C_BWqu2K.cjs +0 -1
  231. package/dist/toolbar-D5FcnRju.cjs +0 -1
  232. package/dist/translations-0tLX4x7M.js +0 -866
  233. package/dist/translations-WPN3ibDg.cjs +0 -1
  234. package/dist/use-form-D4JFOcjo.cjs +0 -2
  235. package/dist/use-form-D4rqJkvG.js +0 -1731
  236. package/dist/widget-customization-BSjJz3_Y.js +0 -1195
  237. package/dist/widget-customization-CrFVrt4V.cjs +0 -1
@@ -1,654 +0,0 @@
1
- import { WithElement as S, OnDispose as z, prop as R, computedOf as A, Fragment as M, attr as g, WithBrowserCtx as J, Value as U, render as Q, html as k, dataAttr as B, aria as V, on as X, When as j, Use as H, coalesce as q } from "@tempots/dom";
2
- import { g as $, I as _ } from "./timer-Rd2sKnvH.js";
3
- import { s as Y, C as Z } from "./use-form-D4rqJkvG.js";
4
- import { a as K, B as P } from "./translations-0tLX4x7M.js";
5
- const ee = [
6
- "a[href]",
7
- "button:not([disabled])",
8
- "input:not([disabled])",
9
- "select:not([disabled])",
10
- "textarea:not([disabled])",
11
- '[tabindex]:not([tabindex="-1"])',
12
- '[contenteditable="true"]',
13
- "audio[controls]",
14
- "video[controls]",
15
- "details > summary:first-of-type",
16
- "details[open]"
17
- ].join(", ");
18
- function te(o) {
19
- return Array.from(o.querySelectorAll(ee)).filter(
20
- (t) => {
21
- const s = t;
22
- return s.offsetWidth > 0 && s.offsetHeight > 0 && !s.hasAttribute("inert") && window.getComputedStyle(s).visibility !== "hidden";
23
- }
24
- );
25
- }
26
- function F(o = {}) {
27
- const {
28
- active: t = !0,
29
- escapeDeactivates: s = !0,
30
- onEscape: e,
31
- initialFocus: n,
32
- returnFocus: r,
33
- clickOutsideDeactivates: a = !1,
34
- onClickOutside: u
35
- } = o;
36
- return S((m) => {
37
- let f = t, p = null, c = [];
38
- typeof document < "u" && (p = document.activeElement);
39
- const v = () => {
40
- c = te(m);
41
- }, b = (l) => {
42
- if (f) {
43
- if (s && l.key === "Escape") {
44
- l.preventDefault(), e?.();
45
- return;
46
- }
47
- if (l.key === "Tab") {
48
- if (v(), c.length === 0) {
49
- l.preventDefault();
50
- return;
51
- }
52
- const i = c.indexOf(
53
- document.activeElement
54
- );
55
- l.shiftKey ? i <= 0 && (l.preventDefault(), c[c.length - 1]?.focus()) : i >= c.length - 1 && (l.preventDefault(), c[0]?.focus());
56
- }
57
- }
58
- }, h = (l) => {
59
- if (!f || !a) return;
60
- const i = l.target;
61
- m.contains(i) || u?.();
62
- }, y = () => {
63
- if (!f) return;
64
- v();
65
- let l = null;
66
- typeof n == "function" ? l = n() : n ? l = n : c.length > 0 && (l = c[0]), l && setTimeout(() => {
67
- l?.focus();
68
- }, 50), document.addEventListener("keydown", b, !0), a && document.addEventListener("click", h, !0);
69
- }, x = () => {
70
- f = !1, document.removeEventListener("keydown", b, !0), document.removeEventListener("click", h, !0);
71
- let l = null;
72
- typeof r == "function" ? l = r() : r ? l = r : p && (l = p), l && document.body.contains(l) && setTimeout(() => {
73
- l?.focus();
74
- }, 0);
75
- };
76
- return setTimeout(() => y(), 0), z(() => {
77
- x();
78
- });
79
- });
80
- }
81
- function pe(o = {}) {
82
- return {
83
- activate: () => F({ ...o, active: !0 }),
84
- deactivate: () => F({ ...o, active: !1 })
85
- };
86
- }
87
- function N({
88
- initialStatus: o = "closed",
89
- openedAfter: t,
90
- closedAfter: s
91
- }) {
92
- const e = R(o), n = () => {
93
- e.set("start-opening");
94
- }, r = () => {
95
- e.set("start-closing");
96
- }, a = e.map(
97
- (i) => i !== "closed" && i !== "start-closing" && i !== "closing"
98
- ), u = (i) => {
99
- i ? n() : r();
100
- }, m = () => {
101
- u(!a.value);
102
- }, f = [], p = (i) => {
103
- f.push(
104
- e.on((w) => {
105
- w === "closed" && i();
106
- })
107
- );
108
- };
109
- let c = () => {
110
- };
111
- e.on((i) => {
112
- switch (c(), i) {
113
- case "start-opening":
114
- c = $(() => e.set("opening"));
115
- break;
116
- case "opening":
117
- c = t(() => e.set("opened"));
118
- break;
119
- case "start-closing":
120
- c = $(() => e.set("closing"));
121
- break;
122
- case "closing":
123
- c = s(() => e.set("closed"));
124
- break;
125
- case "closed":
126
- c = () => {
127
- };
128
- break;
129
- }
130
- }), e.onDispose(() => {
131
- f.forEach((i) => i()), c();
132
- });
133
- const v = e.map((i) => i === "closed"), b = e.map((i) => i === "start-opening"), h = e.map((i) => i === "opening"), y = e.map((i) => i === "opened"), x = e.map((i) => i === "closing"), l = e.map((i) => i === "start-closing");
134
- return {
135
- status: e,
136
- open: n,
137
- close: r,
138
- toggle: m,
139
- setOpen: u,
140
- display: a,
141
- isClosed: v,
142
- isStartOpening: b,
143
- isOpening: h,
144
- isOpened: y,
145
- isClosing: x,
146
- isStartClosing: l,
147
- dispose: () => e.dispose(),
148
- listenOnClosed: p
149
- };
150
- }
151
- function he({
152
- initialStatus: o = "closed",
153
- duration: t,
154
- openDuration: s = t ?? 500,
155
- closeDuration: e = t ?? 500
156
- } = {}) {
157
- return N({
158
- initialStatus: o,
159
- openedAfter: (n) => _(n, s),
160
- closedAfter: (n) => _(n, e)
161
- });
162
- }
163
- function W(o, t) {
164
- let s = !1, e = null;
165
- function n() {
166
- s || (s = !0, o.removeEventListener("transitionend", r), o.removeEventListener("animationend", a), e && (clearTimeout(e), e = null), t());
167
- }
168
- function r(f) {
169
- f.target === o && n();
170
- }
171
- function a(f) {
172
- f.target === o && n();
173
- }
174
- const m = $(() => {
175
- if (typeof o.getAnimations > "u") {
176
- e = setTimeout(n, 16);
177
- return;
178
- }
179
- o.addEventListener("transitionend", r), o.addEventListener("animationend", a), o.getAnimations().length === 0 && (e = setTimeout(n, 1e3));
180
- });
181
- return () => {
182
- s = !0, m(), e && (clearTimeout(e), e = null), o.removeEventListener("transitionend", r), o.removeEventListener("animationend", a);
183
- };
184
- }
185
- function G({
186
- initialStatus: o = "closed",
187
- element: t
188
- } = {}) {
189
- let s = t;
190
- return {
191
- setElement: (e) => {
192
- s = e;
193
- },
194
- ...N({
195
- initialStatus: o,
196
- openedAfter: (e) => s == null ? (e(), () => {
197
- }) : W(s, e),
198
- closedAfter: (e) => s == null ? (e(), () => {
199
- }) : W(s, e)
200
- })
201
- };
202
- }
203
- function se(o) {
204
- if (o == null) return "";
205
- const t = [];
206
- return o.fade && t.push("fade"), o.slide && t.push(`slide-${o.slide}`), o.scale != null && t.push("scale"), t.length > 0 ? t.join(" ") : "none";
207
- }
208
- function ne(o) {
209
- if (o == null) return "";
210
- const t = [];
211
- return o.scale != null && typeof o.scale == "number" && t.push(`--scale-factor: ${o.scale}`), o.transformOrigin != null && t.push(`--transform-origin: ${o.transformOrigin}`), o.duration != null && t.push(`--animation-duration: ${o.duration}ms`), o.easing != null && t.push(`--animation-easing: ${o.easing}`), t.join("; ");
212
- }
213
- function oe({
214
- animation: o,
215
- status: t
216
- }) {
217
- const s = A(
218
- o,
219
- t
220
- )((n, r) => {
221
- if (n == null)
222
- return `bc-animated-toggle bc-animated-toggle--${r}`;
223
- const a = r === "start-opening" || r === "opening" || r === "opened";
224
- let u;
225
- return "enter" in n || "exit" in n ? u = a ? n.enter : n.exit : u = n, `bc-animated-toggle bc-animated-toggle--${se(u)} bc-animated-toggle--${r}`;
226
- }), e = A(
227
- o,
228
- t
229
- )((n, r) => {
230
- if (n == null) return "";
231
- const a = r === "start-opening" || r === "opening" || r === "opened";
232
- let u;
233
- return "enter" in n || "exit" in n ? u = a ? n.enter : n.exit : u = n, ne(u);
234
- });
235
- return M(g.class(s), g.style(e));
236
- }
237
- function ge({
238
- initialStatus: o = "closed",
239
- animation: t
240
- }, s) {
241
- return S((e) => {
242
- const { setElement: n, dispose: r, ...a } = G({
243
- initialStatus: o,
244
- element: e
245
- });
246
- return n(e), M(
247
- oe({ status: a.status, animation: t }),
248
- z(r),
249
- s(a)
250
- );
251
- });
252
- }
253
- function re(o) {
254
- return {
255
- "~standard": {
256
- version: 1,
257
- vendor: "beatui-custom",
258
- validate: (s) => {
259
- const e = o.validate(s);
260
- return e.success ? { value: e.data } : {
261
- issues: e.errors.map((n) => ({
262
- message: n.message,
263
- path: n.path
264
- }))
265
- };
266
- },
267
- types: void 0
268
- },
269
- safeParse: (s) => {
270
- const e = o.validate(s);
271
- return e.success ? { success: !0, data: e.data } : {
272
- success: !1,
273
- error: {
274
- errors: e.errors.map((n) => ({
275
- message: n.message,
276
- path: n.path?.map(
277
- (r) => typeof r == "object" && "key" in r ? r.key.toString() : r.toString()
278
- ) || []
279
- }))
280
- }
281
- };
282
- }
283
- };
284
- }
285
- class T {
286
- optional() {
287
- return new ae(this);
288
- }
289
- default(t) {
290
- return new ie(this, t);
291
- }
292
- schema() {
293
- return re(this);
294
- }
295
- }
296
- class C extends T {
297
- minLength;
298
- maxLength;
299
- pattern;
300
- customValidations = [];
301
- validate(t) {
302
- if (typeof t != "string")
303
- return { success: !1, errors: [{ message: "Expected string" }] };
304
- const s = [];
305
- this.minLength !== void 0 && t.length < this.minLength && s.push({ message: `Must be at least ${this.minLength} characters` }), this.maxLength !== void 0 && t.length > this.maxLength && s.push({ message: `Must be at most ${this.maxLength} characters` }), this.pattern && !this.pattern.test(t) && s.push({ message: "Invalid format" });
306
- for (const e of this.customValidations) {
307
- const n = e(t);
308
- n && s.push({ message: n });
309
- }
310
- return s.length > 0 ? { success: !1, errors: s } : { success: !0, data: t };
311
- }
312
- min(t, s) {
313
- const e = new C();
314
- return e.minLength = t, e.maxLength = this.maxLength, e.pattern = this.pattern, e.customValidations = [...this.customValidations], s && e.customValidations.push(
315
- (n) => n.length < t ? s : null
316
- ), e;
317
- }
318
- max(t, s) {
319
- const e = new C();
320
- return e.minLength = this.minLength, e.maxLength = t, e.pattern = this.pattern, e.customValidations = [...this.customValidations], s && e.customValidations.push(
321
- (n) => n.length > t ? s : null
322
- ), e;
323
- }
324
- regex(t, s) {
325
- const e = new C();
326
- return e.minLength = this.minLength, e.maxLength = this.maxLength, e.pattern = t, e.customValidations = [...this.customValidations], s && e.customValidations.push(
327
- (n) => t.test(n) ? null : s
328
- ), e;
329
- }
330
- email(t = "Please enter a valid email address") {
331
- const s = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, e = new C();
332
- return e.minLength = this.minLength, e.maxLength = this.maxLength, e.pattern = this.pattern, e.customValidations = [
333
- ...this.customValidations,
334
- (n) => s.test(n) ? null : t
335
- ], e;
336
- }
337
- refine(t) {
338
- const s = new C();
339
- return s.minLength = this.minLength, s.maxLength = this.maxLength, s.pattern = this.pattern, s.customValidations = [...this.customValidations, t], s;
340
- }
341
- }
342
- class O extends T {
343
- mustBeTrue = !1;
344
- trueMessage;
345
- validate(t) {
346
- return typeof t != "boolean" ? { success: !1, errors: [{ message: "Expected boolean" }] } : this.mustBeTrue && t !== !0 ? {
347
- success: !1,
348
- errors: [{ message: this.trueMessage || "Must be true" }]
349
- } : { success: !0, data: t };
350
- }
351
- refine(t, s) {
352
- const e = new O();
353
- e.mustBeTrue = this.mustBeTrue, e.trueMessage = this.trueMessage;
354
- const n = e.validate.bind(e);
355
- return e.validate = (r) => {
356
- const a = n(r);
357
- return a.success ? t(a.data) ? a : { success: !1, errors: [{ message: s }] } : a;
358
- }, e;
359
- }
360
- literal(t, s) {
361
- const e = new O();
362
- return e.mustBeTrue = !0, e.trueMessage = s, e;
363
- }
364
- }
365
- class ae extends T {
366
- constructor(t) {
367
- super(), this.inner = t;
368
- }
369
- validate(t) {
370
- if (t === void 0)
371
- return { success: !0, data: void 0 };
372
- const s = this.inner.validate(t);
373
- return s.success ? { success: !0, data: s.data } : { success: !1, errors: s.errors };
374
- }
375
- }
376
- class ie extends T {
377
- constructor(t, s) {
378
- super(), this.inner = t, this.defaultValue = s;
379
- }
380
- validate(t) {
381
- return t === void 0 ? { success: !0, data: this.defaultValue } : this.inner.validate(t);
382
- }
383
- }
384
- class D extends T {
385
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
386
- constructor(t) {
387
- super(), this.shape = t;
388
- }
389
- validate(t) {
390
- if (typeof t != "object" || t === null || Array.isArray(t))
391
- return { success: !1, errors: [{ message: "Expected object" }] };
392
- const s = t, e = {}, n = [];
393
- for (const [r, a] of Object.entries(this.shape)) {
394
- const u = a.validate(s[r]);
395
- if (u.success)
396
- e[r] = u.data;
397
- else
398
- for (const m of u.errors)
399
- n.push({
400
- message: m.message,
401
- path: [r, ...m.path || []]
402
- });
403
- }
404
- return n.length > 0 ? { success: !1, errors: n } : { success: !0, data: e };
405
- }
406
- refine(t, s) {
407
- const e = new D(this.shape), n = e.validate.bind(e);
408
- return e.validate = (r) => {
409
- const a = n(r);
410
- if (!a.success) return a;
411
- const u = t(a.data);
412
- return u ? {
413
- success: !1,
414
- errors: [
415
- {
416
- message: u,
417
- path: s?.path
418
- }
419
- ]
420
- } : { success: !0, data: a.data };
421
- }, e;
422
- }
423
- }
424
- const be = () => new C(), ve = () => new O(), ye = (o) => new D(o);
425
- function ce(o) {
426
- return J((t) => {
427
- const s = [], e = () => s.forEach((r) => r());
428
- return o(({
429
- effect: r = "opaque",
430
- mode: a = "capturing",
431
- onClickOutside: u,
432
- onEscape: m,
433
- content: f,
434
- container: p = "body"
435
- }) => {
436
- p === "body" && (t = t.makePortal("body"));
437
- const c = G();
438
- c.listenOnClosed(e);
439
- let v = () => {
440
- }, b = () => {
441
- };
442
- const h = (E) => {
443
- E.key === "Escape" && (m?.(), c.close());
444
- }, y = () => {
445
- u?.(), c.close();
446
- }, x = (E) => {
447
- v(), b(), E === "capturing" ? (document.addEventListener("keydown", h), v = () => document.removeEventListener("keydown", h), t.element.addEventListener("mousedown", y), b = () => t.element.removeEventListener("mousedown", y)) : (v = () => {
448
- }, b = () => {
449
- });
450
- }, l = U.on(a, x);
451
- s.push(l), s.push(() => {
452
- c.dispose(), v(), b();
453
- });
454
- const w = Q((() => {
455
- const E = /* @__PURE__ */ new Set();
456
- for (const d of t.element.querySelectorAll(
457
- ":scope > :not([data-overlay])"
458
- ))
459
- d.hasAttribute("inert") ? E.add(d) : d.setAttribute("inert", "");
460
- return s.push(() => {
461
- for (const d of t.element.querySelectorAll(
462
- ":scope > :not([data-overlay])"
463
- ))
464
- E.has(d) || d.removeAttribute("inert");
465
- E.clear();
466
- }), document.activeElement?.blur?.(), k.div(
467
- S((d) => c.setElement(d)),
468
- B.status(c.status.map(String)),
469
- B.overlay("true"),
470
- g.class(
471
- A(
472
- r ?? "opaque",
473
- a
474
- )(
475
- (d, L) => `bc-overlay bc-overlay--effect-${d} bc-overlay--mode-${L}`
476
- )
477
- ),
478
- f
479
- );
480
- })(), t.element, {
481
- disposeWithParent: !0,
482
- clear: !1,
483
- providers: t.providers
484
- });
485
- s.push(w), $(() => c.open());
486
- }, e);
487
- });
488
- }
489
- function le(o, t) {
490
- const {
491
- size: s = "md",
492
- dismissable: e = !0,
493
- showCloseButton: n = !0,
494
- onClose: r,
495
- overlayEffect: a = "opaque",
496
- container: u = "body",
497
- position: m = "center"
498
- } = o;
499
- return ce((f, p) => {
500
- let c = () => {
501
- };
502
- return t((h) => {
503
- c = p;
504
- const y = R("capturing");
505
- U.on(e, (d) => {
506
- y.set(d ? "capturing" : "non-capturing");
507
- });
508
- const x = A(
509
- h.header != null,
510
- n
511
- )((d, L) => d || L), l = Y("modal"), i = `${l}-header`, w = `${l}-body`, E = k.div(
512
- g.class(
513
- A(
514
- s,
515
- m
516
- )(
517
- (d, L) => `bc-modal bc-modal--size-${d} bc-modal--container-${u} bc-modal--position-${L}`
518
- )
519
- ),
520
- // Essential ARIA attributes for modal dialog
521
- g.role("dialog"),
522
- V.modal(!0),
523
- ...h.header ? [V.labelledby(i)] : [],
524
- V.describedby(w),
525
- g.tabindex(-1),
526
- // Make modal focusable for initial focus
527
- g.id(l),
528
- B.focusTrap("true"),
529
- // Mark as focus trap container
530
- X.mousedown((d) => d.stopPropagation()),
531
- // Prevent overlay click-outside when clicking modal content
532
- // Focus trap implementation
533
- F({
534
- escapeDeactivates: !1,
535
- // Let Overlay handle escape key
536
- initialFocus: () => {
537
- const d = document.getElementById(l);
538
- if (!d) return null;
539
- const L = d.querySelector(
540
- '[aria-label="Close modal"]'
541
- );
542
- if (L) return L;
543
- const I = d.querySelector(
544
- 'button, input, select, textarea, [tabindex]:not([tabindex="-1"])'
545
- );
546
- return I || d;
547
- }
548
- }),
549
- // Modal content container
550
- k.div(
551
- g.class("bc-modal__content"),
552
- // Header section
553
- j(
554
- x,
555
- () => k.div(
556
- g.class("bc-modal__header"),
557
- k.div(
558
- g.class("bc-modal__title"),
559
- ...h.header ? [g.id(i)] : [],
560
- h.header
561
- ),
562
- j(
563
- n,
564
- () => H(
565
- K,
566
- (d) => Z({
567
- size: "sm",
568
- label: d.$.closeModal,
569
- onClick: () => {
570
- c(), p();
571
- }
572
- })
573
- )
574
- )
575
- )
576
- ),
577
- // Body section
578
- k.div(g.class("bc-modal__body"), g.id(w), h.body),
579
- // Footer section
580
- h.footer && k.div(g.class("bc-modal__footer"), h.footer)
581
- )
582
- );
583
- f({
584
- mode: y,
585
- effect: a ?? "opaque",
586
- container: u,
587
- content: E,
588
- onClickOutside: () => {
589
- r?.(), p();
590
- },
591
- onEscape: () => {
592
- r?.(), p();
593
- }
594
- });
595
- }, () => {
596
- c(), p();
597
- });
598
- });
599
- }
600
- function Ee(o, t) {
601
- const { confirmText: s, cancelText: e, onConfirm: n, onCancel: r, ...a } = o;
602
- return H(
603
- K,
604
- (u) => le({ showCloseButton: !1, ...a }, (m, f) => {
605
- const p = () => {
606
- n?.(), f();
607
- }, c = () => {
608
- r?.(), f();
609
- };
610
- return t((b) => {
611
- m({
612
- body: b,
613
- footer: M(
614
- g.class("bc-modal__actions"),
615
- P(
616
- {
617
- variant: "outline",
618
- onClick: c
619
- },
620
- q(e, u.$.cancel)
621
- ),
622
- P(
623
- {
624
- color: "primary",
625
- variant: "filled",
626
- onClick: p
627
- },
628
- q(s, u.$.confirm)
629
- )
630
- )
631
- });
632
- }, f);
633
- })
634
- );
635
- }
636
- export {
637
- oe as A,
638
- O as B,
639
- Ee as C,
640
- F,
641
- le as M,
642
- ce as O,
643
- C as S,
644
- ge as a,
645
- ve as b,
646
- D as c,
647
- re as d,
648
- pe as e,
649
- N as f,
650
- he as g,
651
- ye as o,
652
- be as s,
653
- G as u
654
- };
@@ -1 +0,0 @@
1
- "use strict";const r=require("@tempots/dom"),w=require("./timer-BJHOsuS6.cjs"),q=require("./use-form-D4JFOcjo.cjs"),O=require("./translations-WPN3ibDg.cjs"),_=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"audio[controls]","video[controls]","details > summary:first-of-type","details[open]"].join(", ");function P(o){return Array.from(o.querySelectorAll(_)).filter(t=>{const s=t;return s.offsetWidth>0&&s.offsetHeight>0&&!s.hasAttribute("inert")&&window.getComputedStyle(s).visibility!=="hidden"})}function V(o={}){const{active:t=!0,escapeDeactivates:s=!0,onEscape:e,initialFocus:n,returnFocus:a,clickOutsideDeactivates:i=!1,onClickOutside:d}=o;return r.WithElement(p=>{let f=t,h=null,c=[];typeof document<"u"&&(h=document.activeElement);const v=()=>{c=P(p)},b=u=>{if(f){if(s&&u.key==="Escape"){u.preventDefault(),e?.();return}if(u.key==="Tab"){if(v(),c.length===0){u.preventDefault();return}const l=c.indexOf(document.activeElement);u.shiftKey?l<=0&&(u.preventDefault(),c[c.length-1]?.focus()):l>=c.length-1&&(u.preventDefault(),c[0]?.focus())}}},g=u=>{if(!f||!i)return;const l=u.target;p.contains(l)||d?.()},y=()=>{if(!f)return;v();let u=null;typeof n=="function"?u=n():n?u=n:c.length>0&&(u=c[0]),u&&setTimeout(()=>{u?.focus()},50),document.addEventListener("keydown",b,!0),i&&document.addEventListener("click",g,!0)},A=()=>{f=!1,document.removeEventListener("keydown",b,!0),document.removeEventListener("click",g,!0);let u=null;typeof a=="function"?u=a():a?u=a:h&&(u=h),u&&document.body.contains(u)&&setTimeout(()=>{u?.focus()},0)};return setTimeout(()=>y(),0),r.OnDispose(()=>{A()})})}function U(o={}){return{activate:()=>V({...o,active:!0}),deactivate:()=>V({...o,active:!1})}}function B({initialStatus:o="closed",openedAfter:t,closedAfter:s}){const e=r.prop(o),n=()=>{e.set("start-opening")},a=()=>{e.set("start-closing")},i=e.map(l=>l!=="closed"&&l!=="start-closing"&&l!=="closing"),d=l=>{l?n():a()},p=()=>{d(!i.value)},f=[],h=l=>{f.push(e.on(x=>{x==="closed"&&l()}))};let c=()=>{};e.on(l=>{switch(c(),l){case"start-opening":c=w.g(()=>e.set("opening"));break;case"opening":c=t(()=>e.set("opened"));break;case"start-closing":c=w.g(()=>e.set("closing"));break;case"closing":c=s(()=>e.set("closed"));break;case"closed":c=()=>{};break}}),e.onDispose(()=>{f.forEach(l=>l()),c()});const v=e.map(l=>l==="closed"),b=e.map(l=>l==="start-opening"),g=e.map(l=>l==="opening"),y=e.map(l=>l==="opened"),A=e.map(l=>l==="closing"),u=e.map(l=>l==="start-closing");return{status:e,open:n,close:a,toggle:p,setOpen:d,display:i,isClosed:v,isStartOpening:b,isOpening:g,isOpened:y,isClosing:A,isStartClosing:u,dispose:()=>e.dispose(),listenOnClosed:h}}function z({initialStatus:o="closed",duration:t,openDuration:s=t??500,closeDuration:e=t??500}={}){return B({initialStatus:o,openedAfter:n=>w.I(n,s),closedAfter:n=>w.I(n,e)})}function I(o,t){let s=!1,e=null;function n(){s||(s=!0,o.removeEventListener("transitionend",a),o.removeEventListener("animationend",i),e&&(clearTimeout(e),e=null),t())}function a(f){f.target===o&&n()}function i(f){f.target===o&&n()}const d=()=>{if(typeof o.getAnimations>"u"){e=setTimeout(n,16);return}o.addEventListener("transitionend",a),o.addEventListener("animationend",i),o.getAnimations().length===0&&(e=setTimeout(n,1e3))},p=w.g(d);return()=>{s=!0,p(),e&&(clearTimeout(e),e=null),o.removeEventListener("transitionend",a),o.removeEventListener("animationend",i)}}function F({initialStatus:o="closed",element:t}={}){let s=t;return{setElement:e=>{s=e},...B({initialStatus:o,openedAfter:e=>s==null?(e(),()=>{}):I(s,e),closedAfter:e=>s==null?(e(),()=>{}):I(s,e)})}}function R(o){if(o==null)return"";const t=[];return o.fade&&t.push("fade"),o.slide&&t.push(`slide-${o.slide}`),o.scale!=null&&t.push("scale"),t.length>0?t.join(" "):"none"}function H(o){if(o==null)return"";const t=[];return o.scale!=null&&typeof o.scale=="number"&&t.push(`--scale-factor: ${o.scale}`),o.transformOrigin!=null&&t.push(`--transform-origin: ${o.transformOrigin}`),o.duration!=null&&t.push(`--animation-duration: ${o.duration}ms`),o.easing!=null&&t.push(`--animation-easing: ${o.easing}`),t.join("; ")}function M({animation:o,status:t}){const s=r.computedOf(o,t)((n,a)=>{if(n==null)return`bc-animated-toggle bc-animated-toggle--${a}`;const i=a==="start-opening"||a==="opening"||a==="opened";let d;return"enter"in n||"exit"in n?d=i?n.enter:n.exit:d=n,`bc-animated-toggle bc-animated-toggle--${R(d)} bc-animated-toggle--${a}`}),e=r.computedOf(o,t)((n,a)=>{if(n==null)return"";const i=a==="start-opening"||a==="opening"||a==="opened";let d;return"enter"in n||"exit"in n?d=i?n.enter:n.exit:d=n,H(d)});return r.Fragment(r.attr.class(s),r.attr.style(e))}function K({initialStatus:o="closed",animation:t},s){return r.WithElement(e=>{const{setElement:n,dispose:a,...i}=F({initialStatus:o,element:e});return n(e),r.Fragment(M({status:i.status,animation:t}),r.OnDispose(a),s(i))})}function D(o){return{"~standard":{version:1,vendor:"beatui-custom",validate:s=>{const e=o.validate(s);return e.success?{value:e.data}:{issues:e.errors.map(n=>({message:n.message,path:n.path}))}},types:void 0},safeParse:s=>{const e=o.validate(s);return e.success?{success:!0,data:e.data}:{success:!1,error:{errors:e.errors.map(n=>({message:n.message,path:n.path?.map(a=>typeof a=="object"&&"key"in a?a.key.toString():a.toString())||[]}))}}}}}class k{optional(){return new N(this)}default(t){return new G(this,t)}schema(){return D(this)}}class T extends k{minLength;maxLength;pattern;customValidations=[];validate(t){if(typeof t!="string")return{success:!1,errors:[{message:"Expected string"}]};const s=[];this.minLength!==void 0&&t.length<this.minLength&&s.push({message:`Must be at least ${this.minLength} characters`}),this.maxLength!==void 0&&t.length>this.maxLength&&s.push({message:`Must be at most ${this.maxLength} characters`}),this.pattern&&!this.pattern.test(t)&&s.push({message:"Invalid format"});for(const e of this.customValidations){const n=e(t);n&&s.push({message:n})}return s.length>0?{success:!1,errors:s}:{success:!0,data:t}}min(t,s){const e=new T;return e.minLength=t,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(n=>n.length<t?s:null),e}max(t,s){const e=new T;return e.minLength=this.minLength,e.maxLength=t,e.pattern=this.pattern,e.customValidations=[...this.customValidations],s&&e.customValidations.push(n=>n.length>t?s:null),e}regex(t,s){const e=new T;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=t,e.customValidations=[...this.customValidations],s&&e.customValidations.push(n=>t.test(n)?null:s),e}email(t="Please enter a valid email address"){const s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,e=new T;return e.minLength=this.minLength,e.maxLength=this.maxLength,e.pattern=this.pattern,e.customValidations=[...this.customValidations,n=>s.test(n)?null:t],e}refine(t){const s=new T;return s.minLength=this.minLength,s.maxLength=this.maxLength,s.pattern=this.pattern,s.customValidations=[...this.customValidations,t],s}}class C extends k{mustBeTrue=!1;trueMessage;validate(t){return typeof t!="boolean"?{success:!1,errors:[{message:"Expected boolean"}]}:this.mustBeTrue&&t!==!0?{success:!1,errors:[{message:this.trueMessage||"Must be true"}]}:{success:!0,data:t}}refine(t,s){const e=new C;e.mustBeTrue=this.mustBeTrue,e.trueMessage=this.trueMessage;const n=e.validate.bind(e);return e.validate=a=>{const i=n(a);return i.success?t(i.data)?i:{success:!1,errors:[{message:s}]}:i},e}literal(t,s){const e=new C;return e.mustBeTrue=!0,e.trueMessage=s,e}}class N extends k{constructor(t){super(),this.inner=t}validate(t){if(t===void 0)return{success:!0,data:void 0};const s=this.inner.validate(t);return s.success?{success:!0,data:s.data}:{success:!1,errors:s.errors}}}class G extends k{constructor(t,s){super(),this.inner=t,this.defaultValue=s}validate(t){return t===void 0?{success:!0,data:this.defaultValue}:this.inner.validate(t)}}class $ extends k{constructor(t){super(),this.shape=t}validate(t){if(typeof t!="object"||t===null||Array.isArray(t))return{success:!1,errors:[{message:"Expected object"}]};const s=t,e={},n=[];for(const[a,i]of Object.entries(this.shape)){const d=i.validate(s[a]);if(d.success)e[a]=d.data;else for(const p of d.errors)n.push({message:p.message,path:[a,...p.path||[]]})}return n.length>0?{success:!1,errors:n}:{success:!0,data:e}}refine(t,s){const e=new $(this.shape),n=e.validate.bind(e);return e.validate=a=>{const i=n(a);if(!i.success)return i;const d=t(i.data);return d?{success:!1,errors:[{message:d,path:s?.path}]}:{success:!0,data:i.data}},e}}const J=()=>new T,Q=()=>new C,X=o=>new $(o);function j(o){return r.WithBrowserCtx(t=>{const s=[],e=()=>s.forEach(a=>a());return o(({effect:a="opaque",mode:i="capturing",onClickOutside:d,onEscape:p,content:f,container:h="body"})=>{h==="body"&&(t=t.makePortal("body"));const c=F();c.listenOnClosed(e);let v=()=>{},b=()=>{};const g=E=>{E.key==="Escape"&&(p?.(),c.close())},y=()=>{d?.(),c.close()},A=E=>{v(),b(),E==="capturing"?(document.addEventListener("keydown",g),v=()=>document.removeEventListener("keydown",g),t.element.addEventListener("mousedown",y),b=()=>t.element.removeEventListener("mousedown",y)):(v=()=>{},b=()=>{})},u=r.Value.on(i,A);s.push(u),s.push(()=>{c.dispose(),v(),b()});const l=()=>{const E=new Set;for(const m of t.element.querySelectorAll(":scope > :not([data-overlay])"))m.hasAttribute("inert")?E.add(m):m.setAttribute("inert","");return s.push(()=>{for(const m of t.element.querySelectorAll(":scope > :not([data-overlay])"))E.has(m)||m.removeAttribute("inert");E.clear()}),document.activeElement?.blur?.(),r.html.div(r.WithElement(m=>c.setElement(m)),r.dataAttr.status(c.status.map(String)),r.dataAttr.overlay("true"),r.attr.class(r.computedOf(a??"opaque",i)((m,L)=>`bc-overlay bc-overlay--effect-${m} bc-overlay--mode-${L}`)),f)},x=r.render(l(),t.element,{disposeWithParent:!0,clear:!1,providers:t.providers});s.push(x),w.g(()=>c.open())},e)})}function W(o,t){const{size:s="md",dismissable:e=!0,showCloseButton:n=!0,onClose:a,overlayEffect:i="opaque",container:d="body",position:p="center"}=o;return j((f,h)=>{let c=()=>{};return t(g=>{c=h;const y=r.prop("capturing");r.Value.on(e,m=>{y.set(m?"capturing":"non-capturing")});const A=r.computedOf(g.header!=null,n)((m,L)=>m||L),u=q.sessionId("modal"),l=`${u}-header`,x=`${u}-body`,E=r.html.div(r.attr.class(r.computedOf(s,p)((m,L)=>`bc-modal bc-modal--size-${m} bc-modal--container-${d} bc-modal--position-${L}`)),r.attr.role("dialog"),r.aria.modal(!0),...g.header?[r.aria.labelledby(l)]:[],r.aria.describedby(x),r.attr.tabindex(-1),r.attr.id(u),r.dataAttr.focusTrap("true"),r.on.mousedown(m=>m.stopPropagation()),V({escapeDeactivates:!1,initialFocus:()=>{const m=document.getElementById(u);if(!m)return null;const L=m.querySelector('[aria-label="Close modal"]');if(L)return L;const S=m.querySelector('button, input, select, textarea, [tabindex]:not([tabindex="-1"])');return S||m}}),r.html.div(r.attr.class("bc-modal__content"),r.When(A,()=>r.html.div(r.attr.class("bc-modal__header"),r.html.div(r.attr.class("bc-modal__title"),...g.header?[r.attr.id(l)]:[],g.header),r.When(n,()=>r.Use(O.BeatUII18n,m=>q.CloseButton({size:"sm",label:m.$.closeModal,onClick:()=>{c(),h()}}))))),r.html.div(r.attr.class("bc-modal__body"),r.attr.id(x),g.body),g.footer&&r.html.div(r.attr.class("bc-modal__footer"),g.footer)));f({mode:y,effect:i??"opaque",container:d,content:E,onClickOutside:()=>{a?.(),h()},onEscape:()=>{a?.(),h()}})},()=>{c(),h()})})}function Y(o,t){const{confirmText:s,cancelText:e,onConfirm:n,onCancel:a,...i}=o;return r.Use(O.BeatUII18n,d=>W({showCloseButton:!1,...i},(p,f)=>{const h=()=>{n?.(),f()},c=()=>{a?.(),f()};return t(b=>{p({body:b,footer:r.Fragment(r.attr.class("bc-modal__actions"),O.Button({variant:"outline",onClick:c},r.coalesce(e,d.$.cancel)),O.Button({color:"primary",variant:"filled",onClick:h},r.coalesce(s,d.$.confirm)))})},f)}))}exports.AnimatedToggle=K;exports.AnimatedToggleClass=M;exports.BooleanValidator=C;exports.ConfirmModal=Y;exports.FocusTrap=V;exports.Modal=W;exports.ObjectValidator=$;exports.Overlay=j;exports.StringValidator=T;exports.boolean=Q;exports.createStandardSchema=D;exports.object=X;exports.string=J;exports.useAnimatedElementToggle=F;exports.useAnimatedToggle=B;exports.useFocusTrap=U;exports.useTimedToggle=z;
@@ -1 +0,0 @@
1
- "use strict";const l=require("./translations-WPN3ibDg.cjs"),t=require("@tempots/dom"),C=require("./use-form-D4JFOcjo.cjs"),E=n=>{const r={name:"email",autocomplete:"email",...n},{value:c,before:s,onBlur:a,onChange:p,onInput:i,placeholder:h}=r,d=s??l.InputIcon({icon:"line-md:email",size:n.size,color:"neutral"});return t.Use(l.BeatUII18n,b=>l.InputContainer({...n,before:d,input:t.input.email(l.CommonInputAttributes(r),t.attr.placeholder(t.coalesce(h,b.$.emailPlaceholderText)),t.attr.value(c),t.attr.class("bc-input"),a!=null?t.on.blur(t.emitValue(a)):t.Empty,p!=null?t.on.change(t.emitValue(p)):t.Empty,i!=null?t.on.input(t.emitValue(i)):t.Empty)}))},_=n=>{const{value:r,onBlur:c,onChange:s,onInput:a,before:p,after:i,hasError:h,disabled:d,autocomplete:b,placeholder:I,...f}=n,y={name:"password",disabled:d,...f},u=t.prop(!0),o=t.computedOf(u,b)((e,m)=>e?m??"current-password":"off");return t.Use(l.BeatUII18n,e=>{const m=t.computedOf(e.$.passwordPlaceholderText,u,I)((g,V,v)=>V?"•••••••••••••••":v??g),w=t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__password-toggle"),t.aria.label(e.$.togglePasswordVisibility),t.on.click(()=>u.update(g=>!g)),t.When(u,()=>l.Icon({icon:"line-md:watch"}),()=>l.Icon({icon:"line-md:watch-off"})));return l.InputContainer({before:p,disabled:d,hasError:h,input:t.html.input(l.CommonInputAttributes({...y,autocomplete:o,placeholder:m}),t.When(u,()=>t.Fragment(t.attr.type("password")),()=>t.Fragment(t.attr.type("text"))),t.attr.class("bc-input"),t.attr.value(r),c!=null?t.on.blur(t.emitValue(c)):t.Empty,s!=null?t.on.change(t.emitValue(s)):t.Empty,a!=null?t.on.input(t.emitValue(a)):t.Empty),after:i!=null?t.Fragment(w,i):w})})};function O(n){switch(n){case"success":return"material-symbols:check-circle-outline";case"warning":return"material-symbols:warning-outline";case"danger":return"material-symbols:error-outline";case"info":default:return"material-symbols:info-outline"}}function B(n){switch(n){case"success":return"success";case"warning":return"warning";case"danger":return"danger";case"info":default:return"info"}}function U(n,r,c,s){const a=["bc-notice",`bc-notice--${n}`,`bc-notice--tone-${r}`];return c&&a.push("bc-notice--dismissible"),s&&s.length>0&&a.push(s),a.join(" ")}function P({variant:n="info",tone:r="subtle",role:c,title:s,icon:a,closable:p=!1,onDismiss:i,class:h},...d){const b=t.prop(!0);return t.When(b,()=>{const I=t.Value.map(p,o=>!!o||i!=null),f=t.Value.map(n,o=>o??"info"),y=t.Value.map(r,o=>o??"subtle"),u=t.computedOf(c,f)((o,e)=>o??(e==="danger"?"alert":"status"));return t.Use(l.BeatUII18n,o=>t.html.div(t.attr.class(t.computedOf(f,y,I,h)((e,m,w,g)=>U(e,m,w,g))),t.attr.role(t.Value.map(u,e=>e)),t.Unless(t.Value.map(a,e=>e===!1),()=>t.html.div(t.attr.class("bc-notice__icon"),l.Icon({icon:t.computedOf(a,f)((e,m)=>e===void 0?O(m):String(e)),size:"md",color:t.Value.map(f,B)}))),t.html.div(t.attr.class("bc-notice__body"),t.Ensure(s,e=>t.html.div(t.attr.class("bc-notice__title"),e)),t.html.div(t.attr.class("bc-notice__content"),...d)),t.When(I,()=>C.CloseButton({size:"xs",label:o.$.closeModal,onClick:()=>{b.set(!1),i?.()}}))))})}exports.EmailInput=E;exports.Notice=P;exports.PasswordInput=_;
@@ -1 +0,0 @@
1
- "use strict";const e=require("@tempots/dom"),h=require("./translations-WPN3ibDg.cjs"),l=["button:not([disabled])",'[role="button"]:not([aria-disabled="true"])',"a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function m(...a){return e.html.div(e.attr.class("bc-toolbar"),e.attr.role("toolbar"),e.aria.orientation("horizontal"),e.WithElement(n=>{const f=()=>{const r=Array.from(n.querySelectorAll(l));r.length!==0&&r.forEach((t,o)=>t.setAttribute("tabindex",o===0?"0":"-1"))},c=r=>{const t=Array.from(n.querySelectorAll(l));if(t.length===0)return;const o=t.findIndex(u=>u===document.activeElement);let i=(o===-1?0:o)+r;i<0&&(i=t.length-1),i>=t.length&&(i=0),t.forEach(u=>u.setAttribute("tabindex","-1"));const d=t[i];d.setAttribute("tabindex","0"),d.focus()};setTimeout(f,0);const b=r=>{switch(r.key){case"ArrowRight":r.preventDefault(),c(1);break;case"ArrowLeft":r.preventDefault(),c(-1);break;case"Home":r.preventDefault(),c(-1);{const t=Array.from(n.querySelectorAll(l));if(t.length){t.forEach(s=>s.setAttribute("tabindex","-1"));const o=t[0];o.setAttribute("tabindex","0"),o.focus()}}break;case"End":r.preventDefault();{const t=Array.from(n.querySelectorAll(l));if(t.length){t.forEach(s=>s.setAttribute("tabindex","-1"));const o=t[t.length-1];o.setAttribute("tabindex","0"),o.focus()}}break}};return n.addEventListener("keydown",b),e.OnDispose(()=>{n.removeEventListener("keydown",b)})}),...a)}function v(a,...n){return h.Button({color:"neutral",roundedness:"md",variant:"light",...a},e.attr.class("bc-toolbar__button"),...n)}function A(...a){return e.html.div(e.attr.class("bc-toolbar__group"),e.attr.role("group"),...a)}function x(){return e.html.div(e.attr.class("bc-toolbar__divider"),e.attr.role("separator"),e.aria.orientation("vertical"))}function p(){return e.html.div(e.attr.class("bc-toolbar__spacer"))}exports.Toolbar=m;exports.ToolbarButton=v;exports.ToolbarDivider=x;exports.ToolbarGroup=A;exports.ToolbarSpacer=p;