@rpcbase/ui 0.260.0 → 0.262.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/dist/assets/sha256.worker-BEf4_Y9w.js.map +1 -0
  2. package/dist/components/FilesUploadField/index.d.ts +19 -6
  3. package/dist/components/FilesUploadField/index.d.ts.map +1 -1
  4. package/dist/components/FilesUploadField/sha256.d.ts +5 -0
  5. package/dist/components/FilesUploadField/sha256.d.ts.map +1 -0
  6. package/dist/components/FilesUploadField/sha256.worker.d.ts +4 -0
  7. package/dist/components/FilesUploadField/sha256.worker.d.ts.map +1 -0
  8. package/dist/components/ImagesField/index.d.ts +4 -2
  9. package/dist/components/ImagesField/index.d.ts.map +1 -1
  10. package/dist/index.js +10 -10
  11. package/dist/index298.js +11 -803
  12. package/dist/index298.js.map +1 -1
  13. package/dist/index299.js +865 -28
  14. package/dist/index299.js.map +1 -1
  15. package/dist/index300.js +26 -510
  16. package/dist/index300.js.map +1 -1
  17. package/dist/index301.js +481 -755
  18. package/dist/index301.js.map +1 -1
  19. package/dist/index302.js +786 -7428
  20. package/dist/index302.js.map +1 -1
  21. package/dist/index303.js +7429 -7
  22. package/dist/index303.js.map +1 -1
  23. package/dist/index304.js +6 -12
  24. package/dist/index304.js.map +1 -1
  25. package/dist/index305.js +12 -5
  26. package/dist/index305.js.map +1 -1
  27. package/dist/index306.js +3 -3
  28. package/dist/index306.js.map +1 -1
  29. package/dist/index307.js +5 -469
  30. package/dist/index307.js.map +1 -1
  31. package/dist/index308.js +464 -32
  32. package/dist/index308.js.map +1 -1
  33. package/dist/index309.js +36 -18
  34. package/dist/index309.js.map +1 -1
  35. package/dist/index310.js +17 -28
  36. package/dist/index310.js.map +1 -1
  37. package/dist/index311.js +30 -4
  38. package/dist/index311.js.map +1 -1
  39. package/dist/index312.js +4 -59
  40. package/dist/index312.js.map +1 -1
  41. package/dist/index313.js +59 -9
  42. package/dist/index313.js.map +1 -1
  43. package/dist/index314.js +9 -5
  44. package/dist/index314.js.map +1 -1
  45. package/dist/index315.js +5 -9
  46. package/dist/index315.js.map +1 -1
  47. package/dist/index316.js +9 -12
  48. package/dist/index316.js.map +1 -1
  49. package/dist/index317.js +13 -3
  50. package/dist/index317.js.map +1 -1
  51. package/dist/index318.js +3 -17
  52. package/dist/index318.js.map +1 -1
  53. package/dist/index319.js +14 -23
  54. package/dist/index319.js.map +1 -1
  55. package/dist/index320.js +23 -39
  56. package/dist/index320.js.map +1 -1
  57. package/dist/index321.js +41 -5
  58. package/dist/index321.js.map +1 -1
  59. package/dist/index322.js +5 -25
  60. package/dist/index322.js.map +1 -1
  61. package/dist/index323.js +24 -18
  62. package/dist/index323.js.map +1 -1
  63. package/dist/index324.js +17 -32
  64. package/dist/index324.js.map +1 -1
  65. package/dist/index325.js +34 -5
  66. package/dist/index325.js.map +1 -1
  67. package/dist/index326.js +5 -9
  68. package/dist/index326.js.map +1 -1
  69. package/dist/index327.js +8 -7
  70. package/dist/index327.js.map +1 -1
  71. package/dist/index328.js +8 -9
  72. package/dist/index328.js.map +1 -1
  73. package/dist/index329.js +9 -10
  74. package/dist/index329.js.map +1 -1
  75. package/dist/index330.js +10 -7
  76. package/dist/index330.js.map +1 -1
  77. package/dist/index331.js +7 -75
  78. package/dist/index331.js.map +1 -1
  79. package/dist/index332.js +66 -153
  80. package/dist/index332.js.map +1 -1
  81. package/dist/index333.js +147 -99
  82. package/dist/index333.js.map +1 -1
  83. package/dist/index334.js +113 -13
  84. package/dist/index334.js.map +1 -1
  85. package/dist/index335.js +12 -78
  86. package/dist/index335.js.map +1 -1
  87. package/dist/index336.js +57 -23
  88. package/dist/index336.js.map +1 -1
  89. package/dist/index337.js +45 -12
  90. package/dist/index337.js.map +1 -1
  91. package/dist/index338.js +13 -16
  92. package/dist/index338.js.map +1 -1
  93. package/dist/index339.js +15 -100
  94. package/dist/index339.js.map +1 -1
  95. package/dist/index340.js +95 -50
  96. package/dist/index340.js.map +1 -1
  97. package/dist/index341.js +5 -57
  98. package/dist/index341.js.map +1 -1
  99. package/dist/index342.js +78 -41
  100. package/dist/index342.js.map +1 -1
  101. package/dist/index343.js +58 -100
  102. package/dist/index343.js.map +1 -1
  103. package/dist/index344.js +104 -46
  104. package/dist/index344.js.map +1 -1
  105. package/dist/index345.js +51 -39
  106. package/dist/index345.js.map +1 -1
  107. package/dist/index346.js +42 -142
  108. package/dist/index346.js.map +1 -1
  109. package/dist/index347.js +123 -120
  110. package/dist/index347.js.map +1 -1
  111. package/dist/index348.js +108 -224
  112. package/dist/index348.js.map +1 -1
  113. package/dist/index349.js +174 -158
  114. package/dist/index349.js.map +1 -1
  115. package/dist/index350.js +144 -213
  116. package/dist/index350.js.map +1 -1
  117. package/dist/index351.js +309 -5
  118. package/dist/index351.js.map +1 -1
  119. package/dist/index352.js +5 -6
  120. package/dist/index352.js.map +1 -1
  121. package/dist/index353.js +6 -7
  122. package/dist/index353.js.map +1 -1
  123. package/dist/index354.js +5 -4
  124. package/dist/index354.js.map +1 -1
  125. package/dist/index355.js +4 -4
  126. package/dist/index355.js.map +1 -1
  127. package/dist/index356.js +6 -21
  128. package/dist/index356.js.map +1 -1
  129. package/dist/index357.js +21 -10
  130. package/dist/index357.js.map +1 -1
  131. package/dist/index358.js +10 -128
  132. package/dist/index358.js.map +1 -1
  133. package/dist/index359.js +122 -36
  134. package/dist/index359.js.map +1 -1
  135. package/dist/index360.js +38 -64
  136. package/dist/index360.js.map +1 -1
  137. package/dist/index361.js +66 -115
  138. package/dist/index361.js.map +1 -1
  139. package/dist/index362.js +112 -485
  140. package/dist/index362.js.map +1 -1
  141. package/dist/index363.js +490 -13
  142. package/dist/index363.js.map +1 -1
  143. package/dist/index364.js +13 -4
  144. package/dist/index364.js.map +1 -1
  145. package/dist/index365.js +4 -47
  146. package/dist/index365.js.map +1 -1
  147. package/dist/index366.js +44 -15
  148. package/dist/index366.js.map +1 -1
  149. package/dist/index367.js +19 -5
  150. package/dist/index367.js.map +1 -1
  151. package/dist/index368.js +5 -27
  152. package/dist/index368.js.map +1 -1
  153. package/dist/index369.js +27 -48
  154. package/dist/index369.js.map +1 -1
  155. package/dist/index370.js +46 -27
  156. package/dist/index370.js.map +1 -1
  157. package/dist/index371.js +27 -16
  158. package/dist/index371.js.map +1 -1
  159. package/dist/index372.js +16 -41
  160. package/dist/index372.js.map +1 -1
  161. package/dist/index373.js +42 -14
  162. package/dist/index373.js.map +1 -1
  163. package/dist/index374.js +14 -10
  164. package/dist/index374.js.map +1 -1
  165. package/dist/index375.js +9 -51
  166. package/dist/index375.js.map +1 -1
  167. package/dist/index376.js +53 -43
  168. package/dist/index376.js.map +1 -1
  169. package/dist/index377.js +43 -16
  170. package/dist/index377.js.map +1 -1
  171. package/dist/index378.js +15 -4
  172. package/dist/index378.js.map +1 -1
  173. package/dist/index379.js +4 -4
  174. package/dist/index379.js.map +1 -1
  175. package/dist/index380.js +4 -9
  176. package/dist/index380.js.map +1 -1
  177. package/dist/index381.js +9 -340
  178. package/dist/index381.js.map +1 -1
  179. package/dist/index382.js +339 -4
  180. package/dist/index382.js.map +1 -1
  181. package/dist/index383.js +5 -16
  182. package/dist/index383.js.map +1 -1
  183. package/dist/index384.js +16 -111
  184. package/dist/index384.js.map +1 -1
  185. package/dist/index385.js +109 -19
  186. package/dist/index385.js.map +1 -1
  187. package/dist/index386.js +18 -18
  188. package/dist/index386.js.map +1 -1
  189. package/dist/index387.js +21 -5
  190. package/dist/index387.js.map +1 -1
  191. package/dist/index388.js +5 -20
  192. package/dist/index388.js.map +1 -1
  193. package/dist/index389.js +19 -13
  194. package/dist/index389.js.map +1 -1
  195. package/dist/index390.js +13 -84
  196. package/dist/index390.js.map +1 -1
  197. package/dist/index391.js +84 -7
  198. package/dist/index391.js.map +1 -1
  199. package/dist/index392.js +9 -29
  200. package/dist/index392.js.map +1 -1
  201. package/dist/index393.js +28 -9
  202. package/dist/index393.js.map +1 -1
  203. package/dist/index394.js +9 -5
  204. package/dist/index394.js.map +1 -1
  205. package/dist/index395.js +6 -252
  206. package/dist/index395.js.map +1 -1
  207. package/dist/index396.js +250 -10
  208. package/dist/index396.js.map +1 -1
  209. package/dist/index397.js +11 -10
  210. package/dist/index397.js.map +1 -1
  211. package/dist/index398.js +10 -6
  212. package/dist/index398.js.map +1 -1
  213. package/dist/index399.js +6 -22
  214. package/dist/index399.js.map +1 -1
  215. package/dist/index400.js +21 -21
  216. package/dist/index400.js.map +1 -1
  217. package/dist/index401.js +21 -107
  218. package/dist/index401.js.map +1 -1
  219. package/dist/index402.js +109 -15
  220. package/dist/index402.js.map +1 -1
  221. package/dist/index403.js +15 -12
  222. package/dist/index403.js.map +1 -1
  223. package/dist/index404.js +10 -8
  224. package/dist/index404.js.map +1 -1
  225. package/dist/index405.js +8 -242
  226. package/dist/index405.js.map +1 -1
  227. package/dist/index406.js +238 -25
  228. package/dist/index406.js.map +1 -1
  229. package/dist/index407.js +29 -51
  230. package/dist/index407.js.map +1 -1
  231. package/dist/index408.js +51 -10
  232. package/dist/index408.js.map +1 -1
  233. package/dist/index409.js +11 -128
  234. package/dist/index409.js.map +1 -1
  235. package/dist/index410.js +124 -35
  236. package/dist/index410.js.map +1 -1
  237. package/dist/index411.js +36 -23
  238. package/dist/index411.js.map +1 -1
  239. package/dist/index412.js +26 -11
  240. package/dist/index412.js.map +1 -1
  241. package/dist/index413.js +11 -23
  242. package/dist/index413.js.map +1 -1
  243. package/dist/index414.js +19 -13
  244. package/dist/index414.js.map +1 -1
  245. package/dist/index415.js +14 -13
  246. package/dist/index415.js.map +1 -1
  247. package/dist/index416.js +14 -322
  248. package/dist/index416.js.map +1 -1
  249. package/dist/index417.js +323 -61
  250. package/dist/index417.js.map +1 -1
  251. package/dist/index418.js +63 -4
  252. package/dist/index418.js.map +1 -1
  253. package/dist/index419.js +4 -28
  254. package/dist/index419.js.map +1 -1
  255. package/dist/index420.js +25 -468
  256. package/dist/index420.js.map +1 -1
  257. package/dist/index421.js +452 -250
  258. package/dist/index421.js.map +1 -1
  259. package/dist/index422.js +272 -0
  260. package/dist/index422.js.map +1 -0
  261. package/package.json +2 -1
package/dist/index385.js CHANGED
@@ -1,25 +1,115 @@
1
1
  "use client";
2
- import { useRenderElement as e } from "./index196.js";
3
- import { useStore as t } from "./index260.js";
4
- import { useSelectRootContext as n } from "./index366.js";
5
- import { resolveMultipleLabels as r, resolveSelectedLabel as i } from "./index375.js";
6
- import { selectors as a } from "./index376.js";
7
- import * as o from "react";
8
- //#region ../../node_modules/@base-ui/react/select/value/SelectValue.mjs
9
- var s = { value: () => null }, c = /*#__PURE__*/ o.forwardRef(function(o, c) {
10
- let { className: l, render: u, children: d, placeholder: f, style: p, ...m } = o, { store: h, valueRef: g } = n(), _ = t(h, a.value), v = t(h, a.items), y = t(h, a.itemToStringLabel), b = t(h, a.hasSelectedValue), x = !b && f != null && d == null, S = t(h, a.hasNullItemLabel, x), C = {
11
- value: _,
12
- placeholder: !b
13
- }, w = null;
14
- return w = typeof d == "function" ? d(_) : d ?? (!b && f != null && !S ? f : Array.isArray(_) ? r(_, v, y) : i(_, v, y)), e("span", o, {
15
- state: C,
16
- ref: [c, g],
17
- props: [{ children: w }, m],
18
- stateAttributesMapping: s
2
+ import { mergeProps as e } from "./index195.js";
3
+ import { useRenderElement as t } from "./index196.js";
4
+ import { pressableTriggerOpenStateMapping as n } from "./index198.js";
5
+ import { useStableCallback as r } from "./index202.js";
6
+ import { useButton as i } from "./index207.js";
7
+ import { cancelOpen as ee, none as a } from "./index208.js";
8
+ import { createChangeEventDetails as o } from "./index209.js";
9
+ import { useTimeout as s } from "./index215.js";
10
+ import { contains as c } from "./index223.js";
11
+ import { getFloatingFocusElement as l } from "./index224.js";
12
+ import { useValueAsRef as u } from "./index227.js";
13
+ import { ownerDocument as d } from "./index229.js";
14
+ import { useStore as f } from "./index260.js";
15
+ import { useSelectRootContext as p } from "./index367.js";
16
+ import { fieldValidityMapping as m } from "./index369.js";
17
+ import { useFieldRootContext as te } from "./index370.js";
18
+ import { useLabelableContext as ne } from "./index372.js";
19
+ import { useLabelableId as re } from "./index373.js";
20
+ import { selectors as h } from "./index377.js";
21
+ import { resolveAriaLabelledBy as g } from "./index383.js";
22
+ import { getPseudoElementBounds as ie } from "./index384.js";
23
+ import * as _ from "react";
24
+ //#region ../../node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs
25
+ var v = 2, y = 400, b = {
26
+ ...n,
27
+ ...m,
28
+ popupSide: (e) => e ? { "data-popup-side": e } : null,
29
+ value: () => null
30
+ }, x = /*#__PURE__*/ _.forwardRef(function(n, m) {
31
+ let { render: x, className: ae, id: oe, disabled: S = !1, nativeButton: C = !0, style: se, ...w } = n, { setTouched: T, setFocused: E, validationMode: D, state: O, disabled: k } = te(), { labelId: A } = ne(), { store: j, setOpen: M, selectionRef: N, validation: P, readOnly: F, required: I, alignItemWithTriggerActiveRef: L, disabled: R } = p(), z = k || R || S, B = f(j, h.open), V = f(j, h.mounted), H = f(j, h.value), U = f(j, h.triggerProps), W = f(j, h.positionerElement), G = f(j, h.listElement), K = f(j, h.popupSide), q = f(j, h.id), ce = f(j, h.labelId), le = f(j, h.hasSelectedValue), ue = V && W ? K : null, J = oe ?? q, Y = g(A, ce);
32
+ re({ id: J });
33
+ let de = u(W), X = _.useRef(null), { getButtonProps: fe, buttonRef: pe } = i({
34
+ disabled: z,
35
+ native: C
36
+ }), me = r((e) => {
37
+ j.set("triggerElement", e);
38
+ }), he = s(), Z = s(), Q = s();
39
+ _.useEffect(() => {
40
+ if (B) return Q.start(y, () => {
41
+ N.current.allowUnselectedMouseUp = !0, N.current.allowSelectedMouseUp = !0;
42
+ }), () => {
43
+ Q.clear();
44
+ };
45
+ N.current = {
46
+ allowSelectedMouseUp: !1,
47
+ allowUnselectedMouseUp: !1,
48
+ dragY: 0
49
+ }, Z.clear();
50
+ }, [
51
+ B,
52
+ N,
53
+ Z,
54
+ Q
55
+ ]);
56
+ let ge = e(U, {
57
+ id: J,
58
+ role: "combobox",
59
+ "aria-expanded": B ? "true" : "false",
60
+ "aria-haspopup": "listbox",
61
+ "aria-controls": B ? G?.id ?? l(W)?.id : void 0,
62
+ "aria-labelledby": Y,
63
+ "aria-readonly": F || void 0,
64
+ "aria-required": I || void 0,
65
+ tabIndex: z ? -1 : 0,
66
+ onFocus(e) {
67
+ E(!0), B && L.current && M(!1, o(a, e.nativeEvent)), he.start(0, () => {
68
+ j.set("forceMount", !0);
69
+ });
70
+ },
71
+ onBlur(e) {
72
+ c(W, e.relatedTarget) || (T(!0), E(!1), D === "onBlur" && P.commit(H));
73
+ },
74
+ onMouseDown(e) {
75
+ if (B) return;
76
+ let t = d(e.currentTarget);
77
+ function n(e) {
78
+ if (!X.current) return;
79
+ let t = e.target;
80
+ if (c(X.current, t) || c(de.current, t)) return;
81
+ let n = ie(X.current);
82
+ e.clientX >= n.left - v && e.clientX <= n.right + v && e.clientY >= n.top - v && e.clientY <= n.bottom + v || M(!1, o(ee, e));
83
+ }
84
+ Z.start(0, () => {
85
+ t.addEventListener("mouseup", n, { once: !0 });
86
+ });
87
+ }
88
+ }, w, fe), $ = P.getValidationProps(z, ge);
89
+ $.role = "combobox";
90
+ let _e = {
91
+ ...O,
92
+ open: B,
93
+ disabled: z,
94
+ value: H,
95
+ readOnly: F,
96
+ popupSide: ue,
97
+ placeholder: !le
98
+ };
99
+ return t("button", n, {
100
+ ref: [
101
+ m,
102
+ X,
103
+ pe,
104
+ me
105
+ ],
106
+ state: _e,
107
+ stateAttributesMapping: b,
108
+ props: $
19
109
  });
20
110
  });
21
- process.env.NODE_ENV !== "production" && (c.displayName = "SelectValue");
111
+ process.env.NODE_ENV !== "production" && (x.displayName = "SelectTrigger");
22
112
  //#endregion
23
- export { c as SelectValue };
113
+ export { x as SelectTrigger };
24
114
 
25
115
  //# sourceMappingURL=index385.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index385.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/value/SelectValue.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { resolveMultipleLabels, resolveSelectedLabel } from \"../../internals/resolveValueLabel.mjs\";\nimport { selectors } from \"../store.mjs\";\nconst stateAttributesMapping = {\n value: () => null\n};\n\n/**\n * A text label of the currently selected item.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectValue = /*#__PURE__*/React.forwardRef(function SelectValue(componentProps, forwardedRef) {\n const {\n className,\n render,\n children: childrenProp,\n placeholder,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n valueRef\n } = useSelectRootContext();\n const value = useStore(store, selectors.value);\n const items = useStore(store, selectors.items);\n const itemToStringLabel = useStore(store, selectors.itemToStringLabel);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;\n const hasNullLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);\n const state = {\n value,\n placeholder: !hasSelectedValue\n };\n let children = null;\n if (typeof childrenProp === 'function') {\n children = childrenProp(value);\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (!hasSelectedValue && placeholder != null && !hasNullLabel) {\n children = placeholder;\n } else if (Array.isArray(value)) {\n children = resolveMultipleLabels(value, items, itemToStringLabel);\n } else {\n children = resolveSelectedLabel(value, items, itemToStringLabel);\n }\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, valueRef],\n props: [{\n children\n }, elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectValue.displayName = \"SelectValue\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAQA,IAAM,IAAyB,EAC7B,aAAa,KACf,GAQa,IAA2B,gBAAM,WAAW,SAAqB,GAAgB,GAAc;CAC1G,IAAM,EACJ,cACA,WACA,UAAU,GACV,gBACA,UACA,GAAG,MACD,GACE,EACJ,UACA,gBACE,EAAqB,GACnB,IAAQ,EAAS,GAAO,EAAU,KAAK,GACvC,IAAQ,EAAS,GAAO,EAAU,KAAK,GACvC,IAAoB,EAAS,GAAO,EAAU,iBAAiB,GAC/D,IAAmB,EAAS,GAAO,EAAU,gBAAgB,GAC7D,IAA2B,CAAC,KAAoB,KAAe,QAAQ,KAAgB,MACvF,IAAe,EAAS,GAAO,EAAU,kBAAkB,CAAwB,GACnF,IAAQ;EACZ;EACA,aAAa,CAAC;CAChB,GACI,IAAW;CAoBf,OAnBA,AAGE,IAHE,OAAO,KAAiB,aACf,EAAa,CAAK,IACpB,MAEA,CAAC,KAAoB,KAAe,QAAQ,CAAC,IAC3C,IACF,MAAM,QAAQ,CAAK,IACjB,EAAsB,GAAO,GAAO,CAAiB,IAErD,EAAqB,GAAO,GAAO,CAAiB,IAEjD,EAAiB,QAAQ,GAAgB;EACvD;EACA,KAAK,CAAC,GAAc,CAAQ;EAC5B,OAAO,CAAC,EACN,YACF,GAAG,CAAY;EACf;CACF,CACa;AACf,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAY,cAAc"}
1
+ {"version":3,"file":"index385.js","names":["React","REASONS.none","REASONS.cancelOpen"],"sources":["../../../node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { getPseudoElementBounds } from \"../../utils/getPseudoElementBounds.mjs\";\nimport { contains, getFloatingFocusElement } from \"../../floating-ui-react/utils.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { resolveAriaLabelledBy } from \"../../utils/resolveAriaLabelledBy.mjs\";\nconst BOUNDARY_OFFSET = 2;\nconst SELECTED_DELAY = 400;\nconst stateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n popupSide: side => side ? {\n 'data-popup-side': side\n } : null,\n value: () => null\n};\n\n/**\n * A button that opens the select popup.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectTrigger = /*#__PURE__*/React.forwardRef(function SelectTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n setTouched,\n setFocused,\n validationMode,\n state: fieldState,\n disabled: fieldDisabled\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const {\n store,\n setOpen,\n selectionRef,\n validation,\n readOnly,\n required,\n alignItemWithTriggerActiveRef,\n disabled: selectDisabled\n } = useSelectRootContext();\n const disabled = fieldDisabled || selectDisabled || disabledProp;\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const value = useStore(store, selectors.value);\n const triggerProps = useStore(store, selectors.triggerProps);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const popupSideValue = useStore(store, selectors.popupSide);\n const rootId = useStore(store, selectors.id);\n const selectLabelId = useStore(store, selectors.labelId);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const popupSide = mounted && positionerElement ? popupSideValue : null;\n const id = idProp ?? rootId;\n const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, selectLabelId);\n useLabelableId({\n id\n });\n const positionerRef = useValueAsRef(positionerElement);\n const triggerRef = React.useRef(null);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const setTriggerElement = useStableCallback(element => {\n store.set('triggerElement', element);\n });\n const timeoutFocus = useTimeout();\n const timeoutMouseDown = useTimeout();\n const selectedDelayTimeout = useTimeout();\n React.useEffect(() => {\n if (open) {\n // A mousedown on the trigger can open the popup under the cursor. Keep mouseup selection\n // disabled briefly so releasing over either the selected item or a neighboring item doesn't\n // commit an accidental selection. SelectItem can still opt into unselected mouseup sooner\n // after a real drag over the item.\n selectedDelayTimeout.start(SELECTED_DELAY, () => {\n selectionRef.current.allowUnselectedMouseUp = true;\n selectionRef.current.allowSelectedMouseUp = true;\n });\n return () => {\n selectedDelayTimeout.clear();\n };\n }\n selectionRef.current = {\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false,\n dragY: 0\n };\n timeoutMouseDown.clear();\n return undefined;\n }, [open, selectionRef, timeoutMouseDown, selectedDelayTimeout]);\n const mergedProps = mergeProps(triggerProps, {\n id,\n role: 'combobox',\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': 'listbox',\n 'aria-controls': open ? listElement?.id ?? getFloatingFocusElement(positionerElement)?.id : undefined,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n tabIndex: disabled ? -1 : 0,\n onFocus(event) {\n setFocused(true);\n\n // The popup element shouldn't obscure the focused trigger.\n if (open && alignItemWithTriggerActiveRef.current) {\n setOpen(false, createChangeEventDetails(REASONS.none, event.nativeEvent));\n }\n\n // Saves a re-render on initial click: `forceMount === true` mounts\n // the items before `open === true`. We could sync those cycles better\n // without a timeout, but this is enough for now.\n timeoutFocus.start(0, () => {\n store.set('forceMount', true);\n });\n },\n onBlur(event) {\n // If focus is moving into the popup, don't count it as a blur.\n if (contains(positionerElement, event.relatedTarget)) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n },\n onMouseDown(event) {\n if (open) {\n return;\n }\n const doc = ownerDocument(event.currentTarget);\n function handleMouseUp(mouseEvent) {\n if (!triggerRef.current) {\n return;\n }\n const mouseUpTarget = mouseEvent.target;\n\n // Don't treat the release as an outside press when it lands on the trigger or inside\n // the popup positioner (or their children).\n if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget)) {\n return;\n }\n const bounds = getPseudoElementBounds(triggerRef.current);\n if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) {\n return;\n }\n setOpen(false, createChangeEventDetails(REASONS.cancelOpen, mouseEvent));\n }\n\n // Firefox can fire this upon mousedown\n timeoutMouseDown.start(0, () => {\n doc.addEventListener('mouseup', handleMouseUp, {\n once: true\n });\n });\n }\n }, elementProps, getButtonProps);\n const props = validation.getValidationProps(disabled, mergedProps);\n\n // ensure nested useButton does not overwrite the combobox role:\n // <Toolbar.Button render={<Select.Trigger />} />\n props.role = 'combobox';\n const state = {\n ...fieldState,\n open,\n disabled,\n value,\n readOnly,\n popupSide,\n placeholder: !hasSelectedValue\n };\n return useRenderElement('button', componentProps, {\n ref: [forwardedRef, triggerRef, buttonRef, setTriggerElement],\n state,\n stateAttributesMapping,\n props\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectTrigger.displayName = \"SelectTrigger\";"],"x_google_ignoreList":[0],"mappings":"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"}
package/dist/index386.js CHANGED
@@ -1,25 +1,25 @@
1
1
  "use client";
2
2
  import { useRenderElement as e } from "./index196.js";
3
- import { triggerOpenStateMapping as t } from "./index198.js";
4
- import { useStore as n } from "./index260.js";
5
- import { useSelectRootContext as r } from "./index366.js";
6
- import { selectors as i } from "./index376.js";
7
- import * as a from "react";
8
- //#region ../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs
9
- var o = /*#__PURE__*/ a.forwardRef(function(a, o) {
10
- let { render: s, className: c, style: l, ...u } = a, { store: d } = r();
11
- return e("span", a, {
12
- state: { open: n(d, i.open) },
13
- ref: o,
14
- props: [{
15
- "aria-hidden": !0,
16
- children: "▼"
17
- }, u],
18
- stateAttributesMapping: t
3
+ import { useStore as t } from "./index260.js";
4
+ import { useSelectRootContext as n } from "./index367.js";
5
+ import { resolveMultipleLabels as r, resolveSelectedLabel as i } from "./index376.js";
6
+ import { selectors as a } from "./index377.js";
7
+ import * as o from "react";
8
+ //#region ../../node_modules/@base-ui/react/select/value/SelectValue.mjs
9
+ var s = { value: () => null }, c = /*#__PURE__*/ o.forwardRef(function(o, c) {
10
+ let { className: l, render: u, children: d, placeholder: f, style: p, ...m } = o, { store: h, valueRef: g } = n(), _ = t(h, a.value), v = t(h, a.items), y = t(h, a.itemToStringLabel), b = t(h, a.hasSelectedValue), x = !b && f != null && d == null, S = t(h, a.hasNullItemLabel, x), C = {
11
+ value: _,
12
+ placeholder: !b
13
+ }, w = null;
14
+ return w = typeof d == "function" ? d(_) : d ?? (!b && f != null && !S ? f : Array.isArray(_) ? r(_, v, y) : i(_, v, y)), e("span", o, {
15
+ state: C,
16
+ ref: [c, g],
17
+ props: [{ children: w }, m],
18
+ stateAttributesMapping: s
19
19
  });
20
20
  });
21
- process.env.NODE_ENV !== "production" && (o.displayName = "SelectIcon");
21
+ process.env.NODE_ENV !== "production" && (c.displayName = "SelectValue");
22
22
  //#endregion
23
- export { o as SelectIcon };
23
+ export { c as SelectValue };
24
24
 
25
25
  //# sourceMappingURL=index386.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index386.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * An icon that indicates that the trigger button opens a select popup.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectIcon = /*#__PURE__*/React.forwardRef(function SelectIcon(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useSelectRootContext();\n const open = useStore(store, selectors.open);\n const state = {\n open\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n 'aria-hidden': true,\n children: '▼'\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectIcon.displayName = \"SelectIcon\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAeA,IAAa,IAA0B,gBAAM,WAAW,SAAoB,GAAgB,GAAc;CACxG,IAAM,EACJ,WACA,cACA,UACA,GAAG,MACD,GACE,EACJ,aACE,EAAqB;CAczB,OATgB,EAAiB,QAAQ,GAAgB;EACvD,OAAA,EAHA,MAFW,EAAS,GAAO,EAAU,IAElC,EAGC;EACJ,KAAK;EACL,OAAO,CAAC;GACN,eAAe;GACf,UAAU;EACZ,GAAG,CAAY;EACf,wBAAwB;CAC1B,CACa;AACf,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAW,cAAc"}
1
+ {"version":3,"file":"index386.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/value/SelectValue.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { resolveMultipleLabels, resolveSelectedLabel } from \"../../internals/resolveValueLabel.mjs\";\nimport { selectors } from \"../store.mjs\";\nconst stateAttributesMapping = {\n value: () => null\n};\n\n/**\n * A text label of the currently selected item.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectValue = /*#__PURE__*/React.forwardRef(function SelectValue(componentProps, forwardedRef) {\n const {\n className,\n render,\n children: childrenProp,\n placeholder,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n valueRef\n } = useSelectRootContext();\n const value = useStore(store, selectors.value);\n const items = useStore(store, selectors.items);\n const itemToStringLabel = useStore(store, selectors.itemToStringLabel);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;\n const hasNullLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);\n const state = {\n value,\n placeholder: !hasSelectedValue\n };\n let children = null;\n if (typeof childrenProp === 'function') {\n children = childrenProp(value);\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (!hasSelectedValue && placeholder != null && !hasNullLabel) {\n children = placeholder;\n } else if (Array.isArray(value)) {\n children = resolveMultipleLabels(value, items, itemToStringLabel);\n } else {\n children = resolveSelectedLabel(value, items, itemToStringLabel);\n }\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, valueRef],\n props: [{\n children\n }, elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectValue.displayName = \"SelectValue\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAQA,IAAM,IAAyB,EAC7B,aAAa,KACf,GAQa,IAA2B,gBAAM,WAAW,SAAqB,GAAgB,GAAc;CAC1G,IAAM,EACJ,cACA,WACA,UAAU,GACV,gBACA,UACA,GAAG,MACD,GACE,EACJ,UACA,gBACE,EAAqB,GACnB,IAAQ,EAAS,GAAO,EAAU,KAAK,GACvC,IAAQ,EAAS,GAAO,EAAU,KAAK,GACvC,IAAoB,EAAS,GAAO,EAAU,iBAAiB,GAC/D,IAAmB,EAAS,GAAO,EAAU,gBAAgB,GAC7D,IAA2B,CAAC,KAAoB,KAAe,QAAQ,KAAgB,MACvF,IAAe,EAAS,GAAO,EAAU,kBAAkB,CAAwB,GACnF,IAAQ;EACZ;EACA,aAAa,CAAC;CAChB,GACI,IAAW;CAoBf,OAnBA,AAGE,IAHE,OAAO,KAAiB,aACf,EAAa,CAAK,IACpB,MAEA,CAAC,KAAoB,KAAe,QAAQ,CAAC,IAC3C,IACF,MAAM,QAAQ,CAAK,IACjB,EAAsB,GAAO,GAAO,CAAiB,IAErD,EAAqB,GAAO,GAAO,CAAiB,IAEjD,EAAiB,QAAQ,GAAgB;EACvD;EACA,KAAK,CAAC,GAAc,CAAQ;EAC5B,OAAO,CAAC,EACN,YACF,GAAG,CAAY;EACf;CACF,CACa;AACf,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAY,cAAc"}
package/dist/index387.js CHANGED
@@ -1,9 +1,25 @@
1
1
  "use client";
2
- import * as e from "react";
3
- //#region ../../node_modules/@base-ui/react/select/portal/SelectPortalContext.mjs
4
- var t = /*#__PURE__*/ e.createContext(void 0);
5
- process.env.NODE_ENV !== "production" && (t.displayName = "SelectPortalContext");
2
+ import { useRenderElement as e } from "./index196.js";
3
+ import { triggerOpenStateMapping as t } from "./index198.js";
4
+ import { useStore as n } from "./index260.js";
5
+ import { useSelectRootContext as r } from "./index367.js";
6
+ import { selectors as i } from "./index377.js";
7
+ import * as a from "react";
8
+ //#region ../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs
9
+ var o = /*#__PURE__*/ a.forwardRef(function(a, o) {
10
+ let { render: s, className: c, style: l, ...u } = a, { store: d } = r();
11
+ return e("span", a, {
12
+ state: { open: n(d, i.open) },
13
+ ref: o,
14
+ props: [{
15
+ "aria-hidden": !0,
16
+ children: "▼"
17
+ }, u],
18
+ stateAttributesMapping: t
19
+ });
20
+ });
21
+ process.env.NODE_ENV !== "production" && (o.displayName = "SelectIcon");
6
22
  //#endregion
7
- export { t as SelectPortalContext };
23
+ export { o as SelectIcon };
8
24
 
9
25
  //# sourceMappingURL=index387.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index387.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/portal/SelectPortalContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectPortalContext.displayName = \"SelectPortalContext\";\nexport function useSelectPortalContext() {\n const value = React.useContext(SelectPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Select.Portal> is missing.' : _formatErrorMessage(58));\n }\n return value;\n}"],"x_google_ignoreList":[0],"mappings":";;;AAIA,IAAa,IAAmC,gBAAM,cAAc,KAAA,CAAS;AAC7E,QAAA,IAAA,aAA6B,iBAAc,EAAoB,cAAc"}
1
+ {"version":3,"file":"index387.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * An icon that indicates that the trigger button opens a select popup.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectIcon = /*#__PURE__*/React.forwardRef(function SelectIcon(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useSelectRootContext();\n const open = useStore(store, selectors.open);\n const state = {\n open\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n 'aria-hidden': true,\n children: '▼'\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectIcon.displayName = \"SelectIcon\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAeA,IAAa,IAA0B,gBAAM,WAAW,SAAoB,GAAgB,GAAc;CACxG,IAAM,EACJ,WACA,cACA,UACA,GAAG,MACD,GACE,EACJ,aACE,EAAqB;CAczB,OATgB,EAAiB,QAAQ,GAAgB;EACvD,OAAA,EAHA,MAFW,EAAS,GAAO,EAAU,IAElC,EAGC;EACJ,KAAK;EACL,OAAO,CAAC;GACN,eAAe;GACf,UAAU;EACZ,GAAG,CAAY;EACf,wBAAwB;CAC1B,CACa;AACf,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAW,cAAc"}
package/dist/index388.js CHANGED
@@ -1,24 +1,9 @@
1
1
  "use client";
2
- import { FloatingPortal as e } from "./index240.js";
3
- import { useStore as t } from "./index260.js";
4
- import { useSelectRootContext as n } from "./index366.js";
5
- import { selectors as r } from "./index376.js";
6
- import { SelectPortalContext as i } from "./index387.js";
7
- import * as a from "react";
8
- import { jsx as o } from "react/jsx-runtime";
9
- //#region ../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs
10
- var s = /*#__PURE__*/ a.forwardRef(function(a, s) {
11
- let { store: c } = n(), l = t(c, r.mounted), u = t(c, r.forceMount);
12
- return l || u ? /*#__PURE__*/ o(i.Provider, {
13
- value: !0,
14
- children: /*#__PURE__*/ o(e, {
15
- ref: s,
16
- ...a
17
- })
18
- }) : null;
19
- });
20
- process.env.NODE_ENV !== "production" && (s.displayName = "SelectPortal");
2
+ import * as e from "react";
3
+ //#region ../../node_modules/@base-ui/react/select/portal/SelectPortalContext.mjs
4
+ var t = /*#__PURE__*/ e.createContext(void 0);
5
+ process.env.NODE_ENV !== "production" && (t.displayName = "SelectPortalContext");
21
6
  //#endregion
22
- export { s as SelectPortal };
7
+ export { t as SelectPortalContext };
23
8
 
24
9
  //# sourceMappingURL=index388.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index388.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { SelectPortalContext } from \"./SelectPortalContext.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectPortal = /*#__PURE__*/React.forwardRef(function SelectPortal(portalProps, forwardedRef) {\n const {\n store\n } = useSelectRootContext();\n const mounted = useStore(store, selectors.mounted);\n const forceMount = useStore(store, selectors.forceMount);\n const shouldRender = mounted || forceMount;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(SelectPortalContext.Provider, {\n value: true,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPortal.displayName = \"SelectPortal\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAiBA,IAAa,IAA4B,gBAAM,WAAW,SAAsB,GAAa,GAAc;CACzG,IAAM,EACJ,aACE,EAAqB,GACnB,IAAU,EAAS,GAAO,EAAU,OAAO,GAC3C,IAAa,EAAS,GAAO,EAAU,UAAU;CAKvD,OAJqB,KAAW,IAIZ,gBAAK,EAAoB,UAAU;EACrD,OAAO;EACP,UAAuB,gBAAK,GAAgB;GAC1C,KAAK;GACL,GAAG;EACL,CAAC;CACH,CAAC,IARQ;AASX,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAa,cAAc"}
1
+ {"version":3,"file":"index388.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/portal/SelectPortalContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectPortalContext.displayName = \"SelectPortalContext\";\nexport function useSelectPortalContext() {\n const value = React.useContext(SelectPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Select.Portal> is missing.' : _formatErrorMessage(58));\n }\n return value;\n}"],"x_google_ignoreList":[0],"mappings":";;;AAIA,IAAa,IAAmC,gBAAM,cAAc,KAAA,CAAS;AAC7E,QAAA,IAAA,aAA6B,iBAAc,EAAoB,cAAc"}
package/dist/index389.js CHANGED
@@ -1,18 +1,24 @@
1
1
  "use client";
2
- import * as e from "react";
3
- //#region ../../node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
4
- var t = /*#__PURE__*/ e.createContext({
5
- register: () => {},
6
- unregister: () => {},
7
- subscribeMapChange: () => () => {},
8
- elementsRef: { current: [] },
9
- nextIndexRef: { current: 0 }
2
+ import { FloatingPortal as e } from "./index240.js";
3
+ import { useStore as t } from "./index260.js";
4
+ import { useSelectRootContext as n } from "./index367.js";
5
+ import { selectors as r } from "./index377.js";
6
+ import { SelectPortalContext as i } from "./index388.js";
7
+ import * as a from "react";
8
+ import { jsx as o } from "react/jsx-runtime";
9
+ //#region ../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs
10
+ var s = /*#__PURE__*/ a.forwardRef(function(a, s) {
11
+ let { store: c } = n(), l = t(c, r.mounted), u = t(c, r.forceMount);
12
+ return l || u ? /*#__PURE__*/ o(i.Provider, {
13
+ value: !0,
14
+ children: /*#__PURE__*/ o(e, {
15
+ ref: s,
16
+ ...a
17
+ })
18
+ }) : null;
10
19
  });
11
- process.env.NODE_ENV !== "production" && (t.displayName = "CompositeListContext");
12
- function n() {
13
- return e.useContext(t);
14
- }
20
+ process.env.NODE_ENV !== "production" && (s.displayName = "SelectPortal");
15
21
  //#endregion
16
- export { t as CompositeListContext, n as useCompositeListContext };
22
+ export { s as SelectPortal };
17
23
 
18
24
  //# sourceMappingURL=index389.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index389.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport const CompositeListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n subscribeMapChange: () => {\n return () => {};\n },\n elementsRef: {\n current: []\n },\n nextIndexRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") CompositeListContext.displayName = \"CompositeListContext\";\nexport function useCompositeListContext() {\n return React.useContext(CompositeListContext);\n}"],"x_google_ignoreList":[0],"mappings":";;;AAGA,IAAa,IAAoC,gBAAM,cAAc;CACnE,gBAAgB,CAAC;CACjB,kBAAkB,CAAC;CACnB,gCACe,CAAC;CAEhB,aAAa,EACX,SAAS,CAAC,EACZ;CACA,cAAc,EACZ,SAAS,EACX;AACF,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAqB,cAAc;AAC9E,SAAgB,IAA0B;CACxC,OAAOA,EAAM,WAAW,CAAoB;AAC9C"}
1
+ {"version":3,"file":"index389.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { SelectPortalContext } from \"./SelectPortalContext.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectPortal = /*#__PURE__*/React.forwardRef(function SelectPortal(portalProps, forwardedRef) {\n const {\n store\n } = useSelectRootContext();\n const mounted = useStore(store, selectors.mounted);\n const forceMount = useStore(store, selectors.forceMount);\n const shouldRender = mounted || forceMount;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(SelectPortalContext.Provider, {\n value: true,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPortal.displayName = \"SelectPortal\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAiBA,IAAa,IAA4B,gBAAM,WAAW,SAAsB,GAAa,GAAc;CACzG,IAAM,EACJ,aACE,EAAqB,GACnB,IAAU,EAAS,GAAO,EAAU,OAAO,GAC3C,IAAa,EAAS,GAAO,EAAU,UAAU;CAKvD,OAJqB,KAAW,IAIZ,gBAAK,EAAoB,UAAU;EACrD,OAAO;EACP,UAAuB,gBAAK,GAAgB;GAC1C,KAAK;GACL,GAAG;EACL,CAAC;CACH,CAAC,IARQ;AASX,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAa,cAAc"}
package/dist/index390.js CHANGED
@@ -1,89 +1,18 @@
1
1
  "use client";
2
- import { useRefWithInit as e } from "./index185.js";
3
- import { useStableCallback as t } from "./index202.js";
4
- import { useIsoLayoutEffect as n } from "./index204.js";
5
- import { CompositeListContext as r } from "./index389.js";
6
- import * as i from "react";
7
- import { jsx as a } from "react/jsx-runtime";
8
- //#region ../../node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
9
- function o(o) {
10
- let { children: u, elementsRef: d, labelsRef: f, onMapChange: p } = o, m = t(p), h = i.useRef(0), g = e(c).current, _ = e(s).current, [v, y] = i.useState(0), b = i.useRef(v), x = t((e, t) => {
11
- _.set(e, t ?? null), b.current += 1, y(b.current);
12
- }), S = t((e) => {
13
- _.delete(e), b.current += 1, y(b.current);
14
- }), C = i.useMemo(() => {
15
- let e = /* @__PURE__ */ new Map();
16
- return Array.from(_.keys()).filter((e) => e.isConnected).sort(l).forEach((t, n) => {
17
- let r = _.get(t) ?? {};
18
- e.set(t, {
19
- ...r,
20
- index: n
21
- });
22
- }), e;
23
- }, [_, v]);
24
- n(() => {
25
- if (typeof MutationObserver != "function" || C.size === 0) return;
26
- let e = new MutationObserver((e) => {
27
- let t = /* @__PURE__ */ new Set(), n = (e) => t.has(e) ? t.delete(e) : t.add(e);
28
- e.forEach((e) => {
29
- e.removedNodes.forEach(n), e.addedNodes.forEach(n);
30
- }), t.size === 0 && (b.current += 1, y(b.current));
31
- });
32
- return C.forEach((t, n) => {
33
- n.parentElement && e.observe(n.parentElement, { childList: !0 });
34
- }), () => {
35
- e.disconnect();
36
- };
37
- }, [C]), n(() => {
38
- b.current === v && (d.current.length !== C.size && (d.current.length = C.size), f && f.current.length !== C.size && (f.current.length = C.size), h.current = C.size), m(C);
39
- }, [
40
- m,
41
- C,
42
- d,
43
- f,
44
- v
45
- ]), n(() => () => {
46
- d.current = [];
47
- }, [d]), n(() => () => {
48
- f && (f.current = []);
49
- }, [f]);
50
- let w = t((e) => (g.add(e), () => {
51
- g.delete(e);
52
- }));
53
- n(() => {
54
- g.forEach((e) => e(C));
55
- }, [g, C]);
56
- let T = i.useMemo(() => ({
57
- register: x,
58
- unregister: S,
59
- subscribeMapChange: w,
60
- elementsRef: d,
61
- labelsRef: f,
62
- nextIndexRef: h
63
- }), [
64
- x,
65
- S,
66
- w,
67
- d,
68
- f,
69
- h
70
- ]);
71
- return /*#__PURE__*/ a(r.Provider, {
72
- value: T,
73
- children: u
74
- });
75
- }
76
- function s() {
77
- return /* @__PURE__ */ new Map();
78
- }
79
- function c() {
80
- return /* @__PURE__ */ new Set();
81
- }
82
- function l(e, t) {
83
- let n = e.compareDocumentPosition(t);
84
- return n & Node.DOCUMENT_POSITION_FOLLOWING || n & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING || n & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
2
+ import * as e from "react";
3
+ //#region ../../node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
4
+ var t = /*#__PURE__*/ e.createContext({
5
+ register: () => {},
6
+ unregister: () => {},
7
+ subscribeMapChange: () => () => {},
8
+ elementsRef: { current: [] },
9
+ nextIndexRef: { current: 0 }
10
+ });
11
+ process.env.NODE_ENV !== "production" && (t.displayName = "CompositeListContext");
12
+ function n() {
13
+ return e.useContext(t);
85
14
  }
86
15
  //#endregion
87
- export { o as CompositeList };
16
+ export { t as CompositeListContext, n as useCompositeListContext };
88
17
 
89
18
  //# sourceMappingURL=index390.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index390.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs"],"sourcesContent":["/* eslint-disable no-bitwise */\n'use client';\n\nimport * as React from 'react';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { CompositeListContext } from \"./CompositeListContext.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Provides context for a list of items in a composite component.\n * @internal\n */\nexport function CompositeList(props) {\n const {\n children,\n elementsRef,\n labelsRef,\n onMapChange: onMapChangeProp\n } = props;\n const onMapChange = useStableCallback(onMapChangeProp);\n const nextIndexRef = React.useRef(0);\n const listeners = useRefWithInit(createListeners).current;\n\n // We use a stable `map` to avoid O(n^2) re-allocation costs for large lists.\n // `mapTick` is our re-render trigger mechanism. We also need to update the\n // elements and label refs, but there's a lot of async work going on and sometimes\n // the effect that handles `onMapChange` gets called after those refs have been\n // filled, and we don't want to lose those values by setting their lengths to `0`.\n // We also need to have them at the proper length because floating-ui uses that\n // information for list navigation.\n\n const map = useRefWithInit(createMap).current;\n // `mapTick` uses a counter rather than objects for low precision-loss risk and better memory efficiency\n const [mapTick, setMapTick] = React.useState(0);\n const lastTickRef = React.useRef(mapTick);\n const register = useStableCallback((node, metadata) => {\n map.set(node, metadata ?? null);\n lastTickRef.current += 1;\n setMapTick(lastTickRef.current);\n });\n const unregister = useStableCallback(node => {\n map.delete(node);\n lastTickRef.current += 1;\n setMapTick(lastTickRef.current);\n });\n const sortedMap = React.useMemo(() => {\n // `mapTick` is the `useMemo` trigger as `map` is stable.\n disableEslintWarning(mapTick);\n const newMap = new Map();\n // Filter out disconnected elements before sorting to avoid inconsistent\n // compareDocumentPosition results when elements are detached from the DOM.\n const sortedNodes = Array.from(map.keys()).filter(node => node.isConnected).sort(sortByDocumentPosition);\n sortedNodes.forEach((node, index) => {\n const metadata = map.get(node) ?? {};\n newMap.set(node, {\n ...metadata,\n index\n });\n });\n return newMap;\n }, [map, mapTick]);\n useIsoLayoutEffect(() => {\n if (typeof MutationObserver !== 'function' || sortedMap.size === 0) {\n return undefined;\n }\n const mutationObserver = new MutationObserver(entries => {\n const diff = new Set();\n const updateDiff = node => diff.has(node) ? diff.delete(node) : diff.add(node);\n entries.forEach(entry => {\n entry.removedNodes.forEach(updateDiff);\n entry.addedNodes.forEach(updateDiff);\n });\n if (diff.size === 0) {\n lastTickRef.current += 1;\n setMapTick(lastTickRef.current);\n }\n });\n sortedMap.forEach((_, node) => {\n if (node.parentElement) {\n mutationObserver.observe(node.parentElement, {\n childList: true\n });\n }\n });\n return () => {\n mutationObserver.disconnect();\n };\n }, [sortedMap]);\n useIsoLayoutEffect(() => {\n const shouldUpdateLengths = lastTickRef.current === mapTick;\n if (shouldUpdateLengths) {\n if (elementsRef.current.length !== sortedMap.size) {\n elementsRef.current.length = sortedMap.size;\n }\n if (labelsRef && labelsRef.current.length !== sortedMap.size) {\n labelsRef.current.length = sortedMap.size;\n }\n nextIndexRef.current = sortedMap.size;\n }\n onMapChange(sortedMap);\n }, [onMapChange, sortedMap, elementsRef, labelsRef, mapTick]);\n useIsoLayoutEffect(() => {\n return () => {\n elementsRef.current = [];\n };\n }, [elementsRef]);\n useIsoLayoutEffect(() => {\n return () => {\n if (labelsRef) {\n labelsRef.current = [];\n }\n };\n }, [labelsRef]);\n const subscribeMapChange = useStableCallback(fn => {\n listeners.add(fn);\n return () => {\n listeners.delete(fn);\n };\n });\n useIsoLayoutEffect(() => {\n listeners.forEach(l => l(sortedMap));\n }, [listeners, sortedMap]);\n const contextValue = React.useMemo(() => ({\n register,\n unregister,\n subscribeMapChange,\n elementsRef,\n labelsRef,\n nextIndexRef\n }), [register, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef]);\n return /*#__PURE__*/_jsx(CompositeListContext.Provider, {\n value: contextValue,\n children: children\n });\n}\nfunction createMap() {\n return new Map();\n}\nfunction createListeners() {\n return new Set();\n}\nfunction sortByDocumentPosition(a, b) {\n const position = a.compareDocumentPosition(b);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return -1;\n }\n if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {\n return 1;\n }\n return 0;\n}\nfunction disableEslintWarning(_) {}"],"x_google_ignoreList":[0],"mappings":"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"}
1
+ {"version":3,"file":"index390.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport const CompositeListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n subscribeMapChange: () => {\n return () => {};\n },\n elementsRef: {\n current: []\n },\n nextIndexRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") CompositeListContext.displayName = \"CompositeListContext\";\nexport function useCompositeListContext() {\n return React.useContext(CompositeListContext);\n}"],"x_google_ignoreList":[0],"mappings":";;;AAGA,IAAa,IAAoC,gBAAM,cAAc;CACnE,gBAAgB,CAAC;CACjB,kBAAkB,CAAC;CACnB,gCACe,CAAC;CAEhB,aAAa,EACX,SAAS,CAAC,EACZ;CACA,cAAc,EACZ,SAAS,EACX;AACF,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAqB,cAAc;AAC9E,SAAgB,IAA0B;CACxC,OAAOA,EAAM,WAAW,CAAoB;AAC9C"}
package/dist/index391.js CHANGED
@@ -1,12 +1,89 @@
1
1
  "use client";
2
- import * as e from "react";
3
- //#region ../../node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
4
- var t = /*#__PURE__*/ e.createContext(void 0);
5
- process.env.NODE_ENV !== "production" && (t.displayName = "DirectionContext");
6
- function n() {
7
- return e.useContext(t)?.direction ?? "ltr";
2
+ import { useRefWithInit as e } from "./index185.js";
3
+ import { useStableCallback as t } from "./index202.js";
4
+ import { useIsoLayoutEffect as n } from "./index204.js";
5
+ import { CompositeListContext as r } from "./index390.js";
6
+ import * as i from "react";
7
+ import { jsx as a } from "react/jsx-runtime";
8
+ //#region ../../node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
9
+ function o(o) {
10
+ let { children: u, elementsRef: d, labelsRef: f, onMapChange: p } = o, m = t(p), h = i.useRef(0), g = e(c).current, _ = e(s).current, [v, y] = i.useState(0), b = i.useRef(v), x = t((e, t) => {
11
+ _.set(e, t ?? null), b.current += 1, y(b.current);
12
+ }), S = t((e) => {
13
+ _.delete(e), b.current += 1, y(b.current);
14
+ }), C = i.useMemo(() => {
15
+ let e = /* @__PURE__ */ new Map();
16
+ return Array.from(_.keys()).filter((e) => e.isConnected).sort(l).forEach((t, n) => {
17
+ let r = _.get(t) ?? {};
18
+ e.set(t, {
19
+ ...r,
20
+ index: n
21
+ });
22
+ }), e;
23
+ }, [_, v]);
24
+ n(() => {
25
+ if (typeof MutationObserver != "function" || C.size === 0) return;
26
+ let e = new MutationObserver((e) => {
27
+ let t = /* @__PURE__ */ new Set(), n = (e) => t.has(e) ? t.delete(e) : t.add(e);
28
+ e.forEach((e) => {
29
+ e.removedNodes.forEach(n), e.addedNodes.forEach(n);
30
+ }), t.size === 0 && (b.current += 1, y(b.current));
31
+ });
32
+ return C.forEach((t, n) => {
33
+ n.parentElement && e.observe(n.parentElement, { childList: !0 });
34
+ }), () => {
35
+ e.disconnect();
36
+ };
37
+ }, [C]), n(() => {
38
+ b.current === v && (d.current.length !== C.size && (d.current.length = C.size), f && f.current.length !== C.size && (f.current.length = C.size), h.current = C.size), m(C);
39
+ }, [
40
+ m,
41
+ C,
42
+ d,
43
+ f,
44
+ v
45
+ ]), n(() => () => {
46
+ d.current = [];
47
+ }, [d]), n(() => () => {
48
+ f && (f.current = []);
49
+ }, [f]);
50
+ let w = t((e) => (g.add(e), () => {
51
+ g.delete(e);
52
+ }));
53
+ n(() => {
54
+ g.forEach((e) => e(C));
55
+ }, [g, C]);
56
+ let T = i.useMemo(() => ({
57
+ register: x,
58
+ unregister: S,
59
+ subscribeMapChange: w,
60
+ elementsRef: d,
61
+ labelsRef: f,
62
+ nextIndexRef: h
63
+ }), [
64
+ x,
65
+ S,
66
+ w,
67
+ d,
68
+ f,
69
+ h
70
+ ]);
71
+ return /*#__PURE__*/ a(r.Provider, {
72
+ value: T,
73
+ children: u
74
+ });
75
+ }
76
+ function s() {
77
+ return /* @__PURE__ */ new Map();
78
+ }
79
+ function c() {
80
+ return /* @__PURE__ */ new Set();
81
+ }
82
+ function l(e, t) {
83
+ let n = e.compareDocumentPosition(t);
84
+ return n & Node.DOCUMENT_POSITION_FOLLOWING || n & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING || n & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
8
85
  }
9
86
  //#endregion
10
- export { t as DirectionContext, n as useDirection };
87
+ export { o as CompositeList };
11
88
 
12
89
  //# sourceMappingURL=index391.js.map