@rpcbase/ui 0.251.0 → 0.252.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 (243) hide show
  1. package/dist/index150.js +3 -3
  2. package/dist/index156.js +1 -1
  3. package/dist/index163.js +2 -2
  4. package/dist/index164.js +7 -7
  5. package/dist/index167.js +1 -1
  6. package/dist/index169.js +1 -1
  7. package/dist/index172.js +3 -3
  8. package/dist/index175.js +1 -1
  9. package/dist/index176.js +4 -4
  10. package/dist/index182.js +1 -1
  11. package/dist/index184.js +4 -4
  12. package/dist/index185.js +13 -13
  13. package/dist/index188.js +5 -5
  14. package/dist/index189.js +1 -1
  15. package/dist/index192.js +2 -2
  16. package/dist/index193.js +6 -6
  17. package/dist/index254.js +155 -20
  18. package/dist/index254.js.map +1 -1
  19. package/dist/index255.js +31 -65
  20. package/dist/index255.js.map +1 -1
  21. package/dist/index256.js +11 -6
  22. package/dist/index256.js.map +1 -1
  23. package/dist/index257.js +49 -5
  24. package/dist/index257.js.map +1 -1
  25. package/dist/index258.js +9 -11
  26. package/dist/index258.js.map +1 -1
  27. package/dist/index259.js +11 -3
  28. package/dist/index259.js.map +1 -1
  29. package/dist/index260.js +41 -48
  30. package/dist/index260.js.map +1 -1
  31. package/dist/index261.js +98 -4
  32. package/dist/index261.js.map +1 -1
  33. package/dist/index262.js +84 -27
  34. package/dist/index262.js.map +1 -1
  35. package/dist/index263.js +103 -14
  36. package/dist/index263.js.map +1 -1
  37. package/dist/index264.js +52 -5
  38. package/dist/index264.js.map +1 -1
  39. package/dist/index265.js +11 -21
  40. package/dist/index265.js.map +1 -1
  41. package/dist/index266.js +4 -53
  42. package/dist/index266.js.map +1 -1
  43. package/dist/index267.js +37 -20
  44. package/dist/index267.js.map +1 -1
  45. package/dist/index268.js +8 -41
  46. package/dist/index268.js.map +1 -1
  47. package/dist/index269.js +132 -36
  48. package/dist/index269.js.map +1 -1
  49. package/dist/index270.js +18 -46
  50. package/dist/index270.js.map +1 -1
  51. package/dist/index271.js +14 -19
  52. package/dist/index271.js.map +1 -1
  53. package/dist/index272.js +3 -70
  54. package/dist/index272.js.map +1 -1
  55. package/dist/index273.js +34 -15
  56. package/dist/index273.js.map +1 -1
  57. package/dist/index274.js +20 -3
  58. package/dist/index274.js.map +1 -1
  59. package/dist/index275.js +9 -11
  60. package/dist/index275.js.map +1 -1
  61. package/dist/index276.js +8 -13
  62. package/dist/index276.js.map +1 -1
  63. package/dist/index277.js +20 -19
  64. package/dist/index277.js.map +1 -1
  65. package/dist/index278.js +65 -35
  66. package/dist/index278.js.map +1 -1
  67. package/dist/index279.js +6 -239
  68. package/dist/index279.js.map +1 -1
  69. package/dist/index280.js +5 -252
  70. package/dist/index280.js.map +1 -1
  71. package/dist/index281.js +10 -67
  72. package/dist/index281.js.map +1 -1
  73. package/dist/index282.js +3 -99
  74. package/dist/index282.js.map +1 -1
  75. package/dist/index283.js +47 -80
  76. package/dist/index283.js.map +1 -1
  77. package/dist/index284.js +4 -4
  78. package/dist/index284.js.map +1 -1
  79. package/dist/index285.js +27 -27
  80. package/dist/index285.js.map +1 -1
  81. package/dist/index286.js +16 -16
  82. package/dist/index286.js.map +1 -1
  83. package/dist/index287.js +6 -35
  84. package/dist/index287.js.map +1 -1
  85. package/dist/index288.js +21 -17
  86. package/dist/index288.js.map +1 -1
  87. package/dist/index289.js +53 -3
  88. package/dist/index289.js.map +1 -1
  89. package/dist/index290.js +20 -26
  90. package/dist/index290.js.map +1 -1
  91. package/dist/index291.js +40 -27
  92. package/dist/index291.js.map +1 -1
  93. package/dist/index292.js +40 -4
  94. package/dist/index292.js.map +1 -1
  95. package/dist/index293.js +46 -79
  96. package/dist/index293.js.map +1 -1
  97. package/dist/index294.js +19 -271
  98. package/dist/index294.js.map +1 -1
  99. package/dist/index295.js +70 -11
  100. package/dist/index295.js.map +1 -1
  101. package/dist/index296.js +18 -11
  102. package/dist/index296.js.map +1 -1
  103. package/dist/index297.js +3 -25
  104. package/dist/index297.js.map +1 -1
  105. package/dist/index298.js +11 -16
  106. package/dist/index298.js.map +1 -1
  107. package/dist/index299.js +12 -124
  108. package/dist/index299.js.map +1 -1
  109. package/dist/index300.js +18 -5
  110. package/dist/index300.js.map +1 -1
  111. package/dist/index301.js +35 -64
  112. package/dist/index301.js.map +1 -1
  113. package/dist/index302.js +240 -14
  114. package/dist/index302.js.map +1 -1
  115. package/dist/index303.js +252 -7
  116. package/dist/index303.js.map +1 -1
  117. package/dist/index304.js +68 -5
  118. package/dist/index304.js.map +1 -1
  119. package/dist/index305.js +99 -3
  120. package/dist/index305.js.map +1 -1
  121. package/dist/index306.js +83 -10
  122. package/dist/index306.js.map +1 -1
  123. package/dist/index307.js +3 -7
  124. package/dist/index307.js.map +1 -1
  125. package/dist/index308.js +24 -128
  126. package/dist/index308.js.map +1 -1
  127. package/dist/index309.js +16 -399
  128. package/dist/index309.js.map +1 -1
  129. package/dist/index310.js +35 -5
  130. package/dist/index310.js.map +1 -1
  131. package/dist/index311.js +16 -51
  132. package/dist/index311.js.map +1 -1
  133. package/dist/index312.js +3 -11
  134. package/dist/index312.js.map +1 -1
  135. package/dist/index313.js +22 -23
  136. package/dist/index313.js.map +1 -1
  137. package/dist/index314.js +27 -10
  138. package/dist/index314.js.map +1 -1
  139. package/dist/index315.js +4 -33
  140. package/dist/index315.js.map +1 -1
  141. package/dist/index316.js +78 -11
  142. package/dist/index316.js.map +1 -1
  143. package/dist/index317.js +268 -45
  144. package/dist/index317.js.map +1 -1
  145. package/dist/index318.js +11 -9
  146. package/dist/index318.js.map +1 -1
  147. package/dist/index319.js +10 -11
  148. package/dist/index319.js.map +1 -1
  149. package/dist/index320.js +25 -43
  150. package/dist/index320.js.map +1 -1
  151. package/dist/index321.js +15 -96
  152. package/dist/index321.js.map +1 -1
  153. package/dist/index322.js +122 -83
  154. package/dist/index322.js.map +1 -1
  155. package/dist/index323.js +4 -104
  156. package/dist/index323.js.map +1 -1
  157. package/dist/index324.js +60 -47
  158. package/dist/index324.js.map +1 -1
  159. package/dist/index325.js +13 -11
  160. package/dist/index325.js.map +1 -1
  161. package/dist/index326.js +7 -4
  162. package/dist/index326.js.map +1 -1
  163. package/dist/index327.js +5 -37
  164. package/dist/index327.js.map +1 -1
  165. package/dist/index328.js +3 -8
  166. package/dist/index328.js.map +1 -1
  167. package/dist/index329.js +10 -154
  168. package/dist/index329.js.map +1 -1
  169. package/dist/index330.js +7 -135
  170. package/dist/index330.js.map +1 -1
  171. package/dist/index331.js +133 -17
  172. package/dist/index331.js.map +1 -1
  173. package/dist/index332.js +398 -14
  174. package/dist/index332.js.map +1 -1
  175. package/dist/index333.js +5 -4
  176. package/dist/index333.js.map +1 -1
  177. package/dist/index334.js +50 -34
  178. package/dist/index334.js.map +1 -1
  179. package/dist/index335.js +11 -20
  180. package/dist/index335.js.map +1 -1
  181. package/dist/index336.js +27 -9
  182. package/dist/index336.js.map +1 -1
  183. package/dist/index337.js +11 -8
  184. package/dist/index337.js.map +1 -1
  185. package/dist/index338.js +2 -2
  186. package/dist/index348.js +2 -2
  187. package/dist/index350.js +4 -4
  188. package/dist/index358.js +5 -5
  189. package/dist/index359.js +1 -1
  190. package/dist/index365.js +5 -4
  191. package/dist/index365.js.map +1 -1
  192. package/dist/index366.js +20 -5
  193. package/dist/index366.js.map +1 -1
  194. package/dist/index367.js +4 -3
  195. package/dist/index367.js.map +1 -1
  196. package/dist/index368.js +5 -11
  197. package/dist/index368.js.map +1 -1
  198. package/dist/index369.js +3 -21
  199. package/dist/index369.js.map +1 -1
  200. package/dist/index370.js +11 -44
  201. package/dist/index370.js.map +1 -1
  202. package/dist/index371.js +20 -17
  203. package/dist/index371.js.map +1 -1
  204. package/dist/index372.js +45 -5
  205. package/dist/index372.js.map +1 -1
  206. package/dist/index373.js +15 -198
  207. package/dist/index373.js.map +1 -1
  208. package/dist/index374.js +5 -74
  209. package/dist/index374.js.map +1 -1
  210. package/dist/index375.js +192 -115
  211. package/dist/index375.js.map +1 -1
  212. package/dist/index376.js +73 -4
  213. package/dist/index376.js.map +1 -1
  214. package/dist/index377.js +122 -19
  215. package/dist/index377.js.map +1 -1
  216. package/dist/index379.js +3 -3
  217. package/dist/index380.js +3 -3
  218. package/dist/index382.js +1 -1
  219. package/dist/index384.js +1 -1
  220. package/dist/index385.js +2 -2
  221. package/dist/index388.js +1 -1
  222. package/dist/index389.js +2 -2
  223. package/dist/index413.js +1 -1
  224. package/dist/index423.js +1 -1
  225. package/dist/index424.js +1 -1
  226. package/dist/index427.js +1 -1
  227. package/dist/index428.js +1 -1
  228. package/dist/index434.js +2 -2
  229. package/dist/index436.js +2 -2
  230. package/dist/index49.js +30 -30
  231. package/dist/index50.js +21 -21
  232. package/dist/index51.js +1 -1
  233. package/dist/index52.js +8 -8
  234. package/dist/index53.js +2 -2
  235. package/dist/index55.js +16 -16
  236. package/dist/index56.js +4 -4
  237. package/dist/index57.js +3 -3
  238. package/dist/index58.js +7 -7
  239. package/dist/index59.js +4 -4
  240. package/dist/index60.js +12 -12
  241. package/dist/index61.js +2 -2
  242. package/dist/index62.js +2 -2
  243. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index311.js","sources":["../../../node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useCompositeListContext } from \"./CompositeListContext.mjs\";\nexport let IndexGuessBehavior = /*#__PURE__*/function (IndexGuessBehavior) {\n IndexGuessBehavior[IndexGuessBehavior[\"None\"] = 0] = \"None\";\n IndexGuessBehavior[IndexGuessBehavior[\"GuessFromOrder\"] = 1] = \"GuessFromOrder\";\n return IndexGuessBehavior;\n}({});\n\n/**\n * Used to register a list item and its index (DOM position) in the `CompositeList`.\n */\nexport function useCompositeListItem(params = {}) {\n const {\n label,\n metadata,\n textRef,\n indexGuessBehavior,\n index: externalIndex\n } = params;\n const {\n register,\n unregister,\n subscribeMapChange,\n elementsRef,\n labelsRef,\n nextIndexRef\n } = useCompositeListContext();\n const indexRef = React.useRef(-1);\n const [index, setIndex] = React.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {\n if (indexRef.current === -1) {\n const newIndex = nextIndexRef.current;\n nextIndexRef.current += 1;\n indexRef.current = newIndex;\n }\n return indexRef.current;\n } : -1));\n const componentRef = React.useRef(null);\n const ref = React.useCallback(node => {\n componentRef.current = node;\n if (index !== -1 && node !== null) {\n elementsRef.current[index] = node;\n if (labelsRef) {\n const isLabelDefined = label !== undefined;\n labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;\n }\n }\n }, [index, elementsRef, labelsRef, label, textRef]);\n useIsoLayoutEffect(() => {\n if (externalIndex != null) {\n return undefined;\n }\n const node = componentRef.current;\n if (node) {\n register(node, metadata);\n return () => {\n unregister(node);\n };\n }\n return undefined;\n }, [externalIndex, register, unregister, metadata]);\n useIsoLayoutEffect(() => {\n if (externalIndex != null) {\n return undefined;\n }\n return subscribeMapChange(map => {\n const i = componentRef.current ? map.get(componentRef.current)?.index : null;\n if (i != null) {\n setIndex(i);\n }\n });\n }, [externalIndex, subscribeMapChange, setIndex]);\n return {\n ref,\n index\n };\n}"],"names":["IndexGuessBehavior","useCompositeListItem","params","label","metadata","textRef","indexGuessBehavior","externalIndex","register","unregister","subscribeMapChange","elementsRef","labelsRef","nextIndexRef","useCompositeListContext","indexRef","React","index","setIndex","newIndex","componentRef","ref","node","isLabelDefined","useIsoLayoutEffect","map","i"],"mappings":";;;AAKU,IAACA,IAAkC,0BAAUA,GAAoB;AACzE,SAAAA,EAAmBA,EAAmB,OAAU,CAAC,IAAI,QACrDA,EAAmBA,EAAmB,iBAAoB,CAAC,IAAI,kBACxDA;AACT,GAAE,CAAA,CAAE;AAKG,SAASC,EAAqBC,IAAS,IAAI;AAChD,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AA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,QAAIM,KAAK,QACPR,EAASQ,CAAC;AAAA,MAEd,CAAC;AAAA,EACH,GAAG,CAACnB,GAAeG,GAAoBQ,CAAQ,CAAC,GACzC;AAAA,IACL,KAAAG;AAAA,IACA,OAAAJ;AAAA,EACJ;AACA;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index311.js","sources":["../../../node_modules/@base-ui/react/utils/getPseudoElementBounds.mjs"],"sourcesContent":["import { ownerWindow } from '@base-ui/utils/owner';\nimport { platform } from '@base-ui/utils/platform';\nexport function getPseudoElementBounds(element) {\n const elementRect = element.getBoundingClientRect();\n const win = ownerWindow(element);\n\n // Avoid \"Not implemented: window.getComputedStyle(elt, pseudoElt)\" in jsdom.\n if (platform.env.jsdom) {\n return elementRect;\n }\n const beforeStyles = win.getComputedStyle(element, '::before');\n const afterStyles = win.getComputedStyle(element, '::after');\n const hasPseudoElements = beforeStyles.content !== 'none' || afterStyles.content !== 'none';\n if (!hasPseudoElements) {\n return elementRect;\n }\n\n // Get dimensions of pseudo-elements\n const beforeWidth = parseFloat(beforeStyles.width) || 0;\n const beforeHeight = parseFloat(beforeStyles.height) || 0;\n const afterWidth = parseFloat(afterStyles.width) || 0;\n const afterHeight = parseFloat(afterStyles.height) || 0;\n\n // Calculate max dimensions including pseudo-elements\n const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);\n const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);\n\n // Calculate the differences to extend the bounds\n const widthDiff = totalWidth - elementRect.width;\n const heightDiff = totalHeight - elementRect.height;\n return {\n left: elementRect.left - widthDiff / 2,\n right: elementRect.right + widthDiff / 2,\n top: elementRect.top - heightDiff / 2,\n bottom: elementRect.bottom + heightDiff / 2\n };\n}"],"names":["getPseudoElementBounds","element","elementRect","win","ownerWindow","platform.env.jsdom","beforeStyles","afterStyles","beforeWidth","beforeHeight","afterWidth","afterHeight","totalWidth","totalHeight","widthDiff","heightDiff"],"mappings":";;AAEO,SAASA,EAAuBC,GAAS;AAC9C,QAAMC,IAAcD,EAAQ,sBAAqB,GAC3CE,IAAMC,EAAYH,CAAO;AAG/B,MAAII;AACF,WAAOH;AAET,QAAMI,IAAeH,EAAI,iBAAiBF,GAAS,UAAU,GACvDM,IAAcJ,EAAI,iBAAiBF,GAAS,SAAS;AAE3D,MAAI,EADsBK,EAAa,YAAY,UAAUC,EAAY,YAAY;AAEnF,WAAOL;AAIT,QAAMM,IAAc,WAAWF,EAAa,KAAK,KAAK,GAChDG,IAAe,WAAWH,EAAa,MAAM,KAAK,GAClDI,IAAa,WAAWH,EAAY,KAAK,KAAK,GAC9CI,IAAc,WAAWJ,EAAY,MAAM,KAAK,GAGhDK,IAAa,KAAK,IAAIV,EAAY,OAAOM,GAAaE,CAAU,GAChEG,IAAc,KAAK,IAAIX,EAAY,QAAQO,GAAcE,CAAW,GAGpEG,IAAYF,IAAaV,EAAY,OACrCa,IAAaF,IAAcX,EAAY;AAC7C,SAAO;AAAA,IACL,MAAMA,EAAY,OAAOY,IAAY;AAAA,IACrC,OAAOZ,EAAY,QAAQY,IAAY;AAAA,IACvC,KAAKZ,EAAY,MAAMa,IAAa;AAAA,IACpC,QAAQb,EAAY,SAASa,IAAa;AAAA,EAC9C;AACA;","x_google_ignoreList":[0]}
package/dist/index312.js CHANGED
@@ -1,15 +1,7 @@
1
- import n from "./index190.js";
2
- import * as t from "react";
3
- const o = /* @__PURE__ */ t.createContext(void 0);
4
- process.env.NODE_ENV !== "production" && (o.displayName = "SelectItemContext");
5
- function s() {
6
- const e = t.useContext(o);
7
- if (!e)
8
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>." : n(57));
9
- return e;
1
+ function l(e, r) {
2
+ return e ?? r;
10
3
  }
11
4
  export {
12
- o as SelectItemContext,
13
- s as useSelectItemContext
5
+ l as resolveAriaLabelledBy
14
6
  };
15
7
  //# sourceMappingURL=index312.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index312.js","sources":["../../../node_modules/@base-ui/react/select/item/SelectItemContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectItemContext.displayName = \"SelectItemContext\";\nexport function useSelectItemContext() {\n const context = React.useContext(SelectItemContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.' : _formatErrorMessage(57));\n }\n return context;\n}"],"names":["SelectItemContext","React","useSelectItemContext","context","_formatErrorMessage"],"mappings":";;AAIY,MAACA,IAAiC,gBAAAC,EAAM,cAAc,MAAS;AACvE,QAAQ,IAAI,aAAa,iBAAcD,EAAkB,cAAc;AACpE,SAASE,IAAuB;AACrC,QAAMC,IAAUF,EAAM,WAAWD,CAAiB;AAClD,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,iGAAiGC,EAAoB,EAAE,CAAC;AAElL,SAAOD;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index312.js","sources":["../../../node_modules/@base-ui/react/utils/resolveAriaLabelledBy.mjs"],"sourcesContent":["'use client';\n\nexport function getDefaultLabelId(id) {\n return id == null ? undefined : `${id}-label`;\n}\nexport function resolveAriaLabelledBy(fieldLabelId, localLabelId) {\n return fieldLabelId ?? localLabelId;\n}"],"names":["resolveAriaLabelledBy","fieldLabelId","localLabelId"],"mappings":"AAKO,SAASA,EAAsBC,GAAcC,GAAc;AAChE,SAAOD,KAAgBC;AACzB;","x_google_ignoreList":[0]}
package/dist/index313.js CHANGED
@@ -1,31 +1,30 @@
1
- import { android as r } from "./index357.js";
2
- import { jsdom as o } from "./index367.js";
3
- function p(i) {
4
- i.preventDefault(), i.stopPropagation();
1
+ import { isHTMLElement as i } from "./index331.js";
2
+ import { FOCUSABLE_ATTRIBUTE as u, TYPEABLE_SELECTOR as n } from "./index390.js";
3
+ function a(t, r) {
4
+ if (r == null)
5
+ return !1;
6
+ if ("composedPath" in t)
7
+ return t.composedPath().includes(r);
8
+ const o = t;
9
+ return o.target != null && r.contains(o.target);
5
10
  }
6
- function e(i) {
7
- return "nativeEvent" in i;
11
+ function b(t) {
12
+ return t.matches("html,body");
8
13
  }
9
- function c(i) {
10
- return i.pointerType === "" && i.isTrusted ? !0 : r && i.pointerType ? i.type === "click" && i.buttons === 1 : i.detail === 0 && !i.pointerType;
14
+ function e(t) {
15
+ return i(t) && t.matches(n);
11
16
  }
12
- function a(i) {
13
- return o ? !1 : !r && i.width === 0 && i.height === 0 || r && i.width === 1 && i.height === 1 && i.pressure === 0 && i.detail === 0 && i.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
14
- i.width < 1 && i.height < 1 && i.pressure === 0 && i.detail === 0 && i.pointerType === "touch";
17
+ function f(t) {
18
+ return t ? t.getAttribute("role") === "combobox" && e(t) : !1;
15
19
  }
16
- function l(i, t) {
17
- return ["mouse", "pen"].includes(i);
18
- }
19
- function d(i) {
20
- const t = i.type;
21
- return t === "click" || t === "mousedown" || t === "keydown" || t === "keyup";
20
+ function T(t) {
21
+ return t ? t.hasAttribute(u) ? t : t.querySelector(`[${u}]`) || t : null;
22
22
  }
23
23
  export {
24
- d as isClickLikeEvent,
25
- l as isMouseLikePointerType,
26
- e as isReactEvent,
27
- c as isVirtualClick,
28
- a as isVirtualPointerEvent,
29
- p as stopEvent
24
+ T as getFloatingFocusElement,
25
+ a as isEventTargetWithin,
26
+ b as isRootElement,
27
+ f as isTypeableCombobox,
28
+ e as isTypeableElement
30
29
  };
31
30
  //# sourceMappingURL=index313.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index313.js","sources":["../../../node_modules/@base-ui/react/floating-ui-react/utils/event.mjs"],"sourcesContent":["import { platform } from '@base-ui/utils/platform';\nexport function stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nexport function isReactEvent(event) {\n return 'nativeEvent' in event;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/utils/src/isVirtualEvent.ts\nexport function isVirtualClick(event) {\n if (event.pointerType === '' && event.isTrusted) {\n return true;\n }\n if (platform.os.android && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nexport function isVirtualPointerEvent(event) {\n if (platform.env.jsdom) {\n return false;\n }\n return !platform.os.android && event.width === 0 && event.height === 0 || platform.os.android && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||\n // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';\n}\nexport function isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\nexport function isClickLikeEvent(event) {\n const type = event.type;\n return type === 'click' || type === 'mousedown' || type === 'keydown' || type === 'keyup';\n}"],"names":["stopEvent","event","isReactEvent","isVirtualClick","platform.os.android","isVirtualPointerEvent","platform.env.jsdom","isMouseLikePointerType","pointerType","strict","isClickLikeEvent","type"],"mappings":";;AACO,SAASA,EAAUC,GAAO;AAC/B,EAAAA,EAAM,eAAc,GACpBA,EAAM,gBAAe;AACvB;AACO,SAASC,EAAaD,GAAO;AAClC,SAAO,iBAAiBA;AAC1B;AAGO,SAASE,EAAeF,GAAO;AACpC,SAAIA,EAAM,gBAAgB,MAAMA,EAAM,YAC7B,KAELG,KAAuBH,EAAM,cACxBA,EAAM,SAAS,WAAWA,EAAM,YAAY,IAE9CA,EAAM,WAAW,KAAK,CAACA,EAAM;AACtC;AACO,SAASI,EAAsBJ,GAAO;AAC3C,SAAIK,IACK,KAEF,CAACF,KAAuBH,EAAM,UAAU,KAAKA,EAAM,WAAW,KAAKG,KAAuBH,EAAM,UAAU,KAAKA,EAAM,WAAW,KAAKA,EAAM,aAAa,KAAKA,EAAM,WAAW,KAAKA,EAAM,gBAAgB;AAAA,EAEhNA,EAAM,QAAQ,KAAKA,EAAM,SAAS,KAAKA,EAAM,aAAa,KAAKA,EAAM,WAAW,KAAKA,EAAM,gBAAgB;AAC7G;AACO,SAASM,EAAuBC,GAAaC,GAAQ;AAO1D,SAJe,CAAC,SAAS,KAAK,EAIhB,SAASD,CAAW;AACpC;AACO,SAASE,EAAiBT,GAAO;AACtC,QAAMU,IAAOV,EAAM;AACnB,SAAOU,MAAS,WAAWA,MAAS,eAAeA,MAAS,aAAaA,MAAS;AACpF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index313.js","sources":["../../../node_modules/@base-ui/react/floating-ui-react/utils/element.mjs"],"sourcesContent":["import { isElement, isHTMLElement } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { FOCUSABLE_ATTRIBUTE, TYPEABLE_SELECTOR } from \"./constants.mjs\";\nimport { activeElement, contains, getTarget } from \"../../internals/shadowDom.mjs\";\nexport { activeElement, contains, getTarget };\nexport function isTargetInsideEnabledTrigger(target, triggerElements) {\n if (!isElement(target)) {\n return false;\n }\n const targetElement = target;\n if (triggerElements.hasElement(targetElement)) {\n return !targetElement.hasAttribute('data-trigger-disabled');\n }\n for (const [, trigger] of triggerElements.entries()) {\n if (contains(trigger, targetElement)) {\n return !trigger.hasAttribute('data-trigger-disabled');\n }\n }\n return false;\n}\nexport function isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const eventAgain = event;\n return eventAgain.target != null && node.contains(eventAgain.target);\n}\nexport function isRootElement(element) {\n return element.matches('html,body');\n}\nexport function isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\nexport function isInteractiveElement(element) {\n return element?.closest(`button,a[href],[role=\"button\"],select,[tabindex]:not([tabindex=\"-1\"]),${TYPEABLE_SELECTOR}`) != null;\n}\nexport function isTypeableCombobox(element) {\n if (!element) {\n return false;\n }\n return element.getAttribute('role') === 'combobox' && isTypeableElement(element);\n}\nexport function matchesFocusVisible(element) {\n // We don't want to block focus from working with `visibleOnly`\n // (JSDOM doesn't match `:focus-visible` when the element has `:focus`)\n if (!element || platform.env.jsdom) {\n return true;\n }\n try {\n return element.matches(':focus-visible');\n } catch (_e) {\n return true;\n }\n}\nexport function getFloatingFocusElement(floatingElement) {\n if (!floatingElement) {\n return null;\n }\n // Try to find the element that has `{...getFloatingProps()}` spread on it.\n // This indicates the floating element is acting as a positioning wrapper, and\n // so focus should be managed on the child element with the event handlers and\n // aria props.\n return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;\n}"],"names":["isEventTargetWithin","event","node","eventAgain","isRootElement","element","isTypeableElement","isHTMLElement","TYPEABLE_SELECTOR","isTypeableCombobox","getFloatingFocusElement","floatingElement","FOCUSABLE_ATTRIBUTE"],"mappings":";;AAoBO,SAASA,EAAoBC,GAAOC,GAAM;AAC/C,MAAIA,KAAQ;AACV,WAAO;AAET,MAAI,kBAAkBD;AACpB,WAAOA,EAAM,eAAe,SAASC,CAAI;AAI3C,QAAMC,IAAaF;AACnB,SAAOE,EAAW,UAAU,QAAQD,EAAK,SAASC,EAAW,MAAM;AACrE;AACO,SAASC,EAAcC,GAAS;AACrC,SAAOA,EAAQ,QAAQ,WAAW;AACpC;AACO,SAASC,EAAkBD,GAAS;AACzC,SAAOE,EAAcF,CAAO,KAAKA,EAAQ,QAAQG,CAAiB;AACpE;AAIO,SAASC,EAAmBJ,GAAS;AAC1C,SAAKA,IAGEA,EAAQ,aAAa,MAAM,MAAM,cAAcC,EAAkBD,CAAO,IAFtE;AAGX;AAaO,SAASK,EAAwBC,GAAiB;AACvD,SAAKA,IAOEA,EAAgB,aAAaC,CAAmB,IAAID,IAAkBA,EAAgB,cAAc,IAAIC,CAAmB,GAAG,KAAKD,IANjI;AAOX;","x_google_ignoreList":[0]}
package/dist/index314.js CHANGED
@@ -1,15 +1,32 @@
1
- import r from "./index190.js";
2
- import * as t from "react";
3
- const o = /* @__PURE__ */ t.createContext(void 0);
4
- process.env.NODE_ENV !== "production" && (o.displayName = "SelectGroupContext");
5
- function s() {
6
- const e = t.useContext(o);
7
- if (e === void 0)
8
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>." : r(56));
1
+ import { isShadowRoot as r } from "./index331.js";
2
+ function a(t) {
3
+ let e = t.activeElement;
4
+ for (; e?.shadowRoot?.activeElement != null; )
5
+ e = e.shadowRoot.activeElement;
9
6
  return e;
10
7
  }
8
+ function u(t, e) {
9
+ if (!t || !e)
10
+ return !1;
11
+ const n = e.getRootNode?.();
12
+ if (t.contains(e))
13
+ return !0;
14
+ if (n && r(n)) {
15
+ let o = e;
16
+ for (; o; ) {
17
+ if (t === o)
18
+ return !0;
19
+ o = o.parentNode || o.host;
20
+ }
21
+ }
22
+ return !1;
23
+ }
24
+ function f(t) {
25
+ return "composedPath" in t ? t.composedPath()[0] : t.target;
26
+ }
11
27
  export {
12
- o as SelectGroupContext,
13
- s as useSelectGroupContext
28
+ a as activeElement,
29
+ u as contains,
30
+ f as getTarget
14
31
  };
15
32
  //# sourceMappingURL=index314.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index314.js","sources":["../../../node_modules/@base-ui/react/select/group/SelectGroupContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectGroupContext.displayName = \"SelectGroupContext\";\nexport function useSelectGroupContext() {\n const context = React.useContext(SelectGroupContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.' : _formatErrorMessage(56));\n }\n return context;\n}"],"names":["SelectGroupContext","React","useSelectGroupContext","context","_formatErrorMessage"],"mappings":";;AAIY,MAACA,IAAkC,gBAAAC,EAAM,cAAc,MAAS;AACxE,QAAQ,IAAI,aAAa,iBAAcD,EAAmB,cAAc;AACrE,SAASE,IAAwB;AACtC,QAAMC,IAAUF,EAAM,WAAWD,CAAkB;AACnD,MAAIG,MAAY;AACd,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,oGAAoGC,EAAoB,EAAE,CAAC;AAErL,SAAOD;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index314.js","sources":["../../../node_modules/@base-ui/react/internals/shadowDom.mjs"],"sourcesContent":["import { isShadowRoot } from '@floating-ui/utils/dom';\nexport function activeElement(doc) {\n let element = doc.activeElement;\n while (element?.shadowRoot?.activeElement != null) {\n element = element.shadowRoot.activeElement;\n }\n return element;\n}\nexport function contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode?.();\n\n // First, attempt with the faster native method.\n if (parent.contains(child)) {\n return true;\n }\n\n // Then fall back to traversing out of shadow roots when needed.\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) {\n return true;\n }\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\nexport function getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n }\n\n // TS assumes `composedPath()` always exists, but older browsers without\n // shadow DOM support still fall back to `target`.\n return event.target;\n}"],"names":["activeElement","doc","element","contains","parent","child","rootNode","isShadowRoot","next","getTarget","event"],"mappings":";AACO,SAASA,EAAcC,GAAK;AACjC,MAAIC,IAAUD,EAAI;AAClB,SAAOC,GAAS,YAAY,iBAAiB;AAC3C,IAAAA,IAAUA,EAAQ,WAAW;AAE/B,SAAOA;AACT;AACO,SAASC,EAASC,GAAQC,GAAO;AACtC,MAAI,CAACD,KAAU,CAACC;AACd,WAAO;AAET,QAAMC,IAAWD,EAAM,cAAW;AAGlC,MAAID,EAAO,SAASC,CAAK;AACvB,WAAO;AAIT,MAAIC,KAAYC,EAAaD,CAAQ,GAAG;AACtC,QAAIE,IAAOH;AACX,WAAOG,KAAM;AACX,UAAIJ,MAAWI;AACb,eAAO;AAET,MAAAA,IAAOA,EAAK,cAAcA,EAAK;AAAA,IACjC;AAAA,EACF;AACA,SAAO;AACT;AACO,SAASC,EAAUC,GAAO;AAC/B,SAAI,kBAAkBA,IACbA,EAAM,aAAY,EAAG,CAAC,IAKxBA,EAAM;AACf;","x_google_ignoreList":[0]}
package/dist/index315.js CHANGED
@@ -1,36 +1,7 @@
1
- import a from "./index163.js";
2
- import t from "./index165.js";
3
- function i(e, n, o) {
4
- n === void 0 && (n = {});
5
- var r = new a(o);
6
- if (n.v2) {
7
- if (!e.countryCallingCode)
8
- throw new Error("Invalid phone number object passed");
9
- r.selectNumberingPlan(e.country || e.countryCallingCode);
10
- } else {
11
- if (!e.phone)
12
- return !1;
13
- if (e.country) {
14
- if (!r.hasCountry(e.country))
15
- throw new Error("Unknown country: ".concat(e.country));
16
- r.selectNumberingPlan(e.country);
17
- } else {
18
- if (!e.countryCallingCode)
19
- throw new Error("Invalid phone number object passed");
20
- r.selectNumberingPlan(e.countryCallingCode);
21
- }
22
- }
23
- if (r.possibleLengths())
24
- return l(e.phone || e.nationalNumber, r);
25
- if (e.countryCallingCode && r.isNonGeographicCallingCode(e.countryCallingCode))
26
- return !0;
27
- throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
28
- }
29
- function l(e, n) {
30
- return t(e, void 0, n) === "IS_POSSIBLE";
31
- }
1
+ import * as e from "react";
2
+ const t = /* @__PURE__ */ e.createContext(void 0);
3
+ process.env.NODE_ENV !== "production" && (t.displayName = "SelectPortalContext");
32
4
  export {
33
- i as default,
34
- l as isPossibleNumber
5
+ t as SelectPortalContext
35
6
  };
36
7
  //# sourceMappingURL=index315.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index315.js","sources":["../../../node_modules/libphonenumber-js/es6/isPossible.js"],"sourcesContent":["import Metadata from './metadata.js';\nimport checkNumberLength from './helpers/checkNumberLength.js';\n\n/**\r\n * Checks if a phone number is \"possible\" (basically just checks its length).\r\n *\r\n * isPossible(phoneNumberInstance, { ..., v2: true }, metadata)\r\n *\r\n * isPossible({ phone: '8005553535', country: 'RU' }, { ... }, metadata)\r\n * isPossible({ phone: '8005553535', country: 'RU' }, undefined, metadata)\r\n *\r\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\r\n * @param {object} [options]\r\n * @param {object} metadataJson\r\n * @return {string}\r\n */\nexport default function isPossiblePhoneNumber(input, options, metadataJson) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n var metadata = new Metadata(metadataJson);\n if (options.v2) {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n metadata.selectNumberingPlan(input.country || input.countryCallingCode);\n } else {\n if (!input.phone) {\n return false;\n }\n if (input.country) {\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n metadata.selectNumberingPlan(input.country);\n } else {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n metadata.selectNumberingPlan(input.countryCallingCode);\n }\n }\n\n // Old (legacy) metadata (< 1.0.18) had no \"possible length\" data.\n // So `isPossibleNumber()` function is supported only for non-legacy metadata.\n if (metadata.possibleLengths()) {\n return isPossibleNumber(input.phone || input.nationalNumber, metadata);\n }\n\n // There was a bug in versions from `1.7.35` to `1.7.37` of `libphonenumber-js`\n // where \"possible_lengths\" property was missing from \"non-geographical\" numbering plans' metadata.\n // After that, the bug was noticed and fixed.\n // So for versions from `1.7.35` to `1.7.37`, just assume that all \"non=geotraphical\" numbers are possible.\n // The reason is that the bug was noticed relatively quickly (within a day or so)\n // and it's unlikely that anyone generated their custom metadata in that short time span.\n // And if they didn't generate any custom metadata then a follow-up package update would've silently fixed the bug.\n if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {\n return true;\n }\n\n // `isPossibleNumber()` function is not supported.\n throw new Error('Missing \"possibleLengths\" in metadata. Perhaps the metadata has been generated before v1.0.18.');\n}\n\n/**\r\n * Tells if a given national (significant) number is possible\r\n * @param {string} nationalNumber\r\n * @param {Metadata} metadata = Metadata instance with a pre-selected telephone numbering plan.\r\n * @returns {boolean}\r\n */\nexport function isPossibleNumber(nationalNumber, metadata) {\n switch (checkNumberLength(nationalNumber, undefined, metadata)) {\n case 'IS_POSSIBLE':\n return true;\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n // \treturn !isInternational\n default:\n return false;\n }\n}\n//# sourceMappingURL=isPossible.js.map"],"names":["isPossiblePhoneNumber","input","options","metadataJson","metadata","Metadata","isPossibleNumber","nationalNumber","checkNumberLength"],"mappings":";;AAgBe,SAASA,EAAsBC,GAAOC,GAASC,GAAc;AAE1E,EAAID,MAAY,WACdA,IAAU,CAAA;AAEZ,MAAIE,IAAW,IAAIC,EAASF,CAAY;AACxC,MAAID,EAAQ,IAAI;AACd,QAAI,CAACD,EAAM;AACT,YAAM,IAAI,MAAM,oCAAoC;AAEtD,IAAAG,EAAS,oBAAoBH,EAAM,WAAWA,EAAM,kBAAkB;AAAA,EACxE,OAAO;AACL,QAAI,CAACA,EAAM;AACT,aAAO;AAET,QAAIA,EAAM,SAAS;AACjB,UAAI,CAACG,EAAS,WAAWH,EAAM,OAAO;AACpC,cAAM,IAAI,MAAM,oBAAoB,OAAOA,EAAM,OAAO,CAAC;AAE3D,MAAAG,EAAS,oBAAoBH,EAAM,OAAO;AAAA,IAC5C,OAAO;AACL,UAAI,CAACA,EAAM;AACT,cAAM,IAAI,MAAM,oCAAoC;AAEtD,MAAAG,EAAS,oBAAoBH,EAAM,kBAAkB;AAAA,IACvD;AAAA,EACF;AAIA,MAAIG,EAAS;AACX,WAAOE,EAAiBL,EAAM,SAASA,EAAM,gBAAgBG,CAAQ;AAUvE,MAAIH,EAAM,sBAAsBG,EAAS,2BAA2BH,EAAM,kBAAkB;AAC1F,WAAO;AAIT,QAAM,IAAI,MAAM,gGAAgG;AAClH;AAQO,SAASK,EAAiBC,GAAgBH,GAAU;AACzD,SAAQI,EAAkBD,GAAgB,QAAWH,CAAQ,MACtD;AAST;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index315.js","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}"],"names":["SelectPortalContext","React"],"mappings":";AAIY,MAACA,IAAmC,gBAAAC,EAAM,cAAc,MAAS;AACzE,QAAQ,IAAI,aAAa,iBAAcD,EAAoB,cAAc;","x_google_ignoreList":[0]}
package/dist/index316.js CHANGED
@@ -1,15 +1,82 @@
1
- import n from "./index163.js";
2
- import l from "./index333.js";
3
- import o from "./index317.js";
4
- function i(e, a, t) {
5
- a = a || {};
6
- var r = new n(t);
7
- if (r.selectNumberingPlan(e.country || e.countryCallingCode), r.hasTypes())
8
- return o(e, a, r.metadata) !== void 0;
9
- var m = a.v2 ? e.nationalNumber : e.phone;
10
- return l(m, r.nationalNumberPattern());
1
+ import * as a from "react";
2
+ import { useRefWithInit as T } from "./index279.js";
3
+ import { useStableCallback as l } from "./index285.js";
4
+ import { useIsoLayoutEffect as f } from "./index284.js";
5
+ import { CompositeListContext as b } from "./index371.js";
6
+ import { j as D } from "./index30.js";
7
+ function k(h) {
8
+ const {
9
+ children: N,
10
+ elementsRef: t,
11
+ labelsRef: o,
12
+ onMapChange: R
13
+ } = h, E = l(R), O = a.useRef(0), d = T(P).current, i = T(L).current, [p, M] = a.useState(0), c = a.useRef(p), C = l((e, u) => {
14
+ i.set(e, u ?? null), c.current += 1, M(c.current);
15
+ }), I = l((e) => {
16
+ i.delete(e), c.current += 1, M(c.current);
17
+ }), r = a.useMemo(() => {
18
+ const e = /* @__PURE__ */ new Map();
19
+ return Array.from(i.keys()).filter((n) => n.isConnected).sort(S).forEach((n, m) => {
20
+ const s = i.get(n) ?? {};
21
+ e.set(n, {
22
+ ...s,
23
+ index: m
24
+ });
25
+ }), e;
26
+ }, [i, p]);
27
+ f(() => {
28
+ if (typeof MutationObserver != "function" || r.size === 0)
29
+ return;
30
+ const e = new MutationObserver((u) => {
31
+ const n = /* @__PURE__ */ new Set(), m = (s) => n.has(s) ? n.delete(s) : n.add(s);
32
+ u.forEach((s) => {
33
+ s.removedNodes.forEach(m), s.addedNodes.forEach(m);
34
+ }), n.size === 0 && (c.current += 1, M(c.current));
35
+ });
36
+ return r.forEach((u, n) => {
37
+ n.parentElement && e.observe(n.parentElement, {
38
+ childList: !0
39
+ });
40
+ }), () => {
41
+ e.disconnect();
42
+ };
43
+ }, [r]), f(() => {
44
+ c.current === p && (t.current.length !== r.size && (t.current.length = r.size), o && o.current.length !== r.size && (o.current.length = r.size), O.current = r.size), E(r);
45
+ }, [E, r, t, o, p]), f(() => () => {
46
+ t.current = [];
47
+ }, [t]), f(() => () => {
48
+ o && (o.current = []);
49
+ }, [o]);
50
+ const g = l((e) => (d.add(e), () => {
51
+ d.delete(e);
52
+ }));
53
+ f(() => {
54
+ d.forEach((e) => e(r));
55
+ }, [d, r]);
56
+ const _ = a.useMemo(() => ({
57
+ register: C,
58
+ unregister: I,
59
+ subscribeMapChange: g,
60
+ elementsRef: t,
61
+ labelsRef: o,
62
+ nextIndexRef: O
63
+ }), [C, I, g, t, o, O]);
64
+ return /* @__PURE__ */ D.jsx(b.Provider, {
65
+ value: _,
66
+ children: N
67
+ });
68
+ }
69
+ function L() {
70
+ return /* @__PURE__ */ new Map();
71
+ }
72
+ function P() {
73
+ return /* @__PURE__ */ new Set();
74
+ }
75
+ function S(h, N) {
76
+ const t = h.compareDocumentPosition(N);
77
+ return t & Node.DOCUMENT_POSITION_FOLLOWING || t & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : t & Node.DOCUMENT_POSITION_PRECEDING || t & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
11
78
  }
12
79
  export {
13
- i as default
80
+ k as CompositeList
14
81
  };
15
82
  //# sourceMappingURL=index316.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index316.js","sources":["../../../node_modules/libphonenumber-js/es6/isValid.js"],"sourcesContent":["import Metadata from './metadata.js';\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport getNumberType from './helpers/getNumberType.js';\n\n/**\r\n * Checks if a given phone number is valid.\r\n *\r\n * isValid(phoneNumberInstance, { ..., v2: true }, metadata)\r\n *\r\n * isPossible({ phone: '8005553535', country: 'RU' }, { ... }, metadata)\r\n * isPossible({ phone: '8005553535', country: 'RU' }, undefined, metadata)\r\n *\r\n * If the `number` is a string, it will be parsed to an object,\r\n * but only if it contains only valid phone number characters (including punctuation).\r\n * If the `number` is an object, it is used as is.\r\n *\r\n * The optional `defaultCountry` argument is the default country.\r\n * I.e. it does not restrict to just that country,\r\n * e.g. in those cases where several countries share\r\n * the same phone numbering rules (NANPA, Britain, etc).\r\n * For example, even though the number `07624 369230`\r\n * belongs to the Isle of Man (\"IM\" country code)\r\n * calling `isValidNumber('07624369230', 'GB', metadata)`\r\n * still returns `true` because the country is not restricted to `GB`,\r\n * it's just that `GB` is the default one for the phone numbering rules.\r\n * For restricting the country see `isValidNumberForRegion()`\r\n * though restricting a country might not be a good idea.\r\n * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\r\n *\r\n * Examples:\r\n *\r\n * ```js\r\n * isValidNumber('+78005553535', metadata)\r\n * isValidNumber('8005553535', 'RU', metadata)\r\n * isValidNumber('88005553535', 'RU', metadata)\r\n * isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)\r\n * ```\r\n */\nexport default function isValidNumber(input, options, metadataJson) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(input.country || input.countryCallingCode);\n\n // By default, countries only have type regexps when it's required for\n // distinguishing different countries having the same `countryCallingCode`.\n if (metadata.hasTypes()) {\n return getNumberType(input, options, metadata.metadata) !== undefined;\n }\n\n // If there are no type regexps for this country in metadata then use\n // `nationalNumberPattern` as a \"better than nothing\" replacement.\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n return matchesEntirely(nationalNumber, metadata.nationalNumberPattern());\n}\n//# sourceMappingURL=isValid.js.map"],"names":["isValidNumber","input","options","metadataJson","metadata","Metadata","getNumberType","nationalNumber","matchesEntirely"],"mappings":";;;AAsCe,SAASA,EAAcC,GAAOC,GAASC,GAAc;AAGlE,EAAAD,IAAUA,KAAW,CAAA;AACrB,MAAIE,IAAW,IAAIC,EAASF,CAAY;AAKxC,MAJAC,EAAS,oBAAoBH,EAAM,WAAWA,EAAM,kBAAkB,GAIlEG,EAAS;AACX,WAAOE,EAAcL,GAAOC,GAASE,EAAS,QAAQ,MAAM;AAK9D,MAAIG,IAAiBL,EAAQ,KAAKD,EAAM,iBAAiBA,EAAM;AAC/D,SAAOO,EAAgBD,GAAgBH,EAAS,sBAAqB,CAAE;AACzE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index316.js","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(_) {}"],"names":["CompositeList","props","children","elementsRef","labelsRef","onMapChangeProp","onMapChange","useStableCallback","nextIndexRef","React","listeners","useRefWithInit","createListeners","map","createMap","mapTick","setMapTick","lastTickRef","register","node","metadata","unregister","sortedMap","newMap","sortByDocumentPosition","index","useIsoLayoutEffect","mutationObserver","entries","diff","updateDiff","entry","_","subscribeMapChange","fn","l","contextValue","_jsx","CompositeListContext","a","b","position"],"mappings":";;;;;;AAaO,SAASA,EAAcC,GAAO;AACnC,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAaC;AAAA,EACjB,IAAMJ,GACEK,IAAcC,EAAkBF,CAAe,GAC/CG,IAAeC,EAAM,OAAO,CAAC,GAC7BC,IAAYC,EAAeC,CAAe,EAAE,SAU5CC,IAAMF,EAAeG,CAAS,EAAE,SAEhC,CAACC,GAASC,CAAU,IAAIP,EAAM,SAAS,CAAC,GACxCQ,IAAcR,EAAM,OAAOM,CAAO,GAClCG,IAAWX,EAAkB,CAACY,GAAMC,MAAa;AACrD,IAAAP,EAAI,IAAIM,GAAMC,KAAY,IAAI,GAC9BH,EAAY,WAAW,GACvBD,EAAWC,EAAY,OAAO;AAAA,EAChC,CAAC,GACKI,IAAad,EAAkB,CAAAY,MAAQ;AAC3C,IAAAN,EAAI,OAAOM,CAAI,GACfF,EAAY,WAAW,GACvBD,EAAWC,EAAY,OAAO;AAAA,EAChC,CAAC,GACKK,IAAYb,EAAM,QAAQ,MAAM;AAGpC,UAAMc,IAAS,oBAAI,IAAG;AAItB,WAD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