@rpcbase/ui 0.239.0 → 0.241.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 (268) hide show
  1. package/dist/components/I18nField/index.d.ts +2 -1
  2. package/dist/components/I18nField/index.d.ts.map +1 -1
  3. package/dist/index11.js +373 -335
  4. package/dist/index11.js.map +1 -1
  5. package/dist/index151.js +4 -4
  6. package/dist/index156.js +1 -1
  7. package/dist/index157.js +1 -1
  8. package/dist/index164.js +1 -1
  9. package/dist/index165.js +6 -6
  10. package/dist/index167.js +1 -1
  11. package/dist/index169.js +1 -1
  12. package/dist/index172.js +3 -3
  13. package/dist/index175.js +1 -1
  14. package/dist/index176.js +4 -4
  15. package/dist/index182.js +1 -1
  16. package/dist/index184.js +12 -12
  17. package/dist/index187.js +5 -5
  18. package/dist/index189.js +3 -3
  19. package/dist/index190.js +1 -1
  20. package/dist/index193.js +3 -3
  21. package/dist/index194.js +5 -5
  22. package/dist/index256.js +20 -14
  23. package/dist/index256.js.map +1 -1
  24. package/dist/index257.js +58 -146
  25. package/dist/index257.js.map +1 -1
  26. package/dist/index258.js +6 -30
  27. package/dist/index258.js.map +1 -1
  28. package/dist/index259.js +11 -9
  29. package/dist/index259.js.map +1 -1
  30. package/dist/index260.js +46 -44
  31. package/dist/index260.js.map +1 -1
  32. package/dist/index261.js +4 -12
  33. package/dist/index261.js.map +1 -1
  34. package/dist/index262.js +28 -43
  35. package/dist/index262.js.map +1 -1
  36. package/dist/index263.js +14 -93
  37. package/dist/index263.js.map +1 -1
  38. package/dist/index264.js +5 -86
  39. package/dist/index264.js.map +1 -1
  40. package/dist/index265.js +21 -105
  41. package/dist/index265.js.map +1 -1
  42. package/dist/index266.js +50 -51
  43. package/dist/index266.js.map +1 -1
  44. package/dist/index267.js +25 -11
  45. package/dist/index267.js.map +1 -1
  46. package/dist/index268.js +41 -37
  47. package/dist/index268.js.map +1 -1
  48. package/dist/index269.js +39 -8
  49. package/dist/index269.js.map +1 -1
  50. package/dist/index270.js +45 -117
  51. package/dist/index270.js.map +1 -1
  52. package/dist/index271.js +20 -17
  53. package/dist/index271.js.map +1 -1
  54. package/dist/index272.js +69 -14
  55. package/dist/index272.js.map +1 -1
  56. package/dist/index273.js +17 -3
  57. package/dist/index273.js.map +1 -1
  58. package/dist/index274.js +11 -36
  59. package/dist/index274.js.map +1 -1
  60. package/dist/index275.js +27 -20
  61. package/dist/index275.js.map +1 -1
  62. package/dist/index276.js +13 -9
  63. package/dist/index276.js.map +1 -1
  64. package/dist/index277.js +18 -8
  65. package/dist/index277.js.map +1 -1
  66. package/dist/index278.js +37 -20
  67. package/dist/index278.js.map +1 -1
  68. package/dist/index279.js +255 -59
  69. package/dist/index279.js.map +1 -1
  70. package/dist/index280.js +278 -6
  71. package/dist/index280.js.map +1 -1
  72. package/dist/index281.js +67 -10
  73. package/dist/index281.js.map +1 -1
  74. package/dist/index282.js +96 -47
  75. package/dist/index282.js.map +1 -1
  76. package/dist/index283.js +84 -4
  77. package/dist/index283.js.map +1 -1
  78. package/dist/index284.js +3 -29
  79. package/dist/index284.js.map +1 -1
  80. package/dist/index285.js +28 -15
  81. package/dist/index285.js.map +1 -1
  82. package/dist/index286.js +16 -5
  83. package/dist/index286.js.map +1 -1
  84. package/dist/index287.js +35 -22
  85. package/dist/index287.js.map +1 -1
  86. package/dist/index288.js +16 -51
  87. package/dist/index288.js.map +1 -1
  88. package/dist/index289.js +3 -25
  89. package/dist/index289.js.map +1 -1
  90. package/dist/index290.js +26 -41
  91. package/dist/index290.js.map +1 -1
  92. package/dist/index291.js +27 -38
  93. package/dist/index291.js.map +1 -1
  94. package/dist/index292.js +4 -45
  95. package/dist/index292.js.map +1 -1
  96. package/dist/index293.js +78 -20
  97. package/dist/index293.js.map +1 -1
  98. package/dist/index294.js +264 -65
  99. package/dist/index294.js.map +1 -1
  100. package/dist/index295.js +11 -17
  101. package/dist/index295.js.map +1 -1
  102. package/dist/index296.js +10 -11
  103. package/dist/index296.js.map +1 -1
  104. package/dist/index297.js +24 -26
  105. package/dist/index297.js.map +1 -1
  106. package/dist/index298.js +16 -13
  107. package/dist/index298.js.map +1 -1
  108. package/dist/index299.js +122 -15
  109. package/dist/index299.js.map +1 -1
  110. package/dist/index300.js +5 -36
  111. package/dist/index300.js.map +1 -1
  112. package/dist/index301.js +38 -260
  113. package/dist/index301.js.map +1 -1
  114. package/dist/index302.js +62 -275
  115. package/dist/index302.js.map +1 -1
  116. package/dist/index303.js +13 -68
  117. package/dist/index303.js.map +1 -1
  118. package/dist/index304.js +7 -99
  119. package/dist/index304.js.map +1 -1
  120. package/dist/index305.js +5 -83
  121. package/dist/index305.js.map +1 -1
  122. package/dist/index306.js +3 -3
  123. package/dist/index306.js.map +1 -1
  124. package/dist/index307.js +10 -29
  125. package/dist/index307.js.map +1 -1
  126. package/dist/index308.js +6 -15
  127. package/dist/index308.js.map +1 -1
  128. package/dist/index309.js +133 -34
  129. package/dist/index309.js.map +1 -1
  130. package/dist/index310.js +398 -15
  131. package/dist/index310.js.map +1 -1
  132. package/dist/index311.js +52 -3
  133. package/dist/index311.js.map +1 -1
  134. package/dist/index312.js +11 -26
  135. package/dist/index312.js.map +1 -1
  136. package/dist/index313.js +10 -27
  137. package/dist/index313.js.map +1 -1
  138. package/dist/index314.js +14 -4
  139. package/dist/index314.js.map +1 -1
  140. package/dist/index315.js +151 -75
  141. package/dist/index315.js.map +1 -1
  142. package/dist/index316.js +28 -267
  143. package/dist/index316.js.map +1 -1
  144. package/dist/index317.js +9 -11
  145. package/dist/index317.js.map +1 -1
  146. package/dist/index318.js +49 -11
  147. package/dist/index318.js.map +1 -1
  148. package/dist/index319.js +11 -25
  149. package/dist/index319.js.map +1 -1
  150. package/dist/index320.js +43 -15
  151. package/dist/index320.js.map +1 -1
  152. package/dist/index321.js +89 -119
  153. package/dist/index321.js.map +1 -1
  154. package/dist/index322.js +86 -5
  155. package/dist/index322.js.map +1 -1
  156. package/dist/index323.js +104 -39
  157. package/dist/index323.js.map +1 -1
  158. package/dist/index324.js +47 -60
  159. package/dist/index324.js.map +1 -1
  160. package/dist/index325.js +11 -13
  161. package/dist/index325.js.map +1 -1
  162. package/dist/index326.js +37 -7
  163. package/dist/index326.js.map +1 -1
  164. package/dist/index327.js +8 -5
  165. package/dist/index327.js.map +1 -1
  166. package/dist/index328.js +3 -3
  167. package/dist/index328.js.map +1 -1
  168. package/dist/index329.js +9 -10
  169. package/dist/index329.js.map +1 -1
  170. package/dist/index330.js +116 -7
  171. package/dist/index330.js.map +1 -1
  172. package/dist/index331.js +17 -133
  173. package/dist/index331.js.map +1 -1
  174. package/dist/index332.js +14 -398
  175. package/dist/index332.js.map +1 -1
  176. package/dist/index333.js +35 -51
  177. package/dist/index333.js.map +1 -1
  178. package/dist/index334.js +20 -11
  179. package/dist/index334.js.map +1 -1
  180. package/dist/index335.js +8 -11
  181. package/dist/index335.js.map +1 -1
  182. package/dist/index336.js +3 -3
  183. package/dist/index346.js +2 -2
  184. package/dist/index348.js +8 -8
  185. package/dist/index349.js +3 -3
  186. package/dist/index350.js +2 -2
  187. package/dist/index351.js +5 -5
  188. package/dist/index353.js +1 -1
  189. package/dist/index362.js +10 -19
  190. package/dist/index362.js.map +1 -1
  191. package/dist/index363.js +17 -4
  192. package/dist/index363.js.map +1 -1
  193. package/dist/index364.js +4 -6
  194. package/dist/index364.js.map +1 -1
  195. package/dist/index365.js +5 -11
  196. package/dist/index365.js.map +1 -1
  197. package/dist/index366.js +19 -15
  198. package/dist/index366.js.map +1 -1
  199. package/dist/index367.js +43 -19
  200. package/dist/index367.js.map +1 -1
  201. package/dist/index368.js +13 -40
  202. package/dist/index368.js.map +1 -1
  203. package/dist/index369.js +4 -17
  204. package/dist/index369.js.map +1 -1
  205. package/dist/index370.js +200 -4
  206. package/dist/index370.js.map +1 -1
  207. package/dist/index371.js +74 -197
  208. package/dist/index371.js.map +1 -1
  209. package/dist/index372.js +20 -77
  210. package/dist/index372.js.map +1 -1
  211. package/dist/index374.js +3 -3
  212. package/dist/index375.js +1 -1
  213. package/dist/index376.js +3 -3
  214. package/dist/index378.js +2 -2
  215. package/dist/index380.js +1 -1
  216. package/dist/index381.js +2 -2
  217. package/dist/index407.js +1 -1
  218. package/dist/index411.js +1 -1
  219. package/dist/index413.js +1 -1
  220. package/dist/index414.js +2 -2
  221. package/dist/index417.js +1 -1
  222. package/dist/index418.js +1 -1
  223. package/dist/index421.js +1 -1
  224. package/dist/index422.js +1 -1
  225. package/dist/index423.js +2 -16
  226. package/dist/index423.js.map +1 -1
  227. package/dist/index424.js +2 -29
  228. package/dist/index424.js.map +1 -1
  229. package/dist/index425.js +2 -13
  230. package/dist/index425.js.map +1 -1
  231. package/dist/index426.js +2 -7
  232. package/dist/index426.js.map +1 -1
  233. package/dist/index427.js +16 -2
  234. package/dist/index427.js.map +1 -1
  235. package/dist/index428.js +29 -2
  236. package/dist/index428.js.map +1 -1
  237. package/dist/index429.js +13 -2
  238. package/dist/index429.js.map +1 -1
  239. package/dist/index430.js +7 -2
  240. package/dist/index430.js.map +1 -1
  241. package/dist/index44.js +1 -1
  242. package/dist/index45.js +2 -2
  243. package/dist/index49.js +28 -28
  244. package/dist/index50.js +21 -21
  245. package/dist/index51.js +1 -1
  246. package/dist/index52.js +8 -8
  247. package/dist/index53.js +2 -2
  248. package/dist/index55.js +17 -17
  249. package/dist/index56.js +4 -4
  250. package/dist/index57.js +3 -3
  251. package/dist/index58.js +7 -7
  252. package/dist/index59.js +4 -4
  253. package/dist/index60.js +12 -12
  254. package/dist/index61.js +2 -2
  255. package/dist/index62.js +2 -2
  256. package/dist/index70.js +1 -1
  257. package/dist/index71.js +1 -1
  258. package/dist/index74.js +2 -6
  259. package/dist/index74.js.map +1 -1
  260. package/dist/index75.js +2 -8
  261. package/dist/index75.js.map +1 -1
  262. package/dist/index76.js +5 -5
  263. package/dist/index76.js.map +1 -1
  264. package/dist/index77.js +8 -2
  265. package/dist/index77.js.map +1 -1
  266. package/dist/index78.js +6 -2
  267. package/dist/index78.js.map +1 -1
  268. package/package.json +1 -1
package/dist/index266.js CHANGED
@@ -1,56 +1,55 @@
1
- import f from "./index270.js";
2
- function o(r) {
3
- "@babel/helpers - typeof";
4
- return o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
5
- return typeof e;
6
- } : function(e) {
7
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
8
- }, o(r);
9
- }
10
- function i(r, e) {
11
- var t = Object.keys(r);
12
- if (Object.getOwnPropertySymbols) {
13
- var n = Object.getOwnPropertySymbols(r);
14
- e && (n = n.filter(function(c) {
15
- return Object.getOwnPropertyDescriptor(r, c).enumerable;
16
- })), t.push.apply(t, n);
17
- }
18
- return t;
19
- }
20
- function u(r) {
21
- for (var e = 1; e < arguments.length; e++) {
22
- var t = arguments[e] != null ? arguments[e] : {};
23
- e % 2 ? i(Object(t), !0).forEach(function(n) {
24
- p(r, n, t[n]);
25
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : i(Object(t)).forEach(function(n) {
26
- Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
27
- });
28
- }
29
- return r;
30
- }
31
- function p(r, e, t) {
32
- return (e = b(e)) in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
33
- }
34
- function b(r) {
35
- var e = y(r, "string");
36
- return o(e) == "symbol" ? e : e + "";
37
- }
38
- function y(r, e) {
39
- if (o(r) != "object" || !r) return r;
40
- var t = r[Symbol.toPrimitive];
41
- if (t !== void 0) {
42
- var n = t.call(r, e);
43
- if (o(n) != "object") return n;
44
- throw new TypeError("@@toPrimitive must return a primitive value.");
1
+ import d from "./index191.js";
2
+ import * as n from "react";
3
+ import { NOOP as e, EMPTY_OBJECT as a } from "./index264.js";
4
+ import { DEFAULT_FIELD_ROOT_STATE as l, DEFAULT_FIELD_STATE_ATTRIBUTES as i, DEFAULT_VALIDITY_STATE as s } from "./index287.js";
5
+ const r = /* @__PURE__ */ n.createContext({
6
+ invalid: void 0,
7
+ name: void 0,
8
+ validityData: {
9
+ state: s,
10
+ errors: [],
11
+ error: "",
12
+ value: "",
13
+ initialValue: null
14
+ },
15
+ setValidityData: e,
16
+ disabled: void 0,
17
+ touched: i.touched,
18
+ setTouched: e,
19
+ dirty: i.dirty,
20
+ setDirty: e,
21
+ filled: i.filled,
22
+ setFilled: e,
23
+ focused: i.focused,
24
+ setFocused: e,
25
+ validate: () => null,
26
+ validationMode: "onSubmit",
27
+ validationDebounceTime: 0,
28
+ shouldValidateOnChange: () => !1,
29
+ state: l,
30
+ markedDirtyRef: {
31
+ current: !1
32
+ },
33
+ registerFieldControl: e,
34
+ validation: {
35
+ getValidationProps: (t = a) => t,
36
+ getInputValidationProps: (t = a) => t,
37
+ inputRef: {
38
+ current: null
39
+ },
40
+ commit: async () => {
41
+ }
45
42
  }
46
- return (e === "string" ? String : Number)(r);
47
- }
48
- function l(r, e, t) {
49
- return f(r, u(u({}, e), {}, {
50
- v2: !0
51
- }), t);
43
+ });
44
+ process.env.NODE_ENV !== "production" && (r.displayName = "FieldRootContext");
45
+ function m(t = !0) {
46
+ const o = n.useContext(r);
47
+ if (o.setValidityData === e && !t)
48
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : d(28));
49
+ return o;
52
50
  }
53
51
  export {
54
- l as default
52
+ r as FieldRootContext,
53
+ m as useFieldRootContext
55
54
  };
56
55
  //# sourceMappingURL=index266.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index266.js","sources":["../../../node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js"],"sourcesContent":["function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport parse from './parse.js';\nexport default function parsePhoneNumberWithError(text, options, metadata) {\n return parse(text, _objectSpread(_objectSpread({}, options), {}, {\n v2: true\n }), metadata);\n}\n//# sourceMappingURL=parsePhoneNumberWithError_.js.map"],"names":["_typeof","o","ownKeys","e","r","_objectSpread","_defineProperty","_toPropertyKey","t","i","_toPrimitive","parsePhoneNumberWithError","text","options","metadata","parse"],"mappings":";AAAA,SAASA,EAAQC,GAAG;AAAE;AAA2B,SAAOD,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAUC,GAAG;AAAE,WAAO,OAAOA;AAAA,EAAG,IAAI,SAAUA,GAAG;A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GAAG;AAAE,MAAIC,IAAIC,EAAaF,GAAG,QAAQ;AAAG,SAAmBR,EAAQS,CAAC,KAArB,WAAyBA,IAAIA,IAAI;AAAI;AAC5G,SAASC,EAAaF,GAAGJ,GAAG;AAAE,MAAgBJ,EAAQQ,CAAC,KAArB,YAA0B,CAACA,EAAG,QAAOA;AAAG,MAAIL,IAAIK,EAAE,OAAO,WAAW;AAAG,MAAeL,MAAX,QAAc;AAAE,QAAIM,IAAIN,EAAE,KAAKK,GAAGJ,CAAc;AAAG,QAAgBJ,EAAQS,CAAC,KAArB,SAAwB,QAAOA;AAAG,UAAM,IAAI,UAAU,8CAA8C;AAAA,EAAG;AAAE,UAAqBL,MAAb,WAAiB,SAAS,QAAQI,CAAC;AAAG;AAE5S,SAASG,EAA0BC,GAAMC,GAASC,GAAU;AACzE,SAAOC,EAAMH,GAAMP,EAAcA,EAAc,IAAIQ,CAAO,GAAG,IAAI;AAAA,IAC/D,IAAI;AAAA,EACR,CAAG,GAAGC,CAAQ;AACd;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index266.js","sources":["../../../node_modules/@base-ui/react/esm/internals/field-root-context/FieldRootContext.js"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { NOOP } from \"../noop.js\";\nimport { DEFAULT_FIELD_ROOT_STATE, DEFAULT_FIELD_STATE_ATTRIBUTES, DEFAULT_VALIDITY_STATE } from \"../field-constants/constants.js\";\nexport const FieldRootContext = /*#__PURE__*/React.createContext({\n invalid: undefined,\n name: undefined,\n validityData: {\n state: DEFAULT_VALIDITY_STATE,\n errors: [],\n error: '',\n value: '',\n initialValue: null\n },\n setValidityData: NOOP,\n disabled: undefined,\n touched: DEFAULT_FIELD_STATE_ATTRIBUTES.touched,\n setTouched: NOOP,\n dirty: DEFAULT_FIELD_STATE_ATTRIBUTES.dirty,\n setDirty: NOOP,\n filled: DEFAULT_FIELD_STATE_ATTRIBUTES.filled,\n setFilled: NOOP,\n focused: DEFAULT_FIELD_STATE_ATTRIBUTES.focused,\n setFocused: NOOP,\n validate: () => null,\n validationMode: 'onSubmit',\n validationDebounceTime: 0,\n shouldValidateOnChange: () => false,\n state: DEFAULT_FIELD_ROOT_STATE,\n markedDirtyRef: {\n current: false\n },\n registerFieldControl: NOOP,\n validation: {\n getValidationProps: (props = EMPTY_OBJECT) => props,\n getInputValidationProps: (props = EMPTY_OBJECT) => props,\n inputRef: {\n current: null\n },\n commit: async () => {}\n }\n});\nif (process.env.NODE_ENV !== \"production\") FieldRootContext.displayName = \"FieldRootContext\";\nexport function useFieldRootContext(optional = true) {\n const context = React.useContext(FieldRootContext);\n if (context.setValidityData === NOOP && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.' : _formatErrorMessage(28));\n }\n return context;\n}"],"names":["FieldRootContext","React","DEFAULT_VALIDITY_STATE","NOOP","DEFAULT_FIELD_STATE_ATTRIBUTES","DEFAULT_FIELD_ROOT_STATE","props","EMPTY_OBJECT","useFieldRootContext","optional","context","_formatErrorMessage"],"mappings":";;;;AAOY,MAACA,IAAgC,gBAAAC,EAAM,cAAc;AAAA,EAC/D,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAAA,IACZ,OAAOC;AAAA,IACP,QAAQ,CAAA;AAAA,IACR,OAAO;AAAA,IACP,OAAO;AAAA,IACP,cAAc;AAAA,EAClB;AAAA,EACE,iBAAiBC;AAAA,EACjB,UAAU;AAAA,EACV,SAASC,EAA+B;AAAA,EACxC,YAAYD;AAAA,EACZ,OAAOC,EAA+B;AAAA,EACtC,UAAUD;AAAA,EACV,QAAQC,EAA+B;AAAA,EACvC,WAAWD;AAAA,EACX,SAASC,EAA+B;AAAA,EACxC,YAAYD;AAAA,EACZ,UAAU,MAAM;AAAA,EAChB,gBAAgB;AAAA,EAChB,wBAAwB;AAAA,EACxB,wBAAwB,MAAM;AAAA,EAC9B,OAAOE;AAAA,EACP,gBAAgB;AAAA,IACd,SAAS;AAAA,EACb;AAAA,EACE,sBAAsBF;AAAA,EACtB,YAAY;AAAA,IACV,oBAAoB,CAACG,IAAQC,MAAiBD;AAAA,IAC9C,yBAAyB,CAACA,IAAQC,MAAiBD;AAAA,IACnD,UAAU;AAAA,MACR,SAAS;AAAA,IACf;AAAA,IACI,QAAQ,YAAY;AAAA,IAAC;AAAA,EACzB;AACA,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcN,EAAiB,cAAc;AACnE,SAASQ,EAAoBC,IAAW,IAAM;AACnD,QAAMC,IAAUT,EAAM,WAAWD,CAAgB;AACjD,MAAIU,EAAQ,oBAAoBP,KAAQ,CAACM;AACvC,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,0FAA0FE,EAAoB,EAAE,CAAC;AAE3K,SAAOD;AACT;","x_google_ignoreList":[0]}
package/dist/index267.js CHANGED
@@ -1,15 +1,29 @@
1
- function f(r, t) {
2
- r = r.split("-"), t = t.split("-");
3
- for (var N = r[0].split("."), s = t[0].split("."), e = 0; e < 3; e++) {
4
- var i = Number(N[e]), u = Number(s[e]);
5
- if (i > u) return 1;
6
- if (u > i) return -1;
7
- if (!isNaN(i) && isNaN(u)) return 1;
8
- if (isNaN(i) && !isNaN(u)) return -1;
9
- }
10
- return r[1] && t[1] ? r[1] > t[1] ? 1 : r[1] < t[1] ? -1 : 0 : !r[1] && t[1] ? 1 : r[1] && !t[1] ? -1 : 0;
1
+ import * as f from "react";
2
+ import { useIsoLayoutEffect as l } from "./index261.js";
3
+ import { useFieldRootContext as d } from "./index266.js";
4
+ function p(o, c) {
5
+ const {
6
+ enabled: n = !0,
7
+ getValue: u,
8
+ id: i,
9
+ value: s
10
+ } = c, {
11
+ registerFieldControl: e
12
+ } = d(), t = f.useRef(null);
13
+ t.current || (t.current = /* @__PURE__ */ Symbol()), l(() => {
14
+ const r = t.current;
15
+ if (!(!r || !n))
16
+ return e(r, {
17
+ controlRef: o,
18
+ getValue: u,
19
+ id: i,
20
+ value: s
21
+ }), () => {
22
+ e(r, void 0);
23
+ };
24
+ }, [o, n, u, i, e, s]);
11
25
  }
12
26
  export {
13
- f as default
27
+ p as useRegisterFieldControl
14
28
  };
15
29
  //# sourceMappingURL=index267.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index267.js","sources":["../../../node_modules/libphonenumber-js/es6/tools/semver-compare.js"],"sourcesContent":["// Copy-pasted from:\n// https://github.com/substack/semver-compare/blob/master/index.js\n//\n// Inlining this function because some users reported issues with\n// importing from `semver-compare` in a browser with ES6 \"native\" modules.\n//\n// Fixes `semver-compare` not being able to compare versions with alpha/beta/etc \"tags\".\n// https://github.com/catamphetamine/libphonenumber-js/issues/381\nexport default function (a, b) {\n a = a.split('-');\n b = b.split('-');\n var pa = a[0].split('.');\n var pb = b[0].split('.');\n for (var i = 0; i < 3; i++) {\n var na = Number(pa[i]);\n var nb = Number(pb[i]);\n if (na > nb) return 1;\n if (nb > na) return -1;\n if (!isNaN(na) && isNaN(nb)) return 1;\n if (isNaN(na) && !isNaN(nb)) return -1;\n }\n if (a[1] && b[1]) {\n return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0;\n }\n return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;\n}\n//# sourceMappingURL=semver-compare.js.map"],"names":["compare","a","b","pa","pb","i","na","nb"],"mappings":"AAQe,SAAAA,EAAUC,GAAGC,GAAG;AAC7B,EAAAD,IAAIA,EAAE,MAAM,GAAG,GACfC,IAAIA,EAAE,MAAM,GAAG;AAGf,WAFIC,IAAKF,EAAE,CAAC,EAAE,MAAM,GAAG,GACnBG,IAAKF,EAAE,CAAC,EAAE,MAAM,GAAG,GACdG,IAAI,GAAGA,IAAI,GAAGA,KAAK;AAC1B,QAAIC,IAAK,OAAOH,EAAGE,CAAC,CAAC,GACjBE,IAAK,OAAOH,EAAGC,CAAC,CAAC;AACrB,QAAIC,IAAKC,EAAI,QAAO;AACpB,QAAIA,IAAKD,EAAI,QAAO;AACpB,QAAI,CAAC,MAAMA,CAAE,KAAK,MAAMC,CAAE,EAAG,QAAO;AACpC,QAAI,MAAMD,CAAE,KAAK,CAAC,MAAMC,CAAE,EAAG,QAAO;AAAA,EACtC;AACA,SAAIN,EAAE,CAAC,KAAKC,EAAE,CAAC,IACND,EAAE,CAAC,IAAIC,EAAE,CAAC,IAAI,IAAID,EAAE,CAAC,IAAIC,EAAE,CAAC,IAAI,KAAK,IAEvC,CAACD,EAAE,CAAC,KAAKC,EAAE,CAAC,IAAI,IAAID,EAAE,CAAC,KAAK,CAACC,EAAE,CAAC,IAAI,KAAK;AAClD;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index267.js","sources":["../../../node_modules/@base-ui/react/esm/internals/field-register-control/useRegisterFieldControl.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useFieldRootContext } from \"../field-root-context/FieldRootContext.js\";\nexport function useRegisterFieldControl(controlRef, params) {\n const {\n enabled = true,\n getValue,\n id,\n value\n } = params;\n const {\n registerFieldControl\n } = useFieldRootContext();\n const sourceRef = React.useRef(null);\n if (!sourceRef.current) {\n sourceRef.current = Symbol();\n }\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n if (!source || !enabled) {\n return undefined;\n }\n registerFieldControl(source, {\n controlRef,\n getValue,\n id,\n value\n });\n return () => {\n registerFieldControl(source, undefined);\n };\n }, [controlRef, enabled, getValue, id, registerFieldControl, value]);\n}"],"names":["useRegisterFieldControl","controlRef","params","enabled","getValue","id","value","registerFieldControl","useFieldRootContext","sourceRef","React","useIsoLayoutEffect","source"],"mappings":";;;AAKO,SAASA,EAAwBC,GAAYC,GAAQ;AAC1D,QAAM;AAAA,IACJ,SAAAC,IAAU;AAAA,IACV,UAAAC;AAAA,IACA,IAAAC;AAAA,IACA,OAAAC;AAAA,EACJ,IAAMJ,GACE;AAAA,IACJ,sBAAAK;AAAA,EACJ,IAAMC,EAAmB,GACjBC,IAAYC,EAAM,OAAO,IAAI;AACnC,EAAKD,EAAU,YACbA,EAAU,UAAU,uBAAM,IAE5BE,EAAmB,MAAM;AACvB,UAAMC,IAASH,EAAU;AACzB,QAAI,GAACG,KAAU,CAACT;AAGhB,aAAAI,EAAqBK,GAAQ;AAAA,QAC3B,YAAAX;AAAA,QACA,UAAAG;AAAA,QACA,IAAAC;AAAA,QACA,OAAAC;AAAA,MACN,CAAK,GACM,MAAM;AACX,QAAAC,EAAqBK,GAAQ,MAAS;AAAA,MACxC;AAAA,EACF,GAAG,CAACX,GAAYE,GAASC,GAAUC,GAAIE,GAAsBD,CAAK,CAAC;AACrE;","x_google_ignoreList":[0]}
package/dist/index268.js CHANGED
@@ -1,41 +1,45 @@
1
- import { parseDigit as i } from "./index158.js";
2
- function u(e, t) {
3
- var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
4
- if (r) return (r = r.call(e)).next.bind(r);
5
- if (Array.isArray(e) || (r = l(e)) || t) {
6
- r && (e = r);
7
- var n = 0;
8
- return function() {
9
- return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
10
- };
11
- }
12
- throw new TypeError(`Invalid attempt to iterate non-iterable instance.
13
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
14
- }
15
- function l(e, t) {
16
- if (e) {
17
- if (typeof e == "string") return o(e, t);
18
- var r = {}.toString.call(e).slice(8, -1);
19
- return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? o(e, t) : void 0;
20
- }
21
- }
22
- function o(e, t) {
23
- (t == null || t > e.length) && (t = e.length);
24
- for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
25
- return n;
26
- }
27
- function c(e) {
28
- for (var t = "", r = u(e.split("")), n; !(n = r()).done; ) {
29
- var a = n.value;
30
- t += f(a, t) || "";
31
- }
32
- return t;
33
- }
34
- function f(e, t, r) {
35
- return e === "+" ? t ? void 0 : "+" : i(e);
1
+ import * as i from "react";
2
+ import { useIsoLayoutEffect as b } from "./index261.js";
3
+ import { useStableCallback as R } from "./index262.js";
4
+ import { useRefWithInit as E } from "./index258.js";
5
+ import { isElement as x } from "./index309.js";
6
+ import { useBaseUiId as C } from "./index178.js";
7
+ import { useLabelableContext as g } from "./index286.js";
8
+ import { NOOP as p } from "./index264.js";
9
+ function F(I = {}) {
10
+ const {
11
+ id: e,
12
+ implicit: l = !1,
13
+ controlRef: s
14
+ } = I, {
15
+ controlId: c,
16
+ registerControlId: t
17
+ } = g(), o = C(e), d = l ? c : void 0, u = E(() => /* @__PURE__ */ Symbol("labelable-control")), f = i.useRef(!1), a = i.useRef(e != null), n = R(() => {
18
+ !f.current || t === p || (f.current = !1, t(u.current, void 0));
19
+ });
20
+ return b(() => {
21
+ if (t === p)
22
+ return;
23
+ let r;
24
+ if (l) {
25
+ const m = s?.current;
26
+ x(m) && m.closest("label") != null ? r = e ?? null : r = d ?? o;
27
+ } else if (e != null)
28
+ a.current = !0, r = e;
29
+ else if (a.current)
30
+ r = o;
31
+ else {
32
+ n();
33
+ return;
34
+ }
35
+ if (r === void 0) {
36
+ n();
37
+ return;
38
+ }
39
+ f.current = !0, t(u.current, r);
40
+ }, [e, s, d, t, l, o, u, n]), i.useEffect(() => n, [n]), c ?? o;
36
41
  }
37
42
  export {
38
- c as default,
39
- f as parsePhoneNumberCharacter
43
+ F as useLabelableId
40
44
  };
41
45
  //# sourceMappingURL=index268.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index268.js","sources":["../../../node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport { parseDigit } from './helpers/parseDigits.js';\n\n/**\r\n * Parses phone number characters from a string.\r\n * Drops all punctuation leaving only digits and the leading `+` sign (if any).\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * // Outputs '8800555'.\r\n * parseIncompletePhoneNumber('8 (800) 555')\r\n * // Outputs '+7800555'.\r\n * parseIncompletePhoneNumber('+7 800 555')\r\n * ```\r\n */\nexport default function parseIncompletePhoneNumber(string) {\n var result = '';\n // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n result += parsePhoneNumberCharacter(character, result) || '';\n }\n return result;\n}\n\n/**\r\n * Parses next character while parsing phone number digits (including a `+`)\r\n * from text: discards everything except `+` and digits, and `+` is only allowed\r\n * at the start of a phone number.\r\n * For example, is used in `react-phone-number-input` where it uses\r\n * [`input-format`](https://gitlab.com/catamphetamine/input-format).\r\n * @param {string} character - Yet another character from raw input string.\r\n * @param {string?} prevParsedCharacters - Previous parsed characters.\r\n * @param {function?} eventListener - An optional \"on event\" function.\r\n * @return {string?} The parsed character.\r\n */\nexport function parsePhoneNumberCharacter(character, prevParsedCharacters, eventListener) {\n // Only allow a leading `+`.\n if (character === '+') {\n // If this `+` is not the first parsed character\n // then discard it.\n if (prevParsedCharacters) {\n // `eventListener` argument was added to this `export`ed function on Dec 26th, 2023.\n // Any 3rd-party code that used to `import` and call this function before that\n // won't be passing any `eventListener` argument.\n //\n // The addition of the `eventListener` argument was to fix the slightly-weird behavior\n // of parsing an input string when the user inputs something like `\"2+7\"\n // https://github.com/catamphetamine/react-phone-number-input/issues/437\n //\n // If the parser encounters an unexpected `+` in a string being parsed\n // then it simply discards that out-of-place `+` and any following characters.\n //\n if (typeof eventListener === 'function') {\n eventListener('end');\n }\n return;\n }\n return '+';\n }\n // Allow digits.\n return parseDigit(character);\n}\n//# sourceMappingURL=parseIncompletePhoneNumber.js.map"],"names":["_createForOfIteratorHelperLoose","r","e","t","_unsupportedIterableToArray","o","a","_arrayLikeToArray","parseIncompletePhoneNumber","string","result","_iterator","_step","character","parsePhoneNumberCharacter","prevParsedCharacters","eventListener","parseDigit"],"mappings":";AAAA,SAASA,EAAgCC,GAAGC,GAAG;AAAE,MAAIC,IAAmB,OAAO,SAAtB,OAAgCF,EAAE,OAAO,QAAQ,KAAKA,EAAE,YAAY;AAAG,MAAIE,EAAG,SAAQA,IAAIA,EAAE,KAAKF,CAAC,GAAG,KAAK,KAAKE,CAAC;AAAG,MAAI,MAAM,QAAQF,CAAC,MAAME,IAAIC,EAA4BH,CAAC,MAAMC,GAAuC;AAAE,IAAAC,MAAMF,IAAIE;AAAI,QAAIE,IAAI;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/react/esm/internals/labelable-provider/useLabelableId.js"],"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.js\";\nimport { useBaseUiId } from \"../useBaseUiId.js\";\nimport { useLabelableContext } from \"./LabelableContext.js\";\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}"],"names":["useLabelableId","params","id","implicit","controlRef","controlId","registerControlId","useLabelableContext","defaultId","useBaseUiId","controlIdForEffect","controlSourceRef","useRefWithInit","hasRegisteredRef","React","hadExplicitIdRef","unregisterControlId","useStableCallback","NOOP","useIsoLayoutEffect","nextId","elem","isElement"],"mappings":";;;;;;;;AAUO,SAASA,EAAeC,IAAS,IAAI;AAC1C,QAAM;AAAA,IACJ,IAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,YAAAC;AAAA,EACJ,IAAMH,GACE;AAAA,IACJ,WAAAI;AAAA,IACA,mBAAAC;AAAA,EACJ,IAAMC,EAAmB,GACjBC,IAAYC,EAAYP,CAAE,GAC1BQ,IAAqBP,IAAWE,IAAY,QAC5CM,IAAmBC,EAAe,MAAM,uBAAO,mBAAmB,CAAC,GACnEC,IAAmBC,EAAM,OAAO,EAAK,GACrCC,IAAmBD,EAAM,OAAOZ,KAAM,IAAI,GAC1Cc,IAAsBC,EAAkB,MAAM;AAClD,IAAI,CAACJ,EAAiB,WAAWP,MAAsBY,MAGvDL,EAAiB,UAAU,IAC3BP,EAAkBK,EAAiB,SAAS,MAAS;AAAA,EACvD,CAAC;AACD,SAAAQ,EAAmB,MAAM;AACvB,QAAIb,MAAsBY;AACxB;AAEF,QAAIE;AACJ,QAAIjB,GAAU;AACZ,YAAMkB,IAAOjB,GAAY;AACzB,MAAIkB,EAAUD,CAAI,KAAKA,EAAK,QAAQ,OAAO,KAAK,OAC9CD,IAASlB,KAAM,OAEfkB,IAASV,KAAsBF;AAAA,IAEnC,WAAWN,KAAM;AACf,MAAAa,EAAiB,UAAU,IAC3BK,IAASlB;AAAA,aACAa,EAAiB;AAC1B,MAAAK,IAASZ;AAAA,SACJ;AACL,MAAAQ,EAAmB;AACnB;AAAA,IACF;AACA,QAAII,MAAW,QAAW;AACxB,MAAAJ,EAAmB;AACnB;AAAA,IACF;AACA,IAAAH,EAAiB,UAAU,IAC3BP,EAAkBK,EAAiB,SAASS,CAAM;AAAA,EAEpD,GAAG,CAAClB,GAAIE,GAAYM,GAAoBJ,GAAmBH,GAAUK,GAAWG,GAAkBK,CAAmB,CAAC,GACtHF,EAAM,UAAU,MACPE,GACN,CAACA,CAAmB,CAAC,GACjBX,KAAaG;AACtB;","x_google_ignoreList":[0]}
package/dist/index269.js CHANGED
@@ -1,12 +1,43 @@
1
- function n(r) {
2
- var t = r.number, e = r.ext;
3
- if (!t)
4
- return "";
5
- if (t[0] !== "+")
6
- throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');
7
- return "tel:".concat(t).concat(e ? ";ext=" + e : "");
1
+ import * as a from "react";
2
+ import { useIsoLayoutEffect as c } from "./index261.js";
3
+ import { AnimationFrame as u } from "./index302.js";
4
+ function g(t, s = !1, f = !1) {
5
+ const [n, r] = a.useState(t && s ? "idle" : void 0), [i, d] = a.useState(t);
6
+ return t && !i && (d(!0), r("starting")), !t && i && n !== "ending" && !f && r("ending"), !t && !i && n === "ending" && r(void 0), c(() => {
7
+ if (!t && i && n !== "ending" && f) {
8
+ const e = u.request(() => {
9
+ r("ending");
10
+ });
11
+ return () => {
12
+ u.cancel(e);
13
+ };
14
+ }
15
+ }, [t, i, n, f]), c(() => {
16
+ if (!t || s)
17
+ return;
18
+ const e = u.request(() => {
19
+ r(void 0);
20
+ });
21
+ return () => {
22
+ u.cancel(e);
23
+ };
24
+ }, [s, t]), c(() => {
25
+ if (!t || !s)
26
+ return;
27
+ t && i && n !== "idle" && r("starting");
28
+ const e = u.request(() => {
29
+ r("idle");
30
+ });
31
+ return () => {
32
+ u.cancel(e);
33
+ };
34
+ }, [s, t, i, n]), {
35
+ mounted: i,
36
+ setMounted: d,
37
+ transitionStatus: n
38
+ };
8
39
  }
9
40
  export {
10
- n as formatRFC3966
41
+ g as useTransitionStatus
11
42
  };
12
43
  //# sourceMappingURL=index269.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index269.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js"],"sourcesContent":["function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport isViablePhoneNumber from './isViablePhoneNumber.js';\n\n// https://www.ietf.org/rfc/rfc3966.txt\n\n/**\r\n * @param {string} text - Phone URI (RFC 3966).\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\nexport function parseRFC3966(text) {\n var number;\n var ext;\n\n // Replace \"tel:\" with \"tel=\" for parsing convenience.\n text = text.replace(/^tel:/, 'tel=');\n for (var _iterator = _createForOfIteratorHelperLoose(text.split(';')), _step; !(_step = _iterator()).done;) {\n var part = _step.value;\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n switch (name) {\n case 'tel':\n number = value;\n break;\n case 'ext':\n ext = value;\n break;\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n break;\n }\n }\n\n // If the phone number is not viable, then abort.\n if (!isViablePhoneNumber(number)) {\n return {};\n }\n var result = {\n number: number\n };\n if (ext) {\n result.ext = ext;\n }\n return result;\n}\n\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\nexport function formatRFC3966(_ref) {\n var number = _ref.number,\n ext = _ref.ext;\n if (!number) {\n return '';\n }\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map"],"names":["formatRFC3966","_ref","number","ext"],"mappings":"AA6DO,SAASA,EAAcC,GAAM;AAClC,MAAIC,IAASD,EAAK,QAChBE,IAAMF,EAAK;AACb,MAAI,CAACC;AACH,WAAO;AAET,MAAIA,EAAO,CAAC,MAAM;AAChB,UAAM,IAAI,MAAM,2DAA+D;AAEjF,SAAO,OAAO,OAAOA,CAAM,EAAE,OAAOC,IAAM,UAAUA,IAAM,EAAE;AAC9D;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index269.js","sources":["../../../node_modules/@base-ui/react/esm/internals/useTransitionStatus.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\n/**\n * Provides a status string for CSS animations.\n * @param open - a boolean that determines if the element is open.\n * @param enableIdleState - a boolean that enables the `'idle'` state between `'starting'` and `'ending'`\n */\nexport function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) {\n const [transitionStatus, setTransitionStatus] = React.useState(open && enableIdleState ? 'idle' : undefined);\n const [mounted, setMounted] = React.useState(open);\n if (open && !mounted) {\n setMounted(true);\n setTransitionStatus('starting');\n }\n if (!open && mounted && transitionStatus !== 'ending' && !deferEndingState) {\n setTransitionStatus('ending');\n }\n if (!open && !mounted && transitionStatus === 'ending') {\n setTransitionStatus(undefined);\n }\n useIsoLayoutEffect(() => {\n if (!open && mounted && transitionStatus !== 'ending' && deferEndingState) {\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('ending');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }\n return undefined;\n }, [open, mounted, transitionStatus, deferEndingState]);\n useIsoLayoutEffect(() => {\n if (!open || enableIdleState) {\n return undefined;\n }\n const frame = AnimationFrame.request(() => {\n // Avoid `flushSync` here due to Firefox.\n // See https://github.com/mui/base-ui/pull/3424\n setTransitionStatus(undefined);\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open]);\n useIsoLayoutEffect(() => {\n if (!open || !enableIdleState) {\n return undefined;\n }\n if (open && mounted && transitionStatus !== 'idle') {\n setTransitionStatus('starting');\n }\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('idle');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open, mounted, transitionStatus]);\n return {\n mounted,\n setMounted,\n transitionStatus\n };\n}"],"names":["useTransitionStatus","open","enableIdleState","deferEndingState","transitionStatus","setTransitionStatus","React","mounted","setMounted","useIsoLayoutEffect","frame","AnimationFrame"],"mappings":";;;AAUO,SAASA,EAAoBC,GAAMC,IAAkB,IA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A,IACA,YAAAC;AAAA,IACA,kBAAAJ;AAAA,EACJ;AACA;","x_google_ignoreList":[0]}
package/dist/index270.js CHANGED
@@ -1,120 +1,48 @@
1
- import { MIN_LENGTH_FOR_NSN as g, MAX_LENGTH_FOR_NSN as h, PLUS_CHARS as P, VALID_DIGITS as d } from "./index160.js";
2
- import m from "./index264.js";
3
- import T, { getCountryCallingCode as O } from "./index164.js";
4
- import s, { isViablePhoneNumberStart as v } from "./index271.js";
5
- import w from "./index272.js";
6
- import y from "./index268.js";
7
- import { isPossibleNumber as S } from "./index258.js";
8
- import x from "./index165.js";
9
- import R from "./index273.js";
10
- import E from "./index262.js";
11
- import I from "./index274.js";
12
- import A from "./index168.js";
13
- import p from "./index275.js";
14
- var H = 250, L = new RegExp("[" + P + d + "]"), U = new RegExp("[^" + d + "#]+$");
15
- function Z(t, r, n) {
16
- if (r = r || {}, n = new T(n), r.defaultCountry && !n.hasCountry(r.defaultCountry))
17
- throw r.v2 ? new m("INVALID_COUNTRY") : new Error("Unknown country: ".concat(r.defaultCountry));
18
- var e = G(t, r.v2, r.extract), l = e.number, c = e.ext, i = e.error;
19
- if (!l) {
20
- if (r.v2)
21
- throw i === "TOO_SHORT" ? new m("TOO_SHORT") : new m("NOT_A_NUMBER");
22
- return {};
23
- }
24
- var a = D(l, r.defaultCountry, r.defaultCallingCode, n), o = a.country, u = a.nationalNumber, N = a.countryCallingCode, _ = a.countryCallingCodeSource, f = a.carrierCode;
25
- if (!n.hasSelectedNumberingPlan()) {
26
- if (r.v2)
27
- throw new m("INVALID_COUNTRY");
28
- return {};
29
- }
30
- if (!u || u.length < g) {
31
- if (r.v2)
32
- throw new m("TOO_SHORT");
33
- return {};
34
- }
35
- if (u.length > h) {
36
- if (r.v2)
37
- throw new m("TOO_LONG");
38
- return {};
39
- }
40
- if (r.v2) {
41
- var C = new x(N, u, n.metadata);
42
- return o && (C.country = o), f && (C.carrierCode = f), c && (C.ext = c), C.__countryCallingCodeSource = _, C;
43
- }
44
- var b = (r.extended ? n.hasSelectedNumberingPlan() : o) ? R(u, n.nationalNumberPattern()) : !1;
45
- return r.extended ? {
46
- country: o,
47
- countryCallingCode: N,
48
- carrierCode: f,
49
- valid: b,
50
- possible: b ? !0 : !!(r.extended === !0 && n.possibleLengths() && S(u, o, n)),
51
- phone: u,
52
- ext: c
53
- } : b ? M(o, u, c) : {};
54
- }
55
- function F(t, r, n) {
56
- if (t) {
57
- if (t.length > H) {
58
- if (n)
59
- throw new m("TOO_LONG");
60
- return;
61
- }
62
- if (r === !1)
63
- return t;
64
- var e = t.search(L);
65
- if (!(e < 0))
66
- return t.slice(e).replace(U, "");
67
- }
68
- }
69
- function G(t, r, n) {
70
- var e = p(t, {
71
- extractFormattedPhoneNumber: function(i) {
72
- return F(i, n, r);
73
- }
74
- });
75
- if (!e)
76
- return {};
77
- if (!s(e))
78
- return v(e) ? {
79
- error: "TOO_SHORT"
80
- } : {};
81
- var l = w(e);
82
- return l.ext ? l : {
83
- number: e
84
- };
85
- }
86
- function M(t, r, n) {
87
- var e = {
88
- country: t,
89
- phone: r
90
- };
91
- return n && (e.ext = n), e;
92
- }
93
- function D(t, r, n, e) {
94
- var l = E(y(t), void 0, r, n, e.metadata), c = l.countryCallingCodeSource, i = l.countryCallingCode, a = l.number, o;
95
- if (i)
96
- e.selectNumberingPlan(i);
97
- else if (a && (r || n))
98
- e.selectNumberingPlan(r, n), r && (o = r), i = n || O(r, e.metadata);
99
- else return {};
100
- if (!a)
101
- return {
102
- countryCallingCodeSource: c,
103
- countryCallingCode: i
104
- };
105
- var u = I(y(a), o, e), N = u.nationalNumber, _ = u.carrierCode, f = A(i, {
106
- nationalNumber: N,
107
- metadata: e
108
- });
109
- return f && (o = f, f === "001" || e.selectNumberingPlan(o)), {
110
- country: o,
111
- countryCallingCode: i,
112
- countryCallingCodeSource: c,
113
- nationalNumber: N,
114
- carrierCode: _
115
- };
116
- }
1
+ import { compareItemEquality as s } from "./index273.js";
2
+ import { hasNullItemLabel as u, stringifyAsValue as a } from "./index272.js";
3
+ import { createSelector as r } from "./index354.js";
4
+ const d = {
5
+ id: r((e) => e.id),
6
+ labelId: r((e) => e.labelId),
7
+ modal: r((e) => e.modal),
8
+ multiple: r((e) => e.multiple),
9
+ items: r((e) => e.items),
10
+ itemToStringLabel: r((e) => e.itemToStringLabel),
11
+ itemToStringValue: r((e) => e.itemToStringValue),
12
+ isItemEqualToValue: r((e) => e.isItemEqualToValue),
13
+ value: r((e) => e.value),
14
+ hasSelectedValue: r((e) => {
15
+ const {
16
+ value: l,
17
+ multiple: t,
18
+ itemToStringValue: o
19
+ } = e;
20
+ return l == null ? !1 : t && Array.isArray(l) ? l.length > 0 : a(l, o) !== "";
21
+ }),
22
+ hasNullItemLabel: r((e, l) => l ? u(e.items) : !1),
23
+ open: r((e) => e.open),
24
+ mounted: r((e) => e.mounted),
25
+ forceMount: r((e) => e.forceMount),
26
+ transitionStatus: r((e) => e.transitionStatus),
27
+ openMethod: r((e) => e.openMethod),
28
+ activeIndex: r((e) => e.activeIndex),
29
+ selectedIndex: r((e) => e.selectedIndex),
30
+ isActive: r((e, l) => e.activeIndex === l),
31
+ isSelected: r((e, l, t) => {
32
+ const o = e.isItemEqualToValue, i = e.value;
33
+ return e.multiple ? Array.isArray(i) && i.some((n) => s(t, n, o)) : e.selectedIndex === l && e.selectedIndex !== null ? !0 : s(t, i, o);
34
+ }),
35
+ isSelectedByFocus: r((e, l) => e.selectedIndex === l),
36
+ popupProps: r((e) => e.popupProps),
37
+ triggerProps: r((e) => e.triggerProps),
38
+ triggerElement: r((e) => e.triggerElement),
39
+ positionerElement: r((e) => e.positionerElement),
40
+ listElement: r((e) => e.listElement),
41
+ scrollUpArrowVisible: r((e) => e.scrollUpArrowVisible),
42
+ scrollDownArrowVisible: r((e) => e.scrollDownArrowVisible),
43
+ hasScrollArrows: r((e) => e.hasScrollArrows)
44
+ };
117
45
  export {
118
- Z as default
46
+ d as selectors
119
47
  };
120
48
  //# sourceMappingURL=index270.js.map