se-design 1.1.1-dev → 1.1.1-dev-01

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 (344) hide show
  1. package/dist/assets/style.css +1 -1
  2. package/dist/index100.js +1 -1
  3. package/dist/index100.js.map +1 -1
  4. package/dist/index101.js +1 -1
  5. package/dist/index101.js.map +1 -1
  6. package/dist/index102.js +1 -1
  7. package/dist/index102.js.map +1 -1
  8. package/dist/index103.js +1 -1
  9. package/dist/index103.js.map +1 -1
  10. package/dist/index104.js +1 -1
  11. package/dist/index104.js.map +1 -1
  12. package/dist/index105.js +1 -1
  13. package/dist/index105.js.map +1 -1
  14. package/dist/index106.js +1 -1
  15. package/dist/index106.js.map +1 -1
  16. package/dist/index107.js +1 -1
  17. package/dist/index107.js.map +1 -1
  18. package/dist/index108.js +1 -1
  19. package/dist/index108.js.map +1 -1
  20. package/dist/index109.js +1 -1
  21. package/dist/index109.js.map +1 -1
  22. package/dist/index110.js +1 -1
  23. package/dist/index110.js.map +1 -1
  24. package/dist/index111.js +1 -1
  25. package/dist/index111.js.map +1 -1
  26. package/dist/index112.js +1 -1
  27. package/dist/index112.js.map +1 -1
  28. package/dist/index113.js +1 -1
  29. package/dist/index113.js.map +1 -1
  30. package/dist/index114.js +1 -1
  31. package/dist/index114.js.map +1 -1
  32. package/dist/index115.js +1 -1
  33. package/dist/index115.js.map +1 -1
  34. package/dist/index116.js +1 -1
  35. package/dist/index116.js.map +1 -1
  36. package/dist/index117.js +1 -1
  37. package/dist/index117.js.map +1 -1
  38. package/dist/index118.js +1 -1
  39. package/dist/index118.js.map +1 -1
  40. package/dist/index119.js +1 -1
  41. package/dist/index119.js.map +1 -1
  42. package/dist/index12.js +2 -2
  43. package/dist/index120.js +2 -2
  44. package/dist/index120.js.map +1 -1
  45. package/dist/index121.js +1 -1
  46. package/dist/index121.js.map +1 -1
  47. package/dist/index122.js +2 -2
  48. package/dist/index122.js.map +1 -1
  49. package/dist/index123.js +1 -1
  50. package/dist/index123.js.map +1 -1
  51. package/dist/index124.js +1 -1
  52. package/dist/index124.js.map +1 -1
  53. package/dist/index125.js +2 -2
  54. package/dist/index125.js.map +1 -1
  55. package/dist/index126.js +1 -1
  56. package/dist/index126.js.map +1 -1
  57. package/dist/index127.js +2 -2
  58. package/dist/index127.js.map +1 -1
  59. package/dist/index128.js +1 -1
  60. package/dist/index128.js.map +1 -1
  61. package/dist/index129.js +1 -1
  62. package/dist/index129.js.map +1 -1
  63. package/dist/index13.js +2 -2
  64. package/dist/index130.js +1 -1
  65. package/dist/index130.js.map +1 -1
  66. package/dist/index131.js +1 -1
  67. package/dist/index131.js.map +1 -1
  68. package/dist/index132.js +1 -1
  69. package/dist/index132.js.map +1 -1
  70. package/dist/index133.js +1 -1
  71. package/dist/index133.js.map +1 -1
  72. package/dist/index134.js +2 -2
  73. package/dist/index134.js.map +1 -1
  74. package/dist/index135.js +1 -1
  75. package/dist/index135.js.map +1 -1
  76. package/dist/index136.js +2 -2
  77. package/dist/index136.js.map +1 -1
  78. package/dist/index137.js +2 -2
  79. package/dist/index137.js.map +1 -1
  80. package/dist/index138.js +1 -1
  81. package/dist/index138.js.map +1 -1
  82. package/dist/index139.js +2 -2
  83. package/dist/index139.js.map +1 -1
  84. package/dist/index140.js +2 -2
  85. package/dist/index140.js.map +1 -1
  86. package/dist/index141.js +1 -1
  87. package/dist/index141.js.map +1 -1
  88. package/dist/index142.js +1 -1
  89. package/dist/index142.js.map +1 -1
  90. package/dist/index143.js +1 -1
  91. package/dist/index143.js.map +1 -1
  92. package/dist/index144.js +2 -2
  93. package/dist/index144.js.map +1 -1
  94. package/dist/index145.js +2 -2
  95. package/dist/index145.js.map +1 -1
  96. package/dist/index146.js +2 -2
  97. package/dist/index146.js.map +1 -1
  98. package/dist/index147.js +1 -1
  99. package/dist/index147.js.map +1 -1
  100. package/dist/index148.js +1 -1
  101. package/dist/index148.js.map +1 -1
  102. package/dist/index149.js +1 -1
  103. package/dist/index149.js.map +1 -1
  104. package/dist/index150.js +1 -1
  105. package/dist/index150.js.map +1 -1
  106. package/dist/index151.js +1 -1
  107. package/dist/index151.js.map +1 -1
  108. package/dist/index152.js +1 -1
  109. package/dist/index152.js.map +1 -1
  110. package/dist/index153.js +1 -1
  111. package/dist/index153.js.map +1 -1
  112. package/dist/index154.js +1 -1
  113. package/dist/index154.js.map +1 -1
  114. package/dist/index155.js +1 -1
  115. package/dist/index155.js.map +1 -1
  116. package/dist/index156.js +2 -2
  117. package/dist/index156.js.map +1 -1
  118. package/dist/index157.js +2 -2
  119. package/dist/index157.js.map +1 -1
  120. package/dist/index158.js +1 -1
  121. package/dist/index158.js.map +1 -1
  122. package/dist/index159.js +1 -1
  123. package/dist/index159.js.map +1 -1
  124. package/dist/index16.js +1 -1
  125. package/dist/index160.js +1 -1
  126. package/dist/index160.js.map +1 -1
  127. package/dist/index161.js +1 -1
  128. package/dist/index161.js.map +1 -1
  129. package/dist/index162.js +1 -1
  130. package/dist/index162.js.map +1 -1
  131. package/dist/index163.js +1 -1
  132. package/dist/index163.js.map +1 -1
  133. package/dist/index164.js +1 -1
  134. package/dist/index164.js.map +1 -1
  135. package/dist/index165.js +1 -1
  136. package/dist/index165.js.map +1 -1
  137. package/dist/index166.js +1 -1
  138. package/dist/index166.js.map +1 -1
  139. package/dist/index167.js +2 -2
  140. package/dist/index167.js.map +1 -1
  141. package/dist/index168.js +1 -1
  142. package/dist/index168.js.map +1 -1
  143. package/dist/index169.js +2 -2
  144. package/dist/index169.js.map +1 -1
  145. package/dist/index170.js +2 -2
  146. package/dist/index170.js.map +1 -1
  147. package/dist/index171.js +2 -2
  148. package/dist/index171.js.map +1 -1
  149. package/dist/index172.js +2 -2
  150. package/dist/index172.js.map +1 -1
  151. package/dist/index173.js +1 -1
  152. package/dist/index173.js.map +1 -1
  153. package/dist/index174.js +1 -1
  154. package/dist/index174.js.map +1 -1
  155. package/dist/index175.js +1 -1
  156. package/dist/index175.js.map +1 -1
  157. package/dist/index176.js +1 -1
  158. package/dist/index176.js.map +1 -1
  159. package/dist/index177.js +1 -1
  160. package/dist/index177.js.map +1 -1
  161. package/dist/index178.js +1 -1
  162. package/dist/index178.js.map +1 -1
  163. package/dist/index179.js +1 -1
  164. package/dist/index179.js.map +1 -1
  165. package/dist/index180.js +1 -1
  166. package/dist/index180.js.map +1 -1
  167. package/dist/index181.js +2 -2
  168. package/dist/index181.js.map +1 -1
  169. package/dist/index182.js +2 -2
  170. package/dist/index182.js.map +1 -1
  171. package/dist/index183.js +1 -1
  172. package/dist/index183.js.map +1 -1
  173. package/dist/index184.js +1 -1
  174. package/dist/index184.js.map +1 -1
  175. package/dist/index185.js +1 -1
  176. package/dist/index185.js.map +1 -1
  177. package/dist/index186.js +1 -1
  178. package/dist/index186.js.map +1 -1
  179. package/dist/index187.js +1 -1
  180. package/dist/index187.js.map +1 -1
  181. package/dist/index188.js +1 -1
  182. package/dist/index188.js.map +1 -1
  183. package/dist/index189.js +1 -1
  184. package/dist/index189.js.map +1 -1
  185. package/dist/index19.js +1 -1
  186. package/dist/index190.js +1 -1
  187. package/dist/index190.js.map +1 -1
  188. package/dist/index191.js +1 -1
  189. package/dist/index191.js.map +1 -1
  190. package/dist/index192.js +1 -1
  191. package/dist/index192.js.map +1 -1
  192. package/dist/index193.js +1 -1
  193. package/dist/index193.js.map +1 -1
  194. package/dist/index194.js +1 -1
  195. package/dist/index194.js.map +1 -1
  196. package/dist/index195.js +1 -1
  197. package/dist/index195.js.map +1 -1
  198. package/dist/index196.js +1 -1
  199. package/dist/index196.js.map +1 -1
  200. package/dist/index197.js +1 -1
  201. package/dist/index197.js.map +1 -1
  202. package/dist/index198.js +1 -1
  203. package/dist/index198.js.map +1 -1
  204. package/dist/index199.js +1 -1
  205. package/dist/index199.js.map +1 -1
  206. package/dist/index200.js +1 -1
  207. package/dist/index200.js.map +1 -1
  208. package/dist/index201.js +1 -1
  209. package/dist/index201.js.map +1 -1
  210. package/dist/index202.js +2 -2
  211. package/dist/index202.js.map +1 -1
  212. package/dist/index203.js +2 -2
  213. package/dist/index203.js.map +1 -1
  214. package/dist/index204.js +1 -1
  215. package/dist/index204.js.map +1 -1
  216. package/dist/index205.js +1 -1
  217. package/dist/index205.js.map +1 -1
  218. package/dist/index206.js +2 -2
  219. package/dist/index206.js.map +1 -1
  220. package/dist/index207.js +2 -2
  221. package/dist/index207.js.map +1 -1
  222. package/dist/index208.js +1 -1
  223. package/dist/index208.js.map +1 -1
  224. package/dist/index209.js +1 -1
  225. package/dist/index209.js.map +1 -1
  226. package/dist/index210.js +1 -1
  227. package/dist/index210.js.map +1 -1
  228. package/dist/index211.js +2 -2
  229. package/dist/index211.js.map +1 -1
  230. package/dist/index212.js +2 -2
  231. package/dist/index212.js.map +1 -1
  232. package/dist/index213.js +1 -1
  233. package/dist/index213.js.map +1 -1
  234. package/dist/index214.js +1 -1
  235. package/dist/index214.js.map +1 -1
  236. package/dist/index215.js +1 -1
  237. package/dist/index215.js.map +1 -1
  238. package/dist/index216.js +1 -1
  239. package/dist/index216.js.map +1 -1
  240. package/dist/index217.js +1 -1
  241. package/dist/index217.js.map +1 -1
  242. package/dist/index218.js +1 -1
  243. package/dist/index218.js.map +1 -1
  244. package/dist/index219.js +1 -1
  245. package/dist/index219.js.map +1 -1
  246. package/dist/index220.js +2 -2
  247. package/dist/index220.js.map +1 -1
  248. package/dist/index221.js +2 -2
  249. package/dist/index221.js.map +1 -1
  250. package/dist/index222.js +2 -2
  251. package/dist/index222.js.map +1 -1
  252. package/dist/index223.js +1 -1
  253. package/dist/index223.js.map +1 -1
  254. package/dist/index224.js +1 -1
  255. package/dist/index224.js.map +1 -1
  256. package/dist/index225.js +149 -2
  257. package/dist/index225.js.map +1 -1
  258. package/dist/index226.js +9 -149
  259. package/dist/index226.js.map +1 -1
  260. package/dist/index227.js +5 -8
  261. package/dist/index227.js.map +1 -1
  262. package/dist/index228.js +42 -5
  263. package/dist/index228.js.map +1 -1
  264. package/dist/index229.js +18 -40
  265. package/dist/index229.js.map +1 -1
  266. package/dist/index236.js +31 -0
  267. package/dist/index236.js.map +1 -0
  268. package/dist/index237.js +68 -24
  269. package/dist/index237.js.map +1 -1
  270. package/dist/index24.js +1 -1
  271. package/dist/{index245.js → index244.js} +1 -1
  272. package/dist/{index245.js.map → index244.js.map} +1 -1
  273. package/dist/{index247.js → index246.js} +1 -1
  274. package/dist/{index247.js.map → index246.js.map} +1 -1
  275. package/dist/{index256.js → index255.js} +1 -1
  276. package/dist/{index256.js.map → index255.js.map} +1 -1
  277. package/dist/{index259.js → index258.js} +1 -1
  278. package/dist/{index259.js.map → index258.js.map} +1 -1
  279. package/dist/index26.js +1 -1
  280. package/dist/index267.js +173 -0
  281. package/dist/index267.js.map +1 -0
  282. package/dist/index268.js +3 -169
  283. package/dist/index268.js.map +1 -1
  284. package/dist/{index88.js → index270.js} +1 -1
  285. package/dist/index270.js.map +1 -0
  286. package/dist/index29.js +2 -2
  287. package/dist/index30.js +1 -1
  288. package/dist/index31.js +1 -1
  289. package/dist/index34.js +1 -1
  290. package/dist/index36.js +1 -1
  291. package/dist/index37.js +1 -1
  292. package/dist/index38.js +1 -1
  293. package/dist/index39.js +1 -1
  294. package/dist/index40.js +2 -2
  295. package/dist/index41.js +1 -1
  296. package/dist/index43.js +1 -1
  297. package/dist/index44.js +27 -27
  298. package/dist/index44.js.map +1 -1
  299. package/dist/index45.js +1 -1
  300. package/dist/index47.js +1 -1
  301. package/dist/index52.js +2 -2
  302. package/dist/index55.js +1 -1
  303. package/dist/index57.js +1 -1
  304. package/dist/index58.js +1 -1
  305. package/dist/index59.js +1 -1
  306. package/dist/index6.js +137 -137
  307. package/dist/index63.js +1 -1
  308. package/dist/index67.js +1 -1
  309. package/dist/index69.js +1 -1
  310. package/dist/index7.js +1 -1
  311. package/dist/index71.js +1 -1
  312. package/dist/index85.js +1 -1
  313. package/dist/index87.js +1 -1
  314. package/dist/index89.js +5 -0
  315. package/dist/index89.js.map +1 -0
  316. package/dist/index9.js +1 -1
  317. package/dist/index90.js +2 -2
  318. package/dist/index90.js.map +1 -1
  319. package/dist/index91.js +2 -2
  320. package/dist/index91.js.map +1 -1
  321. package/dist/index92.js +2 -2
  322. package/dist/index92.js.map +1 -1
  323. package/dist/index93.js +2 -2
  324. package/dist/index93.js.map +1 -1
  325. package/dist/index94.js +1 -1
  326. package/dist/index94.js.map +1 -1
  327. package/dist/index95.js +1 -1
  328. package/dist/index95.js.map +1 -1
  329. package/dist/index96.js +1 -1
  330. package/dist/index96.js.map +1 -1
  331. package/dist/index97.js +1 -1
  332. package/dist/index97.js.map +1 -1
  333. package/dist/index98.js +1 -1
  334. package/dist/index98.js.map +1 -1
  335. package/dist/index99.js +1 -1
  336. package/dist/index99.js.map +1 -1
  337. package/package.json +1 -1
  338. package/dist/index230.js +0 -24
  339. package/dist/index230.js.map +0 -1
  340. package/dist/index238.js +0 -75
  341. package/dist/index238.js.map +0 -1
  342. package/dist/index269.js +0 -7
  343. package/dist/index269.js.map +0 -1
  344. package/dist/index88.js.map +0 -1
package/dist/index24.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import s, { useState as j, useEffect as K } from "react";
2
- import { useStableId as L } from "./index228.js";
2
+ import { useStableId as L } from "./index227.js";
3
3
  import { getA11yNameAttributes as q } from "./index87.js";
4
4
  import "./index78.js";
5
5
  /* empty css */
@@ -5,4 +5,4 @@ function o(...n) {
5
5
  export {
6
6
  o as mergeIds
7
7
  };
8
- //# sourceMappingURL=index245.js.map
8
+ //# sourceMappingURL=index244.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index245.js","sources":["../src/utils/mergeIds.ts"],"sourcesContent":["/**\n * Merges multiple ID strings into a single space-separated string.\n * Filters out falsy values and deduplicates IDs while preserving order.\n * \n * Useful for ARIA attributes (aria-describedby, aria-labelledby) and class names.\n * \n * @param ids - Array of id strings (or undefined/null)\n * @returns Merged space-separated id string, or undefined if no valid ids\n * \n * @example\n * mergeIds('error-1', undefined, 'helper-1', 'error-1')\n * // Returns: 'error-1 helper-1'\n */\nexport function mergeIds(...ids: (string | undefined | null)[]): string | undefined {\n const uniqueIds = [\n ...new Set(\n ids\n .filter((id): id is string => Boolean(id))\n .flatMap(id => id.trim().split(/\\s+/))\n .filter(Boolean)\n )\n ];\n \n return uniqueIds.length > 0 ? uniqueIds.join(' ') : undefined;\n}\n"],"names":["mergeIds","ids","uniqueIds","Set","filter","id","Boolean","flatMap","trim","split","length","join","undefined"],"mappings":"AAaO,SAASA,KAAYC,GAAwD;AAClF,QAAMC,IAAY,CAChB,GAAG,IAAIC,IACLF,EACGG,OAAO,CAACC,MAAqBC,EAAQD,CAAG,EACxCE,QAAQF,CAAAA,MAAMA,EAAGG,OAAOC,MAAM,KAAK,CAAC,EACpCL,OAAOE,OAAO,CACnB,CAAC;AAGH,SAAOJ,EAAUQ,SAAS,IAAIR,EAAUS,KAAK,GAAG,IAAIC;AACtD;"}
1
+ {"version":3,"file":"index244.js","sources":["../src/utils/mergeIds.ts"],"sourcesContent":["/**\n * Merges multiple ID strings into a single space-separated string.\n * Filters out falsy values and deduplicates IDs while preserving order.\n * \n * Useful for ARIA attributes (aria-describedby, aria-labelledby) and class names.\n * \n * @param ids - Array of id strings (or undefined/null)\n * @returns Merged space-separated id string, or undefined if no valid ids\n * \n * @example\n * mergeIds('error-1', undefined, 'helper-1', 'error-1')\n * // Returns: 'error-1 helper-1'\n */\nexport function mergeIds(...ids: (string | undefined | null)[]): string | undefined {\n const uniqueIds = [\n ...new Set(\n ids\n .filter((id): id is string => Boolean(id))\n .flatMap(id => id.trim().split(/\\s+/))\n .filter(Boolean)\n )\n ];\n \n return uniqueIds.length > 0 ? uniqueIds.join(' ') : undefined;\n}\n"],"names":["mergeIds","ids","uniqueIds","Set","filter","id","Boolean","flatMap","trim","split","length","join","undefined"],"mappings":"AAaO,SAASA,KAAYC,GAAwD;AAClF,QAAMC,IAAY,CAChB,GAAG,IAAIC,IACLF,EACGG,OAAO,CAACC,MAAqBC,EAAQD,CAAG,EACxCE,QAAQF,CAAAA,MAAMA,EAAGG,OAAOC,MAAM,KAAK,CAAC,EACpCL,OAAOE,OAAO,CACnB,CAAC;AAGH,SAAOJ,EAAUQ,SAAS,IAAIR,EAAUS,KAAK,GAAG,IAAIC;AACtD;"}
@@ -12,4 +12,4 @@ function n(o, u) {
12
12
  export {
13
13
  n as debounce
14
14
  };
15
- //# sourceMappingURL=index247.js.map
15
+ //# sourceMappingURL=index246.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index247.js","sources":["../src/utils/debounce.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => void>(func: T, wait: number) {\n let timeout: ReturnType<typeof setTimeout> | null;\n const debounced = (...args: Parameters<T>) => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n func(...args);\n }, wait);\n };\n debounced.cancel = () => {\n if (timeout) clearTimeout(timeout);\n timeout = null;\n };\n return debounced as T & { cancel: () => void };\n }"],"names":["debounce","func","wait","timeout","debounced","args","setTimeout","cancel"],"mappings":"AAAO,SAASA,EAA6CC,GAASC,GAAc;AAChF,MAAIC;AACJ,QAAMC,IAAYA,IAAIC,MAAwB;AAC5C,IAAIF,kBAAsBA,CAAO,GACjCA,IAAUG,WAAW,MAAM;AACzBL,MAAAA,EAAK,GAAGI,CAAI;AAAA,IACd,GAAGH,CAAI;AAAA,EACT;AACAE,SAAAA,EAAUG,SAAS,MAAM;AACvB,IAAIJ,kBAAsBA,CAAO,GACjCA,IAAU;AAAA,EACZ,GACOC;AACT;"}
1
+ {"version":3,"file":"index246.js","sources":["../src/utils/debounce.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => void>(func: T, wait: number) {\n let timeout: ReturnType<typeof setTimeout> | null;\n const debounced = (...args: Parameters<T>) => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(() => {\n func(...args);\n }, wait);\n };\n debounced.cancel = () => {\n if (timeout) clearTimeout(timeout);\n timeout = null;\n };\n return debounced as T & { cancel: () => void };\n }"],"names":["debounce","func","wait","timeout","debounced","args","setTimeout","cancel"],"mappings":"AAAO,SAASA,EAA6CC,GAASC,GAAc;AAChF,MAAIC;AACJ,QAAMC,IAAYA,IAAIC,MAAwB;AAC5C,IAAIF,kBAAsBA,CAAO,GACjCA,IAAUG,WAAW,MAAM;AACzBL,MAAAA,EAAK,GAAGI,CAAI;AAAA,IACd,GAAGH,CAAI;AAAA,EACT;AACAE,SAAAA,EAAUG,SAAS,MAAM;AACvB,IAAIJ,kBAAsBA,CAAO,GACjCA,IAAU;AAAA,EACZ,GACOC;AACT;"}
@@ -1233,4 +1233,4 @@ const e = [
1233
1233
  export {
1234
1234
  e as default
1235
1235
  };
1236
- //# sourceMappingURL=index256.js.map
1236
+ //# sourceMappingURL=index255.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index256.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,"file":"index259.js","sources":["../src/components/NavigationBar/TabButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Button } from '../Button';\n\nexport interface TabButtonProps {\n id: string;\n label: string;\n isSelected: boolean;\n isDisabled?: boolean;\n panelId?: string;\n tabIndex: number;\n className?: string;\n automationId?: string;\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;\n onFocus: () => void;\n onKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>) => void;\n}\n\n/**\n * Internal TabButton component for NavigationBar.\n * Uses Button (unstyled) internally for consistent activation handling.\n * Supports forwardRef for focus management (roving tabindex).\n */\nexport const TabButton = forwardRef<HTMLButtonElement, TabButtonProps>(\n (\n {\n id,\n label,\n isSelected,\n isDisabled = false,\n panelId,\n tabIndex,\n className = '',\n automationId,\n onClick,\n onFocus,\n onKeyDown\n },\n ref\n ) => {\n return (\n <Button\n ref={ref}\n type=\"unstyled\"\n label={label}\n disabled={isDisabled}\n onClick={onClick}\n className={className}\n automationId={automationId}\n role=\"tab\"\n id={id}\n aria-selected={isSelected}\n {...(panelId ? { 'aria-controls': panelId } : {})}\n tabIndex={tabIndex}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n />\n );\n }\n);\n\nTabButton.displayName = 'TabButton';\n"],"names":["TabButton","id","label","isSelected","isDisabled","panelId","tabIndex","className","automationId","onClick","onFocus","onKeyDown","ref","React","createElement","Button","_extends","type","disabled","role","displayName"],"mappings":";;;;;;;;;;;AAsBO,MAAMA,sBACX,CACE;AAAA,EACEC,IAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,SAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,cAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AACF,GACAC,MAGEC,gBAAAA,EAAAC,cAACC,GAAMC,EAAA;AAAA,EACLJ,KAAAA;AAAAA,EACAK,MAAK;AAAA,EACLf,OAAAA;AAAAA,EACAgB,UAAUd;AAAAA,EACVK,SAAAA;AAAAA,EACAF,WAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAW,MAAK;AAAA,EACLlB,IAAAA;AAAAA,EACA,iBAAeE;AAAAA,GACVE,IAAU;AAAA,EAAE,iBAAiBA;AAAAA,IAAY,IAAE;AAAA,EAChDC,UAAAA;AAAAA,EACAI,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,CAAqB,CACtB,CAGP;AAEAX,EAAUoB,cAAc;"}
1
+ {"version":3,"file":"index258.js","sources":["../src/components/NavigationBar/TabButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Button } from '../Button';\n\nexport interface TabButtonProps {\n id: string;\n label: string;\n isSelected: boolean;\n isDisabled?: boolean;\n panelId?: string;\n tabIndex: number;\n className?: string;\n automationId?: string;\n onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;\n onFocus: () => void;\n onKeyDown: (e: React.KeyboardEvent<HTMLButtonElement>) => void;\n}\n\n/**\n * Internal TabButton component for NavigationBar.\n * Uses Button (unstyled) internally for consistent activation handling.\n * Supports forwardRef for focus management (roving tabindex).\n */\nexport const TabButton = forwardRef<HTMLButtonElement, TabButtonProps>(\n (\n {\n id,\n label,\n isSelected,\n isDisabled = false,\n panelId,\n tabIndex,\n className = '',\n automationId,\n onClick,\n onFocus,\n onKeyDown\n },\n ref\n ) => {\n return (\n <Button\n ref={ref}\n type=\"unstyled\"\n label={label}\n disabled={isDisabled}\n onClick={onClick}\n className={className}\n automationId={automationId}\n role=\"tab\"\n id={id}\n aria-selected={isSelected}\n {...(panelId ? { 'aria-controls': panelId } : {})}\n tabIndex={tabIndex}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n />\n );\n }\n);\n\nTabButton.displayName = 'TabButton';\n"],"names":["TabButton","id","label","isSelected","isDisabled","panelId","tabIndex","className","automationId","onClick","onFocus","onKeyDown","ref","React","createElement","Button","_extends","type","disabled","role","displayName"],"mappings":";;;;;;;;;;;AAsBO,MAAMA,sBACX,CACE;AAAA,EACEC,IAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA,IAAa;AAAA,EACbC,SAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,cAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,WAAAA;AACF,GACAC,MAGEC,gBAAAA,EAAAC,cAACC,GAAMC,EAAA;AAAA,EACLJ,KAAAA;AAAAA,EACAK,MAAK;AAAA,EACLf,OAAAA;AAAAA,EACAgB,UAAUd;AAAAA,EACVK,SAAAA;AAAAA,EACAF,WAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAW,MAAK;AAAA,EACLlB,IAAAA;AAAAA,EACA,iBAAeE;AAAAA,GACVE,IAAU;AAAA,EAAE,iBAAiBA;AAAAA,IAAY,IAAE;AAAA,EAChDC,UAAAA;AAAAA,EACAI,SAAAA;AAAAA,EACAC,WAAAA;AAAAA,CAAqB,CACtB,CAGP;AAEAX,EAAUoB,cAAc;"}
package/dist/index26.js CHANGED
@@ -4,7 +4,7 @@ import { Icon as we } from "./index6.js";
4
4
  import { Checkbox as He } from "./index24.js";
5
5
  import { Button as Se } from "./index4.js";
6
6
  import { InputWithIcon as Me } from "./index58.js";
7
- import { useStableId as X } from "./index228.js";
7
+ import { useStableId as X } from "./index227.js";
8
8
  import { useCombobox as xe } from "./index74.js";
9
9
  import { getFocusableElements as Ue } from "./index77.js";
10
10
  import "./index78.js";
@@ -0,0 +1,173 @@
1
+ import { useState as W, useMemo as F, useEffect as N, useCallback as S } from "react";
2
+ import { useRovingFocus as C } from "./index76.js";
3
+ const z = (e, n, s, g, m, D = !1) => {
4
+ const i = e.toLocaleDateString("en-US", {
5
+ weekday: "long",
6
+ month: "long",
7
+ day: "numeric",
8
+ year: "numeric"
9
+ });
10
+ return m ? i : g ? `${i}, start and end of range` : n ? `${i}, start of range` : s ? `${i}, end of range` : D ? `${i}, in range` : i;
11
+ }, y = (e) => {
12
+ const n = e.getFullYear(), s = String(e.getMonth() + 1).padStart(2, "0"), g = String(e.getDate()).padStart(2, "0");
13
+ return `date-${n}-${s}-${g}`;
14
+ }, k = (e, n) => new Date(e, n + 1, 0).getDate(), L = (e) => {
15
+ const n = e.getFullYear(), s = e.getMonth();
16
+ return Array.from({
17
+ length: k(n, s)
18
+ }, (g, m) => y(new Date(n, s, m + 1)));
19
+ }, x = (e, n, s) => {
20
+ const g = e.getFullYear(), m = e.getMonth(), D = (a) => a.getFullYear() === g && a.getMonth() === m;
21
+ if (s.startDate && D(s.startDate)) {
22
+ const a = new Date(s.startDate);
23
+ a.setHours(0, 0, 0, 0);
24
+ const l = y(a);
25
+ if (n.includes(l)) return l;
26
+ }
27
+ if (s.endDate && D(s.endDate)) {
28
+ const a = new Date(s.endDate);
29
+ a.setHours(0, 0, 0, 0);
30
+ const l = y(a);
31
+ if (n.includes(l)) return l;
32
+ }
33
+ const i = /* @__PURE__ */ new Date();
34
+ if (D(i)) {
35
+ const a = y(i);
36
+ if (n.includes(a)) return a;
37
+ }
38
+ return n[0] || "";
39
+ };
40
+ function B({
41
+ leftMonth: e,
42
+ rightMonth: n,
43
+ showSingleMonth: s,
44
+ selectedRange: g,
45
+ onMonthChange: m
46
+ }) {
47
+ const [D, i] = W(null), a = F(() => L(e), [e]), l = F(() => L(n), [n]), E = F(() => x(e, a, g), [e, a, g]), H = F(() => x(n, l, g), [n, l, g]), {
48
+ getRovingItemProps: Y,
49
+ focusItem: I,
50
+ getContainerProps: U
51
+ } = C({
52
+ itemIds: a,
53
+ defaultFocusedId: E,
54
+ orientation: "grid",
55
+ cols: 7,
56
+ loop: !1,
57
+ role: "grid"
58
+ }), {
59
+ getRovingItemProps: M,
60
+ focusItem: h,
61
+ getContainerProps: G
62
+ } = C({
63
+ itemIds: l,
64
+ defaultFocusedId: H,
65
+ orientation: "grid",
66
+ cols: 7,
67
+ loop: !1,
68
+ role: "grid"
69
+ });
70
+ N(() => {
71
+ if (!D) return;
72
+ const f = y(D);
73
+ a.includes(f) ? (I(f), i(null)) : l.includes(f) && (h(f), i(null));
74
+ }, [D, a, l, I, h]);
75
+ const b = S((f, K) => {
76
+ const v = s || K === "left";
77
+ m(new Date(f.getFullYear(), f.getMonth(), 1), v), i(new Date(f));
78
+ }, [s, m]);
79
+ return {
80
+ getGridCellProps: S(({
81
+ isLeftCalendar: f,
82
+ isDateDisabled: K,
83
+ handleDateClick: v
84
+ }) => {
85
+ const A = f ? "left" : "right", $ = f ? I : h, O = f ? Y : M, R = (t, p) => {
86
+ const c = p.getFullYear(), o = p.getMonth(), d = p.getDate(), w = (r) => {
87
+ if (r.getFullYear() !== c || r.getMonth() !== o) {
88
+ b(r, A);
89
+ return;
90
+ }
91
+ $(y(r));
92
+ };
93
+ switch (t.key) {
94
+ case "ArrowLeft":
95
+ t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d - 1));
96
+ break;
97
+ case "ArrowRight":
98
+ t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d + 1));
99
+ break;
100
+ case "ArrowUp":
101
+ t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d - 7));
102
+ break;
103
+ case "ArrowDown":
104
+ t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d + 7));
105
+ break;
106
+ case "Home": {
107
+ t.preventDefault(), t.stopPropagation();
108
+ const r = p.getDay(), u = new Date(c, o, d - r), P = u.getMonth() !== o ? new Date(c, o, 1) : u;
109
+ $(y(P));
110
+ break;
111
+ }
112
+ case "End": {
113
+ t.preventDefault(), t.stopPropagation();
114
+ const r = p.getDay(), u = new Date(c, o, d + (6 - r)), P = k(c, o), T = u.getMonth() !== o ? new Date(c, o, P) : u;
115
+ $(y(T));
116
+ break;
117
+ }
118
+ case "PageUp": {
119
+ t.preventDefault(), t.stopPropagation();
120
+ const r = t.shiftKey ? c - 1 : c, u = t.shiftKey ? o : o - 1, P = Math.min(d, k(r, u));
121
+ b(new Date(r, u, P), A);
122
+ break;
123
+ }
124
+ case "PageDown": {
125
+ t.preventDefault(), t.stopPropagation();
126
+ const r = t.shiftKey ? c + 1 : c, u = t.shiftKey ? o : o + 1, P = Math.min(d, k(r, u));
127
+ b(new Date(r, u, P), A);
128
+ break;
129
+ }
130
+ case "Enter":
131
+ case " ":
132
+ t.preventDefault(), K(p) || v(p);
133
+ break;
134
+ }
135
+ };
136
+ return ({
137
+ cellId: t,
138
+ cellDate: p,
139
+ disabled: c,
140
+ ariaLabel: o,
141
+ ariaCurrent: d,
142
+ ariaDisabled: w
143
+ }) => {
144
+ const r = O(t);
145
+ return {
146
+ id: t,
147
+ ref: r.ref,
148
+ tabIndex: r.tabIndex,
149
+ onFocus: r.onFocus,
150
+ "aria-label": o,
151
+ "aria-current": d,
152
+ "aria-disabled": w,
153
+ onKeyDown: (u) => R(u, p),
154
+ onClick: () => {
155
+ c || v(p);
156
+ }
157
+ };
158
+ };
159
+ }, [b, I, h, Y, M]),
160
+ getLeftRovingItemProps: Y,
161
+ getRightRovingItemProps: M,
162
+ getLeftContainerProps: U,
163
+ getRightContainerProps: G,
164
+ focusLeftItem: I,
165
+ focusRightItem: h
166
+ };
167
+ }
168
+ export {
169
+ y as formatDateId,
170
+ z as getCellAriaLabel,
171
+ B as useDatePickerA11y
172
+ };
173
+ //# sourceMappingURL=index267.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index267.js","sources":["../src/components/DatePicker/useDatePickerA11y.ts"],"sourcesContent":["import React, { useState, useCallback, useEffect, useMemo } from 'react';\n\nimport { useRovingFocus, RovingItemProps, RovingContainerProps, AccessibleNameInput } from '../../utils/a11y/useRovingFocus';\nimport type { DateRange } from './index';\n\nexport const getCellAriaLabel = (\n date: Date,\n isStart: boolean,\n isEnd: boolean,\n isSameStartEnd: boolean,\n singleDateSelection: boolean,\n inRange: boolean = false\n): string => {\n const base = date.toLocaleDateString('en-US', {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric'\n });\n if (singleDateSelection) return base;\n if (isSameStartEnd) return `${base}, start and end of range`;\n if (isStart) return `${base}, start of range`;\n if (isEnd) return `${base}, end of range`;\n if (inRange) return `${base}, in range`;\n return base;\n};\n\nexport const formatDateId = (d: Date) => {\n const y = d.getFullYear();\n const m = String(d.getMonth() + 1).padStart(2, '0');\n const dd = String(d.getDate()).padStart(2, '0');\n return `date-${y}-${m}-${dd}`;\n};\n\nconst getDaysInMonth = (year: number, month: number) => new Date(year, month + 1, 0).getDate();\n\nconst getPanelItemIds = (panelDate: Date): string[] => {\n const year = panelDate.getFullYear();\n const month = panelDate.getMonth();\n return Array.from({ length: getDaysInMonth(year, month) }, (_, i) =>\n formatDateId(new Date(year, month, i + 1))\n );\n};\n\nconst getPanelDefaultFocusId = (panelDate: Date, itemIds: string[], selectedRange: DateRange): string => {\n const year = panelDate.getFullYear();\n const month = panelDate.getMonth();\n const isInPanel = (d: Date) => d.getFullYear() === year && d.getMonth() === month;\n\n // Prefer startDate if it falls in this panel\n if (selectedRange.startDate && isInPanel(selectedRange.startDate)) {\n const d = new Date(selectedRange.startDate);\n d.setHours(0, 0, 0, 0);\n const id = formatDateId(d);\n if (itemIds.includes(id)) return id;\n }\n // Fall back to endDate if it falls in this panel (e.g. right panel when start is in left panel)\n if (selectedRange.endDate && isInPanel(selectedRange.endDate)) {\n const d = new Date(selectedRange.endDate);\n d.setHours(0, 0, 0, 0);\n const id = formatDateId(d);\n if (itemIds.includes(id)) return id;\n }\n const today = new Date();\n if (isInPanel(today)) {\n const id = formatDateId(today);\n if (itemIds.includes(id)) return id;\n }\n return itemIds[0] || '';\n};\n\ninterface UseDatePickerA11yOptions {\n leftMonth: Date;\n rightMonth: Date;\n showSingleMonth: boolean;\n selectedRange: DateRange;\n onMonthChange: (date: Date, isLeft: boolean) => void;\n}\n\ninterface CellKeyDownOptions {\n isLeftCalendar: boolean;\n isDateDisabled: (date: Date) => boolean;\n handleDateClick: (date: Date) => void;\n}\n\ninterface GridCellItemInput {\n cellId: string;\n cellDate: Date;\n disabled: boolean;\n ariaLabel: string;\n ariaCurrent: 'date' | undefined;\n ariaDisabled: true | undefined;\n}\n\nexport interface GridCellElementProps {\n id: string;\n ref: (el: HTMLElement | null) => void;\n tabIndex: number;\n onFocus: () => void;\n 'aria-label': string;\n 'aria-current': 'date' | undefined;\n 'aria-disabled': true | undefined;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onClick: () => void;\n}\n\ninterface UseDatePickerA11yReturn {\n getGridCellProps: (options: CellKeyDownOptions) => (item: GridCellItemInput) => GridCellElementProps;\n getLeftRovingItemProps: (id: string) => RovingItemProps;\n getRightRovingItemProps: (id: string) => RovingItemProps;\n getLeftContainerProps: (nameInput?: AccessibleNameInput) => RovingContainerProps;\n getRightContainerProps: (nameInput?: AccessibleNameInput) => RovingContainerProps;\n focusLeftItem: (id: string) => void;\n focusRightItem: (id: string) => void;\n}\n\nexport function useDatePickerA11y({\n leftMonth,\n rightMonth,\n showSingleMonth,\n selectedRange,\n onMonthChange\n}: UseDatePickerA11yOptions): UseDatePickerA11yReturn {\n const [keyboardFocusDate, setKeyboardFocusDate] = useState<Date | null>(null);\n\n const leftItemIds = useMemo(() => getPanelItemIds(leftMonth), [leftMonth]);\n const rightItemIds = useMemo(() => getPanelItemIds(rightMonth), [rightMonth]);\n\n const leftDefaultFocusId = useMemo(\n () => getPanelDefaultFocusId(leftMonth, leftItemIds, selectedRange),\n [leftMonth, leftItemIds, selectedRange]\n );\n const rightDefaultFocusId = useMemo(\n () => getPanelDefaultFocusId(rightMonth, rightItemIds, selectedRange),\n [rightMonth, rightItemIds, selectedRange]\n );\n\n const { getRovingItemProps: getLeftRovingItemProps, focusItem: focusLeftItem, getContainerProps: getLeftContainerProps } = useRovingFocus({\n itemIds: leftItemIds,\n defaultFocusedId: leftDefaultFocusId,\n orientation: 'grid',\n cols: 7,\n loop: false,\n role: 'grid'\n });\n\n const { getRovingItemProps: getRightRovingItemProps, focusItem: focusRightItem, getContainerProps: getRightContainerProps } = useRovingFocus({\n itemIds: rightItemIds,\n defaultFocusedId: rightDefaultFocusId,\n orientation: 'grid',\n cols: 7,\n loop: false,\n role: 'grid'\n });\n\n // After keyboard navigation shifts a panel to a new month, focus the target cell via roving focus refs\n useEffect(() => {\n if (!keyboardFocusDate) return;\n const id = formatDateId(keyboardFocusDate);\n if (leftItemIds.includes(id)) {\n focusLeftItem(id);\n setKeyboardFocusDate(null);\n } else if (rightItemIds.includes(id)) {\n focusRightItem(id);\n setKeyboardFocusDate(null);\n }\n }, [keyboardFocusDate, leftItemIds, rightItemIds, focusLeftItem, focusRightItem]);\n\n // Navigate the keyboard focus to a date that may be in a different month.\n // Each panel advances completely independently — never touches the other panel.\n const handleKeyboardNavigate = useCallback(\n (targetDate: Date, sourcePanel: 'left' | 'right') => {\n const isLeft = showSingleMonth || sourcePanel === 'left';\n onMonthChange(new Date(targetDate.getFullYear(), targetDate.getMonth(), 1), isLeft);\n setKeyboardFocusDate(new Date(targetDate));\n },\n [showSingleMonth, onMonthChange]\n );\n\n const getGridCellProps = useCallback(\n ({ isLeftCalendar, isDateDisabled, handleDateClick }: CellKeyDownOptions) => {\n const panel: 'left' | 'right' = isLeftCalendar ? 'left' : 'right';\n const focusPanelItem = isLeftCalendar ? focusLeftItem : focusRightItem;\n const getRovingItemProps = isLeftCalendar ? getLeftRovingItemProps : getRightRovingItemProps;\n\n const handleKeyDown = (e: React.KeyboardEvent, cellDate: Date) => {\n const cellYear = cellDate.getFullYear();\n const cellMonth = cellDate.getMonth();\n const cellDay = cellDate.getDate();\n\n const navigateTo = (targetDate: Date) => {\n if (targetDate.getFullYear() !== cellYear || targetDate.getMonth() !== cellMonth) {\n handleKeyboardNavigate(targetDate, panel);\n return;\n }\n focusPanelItem(formatDateId(targetDate));\n };\n\n switch (e.key) {\n case 'ArrowLeft':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay - 1));\n break;\n case 'ArrowRight':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay + 1));\n break;\n case 'ArrowUp':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay - 7));\n break;\n case 'ArrowDown':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay + 7));\n break;\n case 'Home': {\n // First day of the current week row (Sunday), clamped to month start\n e.preventDefault(); e.stopPropagation();\n const dayOfWeek = cellDate.getDay();\n const homeDate = new Date(cellYear, cellMonth, cellDay - dayOfWeek);\n const clamped = homeDate.getMonth() !== cellMonth ? new Date(cellYear, cellMonth, 1) : homeDate;\n focusPanelItem(formatDateId(clamped));\n break;\n }\n case 'End': {\n // Last day of the current week row (Saturday), clamped to month end\n e.preventDefault(); e.stopPropagation();\n const dayOfWeek = cellDate.getDay();\n const endDate = new Date(cellYear, cellMonth, cellDay + (6 - dayOfWeek));\n const daysInThisMonth = getDaysInMonth(cellYear, cellMonth);\n const clamped =\n endDate.getMonth() !== cellMonth ? new Date(cellYear, cellMonth, daysInThisMonth) : endDate;\n focusPanelItem(formatDateId(clamped));\n break;\n }\n case 'PageUp': {\n // Shift+PageUp = previous year, PageUp = previous month\n e.preventDefault(); e.stopPropagation();\n const tYear = e.shiftKey ? cellYear - 1 : cellYear;\n const tMonth = e.shiftKey ? cellMonth : cellMonth - 1;\n const tDay = Math.min(cellDay, getDaysInMonth(tYear, tMonth));\n handleKeyboardNavigate(new Date(tYear, tMonth, tDay), panel);\n break;\n }\n case 'PageDown': {\n // Shift+PageDown = next year, PageDown = next month\n e.preventDefault(); e.stopPropagation();\n const tYear = e.shiftKey ? cellYear + 1 : cellYear;\n const tMonth = e.shiftKey ? cellMonth : cellMonth + 1;\n const tDay = Math.min(cellDay, getDaysInMonth(tYear, tMonth));\n handleKeyboardNavigate(new Date(tYear, tMonth, tDay), panel);\n break;\n }\n case 'Enter':\n case ' ':\n e.preventDefault();\n if (!isDateDisabled(cellDate)) {\n handleDateClick(cellDate);\n }\n break;\n }\n };\n\n return ({ cellId, cellDate, disabled, ariaLabel, ariaCurrent, ariaDisabled }: GridCellItemInput): GridCellElementProps => {\n const rovingProps = getRovingItemProps(cellId);\n return {\n id: cellId,\n ref: rovingProps.ref,\n tabIndex: rovingProps.tabIndex,\n onFocus: rovingProps.onFocus,\n 'aria-label': ariaLabel,\n 'aria-current': ariaCurrent,\n 'aria-disabled': ariaDisabled,\n onKeyDown: (e: React.KeyboardEvent) => handleKeyDown(e, cellDate),\n onClick: () => { if (!disabled) handleDateClick(cellDate); }\n };\n };\n },\n [handleKeyboardNavigate, focusLeftItem, focusRightItem, getLeftRovingItemProps, getRightRovingItemProps]\n );\n\n return {\n getGridCellProps,\n getLeftRovingItemProps,\n getRightRovingItemProps,\n getLeftContainerProps,\n getRightContainerProps,\n focusLeftItem,\n focusRightItem\n };\n}\n"],"names":["useState","useMemo","useEffect","useCallback","useRovingFocus","getCellAriaLabel","date","isStart","isEnd","isSameStartEnd","singleDateSelection","inRange","base","toLocaleDateString","weekday","month","day","year","formatDateId","d","y","getFullYear","m","String","getMonth","padStart","dd","getDate","getDaysInMonth","Date","getPanelItemIds","panelDate","Array","from","length","_","i","getPanelDefaultFocusId","itemIds","selectedRange","isInPanel","startDate","setHours","id","includes","endDate","today","useDatePickerA11y","leftMonth","rightMonth","showSingleMonth","onMonthChange","keyboardFocusDate","setKeyboardFocusDate","leftItemIds","rightItemIds","leftDefaultFocusId","rightDefaultFocusId","getRovingItemProps","getLeftRovingItemProps","focusItem","focusLeftItem","getContainerProps","getLeftContainerProps","defaultFocusedId","orientation","cols","loop","role","getRightRovingItemProps","focusRightItem","getRightContainerProps","handleKeyboardNavigate","targetDate","sourcePanel","isLeft","getGridCellProps","isLeftCalendar","isDateDisabled","handleDateClick","panel","focusPanelItem","handleKeyDown","e","cellDate","cellYear","cellMonth","cellDay","navigateTo","key","preventDefault","stopPropagation","dayOfWeek","getDay","homeDate","clamped","daysInThisMonth","tYear","shiftKey","tMonth","tDay","Math","min","cellId","disabled","ariaLabel","ariaCurrent","ariaDisabled","rovingProps","ref","tabIndex","onFocus","onKeyDown","onClick"],"mappings":"AAKO,SAAA,YAAAA,GAAA,WAAAC,GAAA,aAAAC,GAAA,eAAAC,SAAA;AAAA,SAAA,kBAAAC,SAAA;AAAA,MAAMC,IAAmBA,CAC9BC,GACAC,GACAC,GACAC,GACAC,GACAC,IAAmB,OACR;AACX,QAAMC,IAAON,EAAKO,mBAAmB,SAAS;AAAA,IAC5CC,SAAS;AAAA,IACTC,OAAO;AAAA,IACPC,KAAK;AAAA,IACLC,MAAM;AAAA,EAAA,CACP;AACD,SAAIP,IAA4BE,IAC5BH,IAAuB,GAAGG,CAAI,6BAC9BL,IAAgB,GAAGK,CAAI,qBACvBJ,IAAc,GAAGI,CAAI,mBACrBD,IAAgB,GAAGC,CAAI,eACpBA;AACT,GAEaM,IAAeA,CAACC,MAAY;AACvC,QAAMC,IAAID,EAAEE,YAAAA,GACNC,IAAIC,OAAOJ,EAAEK,SAAAA,IAAa,CAAC,EAAEC,SAAS,GAAG,GAAG,GAC5CC,IAAKH,OAAOJ,EAAEQ,QAAAA,CAAS,EAAEF,SAAS,GAAG,GAAG;AAC9C,SAAO,QAAQL,CAAC,IAAIE,CAAC,IAAII,CAAE;AAC7B,GAEME,IAAiBA,CAACX,GAAcF,MAAkB,IAAIc,KAAKZ,GAAMF,IAAQ,GAAG,CAAC,EAAEY,QAAAA,GAE/EG,IAAkBA,CAACC,MAA8B;AACrD,QAAMd,IAAOc,EAAUV,YAAAA,GACjBN,IAAQgB,EAAUP,SAAAA;AACxB,SAAOQ,MAAMC,KAAK;AAAA,IAAEC,QAAQN,EAAeX,GAAMF,CAAK;AAAA,EAAA,GAAK,CAACoB,GAAGC,MAC7DlB,EAAa,IAAIW,KAAKZ,GAAMF,GAAOqB,IAAI,CAAC,CAAC,CAC3C;AACF,GAEMC,IAAy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C5D3B,YAAAA,EAAuB,IAAI3C,KAAKoE,GAAOE,GAAQC,CAAI,GAAGpB,CAAK;AAC3D;AAAA,UACF;AAAA,UACA,KAAK;AAAA,UACL,KAAK;AACHG,YAAAA,EAAEO,eAAAA,GACGZ,EAAeM,CAAQ,KAC1BL,EAAgBK,CAAQ;AAE1B;AAAA,QAAA;AAAA,MAEN;AAEA,aAAO,CAAC;AAAA,QAAEmB,QAAAA;AAAAA,QAAQnB,UAAAA;AAAAA,QAAUoB,UAAAA;AAAAA,QAAUC,WAAAA;AAAAA,QAAWC,aAAAA;AAAAA,QAAaC,cAAAA;AAAAA,MAAAA,MAA4D;AACxH,cAAMC,IAAclD,EAAmB6C,CAAM;AAC7C,eAAO;AAAA,UACL5D,IAAI4D;AAAAA,UACJM,KAAKD,EAAYC;AAAAA,UACjBC,UAAUF,EAAYE;AAAAA,UACtBC,SAASH,EAAYG;AAAAA,UACrB,cAAcN;AAAAA,UACd,gBAAgBC;AAAAA,UAChB,iBAAiBC;AAAAA,UACjBK,WAAWA,CAAC7B,MAA2BD,EAAcC,GAAGC,CAAQ;AAAA,UAChE6B,SAASA,MAAM;AAAE,YAAKT,KAAUzB,EAAgBK,CAAQ;AAAA,UAAG;AAAA,QAAA;AAAA,MAE/D;AAAA,IACF,GACA,CAACZ,GAAwBX,GAAeS,GAAgBX,GAAwBU,CAAuB,CACzG;AAAA,IAIEV,wBAAAA;AAAAA,IACAU,yBAAAA;AAAAA,IACAN,uBAAAA;AAAAA,IACAQ,wBAAAA;AAAAA,IACAV,eAAAA;AAAAA,IACAS,gBAAAA;AAAAA,EAAAA;AAEJ;"}
package/dist/index268.js CHANGED
@@ -1,173 +1,7 @@
1
- import { useState as W, useMemo as F, useEffect as N, useCallback as S } from "react";
2
- import { useRovingFocus as C } from "./index76.js";
3
- const z = (e, n, s, g, m, D = !1) => {
4
- const i = e.toLocaleDateString("en-US", {
5
- weekday: "long",
6
- month: "long",
7
- day: "numeric",
8
- year: "numeric"
9
- });
10
- return m ? i : g ? `${i}, start and end of range` : n ? `${i}, start of range` : s ? `${i}, end of range` : D ? `${i}, in range` : i;
11
- }, y = (e) => {
12
- const n = e.getFullYear(), s = String(e.getMonth() + 1).padStart(2, "0"), g = String(e.getDate()).padStart(2, "0");
13
- return `date-${n}-${s}-${g}`;
14
- }, k = (e, n) => new Date(e, n + 1, 0).getDate(), L = (e) => {
15
- const n = e.getFullYear(), s = e.getMonth();
16
- return Array.from({
17
- length: k(n, s)
18
- }, (g, m) => y(new Date(n, s, m + 1)));
19
- }, x = (e, n, s) => {
20
- const g = e.getFullYear(), m = e.getMonth(), D = (a) => a.getFullYear() === g && a.getMonth() === m;
21
- if (s.startDate && D(s.startDate)) {
22
- const a = new Date(s.startDate);
23
- a.setHours(0, 0, 0, 0);
24
- const l = y(a);
25
- if (n.includes(l)) return l;
26
- }
27
- if (s.endDate && D(s.endDate)) {
28
- const a = new Date(s.endDate);
29
- a.setHours(0, 0, 0, 0);
30
- const l = y(a);
31
- if (n.includes(l)) return l;
32
- }
33
- const i = /* @__PURE__ */ new Date();
34
- if (D(i)) {
35
- const a = y(i);
36
- if (n.includes(a)) return a;
37
- }
38
- return n[0] || "";
39
- };
40
- function B({
41
- leftMonth: e,
42
- rightMonth: n,
43
- showSingleMonth: s,
44
- selectedRange: g,
45
- onMonthChange: m
46
- }) {
47
- const [D, i] = W(null), a = F(() => L(e), [e]), l = F(() => L(n), [n]), E = F(() => x(e, a, g), [e, a, g]), H = F(() => x(n, l, g), [n, l, g]), {
48
- getRovingItemProps: Y,
49
- focusItem: I,
50
- getContainerProps: U
51
- } = C({
52
- itemIds: a,
53
- defaultFocusedId: E,
54
- orientation: "grid",
55
- cols: 7,
56
- loop: !1,
57
- role: "grid"
58
- }), {
59
- getRovingItemProps: M,
60
- focusItem: h,
61
- getContainerProps: G
62
- } = C({
63
- itemIds: l,
64
- defaultFocusedId: H,
65
- orientation: "grid",
66
- cols: 7,
67
- loop: !1,
68
- role: "grid"
69
- });
70
- N(() => {
71
- if (!D) return;
72
- const f = y(D);
73
- a.includes(f) ? (I(f), i(null)) : l.includes(f) && (h(f), i(null));
74
- }, [D, a, l, I, h]);
75
- const b = S((f, K) => {
76
- const v = s || K === "left";
77
- m(new Date(f.getFullYear(), f.getMonth(), 1), v), i(new Date(f));
78
- }, [s, m]);
79
- return {
80
- getGridCellProps: S(({
81
- isLeftCalendar: f,
82
- isDateDisabled: K,
83
- handleDateClick: v
84
- }) => {
85
- const A = f ? "left" : "right", $ = f ? I : h, O = f ? Y : M, R = (t, p) => {
86
- const c = p.getFullYear(), o = p.getMonth(), d = p.getDate(), w = (r) => {
87
- if (r.getFullYear() !== c || r.getMonth() !== o) {
88
- b(r, A);
89
- return;
90
- }
91
- $(y(r));
92
- };
93
- switch (t.key) {
94
- case "ArrowLeft":
95
- t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d - 1));
96
- break;
97
- case "ArrowRight":
98
- t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d + 1));
99
- break;
100
- case "ArrowUp":
101
- t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d - 7));
102
- break;
103
- case "ArrowDown":
104
- t.preventDefault(), t.stopPropagation(), w(new Date(c, o, d + 7));
105
- break;
106
- case "Home": {
107
- t.preventDefault(), t.stopPropagation();
108
- const r = p.getDay(), u = new Date(c, o, d - r), P = u.getMonth() !== o ? new Date(c, o, 1) : u;
109
- $(y(P));
110
- break;
111
- }
112
- case "End": {
113
- t.preventDefault(), t.stopPropagation();
114
- const r = p.getDay(), u = new Date(c, o, d + (6 - r)), P = k(c, o), T = u.getMonth() !== o ? new Date(c, o, P) : u;
115
- $(y(T));
116
- break;
117
- }
118
- case "PageUp": {
119
- t.preventDefault(), t.stopPropagation();
120
- const r = t.shiftKey ? c - 1 : c, u = t.shiftKey ? o : o - 1, P = Math.min(d, k(r, u));
121
- b(new Date(r, u, P), A);
122
- break;
123
- }
124
- case "PageDown": {
125
- t.preventDefault(), t.stopPropagation();
126
- const r = t.shiftKey ? c + 1 : c, u = t.shiftKey ? o : o + 1, P = Math.min(d, k(r, u));
127
- b(new Date(r, u, P), A);
128
- break;
129
- }
130
- case "Enter":
131
- case " ":
132
- t.preventDefault(), K(p) || v(p);
133
- break;
134
- }
135
- };
136
- return ({
137
- cellId: t,
138
- cellDate: p,
139
- disabled: c,
140
- ariaLabel: o,
141
- ariaCurrent: d,
142
- ariaDisabled: w
143
- }) => {
144
- const r = O(t);
145
- return {
146
- id: t,
147
- ref: r.ref,
148
- tabIndex: r.tabIndex,
149
- onFocus: r.onFocus,
150
- "aria-label": o,
151
- "aria-current": d,
152
- "aria-disabled": w,
153
- onKeyDown: (u) => R(u, p),
154
- onClick: () => {
155
- c || v(p);
156
- }
157
- };
158
- };
159
- }, [b, I, h, Y, M]),
160
- getLeftRovingItemProps: Y,
161
- getRightRovingItemProps: M,
162
- getLeftContainerProps: U,
163
- getRightContainerProps: G,
164
- focusLeftItem: I,
165
- focusRightItem: h
166
- };
1
+ function n(e) {
2
+ return new Promise((t) => setTimeout(t, e));
167
3
  }
168
4
  export {
169
- y as formatDateId,
170
- z as getCellAriaLabel,
171
- B as useDatePickerA11y
5
+ n as delay
172
6
  };
173
7
  //# sourceMappingURL=index268.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index268.js","sources":["../src/components/DatePicker/useDatePickerA11y.ts"],"sourcesContent":["import React, { useState, useCallback, useEffect, useMemo } from 'react';\n\nimport { useRovingFocus, RovingItemProps, RovingContainerProps, AccessibleNameInput } from '../../utils/a11y/useRovingFocus';\nimport type { DateRange } from './index';\n\nexport const getCellAriaLabel = (\n date: Date,\n isStart: boolean,\n isEnd: boolean,\n isSameStartEnd: boolean,\n singleDateSelection: boolean,\n inRange: boolean = false\n): string => {\n const base = date.toLocaleDateString('en-US', {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric'\n });\n if (singleDateSelection) return base;\n if (isSameStartEnd) return `${base}, start and end of range`;\n if (isStart) return `${base}, start of range`;\n if (isEnd) return `${base}, end of range`;\n if (inRange) return `${base}, in range`;\n return base;\n};\n\nexport const formatDateId = (d: Date) => {\n const y = d.getFullYear();\n const m = String(d.getMonth() + 1).padStart(2, '0');\n const dd = String(d.getDate()).padStart(2, '0');\n return `date-${y}-${m}-${dd}`;\n};\n\nconst getDaysInMonth = (year: number, month: number) => new Date(year, month + 1, 0).getDate();\n\nconst getPanelItemIds = (panelDate: Date): string[] => {\n const year = panelDate.getFullYear();\n const month = panelDate.getMonth();\n return Array.from({ length: getDaysInMonth(year, month) }, (_, i) =>\n formatDateId(new Date(year, month, i + 1))\n );\n};\n\nconst getPanelDefaultFocusId = (panelDate: Date, itemIds: string[], selectedRange: DateRange): string => {\n const year = panelDate.getFullYear();\n const month = panelDate.getMonth();\n const isInPanel = (d: Date) => d.getFullYear() === year && d.getMonth() === month;\n\n // Prefer startDate if it falls in this panel\n if (selectedRange.startDate && isInPanel(selectedRange.startDate)) {\n const d = new Date(selectedRange.startDate);\n d.setHours(0, 0, 0, 0);\n const id = formatDateId(d);\n if (itemIds.includes(id)) return id;\n }\n // Fall back to endDate if it falls in this panel (e.g. right panel when start is in left panel)\n if (selectedRange.endDate && isInPanel(selectedRange.endDate)) {\n const d = new Date(selectedRange.endDate);\n d.setHours(0, 0, 0, 0);\n const id = formatDateId(d);\n if (itemIds.includes(id)) return id;\n }\n const today = new Date();\n if (isInPanel(today)) {\n const id = formatDateId(today);\n if (itemIds.includes(id)) return id;\n }\n return itemIds[0] || '';\n};\n\ninterface UseDatePickerA11yOptions {\n leftMonth: Date;\n rightMonth: Date;\n showSingleMonth: boolean;\n selectedRange: DateRange;\n onMonthChange: (date: Date, isLeft: boolean) => void;\n}\n\ninterface CellKeyDownOptions {\n isLeftCalendar: boolean;\n isDateDisabled: (date: Date) => boolean;\n handleDateClick: (date: Date) => void;\n}\n\ninterface GridCellItemInput {\n cellId: string;\n cellDate: Date;\n disabled: boolean;\n ariaLabel: string;\n ariaCurrent: 'date' | undefined;\n ariaDisabled: true | undefined;\n}\n\nexport interface GridCellElementProps {\n id: string;\n ref: (el: HTMLElement | null) => void;\n tabIndex: number;\n onFocus: () => void;\n 'aria-label': string;\n 'aria-current': 'date' | undefined;\n 'aria-disabled': true | undefined;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onClick: () => void;\n}\n\ninterface UseDatePickerA11yReturn {\n getGridCellProps: (options: CellKeyDownOptions) => (item: GridCellItemInput) => GridCellElementProps;\n getLeftRovingItemProps: (id: string) => RovingItemProps;\n getRightRovingItemProps: (id: string) => RovingItemProps;\n getLeftContainerProps: (nameInput?: AccessibleNameInput) => RovingContainerProps;\n getRightContainerProps: (nameInput?: AccessibleNameInput) => RovingContainerProps;\n focusLeftItem: (id: string) => void;\n focusRightItem: (id: string) => void;\n}\n\nexport function useDatePickerA11y({\n leftMonth,\n rightMonth,\n showSingleMonth,\n selectedRange,\n onMonthChange\n}: UseDatePickerA11yOptions): UseDatePickerA11yReturn {\n const [keyboardFocusDate, setKeyboardFocusDate] = useState<Date | null>(null);\n\n const leftItemIds = useMemo(() => getPanelItemIds(leftMonth), [leftMonth]);\n const rightItemIds = useMemo(() => getPanelItemIds(rightMonth), [rightMonth]);\n\n const leftDefaultFocusId = useMemo(\n () => getPanelDefaultFocusId(leftMonth, leftItemIds, selectedRange),\n [leftMonth, leftItemIds, selectedRange]\n );\n const rightDefaultFocusId = useMemo(\n () => getPanelDefaultFocusId(rightMonth, rightItemIds, selectedRange),\n [rightMonth, rightItemIds, selectedRange]\n );\n\n const { getRovingItemProps: getLeftRovingItemProps, focusItem: focusLeftItem, getContainerProps: getLeftContainerProps } = useRovingFocus({\n itemIds: leftItemIds,\n defaultFocusedId: leftDefaultFocusId,\n orientation: 'grid',\n cols: 7,\n loop: false,\n role: 'grid'\n });\n\n const { getRovingItemProps: getRightRovingItemProps, focusItem: focusRightItem, getContainerProps: getRightContainerProps } = useRovingFocus({\n itemIds: rightItemIds,\n defaultFocusedId: rightDefaultFocusId,\n orientation: 'grid',\n cols: 7,\n loop: false,\n role: 'grid'\n });\n\n // After keyboard navigation shifts a panel to a new month, focus the target cell via roving focus refs\n useEffect(() => {\n if (!keyboardFocusDate) return;\n const id = formatDateId(keyboardFocusDate);\n if (leftItemIds.includes(id)) {\n focusLeftItem(id);\n setKeyboardFocusDate(null);\n } else if (rightItemIds.includes(id)) {\n focusRightItem(id);\n setKeyboardFocusDate(null);\n }\n }, [keyboardFocusDate, leftItemIds, rightItemIds, focusLeftItem, focusRightItem]);\n\n // Navigate the keyboard focus to a date that may be in a different month.\n // Each panel advances completely independently — never touches the other panel.\n const handleKeyboardNavigate = useCallback(\n (targetDate: Date, sourcePanel: 'left' | 'right') => {\n const isLeft = showSingleMonth || sourcePanel === 'left';\n onMonthChange(new Date(targetDate.getFullYear(), targetDate.getMonth(), 1), isLeft);\n setKeyboardFocusDate(new Date(targetDate));\n },\n [showSingleMonth, onMonthChange]\n );\n\n const getGridCellProps = useCallback(\n ({ isLeftCalendar, isDateDisabled, handleDateClick }: CellKeyDownOptions) => {\n const panel: 'left' | 'right' = isLeftCalendar ? 'left' : 'right';\n const focusPanelItem = isLeftCalendar ? focusLeftItem : focusRightItem;\n const getRovingItemProps = isLeftCalendar ? getLeftRovingItemProps : getRightRovingItemProps;\n\n const handleKeyDown = (e: React.KeyboardEvent, cellDate: Date) => {\n const cellYear = cellDate.getFullYear();\n const cellMonth = cellDate.getMonth();\n const cellDay = cellDate.getDate();\n\n const navigateTo = (targetDate: Date) => {\n if (targetDate.getFullYear() !== cellYear || targetDate.getMonth() !== cellMonth) {\n handleKeyboardNavigate(targetDate, panel);\n return;\n }\n focusPanelItem(formatDateId(targetDate));\n };\n\n switch (e.key) {\n case 'ArrowLeft':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay - 1));\n break;\n case 'ArrowRight':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay + 1));\n break;\n case 'ArrowUp':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay - 7));\n break;\n case 'ArrowDown':\n e.preventDefault(); e.stopPropagation();\n navigateTo(new Date(cellYear, cellMonth, cellDay + 7));\n break;\n case 'Home': {\n // First day of the current week row (Sunday), clamped to month start\n e.preventDefault(); e.stopPropagation();\n const dayOfWeek = cellDate.getDay();\n const homeDate = new Date(cellYear, cellMonth, cellDay - dayOfWeek);\n const clamped = homeDate.getMonth() !== cellMonth ? new Date(cellYear, cellMonth, 1) : homeDate;\n focusPanelItem(formatDateId(clamped));\n break;\n }\n case 'End': {\n // Last day of the current week row (Saturday), clamped to month end\n e.preventDefault(); e.stopPropagation();\n const dayOfWeek = cellDate.getDay();\n const endDate = new Date(cellYear, cellMonth, cellDay + (6 - dayOfWeek));\n const daysInThisMonth = getDaysInMonth(cellYear, cellMonth);\n const clamped =\n endDate.getMonth() !== cellMonth ? new Date(cellYear, cellMonth, daysInThisMonth) : endDate;\n focusPanelItem(formatDateId(clamped));\n break;\n }\n case 'PageUp': {\n // Shift+PageUp = previous year, PageUp = previous month\n e.preventDefault(); e.stopPropagation();\n const tYear = e.shiftKey ? cellYear - 1 : cellYear;\n const tMonth = e.shiftKey ? cellMonth : cellMonth - 1;\n const tDay = Math.min(cellDay, getDaysInMonth(tYear, tMonth));\n handleKeyboardNavigate(new Date(tYear, tMonth, tDay), panel);\n break;\n }\n case 'PageDown': {\n // Shift+PageDown = next year, PageDown = next month\n e.preventDefault(); e.stopPropagation();\n const tYear = e.shiftKey ? cellYear + 1 : cellYear;\n const tMonth = e.shiftKey ? cellMonth : cellMonth + 1;\n const tDay = Math.min(cellDay, getDaysInMonth(tYear, tMonth));\n handleKeyboardNavigate(new Date(tYear, tMonth, tDay), panel);\n break;\n }\n case 'Enter':\n case ' ':\n e.preventDefault();\n if (!isDateDisabled(cellDate)) {\n handleDateClick(cellDate);\n }\n break;\n }\n };\n\n return ({ cellId, cellDate, disabled, ariaLabel, ariaCurrent, ariaDisabled }: GridCellItemInput): GridCellElementProps => {\n const rovingProps = getRovingItemProps(cellId);\n return {\n id: cellId,\n ref: rovingProps.ref,\n tabIndex: rovingProps.tabIndex,\n onFocus: rovingProps.onFocus,\n 'aria-label': ariaLabel,\n 'aria-current': ariaCurrent,\n 'aria-disabled': ariaDisabled,\n onKeyDown: (e: React.KeyboardEvent) => handleKeyDown(e, cellDate),\n onClick: () => { if (!disabled) handleDateClick(cellDate); }\n };\n };\n },\n [handleKeyboardNavigate, focusLeftItem, focusRightItem, getLeftRovingItemProps, getRightRovingItemProps]\n );\n\n return {\n getGridCellProps,\n getLeftRovingItemProps,\n getRightRovingItemProps,\n getLeftContainerProps,\n getRightContainerProps,\n focusLeftItem,\n focusRightItem\n };\n}\n"],"names":["useState","useMemo","useEffect","useCallback","useRovingFocus","getCellAriaLabel","date","isStart","isEnd","isSameStartEnd","singleDateSelection","inRange","base","toLocaleDateString","weekday","month","day","year","formatDateId","d","y","getFullYear","m","String","getMonth","padStart","dd","getDate","getDaysInMonth","Date","getPanelItemIds","panelDate","Array","from","length","_","i","getPanelDefaultFocusId","itemIds","selectedRange","isInPanel","startDate","setHours","id","includes","endDate","today","useDatePickerA11y","leftMonth","rightMonth","showSingleMonth","onMonthChange","keyboardFocusDate","setKeyboardFocusDate","leftItemIds","rightItemIds","leftDefaultFocusId","rightDefaultFocusId","getRovingItemProps","getLeftRovingItemProps","focusItem","focusLeftItem","getContainerProps","getLeftContainerProps","defaultFocusedId","orientation","cols","loop","role","getRightRovingItemProps","focusRightItem","getRightContainerProps","handleKeyboardNavigate","targetDate","sourcePanel","isLeft","getGridCellProps","isLeftCalendar","isDateDisabled","handleDateClick","panel","focusPanelItem","handleKeyDown","e","cellDate","cellYear","cellMonth","cellDay","navigateTo","key","preventDefault","stopPropagation","dayOfWeek","getDay","homeDate","clamped","daysInThisMonth","tYear","shiftKey","tMonth","tDay","Math","min","cellId","disabled","ariaLabel","ariaCurrent","ariaDisabled","rovingProps","ref","tabIndex","onFocus","onKeyDown","onCl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,EAAEO,eAAAA,GACGZ,EAAeM,CAAQ,KAC1BL,EAAgBK,CAAQ;AAE1B;AAAA,QAAA;AAAA,MAEN;AAEA,aAAO,CAAC;AAAA,QAAEmB,QAAAA;AAAAA,QAAQnB,UAAAA;AAAAA,QAAUoB,UAAAA;AAAAA,QAAUC,WAAAA;AAAAA,QAAWC,aAAAA;AAAAA,QAAaC,cAAAA;AAAAA,MAAAA,MAA4D;AACxH,cAAMC,IAAclD,EAAmB6C,CAAM;AAC7C,eAAO;AAAA,UACL5D,IAAI4D;AAAAA,UACJM,KAAKD,EAAYC;AAAAA,UACjBC,UAAUF,EAAYE;AAAAA,UACtBC,SAASH,EAAYG;AAAAA,UACrB,cAAcN;AAAAA,UACd,gBAAgBC;AAAAA,UAChB,iBAAiBC;AAAAA,UACjBK,WAAWA,CAAC7B,MAA2BD,EAAcC,GAAGC,CAAQ;AAAA,UAChE6B,SAASA,MAAM;AAAE,YAAKT,KAAUzB,EAAgBK,CAAQ;AAAA,UAAG;AAAA,QAAA;AAAA,MAE/D;AAAA,IACF,GACA,CAACZ,GAAwBX,GAAeS,GAAgBX,GAAwBU,CAAuB,CACzG;AAAA,IAIEV,wBAAAA;AAAAA,IACAU,yBAAAA;AAAAA,IACAN,uBAAAA;AAAAA,IACAQ,wBAAAA;AAAAA,IACAV,eAAAA;AAAAA,IACAS,gBAAAA;AAAAA,EAAAA;AAEJ;"}
1
+ {"version":3,"file":"index268.js","sources":["../src/utils/delay.ts"],"sourcesContent":["/**\n * Delays execution by the specified number of milliseconds\n * @param ms - The number of milliseconds to delay\n * @returns A Promise that resolves after the specified delay\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n} "],"names":["delay","ms","Promise","resolve","setTimeout"],"mappings":"AAKO,SAASA,EAAMC,GAA2B;AAC7C,SAAO,IAAIC,QAAQC,CAAAA,MAAWC,WAAWD,GAASF,CAAE,CAAC;AACzD;"}
@@ -19,4 +19,4 @@ function m({
19
19
  export {
20
20
  m as useScrollActiveIntoView
21
21
  };
22
- //# sourceMappingURL=index88.js.map
22
+ //# sourceMappingURL=index270.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index270.js","sources":["../src/utils/a11y/useScrollActiveIntoView.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { RefObject } from 'react';\n\nconst DEFAULT_SCROLL_OPTIONS: ScrollIntoViewOptions = { block: 'nearest' };\n\nexport interface UseScrollActiveIntoViewOptions {\n /**\n * Ref to the container element\n */\n containerRef?: RefObject<HTMLElement | null>;\n \n /**\n * Index of the currently active/highlighted item (-1 if none)\n */\n activeIndex: number;\n \n /**\n * CSS selector for item elements\n * Default: '[role=\"option\"]'\n */\n itemSelector?: string;\n \n /**\n * Whether scrolling is enabled\n * Default: true\n */\n enabled?: boolean;\n \n /**\n * ScrollIntoView options\n * Default: { block: 'nearest' }\n */\n scrollOptions?: ScrollIntoViewOptions;\n}\n\n/**\n * Hook to automatically scroll the active item into view.\n * \n * Useful for aria-activedescendant patterns where DOM focus stays\n * on the container (e.g., input field) but we need to visually show\n * which descendant option is logically active.\n * \n * Common use cases:\n * - Combobox dropdown options\n * - Menu items with virtual focus\n * - Grid cells with keyboard navigation\n * - Tree view items\n * - Listbox options\n * \n * @example\n * ```tsx\n * const [highlightedIndex, setHighlightedIndex] = useState(-1);\n * const listboxRef = useRef<HTMLDivElement>(null);\n * \n * useScrollActiveIntoView({\n * containerRef: listboxRef,\n * activeIndex: highlightedIndex,\n * itemSelector: '[role=\"option\"]'\n * });\n * \n * // Now when highlightedIndex changes, the item scrolls into view\n * ```\n * \n * @example Custom scroll behavior\n * ```tsx\n * useScrollActiveIntoView({\n * containerRef: menuRef,\n * activeIndex: activeMenuIndex,\n * itemSelector: '[role=\"menuitem\"]',\n * scrollOptions: { block: 'center', behavior: 'smooth' }\n * });\n * ```\n */\nexport function useScrollActiveIntoView({\n containerRef,\n activeIndex,\n itemSelector = '[role=\"option\"]',\n enabled = true,\n scrollOptions = DEFAULT_SCROLL_OPTIONS\n}: UseScrollActiveIntoViewOptions): void {\n useEffect(() => {\n // Early returns for disabled states\n if (!enabled || activeIndex < 0 || !containerRef?.current) {\n return;\n }\n \n const container = containerRef.current;\n const items = container.querySelectorAll(itemSelector);\n const activeItem = items[activeIndex] as HTMLElement;\n \n if (activeItem) {\n activeItem.scrollIntoView(scrollOptions);\n }\n }, [activeIndex, containerRef, itemSelector, enabled, scrollOptions]);\n}\n"],"names":["useEffect","DEFAULT_SCROLL_OPTIONS","block","useScrollActiveIntoView","containerRef","activeIndex","itemSelector","enabled","scrollOptions","current","activeItem","querySelectorAll","scrollIntoView"],"mappings":"AAGA,SAAA,aAAAA,SAAA;AAAA,MAAMC,IAAgD;AAAA,EAAEC,OAAO;AAAU;AAsElE,SAASC,EAAwB;AAAA,EACtCC,cAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,SAAAA,IAAU;AAAA,EACVC,eAAAA,IAAgBP;AACc,GAAS;AACvCD,EAAAA,EAAU,MAAM;AAEd,QAAI,CAACO,KAAWF,IAAc,KAAK,CAACD,GAAcK;AAChD;AAKF,UAAMC,IAFYN,EAAaK,QACPE,iBAAiBL,CAAY,EAC5BD,CAAW;AAEpC,IAAIK,KACFA,EAAWE,eAAeJ,CAAa;AAAA,EAE3C,GAAG,CAACH,GAAaD,GAAcE,GAAcC,GAASC,CAAa,CAAC;AACtE;"}
package/dist/index29.js CHANGED
@@ -2,8 +2,8 @@ import m, { useMemo as ue, useRef as h, useEffect as f, useCallback as me, useSt
2
2
  import { Icon as fe } from "./index6.js";
3
3
  import { getA11yNameAttributes as ye } from "./index87.js";
4
4
  import { useFocusTrap as be } from "./index78.js";
5
- import { useDismissOnEscape as pe } from "./index237.js";
6
- import { useFocusSentinel as he } from "./index238.js";
5
+ import { useDismissOnEscape as pe } from "./index236.js";
6
+ import { useFocusSentinel as he } from "./index237.js";
7
7
  /* empty css */
8
8
  function E() {
9
9
  return E = Object.assign ? Object.assign.bind() : function(g) {
package/dist/index30.js CHANGED
@@ -2,7 +2,7 @@ import t, { useState as L, useMemo as z, useRef as O, useEffect as H } from "rea
2
2
  import { Icon as A } from "./index6.js";
3
3
  import { Popover as U } from "./index19.js";
4
4
  import { MenuList as V } from "./index18.js";
5
- import { useStableId as q } from "./index228.js";
5
+ import { useStableId as q } from "./index227.js";
6
6
  import "./index78.js";
7
7
  import { useTabsA11y as G, getPanelId as J } from "./index79.js";
8
8
  /* empty css */
package/dist/index31.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import e, { forwardRef as K } from "react";
2
2
  import { Icon as M } from "./index6.js";
3
3
  import { Button as d } from "./index4.js";
4
- import { useStableId as B } from "./index228.js";
4
+ import { useStableId as B } from "./index227.js";
5
5
  import { getRegionAttributes as Q } from "./index72.js";
6
6
  import { useAccessiblePress as U } from "./index73.js";
7
7
  import "./index78.js";
package/dist/index34.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import e, { useRef as y } from "react";
2
- import { useStableId as N } from "./index228.js";
2
+ import { useStableId as N } from "./index227.js";
3
3
  function I(a) {
4
4
  const {
5
5
  label: s,
package/dist/index36.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import e, { useState as h, useEffect as E } from "react";
2
2
  import { Icon as N } from "./index6.js";
3
- import { useStableId as $ } from "./index228.js";
3
+ import { useStableId as $ } from "./index227.js";
4
4
  import { getRegionAttributes as I } from "./index72.js";
5
5
  import { useAccessiblePress as _ } from "./index73.js";
6
6
  import "./index78.js";
package/dist/index37.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import e, { useState as T, useEffect as k } from "react";
2
2
  import { Icon as x } from "./index6.js";
3
- import { useStableId as F } from "./index228.js";
3
+ import { useStableId as F } from "./index227.js";
4
4
  import { getA11yNameAttributes as P } from "./index87.js";
5
5
  import { getRegionAttributes as V } from "./index72.js";
6
6
  import { useAccessiblePress as q } from "./index73.js";
package/dist/index38.js CHANGED
@@ -3,7 +3,7 @@ import a, { useState as w, useRef as $ } from "react";
3
3
  import { Icon as A } from "./index6.js";
4
4
  import { getA11yNameAttributes as B } from "./index87.js";
5
5
  import "./index78.js";
6
- import { useStableId as D } from "./index228.js";
6
+ import { useStableId as D } from "./index227.js";
7
7
  function c() {
8
8
  return c = Object.assign ? Object.assign.bind() : function(r) {
9
9
  for (var n = 1; n < arguments.length; n++) {
package/dist/index39.js CHANGED
@@ -6,7 +6,7 @@ import { Button as ne } from "./index4.js";
6
6
  import { getA11yNameAttributes as Le } from "./index87.js";
7
7
  import "./index78.js";
8
8
  import { useCombobox as He } from "./index74.js";
9
- import { useStableId as le } from "./index228.js";
9
+ import { useStableId as le } from "./index227.js";
10
10
  import { announce as Ke } from "./index81.js";
11
11
  /* empty css */
12
12
  function d() {
package/dist/index40.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import e from "react";
2
- import { useStableId as _ } from "./index228.js";
3
- import { mergeIds as k } from "./index245.js";
2
+ import { useStableId as _ } from "./index227.js";
3
+ import { mergeIds as k } from "./index244.js";
4
4
  import { getA11yNameAttributes as D } from "./index87.js";
5
5
  import "./index78.js";
6
6
  /* empty css */