@citrusworx/juiceui 0.9.3 → 0.9.5

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/index.js CHANGED
@@ -254,6 +254,9 @@ var b = "juice:change", x = (e) => typeof e == "object" && !!e && !Array.isArray
254
254
  return;
255
255
  }
256
256
  S(t.get(n), a) || (t.set(n, a), w(n, e, a));
257
+ },
258
+ adopt: (e, n) => {
259
+ t.set(e, C(n));
257
260
  }
258
261
  };
259
262
  }, E = {
@@ -5738,8 +5741,608 @@ typeof window < "u" && typeof document < "u" && (document.readyState === "loadin
5738
5741
  pu = null, fu || hu();
5739
5742
  }, document.addEventListener("DOMContentLoaded", pu)) : hu());
5740
5743
  //#endregion
5744
+ //#region src/js/src/pressable/pressable-runtime.ts
5745
+ var _u = "juice:longpress", vu = {
5746
+ root: typeof document < "u" ? document : {},
5747
+ pressableSelector: "[pressable]",
5748
+ longPressDelay: 500,
5749
+ moveSlop: 10
5750
+ }, yu = (e) => Array.from(e), bu = L(), xu = {
5751
+ pressed: !1,
5752
+ longPressed: !1
5753
+ }, Su = (e) => !!(e.getAttribute("aria-disabled") === "true" || e.hasAttribute("disabled") || "disabled" in e && e.disabled), Cu = (e) => e.hasAttribute("aria-pressed") || e.hasAttribute("icon-button") && e.hasAttribute("toggle"), wu = (e) => e === "Enter" || e === " " || e === "Spacebar", Tu = (e) => e === " " || e === "Spacebar", Eu = new Set([
5754
+ "button",
5755
+ "switch",
5756
+ "checkbox",
5757
+ "radio",
5758
+ "menuitem",
5759
+ "menuitemcheckbox",
5760
+ "menuitemradio",
5761
+ "option",
5762
+ "tab",
5763
+ "treeitem"
5764
+ ]), Du = (e) => !!(e instanceof HTMLButtonElement || e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement || e.tagName === "SUMMARY" || Ou(e)), Ou = (e) => {
5765
+ if (e.isContentEditable) return !0;
5766
+ let t = e.getAttribute("contenteditable");
5767
+ if (t === null) return !1;
5768
+ let n = t.trim().toLowerCase();
5769
+ return n === "" || n === "true" || n === "plaintext-only";
5770
+ }, ku = (e) => {
5771
+ let t = e.getAttribute("role");
5772
+ if (!t) return !1;
5773
+ let n = t.trim().toLowerCase().split(/\s+/)[0];
5774
+ return n !== void 0 && Eu.has(n);
5775
+ }, Au = (e) => ku(e) && !Du(e), ju = (e) => {
5776
+ if (e === null) return null;
5777
+ let t = e.trim();
5778
+ if (t === "" || !/^\d+(?:\.\d+)?$/.test(t)) return null;
5779
+ let n = Number(t);
5780
+ return Number.isFinite(n) ? n : null;
5781
+ }, Mu = (e, t) => {
5782
+ if (!e.hasAttribute("pressable-longpress")) return null;
5783
+ let n = e.getAttribute("pressable-longpress");
5784
+ if (n !== null && n.trim().toLowerCase() === "false") return null;
5785
+ let r = ju(n);
5786
+ return r === null ? t : r;
5787
+ }, Nu = (e, t) => {
5788
+ if (!e.hasAttribute("pressable-slop")) return t;
5789
+ let n = ju(e.getAttribute("pressable-slop"));
5790
+ return n === null ? t : n;
5791
+ }, Pu = (e, t) => typeof e != "number" || !Number.isFinite(e) || e < 0 ? t : e, Fu = () => ({
5792
+ destroy: () => {},
5793
+ sync: () => {},
5794
+ getState: () => null
5795
+ }), Iu = (e = {}) => {
5796
+ if (typeof window > "u" || typeof document > "u") return Fu();
5797
+ let t = {
5798
+ ...vu,
5799
+ ...e,
5800
+ longPressDelay: Pu(e.longPressDelay, vu.longPressDelay),
5801
+ moveSlop: Pu(e.moveSlop, vu.moveSlop)
5802
+ }, n = t.root ?? document, r = n, i = T("pressable"), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = !1, c = (e) => !(e instanceof HTMLElement) || !e.matches(t.pressableSelector) ? !1 : n instanceof Document ? !0 : n instanceof Node ? n === e || n.contains(e) : !1, l = () => {
5803
+ let e = yu(n.querySelectorAll(t.pressableSelector)).filter(c);
5804
+ return n instanceof HTMLElement && c(n) ? [n, ...e.filter((e) => e !== n)] : e;
5805
+ }, u = (e) => {
5806
+ if (e) {
5807
+ if (c(e)) return e;
5808
+ let n = e.closest(t.pressableSelector);
5809
+ return n instanceof HTMLElement && c(n) ? n : null;
5810
+ }
5811
+ return l()[0] ?? null;
5812
+ }, d = (e) => {
5813
+ if (!(e instanceof Element)) return null;
5814
+ let n = e.closest(t.pressableSelector);
5815
+ return !(n instanceof HTMLElement) || !c(n) ? null : n;
5816
+ }, f = (e) => {
5817
+ let t = a.get(e);
5818
+ return t ? {
5819
+ pressed: t.active,
5820
+ longPressed: t.longPressed
5821
+ } : { ...xu };
5822
+ }, p = (e) => {
5823
+ let t = f(e);
5824
+ if (!i.has(e)) {
5825
+ i.note(e, t, { baseline: { ...xu } });
5826
+ return;
5827
+ }
5828
+ i.note(e, t);
5829
+ }, m = (e, t, n) => {
5830
+ if (Cu(e)) {
5831
+ n.ownsPressed = !1;
5832
+ return;
5833
+ }
5834
+ if (t) {
5835
+ if (e.hasAttribute("pressed")) {
5836
+ n.ownsPressed = !1;
5837
+ return;
5838
+ }
5839
+ e.setAttribute("pressed", ""), n.ownsPressed = !0;
5840
+ return;
5841
+ }
5842
+ n.ownsPressed && !Cu(e) && e.removeAttribute("pressed"), n.ownsPressed = !1;
5843
+ }, h = (e) => {
5844
+ e.timer !== null && (clearTimeout(e.timer), e.timer = null);
5845
+ }, g = (e) => {
5846
+ let t = o.get(e);
5847
+ t !== void 0 && clearTimeout(t), o.delete(e);
5848
+ }, _ = (e) => {
5849
+ g(e);
5850
+ let t = setTimeout(() => {
5851
+ o.delete(e);
5852
+ }, 0);
5853
+ o.set(e, t);
5854
+ }, v = (e) => {
5855
+ for (let [t, n] of a) if (n.source === "pointer" && n.pointerId === e) return t;
5856
+ return null;
5857
+ }, y = (e) => {
5858
+ let t = a.get(e);
5859
+ if (!t) return;
5860
+ h(t), t.onLeave &&= (e.removeEventListener("pointerleave", t.onLeave), null), m(e, !1, t);
5861
+ let n = t.suppressClick;
5862
+ a.delete(e), n && _(e), p(e);
5863
+ }, b = (e, n) => {
5864
+ let r = Mu(e, t.longPressDelay);
5865
+ r !== null && (n.timer = setTimeout(() => {
5866
+ if (n.timer = null, s || a.get(e) !== n) return;
5867
+ if (Su(e) || !c(e)) {
5868
+ y(e);
5869
+ return;
5870
+ }
5871
+ n.longPressed = !0;
5872
+ let t = new CustomEvent(_u, {
5873
+ bubbles: !0,
5874
+ cancelable: !0,
5875
+ composed: !0,
5876
+ detail: {
5877
+ pressed: !0,
5878
+ longPressed: !0
5879
+ }
5880
+ });
5881
+ e.dispatchEvent(t), t.defaultPrevented || (n.suppressClick = !0), a.get(e) === n && p(e);
5882
+ }, r));
5883
+ }, x = (e, n, r) => {
5884
+ if (a.has(e) || Su(e) || !c(e)) return !1;
5885
+ let i = {
5886
+ source: n,
5887
+ pointerId: r?.pointerId ?? null,
5888
+ originX: r?.clientX ?? 0,
5889
+ originY: r?.clientY ?? 0,
5890
+ slop: Nu(e, t.moveSlop),
5891
+ timer: null,
5892
+ active: !0,
5893
+ longPressed: !1,
5894
+ suppressClick: !1,
5895
+ ownsPressed: !1,
5896
+ onLeave: null
5897
+ };
5898
+ if (a.set(e, i), m(e, !0, i), n === "pointer") {
5899
+ let t = (t) => {
5900
+ s || t instanceof PointerEvent && t.pointerId === i.pointerId && y(e);
5901
+ };
5902
+ i.onLeave = t, e.addEventListener("pointerleave", t), b(e, i);
5903
+ }
5904
+ return p(e), !0;
5905
+ }, S = (e, t) => {
5906
+ let n = e.ownerDocument.defaultView;
5907
+ return t == null || t === n || t === e.ownerDocument || t === e.ownerDocument.documentElement ? !0 : t instanceof Node && t.contains(e);
5908
+ }, C = (e) => {
5909
+ if (s || !(e instanceof PointerEvent) || !e.isPrimary || e.button !== 0) return;
5910
+ let t = d(e.target);
5911
+ !t || Su(t) || a.has(t) || bu(e) && x(t, "pointer", {
5912
+ pointerId: e.pointerId,
5913
+ clientX: e.clientX,
5914
+ clientY: e.clientY
5915
+ });
5916
+ }, w = (e) => {
5917
+ if (s || !(e instanceof PointerEvent)) return;
5918
+ let t = v(e.pointerId);
5919
+ if (!t) return;
5920
+ let n = a.get(t);
5921
+ if (n) {
5922
+ if (e.target instanceof Node && !t.contains(e.target)) {
5923
+ y(t);
5924
+ return;
5925
+ }
5926
+ Math.hypot(e.clientX - n.originX, e.clientY - n.originY) > n.slop && y(t);
5927
+ }
5928
+ }, E = (e) => {
5929
+ if (s || !(e instanceof PointerEvent)) return;
5930
+ let t = v(e.pointerId);
5931
+ t && y(t);
5932
+ }, D = (e) => {
5933
+ if (s || !(e instanceof PointerEvent)) return;
5934
+ let t = v(e.pointerId);
5935
+ if (!t || !(e.target instanceof Node) || !t.contains(e.target)) return;
5936
+ let n = e.relatedTarget;
5937
+ n instanceof Node && t.contains(n) || y(t);
5938
+ }, O = (e) => {
5939
+ if (s || !(e instanceof PointerEvent)) return;
5940
+ let t = v(e.pointerId);
5941
+ t && y(t);
5942
+ }, k = (e) => {
5943
+ if (!(s || a.size === 0)) for (let t of Array.from(a.keys())) {
5944
+ let n = a.get(t);
5945
+ !n || n.source !== "pointer" || S(t, e.target) && y(t);
5946
+ }
5947
+ }, A = (e) => {
5948
+ if (s || !(e instanceof KeyboardEvent) || !wu(e.key) || !(e.target instanceof HTMLElement) || !e.target.matches(t.pressableSelector)) return;
5949
+ let n = e.target;
5950
+ c(n) && (Tu(e.key) && Au(n) && e.cancelable && e.preventDefault(), !(e.repeat || Su(n) || a.has(n)) && bu(e) && x(n, "keyboard", null));
5951
+ }, j = (e) => {
5952
+ if (s || !(e instanceof KeyboardEvent) || !wu(e.key) || !(e.target instanceof HTMLElement) || !e.target.matches(t.pressableSelector)) return;
5953
+ let n = a.get(e.target);
5954
+ !n || n.source !== "keyboard" || y(e.target);
5955
+ }, M = (e) => {
5956
+ s || e.target instanceof HTMLElement && e.target.matches(t.pressableSelector) && c(e.target) && y(e.target);
5957
+ }, N = (e) => {
5958
+ if (s) return;
5959
+ let t = d(e.target);
5960
+ !t || !o.has(t) || (g(t), e.cancelable && e.preventDefault(), e.stopPropagation());
5961
+ }, P = !1, F = 0, I = () => {
5962
+ P || s || (P = !0, F = requestAnimationFrame(() => {
5963
+ P = !1, R();
5964
+ }));
5965
+ }, L = () => {
5966
+ for (let e of Array.from(a.keys())) (!c(e) || Su(e)) && y(e);
5967
+ }, R = () => {
5968
+ s || (L(), l().forEach((e) => {
5969
+ i.note(e, f(e));
5970
+ }));
5971
+ }, z = typeof MutationObserver < "u" ? new MutationObserver(() => {
5972
+ L(), I();
5973
+ }) : null, B = {
5974
+ capture: !0,
5975
+ passive: !0
5976
+ }, V = { passive: !0 };
5977
+ r.addEventListener("pointerdown", C), r.addEventListener("pointermove", w, V), r.addEventListener("pointerup", E), r.addEventListener("pointercancel", E), r.addEventListener("pointerout", D), r.addEventListener("lostpointercapture", O), r.addEventListener("keydown", A), r.addEventListener("keyup", j), r.addEventListener("click", N, !0), r.addEventListener("blur", M, !0), r.addEventListener("scroll", k, B);
5978
+ let H = n instanceof Document ? n.defaultView : n instanceof Node ? n.ownerDocument?.defaultView ?? null : null;
5979
+ return H && H.addEventListener("scroll", k, B), z && n instanceof Node && z.observe(n, {
5980
+ childList: !0,
5981
+ subtree: !0,
5982
+ attributes: !0,
5983
+ attributeFilter: [
5984
+ "pressable",
5985
+ "pressable-longpress",
5986
+ "pressable-slop",
5987
+ "pressed",
5988
+ "disabled",
5989
+ "aria-disabled",
5990
+ "aria-pressed",
5991
+ "icon-button",
5992
+ "toggle"
5993
+ ]
5994
+ }), R(), {
5995
+ destroy: () => {
5996
+ if (!s) {
5997
+ s = !0, P &&= (cancelAnimationFrame(F), !1);
5998
+ for (let e of Array.from(a.keys())) y(e);
5999
+ for (let e of Array.from(o.keys())) g(e);
6000
+ r.removeEventListener("pointerdown", C), r.removeEventListener("pointermove", w, V), r.removeEventListener("pointerup", E), r.removeEventListener("pointercancel", E), r.removeEventListener("pointerout", D), r.removeEventListener("lostpointercapture", O), r.removeEventListener("keydown", A), r.removeEventListener("keyup", j), r.removeEventListener("click", N, !0), r.removeEventListener("blur", M, !0), r.removeEventListener("scroll", k, B), H && H.removeEventListener("scroll", k, B), z?.disconnect();
6001
+ }
6002
+ },
6003
+ sync: R,
6004
+ getState: (e) => {
6005
+ if (s) return null;
6006
+ let t = u(e);
6007
+ return t ? f(t) : null;
6008
+ }
6009
+ };
6010
+ }, Lu = Iu, Ru = null, zu = !1, Bu = null, Vu = () => {
6011
+ !Bu || typeof document > "u" || (document.removeEventListener("DOMContentLoaded", Bu), Bu = null);
6012
+ }, Hu = () => typeof window > "u" || typeof document > "u" ? null : (zu = !1, Vu(), Ru ? (Ru.sync(), Ru) : (Ru = Iu(), Ru)), Uu = () => {
6013
+ zu = !0, Vu(), Ru?.destroy(), Ru = null;
6014
+ };
6015
+ typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (Bu = () => {
6016
+ Bu = null, zu || Hu();
6017
+ }, document.addEventListener("DOMContentLoaded", Bu)) : Hu());
6018
+ //#endregion
6019
+ //#region src/js/src/touchable-row/touchable-row-runtime.ts
6020
+ var Wu = {
6021
+ root: typeof document < "u" ? document : {},
6022
+ touchableRowSelector: "[touchable-row]"
6023
+ }, Gu = (e) => Array.from(e), Ku = L(), qu = new Set([
6024
+ "button",
6025
+ "switch",
6026
+ "checkbox",
6027
+ "radio",
6028
+ "link",
6029
+ "menuitem",
6030
+ "menuitemcheckbox",
6031
+ "menuitemradio",
6032
+ "option",
6033
+ "tab",
6034
+ "textbox",
6035
+ "searchbox",
6036
+ "combobox",
6037
+ "slider",
6038
+ "spinbutton"
6039
+ ]), Ju = new Set([
6040
+ "menuitem",
6041
+ "menuitemcheckbox",
6042
+ "menuitemradio"
6043
+ ]), Yu = (e) => e === "Enter" || e === " " || e === "Spacebar", Xu = (e) => e === " " || e === "Spacebar", Zu = (e) => {
6044
+ let t = e.getAttribute("role");
6045
+ return t ? t.trim().toLowerCase().split(/\s+/)[0] ?? "" : "";
6046
+ }, Qu = (e, t) => {
6047
+ let n = e.getAttribute("touchable-row");
6048
+ return n ? n.split(/\s+/).includes(t) : !1;
6049
+ }, $u = (e) => Qu(e, "select"), ed = (e) => Qu(e, "activate"), td = (e) => e.hasAttribute("pressable") || $u(e) || ed(e), nd = (e) => e instanceof HTMLButtonElement || e instanceof HTMLAnchorElement, rd = (e) => {
6050
+ if (e.isContentEditable) return !0;
6051
+ let t = e.getAttribute("contenteditable");
6052
+ if (t === null) return !1;
6053
+ let n = t.trim().toLowerCase();
6054
+ return n === "" || n === "true" || n === "plaintext-only";
6055
+ }, id = (e) => e.hasAttribute("menuitem") || Ju.has(Zu(e)), ad = (e) => e instanceof HTMLAnchorElement || Zu(e) === "link", od = (e) => !!(e.getAttribute("aria-disabled") === "true" || e.hasAttribute("disabled") || "disabled" in e && e.disabled), sd = (e) => {
6056
+ let t = e.tagName;
6057
+ return t === "A" || t === "BUTTON" || t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || t === "SUMMARY" || e.hasAttribute("switch") || e.hasAttribute("icon-button") || e.hasAttribute("menuitem") || rd(e) ? !0 : qu.has(Zu(e));
6058
+ }, cd = (e) => {
6059
+ if (e.hasAttribute("selected") || e.getAttribute("aria-selected") === "true") return !0;
6060
+ let t = e.getAttribute("aria-current");
6061
+ return t !== null && t !== "false";
6062
+ }, ld = (e) => ({
6063
+ selected: cd(e),
6064
+ disabled: od(e)
6065
+ }), ud = (e, t) => {
6066
+ if (t ? e.setAttribute("selected", "") : e.removeAttribute("selected"), ad(e)) {
6067
+ let n = t ? "true" : "false";
6068
+ e.getAttribute("aria-current") !== n && e.setAttribute("aria-current", n), !t && e.getAttribute("aria-selected") === "true" && e.setAttribute("aria-selected", "false");
6069
+ return;
6070
+ }
6071
+ let n = t ? "true" : "false";
6072
+ if (e.getAttribute("aria-selected") !== n && e.setAttribute("aria-selected", n), !t) {
6073
+ let t = e.getAttribute("aria-current");
6074
+ t !== null && t !== "false" && e.setAttribute("aria-current", "false");
6075
+ }
6076
+ }, dd = (e) => e instanceof HTMLElement ? e : e instanceof Node ? e.parentElement : null, fd = () => ({
6077
+ destroy: () => {},
6078
+ sync: () => {},
6079
+ getState: () => null
6080
+ }), pd = (e = {}) => {
6081
+ if (typeof window > "u" || typeof document > "u") return fd();
6082
+ let t = {
6083
+ ...Wu,
6084
+ ...e
6085
+ }, n = t.root ?? document, r = n, i = T("touchable-row"), a = !1, o = !1, s = (e) => !(e instanceof HTMLElement) || !e.matches(t.touchableRowSelector) ? !1 : n instanceof Document ? !0 : n instanceof Node ? n === e || n.contains(e) : !1, c = () => {
6086
+ let e = Gu(n.querySelectorAll(t.touchableRowSelector)).filter(s);
6087
+ return n instanceof HTMLElement && s(n) ? [n, ...e.filter((e) => e !== n)] : e;
6088
+ }, l = (e) => {
6089
+ if (e) {
6090
+ if (s(e)) return e;
6091
+ let n = e.closest(t.touchableRowSelector);
6092
+ return n instanceof HTMLElement && s(n) ? n : null;
6093
+ }
6094
+ return c()[0] ?? null;
6095
+ }, u = (e) => {
6096
+ let n = dd(e);
6097
+ if (!n) return null;
6098
+ let r = n.closest(t.touchableRowSelector);
6099
+ if (!(r instanceof HTMLElement) || !s(r)) return null;
6100
+ let i = n;
6101
+ for (; i && i !== r;) {
6102
+ if (sd(i)) return null;
6103
+ i = i.parentElement;
6104
+ }
6105
+ return r;
6106
+ }, d = (e) => {
6107
+ nd(e) || id(e) || od(e) || td(e) && (e.hasAttribute("role") || e.setAttribute("role", "button"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0"));
6108
+ }, f = (e) => {
6109
+ let t = ld(e);
6110
+ d(e), ud(e, !cd(e)), i.adopt(e, t), i.note(e, ld(e));
6111
+ }, p = () => {
6112
+ if (!(a || o)) {
6113
+ o = !0;
6114
+ try {
6115
+ c().forEach((e) => {
6116
+ d(e), i.note(e, ld(e));
6117
+ });
6118
+ } finally {
6119
+ o = !1;
6120
+ }
6121
+ }
6122
+ }, m = (e) => {
6123
+ if (a) return;
6124
+ let t = u(e.target);
6125
+ !t || od(t) || !$u(t) || Ku(e) && f(t);
6126
+ }, h = (e) => {
6127
+ if (a || !(e instanceof KeyboardEvent) || e.repeat || e.isComposing || !Yu(e.key)) return;
6128
+ let t = u(e.target);
6129
+ !t || od(t) || nd(t) || rd(t) || id(t) || (Xu(e.key) && e.cancelable && e.preventDefault(), Ku(e) && t.dispatchEvent(new MouseEvent("click", {
6130
+ bubbles: !0,
6131
+ cancelable: !0,
6132
+ composed: !0
6133
+ })));
6134
+ }, g = !1, _ = 0, v = () => {
6135
+ g || a || (g = !0, _ = requestAnimationFrame(() => {
6136
+ g = !1, p();
6137
+ }));
6138
+ }, y = typeof MutationObserver < "u" ? new MutationObserver(() => v()) : null;
6139
+ return r.addEventListener("click", m), r.addEventListener("keydown", h), y && n instanceof Node && y.observe(n, {
6140
+ childList: !0,
6141
+ subtree: !0,
6142
+ attributes: !0,
6143
+ attributeFilter: [
6144
+ "touchable-row",
6145
+ "pressable",
6146
+ "selected",
6147
+ "disabled",
6148
+ "role",
6149
+ "tabindex",
6150
+ "href",
6151
+ "aria-disabled",
6152
+ "aria-selected",
6153
+ "aria-current",
6154
+ "menuitem"
6155
+ ]
6156
+ }), p(), {
6157
+ destroy: () => {
6158
+ a || (a = !0, g &&= (cancelAnimationFrame(_), !1), r.removeEventListener("click", m), r.removeEventListener("keydown", h), y?.disconnect());
6159
+ },
6160
+ sync: p,
6161
+ getState: (e) => {
6162
+ if (a) return null;
6163
+ let t = l(e);
6164
+ return t ? ld(t) : null;
6165
+ }
6166
+ };
6167
+ }, md = pd, hd = null, gd = !1, _d = null, vd = () => {
6168
+ !_d || typeof document > "u" || (document.removeEventListener("DOMContentLoaded", _d), _d = null);
6169
+ }, yd = () => typeof window > "u" || typeof document > "u" ? null : (gd = !1, vd(), hd ? (hd.sync(), hd) : (hd = pd(), hd)), bd = () => {
6170
+ gd = !0, vd(), hd?.destroy(), hd = null;
6171
+ };
6172
+ typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (_d = () => {
6173
+ _d = null, gd || yd();
6174
+ }, document.addEventListener("DOMContentLoaded", _d)) : yd());
6175
+ //#endregion
6176
+ //#region src/js/src/keyboard-avoider/keyboard-avoider-runtime.ts
6177
+ var xd = "--juice-keyboard-inset", Sd = "keyboard-open", Cd = 80, wd = {
6178
+ open: !1,
6179
+ inset: 0
6180
+ }, Td = new Set([
6181
+ "text",
6182
+ "email",
6183
+ "password",
6184
+ "search",
6185
+ "tel",
6186
+ "url",
6187
+ "number"
6188
+ ]), Ed = {
6189
+ root: typeof document < "u" ? document : {},
6190
+ keyboardAvoiderSelector: "[keyboard-avoider]",
6191
+ threshold: Cd,
6192
+ scrollIntoView: !0
6193
+ }, Dd = (e) => Array.from(e), Od = (e) => typeof e != "number" || !Number.isFinite(e) || e < 0 ? Cd : e, kd = (e, t) => {
6194
+ let n = e.getAttribute("keyboard-avoider");
6195
+ return n ? n.split(/\s+/).includes(t) : !1;
6196
+ }, Ad = (e) => {
6197
+ if (!e.hasAttribute("type")) return !0;
6198
+ let t = e.getAttribute("type") ?? "";
6199
+ return t === "" ? !0 : Td.has(t.toLowerCase());
6200
+ }, jd = (e) => {
6201
+ if (e.isContentEditable) return !0;
6202
+ let t = e.getAttribute("contenteditable");
6203
+ if (t === null) return !1;
6204
+ let n = t.trim().toLowerCase();
6205
+ return n === "" || n === "true" || n === "plaintext-only";
6206
+ }, Md = (e) => e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement ? !0 : e instanceof HTMLInputElement ? Ad(e) : !1, Nd = (e) => {
6207
+ let t = e.visualViewport;
6208
+ return !t || typeof t.addEventListener != "function" ? null : t;
6209
+ }, Pd = (e) => {
6210
+ let t = e.visualViewport;
6211
+ if (!t) return 0;
6212
+ let n = e.innerHeight, r = t.height, i = t.offsetTop;
6213
+ return [
6214
+ n,
6215
+ r,
6216
+ i
6217
+ ].every((e) => Number.isFinite(e)) ? Math.max(0, Math.round(n - (r + i))) : 0;
6218
+ }, Fd = (e) => {
6219
+ let t = e.visualViewport?.scale;
6220
+ return typeof t == "number" && t !== 1;
6221
+ }, Id = () => ({
6222
+ destroy: () => {},
6223
+ sync: () => {},
6224
+ getState: () => ({ ...wd })
6225
+ }), Ld = (e = {}) => {
6226
+ if (typeof window > "u" || typeof document > "u") return Id();
6227
+ let t = Nd(window);
6228
+ if (!t) return Id();
6229
+ let n = {
6230
+ ...Ed,
6231
+ ...e,
6232
+ threshold: Od(e.threshold),
6233
+ scrollIntoView: e.scrollIntoView !== !1
6234
+ }, r = n.root ?? document, i = r, a = T("keyboard-avoider"), o = /* @__PURE__ */ new Set(), s = !1, c = { ...wd }, l = null, u = 0, d = !1, f = 0, p = 0, m = !1, h = null, g = (e) => !(e instanceof HTMLElement) || !e.matches(n.keyboardAvoiderSelector) ? !1 : r instanceof Document ? !0 : r instanceof Node ? r === e || r.contains(e) : !1, _ = () => {
6235
+ let e = Dd(r.querySelectorAll(n.keyboardAvoiderSelector)).filter(g);
6236
+ return r instanceof HTMLElement && g(r) ? [r, ...e.filter((e) => e !== r)] : e;
6237
+ }, v = (e) => {
6238
+ if (e) {
6239
+ if (g(e)) return e;
6240
+ let t = e.closest(n.keyboardAvoiderSelector);
6241
+ return t instanceof HTMLElement && g(t) ? t : null;
6242
+ }
6243
+ return _()[0] ?? null;
6244
+ }, y = (e) => {
6245
+ if (!e) return null;
6246
+ let t = e.closest(n.keyboardAvoiderSelector);
6247
+ return !(t instanceof HTMLElement) || !g(t) ? null : t;
6248
+ }, b = () => {
6249
+ let e = document.activeElement;
6250
+ if (!(e instanceof HTMLElement)) return !1;
6251
+ let t = e;
6252
+ for (; t && t !== document.documentElement;) {
6253
+ if (Md(t) || jd(t)) return !0;
6254
+ t = t.parentElement;
6255
+ }
6256
+ return !1;
6257
+ }, x = () => {
6258
+ let e = Pd(window);
6259
+ return {
6260
+ inset: e,
6261
+ open: e > n.threshold && b()
6262
+ };
6263
+ }, S = (e) => {
6264
+ let t = document.documentElement.style;
6265
+ e.open ? t.setProperty(xd, `${e.inset}px`) : t.removeProperty(xd);
6266
+ }, C = (e) => {
6267
+ let t = document.documentElement;
6268
+ e ? t.setAttribute(Sd, "") : t.removeAttribute(Sd);
6269
+ let n = e ? _() : [], r = new Set(n);
6270
+ for (let e of o) r.has(e) || e.removeAttribute(Sd);
6271
+ o.clear();
6272
+ for (let e of n) e.setAttribute(Sd, ""), o.add(e);
6273
+ }, w = (e) => {
6274
+ let t = l, r = t !== null && t.open !== e.open, i = t !== null && t.open && e.open && e.inset !== t.inset && Math.abs(e.inset - t.inset) >= n.threshold, o = r || i;
6275
+ (t === null || o) && (l = { ...e });
6276
+ for (let t of _()) {
6277
+ if (!a.has(t)) {
6278
+ a.note(t, e);
6279
+ continue;
6280
+ }
6281
+ o && a.note(t, e);
6282
+ }
6283
+ }, E = () => {
6284
+ if (s || Fd(window)) return;
6285
+ let e = x();
6286
+ c = e, S(e), C(e.open), w(e);
6287
+ }, D = () => {
6288
+ m &&= (cancelAnimationFrame(f), cancelAnimationFrame(p), !1);
6289
+ }, O = () => {
6290
+ s || !h || (D(), m = !0, f = requestAnimationFrame(() => {
6291
+ if (s || !h) {
6292
+ m = !1;
6293
+ return;
6294
+ }
6295
+ p = requestAnimationFrame(() => {
6296
+ if (m = !1, s || !h || Fd(window)) return;
6297
+ let e = h;
6298
+ if (!e.isConnected || !N(e)) {
6299
+ h = null;
6300
+ return;
6301
+ }
6302
+ h = null;
6303
+ let t = y(e);
6304
+ !t || kd(t, "noscroll") || !n.scrollIntoView || e.scrollIntoView({
6305
+ block: "nearest",
6306
+ behavior: K() ? "auto" : "smooth"
6307
+ });
6308
+ });
6309
+ }));
6310
+ }, k = () => {
6311
+ s || d || (d = !0, u = requestAnimationFrame(() => {
6312
+ d = !1, E();
6313
+ }));
6314
+ }, A = () => {
6315
+ s || (k(), h && O());
6316
+ }, j = (e) => {
6317
+ if (s) return;
6318
+ let t = e.target instanceof HTMLElement ? e.target : null, r = t ? y(t) : null;
6319
+ t && n.scrollIntoView && r && !kd(r, "noscroll") ? (h = t, O()) : (h = null, D()), k();
6320
+ }, M = () => {
6321
+ s || k();
6322
+ }, N = (e) => {
6323
+ let t = document.activeElement;
6324
+ return t === e || t instanceof Node && e.contains(t);
6325
+ }, P = () => {
6326
+ s || E();
6327
+ };
6328
+ return t.addEventListener("resize", A), t.addEventListener("scroll", A), window.addEventListener("resize", A), window.addEventListener("orientationchange", A), i.addEventListener("focusin", j), i.addEventListener("focusout", M), P(), {
6329
+ destroy: () => {
6330
+ s || (s = !0, d &&= (cancelAnimationFrame(u), !1), h = null, D(), t.removeEventListener("resize", A), t.removeEventListener("scroll", A), window.removeEventListener("resize", A), window.removeEventListener("orientationchange", A), i.removeEventListener("focusin", j), i.removeEventListener("focusout", M), S(wd), C(!1));
6331
+ },
6332
+ sync: P,
6333
+ getState: (e) => s || !v(e) ? null : { ...c }
6334
+ };
6335
+ }, Rd = Ld, zd = null, Bd = !1, Vd = null, Hd = () => {
6336
+ !Vd || typeof document > "u" || (document.removeEventListener("DOMContentLoaded", Vd), Vd = null);
6337
+ }, Ud = () => typeof window > "u" || typeof document > "u" ? null : (Bd = !1, Hd(), zd ? (zd.sync(), zd) : (zd = Ld(), zd)), Wd = () => {
6338
+ Bd = !0, Hd(), zd?.destroy(), zd = null;
6339
+ };
6340
+ typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (Vd = () => {
6341
+ Vd = null, Bd || Ud();
6342
+ }, document.addEventListener("DOMContentLoaded", Vd)) : Ud());
6343
+ //#endregion
5741
6344
  //#region src/tokens/index.ts
5742
- var _u = {
6345
+ var Gd = {
5743
6346
  colors: {
5744
6347
  families: [
5745
6348
  "black",
@@ -5907,4 +6510,4 @@ var _u = {
5907
6510
  themes: {}
5908
6511
  };
5909
6512
  //#endregion
5910
- export { y as Accordion, b as JUICE_CHANGE_EVENT, ve as createAccordion, jl as createAvatar, $r as createBanner, po as createBreadcrumb, ja as createCheckbox, Fr as createCombobox, Ss as createDisclosure, xt as createDrawer, se as createElementMotion, Rc as createField, ll as createIconButton, cc as createInput, bi as createMenu, rt as createModal, te as createMotionCancelToken, M as createNavigation, ns as createPagination, vn as createPopover, No as createProgress, Za as createRadio, qs as createSelect, pa as createSlider, Ps as createSpinner, Ri as createSwitch, lu as createTable, Pe as createTabs, xc as createTextarea, Ut as createToast, Wn as createTooltip, dr as createWizard, ye as initAccordion, Ml as initAvatar, ei as initBanner, mo as initBreadcrumb, Ma as initCheckbox, Ir as initCombobox, Cs as initDisclosure, St as initDrawer, zc as initField, ul as initIconButton, lc as initInput, xi as initMenu, it as initModal, N as initNavigation, rs as initPagination, yn as initPopover, Po as initProgress, Qa as initRadio, Js as initSelect, ma as initSlider, Fs as initSpinner, zi as initSwitch, uu as initTable, Fe as initTabs, Sc as initTextarea, Wt as initToast, Gn as initTooltip, fr as initWizard, K as prefersReducedMotion, oe as runMotion, we as startAccordionRuntime, Ll as startAvatarRuntime, ai as startBannerRuntime, yo as startBreadcrumbRuntime, La as startCheckboxRuntime, Vr as startComboboxRuntime, Os as startDisclosureRuntime, Dt as startDrawerRuntime, Wc as startFieldRuntime, hl as startIconButtonRuntime, mc as startInputRuntime, Ei as startMenuRuntime, lt as startModalRuntime, F as startNavigationRuntime, cs as startPaginationRuntime, wn as startPopoverRuntime, zo as startProgressRuntime, ro as startRadioRuntime, $s as startSelectRuntime, ya as startSliderRuntime, Bs as startSpinnerRuntime, Wi as startSwitchRuntime, hu as startTableRuntime, Be as startTabsRuntime, Dc as startTextareaRuntime, Yt as startToastRuntime, Xn as startTooltipRuntime, _r as startWizardRuntime, Te as stopAccordionRuntime, Rl as stopAvatarRuntime, oi as stopBannerRuntime, bo as stopBreadcrumbRuntime, Ra as stopCheckboxRuntime, Hr as stopComboboxRuntime, ks as stopDisclosureRuntime, Ot as stopDrawerRuntime, Gc as stopFieldRuntime, gl as stopIconButtonRuntime, hc as stopInputRuntime, Di as stopMenuRuntime, ut as stopModalRuntime, I as stopNavigationRuntime, ls as stopPaginationRuntime, Tn as stopPopoverRuntime, Bo as stopProgressRuntime, io as stopRadioRuntime, ec as stopSelectRuntime, ba as stopSliderRuntime, Vs as stopSpinnerRuntime, Gi as stopSwitchRuntime, gu as stopTableRuntime, Ve as stopTabsRuntime, Oc as stopTextareaRuntime, Xt as stopToastRuntime, Zn as stopTooltipRuntime, vr as stopWizardRuntime, ee as subscribeReducedMotion, _u as tokens };
6513
+ export { y as Accordion, b as JUICE_CHANGE_EVENT, ve as createAccordion, jl as createAvatar, $r as createBanner, po as createBreadcrumb, ja as createCheckbox, Fr as createCombobox, Ss as createDisclosure, xt as createDrawer, se as createElementMotion, Rc as createField, ll as createIconButton, cc as createInput, Ld as createKeyboardAvoider, bi as createMenu, rt as createModal, te as createMotionCancelToken, M as createNavigation, ns as createPagination, vn as createPopover, Iu as createPressable, No as createProgress, Za as createRadio, qs as createSelect, pa as createSlider, Ps as createSpinner, Ri as createSwitch, lu as createTable, Pe as createTabs, xc as createTextarea, Ut as createToast, Wn as createTooltip, pd as createTouchableRow, dr as createWizard, ye as initAccordion, Ml as initAvatar, ei as initBanner, mo as initBreadcrumb, Ma as initCheckbox, Ir as initCombobox, Cs as initDisclosure, St as initDrawer, zc as initField, ul as initIconButton, lc as initInput, Rd as initKeyboardAvoider, xi as initMenu, it as initModal, N as initNavigation, rs as initPagination, yn as initPopover, Lu as initPressable, Po as initProgress, Qa as initRadio, Js as initSelect, ma as initSlider, Fs as initSpinner, zi as initSwitch, uu as initTable, Fe as initTabs, Sc as initTextarea, Wt as initToast, Gn as initTooltip, md as initTouchableRow, fr as initWizard, K as prefersReducedMotion, oe as runMotion, we as startAccordionRuntime, Ll as startAvatarRuntime, ai as startBannerRuntime, yo as startBreadcrumbRuntime, La as startCheckboxRuntime, Vr as startComboboxRuntime, Os as startDisclosureRuntime, Dt as startDrawerRuntime, Wc as startFieldRuntime, hl as startIconButtonRuntime, mc as startInputRuntime, Ud as startKeyboardAvoiderRuntime, Ei as startMenuRuntime, lt as startModalRuntime, F as startNavigationRuntime, cs as startPaginationRuntime, wn as startPopoverRuntime, Hu as startPressableRuntime, zo as startProgressRuntime, ro as startRadioRuntime, $s as startSelectRuntime, ya as startSliderRuntime, Bs as startSpinnerRuntime, Wi as startSwitchRuntime, hu as startTableRuntime, Be as startTabsRuntime, Dc as startTextareaRuntime, Yt as startToastRuntime, Xn as startTooltipRuntime, yd as startTouchableRowRuntime, _r as startWizardRuntime, Te as stopAccordionRuntime, Rl as stopAvatarRuntime, oi as stopBannerRuntime, bo as stopBreadcrumbRuntime, Ra as stopCheckboxRuntime, Hr as stopComboboxRuntime, ks as stopDisclosureRuntime, Ot as stopDrawerRuntime, Gc as stopFieldRuntime, gl as stopIconButtonRuntime, hc as stopInputRuntime, Wd as stopKeyboardAvoiderRuntime, Di as stopMenuRuntime, ut as stopModalRuntime, I as stopNavigationRuntime, ls as stopPaginationRuntime, Tn as stopPopoverRuntime, Uu as stopPressableRuntime, Bo as stopProgressRuntime, io as stopRadioRuntime, ec as stopSelectRuntime, ba as stopSliderRuntime, Vs as stopSpinnerRuntime, Gi as stopSwitchRuntime, gu as stopTableRuntime, Ve as stopTabsRuntime, Oc as stopTextareaRuntime, Xt as stopToastRuntime, Zn as stopTooltipRuntime, bd as stopTouchableRowRuntime, vr as stopWizardRuntime, ee as subscribeReducedMotion, Gd as tokens };
@@ -54,6 +54,12 @@ export { createAvatar, initAvatar, startAvatarRuntime, stopAvatarRuntime } from
54
54
  export type { AvatarController, AvatarOptions, AvatarState } from "./src/avatar/avatar-runtime.js";
55
55
  export { createTable, initTable, startTableRuntime, stopTableRuntime } from "./src/table/table-runtime.js";
56
56
  export type { TableController, TableOptions, TableSortDirection, TableState } from "./src/table/table-runtime.js";
57
+ export { createPressable, initPressable, startPressableRuntime, stopPressableRuntime } from "./src/pressable/pressable-runtime.js";
58
+ export type { PressableController, PressableOptions, PressableState } from "./src/pressable/pressable-runtime.js";
59
+ export { createTouchableRow, initTouchableRow, startTouchableRowRuntime, stopTouchableRowRuntime } from "./src/touchable-row/touchable-row-runtime.js";
60
+ export type { TouchableRowController, TouchableRowOptions, TouchableRowState } from "./src/touchable-row/touchable-row-runtime.js";
61
+ export { createKeyboardAvoider, initKeyboardAvoider, startKeyboardAvoiderRuntime, stopKeyboardAvoiderRuntime } from "./src/keyboard-avoider/keyboard-avoider-runtime.js";
62
+ export type { KeyboardAvoiderController, KeyboardAvoiderOptions, KeyboardAvoiderState } from "./src/keyboard-avoider/keyboard-avoider-runtime.js";
57
63
  export { JUICE_CHANGE_EVENT } from "./src/shared/change.js";
58
64
  export type { JuiceChangeDetail } from "./src/shared/change.js";
59
65
  export { prefersReducedMotion, subscribeReducedMotion, createMotionCancelToken, runMotion, createElementMotion } from "./src/shared/motion.js";