@tempots/beatui 0.86.0 → 0.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/auth/index.cjs.js +1 -1
  2. package/dist/auth/index.es.js +1 -1
  3. package/dist/{auth-divider-C3_CgC0l.js → auth-divider-BIefTDoO.js} +5 -5
  4. package/dist/{auth-divider-C4WTL71M.cjs → auth-divider-V_Se6Qhe.cjs} +1 -1
  5. package/dist/beatui.css +13 -10
  6. package/dist/beatui.tailwind.css +13 -10
  7. package/dist/better-auth/index.cjs.js +1 -1
  8. package/dist/better-auth/index.es.js +4 -4
  9. package/dist/{deep-merge-CmQoIYPC.js → deep-merge-BRqRzEQs.js} +3 -3
  10. package/dist/{deep-merge-UghuPcyW.cjs → deep-merge-CvN7Xvd1.cjs} +1 -1
  11. package/dist/{duration-input-DaB6s0rL.js → duration-input-BDEb1Bb7.js} +95 -89
  12. package/dist/duration-input-BtFL5Vjx.cjs +1 -0
  13. package/dist/{editor-toolbar-group-_V1rDM-1.cjs → editor-toolbar-group-BgWLVgMZ.cjs} +1 -1
  14. package/dist/{editor-toolbar-group-BslfdazC.js → editor-toolbar-group-CwCCGzEC.js} +1 -1
  15. package/dist/{index-DfJMDwSU.js → index-B0t-nt7i.js} +1 -1
  16. package/dist/{index-BzRuy4V1.cjs → index-CaWDj1Vg.cjs} +2 -2
  17. package/dist/{index-vzoI95E1.js → index-DdqGL9Jk.js} +4 -4
  18. package/dist/{index-4GQLcxme.cjs → index-qa82MK4Z.cjs} +1 -1
  19. package/dist/index.cjs.js +2 -2
  20. package/dist/index.es.js +18 -21
  21. package/dist/input-container-B31Seozh.cjs +1 -0
  22. package/dist/input-container-DhUiLmXE.js +263 -0
  23. package/dist/json-schema/index.cjs.js +1 -1
  24. package/dist/json-schema/index.es.js +7 -7
  25. package/dist/json-structure/index.cjs.js +1 -1
  26. package/dist/json-structure/index.es.js +5 -5
  27. package/dist/lexical/index.cjs.js +1 -1
  28. package/dist/lexical/index.es.js +3 -3
  29. package/dist/{modal-kyZfvVZb.cjs → modal-Coenk8Fy.cjs} +1 -1
  30. package/dist/{modal-DaI1jH-X.js → modal-Dkje8L_l.js} +2 -2
  31. package/dist/{notice-Dz4nX57_.js → notice-BmkckDsD.js} +3 -3
  32. package/dist/{notice-Bc1L4Zpr.cjs → notice-DMK7dx9a.cjs} +1 -1
  33. package/dist/prosemirror/index.cjs.js +1 -1
  34. package/dist/prosemirror/index.es.js +1 -1
  35. package/dist/{text-input-CPJzUC2r.js → text-input-BZmAB3_o.js} +15 -15
  36. package/dist/text-input-w0eVcqk5.cjs +1 -0
  37. package/dist/{toolbar-D3ZsC0g_.cjs → toolbar-BR8In7O0.cjs} +1 -1
  38. package/dist/{toolbar-CjQG7l7X.js → toolbar-Pdj-F80l.js} +1 -1
  39. package/dist/types/components/form/input/input-container.d.ts +5 -2
  40. package/dist/types/components/form/input/input-options.d.ts +24 -2
  41. package/dist/types/components/form/input/nullable-plain-date-input.d.ts +1 -0
  42. package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +1 -0
  43. package/dist/types/components/form/input/nullable-plain-time-input.d.ts +1 -0
  44. package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +1 -0
  45. package/dist/types/components/form/input/plain-date-input.d.ts +1 -0
  46. package/dist/types/components/form/input/plain-date-time-input.d.ts +1 -0
  47. package/dist/types/components/form/input/plain-time-input.d.ts +1 -0
  48. package/dist/types/components/form/input/plain-year-month-input.d.ts +1 -0
  49. package/dist/{use-form-BurzbPVV.js → use-form-BSvvERhX.js} +1 -1
  50. package/dist/{use-form-Uree6QFy.cjs → use-form-B_mCauP0.cjs} +1 -1
  51. package/dist/{widget-customization-B9Oc1bG4.cjs → widget-customization-BASfRpF7.cjs} +1 -1
  52. package/dist/{widget-customization-Ct2eqKKR.js → widget-customization-DFr3ycD7.js} +4 -4
  53. package/package.json +2 -2
  54. package/dist/duration-input-BJzKgI15.cjs +0 -1
  55. package/dist/input-container-CSi72GI1.cjs +0 -1
  56. package/dist/input-container-Nx0gMAzS.js +0 -258
  57. package/dist/text-input-8v79fzEy.cjs +0 -1
package/dist/index.es.js CHANGED
@@ -7,34 +7,34 @@ import { c as Se } from "./colors-BmLYKmoH.js";
7
7
  import { b as fl, h as gl, j as ml, e as hl, d as vl, o as yl, g as _l, a as wl, m as kl, k as xl, n as Cl, r as $l, s as Sl, f as Dl, i as Il, t as Tl } from "./colors-BmLYKmoH.js";
8
8
  import { e as On } from "./index-D2_J_-XS.js";
9
9
  import { J as Ml, aa as Pl, v as Al, j as Bl, L as Vl, P as El, K as Nl, M as Rl, h as Ol, n as Fl, f as jl, a as Ul, ai as zl, q as Hl, a5 as Wl, al as Yl, u as Gl, I as ql, B as Zl, as as Jl, g as Kl, F as Xl, y as Ql, aq as ei, a4 as ti, a9 as ni, T as ai, c as si, af as ri, ae as oi, m as li, l as ii, k as ci, a1 as ui, a0 as di, V as pi, U as bi, S as fi, R as gi, X as mi, W as hi, $ as vi, _ as yi, Z as _i, Y as wi, ad as ki, d as xi, ah as Ci, ag as $i, p as Si, o as Di, a3 as Ii, a2 as Ti, ak as Li, t as Mi, H as Pi, A as Ai, ar as Bi, E as Vi, D as Ei, x as Ni, b as Ri, ap as Oi, ao as Fi, i as ji, a8 as Ui, a7 as zi, O as Hi, N as Wi, ab as Yi, ac as Gi, r as qi, Q as Zi, aj as Ji, s as Ki, G as Xi, z as Qi, an as ec, C as tc, w as nc, am as ac, a6 as sc } from "./index-D2_J_-XS.js";
10
- import { C as We, m as Gt, c as qt, I as ft, B as Zt, b as Jt, d as Fn } from "./use-form-BurzbPVV.js";
11
- import { A as oc, h as lc, a as ic, j as cc, M as uc, f as dc, R as pc, n as bc, q as fc, o as gc, l as mc, k as hc, e as vc, p as yc, i as _c, s as wc, t as kc, g as xc, u as Cc, w as $c } from "./use-form-BurzbPVV.js";
10
+ import { C as We, m as Gt, c as qt, I as ft, B as Zt, b as Jt, d as Fn } from "./use-form-BSvvERhX.js";
11
+ import { A as oc, h as lc, a as ic, j as cc, M as uc, f as dc, R as pc, n as bc, q as fc, o as gc, l as mc, k as hc, e as vc, p as yc, i as _c, s as wc, t as kc, g as xc, u as Cc, w as $c } from "./use-form-BSvvERhX.js";
12
12
  import { u as Ke, A as St, a as jn } from "./use-animated-toggle-89fKlXxy.js";
13
13
  import { b as Dc, c as Ic } from "./use-animated-toggle-89fKlXxy.js";
14
14
  import { T as Kt, a as Un } from "./theme-BzpMLdvH.js";
15
15
  import { beatuiPreset as Lc, createBeatuiPreset as Mc } from "./tailwind/preset.es.js";
16
- import { p as Dt, q as zn, r as Hn, s as It, t as Fe } from "./widget-customization-Ct2eqKKR.js";
17
- import { B as Ac, v as Bc, C as Vc, E as Ec, f as Nc, e as Rc, h as Oc, d as Fc, j as jc, i as Uc, a as zc, N as Hc, b as Wc, c as Yc, R as Gc, S as qc, k as Zc, u as Jc, m as Kc, n as Xc, l as Qc, T as eu, D as tu, A as nu, I as au, J as su, y as ru, w as ou, x as lu, O as iu, H as cu, P as uu, F as du, U as pu, z as bu, K as fu, L as gu, Q as mu, M as hu, G as vu } from "./widget-customization-Ct2eqKKR.js";
18
- import { B as Be, I as ye, a as Xe, b as Tt, c as Lt } from "./input-container-Nx0gMAzS.js";
19
- import { g as _u } from "./input-container-Nx0gMAzS.js";
20
- import { W as Ce, S as Wn, G as Xt, E as Yn, b as Qt, N as Qe, M as gt } from "./deep-merge-CmQoIYPC.js";
21
- import { B as ku, o as xu, F as Cu, L as $u, n as Su, l as Du, h as Iu, c as Tu, f as Lu, g as Mu, T as Pu, U as Au, i as Bu, k as Vu, a as Eu, j as Nu, p as Ru, q as Ou, r as Fu, e as ju, t as Uu, m as zu } from "./deep-merge-CmQoIYPC.js";
22
- import { C as Ie } from "./text-input-CPJzUC2r.js";
23
- import { T as Wu } from "./text-input-CPJzUC2r.js";
16
+ import { p as Dt, q as zn, r as Hn, s as It, t as Fe } from "./widget-customization-DFr3ycD7.js";
17
+ import { B as Ac, v as Bc, C as Vc, E as Ec, f as Nc, e as Rc, h as Oc, d as Fc, j as jc, i as Uc, a as zc, N as Hc, b as Wc, c as Yc, R as Gc, S as qc, k as Zc, u as Jc, m as Kc, n as Xc, l as Qc, T as eu, D as tu, A as nu, I as au, J as su, y as ru, w as ou, x as lu, O as iu, H as cu, P as uu, F as du, U as pu, z as bu, K as fu, L as gu, Q as mu, M as hu, G as vu } from "./widget-customization-DFr3ycD7.js";
18
+ import { B as Be, I as ye, a as Xe, b as Tt, c as Lt } from "./input-container-DhUiLmXE.js";
19
+ import { g as _u } from "./input-container-DhUiLmXE.js";
20
+ import { W as Ce, S as Wn, G as Xt, E as Yn, b as Qt, N as Qe, M as gt } from "./deep-merge-BRqRzEQs.js";
21
+ import { B as ku, o as xu, F as Cu, L as $u, n as Su, l as Du, h as Iu, c as Tu, f as Lu, g as Mu, T as Pu, U as Au, i as Bu, k as Vu, a as Eu, j as Nu, p as Ru, q as Ou, r as Fu, e as ju, t as Uu, m as zu } from "./deep-merge-BRqRzEQs.js";
22
+ import { C as Ie } from "./text-input-BZmAB3_o.js";
23
+ import { T as Wu } from "./text-input-BZmAB3_o.js";
24
24
  import { F as mt, M as en, a as tn } from "./menu-Ui4lUPHM.js";
25
25
  import { b as Gu } from "./menu-Ui4lUPHM.js";
26
26
  import { s as ve } from "./session-id-3KiilioY.js";
27
- import { E as Zu, N as Ju, P as Ku } from "./notice-Dz4nX57_.js";
28
- import { f as Gn, g as qn } from "./duration-input-DaB6s0rL.js";
29
- import { B as Qu, D as ed, F as td, N as nd, d as ad, b as sd, a as rd, e as od, c as ld, P as id } from "./duration-input-DaB6s0rL.js";
30
- import { O as ht, F as nn, M as vt } from "./modal-DaI1jH-X.js";
31
- import { B as ud, C as dd, a as pd, S as bd, b as fd, c as gd, o as md, s as hd, u as vd } from "./modal-DaI1jH-X.js";
27
+ import { E as Zu, N as Ju, P as Ku } from "./notice-BmkckDsD.js";
28
+ import { f as Gn, g as qn } from "./duration-input-BDEb1Bb7.js";
29
+ import { B as Qu, D as ed, F as td, N as nd, d as ad, b as sd, a as rd, e as od, c as ld, P as id } from "./duration-input-BDEb1Bb7.js";
30
+ import { O as ht, F as nn, M as vt } from "./modal-Dkje8L_l.js";
31
+ import { B as ud, C as dd, a as pd, S as bd, b as fd, c as gd, o as md, s as hd, u as vd } from "./modal-Dkje8L_l.js";
32
32
  import { C as _d } from "./utils-DEbsp9Q9.js";
33
33
  import { g as an, T as Mt } from "./timer-Rd2sKnvH.js";
34
34
  import { S as Zn } from "./stack-BJgsPJ9A.js";
35
35
  import { D as kd, E as xd, L as Cd, M as $d } from "./stack-BJgsPJ9A.js";
36
36
  import { L as Dd } from "./link-portal-Cr2l9f3k.js";
37
- import { b as Td, T as Ld, c as Md, a as Pd, d as Ad } from "./toolbar-CjQG7l7X.js";
37
+ import { b as Td, T as Ld, c as Md, a as Pd, d as Ad } from "./toolbar-Pdj-F80l.js";
38
38
  function cr(e, t = 0, n = () => !0) {
39
39
  let s = null, r;
40
40
  const u = H(e.value);
@@ -3621,10 +3621,7 @@ function xn(e) {
3621
3621
  group: (h) => i.div(
3622
3622
  a.class("bc-menu-group"),
3623
3623
  i.div(a.class("bc-menu-group__label"), h.$.group),
3624
- oe(
3625
- h.$.options,
3626
- f
3627
- )
3624
+ oe(h.$.options, f)
3628
3625
  ),
3629
3626
  break: () => tn()
3630
3627
  })
@@ -5011,7 +5008,7 @@ function _o({
5011
5008
  )((x, $, C, v, S, y, L, E, j, V, N, q, ie) => {
5012
5009
  if (x == null) return null;
5013
5010
  const O = $ ?? "https://mozilla.github.io/pdf.js/web/viewer.html", P = new URLSearchParams();
5014
- P.set("file", encodeURIComponent(x));
5011
+ P.set("file", x);
5015
5012
  const F = [];
5016
5013
  C != null && C > 0 && F.push(`page=${C}`), v != null && (typeof v == "string" ? F.push(`zoom=${v}`) : F.push(`zoom=${v}`)), S != null && F.push(`pagemode=${S}`), y != null && F.push(`nameddest=${encodeURIComponent(y)}`), L != null && F.push(`search=${encodeURIComponent(L)}`), E != null && F.push(`textLayer=${E}`), j != null && F.push(`sidebar=${j}`), V != null && F.push(`scrollMode=${V}`), N != null && F.push(`spreadMode=${N}`), q != null && F.push(`enableScripting=${q ? "1" : "0"}`), ie != null && F.push(`enablePrinting=${ie ? "1" : "0"}`);
5017
5014
  const W = F.length > 0 ? `#${F.join("&")}` : "";
@@ -0,0 +1 @@
1
+ "use strict";const e=require("@tempots/dom"),n=require("./translations-gVgMyNno.cjs"),m=require("@tempots/ui");function f(l,o,r,t){const d=["bc-button",`bc-button--size-${l}`,`bc-control--padding-${l}`,`bc-control--rounded-${o}`];return r&&d.push("bc-button--loading"),t&&d.push("bc-button--full-width"),d.join(" ")}function C(l,o,r){const t=new Map;t.set("--button-text-shadow","var(--text-shadow-none)"),t.set("--button-text-shadow-dark","var(--text-shadow-none)");const d=(s,u,b,i)=>{r||(t.set("--button-bg-hover",s),t.set("--button-text-hover",b),t.set("--button-bg-hover-dark",u),t.set("--button-text-hover-dark",i))};switch(l){case"filled":{const s=n.backgroundValue(o,"solid","light"),u=n.backgroundValue(o,"solid","dark");t.set("--button-bg",s.backgroundColor),t.set("--button-text",s.textColor),t.set("--button-bg-dark",u.backgroundColor),t.set("--button-text-dark",u.textColor),t.set("--button-text-shadow","var(--text-shadow-button-filled, var(--text-shadow-sm))"),t.set("--button-text-shadow-dark","var(--text-shadow-button-filled, var(--text-shadow-sm))");const b=n.hoverBackgroundValue(o,"solid","light"),i=n.hoverBackgroundValue(o,"solid","dark");d(b.backgroundColor,i.backgroundColor,b.textColor,i.textColor);break}case"light":{const s=n.backgroundValue(o,"light","light"),u=n.backgroundValue(o,"light","dark");t.set("--button-bg",s.backgroundColor),t.set("--button-text",s.textColor),t.set("--button-bg-dark",u.backgroundColor),t.set("--button-text-dark",u.textColor);const b=n.hoverBackgroundValue(o,"light","light"),i=n.hoverBackgroundValue(o,"light","dark");d(b.backgroundColor,i.backgroundColor,b.textColor,i.textColor);break}case"outline":{t.set("--button-bg","transparent"),t.set("--button-bg-dark","transparent"),t.set("--button-border",n.borderColorValue(o,"light")),t.set("--button-border-dark",n.borderColorValue(o,"dark")),t.set("--button-text",n.textColorValue(o,"light")),t.set("--button-text-dark",n.textColorValue(o,"dark")),t.set("--button-text-shadow","var(--text-shadow-button-light, var(--text-shadow-xs))"),t.set("--button-text-shadow-dark","var(--text-shadow-button-light, var(--text-shadow-xs))");const s=n.hoverBackgroundValue(o,"light","light"),u=n.hoverBackgroundValue(o,"light","dark");d(s.backgroundColor,u.backgroundColor,s.textColor,u.textColor);break}case"dashed":{t.set("--button-bg","transparent"),t.set("--button-bg-dark","transparent"),t.set("--button-border",n.borderColorValue(o,"light")),t.set("--button-border-dark",n.borderColorValue(o,"dark")),t.set("--button-border-style","dashed"),t.set("--button-text",n.textColorValue(o,"light")),t.set("--button-text-dark",n.textColorValue(o,"dark"));const s=n.hoverBackgroundValue(o,"light","light"),u=n.hoverBackgroundValue(o,"light","dark");d(s.backgroundColor,u.backgroundColor,s.textColor,u.textColor);break}case"default":{const s=n.backgroundValue("neutral","light","light"),u=n.backgroundValue("neutral","light","dark");t.set("--button-bg",s.backgroundColor),t.set("--button-text",n.textColorValue(o,"light")),t.set("--button-bg-dark",u.backgroundColor),t.set("--button-text-dark",n.textColorValue(o,"dark")),t.set("--button-text-shadow","var(--text-shadow-button-default, var(--text-shadow-2xs))"),t.set("--button-text-shadow-dark","var(--text-shadow-button-default, var(--text-shadow-2xs))");const b=n.hoverBackgroundValue("base","light","light"),i=n.hoverBackgroundValue("base","light","dark");d(b.backgroundColor,i.backgroundColor,t.get("--button-text")??s.textColor,t.get("--button-text-dark")??u.textColor);break}case"text":{t.set("--button-bg","transparent"),t.set("--button-bg-dark","transparent"),t.set("--button-text",n.textColorValue(o,"light")),t.set("--button-text-dark",n.textColorValue(o,"dark")),r||t.set("--button-hover-decoration","underline");break}}return Array.from(t.entries()).map(([s,u])=>`${s}: ${u}`).join("; ")}function V({type:l="button",disabled:o=!1,loading:r=!1,variant:t="filled",size:d="md",color:s="base",roundedness:u="sm",onClick:b=()=>{},fullWidth:i=!1,stopPropagation:k=!0},...x){const h=e.prop(null);return e.Use(n.BeatUII18n,g=>e.html.button(e.attr.type(l),e.attr.disabled(e.computedOf(o,r)((a,c)=>a||c)),e.aria.busy(r??!1),e.When(r??!1,()=>e.aria.label(g.$.loadingExtended)),e.attr.class(e.computedOf(d,u,r,i)(f)),e.attr.style(e.computedOf(t,s,o)(C)),e.When(r??!1,()=>e.Fragment(e.style.width(h.map(a=>a==null?"":`${a.width}px`)),e.style.height(h.map(a=>a==null?"":`${a.height}px`)),n.Icon({icon:"line-md:loading-twotone-loop",size:d??"md"}),e.html.span(e.attr.class("sr-only"),e.aria.live("polite"),g.$.loadingExtended)),()=>e.Fragment(e.on.click(a=>{l!=="submit"&&a.preventDefault(),k&&a.stopPropagation(),b()}),...x)),e.When(r!=null,()=>m.ElementRect(a=>(a.on(c=>{e.Value.get(r??!1)||h.set(c)}),e.Empty)))))}function w(l,o,r){const t=[l?"bc-base-input-container":"bc-input-container"];return o?t.push(l?"bc-base-input-container--disabled":"bc-input-container--disabled"):t.push(l?"bc-base-input-container--default":"bc-input-container--default"),r&&t.push("bc-input-container--error"),t.join(" ")}function v(l,o){const r=["bc-input-container__input"];return l||(r.push(`bc-control--padding-${o}`),r.push(`bc-control--text-size-${o}`)),r.join(" ")}const B=({baseContainer:l,class:o,classes:r,disabled:t,input:d,before:s,after:u,hasError:b,focusableSelector:i="input, select, textarea",growInput:k=!0,size:x},...h)=>{const g=e.Value.map(t??!1,a=>a);return e.html.div(e.WithElement(a=>{const c=()=>{a.querySelector(i)?.focus()};return a.addEventListener("click",c),e.OnDispose(()=>a.removeEventListener("click",c))}),e.attr.class(e.computedOf(l,g,b??!1)((a,c,p)=>w(a??!1,c??!1,p??!1))),e.attr.class(o),e.attr.class(r?.container),s!=null?e.html.span(e.attr.class("bc-input-container__before"),s):null,e.html.div(e.attr.class(e.computedOf(l,x??"md")((a,c)=>v(a??!1,c??"md"))),e.attr.class(e.Value.map(k,a=>a?"bc-input-container__input--grow":"")),e.attr.class(r?.wrapper),d),u!=null?e.html.span(e.attr.class("bc-input-container__after"),u):null,...h)};function I({icon:l,size:o="md",color:r="neutral"}){return e.html.span(e.attr.class("bc-input-container__icon"),n.Icon({icon:l,size:o,color:r}))}exports.Button=V;exports.InputContainer=B;exports.InputIcon=I;exports.generateButtonClasses=f;exports.generateButtonStyles=C;exports.generateInputContainerInputClasses=v;
@@ -0,0 +1,263 @@
1
+ import { prop as B, Use as E, html as g, attr as l, computedOf as p, aria as m, When as D, Fragment as y, style as L, on as V, Value as I, Empty as j, WithElement as S, OnDispose as O } from "@tempots/dom";
2
+ import { t as h, b as k, h as c, a as v, B as U, I as _ } from "./translations-BGblCUBj.js";
3
+ import { ElementRect as W } from "@tempots/ui";
4
+ function q(r, e, o, t) {
5
+ const u = [
6
+ "bc-button",
7
+ `bc-button--size-${r}`,
8
+ `bc-control--padding-${r}`,
9
+ `bc-control--rounded-${e}`
10
+ ];
11
+ return o && u.push("bc-button--loading"), t && u.push("bc-button--full-width"), u.join(" ");
12
+ }
13
+ function z(r, e, o) {
14
+ const t = /* @__PURE__ */ new Map();
15
+ t.set("--button-text-shadow", "var(--text-shadow-none)"), t.set("--button-text-shadow-dark", "var(--text-shadow-none)");
16
+ const u = (a, s, b, i) => {
17
+ o || (t.set("--button-bg-hover", a), t.set("--button-text-hover", b), t.set("--button-bg-hover-dark", s), t.set("--button-text-hover-dark", i));
18
+ };
19
+ switch (r) {
20
+ case "filled": {
21
+ const a = k(e, "solid", "light"), s = k(e, "solid", "dark");
22
+ t.set("--button-bg", a.backgroundColor), t.set("--button-text", a.textColor), t.set("--button-bg-dark", s.backgroundColor), t.set("--button-text-dark", s.textColor), t.set(
23
+ "--button-text-shadow",
24
+ "var(--text-shadow-button-filled, var(--text-shadow-sm))"
25
+ ), t.set(
26
+ "--button-text-shadow-dark",
27
+ "var(--text-shadow-button-filled, var(--text-shadow-sm))"
28
+ );
29
+ const b = c(e, "solid", "light"), i = c(e, "solid", "dark");
30
+ u(
31
+ b.backgroundColor,
32
+ i.backgroundColor,
33
+ b.textColor,
34
+ i.textColor
35
+ );
36
+ break;
37
+ }
38
+ case "light": {
39
+ const a = k(e, "light", "light"), s = k(e, "light", "dark");
40
+ t.set("--button-bg", a.backgroundColor), t.set("--button-text", a.textColor), t.set("--button-bg-dark", s.backgroundColor), t.set("--button-text-dark", s.textColor);
41
+ const b = c(e, "light", "light"), i = c(e, "light", "dark");
42
+ u(
43
+ b.backgroundColor,
44
+ i.backgroundColor,
45
+ b.textColor,
46
+ i.textColor
47
+ );
48
+ break;
49
+ }
50
+ case "outline": {
51
+ t.set("--button-bg", "transparent"), t.set("--button-bg-dark", "transparent"), t.set("--button-border", v(e, "light")), t.set("--button-border-dark", v(e, "dark")), t.set("--button-text", h(e, "light")), t.set("--button-text-dark", h(e, "dark")), t.set(
52
+ "--button-text-shadow",
53
+ "var(--text-shadow-button-light, var(--text-shadow-xs))"
54
+ ), t.set(
55
+ "--button-text-shadow-dark",
56
+ "var(--text-shadow-button-light, var(--text-shadow-xs))"
57
+ );
58
+ const a = c(e, "light", "light"), s = c(e, "light", "dark");
59
+ u(
60
+ a.backgroundColor,
61
+ s.backgroundColor,
62
+ a.textColor,
63
+ s.textColor
64
+ );
65
+ break;
66
+ }
67
+ case "dashed": {
68
+ t.set("--button-bg", "transparent"), t.set("--button-bg-dark", "transparent"), t.set("--button-border", v(e, "light")), t.set("--button-border-dark", v(e, "dark")), t.set("--button-border-style", "dashed"), t.set("--button-text", h(e, "light")), t.set("--button-text-dark", h(e, "dark"));
69
+ const a = c(e, "light", "light"), s = c(e, "light", "dark");
70
+ u(
71
+ a.backgroundColor,
72
+ s.backgroundColor,
73
+ a.textColor,
74
+ s.textColor
75
+ );
76
+ break;
77
+ }
78
+ case "default": {
79
+ const a = k("neutral", "light", "light"), s = k("neutral", "light", "dark");
80
+ t.set("--button-bg", a.backgroundColor), t.set("--button-text", h(e, "light")), t.set("--button-bg-dark", s.backgroundColor), t.set("--button-text-dark", h(e, "dark")), t.set(
81
+ "--button-text-shadow",
82
+ "var(--text-shadow-button-default, var(--text-shadow-2xs))"
83
+ ), t.set(
84
+ "--button-text-shadow-dark",
85
+ "var(--text-shadow-button-default, var(--text-shadow-2xs))"
86
+ );
87
+ const b = c("base", "light", "light"), i = c("base", "light", "dark");
88
+ u(
89
+ b.backgroundColor,
90
+ i.backgroundColor,
91
+ t.get("--button-text") ?? a.textColor,
92
+ t.get("--button-text-dark") ?? s.textColor
93
+ );
94
+ break;
95
+ }
96
+ case "text": {
97
+ t.set("--button-bg", "transparent"), t.set("--button-bg-dark", "transparent"), t.set("--button-text", h(e, "light")), t.set("--button-text-dark", h(e, "dark")), o || t.set("--button-hover-decoration", "underline");
98
+ break;
99
+ }
100
+ }
101
+ return Array.from(t.entries()).map(([a, s]) => `${a}: ${s}`).join("; ");
102
+ }
103
+ function R({
104
+ type: r = "button",
105
+ disabled: e = !1,
106
+ loading: o = !1,
107
+ variant: t = "filled",
108
+ size: u = "md",
109
+ color: a = "base",
110
+ roundedness: s = "sm",
111
+ onClick: b = () => {
112
+ },
113
+ fullWidth: i = !1,
114
+ stopPropagation: C = !0
115
+ }, ...w) {
116
+ const x = B(null);
117
+ return E(
118
+ U,
119
+ (f) => g.button(
120
+ l.type(r),
121
+ l.disabled(
122
+ p(
123
+ e,
124
+ o
125
+ )((n, d) => n || d)
126
+ ),
127
+ // Add ARIA attributes for accessibility
128
+ m.busy(o ?? !1),
129
+ D(o ?? !1, () => m.label(f.$.loadingExtended)),
130
+ l.class(
131
+ p(u, s, o, i)(q)
132
+ ),
133
+ l.style(p(t, a, e)(z)),
134
+ D(
135
+ o ?? !1,
136
+ () => y(
137
+ L.width(
138
+ x.map((n) => n == null ? "" : `${n.width}px`)
139
+ ),
140
+ L.height(
141
+ x.map((n) => n == null ? "" : `${n.height}px`)
142
+ ),
143
+ _({ icon: "line-md:loading-twotone-loop", size: u ?? "md" }),
144
+ // Hidden live region for screen reader announcements
145
+ g.span(
146
+ l.class("sr-only"),
147
+ m.live("polite"),
148
+ f.$.loadingExtended
149
+ )
150
+ ),
151
+ () => y(
152
+ V.click((n) => {
153
+ r !== "submit" && n.preventDefault(), C && n.stopPropagation(), b();
154
+ }),
155
+ ...w
156
+ )
157
+ ),
158
+ D(
159
+ o != null,
160
+ () => W((n) => (n.on((d) => {
161
+ I.get(o ?? !1) || x.set(d);
162
+ }), j))
163
+ )
164
+ )
165
+ );
166
+ }
167
+ function A(r, e, o) {
168
+ const t = [
169
+ r ? "bc-base-input-container" : "bc-input-container"
170
+ ];
171
+ return e ? t.push(
172
+ r ? "bc-base-input-container--disabled" : "bc-input-container--disabled"
173
+ ) : t.push(
174
+ r ? "bc-base-input-container--default" : "bc-input-container--default"
175
+ ), o && t.push("bc-input-container--error"), t.join(" ");
176
+ }
177
+ function F(r, e) {
178
+ const o = ["bc-input-container__input"];
179
+ return r || (o.push(`bc-control--padding-${e}`), o.push(`bc-control--text-size-${e}`)), o.join(" ");
180
+ }
181
+ const G = ({
182
+ baseContainer: r,
183
+ class: e,
184
+ classes: o,
185
+ disabled: t,
186
+ input: u,
187
+ before: a,
188
+ after: s,
189
+ hasError: b,
190
+ focusableSelector: i = "input, select, textarea",
191
+ growInput: C = !0,
192
+ size: w
193
+ }, ...x) => {
194
+ const f = I.map(t ?? !1, (n) => n);
195
+ return g.div(
196
+ S((n) => {
197
+ const d = () => {
198
+ n.querySelector(i)?.focus();
199
+ };
200
+ return n.addEventListener("click", d), O(() => n.removeEventListener("click", d));
201
+ }),
202
+ l.class(
203
+ p(
204
+ r,
205
+ f,
206
+ b ?? !1
207
+ // size ?? 'md'
208
+ )(
209
+ (n, d, $) => A(
210
+ n ?? !1,
211
+ d ?? !1,
212
+ $ ?? !1
213
+ // (size ?? 'md') as ControlSize
214
+ )
215
+ )
216
+ ),
217
+ l.class(e),
218
+ l.class(o?.container),
219
+ a != null ? g.span(l.class("bc-input-container__before"), a) : null,
220
+ g.div(
221
+ l.class(
222
+ p(
223
+ r,
224
+ w ?? "md"
225
+ )(
226
+ (n, d) => F(
227
+ n ?? !1,
228
+ d ?? "md"
229
+ )
230
+ )
231
+ ),
232
+ // attr.class('bc-input-container__input'),
233
+ l.class(
234
+ I.map(
235
+ C,
236
+ (n) => n ? "bc-input-container__input--grow" : ""
237
+ )
238
+ ),
239
+ l.class(o?.wrapper),
240
+ u
241
+ ),
242
+ s != null ? g.span(l.class("bc-input-container__after"), s) : null,
243
+ ...x
244
+ );
245
+ };
246
+ function J({
247
+ icon: r,
248
+ size: e = "md",
249
+ color: o = "neutral"
250
+ }) {
251
+ return g.span(
252
+ l.class("bc-input-container__icon"),
253
+ _({ icon: r, size: e, color: o })
254
+ );
255
+ }
256
+ export {
257
+ R as B,
258
+ G as I,
259
+ J as a,
260
+ q as b,
261
+ z as c,
262
+ F as g
263
+ };