@codeleap/web 7.0.0 → 7.0.2

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 (361) hide show
  1. package/dist/components/ActivityIndicator/index.js +46 -0
  2. package/dist/components/ActivityIndicator/index.js.map +1 -0
  3. package/dist/components/ActivityIndicator/styles.js +3 -0
  4. package/dist/components/ActivityIndicator/styles.js.map +1 -0
  5. package/dist/components/ActivityIndicator/types.js +3 -0
  6. package/dist/components/ActivityIndicator/types.js.map +1 -0
  7. package/dist/components/Badge/index.js +86 -0
  8. package/dist/components/Badge/index.js.map +1 -0
  9. package/dist/components/Badge/styles.js +3 -0
  10. package/dist/components/Badge/styles.js.map +1 -0
  11. package/dist/components/Badge/types.js +3 -0
  12. package/dist/components/Badge/types.js.map +1 -0
  13. package/dist/components/Button/index.js +69 -0
  14. package/dist/components/Button/index.js.map +1 -0
  15. package/dist/components/Button/styles.js +3 -0
  16. package/dist/components/Button/styles.js.map +1 -0
  17. package/dist/components/Button/types.js +3 -0
  18. package/dist/components/Button/types.js.map +1 -0
  19. package/dist/components/Calendar/index.js +67 -0
  20. package/dist/components/Calendar/index.js.map +1 -0
  21. package/dist/components/Calendar/styles.js +3 -0
  22. package/dist/components/Calendar/styles.js.map +1 -0
  23. package/dist/components/Calendar/types.js +3 -0
  24. package/dist/components/Calendar/types.js.map +1 -0
  25. package/dist/components/Carousel/index.js +171 -0
  26. package/dist/components/Carousel/index.js.map +1 -0
  27. package/dist/components/Carousel/styles.js +3 -0
  28. package/dist/components/Carousel/styles.js.map +1 -0
  29. package/dist/components/Carousel/types.js +3 -0
  30. package/dist/components/Carousel/types.js.map +1 -0
  31. package/dist/components/Checkbox/index.js +62 -0
  32. package/dist/components/Checkbox/index.js.map +1 -0
  33. package/dist/components/Checkbox/styles.js +3 -0
  34. package/dist/components/Checkbox/styles.js.map +1 -0
  35. package/dist/components/Checkbox/types.js +3 -0
  36. package/dist/components/Checkbox/types.js.map +1 -0
  37. package/dist/components/Collapse/index.js +45 -0
  38. package/dist/components/Collapse/index.js.map +1 -0
  39. package/dist/components/Collapse/styles.js +3 -0
  40. package/dist/components/Collapse/styles.js.map +1 -0
  41. package/dist/components/Collapse/types.js +3 -0
  42. package/dist/components/Collapse/types.js.map +1 -0
  43. package/dist/components/ColorPicker/index.js +83 -0
  44. package/dist/components/ColorPicker/index.js.map +1 -0
  45. package/dist/components/ColorPicker/styles.js +3 -0
  46. package/dist/components/ColorPicker/styles.js.map +1 -0
  47. package/dist/components/ColorPicker/types.js +3 -0
  48. package/dist/components/ColorPicker/types.js.map +1 -0
  49. package/dist/components/CropPicker/hooks.d.ts +2 -2
  50. package/dist/components/CropPicker/hooks.js +133 -0
  51. package/dist/components/CropPicker/hooks.js.map +1 -0
  52. package/dist/components/CropPicker/index.js +56 -0
  53. package/dist/components/CropPicker/index.js.map +1 -0
  54. package/dist/components/CropPicker/styles.js +3 -0
  55. package/dist/components/CropPicker/styles.js.map +1 -0
  56. package/dist/components/CropPicker/types.js +3 -0
  57. package/dist/components/CropPicker/types.js.map +1 -0
  58. package/dist/components/CropPicker/utils.js +76 -0
  59. package/dist/components/CropPicker/utils.js.map +1 -0
  60. package/dist/components/DatePicker/index.js +87 -0
  61. package/dist/components/DatePicker/index.js.map +1 -0
  62. package/dist/components/DatePicker/styles.js +3 -0
  63. package/dist/components/DatePicker/styles.js.map +1 -0
  64. package/dist/components/DatePicker/types.js +3 -0
  65. package/dist/components/DatePicker/types.js.map +1 -0
  66. package/dist/components/Drawer/index.js +68 -0
  67. package/dist/components/Drawer/index.js.map +1 -0
  68. package/dist/components/Drawer/styles.js +3 -0
  69. package/dist/components/Drawer/styles.js.map +1 -0
  70. package/dist/components/Drawer/types.js +3 -0
  71. package/dist/components/Drawer/types.js.map +1 -0
  72. package/dist/components/Dropzone/context.js +44 -0
  73. package/dist/components/Dropzone/context.js.map +1 -0
  74. package/dist/components/Dropzone/elements.js +57 -0
  75. package/dist/components/Dropzone/elements.js.map +1 -0
  76. package/dist/components/Dropzone/index.js +89 -0
  77. package/dist/components/Dropzone/index.js.map +1 -0
  78. package/dist/components/Dropzone/styles.js +3 -0
  79. package/dist/components/Dropzone/styles.js.map +1 -0
  80. package/dist/components/Dropzone/types.js +3 -0
  81. package/dist/components/Dropzone/types.js.map +1 -0
  82. package/dist/components/Dropzone/useDropzone.js +20 -0
  83. package/dist/components/Dropzone/useDropzone.js.map +1 -0
  84. package/dist/components/EmptyPlaceholder/index.js +86 -0
  85. package/dist/components/EmptyPlaceholder/index.js.map +1 -0
  86. package/dist/components/EmptyPlaceholder/styles.js +3 -0
  87. package/dist/components/EmptyPlaceholder/styles.js.map +1 -0
  88. package/dist/components/EmptyPlaceholder/types.js +3 -0
  89. package/dist/components/EmptyPlaceholder/types.js.map +1 -0
  90. package/dist/components/Field/context.js +58 -0
  91. package/dist/components/Field/context.js.map +1 -0
  92. package/dist/components/Field/elements.js +92 -0
  93. package/dist/components/Field/elements.js.map +1 -0
  94. package/dist/components/Field/index.js +55 -0
  95. package/dist/components/Field/index.js.map +1 -0
  96. package/dist/components/Field/styles.js +3 -0
  97. package/dist/components/Field/styles.js.map +1 -0
  98. package/dist/components/Field/types.js +3 -0
  99. package/dist/components/Field/types.js.map +1 -0
  100. package/dist/components/Field/useFieldInput.d.ts +1 -1
  101. package/dist/components/Field/useFieldInput.js +50 -0
  102. package/dist/components/Field/useFieldInput.js.map +1 -0
  103. package/dist/components/FileInput/index.js +73 -0
  104. package/dist/components/FileInput/index.js.map +1 -0
  105. package/dist/components/FileInput/types.js +3 -0
  106. package/dist/components/FileInput/types.js.map +1 -0
  107. package/dist/components/Icon/index.js +69 -0
  108. package/dist/components/Icon/index.js.map +1 -0
  109. package/dist/components/Icon/styles.js +3 -0
  110. package/dist/components/Icon/styles.js.map +1 -0
  111. package/dist/components/Icon/types.js +3 -0
  112. package/dist/components/Icon/types.js.map +1 -0
  113. package/dist/components/List/context.js +81 -0
  114. package/dist/components/List/context.js.map +1 -0
  115. package/dist/components/List/elements.js +164 -0
  116. package/dist/components/List/elements.js.map +1 -0
  117. package/dist/components/List/index.js +52 -0
  118. package/dist/components/List/index.js.map +1 -0
  119. package/dist/components/List/scroll.js +80 -0
  120. package/dist/components/List/scroll.js.map +1 -0
  121. package/dist/components/List/styles.js +3 -0
  122. package/dist/components/List/styles.js.map +1 -0
  123. package/dist/components/List/types.js +3 -0
  124. package/dist/components/List/types.js.map +1 -0
  125. package/dist/components/LoadingOverlay/index.js +50 -0
  126. package/dist/components/LoadingOverlay/index.js.map +1 -0
  127. package/dist/components/LoadingOverlay/styles.js +3 -0
  128. package/dist/components/LoadingOverlay/styles.js.map +1 -0
  129. package/dist/components/LoadingOverlay/types.js +3 -0
  130. package/dist/components/LoadingOverlay/types.js.map +1 -0
  131. package/dist/components/MaskedTextInput/index.js +52 -0
  132. package/dist/components/MaskedTextInput/index.js.map +1 -0
  133. package/dist/components/MaskedTextInput/mask.js +37 -0
  134. package/dist/components/MaskedTextInput/mask.js.map +1 -0
  135. package/dist/components/MaskedTextInput/types.js +3 -0
  136. package/dist/components/MaskedTextInput/types.js.map +1 -0
  137. package/dist/components/Modal/context.js +41 -0
  138. package/dist/components/Modal/context.js.map +1 -0
  139. package/dist/components/Modal/elements.js +74 -0
  140. package/dist/components/Modal/elements.js.map +1 -0
  141. package/dist/components/Modal/index.js +52 -0
  142. package/dist/components/Modal/index.js.map +1 -0
  143. package/dist/components/Modal/styles.js +3 -0
  144. package/dist/components/Modal/styles.js.map +1 -0
  145. package/dist/components/Modal/types.js +3 -0
  146. package/dist/components/Modal/types.js.map +1 -0
  147. package/dist/components/NumberIncrement/index.js +83 -0
  148. package/dist/components/NumberIncrement/index.js.map +1 -0
  149. package/dist/components/NumberIncrement/styles.js +3 -0
  150. package/dist/components/NumberIncrement/styles.js.map +1 -0
  151. package/dist/components/NumberIncrement/types.js +3 -0
  152. package/dist/components/NumberIncrement/types.js.map +1 -0
  153. package/dist/components/NumberIncrement/useNumberIncrement.js +116 -0
  154. package/dist/components/NumberIncrement/useNumberIncrement.js.map +1 -0
  155. package/dist/components/Overlay/index.js +62 -0
  156. package/dist/components/Overlay/index.js.map +1 -0
  157. package/dist/components/Overlay/styles.js +3 -0
  158. package/dist/components/Overlay/styles.js.map +1 -0
  159. package/dist/components/Overlay/types.js +3 -0
  160. package/dist/components/Overlay/types.js.map +1 -0
  161. package/dist/components/PaginationButtons/index.js +118 -0
  162. package/dist/components/PaginationButtons/index.js.map +1 -0
  163. package/dist/components/PaginationButtons/styles.js +3 -0
  164. package/dist/components/PaginationButtons/styles.js.map +1 -0
  165. package/dist/components/PaginationButtons/types.js +3 -0
  166. package/dist/components/PaginationButtons/types.js.map +1 -0
  167. package/dist/components/PaginationIndicator/index.js +59 -0
  168. package/dist/components/PaginationIndicator/index.js.map +1 -0
  169. package/dist/components/PaginationIndicator/styles.js +3 -0
  170. package/dist/components/PaginationIndicator/styles.js.map +1 -0
  171. package/dist/components/PaginationIndicator/types.js +3 -0
  172. package/dist/components/PaginationIndicator/types.js.map +1 -0
  173. package/dist/components/Progress/Bar/Segmented.js +41 -0
  174. package/dist/components/Progress/Bar/Segmented.js.map +1 -0
  175. package/dist/components/Progress/Bar/index.js +62 -0
  176. package/dist/components/Progress/Bar/index.js.map +1 -0
  177. package/dist/components/Progress/Bar/styles.js +3 -0
  178. package/dist/components/Progress/Bar/styles.js.map +1 -0
  179. package/dist/components/Progress/Bar/types.js +3 -0
  180. package/dist/components/Progress/Bar/types.js.map +1 -0
  181. package/dist/components/Progress/Circle/Segmented.js +64 -0
  182. package/dist/components/Progress/Circle/Segmented.js.map +1 -0
  183. package/dist/components/Progress/Circle/index.js +83 -0
  184. package/dist/components/Progress/Circle/index.js.map +1 -0
  185. package/dist/components/Progress/Circle/styles.js +3 -0
  186. package/dist/components/Progress/Circle/styles.js.map +1 -0
  187. package/dist/components/Progress/Circle/types.js +3 -0
  188. package/dist/components/Progress/Circle/types.js.map +1 -0
  189. package/dist/components/Progress/index.js +19 -0
  190. package/dist/components/Progress/index.js.map +1 -0
  191. package/dist/components/Progress/utils.js +7 -0
  192. package/dist/components/Progress/utils.js.map +1 -0
  193. package/dist/components/RadioInput/index.js +68 -0
  194. package/dist/components/RadioInput/index.js.map +1 -0
  195. package/dist/components/RadioInput/styles.js +3 -0
  196. package/dist/components/RadioInput/styles.js.map +1 -0
  197. package/dist/components/RadioInput/types.js +3 -0
  198. package/dist/components/RadioInput/types.js.map +1 -0
  199. package/dist/components/SearchInput/index.js +98 -0
  200. package/dist/components/SearchInput/index.js.map +1 -0
  201. package/dist/components/SectionFilters/index.js +166 -0
  202. package/dist/components/SectionFilters/index.js.map +1 -0
  203. package/dist/components/SectionFilters/styles.js +3 -0
  204. package/dist/components/SectionFilters/styles.js.map +1 -0
  205. package/dist/components/SectionFilters/types.js +3 -0
  206. package/dist/components/SectionFilters/types.js.map +1 -0
  207. package/dist/components/Select/context.js +162 -0
  208. package/dist/components/Select/context.js.map +1 -0
  209. package/dist/components/Select/elements.js +53 -0
  210. package/dist/components/Select/elements.js.map +1 -0
  211. package/dist/components/Select/index.js +70 -0
  212. package/dist/components/Select/index.js.map +1 -0
  213. package/dist/components/Select/styles.js +3 -0
  214. package/dist/components/Select/styles.js.map +1 -0
  215. package/dist/components/Select/types.js +3 -0
  216. package/dist/components/Select/types.js.map +1 -0
  217. package/dist/components/Select/useTriggerWidth.js +30 -0
  218. package/dist/components/Select/useTriggerWidth.js.map +1 -0
  219. package/dist/components/Slider/index.js +160 -0
  220. package/dist/components/Slider/index.js.map +1 -0
  221. package/dist/components/Slider/styles.js +3 -0
  222. package/dist/components/Slider/styles.js.map +1 -0
  223. package/dist/components/Slider/types.js +3 -0
  224. package/dist/components/Slider/types.js.map +1 -0
  225. package/dist/components/Switch/index.js +66 -0
  226. package/dist/components/Switch/index.js.map +1 -0
  227. package/dist/components/Switch/styles.js +3 -0
  228. package/dist/components/Switch/styles.js.map +1 -0
  229. package/dist/components/Switch/types.js +3 -0
  230. package/dist/components/Switch/types.js.map +1 -0
  231. package/dist/components/Tag/index.js +74 -0
  232. package/dist/components/Tag/index.js.map +1 -0
  233. package/dist/components/Tag/styles.js +3 -0
  234. package/dist/components/Tag/styles.js.map +1 -0
  235. package/dist/components/Tag/types.js +3 -0
  236. package/dist/components/Tag/types.js.map +1 -0
  237. package/dist/components/Text/index.js +115 -0
  238. package/dist/components/Text/index.js.map +1 -0
  239. package/dist/components/Text/styles.js +3 -0
  240. package/dist/components/Text/styles.js.map +1 -0
  241. package/dist/components/Text/types.js +3 -0
  242. package/dist/components/Text/types.js.map +1 -0
  243. package/dist/components/TextEditor/index.js +111 -0
  244. package/dist/components/TextEditor/index.js.map +1 -0
  245. package/dist/components/TextEditor/styles.js +3 -0
  246. package/dist/components/TextEditor/styles.js.map +1 -0
  247. package/dist/components/TextEditor/types.js +3 -0
  248. package/dist/components/TextEditor/types.js.map +1 -0
  249. package/dist/components/TextInput/index.js +86 -0
  250. package/dist/components/TextInput/index.js.map +1 -0
  251. package/dist/components/TextInput/styles.js +3 -0
  252. package/dist/components/TextInput/styles.js.map +1 -0
  253. package/dist/components/TextInput/types.js +3 -0
  254. package/dist/components/TextInput/types.js.map +1 -0
  255. package/dist/components/TextInput/useTextInput.d.ts +2 -2
  256. package/dist/components/TextInput/useTextInput.js +67 -0
  257. package/dist/components/TextInput/useTextInput.js.map +1 -0
  258. package/dist/components/Tooltip/index.js +115 -0
  259. package/dist/components/Tooltip/index.js.map +1 -0
  260. package/dist/components/Tooltip/styles.js +3 -0
  261. package/dist/components/Tooltip/styles.js.map +1 -0
  262. package/dist/components/Tooltip/types.js +3 -0
  263. package/dist/components/Tooltip/types.js.map +1 -0
  264. package/dist/components/Touchable/index.js +100 -0
  265. package/dist/components/Touchable/index.js.map +1 -0
  266. package/dist/components/Touchable/styles.js +3 -0
  267. package/dist/components/Touchable/styles.js.map +1 -0
  268. package/dist/components/Touchable/types.js +3 -0
  269. package/dist/components/Touchable/types.js.map +1 -0
  270. package/dist/components/View/index.js +56 -0
  271. package/dist/components/View/index.js.map +1 -0
  272. package/dist/components/View/styles.js +3 -0
  273. package/dist/components/View/styles.js.map +1 -0
  274. package/dist/components/View/types.js +3 -0
  275. package/dist/components/View/types.js.map +1 -0
  276. package/dist/components/components.js +58 -0
  277. package/dist/components/components.js.map +1 -0
  278. package/dist/index.js +21 -0
  279. package/dist/index.js.map +1 -0
  280. package/dist/lib/ListMasonry.js +95 -0
  281. package/dist/lib/ListMasonry.js.map +1 -0
  282. package/dist/lib/ThemeVariables.js +27 -0
  283. package/dist/lib/ThemeVariables.js.map +1 -0
  284. package/dist/lib/WebStyleRegistry.js +73 -0
  285. package/dist/lib/WebStyleRegistry.js.map +1 -0
  286. package/dist/lib/hooks/index.js +39 -0
  287. package/dist/lib/hooks/index.js.map +1 -0
  288. package/dist/lib/hooks/useAnimatedStyle.js +27 -0
  289. package/dist/lib/hooks/useAnimatedStyle.js.map +1 -0
  290. package/dist/lib/hooks/useAnimatedVariantStyles.js +23 -0
  291. package/dist/lib/hooks/useAnimatedVariantStyles.js.map +1 -0
  292. package/dist/lib/hooks/useAsyncSelect.js +60 -0
  293. package/dist/lib/hooks/useAsyncSelect.js.map +1 -0
  294. package/dist/lib/hooks/useBreakpointMatch.js +111 -0
  295. package/dist/lib/hooks/useBreakpointMatch.js.map +1 -0
  296. package/dist/lib/hooks/useClick.js +41 -0
  297. package/dist/lib/hooks/useClick.js.map +1 -0
  298. package/dist/lib/hooks/useClickOutside.js +34 -0
  299. package/dist/lib/hooks/useClickOutside.js.map +1 -0
  300. package/dist/lib/hooks/useFileInput.js +21 -0
  301. package/dist/lib/hooks/useFileInput.js.map +1 -0
  302. package/dist/lib/hooks/useIsomorphicEffect.js +10 -0
  303. package/dist/lib/hooks/useIsomorphicEffect.js.map +1 -0
  304. package/dist/lib/hooks/useKeydown.js +43 -0
  305. package/dist/lib/hooks/useKeydown.js.map +1 -0
  306. package/dist/lib/hooks/useListFocus.js +49 -0
  307. package/dist/lib/hooks/useListFocus.js.map +1 -0
  308. package/dist/lib/hooks/useMediaQuery.js +28 -0
  309. package/dist/lib/hooks/useMediaQuery.js.map +1 -0
  310. package/dist/lib/hooks/usePageExitBlocker.js +48 -0
  311. package/dist/lib/hooks/usePageExitBlocker.js.map +1 -0
  312. package/dist/lib/hooks/usePagination.js +93 -0
  313. package/dist/lib/hooks/usePagination.js.map +1 -0
  314. package/dist/lib/hooks/usePopState.js +35 -0
  315. package/dist/lib/hooks/usePopState.js.map +1 -0
  316. package/dist/lib/hooks/usePopoverDismiss.js +35 -0
  317. package/dist/lib/hooks/usePopoverDismiss.js.map +1 -0
  318. package/dist/lib/hooks/useRefresh.js +74 -0
  319. package/dist/lib/hooks/useRefresh.js.map +1 -0
  320. package/dist/lib/hooks/useScrollEffect.js +22 -0
  321. package/dist/lib/hooks/useScrollEffect.js.map +1 -0
  322. package/dist/lib/hooks/useSearchParams.js +51 -0
  323. package/dist/lib/hooks/useSearchParams.js.map +1 -0
  324. package/dist/lib/hooks/useStaticAnimationStyles.js +19 -0
  325. package/dist/lib/hooks/useStaticAnimationStyles.js.map +1 -0
  326. package/dist/lib/hooks/useStylesFor.js +40 -0
  327. package/dist/lib/hooks/useStylesFor.js.map +1 -0
  328. package/dist/lib/hooks/useTouchableEvents.js +37 -0
  329. package/dist/lib/hooks/useTouchableEvents.js.map +1 -0
  330. package/dist/lib/hooks/useWindowFocus.js +34 -0
  331. package/dist/lib/hooks/useWindowFocus.js.map +1 -0
  332. package/dist/lib/hooks/useWindowSize.js +32 -0
  333. package/dist/lib/hooks/useWindowSize.js.map +1 -0
  334. package/dist/lib/index.js +23 -0
  335. package/dist/lib/index.js.map +1 -0
  336. package/dist/lib/tools/index.js +20 -0
  337. package/dist/lib/tools/index.js.map +1 -0
  338. package/dist/lib/tools/localStorage.js +159 -0
  339. package/dist/lib/tools/localStorage.js.map +1 -0
  340. package/dist/lib/tools/mediaQuery.js +38 -0
  341. package/dist/lib/tools/mediaQuery.js.map +1 -0
  342. package/dist/lib/tools/modal.js +60 -0
  343. package/dist/lib/tools/modal.js.map +1 -0
  344. package/dist/lib/utils/attributes.js +26 -0
  345. package/dist/lib/utils/attributes.js.map +1 -0
  346. package/dist/lib/utils/cache.d.ts +2 -2
  347. package/dist/lib/utils/cache.js +17 -0
  348. package/dist/lib/utils/cache.js.map +1 -0
  349. package/dist/lib/utils/index.js +22 -0
  350. package/dist/lib/utils/index.js.map +1 -0
  351. package/dist/lib/utils/pollyfils/scroll.js +70 -0
  352. package/dist/lib/utils/pollyfils/scroll.js.map +1 -0
  353. package/dist/lib/utils/stopPropagation.js +22 -0
  354. package/dist/lib/utils/stopPropagation.js.map +1 -0
  355. package/dist/lib/utils/test.js +18 -0
  356. package/dist/lib/utils/test.js.map +1 -0
  357. package/dist/types/index.js +18 -0
  358. package/dist/types/index.js.map +1 -0
  359. package/dist/types/utility.js +3 -0
  360. package/dist/types/utility.js.map +1 -0
  361. package/package.json +18 -18
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebStyleRegistry.js","sourceRoot":"","sources":["../../src/lib/WebStyleRegistry.ts"],"names":[],"mappings":";;;AAAA,6CAAkG;AAElG,MAAM,SAAS,GAAG,IAAI,uBAAc,CAAC;IACnC,GAAG,CAAC,GAAG,EAAE,KAAK;QACZ,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,IAAI,CAAA;QAC9C,OAAO,YAAY,EAAE,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAC1C,CAAC;IACD,GAAG,CAAC,GAAG;QACL,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,IAAI,CAAA;QAC9C,OAAO,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;IACnC,CAAC;IACD,GAAG,CAAC,GAAG;QACL,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,IAAI,CAAA;QAC9C,OAAO,YAAY,EAAE,UAAU,CAAC,GAAG,CAAC,CAAA;IACtC,CAAC;CACF,CAAC,CAAA;AAEF,IAAI,QAA0B,CAAA;AAE9B,MAAM,UAAU,GAAkD,EAAE,CAAA;AAEpE;;;;;;;;;;;;;;GAcG;AACH,MAAa,gBAAiB,SAAQ,8BAAqB;IACzD,eAAe,GAA2C,EAAE,CAAA;IAE5D;QACE,KAAK,CAAC,SAAS,CAAC,CAAA;QAEhB,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YAC/B,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAA;QACnC,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,IAAI,CAAA;QACjB,CAAC;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,8GAA8G;IAC9G,uBAAuB,CAAC,aAAqB,EAAE,QAAgC;QAC7E,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAA;IAChD,CAAC;IAED,iHAAiH;IACjH,iBAAiB,CAAC,aAAqB,EAAE,WAAmB;QAC1D,OAAO,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;IAC3D,CAAC;IAED,WAAW,CAAC,GAAS;QACnB,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,MAAM,KAAK,OAAO;QAChB,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,SAA6B;QACpD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAC1B,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAA;QACvC,CAAC;IACH,CAAC;CACF;AAzCD,4CAyCC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useAnimatedStyle"), exports);
18
+ __exportStar(require("./useAnimatedVariantStyles"), exports);
19
+ __exportStar(require("./useBreakpointMatch"), exports);
20
+ __exportStar(require("./useClick"), exports);
21
+ __exportStar(require("./useClickOutside"), exports);
22
+ __exportStar(require("./useMediaQuery"), exports);
23
+ __exportStar(require("./usePageExitBlocker"), exports);
24
+ __exportStar(require("./usePagination"), exports);
25
+ __exportStar(require("./usePopState"), exports);
26
+ __exportStar(require("./useScrollEffect"), exports);
27
+ __exportStar(require("./useIsomorphicEffect"), exports);
28
+ __exportStar(require("./useSearchParams"), exports);
29
+ __exportStar(require("./useStaticAnimationStyles"), exports);
30
+ __exportStar(require("./useWindowFocus"), exports);
31
+ __exportStar(require("./useWindowSize"), exports);
32
+ __exportStar(require("./useKeydown"), exports);
33
+ __exportStar(require("./useRefresh"), exports);
34
+ __exportStar(require("./useFileInput"), exports);
35
+ __exportStar(require("./useStylesFor"), exports);
36
+ __exportStar(require("./useAsyncSelect"), exports);
37
+ __exportStar(require("./useListFocus"), exports);
38
+ __exportStar(require("./usePopoverDismiss"), exports);
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,6DAA0C;AAC1C,uDAAoC;AACpC,6CAA0B;AAC1B,oDAAiC;AACjC,kDAA+B;AAC/B,uDAAoC;AACpC,kDAA+B;AAC/B,gDAA6B;AAC7B,oDAAiC;AACjC,wDAAqC;AACrC,oDAAiC;AACjC,6DAA0C;AAC1C,mDAAgC;AAChC,kDAA+B;AAC/B,+CAA4B;AAC5B,+CAA4B;AAC5B,iDAA8B;AAC9B,iDAA8B;AAC9B,mDAAgC;AAEhC,iDAA8B;AAC9B,sDAAmC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAnimatedStyle = void 0;
4
+ const react_1 = require("react");
5
+ /**
6
+ * Drives a Framer Motion `animate` prop from a reactive updater function.
7
+ *
8
+ * The transition from the initial call is captured once and held stable; only
9
+ * the animated target re-evaluates on dependency changes. Returns `initial: false`
10
+ * so Motion skips the mount animation and begins from the current state.
11
+ */
12
+ const useAnimatedStyle = (updater, deps) => {
13
+ const initialStyle = updater();
14
+ const [animatedStyle, setAnimatedStyle] = (0, react_1.useState)(initialStyle);
15
+ const transition = (0, react_1.useRef)(initialStyle.transition);
16
+ (0, react_1.useEffect)(() => {
17
+ const animatedStyleUpdated = updater();
18
+ setAnimatedStyle(animatedStyleUpdated);
19
+ }, deps);
20
+ return {
21
+ animate: animatedStyle,
22
+ transition: transition.current,
23
+ initial: false,
24
+ };
25
+ };
26
+ exports.useAnimatedStyle = useAnimatedStyle;
27
+ //# sourceMappingURL=useAnimatedStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnimatedStyle.js","sourceRoot":"","sources":["../../../src/lib/hooks/useAnimatedStyle.ts"],"names":[],"mappings":";;;AAAA,iCAAmD;AAanD;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAAC,OAA4B,EAAE,IAAgB,EAA0B,EAAE;IACzG,MAAM,YAAY,GAAG,OAAO,EAAE,CAAA;IAE9B,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAAsB,YAAY,CAAC,CAAA;IACrF,MAAM,UAAU,GAAG,IAAA,cAAM,EAAyB,YAAY,CAAC,UAAU,CAAC,CAAA;IAE1E,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,oBAAoB,GAAG,OAAO,EAAE,CAAA;QAEtC,gBAAgB,CAAC,oBAAoB,CAAC,CAAA;IACxC,CAAC,EAAE,IAAI,CAAC,CAAA;IAER,OAAO;QACL,OAAO,EAAE,aAAa;QACtB,UAAU,EAAE,UAAU,CAAC,OAAO;QAC9B,OAAO,EAAE,KAAK;KACf,CAAA;AACH,CAAC,CAAA;AAjBY,QAAA,gBAAgB,oBAiB5B"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAnimatedVariantStyles = useAnimatedVariantStyles;
4
+ const useStaticAnimationStyles_1 = require("./useStaticAnimationStyles");
5
+ const react_1 = require("react");
6
+ /**
7
+ * Derives a Framer Motion animation target from a component's variant styles,
8
+ * animating only the properties listed in `animatedProperties` while keeping the
9
+ * rest static (via `useStaticAnimationStyles`). Re-evaluates the `updater` whenever
10
+ * `dependencies` change.
11
+ */
12
+ function useAnimatedVariantStyles(config) {
13
+ const { animatedProperties, updater, variantStyles, dependencies = [] } = config;
14
+ const staticStyles = (0, useStaticAnimationStyles_1.useStaticAnimationStyles)(variantStyles, animatedProperties);
15
+ const initialState = updater(staticStyles);
16
+ const [animated, setAnimated] = (0, react_1.useState)(initialState);
17
+ (0, react_1.useEffect)(() => {
18
+ const nextState = updater(staticStyles);
19
+ setAnimated(nextState);
20
+ }, dependencies);
21
+ return animated;
22
+ }
23
+ //# sourceMappingURL=useAnimatedVariantStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnimatedVariantStyles.js","sourceRoot":"","sources":["../../../src/lib/hooks/useAnimatedVariantStyles.ts"],"names":[],"mappings":";;AAkBA,4DAgBC;AAhCD,yEAAqE;AACrE,iCAA2C;AAS3C;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAqE,MAA4C;IACvJ,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,MAAM,CAAA;IAEhF,MAAM,YAAY,GAAG,IAAA,mDAAwB,EAAC,aAAa,EAAE,kBAAkB,CAAC,CAAA;IAEhF,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IAE1C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,EAAC,YAAY,CAAC,CAAA;IAEtD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;QAEvC,WAAW,CAAC,SAAS,CAAC,CAAA;IACxB,CAAC,EAAE,YAAY,CAAC,CAAA;IAEhB,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAsyncSelect = useAsyncSelect;
4
+ const react_1 = require("react");
5
+ const react_query_1 = require("@tanstack/react-query");
6
+ /**
7
+ * Wraps TanStack Query to power a search-driven async Select component.
8
+ *
9
+ * Returns a `[selectProps, state]` tuple. Spread the first element onto a
10
+ * `Select` component; use the second to drive the search query and inspect
11
+ * loading / error state.
12
+ *
13
+ * The query is gated by `isSearchValid` (defaults to non-empty/non-null).
14
+ * Pass `isSearchValid: () => true` to fetch on mount with an empty query.
15
+ * Requires a TanStack Query `QueryClientProvider` in the tree.
16
+ */
17
+ function useAsyncSelect(opts) {
18
+ const { load, isSearchValid, renderError, renderNoResults, renderLoading, queryOptions, } = opts;
19
+ const hookId = (0, react_1.useId)();
20
+ const baseKey = opts.queryKey ?? [hookId];
21
+ const [searchQuery, setSearchQuery] = (0, react_1.useState)('');
22
+ const defaultIsValid = (q) => q != null && q !== '';
23
+ const enabled = isSearchValid ? isSearchValid(searchQuery) : defaultIsValid(searchQuery);
24
+ const queryResult = (0, react_query_1.useQuery)({
25
+ queryKey: ['asyncSelect', ...baseKey, searchQuery],
26
+ queryFn: () => load(searchQuery),
27
+ enabled,
28
+ placeholderData: (prev) => prev,
29
+ ...queryOptions,
30
+ });
31
+ const query = (0, react_1.useCallback)((q) => setSearchQuery(q), []);
32
+ const renderEmpty = (0, react_1.useCallback)(({ style }) => {
33
+ if (queryResult.isLoading || queryResult.isFetching) {
34
+ return renderLoading?.(style) ?? null;
35
+ }
36
+ if (queryResult.isError) {
37
+ return renderError?.(queryResult.error, style) ?? null;
38
+ }
39
+ return renderNoResults?.(searchQuery, style) ?? null;
40
+ }, [
41
+ queryResult.isLoading, queryResult.isFetching,
42
+ queryResult.isError, queryResult.error,
43
+ renderLoading, renderError, renderNoResults, searchQuery,
44
+ ]);
45
+ return [
46
+ {
47
+ options: (queryResult.data?.results ?? []),
48
+ renderEmpty,
49
+ },
50
+ {
51
+ query,
52
+ searchQuery,
53
+ data: queryResult.data?.data ?? null,
54
+ isLoading: queryResult.isLoading,
55
+ error: queryResult.error,
56
+ queryResult,
57
+ },
58
+ ];
59
+ }
60
+ //# sourceMappingURL=useAsyncSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAsyncSelect.js","sourceRoot":"","sources":["../../../src/lib/hooks/useAsyncSelect.ts"],"names":[],"mappings":";;AAkEA,wCA2DC;AA7HD,iCAA2D;AAC3D,uDAA2F;AAsD3F;;;;;;;;;;GAUG;AACH,SAAgB,cAAc,CAI5B,IAA4C;IAE5C,MAAM,EACJ,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,GAC/E,GAAG,IAAI,CAAA;IAER,MAAM,MAAM,GAAG,IAAA,aAAK,GAAE,CAAA;IACtB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,CAAA;IAEzC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAY,CAAC,CAAA;IA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,OAAO;QACL;YACE,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAc;YACvD,WAAW;SACZ;QACD;YACE,KAAK;YACL,WAAW;YACX,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI;YACpC,SAAS,EAAE,WAAW,CAAC,SAAS;YAChC,KAAK,EAAE,WAAW,CAAC,KAAK;YACxB,WAAW;SACZ;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useBreakpointMatch = useBreakpointMatch;
4
+ const react_1 = require("react");
5
+ const types_1 = require("@codeleap/types");
6
+ const styles_1 = require("@codeleap/styles");
7
+ const tools_1 = require("../tools");
8
+ const getTheme = () => styles_1.themeStore.themeTyped;
9
+ function validateBreakpoint(currentTheme, breakpoint) {
10
+ const matchesDown = (0, tools_1.isMediaQuery)(currentTheme.media.down(breakpoint));
11
+ const matchesUp = (0, tools_1.isMediaQuery)(currentTheme.media.up(breakpoint));
12
+ return !matchesUp && matchesDown;
13
+ }
14
+ function useBreakpointMatches() {
15
+ return (0, react_1.useState)(() => {
16
+ const currentTheme = getTheme();
17
+ const breakpointMatches = {};
18
+ for (const breakpoint in currentTheme.breakpoints) {
19
+ breakpointMatches[breakpoint] = validateBreakpoint(currentTheme, breakpoint);
20
+ }
21
+ return breakpointMatches;
22
+ });
23
+ }
24
+ function useBreakpointListeners() {
25
+ const [breakpointMatches, setBreakpointMatches] = useBreakpointMatches();
26
+ const loaded = (0, react_1.useRef)(false);
27
+ const mediaQueries = (0, react_1.useRef)({});
28
+ function callback(event, breakpoint) {
29
+ const currentTheme = getTheme();
30
+ setBreakpointMatches((prevState) => {
31
+ const updatedMatches = { ...prevState };
32
+ updatedMatches[breakpoint] = validateBreakpoint(currentTheme, breakpoint);
33
+ return updatedMatches;
34
+ });
35
+ }
36
+ (0, react_1.useEffect)(() => {
37
+ if (loaded.current)
38
+ return;
39
+ loaded.current = true;
40
+ const currentTheme = getTheme();
41
+ for (const breakpoint in currentTheme.breakpoints) {
42
+ const queryUp = (0, tools_1.getMediaQuery)(currentTheme.media.up(breakpoint));
43
+ const matchUp = window.matchMedia(queryUp);
44
+ mediaQueries.current[breakpoint] = matchUp;
45
+ try {
46
+ matchUp.addEventListener('change', (event) => callback(event, breakpoint));
47
+ }
48
+ catch {
49
+ matchUp.addListener((event) => callback(event, breakpoint));
50
+ }
51
+ }
52
+ return () => {
53
+ for (const breakpoint in mediaQueries.current) {
54
+ const matchUp = mediaQueries.current[breakpoint];
55
+ try {
56
+ matchUp.removeEventListener('change', (event) => callback(event, breakpoint));
57
+ }
58
+ catch {
59
+ matchUp.removeListener((event) => callback(event, breakpoint));
60
+ }
61
+ }
62
+ mediaQueries.current = {};
63
+ };
64
+ }, []);
65
+ return breakpointMatches;
66
+ }
67
+ /**
68
+ * Returns the value mapped to the currently active breakpoint.
69
+ *
70
+ * Reads breakpoint definitions from the active `themeStore` theme and attaches
71
+ * `matchMedia` listeners to track viewport changes reactively. The lookup walks
72
+ * up from the current breakpoint until it finds a key present in `values`, so
73
+ * you can omit smaller breakpoints and let them fall back to the next larger one.
74
+ *
75
+ * Must be rendered in a browser context; SSR always resolves to the fallback
76
+ * value (the largest defined key in `values`).
77
+ */
78
+ function useBreakpointMatch(values) {
79
+ const breakpointMatches = useBreakpointListeners();
80
+ const breakpoints = (0, react_1.useMemo)(() => {
81
+ return Object.entries(getTheme().breakpoints)
82
+ .sort(([, a], [, b]) => a - b)
83
+ .reduce((acc, [key, value]) => {
84
+ acc[key] = value;
85
+ return acc;
86
+ }, {});
87
+ }, []);
88
+ const breakpointValues = (0, react_1.useMemo)(() => {
89
+ return Object.keys(breakpoints).sort((a, b) => breakpoints?.[a] - breakpoints?.[b]);
90
+ }, []);
91
+ const currentBreakpoint = (0, react_1.useMemo)(() => {
92
+ return Object.keys(breakpointMatches).find((key) => breakpointMatches[key]);
93
+ }, [breakpointMatches]);
94
+ const breakpoint = (0, react_1.useMemo)(() => {
95
+ const validBreakpointIndex = breakpointValues?.findIndex(key => key === currentBreakpoint);
96
+ const validBreakpoints = breakpointValues?.slice(validBreakpointIndex, 100);
97
+ let validBreakpoint = null;
98
+ validBreakpoint = validBreakpoints?.find((currentValue) => {
99
+ if (Object?.keys(values)?.includes(currentValue)) {
100
+ return currentValue;
101
+ }
102
+ });
103
+ if (types_1.TypeGuards.isNil(validBreakpoint)) {
104
+ validBreakpoint = breakpointValues?.reverse()?.find(key => !!values?.[key]);
105
+ }
106
+ return validBreakpoint;
107
+ }, [currentBreakpoint]);
108
+ const value = (0, react_1.useMemo)(() => values?.[breakpoint], [breakpoint]);
109
+ return value;
110
+ }
111
+ //# sourceMappingURL=useBreakpointMatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreakpointMatch.js","sourceRoot":"","sources":["../../../src/lib/hooks/useBreakpointMatch.ts"],"names":[],"mappings":";;AA+FA,gDA2CC;AA1ID,iCAA4D;AAC5D,2CAA4C;AAC5C,6CAA0E;AAC1E,oCAAsD;AAEtD,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,mBAAU,CAAC,UAAU,CAAA;AAE5C,SAAS,kBAAkB,CAAC,YAA6B,EAAE,UAAkB;IAC3E,MAAM,WAAW,GAAG,IAAA,oBAAY,EAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,UAAmB,CAAC,CAAC,CAAA;IAC9E,MAAM,SAAS,GAAG,IAAA,oBAAY,EAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,UAAmB,CAAC,CAAC,CAAA;IAE1E,OAAO,CAAC,SAAS,IAAI,WAAW,CAAA;AAClC,CAAC;AAED,SAAS,oBAAoB;IAC3B,OAAO,IAAA,gBAAQ,EAA0B,GAAG,EAAE;QAC5C,MAAM,YAAY,GAAG,QAAQ,EAAE,CAAA;QAE/B,MAAM,iBAAiB,GAA4B,EAAE,CAAA;QAErD,KAAK,MA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ACrB,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,kBAAU,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;YACtC,eAAe,GAAG,gBAAgB,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;QAC7E,CAAC;QAED,OAAO,eAAe,CAAA;IACxB,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAEvB,MAAM,KAAK,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAE/D,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useClickOutsideElement = useClickOutsideElement;
4
+ const types_1 = require("@codeleap/types");
5
+ const react_1 = require("react");
6
+ /**
7
+ * Attaches a global `click` listener and calls `handler` with `true` when the
8
+ * user clicks outside the returned ref's element, or `false` when they click
9
+ * inside it. Pass additional `elements` refs to treat those nodes as "inside"
10
+ * as well — the handler fires `false` if any of them contains the click target.
11
+ */
12
+ function useClickOutsideElement(handler, elements = null) {
13
+ const elementRef = (0, react_1.useRef)(null);
14
+ const handleClickOutside = (0, react_1.useCallback)((event) => {
15
+ if (!elementRef.current)
16
+ return;
17
+ const clickedOutsideElement = !elementRef.current.contains(event?.target);
18
+ const clickedOutsideElements = [true];
19
+ if (types_1.TypeGuards?.isArray(elements)) {
20
+ elements?.forEach(element => {
21
+ if (element.current) {
22
+ clickedOutsideElements.push(!element.current.contains(event?.target));
23
+ }
24
+ });
25
+ }
26
+ if (clickedOutsideElement && clickedOutsideElements.every((clickedOutside) => !!clickedOutside)) {
27
+ handler(true);
28
+ }
29
+ else {
30
+ handler(false);
31
+ }
32
+ }, [handler]);
33
+ (0, react_1.useEffect)(() => {
34
+ document.addEventListener('click', handleClickOutside);
35
+ return () => {
36
+ document.removeEventListener('click', handleClickOutside);
37
+ };
38
+ }, [handleClickOutside]);
39
+ return elementRef;
40
+ }
41
+ //# sourceMappingURL=useClick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClick.js","sourceRoot":"","sources":["../../../src/lib/hooks/useClick.ts"],"names":[],"mappings":";;AAaA,wDAoCC;AAjDD,2CAA4C;AAC5C,iCAA6D;AAM7D;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,OAA4B,EAC5B,WAA+C,IAAI;IAEnD,MAAM,UAAU,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAA;IAE/B,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EAAC,CAAC,KAAiB,EAAE,EAAE;QAC3D,IAAI,CAAC,UAAU,CAAC,OAAO;YAAE,OAAM;QAE/B,MAAM,qBAAqB,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACzE,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,CAAA;QAErC,IAAI,kBAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;gBAC1B,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;oBACpB,sBAAsB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;gBACvE,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,IAAI,qBAAqB,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC;YAChG,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,CAAA;QAChB,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAEb,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAA;QAEtD,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAA;QAC3D,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA;IAExB,OAAO,UAAU,CAAA;AACnB,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useClickOutside = useClickOutside;
4
+ const react_1 = require("react");
5
+ const DEFAULT_EVENTS = ['mousedown', 'touchstart'];
6
+ /**
7
+ * Calls `handler` when a pointer event fires outside the returned ref's element.
8
+ *
9
+ * Listens for `mousedown` and `touchstart` by default; pass `events` to
10
+ * override. Supply `nodes` to bypass the ref entirely and check a fixed set of
11
+ * elements instead — useful when the trigger lives outside the component tree.
12
+ * Elements with `data-ignore-outside-clicks` are always ignored.
13
+ */
14
+ function useClickOutside(handler, events, nodes) {
15
+ const ref = (0, react_1.useRef)(null);
16
+ (0, react_1.useEffect)(() => {
17
+ const listener = (event) => {
18
+ if (Array.isArray(nodes)) {
19
+ const shouldIgnore = event?.target?.hasAttribute('data-ignore-outside-clicks');
20
+ const shouldTrigger = nodes.every((node) => !!node && !node.contains(event.target));
21
+ shouldTrigger && !shouldIgnore && handler();
22
+ }
23
+ else if (ref.current && !ref.current.contains(event.target)) {
24
+ handler();
25
+ }
26
+ };
27
+ (events || DEFAULT_EVENTS).forEach((fn) => document.addEventListener(fn, listener));
28
+ return () => {
29
+ (events || DEFAULT_EVENTS).forEach((fn) => document.removeEventListener(fn, listener));
30
+ };
31
+ }, [ref, handler, nodes]);
32
+ return ref;
33
+ }
34
+ //# sourceMappingURL=useClickOutside.js.map
@@ -0,0 +1 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BAAmB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAA;QACxF,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAA;IAEzB,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useFileInput = void 0;
4
+ const react_1 = require("react");
5
+ /**
6
+ * Provides an imperative ref and `openFilePicker` helper for a `FileInput`
7
+ * component. Attach the returned `ref` to `<FileInput ref={ref} />` and call
8
+ * `openFilePicker()` from a button or any other trigger.
9
+ */
10
+ const useFileInput = () => {
11
+ const inputRef = (0, react_1.useRef)(null);
12
+ const openFilePicker = () => {
13
+ return inputRef.current?.openFilePicker();
14
+ };
15
+ return {
16
+ openFilePicker,
17
+ ref: inputRef,
18
+ };
19
+ };
20
+ exports.useFileInput = useFileInput;
21
+ //# sourceMappingURL=useFileInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFileInput.js","sourceRoot":"","sources":["../../../src/lib/hooks/useFileInput.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAG9B;;;;GAIG;AACI,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAsB,IAAI,CAAC,CAAA;IAElD,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,OAAO,QAAQ,CAAC,OAAO,EAAE,cAAc,EAAE,CAAA;IAC3C,CAAC,CAAA;IAED,OAAO;QACL,cAAc;QACd,GAAG,EAAE,QAAQ;KACd,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,YAAY,gBAWxB"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useIsomorphicEffect = void 0;
4
+ const react_1 = require("react");
5
+ /**
6
+ * `useLayoutEffect` in the browser; `useEffect` on the server.
7
+ * Avoids the React SSR warning about `useLayoutEffect` in non-browser environments.
8
+ */
9
+ exports.useIsomorphicEffect = typeof document !== 'undefined' ? react_1.useLayoutEffect : react_1.useEffect;
10
+ //# sourceMappingURL=useIsomorphicEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsomorphicEffect.js","sourceRoot":"","sources":["../../../src/lib/hooks/useIsomorphicEffect.ts"],"names":[],"mappings":";;;AAAA,iCAAkD;AAElD;;;GAGG;AACU,QAAA,mBAAmB,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,uBAAe,CAAC,CAAC,CAAC,iBAAS,CAAA"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.keydownDefaultKeyOptions = void 0;
4
+ exports.useKeydown = useKeydown;
5
+ const types_1 = require("@codeleap/types");
6
+ const react_1 = require("react");
7
+ /** Convenience key descriptors available as `useKeydown.keys`. */
8
+ exports.keydownDefaultKeyOptions = {
9
+ ArrowLeft: 'ArrowLeft',
10
+ ArrowRight: 'ArrowRight',
11
+ ArrowUp: 'ArrowUp',
12
+ ArrowDown: 'ArrowDown',
13
+ Enter: 'Enter',
14
+ Space: {
15
+ key: ' ',
16
+ code: 'Space',
17
+ },
18
+ };
19
+ /**
20
+ * Adds a `keydown` listener on `document` for a single key.
21
+ *
22
+ * `expectedKey` can be a shorthand from `useKeydown.keys` (e.g. `'Enter'`) or
23
+ * an explicit `{ key, code }` object. The listener is re-registered whenever
24
+ * `deps` change.
25
+ */
26
+ function useKeydown(expectedKey, handler, deps = [], options) {
27
+ const eventKey = types_1.TypeGuards.isString(expectedKey) ? (useKeydown?.keys?.[expectedKey] ?? expectedKey) : expectedKey;
28
+ const handleKeyPress = (event) => {
29
+ const { key, code } = types_1.TypeGuards.isString(eventKey) ? { key: eventKey, code: eventKey } : eventKey;
30
+ if (event?.key === key || event?.code === code) {
31
+ handler?.(event);
32
+ }
33
+ };
34
+ (0, react_1.useEffect)(() => {
35
+ document.addEventListener('keydown', handleKeyPress, options);
36
+ return () => {
37
+ document.removeEventListener('keydown', handleKeyPress);
38
+ };
39
+ }, deps);
40
+ }
41
+ useKeydown.keys = exports.keydownDefaultKeyOptions;
42
+ useKeydown.defaultKeyOptions = exports.keydownDefaultKeyOptions;
43
+ //# sourceMappingURL=useKeydown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeydown.js","sourceRoot":"","sources":["../../../src/lib/hooks/useKeydown.ts"],"names":[],"mappings":";;;AAuBA,gCAuBC;AA9CD,2CAA4C;AAC5C,iCAAiC;AAEjC,kEAAkE;AACrD,QAAA,wBAAwB,GAAG;IACtC,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE;QACL,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,OAAO;KACd;CACF,CAAA;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CACxB,WAAyE,EACzE,OAAuC,EACvC,OAAmB,EAAE,EACrB,OAA2C;IAE3C,MAAM,QAAQ,GAAG,kBAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;IAElH,MAAM,cAAc,GAAG,CAAC,KAAoB,EAAE,EAAE;QAC9C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,kBAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAA;QAElG,IAAI,KAAK,EAAE,GAAG,KAAK,GAAG,IAAI,KAAK,EAAE,IAAI,KAAK,IAAI,EAAE,CAAC;YAC/C,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;QAClB,CAAC;IACH,CAAC,CAAA;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;QAE7D,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;QACzD,CAAC,CAAA;IACH,CAAC,EAAE,IAAI,CAAC,CAAA;AACV,CAAC;AAED,UAAU,CAAC,IAAI,GAAG,gCAAwB,CAAA;AAC1C,UAAU,CAAC,iBAAiB,GAAG,gCAAwB,CAAA"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useListFocus = useListFocus;
4
+ const react_1 = require("react");
5
+ /**
6
+ * Creates a stable imperative focus handle for a ListBox DOM ref and returns it.
7
+ *
8
+ * The handle queries [role="option"] elements directly. When the chosen item
9
+ * receives DOM focus, react-aria's own useSelectableItem onFocus handler calls
10
+ * manager.setFocusedKey(key), so internal keyboard-navigation state stays in
11
+ * sync without needing access to ListStateContext.
12
+ *
13
+ * Pass the same listBoxRef to <ListBox ref={...}>.
14
+ * Pass externalRef to also expose the handle to a consumer-provided ref.
15
+ */
16
+ function useListFocus(listBoxRef, externalRef) {
17
+ const handle = (0, react_1.useMemo)(() => ({
18
+ focus(strategy = 'selected') {
19
+ const list = listBoxRef.current;
20
+ if (!list)
21
+ return;
22
+ const options = Array.from(list.querySelectorAll('[role="option"]:not([data-disabled])'));
23
+ if (!options.length)
24
+ return;
25
+ let target = null;
26
+ if (strategy === 'last') {
27
+ target = options.at(-1) ?? null;
28
+ }
29
+ else if (strategy === 'selected') {
30
+ target =
31
+ list.querySelector('[role="option"][aria-selected="true"]') ??
32
+ options[0] ??
33
+ null;
34
+ }
35
+ else {
36
+ target = options[0] ?? null;
37
+ }
38
+ target?.focus();
39
+ },
40
+ }), [listBoxRef]);
41
+ (0, react_1.useEffect)(() => {
42
+ if (!externalRef)
43
+ return;
44
+ externalRef.current = handle;
45
+ return () => { externalRef.current = null; };
46
+ }, [handle, externalRef]);
47
+ return handle;
48
+ }
49
+ //# sourceMappingURL=useListFocus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useListFocus.js","sourceRoot":"","sources":["../../../src/lib/hooks/useListFocus.ts"],"names":[],"mappings":";;AAoBA,oCAsCC;AA1DD,iCAA0D;AAS1D;;;;;;;;;;GAUG;AACH,SAAgB,YAAY,CAC1B,UAAyC,EACzC,WAA+C;IAE/C,MAAM,MAAM,GAAG,IAAA,eAAO,EAAkB,GAAG,EAAE,CAAC,CAAC;QAC7C,KAAK,CAAC,WAA8B,UAAU;YAC5C,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAA;YAC/B,IAAI,CAAC,IAAI;gBAAE,OAAM;YAEjB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CACxB,IAAI,CAAC,gBAAgB,CAAc,sCAAsC,CAAC,CAC3E,CAAA;YACD,IAAI,CAAC,OAAO,CAAC,MAAM;gBAAE,OAAM;YAE3B,IAAI,MAAM,GAAuB,IAAI,CAAA;YAErC,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;gBACxB,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAA;YACjC,CAAC;iBAAM,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;gBACnC,MAAM;oBACJ,IAAI,CAAC,aAAa,CAAc,uCAAuC,CAAC;wBACxE,OAAO,CAAC,CAAC,CAAC;wBACV,IAAI,CAAA;YACR,CAAC;iBAAM,CAAC;gBACN,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAA;YAC7B,CAAC;YAED,MAAM,EAAE,KAAK,EAAE,CAAA;QACjB,CAAC;KACF,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAEjB,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,WAAW;YAAE,OAAM;QACxB,WAAW,CAAC,OAAO,GAAG,MAAM,CAAA;QAC5B,OAAO,GAAG,EAAE,GAAG,WAAW,CAAC,OAAO,GAAG,IAAI,CAAA,CAAC,CAAC,CAAA;IAC7C,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAA;IAEzB,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMediaQuery = useMediaQuery;
4
+ const react_1 = require("react");
5
+ const tools_1 = require("../tools");
6
+ /**
7
+ * Subscribes to a CSS media query string and returns whether it currently matches.
8
+ *
9
+ * Falls back to a static check via `isMediaQuery` on SSR or when `matchMedia` is
10
+ * unavailable. The query string may include the `@media screen and ` prefix —
11
+ * it is stripped internally before passing to `window.matchMedia`.
12
+ */
13
+ function useMediaQuery(query) {
14
+ const [matches, setMatches] = (0, react_1.useState)((0, tools_1.isMediaQuery)(query));
15
+ const queryRef = (0, react_1.useRef)(undefined);
16
+ (0, react_1.useEffect)(() => {
17
+ if (query?.trim() === '' || !query)
18
+ return;
19
+ if ('matchMedia' in window) {
20
+ queryRef.current = window.matchMedia((0, tools_1.getMediaQuery)(query));
21
+ setMatches(queryRef.current.matches);
22
+ return (0, tools_1.attachMediaListener)(queryRef.current, (event) => setMatches(event.matches));
23
+ }
24
+ return undefined;
25
+ }, []);
26
+ return matches;
27
+ }
28
+ //# sourceMappingURL=useMediaQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMediaQuery.js","sourceRoot":"","sources":["../../../src/lib/hooks/useMediaQuery.ts"],"names":[],"mappings":";;AAUA,sCAkBC;AA5BD,iCAAmD;AACnD,oCAA2E;AAE3E;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,KAAa;IACzC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC,CAAA;IAE3D,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAiB,SAAS,CAAC,CAAA;IAElD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK;YAAE,OAAM;QAE1C,IAAI,YAAY,IAAI,MAAM,EAAE,CAAC;YAC3B,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC,CAAA;YAC1D,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;YACpC,OAAO,IAAA,2BAAmB,EAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;QACpF,CAAC;QAED,OAAO,SAAS,CAAA;IAClB,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usePageExitBlocker = void 0;
4
+ const router_1 = require("@reach/router");
5
+ const react_1 = require("react");
6
+ /**
7
+ * Blocks the user from leaving the current page without confirmation.
8
+ *
9
+ * Intercepts both browser tab-close / reload (`beforeunload`) and in-app
10
+ * navigation via `@reach/router`'s `globalHistory`. When a PUSH or POP
11
+ * navigation is detected, a `window.confirm` dialog is shown; `handler` is
12
+ * called with `true` if the user confirmed, `false` if they cancelled.
13
+ *
14
+ * Requires `@reach/router` to be present in the application.
15
+ */
16
+ const usePageExitBlocker = (handler, deps = [], message = 'Are you sure you want to leave?') => {
17
+ const handleBeforeUnload = (event) => {
18
+ if (!event)
19
+ return null;
20
+ event?.preventDefault();
21
+ event.returnValue = '';
22
+ return;
23
+ };
24
+ (0, react_1.useEffect)(() => {
25
+ if (!window)
26
+ return null;
27
+ window.addEventListener('beforeunload', handleBeforeUnload);
28
+ return () => {
29
+ window.removeEventListener('beforeunload', handleBeforeUnload);
30
+ };
31
+ }, deps);
32
+ (0, react_1.useEffect)(() => {
33
+ return router_1.globalHistory.listen((args) => {
34
+ if (!window)
35
+ return null;
36
+ const historyPathname = args?.location?.pathname;
37
+ const windowPathname = window?.location?.pathname;
38
+ const isPopAction = args?.action === 'POP';
39
+ const isLeaveAction = args?.action === 'PUSH' && !historyPathname?.includes(windowPathname);
40
+ if (isLeaveAction || isPopAction) {
41
+ const willLeavePage = window.confirm(message);
42
+ handler?.(willLeavePage);
43
+ }
44
+ });
45
+ }, deps);
46
+ };
47
+ exports.usePageExitBlocker = usePageExitBlocker;
48
+ //# sourceMappingURL=usePageExitBlocker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePageExitBlocker.js","sourceRoot":"","sources":["../../../src/lib/hooks/usePageExitBlocker.ts"],"names":[],"mappings":";;;AAAA,0CAA6C;AAC7C,iCAAiC;AAEjC;;;;;;;;;GASG;AACI,MAAM,kBAAkB,GAAG,CAChC,OAAyC,EACzC,OAAmB,EAAE,EACrB,OAAO,GAAG,iCAAiC,EAC3C,EAAE;IACF,MAAM,kBAAkB,GAAG,CAAC,KAAwB,EAAE,EAAE;QACtD,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAA;QAEvB,KAAK,EAAE,cAAc,EAAE,CAAA;QACvB,KAAK,CAAC,WAAW,GAAG,EAAE,CAAA;QACtB,OAAM;IACR,CAAC,CAAA;IAED,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAA;QAExB,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAA;QAE3D,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAA;QAChE,CAAC,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