solid-baseui 0.1.0-alpha.1 → 0.1.0-alpha.2

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 (189) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +51 -20
  3. package/dist/lib/client/DialogHandle-DluOK_7u.js +521 -0
  4. package/dist/lib/client/DialogPopup-CfEb3F54.js +138 -0
  5. package/dist/lib/client/FieldControl-eDe-Jnp9.js +142 -0
  6. package/dist/lib/client/{FieldRootContext-izCEh80D.js → FieldRootContext-D3fuVjs3.js} +1 -1
  7. package/dist/lib/client/{FocusManager-NP1uPXTi.js → FocusManager-q7z7PMV1.js} +92 -89
  8. package/dist/lib/client/{InternalBackdrop-cSK13gaM.js → InternalBackdrop-B8_lfUvf.js} +1 -1
  9. package/dist/lib/client/{MenuSubmenuTrigger-yfncqM-D.js → MenuSubmenuTrigger-DMb5CwTF.js} +386 -386
  10. package/dist/lib/client/{PopupHandle-CQI6Om1Z.js → PopupHandle-DyX5gY1e.js} +17 -11
  11. package/dist/lib/client/{PopupStore-Du0O57fL.js → PopupStore-BjRwcvbG.js} +91 -88
  12. package/dist/lib/client/PopupViewport-BanYHrD-.js +154 -0
  13. package/dist/lib/client/{TriggerFocusGuards-Cs8LVBj5.js → TriggerFocusGuards-Fzspp3Y1.js} +2 -2
  14. package/dist/lib/client/accordion/index.js +1 -1
  15. package/dist/lib/client/{accordion-BFeZFpJZ.js → accordion-CA2DfX67.js} +144 -144
  16. package/dist/lib/client/alert-dialog/index.js +1 -1
  17. package/dist/lib/client/{alert-dialog-BxGUF8_Q.js → alert-dialog-Bup88Dpx.js} +2 -2
  18. package/dist/lib/client/autocomplete/index.js +1 -1
  19. package/dist/lib/client/{autocomplete-C9QA98XD.js → autocomplete-oyy_uRpU.js} +2 -2
  20. package/dist/lib/client/avatar/index.js +1 -1
  21. package/dist/lib/client/avatar-DNZ4fnBd.js +191 -0
  22. package/dist/lib/client/button/index.js +1 -1
  23. package/dist/lib/client/button-BJZYmCVv.js +88 -0
  24. package/dist/lib/client/checkbox/index.js +1 -1
  25. package/dist/lib/client/checkbox-group/index.js +1 -1
  26. package/dist/lib/client/{checkbox-group-CwMDoSTK.js → checkbox-group-DGyrciZJ.js} +1 -1
  27. package/dist/lib/client/checkbox-sQHYTbpB.js +425 -0
  28. package/dist/lib/client/collapsible/index.js +1 -1
  29. package/dist/lib/client/collapsible-BENbFFCc.js +230 -0
  30. package/dist/lib/client/combobox/index.js +1 -1
  31. package/dist/lib/client/{combobox-6DhOdzit.js → combobox-BGH8QLXH.js} +143 -141
  32. package/dist/lib/client/compositeNavigation-DCt1sQon.js +82 -0
  33. package/dist/lib/client/{constants-cOVxAoxB.js → constants-ByOMFJAe.js} +100 -100
  34. package/dist/lib/client/context-menu/index.js +1 -1
  35. package/dist/lib/client/context-menu-xQ1sBCET.js +220 -0
  36. package/dist/lib/client/{createAnchorPositioning-D96gu-Dz.js → createAnchorPositioning-DCXIApS1.js} +1 -1
  37. package/dist/lib/client/{createAnchoredPopupScrollLock-Cx0cbh1_.js → createAnchoredPopupScrollLock-BxKpJbCE.js} +2 -2
  38. package/dist/lib/client/{createClickInteraction-CTaIFBiV.js → createClickInteraction-BeBsTqtY.js} +1 -1
  39. package/dist/lib/client/{createFocusInteraction--s9_qBf3.js → createFocusInteraction-DQPWkZe2.js} +7 -7
  40. package/dist/lib/client/{createPopupAutoResize-Dn-stj-8.js → createPopupAutoResize-CSNpMz5v.js} +3 -3
  41. package/dist/lib/client/dialog/index.js +1 -1
  42. package/dist/lib/client/{dialog-B9tR9X48.js → dialog-C0EF0a5u.js} +2 -2
  43. package/dist/lib/client/{dom-BEAeQ9Eb.js → dom-lDdayFF_.js} +25 -15
  44. package/dist/lib/client/drawer/index.js +1 -1
  45. package/dist/lib/client/{drawer-dyr3_sKQ.js → drawer-uKoNBwDU.js} +519 -518
  46. package/dist/lib/client/field/index.js +1 -1
  47. package/dist/lib/client/{field-CjUAjp1m.js → field-DIMrgpBW.js} +144 -144
  48. package/dist/lib/client/form/index.js +1 -1
  49. package/dist/lib/client/form-Bqq8wSLY.js +109 -0
  50. package/dist/lib/client/index.js +34 -34
  51. package/dist/lib/client/input/index.js +1 -1
  52. package/dist/lib/client/{input-_QHvSSqM.js → input-YthuKwIE.js} +1 -1
  53. package/dist/lib/client/internals/composeEventHandlers.js +14 -8
  54. package/dist/lib/client/internals/field-root-context/index.js +2 -2
  55. package/dist/lib/client/{mergeStyleValue-DhTA9Nwe.js → isSolidAccessor-BH_FevwH.js} +1 -12
  56. package/dist/lib/client/menu/index.js +1 -1
  57. package/dist/lib/client/{menu-DLqUBmMK.js → menu-4rNLN6aX.js} +79 -79
  58. package/dist/lib/client/menubar/index.js +1 -1
  59. package/dist/lib/client/menubar-nFQGtNmY.js +163 -0
  60. package/dist/lib/client/mergeStyleValue-Dcd36yxZ.js +12 -0
  61. package/dist/lib/client/navigation-menu/index.js +1 -1
  62. package/dist/lib/client/{navigation-menu-mVHV41Ky.js → navigation-menu-BbRyun3a.js} +284 -284
  63. package/dist/lib/client/number-field/index.js +1 -1
  64. package/dist/lib/client/{number-field-DusLw_0X.js → number-field-hT_H0hVu.js} +356 -356
  65. package/dist/lib/client/otp-field/index.js +1 -1
  66. package/dist/lib/client/otp-field-lsy2iGID.js +584 -0
  67. package/dist/lib/client/popover/index.js +1 -1
  68. package/dist/lib/client/{popover-Cv7xn0nW.js → popover-Cmvmuf1L.js} +250 -248
  69. package/dist/lib/client/{popupStateMapping-C6jQ_LKo.js → popupStateMapping-nhukB8NK.js} +51 -51
  70. package/dist/lib/client/preview-card/index.js +1 -1
  71. package/dist/lib/client/{preview-card-FTN_aafM.js → preview-card-Dtu8AnBN.js} +168 -168
  72. package/dist/lib/client/radio/index.js +1 -1
  73. package/dist/lib/client/{radio-DA_oZhQT.js → radio-CeCU-Qqi.js} +77 -77
  74. package/dist/lib/client/radio-group/index.js +1 -1
  75. package/dist/lib/client/radio-group-NbuJvjQe.js +195 -0
  76. package/dist/lib/client/{safePolygon-DJG0VIVo.js → safePolygon-DVAR5dQD.js} +70 -70
  77. package/dist/lib/client/scroll-area/index.js +1 -1
  78. package/dist/lib/client/scroll-area-DqbvoAd7.js +717 -0
  79. package/dist/lib/client/{scrollable-SRNYlhF7.js → scrollable-BVaDUXng.js} +12 -12
  80. package/dist/lib/client/select/index.js +1 -1
  81. package/dist/lib/client/{select-DSPJt7Rk.js → select-Dad51Xbn.js} +635 -634
  82. package/dist/lib/client/slider/index.js +1 -1
  83. package/dist/lib/client/slider-CLSKFq_M.js +927 -0
  84. package/dist/lib/client/switch/index.js +1 -1
  85. package/dist/lib/client/{switch-CPl7QHKI.js → switch-Bzuu5EIg.js} +61 -61
  86. package/dist/lib/client/tabs/index.js +1 -1
  87. package/dist/lib/client/{tabs-Bn4rZDyZ.js → tabs-DWiBDv8D.js} +252 -249
  88. package/dist/lib/client/toast/index.js +1 -1
  89. package/dist/lib/client/{toast-7LdqZWOs.js → toast-DmtPJW2k.js} +353 -353
  90. package/dist/lib/client/toggle/index.js +1 -1
  91. package/dist/lib/client/{toggle-CsC37e3e.js → toggle-CAe-Z8Xn.js} +33 -33
  92. package/dist/lib/client/toggle-group/index.js +1 -1
  93. package/dist/lib/client/{toggle-group-DSWb9HxN.js → toggle-group-BbQg5s-m.js} +44 -44
  94. package/dist/lib/client/toolbar/index.js +1 -1
  95. package/dist/lib/client/{toolbar-DcCi3HNp.js → toolbar-BXT_g-oX.js} +218 -218
  96. package/dist/lib/client/tooltip/index.js +1 -1
  97. package/dist/lib/client/{tooltip-D-PkGco9.js → tooltip-h2r2_Xuo.js} +250 -249
  98. package/dist/lib/client/{useFilteredItems-B7z2CGMV.js → useFilteredItems-BX0BEuSI.js} +850 -819
  99. package/dist/lib/server/{DialogHandle-nJSSy_jM.js → DialogHandle-BGIISmG7.js} +16 -16
  100. package/dist/lib/server/{DialogPopup-Da1aIxVA.js → DialogPopup-C2ZDGf42.js} +4 -4
  101. package/dist/lib/server/{FieldControl-BDeNR3ug.js → FieldControl-CDMMyvuj.js} +6 -6
  102. package/dist/lib/server/{FieldRootContext-IC-LWzVp.js → FieldRootContext-Bfpna6gA.js} +3 -3
  103. package/dist/lib/server/{FocusManager-1LfoCsya.js → FocusManager-D-xgblGs.js} +9 -3
  104. package/dist/lib/server/{InternalBackdrop-C_iDPVR-.js → InternalBackdrop-D_2zAWnl.js} +1 -1
  105. package/dist/lib/server/{MenuSubmenuTrigger-rR8ZN7YR.js → MenuSubmenuTrigger-BMQKlOvU.js} +50 -50
  106. package/dist/lib/server/{PopupHandle-Ct6wywmP.js → PopupHandle-QNj4mED2.js} +14 -5
  107. package/dist/lib/server/{PopupStore-kHjFPiQ5.js → PopupStore-evylvVnN.js} +5 -2
  108. package/dist/lib/server/{PopupViewport-DftN5VUp.js → PopupViewport-BDttjORN.js} +37 -27
  109. package/dist/lib/server/{TriggerFocusGuards-CvoGfft9.js → TriggerFocusGuards-B9GNbLrL.js} +2 -2
  110. package/dist/lib/server/accordion/index.js +7 -7
  111. package/dist/lib/server/alert-dialog/index.js +2 -2
  112. package/dist/lib/server/autocomplete/index.js +2 -2
  113. package/dist/lib/server/avatar/index.js +3 -3
  114. package/dist/lib/server/button/index.js +6 -6
  115. package/dist/lib/server/checkbox/index.js +7 -7
  116. package/dist/lib/server/checkbox-group/index.js +1 -1
  117. package/dist/lib/server/collapsible/index.js +6 -6
  118. package/dist/lib/server/combobox/index.js +18 -18
  119. package/dist/lib/server/{compositeNavigation-BRVT1C38.js → compositeNavigation-D5jKM4yk.js} +32 -1
  120. package/dist/lib/server/{constants-D7ciIzsV.js → constants-ByqXubhO.js} +2 -2
  121. package/dist/lib/server/context-menu/index.js +9 -9
  122. package/dist/lib/server/{createAnchorPositioning-B5Y0WEev.js → createAnchorPositioning-DrQYe7RS.js} +1 -1
  123. package/dist/lib/server/{createAnchoredPopupScrollLock-DFuUrykR.js → createAnchoredPopupScrollLock-q6gnOSmv.js} +2 -2
  124. package/dist/lib/server/{createClickInteraction-BYsMgvup.js → createClickInteraction-D7oc1Vco.js} +1 -1
  125. package/dist/lib/server/{createFocusInteraction-DMyKsniI.js → createFocusInteraction-DFKr4G7a.js} +1 -1
  126. package/dist/lib/server/{createPopupAutoResize-ImBjwdj_.js → createPopupAutoResize-Cg0-lLf4.js} +1 -1
  127. package/dist/lib/server/dialog/index.js +2 -2
  128. package/dist/lib/server/{dom-Crg_2R-j.js → dom-D8_aB1yy.js} +14 -1
  129. package/dist/lib/server/drawer/index.js +38 -34
  130. package/dist/lib/server/field/index.js +6 -6
  131. package/dist/lib/server/form/index.js +2 -2
  132. package/dist/lib/server/input/index.js +1 -1
  133. package/dist/lib/server/internals/composeEventHandlers.js +15 -9
  134. package/dist/lib/server/internals/field-root-context/index.js +1 -1
  135. package/dist/lib/server/{mergeStyleValue-BwJ10_X2.js → isSolidAccessor-CZpzAH5l.js} +1 -20
  136. package/dist/lib/server/menu/index.js +17 -17
  137. package/dist/lib/server/menubar/index.js +4 -4
  138. package/dist/lib/server/mergeStyleValue-DecVaoac.js +20 -0
  139. package/dist/lib/server/navigation-menu/index.js +21 -21
  140. package/dist/lib/server/number-field/index.js +21 -21
  141. package/dist/lib/server/otp-field/index.js +8 -8
  142. package/dist/lib/server/popover/index.js +27 -26
  143. package/dist/lib/server/{popupStateMapping-B2KsiiLb.js → popupStateMapping-VHqr6M4H.js} +1 -1
  144. package/dist/lib/server/preview-card/index.js +16 -16
  145. package/dist/lib/server/radio/index.js +6 -6
  146. package/dist/lib/server/radio-group/index.js +5 -5
  147. package/dist/lib/server/{safePolygon-C1GNJbKR.js → safePolygon-B8QtiIZ3.js} +1 -1
  148. package/dist/lib/server/scroll-area/index.js +18 -18
  149. package/dist/lib/server/{scrollable-CjsSxbGr.js → scrollable-C9Pgq8T5.js} +1 -1
  150. package/dist/lib/server/select/index.js +39 -38
  151. package/dist/lib/server/slider/index.js +14 -14
  152. package/dist/lib/server/switch/index.js +9 -9
  153. package/dist/lib/server/tabs/index.js +12 -8
  154. package/dist/lib/server/toast/index.js +32 -32
  155. package/dist/lib/server/toggle/index.js +7 -7
  156. package/dist/lib/server/toggle-group/index.js +2 -2
  157. package/dist/lib/server/toolbar/index.js +14 -14
  158. package/dist/lib/server/tooltip/index.js +32 -27
  159. package/dist/lib/server/{useFilteredItems-DCxq20Is.js → useFilteredItems-BmhL0nf1.js} +181 -137
  160. package/dist/lib/types/accordion/trigger/AccordionTrigger.d.ts +7 -7
  161. package/dist/lib/types/combobox/chip/ComboboxChip.d.ts +2 -0
  162. package/dist/lib/types/combobox/root/ComboboxRoot.d.ts +6 -1
  163. package/dist/lib/types/combobox/store/ComboboxStore.d.ts +1 -0
  164. package/dist/lib/types/combobox/utils/handleInputPress.d.ts +1 -1
  165. package/dist/lib/types/field/control/FieldControl.d.ts +5 -5
  166. package/dist/lib/types/internals/composeEventHandlers.d.ts +9 -2
  167. package/dist/lib/types/internals/field-root-context/FieldRootContext.d.ts +1 -0
  168. package/dist/lib/types/internals/overlay/dom.d.ts +2 -0
  169. package/dist/lib/types/number-field/input/NumberFieldInput.d.ts +5 -5
  170. package/dist/lib/types/slider/track/SliderTrack.d.ts +2 -2
  171. package/dist/lib/types/toolbar/link/ToolbarLink.d.ts +10 -3
  172. package/dist/lib/types/toolbar/root/ToolbarRoot.d.ts +10 -4
  173. package/package.json +1 -1
  174. package/dist/lib/client/DialogHandle-BGyIbcvg.js +0 -521
  175. package/dist/lib/client/DialogPopup-Df7MC358.js +0 -138
  176. package/dist/lib/client/FieldControl-C0PATyKV.js +0 -142
  177. package/dist/lib/client/PopupViewport-IS4XU03s.js +0 -152
  178. package/dist/lib/client/avatar-BQoEzzav.js +0 -191
  179. package/dist/lib/client/button-akYS6FyY.js +0 -88
  180. package/dist/lib/client/checkbox-DOXtzBhA.js +0 -425
  181. package/dist/lib/client/collapsible-t8YReaIp.js +0 -230
  182. package/dist/lib/client/compositeNavigation-sxniYTc7.js +0 -58
  183. package/dist/lib/client/context-menu-CplDpqmi.js +0 -220
  184. package/dist/lib/client/form-6Ne_bWQX.js +0 -109
  185. package/dist/lib/client/menubar-DhPRUQZ6.js +0 -163
  186. package/dist/lib/client/otp-field-D-B9tZzF.js +0 -584
  187. package/dist/lib/client/radio-group-CWtQxWDl.js +0 -195
  188. package/dist/lib/client/scroll-area-NCr49LkD.js +0 -717
  189. package/dist/lib/client/slider-CWq9hxFf.js +0 -927
@@ -1,58 +0,0 @@
1
- import { o as e } from "./dom-BEAeQ9Eb.js";
2
- //#region src/internals/overlay/compositeNavigation.ts
3
- function t(t, n, r) {
4
- if (typeof r == "function" ? r(n) : r?.includes(n) ?? !1) return !0;
5
- let i = t[n];
6
- return i ? !e(i) || i.matches(":disabled") ? !0 : r === void 0 && (i.hasAttribute("disabled") || i.getAttribute("aria-disabled") === "true") : !1;
7
- }
8
- function n(e, n = {}) {
9
- let { startingIndex: r = -1, decrement: i = !1, amount: a = 1, disabledIndices: o } = n, s = r;
10
- do
11
- s += i ? -a : a;
12
- while (s >= 0 && s < e.length && t(e, s, o));
13
- return s;
14
- }
15
- function r(e, t) {
16
- return n(e, { disabledIndices: t });
17
- }
18
- function i(e, t) {
19
- return n(e, {
20
- startingIndex: e.length,
21
- decrement: !0,
22
- disabledIndices: t
23
- });
24
- }
25
- function a(e) {
26
- let { list: t, currentIndex: a, key: o, orientation: s = "vertical", rtl: c = !1, loop: l = !1, cols: u = 1, disabledIndices: d } = e, f = r(t, d), p = i(t, d);
27
- if (o === "Home") return f;
28
- if (o === "End") return p;
29
- let m, h = 1;
30
- if (s !== "horizontal" && (o === "ArrowDown" || o === "ArrowUp") ? (m = o === "ArrowDown" ? 1 : -1, h = s === "both" ? u : 1) : s !== "vertical" && (o === "ArrowRight" || o === "ArrowLeft") && (m = o === "ArrowRight" === c ? -1 : 1), !m) return a;
31
- if (a === -1) return m === 1 ? f : p;
32
- let g = n(t, {
33
- startingIndex: a,
34
- decrement: m === -1,
35
- amount: h,
36
- disabledIndices: d
37
- });
38
- if (g >= f && g <= p) return g;
39
- if (!l) return a;
40
- if (s === "both" && h > 1) {
41
- let e = Math.max(0, a) % u;
42
- if (m === 1) return n(t, {
43
- startingIndex: e - u,
44
- amount: u,
45
- disabledIndices: d
46
- });
47
- let r = p - p % u;
48
- return n(t, {
49
- startingIndex: Math.min(r + e, p) + u,
50
- decrement: !0,
51
- amount: u,
52
- disabledIndices: d
53
- });
54
- }
55
- return m === 1 ? f : p;
56
- }
57
- //#endregion
58
- export { t as i, r as n, a as r, i as t };
@@ -1,220 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { t } from "./useRender-CxZ8PI-g.js";
3
- import { getStateAttributesProps as n } from "./internals/getStateAttributesProps.js";
4
- import { P as r, t as i } from "./reasons-Co5CzjKq.js";
5
- import { n as a, t as o } from "./resolveStyle-XcgAuaKR.js";
6
- import { createChangeEventDetails as s } from "./internals/createBaseUIEventDetails.js";
7
- import { composeEventHandlers as c } from "./internals/composeEventHandlers.js";
8
- import { n as l, r as u } from "./dom-BEAeQ9Eb.js";
9
- import { i as d } from "./popupStateMapping-C6jQ_LKo.js";
10
- import { C as f, E as p, S as m, T as h, a as g, b as _, c as v, d as y, f as b, h as x, i as S, l as C, m as w, n as T, o as E, p as D, r as O, s as k, t as A, v as j, x as M, y as N } from "./MenuSubmenuTrigger-yfncqM-D.js";
11
- import { t as P } from "./Separator-D5oJzlA3.js";
12
- import { createComponent as F, getNextElement as I, mergeProps as L, runHydrationEvents as R, spread as z, template as B } from "@solidjs/web";
13
- import { createEffect as V, createMemo as H, createSignal as U, omit as W, onCleanup as G } from "solid-js";
14
- //#region src/context-menu/root/ContextMenuRoot.tsx
15
- function K(e) {
16
- let [t, n] = U(q(), { ownedWrite: !0 });
17
- return F(h, {
18
- value: {
19
- anchor: t,
20
- setAnchor: n,
21
- initialCursorPoint: { current: null },
22
- allowOutsidePressDismissal: { current: !1 }
23
- },
24
- get children() {
25
- return F(m, {
26
- value: void 0,
27
- get children() {
28
- return F(M, {
29
- get defaultOpen() {
30
- return e.defaultOpen;
31
- },
32
- get loopFocus() {
33
- return e.loopFocus;
34
- },
35
- get highlightItemOnHover() {
36
- return e.highlightItemOnHover;
37
- },
38
- get onOpenChange() {
39
- return e.onOpenChange;
40
- },
41
- get onOpenChangeComplete() {
42
- return e.onOpenChangeComplete;
43
- },
44
- get open() {
45
- return e.open;
46
- },
47
- get orientation() {
48
- return e.orientation;
49
- },
50
- get disabled() {
51
- return e.disabled;
52
- },
53
- get closeParentOnEsc() {
54
- return e.closeParentOnEsc;
55
- },
56
- get actionsRef() {
57
- return e.actionsRef;
58
- },
59
- get children() {
60
- return e.children;
61
- }
62
- });
63
- }
64
- });
65
- }
66
- });
67
- }
68
- function q() {
69
- return { getBoundingClientRect() {
70
- return {
71
- x: 0,
72
- y: 0,
73
- left: 0,
74
- top: 0,
75
- right: 0,
76
- bottom: 0,
77
- width: 0,
78
- height: 0,
79
- toJSON: () => ({})
80
- };
81
- } };
82
- }
83
- //#endregion
84
- //#region src/context-menu/trigger/ContextMenuTrigger.tsx
85
- var J = /* @__PURE__ */ B("<div>"), Y = 500;
86
- function X(e) {
87
- let m = p(!1), h = f(), g = e, v = e, [y, b] = U(null, { ownedWrite: !0 }), x = H(() => h.store.open()), S = H(() => h.store.disabled()), C = H(() => ({ open: x() })), w = H(() => a(e.class, C())), T = H(() => _({ "-webkit-touch-callout": "none" }, o(e.style, C()))), E = H(() => n(C(), d)), D = W(v, "render", "class", "onContextMenu", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "ref", "style"), O = null, k, A, j = !1, M;
88
- function N(e, t, n) {
89
- let i = y();
90
- if (!i) return;
91
- let a = Z(i, e, t, n.type.startsWith("touch"));
92
- m.initialCursorPoint.current = {
93
- x: e,
94
- y: t
95
- }, m.setAnchor(a), h.store.setOpenMethod(n.type.startsWith("touch") ? "touch" : "mouse"), h.store.context.floatingRoot.update({
96
- domReferenceElement: i,
97
- referenceElement: i,
98
- positionReference: a
99
- }), j = !1, h.store.setOpen(!0, s(r, n)), clearTimeout(A), A = setTimeout(() => {
100
- j = !0;
101
- }, Y);
102
- }
103
- function P(e) {
104
- let t = y();
105
- if (!t || S()) return;
106
- h.store.allowMouseUpTrigger = !0, e.preventDefault(), e.stopPropagation(), N(e.clientX, e.clientY, e), M?.abort();
107
- let n = new ((t.ownerDocument.defaultView?.AbortController) ?? AbortController)();
108
- M = n, t.ownerDocument.addEventListener("mouseup", (e) => {
109
- if (h.store.allowMouseUpTrigger = !1, !j) return;
110
- clearTimeout(A), j = !1;
111
- let t = u(e);
112
- if (l(h.store.track().positionerElement, t)) return;
113
- let n = h.store.rootNodeId();
114
- n && t?.closest(`[data-rootownerid="${n}"]`) || h.store.setOpen(!1, s(i, e));
115
- }, {
116
- once: !0,
117
- signal: n.signal
118
- });
119
- }
120
- function B() {
121
- clearTimeout(k), O = null;
122
- }
123
- function K(e) {
124
- if (B(), h.store.allowMouseUpTrigger = !1, S() || e.touches.length !== 1) return;
125
- e.stopPropagation();
126
- let t = e.touches[0];
127
- O = {
128
- x: t.clientX,
129
- y: t.clientY
130
- }, k = setTimeout(() => {
131
- O && !S() && N(O.x, O.y, e);
132
- }, Y);
133
- }
134
- function q(e) {
135
- if (!O || e.touches.length !== 1) {
136
- B();
137
- return;
138
- }
139
- let t = e.touches[0];
140
- (Math.abs(t.clientX - O.x) > 10 || Math.abs(t.clientY - O.y) > 10) && B();
141
- }
142
- let X = c(() => g.onContextMenu, () => P), Q = c(() => g.onTouchStart, () => K), $ = c(() => g.onTouchMove, () => q), ee = c(() => g.onTouchEnd, () => B), te = c(() => g.onTouchCancel, () => B);
143
- V(() => ({
144
- trigger: y(),
145
- disabled: S(),
146
- backdrop: h.backdropElement(),
147
- internalBackdrop: h.internalBackdropElement()
148
- }), (e) => {
149
- if (!e.trigger || e.disabled) return;
150
- let t = (t) => {
151
- let n = u(t);
152
- (l(e.trigger, n) || l(e.backdrop, n) || l(e.internalBackdrop, n)) && t.preventDefault();
153
- };
154
- return e.trigger.ownerDocument.addEventListener("contextmenu", t), () => e.trigger?.ownerDocument.removeEventListener("contextmenu", t);
155
- }), G(() => {
156
- B(), clearTimeout(A), M?.abort();
157
- });
158
- let ne = t(e, () => C(), (e) => (() => {
159
- var t = I(J);
160
- return z(t, e, !1), R(), t;
161
- })());
162
- return F(ne, L({
163
- ref: [((e) => b(e)), g.ref],
164
- get class() {
165
- return w();
166
- },
167
- get style() {
168
- return T();
169
- },
170
- onContextMenu: X,
171
- onTouchStart: Q,
172
- onTouchMove: $,
173
- onTouchEnd: ee,
174
- onTouchCancel: te
175
- }, E, D));
176
- }
177
- function Z(e, t, n, r) {
178
- return {
179
- contextElement: e,
180
- getBoundingClientRect() {
181
- let e = r ? 10 : 0;
182
- return {
183
- x: t,
184
- y: n,
185
- left: t,
186
- top: n,
187
- right: t + e,
188
- bottom: n + e,
189
- width: e,
190
- height: e,
191
- toJSON: () => ({})
192
- };
193
- }
194
- };
195
- }
196
- //#endregion
197
- //#region src/context-menu/index.parts.ts
198
- var Q = /* @__PURE__ */ e({
199
- Arrow: () => D,
200
- Backdrop: () => N,
201
- CheckboxItem: () => v,
202
- CheckboxItemIndicator: () => k,
203
- Group: () => b,
204
- GroupLabel: () => y,
205
- Item: () => C,
206
- LinkItem: () => E,
207
- Popup: () => w,
208
- Portal: () => j,
209
- Positioner: () => x,
210
- RadioGroup: () => g,
211
- RadioItem: () => S,
212
- RadioItemIndicator: () => O,
213
- Root: () => K,
214
- Separator: () => P,
215
- SubmenuRoot: () => T,
216
- SubmenuTrigger: () => A,
217
- Trigger: () => X
218
- });
219
- //#endregion
220
- export { Q as t };
@@ -1,109 +0,0 @@
1
- import { t as e } from "./useRender-CxZ8PI-g.js";
2
- import { w as t } from "./reasons-Co5CzjKq.js";
3
- import { n, t as r } from "./resolveStyle-XcgAuaKR.js";
4
- import { createGenericEventDetails as i } from "./internals/createBaseUIEventDetails.js";
5
- import { composeEventHandlers as a } from "./internals/composeEventHandlers.js";
6
- import { t as o } from "./FormContext-CwLBtm_d.js";
7
- import { t as s } from "./form-types-DFBxc1LF.js";
8
- import { claimElement as c, createComponent as l, getNextElement as u, mergeProps as d, runHydrationEvents as f, spread as p, template as m } from "@solidjs/web";
9
- import { createEffect as h, createMemo as g, createSignal as _, omit as v, untrack as y } from "solid-js";
10
- //#region src/form/Form.tsx
11
- var b = /* @__PURE__ */ m("<form>"), x = Object.freeze({}), S = {};
12
- function C(m) {
13
- let C = null, T = !1, E = !1, D = 0, O = /* @__PURE__ */ new Map(), k = m, A = y(() => k.errors), j = m, M = v(m, "actionsRef", "render", "class", "errors", "onFormSubmit", "onSubmit", "ref", "style", "validationMode"), [N, P] = _(y(() => k.errors) ?? x), F = g(() => k.validationMode ?? "onSubmit"), I = g(() => n(m.class, S)), L = e(m, () => S, (e) => (() => {
14
- var t = u(b);
15
- return c(t), p(t, e, !1), f(), t;
16
- })()), R = g(() => r(m.style, S));
17
- function z(e) {
18
- return O.set(e.token, e), () => {
19
- O.get(e.token) === e && O.delete(e.token);
20
- };
21
- }
22
- function B() {
23
- let e = {};
24
- for (let t of O.values()) {
25
- let n = t.name();
26
- n && (e[n] = t.getValue());
27
- }
28
- return e;
29
- }
30
- function V(e = y(N)) {
31
- let t = !1, n = null;
32
- for (let r of O.values()) {
33
- if (!r.isInvalid() && !s(e, r.name())) continue;
34
- t = !0;
35
- let i = r.getControl();
36
- i && (!n || w(i, n)) && (n = i);
37
- }
38
- return n ? (n.focus(), n.tagName === "INPUT" && n.select(), !0) : t;
39
- }
40
- function H(e) {
41
- e && P((t) => {
42
- if (!Object.hasOwn(t, e)) return t;
43
- let n = { ...t };
44
- return delete n[e], n;
45
- });
46
- }
47
- let U = { validate(e) {
48
- if (e) {
49
- for (let t of O.values()) if (t.name() === e) {
50
- t.validate();
51
- break;
52
- }
53
- return;
54
- }
55
- for (let e of O.values()) e.validate();
56
- } }, W = a(() => j.onSubmit);
57
- function G(e) {
58
- E = !0, D += 1;
59
- for (let e of O.values()) e.validate();
60
- if (V()) {
61
- e.preventDefault();
62
- return;
63
- }
64
- T = !0, W.call(e.currentTarget, e);
65
- let n = k.onFormSubmit;
66
- n && (e.preventDefault(), n(B(), i(t, e)));
67
- }
68
- let K = {
69
- errors: N,
70
- validationMode: F,
71
- submitAttempted: () => E,
72
- submitCount: () => D,
73
- formElement: () => C,
74
- clearError: H,
75
- registerField: z,
76
- getFormValues: B
77
- };
78
- return h(() => k.errors, (e) => {
79
- if (e === A) return;
80
- A = e;
81
- let t = e ?? x;
82
- P(t), T && (T = !1, y(() => V(t)));
83
- }), h(() => k.actionsRef, (e) => {
84
- e?.(U);
85
- }), l(o, {
86
- value: K,
87
- get children() {
88
- return l(L, d({
89
- ref: [((e) => {
90
- C = e.tagName === "FORM" ? e : null;
91
- }), j.ref],
92
- get class() {
93
- return I();
94
- },
95
- get style() {
96
- return R();
97
- },
98
- novalidate: !0,
99
- onSubmit: G
100
- }, M));
101
- }
102
- });
103
- }
104
- function w(e, t) {
105
- let n = e.compareDocumentPosition(t);
106
- return (n & Node.DOCUMENT_POSITION_DISCONNECTED) === 0 && (n & Node.DOCUMENT_POSITION_FOLLOWING) !== 0;
107
- }
108
- //#endregion
109
- export { C as t };
@@ -1,163 +0,0 @@
1
- import { t as e } from "./useRender-CxZ8PI-g.js";
2
- import { getStateAttributesProps as t } from "./internals/getStateAttributesProps.js";
3
- import { n, t as r } from "./resolveStyle-XcgAuaKR.js";
4
- import { composeEventHandlers as i } from "./internals/composeEventHandlers.js";
5
- import { r as a } from "./compositeNavigation-sxniYTc7.js";
6
- import { i as o, r as s } from "./FloatingTree-23B7KKPD.js";
7
- import { n as c } from "./DirectionContext-BwMabICS.js";
8
- import { t as l } from "./MenubarContext-BYt3fkt-.js";
9
- import { createComponent as u, getNextElement as ee, mergeProps as d, runHydrationEvents as f, spread as p, template as m } from "@solidjs/web";
10
- import { createEffect as h, createMemo as g, createSignal as _, createUniqueId as v, omit as y, onCleanup as te } from "solid-js";
11
- //#region src/menubar/Menubar.tsx
12
- var ne = /* @__PURE__ */ m("<div>"), re = { hasSubmenuOpen: (e) => e ? { "data-has-submenu-open": "" } : null };
13
- function b(m) {
14
- let b = c(), C = m, w = m, ie = `base-ui-${v()}`, T = g(() => C.id || ie), E = g(() => C.modal ?? !0), D = g(() => C.disabled ?? !1), O = g(() => C.orientation ?? "horizontal"), [k, ae] = _(null, { ownedWrite: !0 }), [A, j] = _(!1, { ownedWrite: !0 }), [M, N] = _(), [P, F] = _(0), I = new s(), L = v();
15
- o({
16
- tree: I,
17
- id: L
18
- });
19
- let R = /* @__PURE__ */ new Map(), z = { value: !1 }, B = 0, V = 0, H = 0, U = !1, W = !1, G = g(() => ({
20
- orientation: O(),
21
- modal: E(),
22
- hasSubmenuOpen: A()
23
- })), K = g(() => n(m.class, G())), q = g(() => r(m.style, G())), oe = g(() => t(G(), re)), se = y(w, "render", "class", "disabled", "id", "loopFocus", "modal", "onFocusIn", "onKeyDown", "orientation", "ref", "style");
24
- function J() {
25
- W || (W = !0, queueMicrotask(() => {
26
- W = !1, F((e) => e + 1);
27
- }));
28
- }
29
- function ce(e) {
30
- return e.order = B, B += 1, R.set(e.token, e), J(), () => {
31
- R.delete(e.token), J();
32
- };
33
- }
34
- function Y() {
35
- return Array.from(R.values()).sort(x);
36
- }
37
- function X() {
38
- return Y().filter(S);
39
- }
40
- function le(e) {
41
- P();
42
- let t = Y(), n = t.every((e) => !e.element()), r = n ? t.filter((e) => !e.disabled()) : X(), i = r.find((e) => e.token === M());
43
- return (n || S(e)) && (i ?? r[0])?.token === e.token;
44
- }
45
- function Z(e) {
46
- S(e) && N(e.token);
47
- }
48
- function Q(e) {
49
- let t = e.composedPath(), n = t[0];
50
- return Y().find((e) => {
51
- let r = e.element();
52
- return r && (t.includes(r) || n instanceof Node && r.contains(n));
53
- });
54
- }
55
- function $(e) {
56
- if (e.defaultPrevented || e.cancelBubble || e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) return;
57
- let t = X();
58
- if (t.length === 0) return;
59
- let n = Q(e)?.token ?? M(), r = t.findIndex((e) => e.token === n), i = a({
60
- list: t.map((e) => e.element()),
61
- currentIndex: r,
62
- key: e.key,
63
- orientation: O(),
64
- rtl: b() === "rtl",
65
- loop: C.loopFocus ?? !0
66
- });
67
- if (i === r || i < 0) return;
68
- let o = t[i];
69
- o && (e.preventDefault(), e.stopPropagation(), Z(o), o.element()?.focus({ preventScroll: !0 }));
70
- }
71
- let ue = i(() => C.onFocusIn, () => (e) => {
72
- let t = Q(e);
73
- t && Z(t);
74
- }), de = i(() => C.onKeyDown, () => $), fe = {
75
- modal: E,
76
- disabled: D,
77
- orientation: O,
78
- hasSubmenuOpen: A,
79
- rootElement: k,
80
- rootId: T,
81
- tree: I,
82
- nodeId: L,
83
- allowMouseUpTrigger: z,
84
- createTriggerId() {
85
- V += 1, V === 1 && typeof document < "u" && (H = (k() ?? document.getElementById(T()))?.querySelectorAll("[role=\"menuitem\"][aria-haspopup=\"menu\"]").length ?? 0, H > 0 && !U && (U = !0, queueMicrotask(() => {
86
- H = 0;
87
- })));
88
- let e = H > 0 ? (V - 1) % H + 1 : V;
89
- return `${T()}-trigger-${e}`;
90
- },
91
- isTabStop: le,
92
- notifyItemChange: J,
93
- registerTrigger: ce,
94
- setActiveTrigger: Z,
95
- relayKeyboardEvent: $
96
- };
97
- h(k, (e) => {
98
- let t = e?.ownerDocument.defaultView?.MutationObserver;
99
- if (!e || !t) return;
100
- let n = new t(J);
101
- return n.observe(e, {
102
- attributes: !0,
103
- childList: !0,
104
- subtree: !0,
105
- attributeFilter: [
106
- "class",
107
- "disabled",
108
- "hidden",
109
- "style"
110
- ]
111
- }), () => n.disconnect();
112
- });
113
- let pe = I.events.on("menuopenchange", (e) => {
114
- !e.nodeId || e.parentNodeId !== L || (e.open ? j(!0) : e.reason !== "sibling-open" && e.reason !== "list-navigation" && j(!1));
115
- });
116
- te(pe);
117
- let me = e(m, () => G(), (e) => (() => {
118
- var t = ee(ne);
119
- return p(t, e, !1), f(), t;
120
- })());
121
- return u(l, {
122
- value: fe,
123
- get children() {
124
- return u(me, d({
125
- ref: [((e) => ae(e)), C.ref],
126
- get id() {
127
- return T();
128
- },
129
- role: "menubar",
130
- get "aria-orientation"() {
131
- return O();
132
- },
133
- get class() {
134
- return K();
135
- },
136
- get style() {
137
- return q();
138
- },
139
- onFocusIn: ue,
140
- onKeyDown: de
141
- }, oe, se));
142
- }
143
- });
144
- }
145
- function x(e, t) {
146
- let n = e.element(), r = t.element();
147
- if (n && r && n !== r) {
148
- let e = n.compareDocumentPosition(r);
149
- if ((e & Node.DOCUMENT_POSITION_DISCONNECTED) === 0) {
150
- if (e & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
151
- if (e & Node.DOCUMENT_POSITION_PRECEDING) return 1;
152
- }
153
- }
154
- return e.order - t.order;
155
- }
156
- function S(e) {
157
- let t = e.element();
158
- if (!t?.isConnected || e.disabled() || t.matches(":disabled")) return !1;
159
- let n = t.ownerDocument.defaultView?.getComputedStyle(t);
160
- return !n || n.display === "none" || n.display === "contents" || n.visibility === "hidden" || n.visibility === "collapse" ? !1 : typeof t.checkVisibility != "function" || t.checkVisibility();
161
- }
162
- //#endregion
163
- export { b as t };