@rpcbase/ui 0.261.0 → 0.263.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
@@ -1 +1 @@
1
- {"version":3,"file":"index372.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { NOOP } from \"../noop.mjs\";\nimport { useBaseUiId } from \"../useBaseUiId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabelableId(params = {}) {\n const {\n id,\n implicit = false,\n controlRef\n } = params;\n const {\n controlId,\n registerControlId\n } = useLabelableContext();\n const defaultId = useBaseUiId(id);\n const controlIdForEffect = implicit ? controlId : undefined;\n const controlSourceRef = useRefWithInit(() => Symbol('labelable-control'));\n const hasRegisteredRef = React.useRef(false);\n const hadExplicitIdRef = React.useRef(id != null);\n const unregisterControlId = useStableCallback(() => {\n if (!hasRegisteredRef.current || registerControlId === NOOP) {\n return;\n }\n hasRegisteredRef.current = false;\n registerControlId(controlSourceRef.current, undefined);\n });\n useIsoLayoutEffect(() => {\n if (registerControlId === NOOP) {\n return undefined;\n }\n let nextId;\n if (implicit) {\n const elem = controlRef?.current;\n if (isElement(elem) && elem.closest('label') != null) {\n nextId = id ?? null;\n } else {\n nextId = controlIdForEffect ?? defaultId;\n }\n } else if (id != null) {\n hadExplicitIdRef.current = true;\n nextId = id;\n } else if (hadExplicitIdRef.current) {\n nextId = defaultId;\n } else {\n unregisterControlId();\n return undefined;\n }\n if (nextId === undefined) {\n unregisterControlId();\n return undefined;\n }\n hasRegisteredRef.current = true;\n registerControlId(controlSourceRef.current, nextId);\n return undefined;\n }, [id, controlRef, controlIdForEffect, registerControlId, implicit, defaultId, controlSourceRef, unregisterControlId]);\n React.useEffect(() => {\n return unregisterControlId;\n }, [unregisterControlId]);\n return controlId ?? defaultId;\n}"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAUA,SAAgB,EAAe,IAAS,CAAC,GAAG;CAC1C,IAAM,EACJ,OACA,cAAW,IACX,kBACE,GACE,EACJ,cACA,yBACE,EAAoB,GAClB,IAAY,EAAY,CAAE,GAC1B,IAAqB,IAAW,IAAY,KAAA,GAC5C,IAAmB,QAAqB,OAAO,mBAAmB,CAAC,GACnE,IAAmBA,EAAM,OAAO,EAAK,GACrC,IAAmBA,EAAM,OAAO,KAAM,IAAI,GAC1C,IAAsB,QAAwB;EAC9C,CAAC,EAAiB,WAAW,MAAsB,MAGvD,EAAiB,UAAU,IAC3B,EAAkB,EAAiB,SAAS,KAAA,CAAS;CACvD,CAAC;CAiCD,OAhCA,QAAyB;EACvB,IAAI,MAAsB,GACxB;EAEF,IAAI;EACJ,IAAI,GAAU;GACZ,IAAM,IAAO,GAAY;GACzB,AAGE,IAHE,EAAU,CAAI,KAAK,EAAK,QAAQ,OAAO,KAAK,OACrC,KAAM,OAEN,KAAsB;EAEnC,OAAO,IAAI,KAAM,MAEf,AADA,EAAiB,UAAU,IAC3B,IAAS;OACJ,IAAI,EAAiB,SAC1B,IAAS;OACJ;GACL,EAAoB;GACpB;EACF;EACA,IAAI,MAAW,KAAA,GAAW;GACxB,EAAoB;GACpB;EACF;EAEA,AADA,EAAiB,UAAU,IAC3B,EAAkB,EAAiB,SAAS,CAAM;CAEpD,GAAG;EAAC;EAAI;EAAY;EAAoB;EAAmB;EAAU;EAAW;EAAkB;CAAmB,CAAC,GACtH,EAAM,gBACG,GACN,CAAC,CAAmB,CAAC,GACjB,KAAa;AACtB"}
1
+ {"version":3,"file":"index372.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\n/**\n * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\\\n * with an accessible name (label) and description.\n */\nexport const LabelableContext = /*#__PURE__*/React.createContext({\n controlId: undefined,\n registerControlId: NOOP,\n labelId: undefined,\n setLabelId: NOOP,\n messageIds: [],\n setMessageIds: NOOP,\n getDescriptionProps: externalProps => externalProps\n});\nif (process.env.NODE_ENV !== \"production\") LabelableContext.displayName = \"LabelableContext\";\nexport function useLabelableContext() {\n return React.useContext(LabelableContext);\n}"],"x_google_ignoreList":[0],"mappings":";;;;AAQA,IAAa,IAAgC,gBAAM,cAAc;CAC/D,WAAW,KAAA;CACX,mBAAmB;CACnB,SAAS,KAAA;CACT,YAAY;CACZ,YAAY,CAAC;CACb,eAAe;CACf,sBAAqB,MAAiB;AACxC,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAiB,cAAc;AAC1E,SAAgB,IAAsB;CACpC,OAAOA,EAAM,WAAW,CAAgB;AAC1C"}
package/dist/index373.js CHANGED
@@ -1,18 +1,46 @@
1
- //#region ../../node_modules/@base-ui/react/internals/itemEquality.mjs
2
- var e = (e, t) => Object.is(e, t);
3
- function t(e, t, n) {
4
- return e == null || t == null ? Object.is(e, t) : n(e, t);
5
- }
6
- function n(e, n, r) {
7
- return !e || e.length === 0 ? !1 : e.some((e) => e !== void 0 && t(n, e, r));
8
- }
9
- function r(e, n, r) {
10
- return !e || e.length === 0 ? -1 : e.findIndex((e) => e !== void 0 && t(e, n, r));
11
- }
12
- function i(e, n, r) {
13
- return e.filter((e) => !t(n, e, r));
1
+ "use client";
2
+ import { useRefWithInit as e } from "./index185.js";
3
+ import { NOOP as t } from "./index191.js";
4
+ import { isElement as n } from "./index200.js";
5
+ import { useStableCallback as r } from "./index202.js";
6
+ import { useIsoLayoutEffect as i } from "./index204.js";
7
+ import { useBaseUiId as a } from "./index212.js";
8
+ import { useLabelableContext as o } from "./index372.js";
9
+ import * as s from "react";
10
+ //#region ../../node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
11
+ function c(c = {}) {
12
+ let { id: l, implicit: u = !1, controlRef: d } = c, { controlId: f, registerControlId: p } = o(), m = a(l), h = u ? f : void 0, g = e(() => Symbol("labelable-control")), _ = s.useRef(!1), v = s.useRef(l != null), y = r(() => {
13
+ !_.current || p === t || (_.current = !1, p(g.current, void 0));
14
+ });
15
+ return i(() => {
16
+ if (p === t) return;
17
+ let e;
18
+ if (u) {
19
+ let t = d?.current;
20
+ e = n(t) && t.closest("label") != null ? l ?? null : h ?? m;
21
+ } else if (l != null) v.current = !0, e = l;
22
+ else if (v.current) e = m;
23
+ else {
24
+ y();
25
+ return;
26
+ }
27
+ if (e === void 0) {
28
+ y();
29
+ return;
30
+ }
31
+ _.current = !0, p(g.current, e);
32
+ }, [
33
+ l,
34
+ d,
35
+ h,
36
+ p,
37
+ u,
38
+ m,
39
+ g,
40
+ y
41
+ ]), s.useEffect(() => y, [y]), f ?? m;
14
42
  }
15
43
  //#endregion
16
- export { t as compareItemEquality, e as defaultItemEquality, r as findItemIndex, i as removeItem, n as selectedValueIncludes };
44
+ export { c as useLabelableId };
17
45
 
18
46
  //# sourceMappingURL=index373.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index373.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/itemEquality.mjs"],"sourcesContent":["export const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);\nexport function compareItemEquality(itemValue, selectedValue, comparer) {\n if (itemValue == null || selectedValue == null) {\n return Object.is(itemValue, selectedValue);\n }\n return comparer(itemValue, selectedValue);\n}\nexport function selectedValueIncludes(selectedValues, itemValue, comparer) {\n if (!selectedValues || selectedValues.length === 0) {\n return false;\n }\n return selectedValues.some(selectedValue => {\n if (selectedValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function findItemIndex(itemValues, selectedValue, comparer) {\n if (!itemValues || itemValues.length === 0) {\n return -1;\n }\n return itemValues.findIndex(itemValue => {\n if (itemValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function removeItem(selectedValues, itemValue, comparer) {\n return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));\n}"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAa,KAAuB,GAAW,MAAkB,OAAO,GAAG,GAAW,CAAa;AACnG,SAAgB,EAAoB,GAAW,GAAe,GAAU;CAItE,OAHI,KAAa,QAAQ,KAAiB,OACjC,OAAO,GAAG,GAAW,CAAa,IAEpC,EAAS,GAAW,CAAa;AAC1C;AACA,SAAgB,EAAsB,GAAgB,GAAW,GAAU;CAIzE,OAHI,CAAC,KAAkB,EAAe,WAAW,IACxC,KAEF,EAAe,MAAK,MACrB,MAAkB,KAAA,KAGf,EAAoB,GAAW,GAAe,CAAQ,CAC9D;AACH;AACA,SAAgB,EAAc,GAAY,GAAe,GAAU;CAIjE,OAHI,CAAC,KAAc,EAAW,WAAW,IAChC,KAEF,EAAW,WAAU,MACtB,MAAc,KAAA,KAGX,EAAoB,GAAW,GAAe,CAAQ,CAC9D;AACH;AACA,SAAgB,EAAW,GAAgB,GAAW,GAAU;CAC9D,OAAO,EAAe,QAAO,MAAiB,CAAC,EAAoB,GAAW,GAAe,CAAQ,CAAC;AACxG"}
1
+ {"version":3,"file":"index373.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { NOOP } from \"../noop.mjs\";\nimport { useBaseUiId } from \"../useBaseUiId.mjs\";\nimport { useLabelableContext } from \"./LabelableContext.mjs\";\nexport function useLabelableId(params = {}) {\n const {\n id,\n implicit = false,\n controlRef\n } = params;\n const {\n controlId,\n registerControlId\n } = useLabelableContext();\n const defaultId = useBaseUiId(id);\n const controlIdForEffect = implicit ? controlId : undefined;\n const controlSourceRef = useRefWithInit(() => Symbol('labelable-control'));\n const hasRegisteredRef = React.useRef(false);\n const hadExplicitIdRef = React.useRef(id != null);\n const unregisterControlId = useStableCallback(() => {\n if (!hasRegisteredRef.current || registerControlId === NOOP) {\n return;\n }\n hasRegisteredRef.current = false;\n registerControlId(controlSourceRef.current, undefined);\n });\n useIsoLayoutEffect(() => {\n if (registerControlId === NOOP) {\n return undefined;\n }\n let nextId;\n if (implicit) {\n const elem = controlRef?.current;\n if (isElement(elem) && elem.closest('label') != null) {\n nextId = id ?? null;\n } else {\n nextId = controlIdForEffect ?? defaultId;\n }\n } else if (id != null) {\n hadExplicitIdRef.current = true;\n nextId = id;\n } else if (hadExplicitIdRef.current) {\n nextId = defaultId;\n } else {\n unregisterControlId();\n return undefined;\n }\n if (nextId === undefined) {\n unregisterControlId();\n return undefined;\n }\n hasRegisteredRef.current = true;\n registerControlId(controlSourceRef.current, nextId);\n return undefined;\n }, [id, controlRef, controlIdForEffect, registerControlId, implicit, defaultId, controlSourceRef, unregisterControlId]);\n React.useEffect(() => {\n return unregisterControlId;\n }, [unregisterControlId]);\n return controlId ?? defaultId;\n}"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AAUA,SAAgB,EAAe,IAAS,CAAC,GAAG;CAC1C,IAAM,EACJ,OACA,cAAW,IACX,kBACE,GACE,EACJ,cACA,yBACE,EAAoB,GAClB,IAAY,EAAY,CAAE,GAC1B,IAAqB,IAAW,IAAY,KAAA,GAC5C,IAAmB,QAAqB,OAAO,mBAAmB,CAAC,GACnE,IAAmBA,EAAM,OAAO,EAAK,GACrC,IAAmBA,EAAM,OAAO,KAAM,IAAI,GAC1C,IAAsB,QAAwB;EAC9C,CAAC,EAAiB,WAAW,MAAsB,MAGvD,EAAiB,UAAU,IAC3B,EAAkB,EAAiB,SAAS,KAAA,CAAS;CACvD,CAAC;CAiCD,OAhCA,QAAyB;EACvB,IAAI,MAAsB,GACxB;EAEF,IAAI;EACJ,IAAI,GAAU;GACZ,IAAM,IAAO,GAAY;GACzB,AAGE,IAHE,EAAU,CAAI,KAAK,EAAK,QAAQ,OAAO,KAAK,OACrC,KAAM,OAEN,KAAsB;EAEnC,OAAO,IAAI,KAAM,MAEf,AADA,EAAiB,UAAU,IAC3B,IAAS;OACJ,IAAI,EAAiB,SAC1B,IAAS;OACJ;GACL,EAAoB;GACpB;EACF;EACA,IAAI,MAAW,KAAA,GAAW;GACxB,EAAoB;GACpB;EACF;EAEA,AADA,EAAiB,UAAU,IAC3B,EAAkB,EAAiB,SAAS,CAAM;CAEpD,GAAG;EAAC;EAAI;EAAY;EAAoB;EAAmB;EAAU;EAAW;EAAkB;CAAmB,CAAC,GACtH,EAAM,gBACG,GACN,CAAC,CAAmB,CAAC,GACjB,KAAa;AACtB"}
package/dist/index374.js CHANGED
@@ -1,14 +1,18 @@
1
- //#region ../../node_modules/@base-ui/react/internals/serializeValue.mjs
2
- function e(e) {
3
- if (e == null) return "";
4
- if (typeof e == "string") return e;
5
- try {
6
- return JSON.stringify(e);
7
- } catch {
8
- return String(e);
9
- }
1
+ //#region ../../node_modules/@base-ui/react/internals/itemEquality.mjs
2
+ var e = (e, t) => Object.is(e, t);
3
+ function t(e, t, n) {
4
+ return e == null || t == null ? Object.is(e, t) : n(e, t);
5
+ }
6
+ function n(e, n, r) {
7
+ return !e || e.length === 0 ? !1 : e.some((e) => e !== void 0 && t(n, e, r));
8
+ }
9
+ function r(e, n, r) {
10
+ return !e || e.length === 0 ? -1 : e.findIndex((e) => e !== void 0 && t(e, n, r));
11
+ }
12
+ function i(e, n, r) {
13
+ return e.filter((e) => !t(n, e, r));
10
14
  }
11
15
  //#endregion
12
- export { e as serializeValue };
16
+ export { t as compareItemEquality, e as defaultItemEquality, r as findItemIndex, i as removeItem, n as selectedValueIncludes };
13
17
 
14
18
  //# sourceMappingURL=index374.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index374.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/serializeValue.mjs"],"sourcesContent":["export function serializeValue(value) {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,EAAe,GAAO;CACpC,IAAI,KAAS,MACX,OAAO;CAET,IAAI,OAAO,KAAU,UACnB,OAAO;CAET,IAAI;EACF,OAAO,KAAK,UAAU,CAAK;CAC7B,QAAQ;EACN,OAAO,OAAO,CAAK;CACrB;AACF"}
1
+ {"version":3,"file":"index374.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/itemEquality.mjs"],"sourcesContent":["export const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);\nexport function compareItemEquality(itemValue, selectedValue, comparer) {\n if (itemValue == null || selectedValue == null) {\n return Object.is(itemValue, selectedValue);\n }\n return comparer(itemValue, selectedValue);\n}\nexport function selectedValueIncludes(selectedValues, itemValue, comparer) {\n if (!selectedValues || selectedValues.length === 0) {\n return false;\n }\n return selectedValues.some(selectedValue => {\n if (selectedValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function findItemIndex(itemValues, selectedValue, comparer) {\n if (!itemValues || itemValues.length === 0) {\n return -1;\n }\n return itemValues.findIndex(itemValue => {\n if (itemValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function removeItem(selectedValues, itemValue, comparer) {\n return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));\n}"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAa,KAAuB,GAAW,MAAkB,OAAO,GAAG,GAAW,CAAa;AACnG,SAAgB,EAAoB,GAAW,GAAe,GAAU;CAItE,OAHI,KAAa,QAAQ,KAAiB,OACjC,OAAO,GAAG,GAAW,CAAa,IAEpC,EAAS,GAAW,CAAa;AAC1C;AACA,SAAgB,EAAsB,GAAgB,GAAW,GAAU;CAIzE,OAHI,CAAC,KAAkB,EAAe,WAAW,IACxC,KAEF,EAAe,MAAK,MACrB,MAAkB,KAAA,KAGf,EAAoB,GAAW,GAAe,CAAQ,CAC9D;AACH;AACA,SAAgB,EAAc,GAAY,GAAe,GAAU;CAIjE,OAHI,CAAC,KAAc,EAAW,WAAW,IAChC,KAEF,EAAW,WAAU,MACtB,MAAc,KAAA,KAGX,EAAoB,GAAW,GAAe,CAAQ,CAC9D;AACH;AACA,SAAgB,EAAW,GAAgB,GAAW,GAAU;CAC9D,OAAO,EAAe,QAAO,MAAiB,CAAC,EAAoB,GAAW,GAAe,CAAQ,CAAC;AACxG"}
package/dist/index375.js CHANGED
@@ -1,56 +1,14 @@
1
- "use client";
2
- import { serializeValue as e } from "./index374.js";
3
- import * as t from "react";
4
- import { jsx as n } from "react/jsx-runtime";
5
- //#region ../../node_modules/@base-ui/react/internals/resolveValueLabel.mjs
6
- function r(e) {
7
- return e != null && e.length > 0 && typeof e[0] == "object" && e[0] != null && "items" in e[0];
8
- }
9
- function i(e) {
10
- if (!Array.isArray(e)) return e != null && "null" in e;
11
- let t = e;
12
- if (r(t)) {
13
- for (let e of t) for (let t of e.items) if (t && t.value == null && t.label != null) return !0;
14
- return !1;
15
- }
16
- for (let e of t) if (e && e.value == null && e.label != null) return !0;
17
- return !1;
18
- }
19
- function a(t, n) {
20
- if (n && t != null) return n(t) ?? "";
21
- if (t && typeof t == "object") {
22
- if ("label" in t && t.label != null) return String(t.label);
23
- if ("value" in t) return String(t.value);
24
- }
25
- return e(t);
26
- }
27
- function o(t, n) {
28
- return n && t != null ? n(t) ?? "" : t && typeof t == "object" && "value" in t && "label" in t ? e(t.value) : e(t);
29
- }
30
- function s(e, t, n) {
31
- function i() {
32
- return a(e, n);
1
+ //#region ../../node_modules/@base-ui/react/internals/serializeValue.mjs
2
+ function e(e) {
3
+ if (e == null) return "";
4
+ if (typeof e == "string") return e;
5
+ try {
6
+ return JSON.stringify(e);
7
+ } catch {
8
+ return String(e);
33
9
  }
34
- if (n && e != null) return n(e);
35
- if (e && typeof e == "object" && "label" in e && e.label != null) return e.label;
36
- if (t && !Array.isArray(t)) return t[e] ?? i();
37
- if (Array.isArray(t)) {
38
- let n = t, a = r(n) ? n.flatMap((e) => e.items) : n;
39
- if (typeof e != "object" || !e) {
40
- let t = a.find((t) => t.value === e);
41
- return t && t.label != null ? t.label : i();
42
- }
43
- if ("value" in e) {
44
- let t = a.find((t) => t && t.value === e.value);
45
- if (t && t.label != null) return t.label;
46
- }
47
- }
48
- return i();
49
- }
50
- function c(e, r, i) {
51
- return e.reduce((e, a, o) => (o > 0 && e.push(", "), e.push(/*#__PURE__*/ n(t.Fragment, { children: s(a, r, i) }, o)), e), []);
52
10
  }
53
11
  //#endregion
54
- export { i as hasNullItemLabel, r as isGroupedItems, c as resolveMultipleLabels, s as resolveSelectedLabel, a as stringifyAsLabel, o as stringifyAsValue };
12
+ export { e as serializeValue };
55
13
 
56
14
  //# sourceMappingURL=index375.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index375.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/resolveValueLabel.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { serializeValue } from \"./serializeValue.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function isGroupedItems(items) {\n return items != null && items.length > 0 && typeof items[0] === 'object' && items[0] != null && 'items' in items[0];\n}\n\n/**\n * Checks if the items array contains an item with a null value that has a non-null label.\n */\nexport function hasNullItemLabel(items) {\n if (!Array.isArray(items)) {\n return items != null && 'null' in items;\n }\n const arrayItems = items;\n if (isGroupedItems(arrayItems)) {\n for (const group of arrayItems) {\n for (const item of group.items) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n }\n return false;\n }\n for (const item of arrayItems) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n return false;\n}\nexport function stringifyAsLabel(item, itemToStringLabel) {\n if (itemToStringLabel && item != null) {\n return itemToStringLabel(item) ?? '';\n }\n if (item && typeof item === 'object') {\n if ('label' in item && item.label != null) {\n return String(item.label);\n }\n if ('value' in item) {\n return String(item.value);\n }\n }\n return serializeValue(item);\n}\nexport function stringifyAsValue(item, itemToStringValue) {\n if (itemToStringValue && item != null) {\n return itemToStringValue(item) ?? '';\n }\n if (item && typeof item === 'object' && 'value' in item && 'label' in item) {\n return serializeValue(item.value);\n }\n return serializeValue(item);\n}\nexport function resolveSelectedLabel(value, items, itemToStringLabel) {\n function fallback() {\n return stringifyAsLabel(value, itemToStringLabel);\n }\n if (itemToStringLabel && value != null) {\n return itemToStringLabel(value);\n }\n\n // Custom object with explicit label takes precedence\n if (value && typeof value === 'object' && 'label' in value && value.label != null) {\n return value.label;\n }\n\n // Items provided as plain record map\n if (items && !Array.isArray(items)) {\n return items[value] ?? fallback();\n }\n\n // Items provided as array (flat or grouped)\n if (Array.isArray(items)) {\n const arrayItems = items;\n const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap(group => group.items) : arrayItems;\n if (value == null || typeof value !== 'object') {\n const match = flatItems.find(item => item.value === value);\n if (match && match.label != null) {\n return match.label;\n }\n return fallback();\n }\n\n // Object without explicit label: try matching by its `value` property\n if ('value' in value) {\n const match = flatItems.find(item => item && item.value === value.value);\n if (match && match.label != null) {\n return match.label;\n }\n }\n }\n return fallback();\n}\nexport function resolveMultipleLabels(values, items, itemToStringLabel) {\n return values.reduce((acc, value, index) => {\n if (index > 0) {\n acc.push(', ');\n }\n acc.push(/*#__PURE__*/_jsx(React.Fragment, {\n children: resolveSelectedLabel(value, items, itemToStringLabel)\n }, index));\n return acc;\n }, []);\n}"],"x_google_ignoreList":[0],"mappings":";;;;;AAKA,SAAgB,EAAe,GAAO;CACpC,OAAO,KAAS,QAAQ,EAAM,SAAS,KAAK,OAAO,EAAM,MAAO,YAAY,EAAM,MAAM,QAAQ,WAAW,EAAM;AACnH;AAKA,SAAgB,EAAiB,GAAO;CACtC,IAAI,CAAC,MAAM,QAAQ,CAAK,GACtB,OAAO,KAAS,QAAQ,UAAU;CAEpC,IAAM,IAAa;CACnB,IAAI,EAAe,CAAU,GAAG;EAC9B,KAAK,IAAM,KAAS,GAClB,KAAK,IAAM,KAAQ,EAAM,OACvB,IAAI,KAAQ,EAAK,SAAS,QAAQ,EAAK,SAAS,MAC9C,OAAO;EAIb,OAAO;CACT;CACA,KAAK,IAAM,KAAQ,GACjB,IAAI,KAAQ,EAAK,SAAS,QAAQ,EAAK,SAAS,MAC9C,OAAO;CAGX,OAAO;AACT;AACA,SAAgB,EAAiB,GAAM,GAAmB;CACxD,IAAI,KAAqB,KAAQ,MAC/B,OAAO,EAAkB,CAAI,KAAK;CAEpC,IAAI,KAAQ,OAAO,KAAS,UAAU;EACpC,IAAI,WAAW,KAAQ,EAAK,SAAS,MACnC,OAAO,OAAO,EAAK,KAAK;EAE1B,IAAI,WAAW,GACb,OAAO,OAAO,EAAK,KAAK;CAE5B;CACA,OAAO,EAAe,CAAI;AAC5B;AACA,SAAgB,EAAiB,GAAM,GAAmB;CAOxD,OANI,KAAqB,KAAQ,OACxB,EAAkB,CAAI,KAAK,KAEhC,KAAQ,OAAO,KAAS,YAAY,WAAW,KAAQ,WAAW,IAC7D,EAAe,EAAK,KAAK,IAE3B,EAAe,CAAI;AAC5B;AACA,SAAgB,EAAqB,GAAO,GAAO,GAAmB;CACpE,SAAS,IAAW;EAClB,OAAO,EAAiB,GAAO,CAAiB;CAClD;CACA,IAAI,KAAqB,KAAS,MAChC,OAAO,EAAkB,CAAK;CAIhC,IAAI,KAAS,OAAO,KAAU,YAAY,WAAW,KAAS,EAAM,SAAS,MAC3E,OAAO,EAAM;CAIf,IAAI,KAAS,CAAC,MAAM,QAAQ,CAAK,GAC/B,OAAO,EAAM,MAAU,EAAS;CAIlC,IAAI,MAAM,QAAQ,CAAK,GAAG;EACxB,IAAM,IAAa,GACb,IAAY,EAAe,CAAU,IAAI,EAAW,SAAQ,MAAS,EAAM,KAAK,IAAI;EAC1F,IAAqB,OAAO,KAAU,aAAlC,GAA4C;GAC9C,IAAM,IAAQ,EAAU,MAAK,MAAQ,EAAK,UAAU,CAAK;GAIzD,OAHI,KAAS,EAAM,SAAS,OACnB,EAAM,QAER,EAAS;EAClB;EAGA,IAAI,WAAW,GAAO;GACpB,IAAM,IAAQ,EAAU,MAAK,MAAQ,KAAQ,EAAK,UAAU,EAAM,KAAK;GACvE,IAAI,KAAS,EAAM,SAAS,MAC1B,OAAO,EAAM;EAEjB;CACF;CACA,OAAO,EAAS;AAClB;AACA,SAAgB,EAAsB,GAAQ,GAAO,GAAmB;CACtE,OAAO,EAAO,QAAQ,GAAK,GAAO,OAC5B,IAAQ,KACV,EAAI,KAAK,IAAI,GAEf,EAAI,KAAkB,gBAAKA,EAAM,UAAU,EACzC,UAAU,EAAqB,GAAO,GAAO,CAAiB,EAChE,GAAG,CAAK,CAAC,GACF,IACN,CAAC,CAAC;AACP"}
1
+ {"version":3,"file":"index375.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/serializeValue.mjs"],"sourcesContent":["export function serializeValue(value) {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,EAAe,GAAO;CACpC,IAAI,KAAS,MACX,OAAO;CAET,IAAI,OAAO,KAAU,UACnB,OAAO;CAET,IAAI;EACF,OAAO,KAAK,UAAU,CAAK;CAC7B,QAAQ;EACN,OAAO,OAAO,CAAK;CACrB;AACF"}
package/dist/index376.js CHANGED
@@ -1,46 +1,56 @@
1
- import { createSelector as e } from "./index251.js";
2
- import { compareItemEquality as t } from "./index373.js";
3
- import { hasNullItemLabel as n, stringifyAsValue as r } from "./index375.js";
4
- //#region ../../node_modules/@base-ui/react/select/store.mjs
5
- var i = {
6
- id: e((e) => e.id),
7
- labelId: e((e) => e.labelId),
8
- modal: e((e) => e.modal),
9
- multiple: e((e) => e.multiple),
10
- items: e((e) => e.items),
11
- itemToStringLabel: e((e) => e.itemToStringLabel),
12
- itemToStringValue: e((e) => e.itemToStringValue),
13
- isItemEqualToValue: e((e) => e.isItemEqualToValue),
14
- value: e((e) => e.value),
15
- hasSelectedValue: e((e) => {
16
- let { value: t, multiple: n, itemToStringValue: i } = e;
17
- return t == null ? !1 : n && Array.isArray(t) ? t.length > 0 : r(t, i) !== "";
18
- }),
19
- hasNullItemLabel: e((e, t) => t ? n(e.items) : !1),
20
- open: e((e) => e.open),
21
- mounted: e((e) => e.mounted),
22
- forceMount: e((e) => e.forceMount),
23
- transitionStatus: e((e) => e.transitionStatus),
24
- openMethod: e((e) => e.openMethod),
25
- activeIndex: e((e) => e.activeIndex),
26
- selectedIndex: e((e) => e.selectedIndex),
27
- isActive: e((e, t) => e.activeIndex === t),
28
- isSelected: e((e, n) => {
29
- let r = e.isItemEqualToValue, i = e.value;
30
- return e.multiple ? Array.isArray(i) && i.some((e) => t(n, e, r)) : t(n, i, r);
31
- }),
32
- isSelectedByFocus: e((e, t) => e.selectedIndex === t),
33
- popupProps: e((e) => e.popupProps),
34
- triggerProps: e((e) => e.triggerProps),
35
- triggerElement: e((e) => e.triggerElement),
36
- positionerElement: e((e) => e.positionerElement),
37
- listElement: e((e) => e.listElement),
38
- popupSide: e((e) => e.popupSide),
39
- scrollUpArrowVisible: e((e) => e.scrollUpArrowVisible),
40
- scrollDownArrowVisible: e((e) => e.scrollDownArrowVisible),
41
- hasScrollArrows: e((e) => e.hasScrollArrows)
42
- };
1
+ "use client";
2
+ import { serializeValue as e } from "./index375.js";
3
+ import * as t from "react";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ //#region ../../node_modules/@base-ui/react/internals/resolveValueLabel.mjs
6
+ function r(e) {
7
+ return e != null && e.length > 0 && typeof e[0] == "object" && e[0] != null && "items" in e[0];
8
+ }
9
+ function i(e) {
10
+ if (!Array.isArray(e)) return e != null && "null" in e;
11
+ let t = e;
12
+ if (r(t)) {
13
+ for (let e of t) for (let t of e.items) if (t && t.value == null && t.label != null) return !0;
14
+ return !1;
15
+ }
16
+ for (let e of t) if (e && e.value == null && e.label != null) return !0;
17
+ return !1;
18
+ }
19
+ function a(t, n) {
20
+ if (n && t != null) return n(t) ?? "";
21
+ if (t && typeof t == "object") {
22
+ if ("label" in t && t.label != null) return String(t.label);
23
+ if ("value" in t) return String(t.value);
24
+ }
25
+ return e(t);
26
+ }
27
+ function o(t, n) {
28
+ return n && t != null ? n(t) ?? "" : t && typeof t == "object" && "value" in t && "label" in t ? e(t.value) : e(t);
29
+ }
30
+ function s(e, t, n) {
31
+ function i() {
32
+ return a(e, n);
33
+ }
34
+ if (n && e != null) return n(e);
35
+ if (e && typeof e == "object" && "label" in e && e.label != null) return e.label;
36
+ if (t && !Array.isArray(t)) return t[e] ?? i();
37
+ if (Array.isArray(t)) {
38
+ let n = t, a = r(n) ? n.flatMap((e) => e.items) : n;
39
+ if (typeof e != "object" || !e) {
40
+ let t = a.find((t) => t.value === e);
41
+ return t && t.label != null ? t.label : i();
42
+ }
43
+ if ("value" in e) {
44
+ let t = a.find((t) => t && t.value === e.value);
45
+ if (t && t.label != null) return t.label;
46
+ }
47
+ }
48
+ return i();
49
+ }
50
+ function c(e, r, i) {
51
+ return e.reduce((e, a, o) => (o > 0 && e.push(", "), e.push(/*#__PURE__*/ n(t.Fragment, { children: s(a, r, i) }, o)), e), []);
52
+ }
43
53
  //#endregion
44
- export { i as selectors };
54
+ export { i as hasNullItemLabel, r as isGroupedItems, c as resolveMultipleLabels, s as resolveSelectedLabel, a as stringifyAsLabel, o as stringifyAsValue };
45
55
 
46
56
  //# sourceMappingURL=index376.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index376.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/store.mjs"],"sourcesContent":["import { createSelector } from '@base-ui/utils/store';\nimport { compareItemEquality } from \"../internals/itemEquality.mjs\";\nimport { hasNullItemLabel, stringifyAsValue } from \"../internals/resolveValueLabel.mjs\";\nexport const selectors = {\n id: createSelector(state => state.id),\n labelId: createSelector(state => state.labelId),\n modal: createSelector(state => state.modal),\n multiple: createSelector(state => state.multiple),\n items: createSelector(state => state.items),\n itemToStringLabel: createSelector(state => state.itemToStringLabel),\n itemToStringValue: createSelector(state => state.itemToStringValue),\n isItemEqualToValue: createSelector(state => state.isItemEqualToValue),\n value: createSelector(state => state.value),\n hasSelectedValue: createSelector(state => {\n const {\n value,\n multiple,\n itemToStringValue\n } = state;\n if (value == null) {\n return false;\n }\n if (multiple && Array.isArray(value)) {\n return value.length > 0;\n }\n return stringifyAsValue(value, itemToStringValue) !== '';\n }),\n hasNullItemLabel: createSelector((state, enabled) => {\n return enabled ? hasNullItemLabel(state.items) : false;\n }),\n open: createSelector(state => state.open),\n mounted: createSelector(state => state.mounted),\n forceMount: createSelector(state => state.forceMount),\n transitionStatus: createSelector(state => state.transitionStatus),\n openMethod: createSelector(state => state.openMethod),\n activeIndex: createSelector(state => state.activeIndex),\n selectedIndex: createSelector(state => state.selectedIndex),\n isActive: createSelector((state, index) => state.activeIndex === index),\n isSelected: createSelector((state, itemValue) => {\n const comparer = state.isItemEqualToValue;\n const storeValue = state.value;\n if (state.multiple) {\n return Array.isArray(storeValue) && storeValue.some(selectedItem => compareItemEquality(itemValue, selectedItem, comparer));\n }\n\n // The value is the source of truth: a stale `selectedIndex` (e.g. the controlled\n // value changes while the popup is open, where the index sync is deferred) must not\n // keep a previously selected item marked as selected.\n return compareItemEquality(itemValue, storeValue, comparer);\n }),\n isSelectedByFocus: createSelector((state, index) => {\n return state.selectedIndex === index;\n }),\n popupProps: createSelector(state => state.popupProps),\n triggerProps: createSelector(state => state.triggerProps),\n triggerElement: createSelector(state => state.triggerElement),\n positionerElement: createSelector(state => state.positionerElement),\n listElement: createSelector(state => state.listElement),\n popupSide: createSelector(state => state.popupSide),\n scrollUpArrowVisible: createSelector(state => state.scrollUpArrowVisible),\n scrollDownArrowVisible: createSelector(state => state.scrollDownArrowVisible),\n hasScrollArrows: createSelector(state => state.hasScrollArrows)\n};"],"x_google_ignoreList":[0],"mappings":";;;;AAGA,IAAa,IAAY;CACvB,IAAI,GAAe,MAAS,EAAM,EAAE;CACpC,SAAS,GAAe,MAAS,EAAM,OAAO;CAC9C,OAAO,GAAe,MAAS,EAAM,KAAK;CAC1C,UAAU,GAAe,MAAS,EAAM,QAAQ;CAChD,OAAO,GAAe,MAAS,EAAM,KAAK;CAC1C,mBAAmB,GAAe,MAAS,EAAM,iBAAiB;CAClE,mBAAmB,GAAe,MAAS,EAAM,iBAAiB;CAClE,oBAAoB,GAAe,MAAS,EAAM,kBAAkB;CACpE,OAAO,GAAe,MAAS,EAAM,KAAK;CAC1C,kBAAkB,GAAe,MAAS;EACxC,IAAM,EACJ,UACA,aACA,yBACE;EAOJ,OANI,KAAS,OACJ,KAEL,KAAY,MAAM,QAAQ,CAAK,IAC1B,EAAM,SAAS,IAEjB,EAAiB,GAAO,CAAiB,MAAM;CACxD,CAAC;CACD,kBAAkB,GAAgB,GAAO,MAChC,IAAU,EAAiB,EAAM,KAAK,IAAI,EAClD;CACD,MAAM,GAAe,MAAS,EAAM,IAAI;CACxC,SAAS,GAAe,MAAS,EAAM,OAAO;CAC9C,YAAY,GAAe,MAAS,EAAM,UAAU;CACpD,kBAAkB,GAAe,MAAS,EAAM,gBAAgB;CAChE,YAAY,GAAe,MAAS,EAAM,UAAU;CACpD,aAAa,GAAe,MAAS,EAAM,WAAW;CACtD,eAAe,GAAe,MAAS,EAAM,aAAa;CAC1D,UAAU,GAAgB,GAAO,MAAU,EAAM,gBAAgB,CAAK;CACtE,YAAY,GAAgB,GAAO,MAAc;EAC/C,IAAM,IAAW,EAAM,oBACjB,IAAa,EAAM;EAQzB,OAPI,EAAM,WACD,MAAM,QAAQ,CAAU,KAAK,EAAW,MAAK,MAAgB,EAAoB,GAAW,GAAc,CAAQ,CAAC,IAMrH,EAAoB,GAAW,GAAY,CAAQ;CAC5D,CAAC;CACD,mBAAmB,GAAgB,GAAO,MACjC,EAAM,kBAAkB,CAChC;CACD,YAAY,GAAe,MAAS,EAAM,UAAU;CACpD,cAAc,GAAe,MAAS,EAAM,YAAY;CACxD,gBAAgB,GAAe,MAAS,EAAM,cAAc;CAC5D,mBAAmB,GAAe,MAAS,EAAM,iBAAiB;CAClE,aAAa,GAAe,MAAS,EAAM,WAAW;CACtD,WAAW,GAAe,MAAS,EAAM,SAAS;CAClD,sBAAsB,GAAe,MAAS,EAAM,oBAAoB;CACxE,wBAAwB,GAAe,MAAS,EAAM,sBAAsB;CAC5E,iBAAiB,GAAe,MAAS,EAAM,eAAe;AAChE"}
1
+ {"version":3,"file":"index376.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/resolveValueLabel.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { serializeValue } from \"./serializeValue.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function isGroupedItems(items) {\n return items != null && items.length > 0 && typeof items[0] === 'object' && items[0] != null && 'items' in items[0];\n}\n\n/**\n * Checks if the items array contains an item with a null value that has a non-null label.\n */\nexport function hasNullItemLabel(items) {\n if (!Array.isArray(items)) {\n return items != null && 'null' in items;\n }\n const arrayItems = items;\n if (isGroupedItems(arrayItems)) {\n for (const group of arrayItems) {\n for (const item of group.items) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n }\n return false;\n }\n for (const item of arrayItems) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n return false;\n}\nexport function stringifyAsLabel(item, itemToStringLabel) {\n if (itemToStringLabel && item != null) {\n return itemToStringLabel(item) ?? '';\n }\n if (item && typeof item === 'object') {\n if ('label' in item && item.label != null) {\n return String(item.label);\n }\n if ('value' in item) {\n return String(item.value);\n }\n }\n return serializeValue(item);\n}\nexport function stringifyAsValue(item, itemToStringValue) {\n if (itemToStringValue && item != null) {\n return itemToStringValue(item) ?? '';\n }\n if (item && typeof item === 'object' && 'value' in item && 'label' in item) {\n return serializeValue(item.value);\n }\n return serializeValue(item);\n}\nexport function resolveSelectedLabel(value, items, itemToStringLabel) {\n function fallback() {\n return stringifyAsLabel(value, itemToStringLabel);\n }\n if (itemToStringLabel && value != null) {\n return itemToStringLabel(value);\n }\n\n // Custom object with explicit label takes precedence\n if (value && typeof value === 'object' && 'label' in value && value.label != null) {\n return value.label;\n }\n\n // Items provided as plain record map\n if (items && !Array.isArray(items)) {\n return items[value] ?? fallback();\n }\n\n // Items provided as array (flat or grouped)\n if (Array.isArray(items)) {\n const arrayItems = items;\n const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap(group => group.items) : arrayItems;\n if (value == null || typeof value !== 'object') {\n const match = flatItems.find(item => item.value === value);\n if (match && match.label != null) {\n return match.label;\n }\n return fallback();\n }\n\n // Object without explicit label: try matching by its `value` property\n if ('value' in value) {\n const match = flatItems.find(item => item && item.value === value.value);\n if (match && match.label != null) {\n return match.label;\n }\n }\n }\n return fallback();\n}\nexport function resolveMultipleLabels(values, items, itemToStringLabel) {\n return values.reduce((acc, value, index) => {\n if (index > 0) {\n acc.push(', ');\n }\n acc.push(/*#__PURE__*/_jsx(React.Fragment, {\n children: resolveSelectedLabel(value, items, itemToStringLabel)\n }, index));\n return acc;\n }, []);\n}"],"x_google_ignoreList":[0],"mappings":";;;;;AAKA,SAAgB,EAAe,GAAO;CACpC,OAAO,KAAS,QAAQ,EAAM,SAAS,KAAK,OAAO,EAAM,MAAO,YAAY,EAAM,MAAM,QAAQ,WAAW,EAAM;AACnH;AAKA,SAAgB,EAAiB,GAAO;CACtC,IAAI,CAAC,MAAM,QAAQ,CAAK,GACtB,OAAO,KAAS,QAAQ,UAAU;CAEpC,IAAM,IAAa;CACnB,IAAI,EAAe,CAAU,GAAG;EAC9B,KAAK,IAAM,KAAS,GAClB,KAAK,IAAM,KAAQ,EAAM,OACvB,IAAI,KAAQ,EAAK,SAAS,QAAQ,EAAK,SAAS,MAC9C,OAAO;EAIb,OAAO;CACT;CACA,KAAK,IAAM,KAAQ,GACjB,IAAI,KAAQ,EAAK,SAAS,QAAQ,EAAK,SAAS,MAC9C,OAAO;CAGX,OAAO;AACT;AACA,SAAgB,EAAiB,GAAM,GAAmB;CACxD,IAAI,KAAqB,KAAQ,MAC/B,OAAO,EAAkB,CAAI,KAAK;CAEpC,IAAI,KAAQ,OAAO,KAAS,UAAU;EACpC,IAAI,WAAW,KAAQ,EAAK,SAAS,MACnC,OAAO,OAAO,EAAK,KAAK;EAE1B,IAAI,WAAW,GACb,OAAO,OAAO,EAAK,KAAK;CAE5B;CACA,OAAO,EAAe,CAAI;AAC5B;AACA,SAAgB,EAAiB,GAAM,GAAmB;CAOxD,OANI,KAAqB,KAAQ,OACxB,EAAkB,CAAI,KAAK,KAEhC,KAAQ,OAAO,KAAS,YAAY,WAAW,KAAQ,WAAW,IAC7D,EAAe,EAAK,KAAK,IAE3B,EAAe,CAAI;AAC5B;AACA,SAAgB,EAAqB,GAAO,GAAO,GAAmB;CACpE,SAAS,IAAW;EAClB,OAAO,EAAiB,GAAO,CAAiB;CAClD;CACA,IAAI,KAAqB,KAAS,MAChC,OAAO,EAAkB,CAAK;CAIhC,IAAI,KAAS,OAAO,KAAU,YAAY,WAAW,KAAS,EAAM,SAAS,MAC3E,OAAO,EAAM;CAIf,IAAI,KAAS,CAAC,MAAM,QAAQ,CAAK,GAC/B,OAAO,EAAM,MAAU,EAAS;CAIlC,IAAI,MAAM,QAAQ,CAAK,GAAG;EACxB,IAAM,IAAa,GACb,IAAY,EAAe,CAAU,IAAI,EAAW,SAAQ,MAAS,EAAM,KAAK,IAAI;EAC1F,IAAqB,OAAO,KAAU,aAAlC,GAA4C;GAC9C,IAAM,IAAQ,EAAU,MAAK,MAAQ,EAAK,UAAU,CAAK;GAIzD,OAHI,KAAS,EAAM,SAAS,OACnB,EAAM,QAER,EAAS;EAClB;EAGA,IAAI,WAAW,GAAO;GACpB,IAAM,IAAQ,EAAU,MAAK,MAAQ,KAAQ,EAAK,UAAU,EAAM,KAAK;GACvE,IAAI,KAAS,EAAM,SAAS,MAC1B,OAAO,EAAM;EAEjB;CACF;CACA,OAAO,EAAS;AAClB;AACA,SAAgB,EAAsB,GAAQ,GAAO,GAAmB;CACtE,OAAO,EAAO,QAAQ,GAAK,GAAO,OAC5B,IAAQ,KACV,EAAI,KAAK,IAAI,GAEf,EAAI,KAAkB,gBAAKA,EAAM,UAAU,EACzC,UAAU,EAAqB,GAAO,GAAO,CAAiB,EAChE,GAAG,CAAK,CAAC,GACF,IACN,CAAC,CAAC;AACP"}
package/dist/index377.js CHANGED
@@ -1,19 +1,46 @@
1
- "use client";
2
- import { NOOP as e } from "./index191.js";
3
- import * as t from "react";
4
- //#region ../../node_modules/@base-ui/react/internals/form-context/FormContext.mjs
5
- var n = /*#__PURE__*/ t.createContext({
6
- formRef: { current: { fields: /* @__PURE__ */ new Map() } },
7
- errors: {},
8
- clearErrors: e,
9
- validationMode: "onSubmit",
10
- submitAttemptedRef: { current: !1 }
11
- });
12
- process.env.NODE_ENV !== "production" && (n.displayName = "FormContext");
13
- function r() {
14
- return t.useContext(n);
15
- }
1
+ import { createSelector as e } from "./index251.js";
2
+ import { compareItemEquality as t } from "./index374.js";
3
+ import { hasNullItemLabel as n, stringifyAsValue as r } from "./index376.js";
4
+ //#region ../../node_modules/@base-ui/react/select/store.mjs
5
+ var i = {
6
+ id: e((e) => e.id),
7
+ labelId: e((e) => e.labelId),
8
+ modal: e((e) => e.modal),
9
+ multiple: e((e) => e.multiple),
10
+ items: e((e) => e.items),
11
+ itemToStringLabel: e((e) => e.itemToStringLabel),
12
+ itemToStringValue: e((e) => e.itemToStringValue),
13
+ isItemEqualToValue: e((e) => e.isItemEqualToValue),
14
+ value: e((e) => e.value),
15
+ hasSelectedValue: e((e) => {
16
+ let { value: t, multiple: n, itemToStringValue: i } = e;
17
+ return t == null ? !1 : n && Array.isArray(t) ? t.length > 0 : r(t, i) !== "";
18
+ }),
19
+ hasNullItemLabel: e((e, t) => t ? n(e.items) : !1),
20
+ open: e((e) => e.open),
21
+ mounted: e((e) => e.mounted),
22
+ forceMount: e((e) => e.forceMount),
23
+ transitionStatus: e((e) => e.transitionStatus),
24
+ openMethod: e((e) => e.openMethod),
25
+ activeIndex: e((e) => e.activeIndex),
26
+ selectedIndex: e((e) => e.selectedIndex),
27
+ isActive: e((e, t) => e.activeIndex === t),
28
+ isSelected: e((e, n) => {
29
+ let r = e.isItemEqualToValue, i = e.value;
30
+ return e.multiple ? Array.isArray(i) && i.some((e) => t(n, e, r)) : t(n, i, r);
31
+ }),
32
+ isSelectedByFocus: e((e, t) => e.selectedIndex === t),
33
+ popupProps: e((e) => e.popupProps),
34
+ triggerProps: e((e) => e.triggerProps),
35
+ triggerElement: e((e) => e.triggerElement),
36
+ positionerElement: e((e) => e.positionerElement),
37
+ listElement: e((e) => e.listElement),
38
+ popupSide: e((e) => e.popupSide),
39
+ scrollUpArrowVisible: e((e) => e.scrollUpArrowVisible),
40
+ scrollDownArrowVisible: e((e) => e.scrollDownArrowVisible),
41
+ hasScrollArrows: e((e) => e.hasScrollArrows)
42
+ };
16
43
  //#endregion
17
- export { n as FormContext, r as useFormContext };
44
+ export { i as selectors };
18
45
 
19
46
  //# sourceMappingURL=index377.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index377.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/form-context/FormContext.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\nexport const FormContext = /*#__PURE__*/React.createContext({\n formRef: {\n current: {\n fields: new Map()\n }\n },\n errors: {},\n clearErrors: NOOP,\n validationMode: 'onSubmit',\n submitAttemptedRef: {\n current: false\n }\n});\nif (process.env.NODE_ENV !== \"production\") FormContext.displayName = \"FormContext\";\nexport function useFormContext() {\n return React.useContext(FormContext);\n}"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,IAAa,IAA2B,gBAAM,cAAc;CAC1D,SAAS,EACP,SAAS,EACP,wBAAQ,IAAI,IAAI,EAClB,EACF;CACA,QAAQ,CAAC;CACT,aAAa;CACb,gBAAgB;CAChB,oBAAoB,EAClB,SAAS,GACX;AACF,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAY,cAAc;AACrE,SAAgB,IAAiB;CAC/B,OAAOA,EAAM,WAAW,CAAW;AACrC"}
1
+ {"version":3,"file":"index377.js","names":[],"sources":["../../../node_modules/@base-ui/react/select/store.mjs"],"sourcesContent":["import { createSelector } from '@base-ui/utils/store';\nimport { compareItemEquality } from \"../internals/itemEquality.mjs\";\nimport { hasNullItemLabel, stringifyAsValue } from \"../internals/resolveValueLabel.mjs\";\nexport const selectors = {\n id: createSelector(state => state.id),\n labelId: createSelector(state => state.labelId),\n modal: createSelector(state => state.modal),\n multiple: createSelector(state => state.multiple),\n items: createSelector(state => state.items),\n itemToStringLabel: createSelector(state => state.itemToStringLabel),\n itemToStringValue: createSelector(state => state.itemToStringValue),\n isItemEqualToValue: createSelector(state => state.isItemEqualToValue),\n value: createSelector(state => state.value),\n hasSelectedValue: createSelector(state => {\n const {\n value,\n multiple,\n itemToStringValue\n } = state;\n if (value == null) {\n return false;\n }\n if (multiple && Array.isArray(value)) {\n return value.length > 0;\n }\n return stringifyAsValue(value, itemToStringValue) !== '';\n }),\n hasNullItemLabel: createSelector((state, enabled) => {\n return enabled ? hasNullItemLabel(state.items) : false;\n }),\n open: createSelector(state => state.open),\n mounted: createSelector(state => state.mounted),\n forceMount: createSelector(state => state.forceMount),\n transitionStatus: createSelector(state => state.transitionStatus),\n openMethod: createSelector(state => state.openMethod),\n activeIndex: createSelector(state => state.activeIndex),\n selectedIndex: createSelector(state => state.selectedIndex),\n isActive: createSelector((state, index) => state.activeIndex === index),\n isSelected: createSelector((state, itemValue) => {\n const comparer = state.isItemEqualToValue;\n const storeValue = state.value;\n if (state.multiple) {\n return Array.isArray(storeValue) && storeValue.some(selectedItem => compareItemEquality(itemValue, selectedItem, comparer));\n }\n\n // The value is the source of truth: a stale `selectedIndex` (e.g. the controlled\n // value changes while the popup is open, where the index sync is deferred) must not\n // keep a previously selected item marked as selected.\n return compareItemEquality(itemValue, storeValue, comparer);\n }),\n isSelectedByFocus: createSelector((state, index) => {\n return state.selectedIndex === index;\n }),\n popupProps: createSelector(state => state.popupProps),\n triggerProps: createSelector(state => state.triggerProps),\n triggerElement: createSelector(state => state.triggerElement),\n positionerElement: createSelector(state => state.positionerElement),\n listElement: createSelector(state => state.listElement),\n popupSide: createSelector(state => state.popupSide),\n scrollUpArrowVisible: createSelector(state => state.scrollUpArrowVisible),\n scrollDownArrowVisible: createSelector(state => state.scrollDownArrowVisible),\n hasScrollArrows: createSelector(state => state.hasScrollArrows)\n};"],"x_google_ignoreList":[0],"mappings":";;;;AAGA,IAAa,IAAY;CACvB,IAAI,GAAe,MAAS,EAAM,EAAE;CACpC,SAAS,GAAe,MAAS,EAAM,OAAO;CAC9C,OAAO,GAAe,MAAS,EAAM,KAAK;CAC1C,UAAU,GAAe,MAAS,EAAM,QAAQ;CAChD,OAAO,GAAe,MAAS,EAAM,KAAK;CAC1C,mBAAmB,GAAe,MAAS,EAAM,iBAAiB;CAClE,mBAAmB,GAAe,MAAS,EAAM,iBAAiB;CAClE,oBAAoB,GAAe,MAAS,EAAM,kBAAkB;CACpE,OAAO,GAAe,MAAS,EAAM,KAAK;CAC1C,kBAAkB,GAAe,MAAS;EACxC,IAAM,EACJ,UACA,aACA,yBACE;EAOJ,OANI,KAAS,OACJ,KAEL,KAAY,MAAM,QAAQ,CAAK,IAC1B,EAAM,SAAS,IAEjB,EAAiB,GAAO,CAAiB,MAAM;CACxD,CAAC;CACD,kBAAkB,GAAgB,GAAO,MAChC,IAAU,EAAiB,EAAM,KAAK,IAAI,EAClD;CACD,MAAM,GAAe,MAAS,EAAM,IAAI;CACxC,SAAS,GAAe,MAAS,EAAM,OAAO;CAC9C,YAAY,GAAe,MAAS,EAAM,UAAU;CACpD,kBAAkB,GAAe,MAAS,EAAM,gBAAgB;CAChE,YAAY,GAAe,MAAS,EAAM,UAAU;CACpD,aAAa,GAAe,MAAS,EAAM,WAAW;CACtD,eAAe,GAAe,MAAS,EAAM,aAAa;CAC1D,UAAU,GAAgB,GAAO,MAAU,EAAM,gBAAgB,CAAK;CACtE,YAAY,GAAgB,GAAO,MAAc;EAC/C,IAAM,IAAW,EAAM,oBACjB,IAAa,EAAM;EAQzB,OAPI,EAAM,WACD,MAAM,QAAQ,CAAU,KAAK,EAAW,MAAK,MAAgB,EAAoB,GAAW,GAAc,CAAQ,CAAC,IAMrH,EAAoB,GAAW,GAAY,CAAQ;CAC5D,CAAC;CACD,mBAAmB,GAAgB,GAAO,MACjC,EAAM,kBAAkB,CAChC;CACD,YAAY,GAAe,MAAS,EAAM,UAAU;CACpD,cAAc,GAAe,MAAS,EAAM,YAAY;CACxD,gBAAgB,GAAe,MAAS,EAAM,cAAc;CAC5D,mBAAmB,GAAe,MAAS,EAAM,iBAAiB;CAClE,aAAa,GAAe,MAAS,EAAM,WAAW;CACtD,WAAW,GAAe,MAAS,EAAM,SAAS;CAClD,sBAAsB,GAAe,MAAS,EAAM,oBAAoB;CACxE,wBAAwB,GAAe,MAAS,EAAM,sBAAsB;CAC5E,iBAAiB,GAAe,MAAS,EAAM,eAAe;AAChE"}
package/dist/index378.js CHANGED
@@ -1,8 +1,19 @@
1
- //#region ../../node_modules/@base-ui/react/internals/areArraysEqual.mjs
2
- function e(e, t, n = (e, t) => e === t) {
3
- return e.length === t.length && e.every((e, r) => n(e, t[r]));
1
+ "use client";
2
+ import { NOOP as e } from "./index191.js";
3
+ import * as t from "react";
4
+ //#region ../../node_modules/@base-ui/react/internals/form-context/FormContext.mjs
5
+ var n = /*#__PURE__*/ t.createContext({
6
+ formRef: { current: { fields: /* @__PURE__ */ new Map() } },
7
+ errors: {},
8
+ clearErrors: e,
9
+ validationMode: "onSubmit",
10
+ submitAttemptedRef: { current: !1 }
11
+ });
12
+ process.env.NODE_ENV !== "production" && (n.displayName = "FormContext");
13
+ function r() {
14
+ return t.useContext(n);
4
15
  }
5
16
  //#endregion
6
- export { e as areArraysEqual };
17
+ export { n as FormContext, r as useFormContext };
7
18
 
8
19
  //# sourceMappingURL=index378.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index378.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/areArraysEqual.mjs"],"sourcesContent":["export function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {\n return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));\n}"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,EAAe,GAAQ,GAAQ,KAAgB,GAAG,MAAM,MAAM,GAAG;CAC/E,OAAO,EAAO,WAAW,EAAO,UAAU,EAAO,OAAO,GAAO,MAAU,EAAa,GAAO,EAAO,EAAM,CAAC;AAC7G"}
1
+ {"version":3,"file":"index378.js","names":["React"],"sources":["../../../node_modules/@base-ui/react/internals/form-context/FormContext.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../noop.mjs\";\nexport const FormContext = /*#__PURE__*/React.createContext({\n formRef: {\n current: {\n fields: new Map()\n }\n },\n errors: {},\n clearErrors: NOOP,\n validationMode: 'onSubmit',\n submitAttemptedRef: {\n current: false\n }\n});\nif (process.env.NODE_ENV !== \"production\") FormContext.displayName = \"FormContext\";\nexport function useFormContext() {\n return React.useContext(FormContext);\n}"],"x_google_ignoreList":[0],"mappings":";;;;AAIA,IAAa,IAA2B,gBAAM,cAAc;CAC1D,SAAS,EACP,SAAS,EACP,wBAAQ,IAAI,IAAI,EAClB,EACF;CACA,QAAQ,CAAC;CACT,aAAa;CACb,gBAAgB;CAChB,oBAAoB,EAClB,SAAS,GACX;AACF,CAAC;AACD,QAAA,IAAA,aAA6B,iBAAc,EAAY,cAAc;AACrE,SAAgB,IAAiB;CAC/B,OAAOA,EAAM,WAAW,CAAW;AACrC"}
package/dist/index379.js CHANGED
@@ -1,8 +1,8 @@
1
- //#region ../../node_modules/@base-ui/react/internals/clamp.mjs
2
- function e(e, t = -(2 ** 53 - 1), n = 2 ** 53 - 1) {
3
- return Math.max(t, Math.min(e, n));
1
+ //#region ../../node_modules/@base-ui/react/internals/areArraysEqual.mjs
2
+ function e(e, t, n = (e, t) => e === t) {
3
+ return e.length === t.length && e.every((e, r) => n(e, t[r]));
4
4
  }
5
5
  //#endregion
6
- export { e as clamp };
6
+ export { e as areArraysEqual };
7
7
 
8
8
  //# sourceMappingURL=index379.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index379.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/clamp.mjs"],"sourcesContent":["export function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,EAAM,GAAK,IAAM,gBAAyB,iBAA+B;CACvF,OAAO,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAG,CAAC;AACzC"}
1
+ {"version":3,"file":"index379.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/areArraysEqual.mjs"],"sourcesContent":["export function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {\n return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));\n}"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,EAAe,GAAQ,GAAQ,KAAgB,GAAG,MAAM,MAAM,GAAG;CAC/E,OAAO,EAAO,WAAW,EAAO,UAAU,EAAO,OAAO,GAAO,MAAU,EAAa,GAAO,EAAO,EAAM,CAAC;AAC7G"}
package/dist/index380.js CHANGED
@@ -1,13 +1,8 @@
1
- import { clamp as e } from "./index379.js";
2
- function t(e, t) {
3
- return Math.max(0, e - t);
4
- }
5
- function n(t, n) {
6
- if (n <= 0) return 0;
7
- let r = e(t, 0, n), i = r, a = n - r, o = i <= 1, s = a <= 1;
8
- return o && s ? i <= a ? 0 : n : o ? 0 : s ? n : r;
1
+ //#region ../../node_modules/@base-ui/react/internals/clamp.mjs
2
+ function e(e, t = -(2 ** 53 - 1), n = 2 ** 53 - 1) {
3
+ return Math.max(t, Math.min(e, n));
9
4
  }
10
5
  //#endregion
11
- export { t as getMaxScrollOffset, n as normalizeScrollOffset };
6
+ export { e as clamp };
12
7
 
13
8
  //# sourceMappingURL=index380.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index380.js","names":[],"sources":["../../../node_modules/@base-ui/react/utils/scrollEdges.mjs"],"sourcesContent":["import { clamp } from \"../internals/clamp.mjs\";\nexport const SCROLL_EDGE_TOLERANCE_PX = 1;\nexport function getMaxScrollOffset(scrollSize, clientSize) {\n return Math.max(0, scrollSize - clientSize);\n}\nexport function normalizeScrollOffset(value, max) {\n if (max <= 0) {\n return 0;\n }\n const clamped = clamp(value, 0, max);\n const startDistance = clamped;\n const endDistance = max - clamped;\n const withinStartTolerance = startDistance <= SCROLL_EDGE_TOLERANCE_PX;\n const withinEndTolerance = endDistance <= SCROLL_EDGE_TOLERANCE_PX;\n if (withinStartTolerance && withinEndTolerance) {\n return startDistance <= endDistance ? 0 : max;\n }\n if (withinStartTolerance) {\n return 0;\n }\n if (withinEndTolerance) {\n return max;\n }\n return clamped;\n}"],"x_google_ignoreList":[0],"mappings":";AAEA,SAAgB,EAAmB,GAAY,GAAY;CACzD,OAAO,KAAK,IAAI,GAAG,IAAa,CAAU;AAC5C;AACA,SAAgB,EAAsB,GAAO,GAAK;CAChD,IAAI,KAAO,GACT,OAAO;CAET,IAAM,IAAU,EAAM,GAAO,GAAG,CAAG,GAC7B,IAAgB,GAChB,IAAc,IAAM,GACpB,IAAuB,KAAA,GACvB,IAAqB,KAAA;CAU3B,OATI,KAAwB,IACnB,KAAiB,IAAc,IAAI,IAExC,IACK,IAEL,IACK,IAEF;AACT"}
1
+ {"version":3,"file":"index380.js","names":[],"sources":["../../../node_modules/@base-ui/react/internals/clamp.mjs"],"sourcesContent":["export function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,EAAM,GAAK,IAAM,gBAAyB,iBAA+B;CACvF,OAAO,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAG,CAAC;AACzC"}