@okam/stack-ui 1.29.1 → 1.30.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 (412) hide show
  1. package/components/Accordion/components/AccordionItem.d.ts +1 -0
  2. package/components/Accordion/index.d.ts +2 -1
  3. package/components/Accordion/interface.d.ts +3 -2
  4. package/components/Alerts/components/AlertsCloseButton.d.ts +1 -1
  5. package/components/Alerts/index.d.ts +2 -1
  6. package/components/Alerts/interface.d.ts +4 -3
  7. package/components/Box/index.d.ts +3 -2
  8. package/components/Button/index.d.ts +8 -4
  9. package/components/Button/interface.d.ts +3 -2
  10. package/components/Calendar/index.d.ts +5 -1
  11. package/components/Calendar/interface.d.ts +2 -1
  12. package/components/Carousel/components/CarouselNavigationButton.d.ts +3 -3
  13. package/components/Date/index.d.ts +2 -1
  14. package/components/Date/interface.d.ts +2 -1
  15. package/components/Icon/index.d.ts +2 -1
  16. package/components/Icon/interface.d.ts +2 -1
  17. package/components/Lightbox/hooks/overlay/index.d.ts +75 -0
  18. package/components/Lightbox/index.d.ts +2 -1
  19. package/components/Lightbox/interface.d.ts +3 -2
  20. package/components/Menu/Menu.d.ts +2 -1
  21. package/components/Menu/interface.d.ts +5 -4
  22. package/components/Modal/index.d.ts +2 -1
  23. package/components/Modal/interface.d.ts +2 -1
  24. package/components/Popover/index.d.ts +2 -1
  25. package/components/Popover/interface.d.ts +3 -2
  26. package/components/ShareButton/index.d.ts +2 -1
  27. package/components/ShareButton/interface.d.ts +2 -2
  28. package/components/SidePanel/index.d.ts +3 -3
  29. package/components/SidePanel/interface.d.ts +5 -4
  30. package/components/Typography/index.d.ts +3 -2
  31. package/components/Video/index.d.ts +2 -1
  32. package/components/Video/interface.d.ts +2 -1
  33. package/components/WysiwygBlock/index.d.ts +2 -1
  34. package/components/WysiwygBlock/interface.d.ts +2 -1
  35. package/components/fields/Checkbox/Checkbox.interface.d.ts +2 -1
  36. package/components/fields/Checkbox/index.d.ts +2 -1
  37. package/components/fields/CheckboxGroup/index.d.ts +2 -1
  38. package/components/fields/CheckboxGroup/interface.d.ts +2 -1
  39. package/components/fields/DatePicker/index.d.ts +2 -1
  40. package/components/fields/DatePicker/interface.d.ts +2 -1
  41. package/components/fields/Radio/Radio.interface.d.ts +3 -2
  42. package/components/fields/Radio/index.d.ts +3 -2
  43. package/components/fields/RadioGroup/index.d.ts +2 -1
  44. package/components/fields/RadioGroup/interface.d.ts +2 -1
  45. package/components/fields/SearchField/index.d.ts +2 -1
  46. package/components/fields/SearchField/interface.d.ts +2 -1
  47. package/components/fields/Select/Select.d.ts +2 -1
  48. package/components/fields/Select/Select.interface.d.ts +3 -2
  49. package/components/fields/TextArea/index.d.ts +2 -1
  50. package/components/fields/TextInputField/interface.d.ts +3 -2
  51. package/index.d.ts +1 -0
  52. package/index.js +1 -1
  53. package/index.mjs +41 -38
  54. package/index100.js +1 -2
  55. package/index100.mjs +22 -21
  56. package/index101.js +2 -1
  57. package/index101.mjs +22 -63
  58. package/index102.js +1 -1
  59. package/index102.mjs +58 -24
  60. package/index103.js +1 -1
  61. package/index103.mjs +29 -52
  62. package/index104.js +1 -1
  63. package/index104.mjs +52 -4
  64. package/index105.js +1 -1
  65. package/index105.mjs +4 -11
  66. package/index106.js +1 -1
  67. package/index106.mjs +11 -14
  68. package/index107.js +1 -1
  69. package/index107.mjs +13 -22
  70. package/index108.js +1 -1
  71. package/index108.mjs +19 -19
  72. package/index109.js +1 -1
  73. package/index109.mjs +22 -38
  74. package/index11.js +1 -1
  75. package/index11.mjs +2 -2
  76. package/index110.js +1 -2
  77. package/index110.mjs +38 -12
  78. package/index111.js +2 -1
  79. package/index111.mjs +12 -7
  80. package/index112.js +1 -1
  81. package/index112.mjs +7 -21
  82. package/index113.js +1 -1
  83. package/index113.mjs +21 -38
  84. package/index114.js +1 -1
  85. package/index114.mjs +38 -49
  86. package/index115.js +1 -1
  87. package/index115.mjs +49 -40
  88. package/index116.js +1 -1
  89. package/index116.mjs +40 -13
  90. package/index117.js +1 -1
  91. package/index117.mjs +14 -26
  92. package/index118.js +1 -1
  93. package/index118.mjs +29 -18
  94. package/index119.js +1 -1
  95. package/index119.mjs +19 -8
  96. package/index120.js +1 -1
  97. package/index120.mjs +9 -30
  98. package/index121.js +1 -1
  99. package/index121.mjs +30 -15
  100. package/index122.js +1 -1
  101. package/index122.mjs +13 -15
  102. package/index123.js +1 -1
  103. package/index123.mjs +17 -21
  104. package/index124.js +1 -1
  105. package/index124.mjs +21 -11
  106. package/index125.js +1 -2
  107. package/index125.mjs +11 -22
  108. package/index126.js +2 -1
  109. package/index126.mjs +22 -12
  110. package/index127.js +1 -1
  111. package/index127.mjs +12 -46
  112. package/index128.js +1 -1
  113. package/index128.mjs +46 -241
  114. package/index129.js +1 -2
  115. package/index129.mjs +241 -13
  116. package/index13.js +1 -1
  117. package/index13.mjs +1 -1
  118. package/index130.js +2 -1
  119. package/index130.mjs +12 -29
  120. package/index131.js +1 -1
  121. package/index131.mjs +30 -51
  122. package/index132.js +1 -1
  123. package/index132.mjs +49 -25
  124. package/index133.js +1 -1
  125. package/index133.mjs +25 -19
  126. package/index134.js +1 -1
  127. package/index134.mjs +17 -58
  128. package/index135.js +1 -1
  129. package/index135.mjs +57 -90
  130. package/index136.js +1 -1
  131. package/index136.mjs +91 -28
  132. package/index137.js +1 -1
  133. package/index137.mjs +31 -119
  134. package/index138.js +1 -1
  135. package/index138.mjs +119 -25
  136. package/index139.js +1 -1
  137. package/index139.mjs +25 -122
  138. package/index14.js +1 -1
  139. package/index14.mjs +3 -3
  140. package/index140.js +1 -1
  141. package/index140.mjs +122 -132
  142. package/index141.js +1 -1
  143. package/index141.mjs +132 -12
  144. package/index142.js +1 -1
  145. package/index142.mjs +12 -93
  146. package/index143.js +1 -1
  147. package/index143.mjs +87 -98
  148. package/index144.js +1 -1
  149. package/index144.mjs +106 -5
  150. package/index145.js +1 -1
  151. package/index145.mjs +5 -3
  152. package/index146.js +1 -1
  153. package/index146.mjs +3 -125
  154. package/index147.js +1 -1
  155. package/index147.mjs +117 -21
  156. package/index148.js +1 -1
  157. package/index148.mjs +15 -37
  158. package/index149.js +1 -1
  159. package/index149.mjs +41 -34
  160. package/index150.js +1 -1
  161. package/index150.mjs +32 -25
  162. package/index151.js +1 -1
  163. package/index151.mjs +22 -98
  164. package/index152.js +1 -1
  165. package/index152.mjs +99 -63
  166. package/index153.js +1 -1
  167. package/index153.mjs +55 -79
  168. package/index154.js +1 -1
  169. package/index154.mjs +102 -98
  170. package/index155.js +1 -1
  171. package/index155.mjs +98 -200
  172. package/index156.js +1 -1
  173. package/index156.mjs +186 -51
  174. package/index157.js +1 -1
  175. package/index157.mjs +51 -128
  176. package/index158.js +1 -1
  177. package/index158.mjs +129 -107
  178. package/index159.js +1 -1
  179. package/index159.mjs +101 -199
  180. package/index16.js +1 -1
  181. package/index16.mjs +2 -2
  182. package/index160.js +1 -1
  183. package/index160.mjs +198 -171
  184. package/index161.js +1 -1
  185. package/index161.mjs +182 -61
  186. package/index162.js +1 -1
  187. package/index162.mjs +60 -249
  188. package/index163.js +1 -1
  189. package/index163.mjs +249 -88
  190. package/index164.js +1 -1
  191. package/index164.mjs +93 -170
  192. package/index165.js +1 -1
  193. package/index165.mjs +170 -80
  194. package/index166.js +1 -1
  195. package/index166.mjs +75 -49
  196. package/index167.js +1 -1
  197. package/index167.mjs +49 -117
  198. package/index168.js +1 -1
  199. package/index168.mjs +118 -108
  200. package/index169.js +1 -1
  201. package/index169.mjs +106 -112
  202. package/index170.js +1 -1
  203. package/index170.mjs +113 -63
  204. package/index171.js +1 -1
  205. package/index171.mjs +70 -108
  206. package/index172.js +1 -1
  207. package/index172.mjs +108 -50
  208. package/index173.js +1 -1
  209. package/index173.mjs +34 -75
  210. package/index174.js +1 -1
  211. package/index174.mjs +71 -48
  212. package/index175.js +1 -1
  213. package/index175.mjs +57 -43
  214. package/index176.js +1 -1
  215. package/index176.mjs +43 -86
  216. package/index177.js +1 -5
  217. package/index177.mjs +81 -62
  218. package/index178.js +5 -1
  219. package/index178.mjs +72 -2003
  220. package/index179.js +1 -1
  221. package/index179.mjs +2006 -54
  222. package/index18.js +1 -1
  223. package/index18.mjs +7 -7
  224. package/index180.js +1 -1
  225. package/index180.mjs +56 -185
  226. package/index181.js +1 -1
  227. package/index181.mjs +188 -5
  228. package/index182.js +1 -1
  229. package/index182.mjs +5 -130
  230. package/index183.js +1 -1
  231. package/index183.mjs +123 -172
  232. package/index184.js +1 -1
  233. package/index184.mjs +178 -8
  234. package/index185.js +1 -1
  235. package/index185.mjs +9 -3
  236. package/index186.js +1 -1
  237. package/index186.mjs +3 -36
  238. package/index187.js +1 -1
  239. package/index187.mjs +36 -5
  240. package/index188.js +1 -1
  241. package/index188.mjs +5 -29
  242. package/index189.js +1 -1
  243. package/index189.mjs +29 -6
  244. package/index19.js +1 -1
  245. package/index19.mjs +2 -2
  246. package/index190.js +1 -1
  247. package/index190.mjs +6 -313
  248. package/index191.js +1 -1
  249. package/index191.mjs +327 -179
  250. package/index192.js +1 -1
  251. package/index192.mjs +183 -8
  252. package/index193.js +1 -1
  253. package/index193.mjs +7 -25
  254. package/index194.js +1 -1
  255. package/index194.mjs +26 -55
  256. package/index195.js +1 -1
  257. package/index195.mjs +55 -46
  258. package/index196.js +1 -1
  259. package/index196.mjs +45 -123
  260. package/index197.js +1 -1
  261. package/index197.mjs +110 -5
  262. package/index198.js +1 -1
  263. package/index198.mjs +31 -27
  264. package/index199.js +1 -1
  265. package/index199.mjs +6 -7
  266. package/index2.js +1 -1
  267. package/index2.mjs +19 -19
  268. package/index20.js +1 -1
  269. package/index20.mjs +1 -1
  270. package/index200.js +1 -1
  271. package/index200.mjs +28 -7
  272. package/index201.js +1 -1
  273. package/index201.mjs +7 -8
  274. package/index202.js +1 -1
  275. package/index202.mjs +6 -3
  276. package/index203.js +1 -1
  277. package/index203.mjs +7 -5
  278. package/index204.js +1 -1
  279. package/index204.mjs +4 -9
  280. package/index205.js +1 -0
  281. package/index205.mjs +8 -0
  282. package/index206.js +1 -0
  283. package/index206.mjs +12 -0
  284. package/index21.js +1 -1
  285. package/index21.mjs +8 -8
  286. package/index22.js +1 -1
  287. package/index22.mjs +2 -2
  288. package/index23.js +1 -1
  289. package/index23.mjs +3 -3
  290. package/index24.js +1 -1
  291. package/index24.mjs +14 -14
  292. package/index26.js +1 -1
  293. package/index26.mjs +28 -21
  294. package/index27.js +1 -1
  295. package/index27.mjs +12 -12
  296. package/index28.js +1 -1
  297. package/index28.mjs +6 -6
  298. package/index29.js +1 -1
  299. package/index29.mjs +1 -1
  300. package/index30.js +1 -1
  301. package/index30.mjs +14 -8
  302. package/index31.js +1 -1
  303. package/index31.mjs +18 -18
  304. package/index32.js +1 -1
  305. package/index32.mjs +1 -1
  306. package/index33.mjs +43 -43
  307. package/index34.js +1 -1
  308. package/index34.mjs +1 -1
  309. package/index35.js +1 -1
  310. package/index35.mjs +3 -3
  311. package/index36.mjs +10 -10
  312. package/index4.js +1 -1
  313. package/index4.mjs +3 -3
  314. package/index6.js +1 -1
  315. package/index6.mjs +34 -33
  316. package/index65.js +1 -1
  317. package/index65.mjs +1 -1
  318. package/index66.js +1 -1
  319. package/index66.mjs +2 -2
  320. package/index67.js +1 -1
  321. package/index67.mjs +1 -1
  322. package/index69.js +1 -1
  323. package/index69.mjs +1 -1
  324. package/index7.mjs +4 -4
  325. package/index70.js +1 -1
  326. package/index70.mjs +1 -1
  327. package/index71.js +1 -1
  328. package/index71.mjs +1 -1
  329. package/index72.js +2 -1
  330. package/index72.mjs +27 -2
  331. package/index73.js +1 -2
  332. package/index73.mjs +2 -9
  333. package/index74.js +1 -1
  334. package/index74.mjs +7 -6
  335. package/index75.js +1 -1
  336. package/index75.mjs +6 -6
  337. package/index76.js +1 -1
  338. package/index76.mjs +6 -6
  339. package/index77.js +2 -1
  340. package/index77.mjs +8 -25
  341. package/index78.js +1 -1
  342. package/index78.mjs +25 -2
  343. package/index79.js +1 -6
  344. package/index79.mjs +2 -94
  345. package/index8.js +1 -1
  346. package/index8.mjs +42 -23
  347. package/index80.js +6 -1
  348. package/index80.mjs +79 -54
  349. package/index81.js +1 -1
  350. package/index81.mjs +61 -33
  351. package/index82.js +1 -42
  352. package/index82.mjs +34 -67
  353. package/index83.js +42 -1
  354. package/index83.mjs +69 -154
  355. package/index84.js +1 -9
  356. package/index84.mjs +149 -47
  357. package/index85.js +9 -1
  358. package/index85.mjs +48 -36
  359. package/index86.js +1 -1
  360. package/index86.mjs +40 -8
  361. package/index87.js +1 -1
  362. package/index87.mjs +9 -31
  363. package/index88.js +1 -1
  364. package/index88.mjs +35 -6
  365. package/index89.js +1 -12
  366. package/index89.mjs +6 -40
  367. package/index9.js +1 -1
  368. package/index9.mjs +7 -7
  369. package/index90.js +12 -1
  370. package/index90.mjs +36 -25
  371. package/index91.js +1 -1
  372. package/index91.mjs +24 -8
  373. package/index92.js +1 -7
  374. package/index92.mjs +7 -13
  375. package/index93.js +6 -14
  376. package/index93.mjs +13 -65
  377. package/index94.js +15 -1
  378. package/index94.mjs +71 -7
  379. package/index95.js +1 -16
  380. package/index95.mjs +7 -25
  381. package/index96.js +16 -1
  382. package/index96.mjs +20 -37
  383. package/index97.js +1 -1
  384. package/index97.mjs +40 -43
  385. package/index98.js +1 -1
  386. package/index98.mjs +44 -47
  387. package/index99.js +1 -1
  388. package/index99.mjs +48 -17
  389. package/package.json +1 -1
  390. package/providers/Translation/index.d.ts +4 -0
  391. package/providers/Translation/interface.d.ts +16 -0
  392. package/theme/Accordion/index.d.ts +12 -12
  393. package/theme/Alerts/index.d.ts +22 -22
  394. package/theme/Box/index.d.ts +8 -8
  395. package/theme/Button/index.d.ts +2 -2
  396. package/theme/Calendar/index.d.ts +12 -12
  397. package/theme/Carousel/index.d.ts +11 -11
  398. package/theme/Checkbox/index.d.ts +8 -8
  399. package/theme/CheckboxGroup/index.d.ts +3 -3
  400. package/theme/DatePicker/index.d.ts +9 -9
  401. package/theme/Image/index.d.ts +1 -1
  402. package/theme/LightBox/index.d.ts +9 -9
  403. package/theme/Radio/index.d.ts +6 -6
  404. package/theme/RadioGroup/index.d.ts +3 -3
  405. package/theme/Search/index.d.ts +3 -3
  406. package/theme/ShareButton/index.d.ts +10 -10
  407. package/theme/SidePanel/index.d.ts +3 -3
  408. package/theme/TextArea/index.d.ts +2 -2
  409. package/theme/Typography/index.d.ts +2 -2
  410. package/transitions/ModalTransition.d.ts +3 -6
  411. package/transitions/RenderWithSlide.d.ts +3 -6
  412. package/transitions/SidePanelTransition.d.ts +3 -6
package/index138.mjs CHANGED
@@ -1,30 +1,124 @@
1
- import { useState as C, useRef as $, useEffect as S, useCallback as V } from "react";
2
- function w(o, d, c) {
3
- let [p, s] = C(o || d), u = $(o !== void 0), e = o !== void 0;
4
- S(() => {
5
- let t = u.current;
6
- t !== e && console.warn(`WARN: A component changed from ${t ? "controlled" : "uncontrolled"} to ${e ? "controlled" : "uncontrolled"}.`), u.current = e;
7
- }, [
8
- e
9
- ]);
10
- let n = e ? o : p, b = V((t, ...i) => {
11
- let f = (r, ...l) => {
12
- c && (Object.is(n, r) || c(r, ...l)), e || (n = r);
1
+ import { createContext as O, useMemo as I, useContext as U, useState as f, useRef as T, useEffect as R } from "react";
2
+ const D = {
3
+ badInput: !1,
4
+ customError: !1,
5
+ patternMismatch: !1,
6
+ rangeOverflow: !1,
7
+ rangeUnderflow: !1,
8
+ stepMismatch: !1,
9
+ tooLong: !1,
10
+ tooShort: !1,
11
+ typeMismatch: !1,
12
+ valueMissing: !1,
13
+ valid: !0
14
+ }, L = {
15
+ ...D,
16
+ customError: !0,
17
+ valid: !1
18
+ }, c = {
19
+ isInvalid: !1,
20
+ validationDetails: D,
21
+ validationErrors: []
22
+ }, B = O({}), h = "__formValidationState" + Date.now();
23
+ function P(a) {
24
+ if (a[h]) {
25
+ let { realtimeValidation: e, displayValidation: t, updateValidation: i, resetValidation: o, commitValidation: l } = a[h];
26
+ return {
27
+ realtimeValidation: e,
28
+ displayValidation: t,
29
+ updateValidation: i,
30
+ resetValidation: o,
31
+ commitValidation: l
13
32
  };
14
- typeof t == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), s((l, ...m) => {
15
- let a = t(e ? n : l, ...m);
16
- return f(a, ...i), e ? l : a;
17
- })) : (e || s(t), f(t, ...i));
18
- }, [
19
- e,
20
- n,
21
- c
33
+ }
34
+ return Q(a);
35
+ }
36
+ function Q(a) {
37
+ let { isInvalid: e, validationState: t, name: i, value: o, builtinValidation: l, validate: d, validationBehavior: n = "aria" } = a;
38
+ t && (e || (e = t === "invalid"));
39
+ let v = e !== void 0 ? {
40
+ isInvalid: e,
41
+ validationErrors: [],
42
+ validationDetails: L
43
+ } : null, V = I(() => C(Y(d, o)), [
44
+ d,
45
+ o
22
46
  ]);
23
- return [
24
- n,
25
- b
26
- ];
47
+ l != null && l.validationDetails.valid && (l = null);
48
+ let s = U(B), A = I(() => i ? Array.isArray(i) ? i.flatMap((r) => S(s[r])) : S(s[i]) : [], [
49
+ s,
50
+ i
51
+ ]), [M, _] = f(s), [x, m] = f(!1);
52
+ s !== M && (_(s), m(!1));
53
+ let $ = I(() => C(x ? [] : A), [
54
+ x,
55
+ A
56
+ ]), g = T(c), [b, E] = f(c), u = T(c), w = () => {
57
+ if (!F) return;
58
+ p(!1);
59
+ let r = V || l || g.current;
60
+ y(r, u.current) || (u.current = r, E(r));
61
+ }, [F, p] = f(!1);
62
+ return R(w), {
63
+ realtimeValidation: v || $ || V || l || c,
64
+ displayValidation: n === "native" ? v || $ || b : v || $ || V || l || b,
65
+ updateValidation(r) {
66
+ n === "aria" && !y(b, r) ? E(r) : g.current = r;
67
+ },
68
+ resetValidation() {
69
+ let r = c;
70
+ y(r, u.current) || (u.current = r, E(r)), n === "native" && p(!1), m(!0);
71
+ },
72
+ commitValidation() {
73
+ n === "native" && p(!0), m(!0);
74
+ }
75
+ };
76
+ }
77
+ function S(a) {
78
+ return a ? Array.isArray(a) ? a : [
79
+ a
80
+ ] : [];
81
+ }
82
+ function Y(a, e) {
83
+ if (typeof a == "function") {
84
+ let t = a(e);
85
+ if (t && typeof t != "boolean") return S(t);
86
+ }
87
+ return [];
88
+ }
89
+ function C(a) {
90
+ return a.length ? {
91
+ isInvalid: !0,
92
+ validationErrors: a,
93
+ validationDetails: L
94
+ } : null;
95
+ }
96
+ function y(a, e) {
97
+ return a === e ? !0 : a && e && a.isInvalid === e.isInvalid && a.validationErrors.length === e.validationErrors.length && a.validationErrors.every((t, i) => t === e.validationErrors[i]) && Object.entries(a.validationDetails).every(([t, i]) => e.validationDetails[t] === i);
98
+ }
99
+ function k(...a) {
100
+ let e = /* @__PURE__ */ new Set(), t = !1, i = {
101
+ ...D
102
+ };
103
+ for (let d of a) {
104
+ var o, l;
105
+ for (let n of d.validationErrors) e.add(n);
106
+ t || (t = d.isInvalid);
107
+ for (let n in i) (o = i)[l = n] || (o[l] = d.validationDetails[n]);
108
+ }
109
+ return i.valid = !t, {
110
+ isInvalid: t,
111
+ validationErrors: [
112
+ ...e
113
+ ],
114
+ validationDetails: i
115
+ };
27
116
  }
28
117
  export {
29
- w as useControlledState
118
+ c as DEFAULT_VALIDATION_RESULT,
119
+ B as FormValidationContext,
120
+ D as VALID_VALIDITY_STATE,
121
+ k as mergeValidation,
122
+ h as privateValidationStateProp,
123
+ P as useFormValidationState
30
124
  };
package/index139.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index140.js"),l=require("./index131.js"),d=require("./index141.js"),f=require("./index142.js"),u=require("./index143.js"),y=require("./index144.js");function m(s){let t=typeof s[0]=="object"?s.shift():new f.GregorianCalendar,e;if(typeof s[0]=="string")e=s.shift();else{let a=t.getEras();e=a[a.length-1]}let r=s.shift(),n=s.shift(),h=s.shift();return[t,e,r,n,h]}var p=new WeakMap;class c{copy(){return this.era?new c(this.calendar,this.era,this.year,this.month,this.day):new c(this.calendar,this.year,this.month,this.day)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(this,t)}cycle(t,e,r){return i.cycleDate(this,t,e,r)}toDate(t){return u.toDate(this,t)}toString(){return d.dateToString(this)}compare(t){return l.compareDate(this,t)}constructor(...t){y._class_private_field_init(this,p,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,i.constrain(this)}}var v=new WeakMap;class o{copy(){return this.era?new o(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new o(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(i.setTime(this,t),t)}cycle(t,e,r){switch(t){case"era":case"year":case"month":case"day":return i.cycleDate(this,t,e,r);default:return i.cycleTime(this,t,e,r)}}toDate(t,e){return u.toDate(this,t,e)}toString(){return d.dateTimeToString(this)}compare(t){let e=l.compareDate(this,t);return e===0?l.compareTime(this,u.toCalendarDateTime(t)):e}constructor(...t){y._class_private_field_init(this,v,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,i.constrain(this)}}exports.CalendarDate=c;exports.CalendarDateTime=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react");function C(o,b,u){let[p,s]=l.useState(o||b),i=l.useRef(o!==void 0),e=o!==void 0;l.useEffect(()=>{let t=i.current;t!==e&&console.warn(`WARN: A component changed from ${t?"controlled":"uncontrolled"} to ${e?"controlled":"uncontrolled"}.`),i.current=e},[e]);let n=e?o:p,S=l.useCallback((t,...f)=>{let a=(r,...c)=>{u&&(Object.is(n,r)||u(r,...c)),e||(n=r)};typeof t=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),s((c,...m)=>{let d=t(e?n:c,...m);return a(d,...f),e?c:d})):(e||s(t),a(t,...f))},[e,n,u]);return[n,S]}exports.useControlledState=C;
package/index139.mjs CHANGED
@@ -1,127 +1,30 @@
1
- import { add as n, subtract as o, set as $, cycleDate as f, constrain as l, setTime as b, cycleTime as x } from "./index140.mjs";
2
- import { compareDate as m, compareTime as v } from "./index131.mjs";
3
- import { dateToString as w, dateTimeToString as D } from "./index141.mjs";
4
- import { GregorianCalendar as T } from "./index142.mjs";
5
- import { toDate as u, toCalendarDateTime as C } from "./index143.mjs";
6
- import { _class_private_field_init as p } from "./index144.mjs";
7
- function y(r) {
8
- let t = typeof r[0] == "object" ? r.shift() : new T(), e;
9
- if (typeof r[0] == "string") e = r.shift();
10
- else {
11
- let s = t.getEras();
12
- e = s[s.length - 1];
13
- }
14
- let a = r.shift(), i = r.shift(), h = r.shift();
15
- return [
16
- t,
1
+ import { useState as C, useRef as $, useEffect as S, useCallback as V } from "react";
2
+ function w(o, d, c) {
3
+ let [p, s] = C(o || d), u = $(o !== void 0), e = o !== void 0;
4
+ S(() => {
5
+ let t = u.current;
6
+ t !== e && console.warn(`WARN: A component changed from ${t ? "controlled" : "uncontrolled"} to ${e ? "controlled" : "uncontrolled"}.`), u.current = e;
7
+ }, [
8
+ e
9
+ ]);
10
+ let n = e ? o : p, b = V((t, ...i) => {
11
+ let f = (r, ...l) => {
12
+ c && (Object.is(n, r) || c(r, ...l)), e || (n = r);
13
+ };
14
+ typeof t == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), s((l, ...m) => {
15
+ let a = t(e ? n : l, ...m);
16
+ return f(a, ...i), e ? l : a;
17
+ })) : (e || s(t), f(t, ...i));
18
+ }, [
17
19
  e,
18
- a,
19
- i,
20
- h
20
+ n,
21
+ c
22
+ ]);
23
+ return [
24
+ n,
25
+ b
21
26
  ];
22
27
  }
23
- var S = /* @__PURE__ */ new WeakMap();
24
- class d {
25
- /** Returns a copy of this date. */
26
- copy() {
27
- return this.era ? new d(this.calendar, this.era, this.year, this.month, this.day) : new d(this.calendar, this.year, this.month, this.day);
28
- }
29
- /** Returns a new `CalendarDate` with the given duration added to it. */
30
- add(t) {
31
- return n(this, t);
32
- }
33
- /** Returns a new `CalendarDate` with the given duration subtracted from it. */
34
- subtract(t) {
35
- return o(this, t);
36
- }
37
- /** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
38
- set(t) {
39
- return $(this, t);
40
- }
41
- /**
42
- * Returns a new `CalendarDate` with the given field adjusted by a specified amount.
43
- * When the resulting value reaches the limits of the field, it wraps around.
44
- */
45
- cycle(t, e, a) {
46
- return f(this, t, e, a);
47
- }
48
- /** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
49
- toDate(t) {
50
- return u(this, t);
51
- }
52
- /** Converts the date to an ISO 8601 formatted string. */
53
- toString() {
54
- return w(this);
55
- }
56
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
57
- compare(t) {
58
- return m(this, t);
59
- }
60
- constructor(...t) {
61
- p(this, S, {
62
- writable: !0,
63
- value: void 0
64
- });
65
- let [e, a, i, h, s] = y(t);
66
- this.calendar = e, this.era = a, this.year = i, this.month = h, this.day = s, l(this);
67
- }
68
- }
69
- var k = /* @__PURE__ */ new WeakMap();
70
- class c {
71
- /** Returns a copy of this date. */
72
- copy() {
73
- return this.era ? new c(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new c(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
74
- }
75
- /** Returns a new `CalendarDateTime` with the given duration added to it. */
76
- add(t) {
77
- return n(this, t);
78
- }
79
- /** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
80
- subtract(t) {
81
- return o(this, t);
82
- }
83
- /** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
84
- set(t) {
85
- return $(b(this, t), t);
86
- }
87
- /**
88
- * Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
89
- * When the resulting value reaches the limits of the field, it wraps around.
90
- */
91
- cycle(t, e, a) {
92
- switch (t) {
93
- case "era":
94
- case "year":
95
- case "month":
96
- case "day":
97
- return f(this, t, e, a);
98
- default:
99
- return x(this, t, e, a);
100
- }
101
- }
102
- /** Converts the date to a native JavaScript Date object in the given time zone. */
103
- toDate(t, e) {
104
- return u(this, t, e);
105
- }
106
- /** Converts the date to an ISO 8601 formatted string. */
107
- toString() {
108
- return D(this);
109
- }
110
- /** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
111
- compare(t) {
112
- let e = m(this, t);
113
- return e === 0 ? v(this, C(t)) : e;
114
- }
115
- constructor(...t) {
116
- p(this, k, {
117
- writable: !0,
118
- value: void 0
119
- });
120
- let [e, a, i, h, s] = y(t);
121
- this.calendar = e, this.era = a, this.year = i, this.month = h, this.day = s, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, l(this);
122
- }
123
- }
124
28
  export {
125
- d as CalendarDate,
126
- c as CalendarDateTime
29
+ w as useControlledState
127
30
  };
package/index14.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";const a=require("./index106.js"),o=require("react/jsx-runtime"),t=require("react"),v=require("./index64.js"),x=require("./index104.js"),e=r=>Object.freeze(Object.defineProperty({__proto__:null,default:r},Symbol.toStringTag,{value:"Module"})),q=r=>{const{icon:s,...i}=r,n=t.useMemo(()=>t.lazy(()=>a(Object.assign({"../icons/ArrowDown.tsx":()=>Promise.resolve().then(()=>e(require("./index39.js"))),"../icons/ArrowLeft.tsx":()=>Promise.resolve().then(()=>e(require("./index40.js"))),"../icons/ArrowRight.tsx":()=>Promise.resolve().then(()=>e(require("./index41.js"))),"../icons/Check.tsx":()=>Promise.resolve().then(()=>e(require("./index42.js"))),"../icons/ChevronLeft.tsx":()=>Promise.resolve().then(()=>e(require("./index43.js"))),"../icons/ChevronRight.tsx":()=>Promise.resolve().then(()=>e(require("./index44.js"))),"../icons/CloseBtn.tsx":()=>Promise.resolve().then(()=>e(require("./index45.js"))),"../icons/Facebook.tsx":()=>Promise.resolve().then(()=>e(require("./index46.js"))),"../icons/FacebookColored.tsx":()=>Promise.resolve().then(()=>e(require("./index47.js"))),"../icons/FacebookRounded.tsx":()=>Promise.resolve().then(()=>e(require("./index48.js"))),"../icons/Globe.tsx":()=>Promise.resolve().then(()=>e(require("./index49.js"))),"../icons/IconFallback.tsx":()=>Promise.resolve().then(()=>e(require("./index104.js"))),"../icons/Instagram.tsx":()=>Promise.resolve().then(()=>e(require("./index50.js"))),"../icons/InstagramColored.tsx":()=>Promise.resolve().then(()=>e(require("./index51.js"))),"../icons/Link.tsx":()=>Promise.resolve().then(()=>e(require("./index52.js"))),"../icons/LinkedIn.tsx":()=>Promise.resolve().then(()=>e(require("./index53.js"))),"../icons/Mail.tsx":()=>Promise.resolve().then(()=>e(require("./index54.js"))),"../icons/Plus.tsx":()=>Promise.resolve().then(()=>e(require("./index55.js"))),"../icons/Search.tsx":()=>Promise.resolve().then(()=>e(require("./index105.js"))),"../icons/Share.tsx":()=>Promise.resolve().then(()=>e(require("./index56.js"))),"../icons/Twitter.tsx":()=>Promise.resolve().then(()=>e(require("./index57.js"))),"../icons/TwitterColored.tsx":()=>Promise.resolve().then(()=>e(require("./index58.js"))),"../icons/Upload.tsx":()=>Promise.resolve().then(()=>e(require("./index59.js"))),"../icons/X.tsx":()=>Promise.resolve().then(()=>e(require("./index60.js"))),"../icons/YouTube.tsx":()=>Promise.resolve().then(()=>e(require("./index61.js"))),"../icons/YouTubeColored.tsx":()=>Promise.resolve().then(()=>e(require("./index62.js")))}),`../icons/${s||"ArrowRight"}.tsx`,3)),[s]);return o.jsx(t.Suspense,{fallback:o.jsx(x,{className:"overflow-visible pointer-events-none"}),children:o.jsx(n,{...i,className:"overflow-visible pointer-events-none",...r})})},P=r=>{const{icon:s,as:i="span",tokens:n,customTheme:m,themeName:h="icon",children:c,...l}=r,u=v(h,n,m);return typeof s!="string"?o.jsxs(i,{...l,className:u,children:[c,s]}):o.jsxs(i,{className:u,children:[c,o.jsx(q,{icon:s,...l})]})};module.exports=P;
2
+ "use strict";const a=require("./index107.js"),o=require("react/jsx-runtime"),t=require("react"),v=require("./index64.js"),x=require("./index105.js"),e=r=>Object.freeze(Object.defineProperty({__proto__:null,default:r},Symbol.toStringTag,{value:"Module"})),q=r=>{const{icon:s,...i}=r,n=t.useMemo(()=>t.lazy(()=>a(Object.assign({"../icons/ArrowDown.tsx":()=>Promise.resolve().then(()=>e(require("./index39.js"))),"../icons/ArrowLeft.tsx":()=>Promise.resolve().then(()=>e(require("./index40.js"))),"../icons/ArrowRight.tsx":()=>Promise.resolve().then(()=>e(require("./index41.js"))),"../icons/Check.tsx":()=>Promise.resolve().then(()=>e(require("./index42.js"))),"../icons/ChevronLeft.tsx":()=>Promise.resolve().then(()=>e(require("./index43.js"))),"../icons/ChevronRight.tsx":()=>Promise.resolve().then(()=>e(require("./index44.js"))),"../icons/CloseBtn.tsx":()=>Promise.resolve().then(()=>e(require("./index45.js"))),"../icons/Facebook.tsx":()=>Promise.resolve().then(()=>e(require("./index46.js"))),"../icons/FacebookColored.tsx":()=>Promise.resolve().then(()=>e(require("./index47.js"))),"../icons/FacebookRounded.tsx":()=>Promise.resolve().then(()=>e(require("./index48.js"))),"../icons/Globe.tsx":()=>Promise.resolve().then(()=>e(require("./index49.js"))),"../icons/IconFallback.tsx":()=>Promise.resolve().then(()=>e(require("./index105.js"))),"../icons/Instagram.tsx":()=>Promise.resolve().then(()=>e(require("./index50.js"))),"../icons/InstagramColored.tsx":()=>Promise.resolve().then(()=>e(require("./index51.js"))),"../icons/Link.tsx":()=>Promise.resolve().then(()=>e(require("./index52.js"))),"../icons/LinkedIn.tsx":()=>Promise.resolve().then(()=>e(require("./index53.js"))),"../icons/Mail.tsx":()=>Promise.resolve().then(()=>e(require("./index54.js"))),"../icons/Plus.tsx":()=>Promise.resolve().then(()=>e(require("./index55.js"))),"../icons/Search.tsx":()=>Promise.resolve().then(()=>e(require("./index106.js"))),"../icons/Share.tsx":()=>Promise.resolve().then(()=>e(require("./index56.js"))),"../icons/Twitter.tsx":()=>Promise.resolve().then(()=>e(require("./index57.js"))),"../icons/TwitterColored.tsx":()=>Promise.resolve().then(()=>e(require("./index58.js"))),"../icons/Upload.tsx":()=>Promise.resolve().then(()=>e(require("./index59.js"))),"../icons/X.tsx":()=>Promise.resolve().then(()=>e(require("./index60.js"))),"../icons/YouTube.tsx":()=>Promise.resolve().then(()=>e(require("./index61.js"))),"../icons/YouTubeColored.tsx":()=>Promise.resolve().then(()=>e(require("./index62.js")))}),`../icons/${s||"ArrowRight"}.tsx`,3)),[s]);return o.jsx(t.Suspense,{fallback:o.jsx(x,{className:"overflow-visible pointer-events-none"}),children:o.jsx(n,{...i,className:"overflow-visible pointer-events-none",...r})})},P=r=>{const{icon:s,as:i="span",tokens:n,customTheme:m,themeName:h="icon",children:c,...l}=r,u=v(h,n,m);return typeof s!="string"?o.jsxs(i,{...l,className:u,children:[c,s]}):o.jsxs(i,{className:u,children:[c,o.jsx(q,{icon:s,...l})]})};module.exports=P;
package/index14.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import l from "./index106.mjs";
2
+ import l from "./index107.mjs";
3
3
  import { jsxs as m, jsx as i } from "react/jsx-runtime";
4
4
  import { useMemo as x, lazy as h, Suspense as u } from "react";
5
5
  import d from "./index64.mjs";
6
- import b from "./index104.mjs";
6
+ import b from "./index105.mjs";
7
7
  const f = (t) => {
8
- const { icon: o, ...s } = t, r = x(() => h(() => l(/* @__PURE__ */ Object.assign({ "../icons/ArrowDown.tsx": () => import("./index39.mjs"), "../icons/ArrowLeft.tsx": () => import("./index40.mjs"), "../icons/ArrowRight.tsx": () => import("./index41.mjs"), "../icons/Check.tsx": () => import("./index42.mjs"), "../icons/ChevronLeft.tsx": () => import("./index43.mjs"), "../icons/ChevronRight.tsx": () => import("./index44.mjs"), "../icons/CloseBtn.tsx": () => import("./index45.mjs"), "../icons/Facebook.tsx": () => import("./index46.mjs"), "../icons/FacebookColored.tsx": () => import("./index47.mjs"), "../icons/FacebookRounded.tsx": () => import("./index48.mjs"), "../icons/Globe.tsx": () => import("./index49.mjs"), "../icons/IconFallback.tsx": () => import("./index104.mjs"), "../icons/Instagram.tsx": () => import("./index50.mjs"), "../icons/InstagramColored.tsx": () => import("./index51.mjs"), "../icons/Link.tsx": () => import("./index52.mjs"), "../icons/LinkedIn.tsx": () => import("./index53.mjs"), "../icons/Mail.tsx": () => import("./index54.mjs"), "../icons/Plus.tsx": () => import("./index55.mjs"), "../icons/Search.tsx": () => import("./index105.mjs"), "../icons/Share.tsx": () => import("./index56.mjs"), "../icons/Twitter.tsx": () => import("./index57.mjs"), "../icons/TwitterColored.tsx": () => import("./index58.mjs"), "../icons/Upload.tsx": () => import("./index59.mjs"), "../icons/X.tsx": () => import("./index60.mjs"), "../icons/YouTube.tsx": () => import("./index61.mjs"), "../icons/YouTubeColored.tsx": () => import("./index62.mjs") }), `../icons/${o || "ArrowRight"}.tsx`, 3)), [o]);
8
+ const { icon: o, ...s } = t, r = x(() => h(() => l(/* @__PURE__ */ Object.assign({ "../icons/ArrowDown.tsx": () => import("./index39.mjs"), "../icons/ArrowLeft.tsx": () => import("./index40.mjs"), "../icons/ArrowRight.tsx": () => import("./index41.mjs"), "../icons/Check.tsx": () => import("./index42.mjs"), "../icons/ChevronLeft.tsx": () => import("./index43.mjs"), "../icons/ChevronRight.tsx": () => import("./index44.mjs"), "../icons/CloseBtn.tsx": () => import("./index45.mjs"), "../icons/Facebook.tsx": () => import("./index46.mjs"), "../icons/FacebookColored.tsx": () => import("./index47.mjs"), "../icons/FacebookRounded.tsx": () => import("./index48.mjs"), "../icons/Globe.tsx": () => import("./index49.mjs"), "../icons/IconFallback.tsx": () => import("./index105.mjs"), "../icons/Instagram.tsx": () => import("./index50.mjs"), "../icons/InstagramColored.tsx": () => import("./index51.mjs"), "../icons/Link.tsx": () => import("./index52.mjs"), "../icons/LinkedIn.tsx": () => import("./index53.mjs"), "../icons/Mail.tsx": () => import("./index54.mjs"), "../icons/Plus.tsx": () => import("./index55.mjs"), "../icons/Search.tsx": () => import("./index106.mjs"), "../icons/Share.tsx": () => import("./index56.mjs"), "../icons/Twitter.tsx": () => import("./index57.mjs"), "../icons/TwitterColored.tsx": () => import("./index58.mjs"), "../icons/Upload.tsx": () => import("./index59.mjs"), "../icons/X.tsx": () => import("./index60.mjs"), "../icons/YouTube.tsx": () => import("./index61.mjs"), "../icons/YouTubeColored.tsx": () => import("./index62.mjs") }), `../icons/${o || "ArrowRight"}.tsx`, 3)), [o]);
9
9
  return /* @__PURE__ */ i(u, { fallback: /* @__PURE__ */ i(b, { className: "overflow-visible pointer-events-none" }), children: /* @__PURE__ */ i(r, { ...s, className: "overflow-visible pointer-events-none", ...t }) });
10
10
  }, g = (t) => {
11
11
  const { icon: o, as: s = "span", tokens: r, customTheme: p, themeName: a = "icon", children: n, ...e } = t, c = d(a, r, p);
package/index140.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function $(n,e){let r=n.copy(),a="hour"in r?Y(r,e):0;f(r,e.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,n),r.month+=e.months||0,s(r),M(r),r.day+=(e.weeks||0)*7,r.day+=e.days||0,r.day+=a,b(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let c=r.calendar.getYearsInEra(r);if(r.year>c){var d,h;let o=(d=(h=r.calendar).isInverseEra)===null||d===void 0?void 0:d.call(h,r);r.year=c,r.month=o?1:r.calendar.getMonthsInYear(r),r.day=o?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);let l=r.calendar.getMonthsInYear(r);return r.month>l&&(r.month=l,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function f(n,e){var r,a;!((r=(a=n.calendar).isInverseEra)===null||r===void 0)&&r.call(a,n)&&(e=-e),n.year+=e}function s(n){for(;n.month<1;)f(n,-1),n.month+=n.calendar.getMonthsInYear(n);let e=0;for(;n.month>(e=n.calendar.getMonthsInYear(n));)n.month-=e,f(n,1)}function b(n){for(;n.day<1;)n.month--,s(n),n.day+=n.calendar.getDaysInMonth(n);for(;n.day>n.calendar.getDaysInMonth(n);)n.day-=n.calendar.getDaysInMonth(n),n.month++,s(n)}function M(n){n.month=Math.max(1,Math.min(n.calendar.getMonthsInYear(n),n.month)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day))}function y(n){n.calendar.constrainDate&&n.calendar.constrainDate(n),n.year=Math.max(1,Math.min(n.calendar.getYearsInEra(n),n.year)),M(n)}function u(n){let e={};for(let r in n)typeof n[r]=="number"&&(e[r]=-n[r]);return e}function g(n,e){return $(n,u(e))}function I(n,e){let r=n.copy();return e.era!=null&&(r.era=e.era),e.year!=null&&(r.year=e.year),e.month!=null&&(r.month=e.month),e.day!=null&&(r.day=e.day),y(r),r}function x(n,e){let r=n.copy();return e.hour!=null&&(r.hour=e.hour),e.minute!=null&&(r.minute=e.minute),e.second!=null&&(r.second=e.second),e.millisecond!=null&&(r.millisecond=e.millisecond),m(r),r}function D(n){n.second+=Math.floor(n.millisecond/1e3),n.millisecond=i(n.millisecond,1e3),n.minute+=Math.floor(n.second/60),n.second=i(n.second,60),n.hour+=Math.floor(n.minute/60),n.minute=i(n.minute,60);let e=Math.floor(n.hour/24);return n.hour=i(n.hour,24),e}function m(n){n.millisecond=Math.max(0,Math.min(n.millisecond,1e3)),n.second=Math.max(0,Math.min(n.second,59)),n.minute=Math.max(0,Math.min(n.minute,59)),n.hour=Math.max(0,Math.min(n.hour,23))}function i(n,e){let r=n%e;return r<0&&(r+=e),r}function Y(n,e){return n.hour+=e.hours||0,n.minute+=e.minutes||0,n.second+=e.seconds||0,n.millisecond+=e.milliseconds||0,D(n)}function w(n,e,r,a){let c=n.copy();switch(e){case"era":{let l=n.calendar.getEras(),o=l.indexOf(n.era);if(o<0)throw new Error("Invalid era: "+n.era);o=t(o,r,0,l.length-1,a==null?void 0:a.round),c.era=l[o],y(c);break}case"year":var d,h;!((d=(h=c.calendar).isInverseEra)===null||d===void 0)&&d.call(h,c)&&(r=-r),c.year=t(n.year,r,-1/0,9999,a==null?void 0:a.round),c.year===-1/0&&(c.year=1),c.calendar.balanceYearMonth&&c.calendar.balanceYearMonth(c,n);break;case"month":c.month=t(n.month,r,1,n.calendar.getMonthsInYear(n),a==null?void 0:a.round);break;case"day":c.day=t(n.day,r,1,n.calendar.getDaysInMonth(n),a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return n.calendar.balanceDate&&n.calendar.balanceDate(c),y(c),c}function k(n,e,r,a){let c=n.copy();switch(e){case"hour":{let d=n.hour,h=0,l=23;if((a==null?void 0:a.hourCycle)===12){let o=d>=12;h=o?12:0,l=o?23:11}c.hour=t(d,r,h,l,a==null?void 0:a.round);break}case"minute":c.minute=t(n.minute,r,0,59,a==null?void 0:a.round);break;case"second":c.second=t(n.second,r,0,59,a==null?void 0:a.round);break;case"millisecond":c.millisecond=t(n.millisecond,r,0,999,a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return c}function t(n,e,r,a,c=!1){if(c){n+=Math.sign(e),n<r&&(n=a);let d=Math.abs(e);e>0?n=Math.ceil(n/d)*d:n=Math.floor(n/d)*d,n>a&&(n=r)}else n+=e,n<r?n=a-(r-n-1):n>a&&(n=r+(n-a-1));return n}exports.add=$;exports.constrain=y;exports.constrainTime=m;exports.cycleDate=w;exports.cycleTime=k;exports.invertDuration=u;exports.set=I;exports.setTime=x;exports.subtract=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index141.js"),l=require("./index132.js"),d=require("./index142.js"),f=require("./index143.js"),u=require("./index144.js"),y=require("./index145.js");function m(s){let t=typeof s[0]=="object"?s.shift():new f.GregorianCalendar,e;if(typeof s[0]=="string")e=s.shift();else{let a=t.getEras();e=a[a.length-1]}let r=s.shift(),n=s.shift(),h=s.shift();return[t,e,r,n,h]}var p=new WeakMap;class c{copy(){return this.era?new c(this.calendar,this.era,this.year,this.month,this.day):new c(this.calendar,this.year,this.month,this.day)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(this,t)}cycle(t,e,r){return i.cycleDate(this,t,e,r)}toDate(t){return u.toDate(this,t)}toString(){return d.dateToString(this)}compare(t){return l.compareDate(this,t)}constructor(...t){y._class_private_field_init(this,p,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,i.constrain(this)}}var v=new WeakMap;class o{copy(){return this.era?new o(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new o(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(i.setTime(this,t),t)}cycle(t,e,r){switch(t){case"era":case"year":case"month":case"day":return i.cycleDate(this,t,e,r);default:return i.cycleTime(this,t,e,r)}}toDate(t,e){return u.toDate(this,t,e)}toString(){return d.dateTimeToString(this)}compare(t){let e=l.compareDate(this,t);return e===0?l.compareTime(this,u.toCalendarDateTime(t)):e}constructor(...t){y._class_private_field_init(this,v,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,i.constrain(this)}}exports.CalendarDate=c;exports.CalendarDateTime=o;