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

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 +56 -0
  2. package/README.md +30 -35
  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 +2 -2
  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,425 +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 { w as r } from "./reasons-Co5CzjKq.js";
5
- import { n as i, t as a } from "./resolveStyle-XcgAuaKR.js";
6
- import { createChangeEventDetails as o } from "./internals/createBaseUIEventDetails.js";
7
- import { transitionStatusMapping as s } from "./internals/stateAttributesMapping.js";
8
- import { composeEventHandlers as c } from "./internals/composeEventHandlers.js";
9
- import { t as ee } from "./runOnceAnimationsFinish-CFADb4CN.js";
10
- import { t as te } from "./createTransitionStatus-BL_cPSEA.js";
11
- import { fieldStateAttributesMapping as l } from "./internals/field-constants.js";
12
- import { n as ne } from "./FieldRootContext-izCEh80D.js";
13
- import { n as u } from "./FormContext-CwLBtm_d.js";
14
- import { r as d } from "./LabelableContext-CmQF-TX2.js";
15
- import { t as f } from "./createLabelableId-DxJRwMUJ.js";
16
- import { n as p } from "./FieldItemContext-Bwzf-4tL.js";
17
- import { n as re } from "./CheckboxGroupContext-1CRRHK0T.js";
18
- import { createComponent as m, effect as ie, getNextElement as h, memo as g, mergeProps as _, ref as ae, runHydrationEvents as v, setAttribute as y, setProperty as oe, spread as b, template as x } from "@solidjs/web";
19
- import { Show as se, createContext as S, createEffect as C, createMemo as w, createSignal as T, createUniqueId as E, omit as ce, onCleanup as le, onSettled as ue, untrack as D, useContext as de } from "solid-js";
20
- //#region src/checkbox/utils/getCheckboxStateAttributesMapping.ts
21
- function fe(e) {
22
- return {
23
- ...l,
24
- checked(t) {
25
- return e.indeterminate ? null : t ? { "data-checked": "" } : { "data-unchecked": "" };
26
- }
27
- };
28
- }
29
- //#endregion
30
- //#region src/checkbox/root/CheckboxRootContext.ts
31
- var O = Symbol("CheckboxRootContext"), pe = S(O);
32
- function me() {
33
- let e = de(pe);
34
- if (e === O) throw Error("Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.");
35
- return e;
36
- }
37
- //#endregion
38
- //#region src/checkbox/root/CheckboxRoot.tsx
39
- var he = /* @__PURE__ */ x("<span>"), ge = /* @__PURE__ */ x("<input type=hidden>"), _e = /* @__PURE__ */ x("<input>"), ve = {
40
- "clip-path": "inset(50%)",
41
- overflow: "hidden",
42
- "white-space": "nowrap",
43
- border: "0",
44
- padding: "0",
45
- width: "1px",
46
- height: "1px",
47
- margin: "-1px",
48
- position: "fixed",
49
- top: "0",
50
- left: "0"
51
- }, ye = {
52
- ...ve,
53
- position: "absolute",
54
- top: "auto",
55
- left: "auto"
56
- };
57
- function k(e) {
58
- let s = ne(!0), ee = u(), te = p(), l = d(), x = re(), S = e, de = e, O = Symbol("Checkbox"), me = Symbol("CheckboxGroupItem"), k = `base-ui-${E()}`, A = `base-ui-${E()}`, j = `base-ui-${E()}`, M = l.defaultControlId, Se = typeof M == "string" ? M : k, N = D(() => S.checked !== void 0), [Ce, we] = T(D(() => S.defaultChecked ?? !1)), [P, Te] = T(), [F, Ee] = T(), [De, I] = T(), Oe = D(() => N ? !!S.checked : Ce()), L = !1, R = !1, z, B = () => void 0, ke = ce(de, "aria-describedby", "aria-labelledby", "render", "checked", "class", "defaultChecked", "disabled", "form", "id", "indeterminate", "inputRef", "name", "nativeButton", "onBlur", "onChange", "onCheckedChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "parent", "readOnly", "ref", "required", "style", "uncheckedValue", "value"), V = w(() => S.nativeButton ?? !1), H = w(() => S.parent ?? !1), U = w(() => x?.allValues() !== void 0), W = w(() => s.disabled() || te.disabled() || (x?.disabled() ?? !1) || (S.disabled ?? !1)), G = w(() => S.readOnly ?? !1), K = w(() => S.required ?? !1), q = w(() => s.name() ?? S.name), J = w(() => S.value ?? q()), Ae = w(() => N ? !!S.checked : Ce()), Y = w(() => !x || J() === void 0 || H() ? U() && H() ? x?.parent.checked() ?? !1 : Ae() : x.value().includes(J())), X = w(() => U() && H() && (x?.parent.indeterminate() ?? !1) || (S.indeterminate ?? !1)), je = () => x?.registerControlId !== l.registerControlId, Me = f(() => S.id || void 0, je() ? Se : k, je), Ne = w(() => V() ? Me() : A), Z = w(() => ({
59
- ...s.state(),
60
- checked: Y(),
61
- disabled: W(),
62
- readOnly: G(),
63
- required: K(),
64
- indeterminate: X()
65
- })), Pe = w(() => i(e.class, Z())), Fe = t(e, () => Z(), (e) => (() => {
66
- var t = h(he);
67
- return b(t, e, !1), v(), t;
68
- })()), Ie = w(() => a(e.style, Z())), Le = w(() => n(Z(), fe(Z()))), Re = w(() => S["aria-labelledby"] ?? l.labelId() ?? De()), ze = w(() => l.getAriaDescribedBy(S["aria-describedby"])), Be = {
69
- token: me,
70
- id: Ne,
71
- disabled: W,
72
- element: P,
73
- input: F,
74
- parent: H,
75
- value: J
76
- }, Ve = {
77
- id: A,
78
- name: S.name,
79
- value: Y,
80
- getControl: () => P() ?? null
81
- }, He = c(() => S.onBlur), Ue = c(() => S.onClick), We = c(() => S.onFocus), Ge = c(() => S.onKeyDown), Ke = c(() => S.onKeyUp);
82
- function qe(e) {
83
- if (R) {
84
- e.preventDefault(), e.stopPropagation();
85
- return;
86
- }
87
- if (Ue.call(e.currentTarget, e), e.baseUIHandlerPrevented || G() || W()) return;
88
- e.preventDefault();
89
- let t = F();
90
- t && be(t, e);
91
- }
92
- function Je(e) {
93
- We.call(e.currentTarget, e), !e.baseUIHandlerPrevented && !W() && s.setFocused(!0);
94
- }
95
- function Ye(e) {
96
- He.call(e.currentTarget, e), !e.baseUIHandlerPrevented && (s.setTouched(!0), s.setFocused(!1), s.validationMode() === "onBlur" && s.validation.commit(x ? x.value() : Y()));
97
- }
98
- function Xe(e) {
99
- Ge.call(e.currentTarget, e), !e.baseUIHandlerPrevented && (e.key === "Enter" ? (V() && nt(e.currentTarget), xe(e, F()?.form ?? null)) : !V() && e.key === " " && e.preventDefault());
100
- }
101
- function Ze(e) {
102
- Ke.call(e.currentTarget, e), !(e.baseUIHandlerPrevented || V() || e.defaultPrevented || e.key !== " " || W() || G()) && be(e.currentTarget, e);
103
- }
104
- function Qe(e) {
105
- if (e.stopPropagation(), e.defaultPrevented) {
106
- queueMicrotask(Q);
107
- return;
108
- }
109
- L = !0, et(e.currentTarget.checked, e), setTimeout(() => {
110
- L = !1;
111
- }, 0), queueMicrotask(Q);
112
- }
113
- function $e(e) {
114
- if (L && e.isTrusted) {
115
- L = !1;
116
- return;
117
- }
118
- if (e.defaultPrevented) {
119
- queueMicrotask(Q);
120
- return;
121
- }
122
- et(e.currentTarget.checked, e), queueMicrotask(Q);
123
- }
124
- function et(e, t) {
125
- if (G() || W()) {
126
- t.preventDefault();
127
- return;
128
- }
129
- let n = o(r, t);
130
- if (S.onCheckedChange?.(e, n), n.isCanceled) {
131
- t.preventDefault();
132
- return;
133
- }
134
- let i = J();
135
- if (U() && H()) {
136
- x?.parent.changeParent(n) || t.preventDefault();
137
- return;
138
- }
139
- if (U() && x && i !== void 0) {
140
- x.parent.changeChild(i, e, n) || t.preventDefault();
141
- return;
142
- }
143
- if (x && i !== void 0 && !H()) {
144
- let r = e ? [...x.getValue(), i] : x.getValue().filter((e) => e !== i);
145
- x.setValue(r, n) || t.preventDefault();
146
- return;
147
- }
148
- N || we(e);
149
- }
150
- function Q() {
151
- let e = F();
152
- e && (e.checked = D(Y), e.indeterminate = D(X));
153
- }
154
- function tt() {
155
- return P() ?? null;
156
- }
157
- function nt(e) {
158
- B(), R = !0;
159
- let t = e.ownerDocument, n = t.defaultView, r, i = n?.setTimeout(a, 1e3);
160
- function a() {
161
- R = !1, t.removeEventListener("keyup", o, !0), n?.removeEventListener("blur", a), r !== void 0 && clearTimeout(r), i !== void 0 && clearTimeout(i), B = () => void 0;
162
- }
163
- function o(e) {
164
- e.key === "Enter" && (r = setTimeout(a, 0));
165
- }
166
- t.addEventListener("keyup", o, !0), n?.addEventListener("blur", a, { once: !0 }), B = a;
167
- }
168
- function $(e) {
169
- z && z !== e && z.id === j && z.removeAttribute("id"), z !== e && (z = void 0);
170
- }
171
- return C(() => ({
172
- explicit: S["aria-labelledby"],
173
- fieldLabel: l.labelId(),
174
- input: F(),
175
- inputId: Me(),
176
- nativeButton: V()
177
- }), (e) => {
178
- function t() {
179
- if (e.explicit || e.fieldLabel || e.nativeButton || !e.input) {
180
- $(), I(void 0);
181
- return;
182
- }
183
- let t = e.input.closest("label") ?? e.input.labels?.[0];
184
- if (!t) {
185
- $(), I(void 0);
186
- return;
187
- }
188
- $(t), t.id || (t.id = j, z = t), I(t.id || void 0);
189
- }
190
- if (t(), e.explicit || e.fieldLabel || e.nativeButton || !e.input || typeof MutationObserver > "u") return;
191
- let n, r = new MutationObserver(() => {
192
- t(), i();
193
- });
194
- function i() {
195
- let t = e.input?.getRootNode();
196
- !t || t === n || (r.disconnect(), n = t, r.observe(t, {
197
- attributes: !0,
198
- attributeFilter: ["for", "id"],
199
- childList: !0,
200
- subtree: !0
201
- }));
202
- }
203
- return i(), () => {
204
- r.disconnect(), $();
205
- };
206
- }), C(() => x, (e) => e?.registerCheckbox(Be)), C(() => ({
207
- group: x,
208
- input: F(),
209
- parent: H()
210
- }), (e) => {
211
- if (!e.input || e.parent) return;
212
- let t = e.group?.fieldControlSource ?? O;
213
- return s.validation.registerInput(t, e.input, tt);
214
- }), C(() => ({
215
- checked: Y(),
216
- group: x,
217
- indeterminate: X(),
218
- input: F(),
219
- name: q()
220
- }), (e) => {
221
- e.input && (e.input.indeterminate = e.indeterminate), e.group || s.setFilled(e.checked), !(e.group || e.checked === Oe) && (Oe = e.checked, D(() => {
222
- ee.clearError(e.name), s.setDirty(e.checked !== s.validityData().initialValue), s.validation.change(e.checked);
223
- }));
224
- }), C(() => ({
225
- disabled: W(),
226
- group: x,
227
- name: S.name,
228
- root: P()
229
- }), (e) => {
230
- Ve.name = e.name, s.registerFieldControl(O, !e.group && !e.disabled && e.root ? Ve : void 0);
231
- }), ue(() => {
232
- x || s.setFilled(Y()), P();
233
- }), le(() => {
234
- B(), $(), s.registerFieldControl(O, void 0);
235
- }), m(pe, {
236
- value: Z,
237
- get children() {
238
- return [
239
- m(Fe, _({
240
- ref: [((e) => Te(e)), S.ref],
241
- get id() {
242
- return Ne();
243
- },
244
- get class() {
245
- return Pe();
246
- },
247
- get style() {
248
- return Ie();
249
- },
250
- get type() {
251
- return V() ? "button" : void 0;
252
- },
253
- role: "checkbox",
254
- get tabIndex() {
255
- return W() ? -1 : 0;
256
- },
257
- get disabled() {
258
- return V() && W() ? !0 : void 0;
259
- },
260
- get "aria-disabled"() {
261
- return !V() && W() ? "true" : void 0;
262
- },
263
- get "aria-checked"() {
264
- return g(() => !!X())() ? "mixed" : Y() ? "true" : "false";
265
- },
266
- get "aria-readonly"() {
267
- return G() ? "true" : void 0;
268
- },
269
- get "aria-required"() {
270
- return K() ? "true" : void 0;
271
- },
272
- get "aria-labelledby"() {
273
- return Re();
274
- },
275
- get "aria-describedby"() {
276
- return ze();
277
- },
278
- get "aria-invalid"() {
279
- return Z().valid === !1 && !W() ? "true" : void 0;
280
- },
281
- get "data-parent"() {
282
- return H() ? "" : void 0;
283
- },
284
- get "aria-controls"() {
285
- return g(() => !!(U() && H()))() ? x?.parent.ariaControls() : void 0;
286
- },
287
- onBlur: Ye,
288
- onClick: qe,
289
- onFocus: Je,
290
- onKeyDown: Xe,
291
- onKeyUp: Ze
292
- }, Le, ke)),
293
- m(se, {
294
- get when() {
295
- return g(() => !!(!Y() && !x && q() && !H()))() ? S.uncheckedValue !== void 0 : !Y() && !x && q() && !H();
296
- },
297
- get children() {
298
- var e = h(ge);
299
- return ie(() => ({
300
- e: S.form,
301
- t: q(),
302
- a: S.uncheckedValue,
303
- o: W()
304
- }), ({ e: t, t: n, a: r, o: i }, a) => {
305
- t !== a?.e && y(e, "form", t), n !== a?.t && y(e, "name", n), oe(e, "value", r), i !== a?.o && y(e, "disabled", i);
306
- }), e;
307
- }
308
- }),
309
- (() => {
310
- var e = h(_e);
311
- return ae(() => [((e) => Ee(e)), S.inputRef], e), b(e, _({
312
- type: "checkbox",
313
- get form() {
314
- return S.form;
315
- },
316
- get id() {
317
- return V() ? void 0 : Me();
318
- },
319
- get name() {
320
- return H() ? void 0 : q();
321
- },
322
- tabindex: -1,
323
- get style() {
324
- return q() ? ye : ve;
325
- },
326
- "aria-hidden": "true",
327
- get "aria-describedby"() {
328
- return ze();
329
- },
330
- get "aria-invalid"() {
331
- return Z().valid === !1 && !W() ? "true" : void 0;
332
- }
333
- }, () => S.value === void 0 ? {} : { value: x && !Y() ? "" : S.value }, {
334
- get disabled() {
335
- return W();
336
- },
337
- get checked() {
338
- return Y();
339
- },
340
- get required() {
341
- return K();
342
- },
343
- onClick: Qe,
344
- onChange: $e,
345
- onFocus: () => P()?.focus({ preventScroll: !0 })
346
- }), !1), v(), e;
347
- })()
348
- ];
349
- }
350
- });
351
- }
352
- function be(e, t) {
353
- let n = e.ownerDocument.defaultView;
354
- if (!n) return;
355
- let r = n.PointerEvent ?? n.MouseEvent;
356
- e.dispatchEvent(new r("click", {
357
- bubbles: !0,
358
- cancelable: !0,
359
- composed: !0,
360
- detail: 0,
361
- shiftKey: t.shiftKey,
362
- ctrlKey: t.ctrlKey,
363
- altKey: t.altKey,
364
- metaKey: t.metaKey
365
- }));
366
- }
367
- function xe(e, t) {
368
- e.defaultPrevented || queueMicrotask(() => {
369
- e.defaultPrevented || A(t)?.click();
370
- });
371
- }
372
- function A(e) {
373
- if (!e) return null;
374
- for (let t of e.elements) if ((t.tagName === "BUTTON" || t.tagName === "INPUT") && t.type === "submit") return t;
375
- return null;
376
- }
377
- //#endregion
378
- //#region src/checkbox/indicator/CheckboxIndicator.tsx
379
- var j = /* @__PURE__ */ x("<span>");
380
- function M(e) {
381
- let r, o = !1, c = me(), l = e, ne = ce(e, "render", "class", "keepMounted", "ref", "style"), u = w(() => c().checked || c().indeterminate), d = te(() => u()), f = w(() => (l.keepMounted ?? !1) || d.mounted()), p = w(() => ({
382
- ...c(),
383
- transitionStatus: d.transitionStatus()
384
- })), re = t(e, () => p(), (e) => (() => {
385
- var t = h(j);
386
- return b(t, e, !1), v(), t;
387
- })()), ie = w(() => f() ? i(e.class, p()) : void 0), g = w(() => f() ? a(e.style, p()) : void 0), ae = w(() => n(p(), {
388
- ...fe(p()),
389
- ...s
390
- }));
391
- return C(() => ({
392
- element: r,
393
- rendered: u(),
394
- status: d.transitionStatus()
395
- }), (e) => {
396
- if (o = e.rendered, e.rendered || e.status !== "ending" || !e.element) return;
397
- let t = new AbortController();
398
- return ee(e.element, () => {
399
- o || d.setMounted(!1);
400
- }, t.signal), () => t.abort();
401
- }), m(se, {
402
- get when() {
403
- return f();
404
- },
405
- get children() {
406
- return m(re, _({
407
- ref: [l.ref, ((e) => r = e)],
408
- get class() {
409
- return ie();
410
- },
411
- get style() {
412
- return g();
413
- }
414
- }, ae, ne));
415
- }
416
- });
417
- }
418
- //#endregion
419
- //#region src/checkbox/index.parts.ts
420
- var Se = /* @__PURE__ */ e({
421
- Indicator: () => M,
422
- Root: () => k
423
- });
424
- //#endregion
425
- export { Se as t };
@@ -1,230 +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, w as i } from "./reasons-Co5CzjKq.js";
5
- import { n as a, t as o } from "./resolveStyle-XcgAuaKR.js";
6
- import { n as s, t as c } from "./createCollapsiblePanel-BQ8r4RTi.js";
7
- import { createChangeEventDetails as l } from "./internals/createBaseUIEventDetails.js";
8
- import { transitionStatusMapping as u } from "./internals/stateAttributesMapping.js";
9
- import { composeEventHandlers as d } from "./internals/composeEventHandlers.js";
10
- import { createComponent as f, getNextElement as p, memo as m, mergeProps as h, runHydrationEvents as g, spread as _, template as v } from "@solidjs/web";
11
- import { Show as y, createContext as b, createEffect as x, createMemo as S, createSignal as C, createUniqueId as w, flush as T, omit as E, onCleanup as D, untrack as O, useContext as k } from "solid-js";
12
- //#region src/collapsible/root/CollapsibleRootContext.ts
13
- var A = Symbol("CollapsibleRootContext"), j = b(A);
14
- function M() {
15
- let e = k(j);
16
- if (e === A) throw Error("Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.");
17
- return e;
18
- }
19
- //#endregion
20
- //#region src/collapsible/root/stateAttributesMapping.ts
21
- var N = { "data-open": "" }, P = { "data-closed": "" }, F = { "data-panel-open": "" }, I = {
22
- open(e) {
23
- return e ? N : P;
24
- },
25
- ...u
26
- }, L = {
27
- open(e) {
28
- return e ? F : null;
29
- },
30
- ...u
31
- }, R = /* @__PURE__ */ v("<div>");
32
- function z(e) {
33
- let r = e, i = e, c = O(() => i.open !== void 0), [u, d] = C(O(() => i.defaultOpen ?? !1)), [m, v] = C(), y = `base-ui-${w()}`, b = E(r, "render", "class", "defaultOpen", "disabled", "onOpenChange", "open", "style"), x = S(() => c ? i.open ?? !1 : u()), D = S(() => i.disabled ?? !1), k = s(() => x()), A = S(() => {
34
- let e = m();
35
- return e === null ? void 0 : e ?? y;
36
- }), M = S(() => ({
37
- disabled: D(),
38
- open: x(),
39
- transitionStatus: k.transitionStatus()
40
- })), N = S(() => a(e.class, M())), P = S(() => o(e.style, M())), F = S(() => n(M(), I));
41
- function L(e, t, n, r) {
42
- let a = l(n, t);
43
- return i.onOpenChange?.(e, a), !a.isCanceled && (r?.(), c || d(e), T(), !0);
44
- }
45
- let z = {
46
- defaultPanelId: y,
47
- disabled: D,
48
- mounted: k.mounted,
49
- open: x,
50
- panelId: A,
51
- requestOpenChange: L,
52
- setMounted: k.setMounted,
53
- setPanelIdState: v,
54
- state: M,
55
- transitionStatus: k.transitionStatus
56
- }, B = t(e, () => M(), (e) => (() => {
57
- var t = p(R);
58
- return _(t, e, !1), g(), t;
59
- })());
60
- return f(j, {
61
- value: z,
62
- get children() {
63
- return f(B, h({
64
- get class() {
65
- return N();
66
- },
67
- get style() {
68
- return P();
69
- }
70
- }, F, b));
71
- }
72
- });
73
- }
74
- //#endregion
75
- //#region src/collapsible/trigger/CollapsibleTrigger.tsx
76
- var B = /* @__PURE__ */ v("<button>");
77
- function V(e) {
78
- let i = M(), s = e, c = E(e, "render", "class", "disabled", "nativeButton", "onClick", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "ref", "style"), l = S(() => e.disabled ?? i.disabled()), u = S(() => e.nativeButton ?? !0), v = i.state, y = S(() => a(e.class, v())), b = S(() => o(e.style, v())), x = S(() => n(v(), L)), C = d(() => O(() => l() ? H : void 0), () => s.onClick, () => (e) => {
79
- i.requestOpenChange(!i.open(), e, r);
80
- }), w = d(() => O(() => l() ? U : void 0), () => s.onMouseDown), T = d(() => O(() => l() ? H : void 0), () => s.onPointerDown), D = d(() => O(() => l() ? W : void 0), () => s.onKeyDown, () => O(() => u() ? void 0 : G)), k = d(() => O(() => l() ? U : void 0), () => s.onKeyUp, () => O(() => u() ? void 0 : K)), A = S(() => u() ? l() ? "true" : "false" : l() ? "true" : void 0), j = S(() => i.open() ? "true" : "false"), N = t(e, () => v(), (e) => (() => {
81
- var t = p(B);
82
- return _(t, e, !1), g(), t;
83
- })());
84
- return f(N, h({
85
- ref: [s.ref],
86
- get class() {
87
- return y();
88
- },
89
- get style() {
90
- return b();
91
- },
92
- get type() {
93
- return u() ? "button" : void 0;
94
- },
95
- get role() {
96
- return u() ? void 0 : "button";
97
- },
98
- get tabIndex() {
99
- return u() ? void 0 : 0;
100
- },
101
- get "aria-controls"() {
102
- return m(() => !!i.open())() ? i.panelId() : void 0;
103
- },
104
- get "aria-disabled"() {
105
- return A();
106
- },
107
- get "aria-expanded"() {
108
- return j();
109
- },
110
- onClick: C,
111
- onKeyDown: D,
112
- onKeyUp: k,
113
- onMouseDown: w,
114
- onPointerDown: T
115
- }, x, c));
116
- }
117
- function H(e) {
118
- e.preventDefault(), e.preventBaseUIHandler();
119
- }
120
- function U(e) {
121
- e.preventBaseUIHandler();
122
- }
123
- function W(e) {
124
- e.key !== "Tab" && e.preventDefault(), e.preventBaseUIHandler();
125
- }
126
- function G(e) {
127
- if (e.target !== e.currentTarget) return;
128
- let t = e.currentTarget.tagName === "A" && !!e.currentTarget.href;
129
- if (t || e.key !== "Enter" && e.key !== " ") {
130
- t && e.key === " " && e.preventDefault();
131
- return;
132
- }
133
- e.defaultPrevented || (e.preventDefault(), e.key === "Enter" && (e.preventBaseUIHandler(), q(e.currentTarget, e)));
134
- }
135
- function K(e) {
136
- e.target === e.currentTarget && !e.defaultPrevented && e.key === " " && (e.preventBaseUIHandler(), q(e.currentTarget, e));
137
- }
138
- function q(e, t) {
139
- let n = e.ownerDocument.defaultView;
140
- if (!n) return;
141
- let r = n.PointerEvent ?? n.MouseEvent;
142
- e.dispatchEvent(new r("click", {
143
- bubbles: !0,
144
- cancelable: !0,
145
- composed: !0,
146
- detail: 0,
147
- shiftKey: t.shiftKey,
148
- ctrlKey: t.ctrlKey,
149
- altKey: t.altKey,
150
- metaKey: t.metaKey
151
- }));
152
- }
153
- //#endregion
154
- //#region src/collapsible/panel/CollapsiblePanel.tsx
155
- var J = /* @__PURE__ */ v("<div>"), Y = "--collapsible-panel-height", X = "--collapsible-panel-width";
156
- function Z(e) {
157
- let r = M(), s = e, l = e, [u, d] = C(), m = S(() => s.id || void 0), v = S(() => m() ?? r.defaultPanelId), b = S(() => s.hiddenUntilFound ?? !1), w = S(() => s.keepMounted ?? !1), T = E(l, "render", "class", "hiddenUntilFound", "id", "keepMounted", "ref", "style"), O = c({
158
- element: u,
159
- hiddenUntilFound: b,
160
- keepMounted: w,
161
- mounted: r.mounted,
162
- open: r.open,
163
- requestBeforeMatchOpen: (e, t) => r.requestOpenChange(!0, e, i, t),
164
- setMounted: r.setMounted,
165
- transitionStatus: r.transitionStatus
166
- }), k = S(() => ({
167
- ...r.state(),
168
- transitionStatus: O.panelTransitionStatus()
169
- })), A = S(() => O.shouldRender() ? a(e.class, k()) : void 0), j = S(() => Q(O.dimensions(), O.shouldRender() ? o(e.style, k()) : void 0, O.shouldPreventOpenAnimation())), N = S(() => {
170
- let e = n(k(), I);
171
- return O.shouldPersistHiddenTransitionStyles() && (e["data-starting-style"] = ""), e;
172
- }), P = S(() => O.hidden() ? !b() || "until-found" : void 0);
173
- x(() => m(), (e) => (r.setPanelIdState((t) => e ?? (t === null ? void 0 : t)), () => {
174
- r.setPanelIdState((t) => t === e ? null : t);
175
- })), x(() => ({
176
- hiddenUntilFound: b(),
177
- keepMounted: s.keepMounted
178
- }), (e) => {
179
- e.hiddenUntilFound && e.keepMounted;
180
- }), D(() => d(void 0));
181
- let F = t(e, () => k(), (e) => (() => {
182
- var t = p(J);
183
- return _(t, e, !1), g(), t;
184
- })());
185
- return f(y, {
186
- get when() {
187
- return O.shouldRender();
188
- },
189
- get children() {
190
- return f(F, h({
191
- ref: [s.ref, (e) => d(e)],
192
- get id() {
193
- return v();
194
- },
195
- get class() {
196
- return A();
197
- },
198
- get style() {
199
- return j();
200
- },
201
- get hidden() {
202
- return P();
203
- }
204
- }, N, T));
205
- }
206
- });
207
- }
208
- function Q(e, t, n) {
209
- let r = e.height === void 0 ? "auto" : `${e.height}px`, i = e.width === void 0 ? "auto" : `${e.width}px`;
210
- return typeof t == "string" ? [
211
- `${Y}:${r}`,
212
- `${X}:${i}`,
213
- t,
214
- n ? "animation-name:none" : ""
215
- ].filter(Boolean).join(";") : {
216
- [Y]: r,
217
- [X]: i,
218
- ...t,
219
- ...n ? { "animation-name": "none" } : {}
220
- };
221
- }
222
- //#endregion
223
- //#region src/collapsible/index.parts.ts
224
- var $ = /* @__PURE__ */ e({
225
- Panel: () => Z,
226
- Root: () => z,
227
- Trigger: () => V
228
- });
229
- //#endregion
230
- export { $ as t };