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,521 +0,0 @@
1
- import { t as e } from "./useRender-CxZ8PI-g.js";
2
- import { getStateAttributesProps as t } from "./internals/getStateAttributesProps.js";
3
- import { P as n, d as r, i } from "./reasons-Co5CzjKq.js";
4
- import { n as a, t as o } from "./resolveStyle-XcgAuaKR.js";
5
- import { createChangeEventDetails as s } from "./internals/createBaseUIEventDetails.js";
6
- import { transitionStatusMapping as c } from "./internals/stateAttributesMapping.js";
7
- import { composeEventHandlers as l } from "./internals/composeEventHandlers.js";
8
- import { a as u, n as d, r as f } from "./dom-BEAeQ9Eb.js";
9
- import { n as p, t as m } from "./InternalBackdrop-cSK13gaM.js";
10
- import { c as h, i as ee, n as te, r as g, s as _, t as v } from "./FloatingTree-23B7KKPD.js";
11
- import { a as y, n as b, o as x, t as S } from "./PopupStore-Du0O57fL.js";
12
- import { a as ne, o as C } from "./popupStateMapping-C6jQ_LKo.js";
13
- import { i as re, n as w, r as T, t as E } from "./PopupHandle-CQI6Om1Z.js";
14
- import { t as D } from "./setRef-fXF6OIo3.js";
15
- import { a as O, i as ie, n as ae, r as k, t as oe } from "./buttonSemantics-paljfpOX.js";
16
- import { createComponent as A, getNextElement as j, memo as M, mergeProps as N, runHydrationEvents as P, spread as F, template as I } from "@solidjs/web";
17
- import { $REFRESH as se, Show as L, createContext as R, createEffect as z, createMemo as B, createSignal as V, createUniqueId as H, omit as U, onCleanup as W, untrack as G, useContext as K } from "solid-js";
18
- //#region src/dialog/store/DialogStore.ts
19
- var ce = class extends S {
20
- openMethodAccessor;
21
- setOpenMethodSignal;
22
- openMethodRevisionAccessor;
23
- setOpenMethodRevision;
24
- constructor(e = {}) {
25
- super(e);
26
- let [t, n] = V(null, { ownedWrite: !0 });
27
- this.openMethodAccessor = t, this.setOpenMethodSignal = n;
28
- let [r, i] = V(0, { ownedWrite: !0 });
29
- this.openMethodRevisionAccessor = r, this.setOpenMethodRevision = i;
30
- }
31
- openMethod() {
32
- return this.openMethodAccessor();
33
- }
34
- setOpenMethod(e) {
35
- this.setOpenMethodSignal(e), this.setOpenMethodRevision((e) => e + 1);
36
- }
37
- openMethodRevision() {
38
- return this.openMethodRevisionAccessor();
39
- }
40
- setPayload(e) {
41
- this.set("payload", e);
42
- }
43
- setOpen(e, t) {
44
- return !e && t.trigger == null && this.activeTriggerId() != null && (t.trigger = this.state.activeTriggerElement ?? void 0), super.setOpen(e, t);
45
- }
46
- }, q = class extends w {
47
- openMethod() {
48
- return null;
49
- }
50
- setOpenMethod(e) {}
51
- setPayload(e) {}
52
- }, J = Symbol("DialogRootContext"), le = R(J);
53
- function Y(e = !1) {
54
- let t = K(le);
55
- if (t === J) {
56
- if (e) return;
57
- throw Error("Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");
58
- }
59
- return t;
60
- }
61
- //#endregion
62
- //#region src/dialog/root/DialogRoot.tsx
63
- function ue(e) {
64
- return X("dialog", e);
65
- }
66
- function X(e, t, n = {}) {
67
- let i = Y(!0), a = h(), o = _(), c = a ?? new g(), l = H(), m = H(), b = G(() => t.open !== void 0), S = G(() => t.triggerId !== void 0), ne = i !== void 0, C = e === "alert-dialog", re = e === "drawer", w = B(() => C ? !0 : t.modal ?? !0), E = B(() => C || (t.disablePointerDismissal ?? !1)), D = new ce({
68
- controlledOpen: () => b ? t.open : void 0,
69
- controlledTriggerId: () => S ? t.triggerId : void 0,
70
- floatingId: m,
71
- nested: o !== null,
72
- nodeId: l,
73
- onOpenChange: () => t.onOpenChange,
74
- onOpenChangeComplete: () => t.onOpenChangeComplete
75
- });
76
- D.update({
77
- open: b ? !!G(() => t.open) : !!G(() => t.defaultOpen),
78
- activeTriggerId: G(() => t.defaultTriggerId ?? null)
79
- });
80
- let O = D.access((e) => e.payload), ie = ee({
81
- tree: c,
82
- id: l,
83
- parentId: o,
84
- context: () => D.context.floatingRoot
85
- }), [ae, k] = V(), [oe, j] = V(), [N, P] = V(null, { ownedWrite: !0 }), [F, I] = V(null, { ownedWrite: !0 }), [L, R] = V(null, { ownedWrite: !0 }), [U, K] = V(0, {
86
- equals: !1,
87
- ownedWrite: !0
88
- }), q = /* @__PURE__ */ new Map(), J = B(() => {
89
- U();
90
- let e = 0;
91
- for (let t of q.values()) e += t.dialogCount;
92
- return e;
93
- }), ue = B(() => {
94
- U();
95
- let e = 0;
96
- for (let t of q.values()) e += t.drawerCount;
97
- return e;
98
- }), X = { current: !0 }, Z = y(D, () => D.track().popupElement, { onUnmount: () => D.setOpenMethod(null) });
99
- function de(e, t, n) {
100
- let r = q.get(e);
101
- (r?.dialogCount !== t || r.drawerCount !== n) && (q.set(e, {
102
- dialogCount: t,
103
- drawerCount: n
104
- }), K((e) => e + 1));
105
- }
106
- function fe(e) {
107
- q.delete(e) && K((e) => e + 1);
108
- }
109
- let pe = {
110
- store: D,
111
- tree: c,
112
- nested: ne,
113
- role: C ? "alertdialog" : "dialog",
114
- modal: w,
115
- disablePointerDismissal: E,
116
- nestedOpenDialogCount: J,
117
- nestedOpenDrawerCount: ue,
118
- outsidePressEnabled: X,
119
- titleId: ae,
120
- setTitleId: k,
121
- descriptionId: oe,
122
- setDescriptionId: j,
123
- backdropElement: N,
124
- setBackdropElement: P,
125
- internalBackdropElement: F,
126
- setInternalBackdropElement: I,
127
- viewportElement: L,
128
- setViewportElement: R,
129
- presence: Z,
130
- updateNestedLayer: de,
131
- removeNestedLayer: fe
132
- };
133
- D.context.floatingRoot.context.data.insideElements = () => [
134
- N(),
135
- F(),
136
- L()
137
- ], D.configureTriggerUnmount({ closeOnActiveTriggerUnmount: !1 }), T(() => t.handle, D);
138
- let Q = x({
139
- context: D.context.floatingRoot,
140
- tree: () => c,
141
- escapeKey: () => J() === 0,
142
- outsidePress: () => (e) => {
143
- if (!X.current || E() || J() > 0 || "button" in e && e.button !== 0) return !1;
144
- if ("touches" in e) {
145
- if (e.type === "touchend") {
146
- if (e.changedTouches.length !== 1 || e.touches.length !== 0) return !1;
147
- } else if (e.touches.length !== 1) return !1;
148
- }
149
- if (w() === !1) return !0;
150
- let t = f(e), n = F(), r = N();
151
- return !n && !r || t === n || t === r || u(t) && d(t, D.state.popupElement) && !t.hasAttribute("data-base-ui-portal");
152
- },
153
- outsidePressEvent: () => F() || N() ? "intentional" : {
154
- mouse: w() === "trap-focus" ? "sloppy" : "intentional",
155
- touch: "sloppy"
156
- }
157
- });
158
- D.setInteractionProps({
159
- activeTriggerProps: { onKeyDown: Q.onKeyDown },
160
- inactiveTriggerProps: { onKeyDown: Q.onKeyDown },
161
- popupProps: {}
162
- }), p(() => D.open() && w() === !0, () => D.track().popupElement), z(() => ({
163
- open: D.open(),
164
- activeTriggerId: D.activeTriggerId()
165
- }), () => G(() => D.reconcileTriggers()));
166
- let $ = G(() => D.open()), me = G(() => D.openMethodRevision());
167
- z(() => ({
168
- open: D.open(),
169
- openMethodRevision: D.openMethodRevision()
170
- }), (e) => {
171
- !e.open && $ ? me = e.openMethodRevision : e.open && !$ && e.openMethodRevision === me && D.setOpenMethod(null), $ = e.open;
172
- });
173
- let he = Symbol("DialogRoot");
174
- z(() => ({
175
- open: D.open(),
176
- nestedDialogs: J(),
177
- nestedDrawers: ue()
178
- }), (e) => {
179
- i?.updateNestedLayer(he, e.open ? e.nestedDialogs + 1 : 0, e.open ? e.nestedDrawers + +!!re : 0);
180
- });
181
- let ge = {
182
- unmount: Z.forceUnmount,
183
- close() {
184
- D.setOpen(!1, s(r));
185
- }
186
- };
187
- z(() => t.actionsRef, (e) => {
188
- e?.(ge);
189
- });
190
- function _e() {
191
- let e = B(() => t.children), n = G(e), r = n;
192
- return typeof n == "function" && (r = n.name === "bound read" && Object.prototype.hasOwnProperty.call(n, se) ? M(() => e()) : G(() => n({ payload: O }))), r;
193
- }
194
- return W(() => {
195
- i?.removeNestedLayer(he), D.clearInteractionProps(), delete D.context.floatingRoot.context.data.insideElements;
196
- }), A(le, {
197
- value: pe,
198
- get children() {
199
- return A(te, {
200
- value: c,
201
- get children() {
202
- return A(v, {
203
- get value() {
204
- return ie.id ?? null;
205
- },
206
- get children() {
207
- return [M(() => n.extraContent?.()), A(_e, {})];
208
- }
209
- });
210
- }
211
- });
212
- }
213
- });
214
- }
215
- //#endregion
216
- //#region src/dialog/utils/mergeDialogStyles.ts
217
- function Z(e, t) {
218
- if (typeof t == "string") {
219
- let n = Object.entries(e).filter((e) => e[1] != null).map(([e, t]) => `${e}:${String(t)}`).join(";");
220
- return n ? `${n};${t}` : t;
221
- }
222
- return {
223
- ...e,
224
- ...t || void 0
225
- };
226
- }
227
- //#endregion
228
- //#region src/dialog/utils/stateAttributesMapping.ts
229
- var de = { "data-open": "" }, fe = { "data-closed": "" }, pe = { "data-nested-dialog-open": "" }, Q = {
230
- open: (e) => e ? de : fe,
231
- ...c
232
- }, $ = {
233
- ...Q,
234
- nestedDialogOpen: (e) => e ? pe : null
235
- }, me = /* @__PURE__ */ I("<button>");
236
- function he(n) {
237
- let r = Y(), c = n, u = n, d = B(() => c.disabled ?? !1), f = B(() => c.nativeButton ?? !0), p = B(() => ({ disabled: d() })), m = e(n, () => p(), (e) => (() => {
238
- var t = j(me);
239
- return F(t, e, !1), P(), t;
240
- })()), h = B(() => a(n.class, p())), ee = B(() => o(n.style, p())), te = B(() => t(p())), g = U(u, "render", "class", "disabled", "nativeButton", "onClick", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "ref", "style");
241
- function _(e) {
242
- r.store.open() && r.store.setOpen(!1, s(i, e));
243
- }
244
- let v = l(() => G(() => d() ? k : void 0), () => c.onClick, () => _), y = l(() => G(() => d() ? k : void 0), () => c.onPointerDown), b = l(() => G(() => d() ? O : void 0), () => c.onMouseDown), x = l(() => G(() => d() ? ie : void 0), () => c.onKeyDown, () => G(() => f() ? void 0 : oe)), S = l(() => G(() => d() ? O : void 0), () => c.onKeyUp, () => G(() => f() ? void 0 : ae));
245
- return A(m, N({
246
- ref: [c.ref],
247
- get type() {
248
- return f() ? "button" : void 0;
249
- },
250
- get role() {
251
- return f() ? void 0 : "button";
252
- },
253
- get tabIndex() {
254
- return !f() && d() ? -1 : 0;
255
- },
256
- get disabled() {
257
- return (M(() => !!f())() ? d() : f()) || void 0;
258
- },
259
- get "aria-disabled"() {
260
- return !f() && d() ? "true" : void 0;
261
- },
262
- get class() {
263
- return h();
264
- },
265
- get style() {
266
- return ee();
267
- },
268
- onClick: v,
269
- onKeyDown: x,
270
- onKeyUp: S,
271
- onMouseDown: b,
272
- onPointerDown: y
273
- }, te, g));
274
- }
275
- //#endregion
276
- //#region src/dialog/description/DialogDescription.tsx
277
- var ge = /* @__PURE__ */ I("<p>");
278
- function _e(t) {
279
- let n = Y(), r = t, i = t, s = `base-ui-${H()}`, c = B(() => r.id || s), l = {}, u = e(t, () => l, (e) => (() => {
280
- var t = j(ge);
281
- return F(t, e, !1), P(), t;
282
- })()), d = B(() => a(t.class, l)), f = B(() => o(t.style, l)), p = U(i, "render", "class", "id", "ref", "style");
283
- return z(() => c(), (e) => (n.setDescriptionId(e), () => n.setDescriptionId((t) => t === e ? void 0 : t))), A(u, N({
284
- ref: [r.ref],
285
- get id() {
286
- return c();
287
- },
288
- get class() {
289
- return d();
290
- },
291
- get style() {
292
- return f();
293
- }
294
- }, p));
295
- }
296
- //#endregion
297
- //#region src/dialog/portal/DialogPortalContext.ts
298
- var ve = Symbol("DialogPortalContext"), ye = R(ve);
299
- function be() {
300
- let e = K(ye);
301
- if (e === ve) throw Error("Base UI: <Dialog.Portal> is missing.");
302
- return e;
303
- }
304
- //#endregion
305
- //#region src/dialog/portal/DialogPortal.tsx
306
- function xe(e) {
307
- let t = Y(), n = e, r = e, i = B(() => n.keepMounted ?? !1), s = B(() => t.presence.mounted() || i()), c = {}, l = B(() => a(e.class, c)), u = B(() => o(e.style, c)), d = U(r, "render", "class", "container", "keepMounted", "ref", "style"), f = { keepMounted: i };
308
- function p() {
309
- let e = null;
310
- return W(() => {
311
- t.internalBackdropElement() === e && t.setInternalBackdropElement(null);
312
- }), A(m, {
313
- ref: (n) => {
314
- e = n, t.setInternalBackdropElement(n);
315
- },
316
- get open() {
317
- return t.store.open();
318
- }
319
- });
320
- }
321
- return A(L, {
322
- get when() {
323
- return s();
324
- },
325
- get children() {
326
- return A(ye, {
327
- value: f,
328
- get children() {
329
- return A(C, N({
330
- get render() {
331
- return e.render;
332
- },
333
- get container() {
334
- return n.container;
335
- },
336
- ref: (e) => {
337
- n.ref && D(n.ref, e);
338
- },
339
- get class() {
340
- return l();
341
- },
342
- get style() {
343
- return u();
344
- }
345
- }, d, { get children() {
346
- return [A(L, {
347
- get when() {
348
- return M(() => !!t.presence.mounted())() ? t.modal() === !0 : t.presence.mounted();
349
- },
350
- get children() {
351
- return A(p, {});
352
- }
353
- }), M(() => e.children)];
354
- } }));
355
- }
356
- });
357
- }
358
- });
359
- }
360
- //#endregion
361
- //#region src/dialog/title/DialogTitle.tsx
362
- var Se = /* @__PURE__ */ I("<h2>");
363
- function Ce(t) {
364
- let n = Y(), r = t, i = t, s = `base-ui-${H()}`, c = B(() => r.id || s), l = {}, u = e(t, () => l, (e) => (() => {
365
- var t = j(Se);
366
- return F(t, e, !1), P(), t;
367
- })()), d = B(() => a(t.class, l)), f = B(() => o(t.style, l)), p = U(i, "render", "class", "id", "ref", "style");
368
- return z(() => c(), (e) => (n.setTitleId(e), () => n.setTitleId((t) => t === e ? void 0 : t))), A(u, N({
369
- ref: [r.ref],
370
- get id() {
371
- return c();
372
- },
373
- get class() {
374
- return d();
375
- },
376
- get style() {
377
- return f();
378
- }
379
- }, p));
380
- }
381
- //#endregion
382
- //#region src/dialog/trigger/DialogTrigger.tsx
383
- var we = /* @__PURE__ */ I("<button>");
384
- function Te(r) {
385
- let i = Y(!0), c = r;
386
- if (!i && !G(() => c.handle)) throw Error("Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.");
387
- let u = r, d = `base-ui-${H()}`, f = B(() => c.id || d), p = B(() => c.disabled ?? !1), m = B(() => c.nativeButton ?? !0), [h, ee] = V(null, { ownedWrite: !0 }), te = re(() => c.handle), g = B(() => te() ?? i?.store), _ = B(() => {
388
- let e = g();
389
- return !!(e?.open() && e.activeTriggerId() === f());
390
- }), v = B(() => ({
391
- disabled: p(),
392
- open: _()
393
- })), y = e(r, () => v(), (e) => (() => {
394
- var t = j(we);
395
- return F(t, e, !1), P(), t;
396
- })()), x = B(() => a(r.class, v())), S = B(() => o(r.style, v())), C = B(() => t(v(), ne)), w = U(u, "render", "class", "disabled", "handle", "id", "nativeButton", "onClick", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "payload", "ref", "style"), T = "", E = "";
397
- b(g, f, h, () => ({ payload: c.payload }));
398
- function D(e) {
399
- let t = g(), r = h();
400
- !t || !r || e.button !== 0 || (t.open() || t.setOpenMethod(E || (e.detail === 0 ? "keyboard" : Ee() ? "touch" : "mouse")), t.setOpen(!(t.open() && t.activeTriggerId() === f()), s(n, e, r)));
401
- }
402
- function I() {
403
- E = T, T = "";
404
- }
405
- function se(e) {
406
- T = e.pointerType;
407
- }
408
- function L(e) {
409
- T = "keyboard";
410
- let t = g(), n = t?.state.popupElement, r = t ? (t.activeTriggerId() === f() ? t.state.activeTriggerProps : t.state.inactiveTriggerProps).onKeyDown : void 0, i = e.currentTarget;
411
- n && i && n.ownerDocument !== i.ownerDocument && typeof r == "function" && r(e);
412
- }
413
- let R = l(() => G(() => p() ? k : void 0), () => I, () => c.onClick, () => D), z = l(() => G(() => p() ? k : void 0), () => c.onPointerDown, () => se), W = l(() => G(() => p() ? O : void 0), () => c.onMouseDown), K = l(() => G(() => p() ? ie : void 0), () => c.onKeyDown, () => L, () => G(() => m() ? void 0 : oe)), ce = l(() => G(() => p() ? O : void 0), () => c.onKeyUp, () => G(() => m() ? void 0 : ae));
414
- return A(y, N({
415
- ref: [((e) => ee(e)), c.ref],
416
- get id() {
417
- return f();
418
- },
419
- get type() {
420
- return m() ? "button" : void 0;
421
- },
422
- get role() {
423
- return m() ? void 0 : "button";
424
- },
425
- get tabIndex() {
426
- return !m() && p() ? -1 : 0;
427
- },
428
- get disabled() {
429
- return (M(() => !!m())() ? p() : m()) || void 0;
430
- },
431
- get "aria-disabled"() {
432
- return !m() && p() ? "true" : void 0;
433
- },
434
- "aria-haspopup": "dialog",
435
- get "aria-expanded"() {
436
- return _() ? "true" : "false";
437
- },
438
- get "aria-controls"() {
439
- return g()?.triggerPopupId(f());
440
- },
441
- "data-base-ui-click-trigger": "",
442
- get class() {
443
- return x();
444
- },
445
- get style() {
446
- return S();
447
- },
448
- onClick: R,
449
- onKeyDown: K,
450
- onKeyUp: ce,
451
- onMouseDown: W,
452
- onPointerDown: z
453
- }, C, w));
454
- }
455
- function Ee() {
456
- if (typeof navigator > "u") return !1;
457
- let e = navigator.platform.toLowerCase();
458
- return /^i(os$|p)/.test(e) || e === "macintel" && navigator.maxTouchPoints > 1;
459
- }
460
- //#endregion
461
- //#region src/dialog/viewport/DialogViewport.tsx
462
- var De = /* @__PURE__ */ I("<div>");
463
- function Oe(n) {
464
- let r = be(), i = Y(), s = n, c = U(n, "render", "class", "ref", "style"), l = B(() => ({
465
- open: i.store.open(),
466
- transitionStatus: i.store.track().transitionStatus,
467
- nested: i.nested,
468
- nestedDialogOpen: i.nestedOpenDialogCount() > 0
469
- })), u = e(n, () => l(), (e) => (() => {
470
- var t = j(De);
471
- return F(t, e, !1), P(), t;
472
- })()), d = B(() => a(n.class, l())), f = B(() => Z({ "pointer-events": i.store.open() ? void 0 : "none" }, o(n.style, l()))), p = B(() => t(l(), $)), m = B(() => r.keepMounted() || i.presence.mounted()), h = null;
473
- return W(() => {
474
- i.viewportElement() === h && i.setViewportElement(null);
475
- }), A(L, {
476
- get when() {
477
- return m();
478
- },
479
- get children() {
480
- return A(u, N({
481
- ref: [((e) => {
482
- h = e, i.setViewportElement(e);
483
- }), s.ref],
484
- role: "presentation",
485
- get hidden() {
486
- return !i.presence.mounted();
487
- },
488
- get class() {
489
- return d();
490
- },
491
- get style() {
492
- return f();
493
- }
494
- }, p, c));
495
- }
496
- });
497
- }
498
- //#endregion
499
- //#region src/dialog/store/DialogHandle.ts
500
- var ke = class extends E {
501
- constructor() {
502
- super("Dialog", !1, new q());
503
- }
504
- open(e) {
505
- this.openByTrigger(e);
506
- }
507
- openWithPayload(e) {
508
- this.attachedStore && (this.attachedStore.setPayload(e), this.attachedStore.setOpen(!0, s(r)));
509
- }
510
- close() {
511
- this.closePopup();
512
- }
513
- get isOpen() {
514
- return this.attachedStore?.open() ?? !1;
515
- }
516
- };
517
- function Ae() {
518
- return new ke();
519
- }
520
- //#endregion
521
- export { Ce as a, _e as c, Q as d, Z as f, Y as h, Te as i, he as l, X as m, Ae as n, xe as o, ue as p, Oe as r, be as s, ke as t, $ as u };
@@ -1,138 +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 { t as a } from "./FocusManager-NP1uPXTi.js";
6
- import { d as o, f as s, h as c, s as l, u } from "./DialogHandle-BGyIbcvg.js";
7
- import { createComponent as d, getNextElement as f, mergeProps as p, runHydrationEvents as m, spread as h, template as g } from "@solidjs/web";
8
- import { Show as _, createEffect as v, createMemo as y, omit as b, onCleanup as x } from "solid-js";
9
- //#region src/dialog/backdrop/DialogBackdrop.tsx
10
- var S = /* @__PURE__ */ g("<div>");
11
- function C(i) {
12
- let a = c(), l = i, u = b(i, "render", "class", "forceRender", "ref", "style"), g = y(() => ({
13
- open: a.store.open(),
14
- transitionStatus: a.store.track().transitionStatus
15
- })), v = e(i, () => g(), (e) => (() => {
16
- var t = f(S);
17
- return h(t, e, !1), m(), t;
18
- })()), C = y(() => n(i.class, g())), w = y(() => s({
19
- "user-select": "none",
20
- "-webkit-user-select": "none"
21
- }, r(i.style, g()))), T = y(() => t(g(), o)), E = y(() => !!l.forceRender || !a.nested);
22
- function D() {
23
- let e = null;
24
- return x(() => {
25
- a.backdropElement() === e && a.setBackdropElement(null);
26
- }), d(v, p({
27
- ref: [((t) => {
28
- e = t, a.setBackdropElement(t);
29
- }), l.ref],
30
- role: "presentation",
31
- get hidden() {
32
- return !a.presence.mounted();
33
- },
34
- get class() {
35
- return C();
36
- },
37
- get style() {
38
- return w();
39
- }
40
- }, T, u));
41
- }
42
- return d(_, {
43
- get when() {
44
- return E();
45
- },
46
- get children() {
47
- return d(D, {});
48
- }
49
- });
50
- }
51
- //#endregion
52
- //#region src/dialog/popup/DialogPopup.tsx
53
- var w = /* @__PURE__ */ g("<div>"), T = /* @__PURE__ */ new Set([
54
- "ArrowUp",
55
- "ArrowDown",
56
- "ArrowLeft",
57
- "ArrowRight",
58
- "Home",
59
- "End"
60
- ]);
61
- function E(o) {
62
- l();
63
- let g = c(), _ = o, S = b(o, "render", "class", "finalFocus", "id", "initialFocus", "onKeyDown", "ref", "style"), C = y(() => ({
64
- open: g.store.open(),
65
- transitionStatus: g.store.track().transitionStatus,
66
- nested: g.nested,
67
- nestedDialogOpen: g.nestedOpenDialogCount() > 0
68
- })), E = e(o, () => C(), (e) => (() => {
69
- var t = f(w);
70
- return h(t, e, !1), m(), t;
71
- })()), D = y(() => n(o.class, C())), O = y(() => s({ "--nested-dialogs": g.nestedOpenDialogCount() }, r(o.style, C()))), k = y(() => t(C(), u)), A = y(() => _.id ?? g.store.context.floatingId), j = y(() => _.initialFocus ?? ((e) => e !== "touch" || g.store.state.popupElement)), M = i(() => _.onKeyDown, () => (e) => {
72
- T.has(e.key) && e.stopPropagation();
73
- }), N = null;
74
- v(() => A(), (e) => {
75
- g.store.setPopupId(e);
76
- }), x(() => {
77
- g.store.state.popupElement === N && g.store.setPopupElement(null);
78
- });
79
- let P = d(E, p({
80
- ref: [((e) => {
81
- N = e, g.store.setPopupElement(e);
82
- }), _.ref],
83
- get id() {
84
- return A();
85
- },
86
- get role() {
87
- return g.role;
88
- },
89
- tabIndex: -1,
90
- "data-base-ui-focusable": "",
91
- get hidden() {
92
- return !g.presence.mounted();
93
- },
94
- get "aria-labelledby"() {
95
- return g.titleId();
96
- },
97
- get "aria-describedby"() {
98
- return g.descriptionId();
99
- },
100
- get class() {
101
- return D();
102
- },
103
- get style() {
104
- return O();
105
- },
106
- onKeyDown: M
107
- }, k, S));
108
- return d(a, {
109
- get context() {
110
- return g.store.context.floatingRoot;
111
- },
112
- get tree() {
113
- return g.tree;
114
- },
115
- get disabled() {
116
- return !g.presence.mounted();
117
- },
118
- get closeOnFocusOut() {
119
- return !g.disablePointerDismissal();
120
- },
121
- get initialFocus() {
122
- return j();
123
- },
124
- get returnFocus() {
125
- return _.finalFocus;
126
- },
127
- get modal() {
128
- return g.modal() !== !1;
129
- },
130
- restoreFocus: "popup",
131
- get openInteractionType() {
132
- return g.store.openMethod();
133
- },
134
- children: P
135
- });
136
- }
137
- //#endregion
138
- export { C as n, E as t };