@codeleap/web 6.8.0 → 7.0.1

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 (357) hide show
  1. package/dist/components/ActivityIndicator/index.js +28 -0
  2. package/dist/components/ActivityIndicator/index.js.map +1 -0
  3. package/dist/components/ActivityIndicator/styles.js +2 -0
  4. package/dist/components/ActivityIndicator/styles.js.map +1 -0
  5. package/dist/components/ActivityIndicator/types.js +2 -0
  6. package/dist/components/ActivityIndicator/types.js.map +1 -0
  7. package/dist/components/Badge/index.js +68 -0
  8. package/dist/components/Badge/index.js.map +1 -0
  9. package/dist/components/Badge/styles.js +2 -0
  10. package/dist/components/Badge/styles.js.map +1 -0
  11. package/dist/components/Badge/types.js +2 -0
  12. package/dist/components/Badge/types.js.map +1 -0
  13. package/dist/components/Button/index.js +52 -0
  14. package/dist/components/Button/index.js.map +1 -0
  15. package/dist/components/Button/styles.js +2 -0
  16. package/dist/components/Button/styles.js.map +1 -0
  17. package/dist/components/Button/types.js +2 -0
  18. package/dist/components/Button/types.js.map +1 -0
  19. package/dist/components/Calendar/index.js +50 -0
  20. package/dist/components/Calendar/index.js.map +1 -0
  21. package/dist/components/Calendar/styles.js +2 -0
  22. package/dist/components/Calendar/styles.js.map +1 -0
  23. package/dist/components/Calendar/types.js +2 -0
  24. package/dist/components/Calendar/types.js.map +1 -0
  25. package/dist/components/Carousel/index.js +129 -0
  26. package/dist/components/Carousel/index.js.map +1 -0
  27. package/dist/components/Carousel/styles.js +2 -0
  28. package/dist/components/Carousel/styles.js.map +1 -0
  29. package/dist/components/Carousel/types.js +2 -0
  30. package/dist/components/Carousel/types.js.map +1 -0
  31. package/dist/components/Checkbox/index.js +44 -0
  32. package/dist/components/Checkbox/index.js.map +1 -0
  33. package/dist/components/Checkbox/styles.js +2 -0
  34. package/dist/components/Checkbox/styles.js.map +1 -0
  35. package/dist/components/Checkbox/types.js +2 -0
  36. package/dist/components/Checkbox/types.js.map +1 -0
  37. package/dist/components/Collapse/index.js +27 -0
  38. package/dist/components/Collapse/index.js.map +1 -0
  39. package/dist/components/Collapse/styles.js +2 -0
  40. package/dist/components/Collapse/styles.js.map +1 -0
  41. package/dist/components/Collapse/types.js +2 -0
  42. package/dist/components/Collapse/types.js.map +1 -0
  43. package/dist/components/ColorPicker/index.js +65 -0
  44. package/dist/components/ColorPicker/index.js.map +1 -0
  45. package/dist/components/ColorPicker/styles.js +2 -0
  46. package/dist/components/ColorPicker/styles.js.map +1 -0
  47. package/dist/components/ColorPicker/types.js +2 -0
  48. package/dist/components/ColorPicker/types.js.map +1 -0
  49. package/dist/components/CropPicker/hooks.js +130 -0
  50. package/dist/components/CropPicker/hooks.js.map +1 -0
  51. package/dist/components/CropPicker/index.js +38 -0
  52. package/dist/components/CropPicker/index.js.map +1 -0
  53. package/dist/components/CropPicker/styles.js +2 -0
  54. package/dist/components/CropPicker/styles.js.map +1 -0
  55. package/dist/components/CropPicker/types.js +2 -0
  56. package/dist/components/CropPicker/types.js.map +1 -0
  57. package/dist/components/CropPicker/utils.js +70 -0
  58. package/dist/components/CropPicker/utils.js.map +1 -0
  59. package/dist/components/DatePicker/index.js +70 -0
  60. package/dist/components/DatePicker/index.js.map +1 -0
  61. package/dist/components/DatePicker/styles.js +2 -0
  62. package/dist/components/DatePicker/styles.js.map +1 -0
  63. package/dist/components/DatePicker/types.js +2 -0
  64. package/dist/components/DatePicker/types.js.map +1 -0
  65. package/dist/components/Drawer/index.js +50 -0
  66. package/dist/components/Drawer/index.js.map +1 -0
  67. package/dist/components/Drawer/styles.js +2 -0
  68. package/dist/components/Drawer/styles.js.map +1 -0
  69. package/dist/components/Drawer/types.js +2 -0
  70. package/dist/components/Drawer/types.js.map +1 -0
  71. package/dist/components/Dropzone/context.js +39 -0
  72. package/dist/components/Dropzone/context.js.map +1 -0
  73. package/dist/components/Dropzone/elements.js +51 -0
  74. package/dist/components/Dropzone/elements.js.map +1 -0
  75. package/dist/components/Dropzone/index.js +71 -0
  76. package/dist/components/Dropzone/index.js.map +1 -0
  77. package/dist/components/Dropzone/styles.js +2 -0
  78. package/dist/components/Dropzone/styles.js.map +1 -0
  79. package/dist/components/Dropzone/types.js +2 -0
  80. package/dist/components/Dropzone/types.js.map +1 -0
  81. package/dist/components/Dropzone/useDropzone.js +17 -0
  82. package/dist/components/Dropzone/useDropzone.js.map +1 -0
  83. package/dist/components/EmptyPlaceholder/index.js +65 -0
  84. package/dist/components/EmptyPlaceholder/index.js.map +1 -0
  85. package/dist/components/EmptyPlaceholder/styles.js +2 -0
  86. package/dist/components/EmptyPlaceholder/styles.js.map +1 -0
  87. package/dist/components/EmptyPlaceholder/types.js +2 -0
  88. package/dist/components/EmptyPlaceholder/types.js.map +1 -0
  89. package/dist/components/Field/context.js +52 -0
  90. package/dist/components/Field/context.js.map +1 -0
  91. package/dist/components/Field/elements.js +84 -0
  92. package/dist/components/Field/elements.js.map +1 -0
  93. package/dist/components/Field/index.js +37 -0
  94. package/dist/components/Field/index.js.map +1 -0
  95. package/dist/components/Field/styles.js +2 -0
  96. package/dist/components/Field/styles.js.map +1 -0
  97. package/dist/components/Field/types.js +2 -0
  98. package/dist/components/Field/types.js.map +1 -0
  99. package/dist/components/Field/useFieldInput.js +47 -0
  100. package/dist/components/Field/useFieldInput.js.map +1 -0
  101. package/dist/components/FileInput/index.js +55 -0
  102. package/dist/components/FileInput/index.js.map +1 -0
  103. package/dist/components/FileInput/types.js +2 -0
  104. package/dist/components/FileInput/types.js.map +1 -0
  105. package/dist/components/Icon/index.js +51 -0
  106. package/dist/components/Icon/index.js.map +1 -0
  107. package/dist/components/Icon/styles.js +2 -0
  108. package/dist/components/Icon/styles.js.map +1 -0
  109. package/dist/components/Icon/types.js +2 -0
  110. package/dist/components/Icon/types.js.map +1 -0
  111. package/dist/components/List/context.js +76 -0
  112. package/dist/components/List/context.js.map +1 -0
  113. package/dist/components/List/elements.js +123 -0
  114. package/dist/components/List/elements.js.map +1 -0
  115. package/dist/components/List/index.js +35 -0
  116. package/dist/components/List/index.js.map +1 -0
  117. package/dist/components/List/scroll.js +75 -0
  118. package/dist/components/List/scroll.js.map +1 -0
  119. package/dist/components/List/styles.js +2 -0
  120. package/dist/components/List/styles.js.map +1 -0
  121. package/dist/components/List/types.js +2 -0
  122. package/dist/components/List/types.js.map +1 -0
  123. package/dist/components/LoadingOverlay/index.js +32 -0
  124. package/dist/components/LoadingOverlay/index.js.map +1 -0
  125. package/dist/components/LoadingOverlay/styles.js +2 -0
  126. package/dist/components/LoadingOverlay/styles.js.map +1 -0
  127. package/dist/components/LoadingOverlay/types.js +2 -0
  128. package/dist/components/LoadingOverlay/types.js.map +1 -0
  129. package/dist/components/MaskedTextInput/index.js +34 -0
  130. package/dist/components/MaskedTextInput/index.js.map +1 -0
  131. package/dist/components/MaskedTextInput/mask.js +34 -0
  132. package/dist/components/MaskedTextInput/mask.js.map +1 -0
  133. package/dist/components/MaskedTextInput/types.js +2 -0
  134. package/dist/components/MaskedTextInput/types.js.map +1 -0
  135. package/dist/components/Modal/context.js +36 -0
  136. package/dist/components/Modal/context.js.map +1 -0
  137. package/dist/components/Modal/elements.js +66 -0
  138. package/dist/components/Modal/elements.js.map +1 -0
  139. package/dist/components/Modal/index.js +34 -0
  140. package/dist/components/Modal/index.js.map +1 -0
  141. package/dist/components/Modal/styles.js +2 -0
  142. package/dist/components/Modal/styles.js.map +1 -0
  143. package/dist/components/Modal/types.js +2 -0
  144. package/dist/components/Modal/types.js.map +1 -0
  145. package/dist/components/NumberIncrement/index.js +65 -0
  146. package/dist/components/NumberIncrement/index.js.map +1 -0
  147. package/dist/components/NumberIncrement/styles.js +2 -0
  148. package/dist/components/NumberIncrement/styles.js.map +1 -0
  149. package/dist/components/NumberIncrement/types.js +2 -0
  150. package/dist/components/NumberIncrement/types.js.map +1 -0
  151. package/dist/components/NumberIncrement/useNumberIncrement.js +113 -0
  152. package/dist/components/NumberIncrement/useNumberIncrement.js.map +1 -0
  153. package/dist/components/Overlay/index.js +44 -0
  154. package/dist/components/Overlay/index.js.map +1 -0
  155. package/dist/components/Overlay/styles.js +2 -0
  156. package/dist/components/Overlay/styles.js.map +1 -0
  157. package/dist/components/Overlay/types.js +2 -0
  158. package/dist/components/Overlay/types.js.map +1 -0
  159. package/dist/components/PaginationButtons/index.js +100 -0
  160. package/dist/components/PaginationButtons/index.js.map +1 -0
  161. package/dist/components/PaginationButtons/styles.js +2 -0
  162. package/dist/components/PaginationButtons/styles.js.map +1 -0
  163. package/dist/components/PaginationButtons/types.js +2 -0
  164. package/dist/components/PaginationButtons/types.js.map +1 -0
  165. package/dist/components/PaginationIndicator/index.js +41 -0
  166. package/dist/components/PaginationIndicator/index.js.map +1 -0
  167. package/dist/components/PaginationIndicator/styles.js +2 -0
  168. package/dist/components/PaginationIndicator/styles.js.map +1 -0
  169. package/dist/components/PaginationIndicator/types.js +2 -0
  170. package/dist/components/PaginationIndicator/types.js.map +1 -0
  171. package/dist/components/Progress/Bar/Segmented.js +37 -0
  172. package/dist/components/Progress/Bar/Segmented.js.map +1 -0
  173. package/dist/components/Progress/Bar/index.js +44 -0
  174. package/dist/components/Progress/Bar/index.js.map +1 -0
  175. package/dist/components/Progress/Bar/styles.js +2 -0
  176. package/dist/components/Progress/Bar/styles.js.map +1 -0
  177. package/dist/components/Progress/Bar/types.js +2 -0
  178. package/dist/components/Progress/Bar/types.js.map +1 -0
  179. package/dist/components/Progress/Circle/Segmented.js +60 -0
  180. package/dist/components/Progress/Circle/Segmented.js.map +1 -0
  181. package/dist/components/Progress/Circle/index.js +65 -0
  182. package/dist/components/Progress/Circle/index.js.map +1 -0
  183. package/dist/components/Progress/Circle/styles.js +2 -0
  184. package/dist/components/Progress/Circle/styles.js.map +1 -0
  185. package/dist/components/Progress/Circle/types.js +2 -0
  186. package/dist/components/Progress/Circle/types.js.map +1 -0
  187. package/dist/components/Progress/index.js +3 -0
  188. package/dist/components/Progress/index.js.map +1 -0
  189. package/dist/components/Progress/utils.js +4 -0
  190. package/dist/components/Progress/utils.js.map +1 -0
  191. package/dist/components/RadioInput/index.js +47 -0
  192. package/dist/components/RadioInput/index.js.map +1 -0
  193. package/dist/components/RadioInput/styles.js +2 -0
  194. package/dist/components/RadioInput/styles.js.map +1 -0
  195. package/dist/components/RadioInput/types.js +2 -0
  196. package/dist/components/RadioInput/types.js.map +1 -0
  197. package/dist/components/SearchInput/index.js +61 -0
  198. package/dist/components/SearchInput/index.js.map +1 -0
  199. package/dist/components/SectionFilters/index.js +148 -0
  200. package/dist/components/SectionFilters/index.js.map +1 -0
  201. package/dist/components/SectionFilters/styles.js +2 -0
  202. package/dist/components/SectionFilters/styles.js.map +1 -0
  203. package/dist/components/SectionFilters/types.js +2 -0
  204. package/dist/components/SectionFilters/types.js.map +1 -0
  205. package/dist/components/Select/context.js +156 -0
  206. package/dist/components/Select/context.js.map +1 -0
  207. package/dist/components/Select/elements.js +47 -0
  208. package/dist/components/Select/elements.js.map +1 -0
  209. package/dist/components/Select/index.js +53 -0
  210. package/dist/components/Select/index.js.map +1 -0
  211. package/dist/components/Select/styles.js +2 -0
  212. package/dist/components/Select/styles.js.map +1 -0
  213. package/dist/components/Select/types.js +2 -0
  214. package/dist/components/Select/types.js.map +1 -0
  215. package/dist/components/Select/useTriggerWidth.js +27 -0
  216. package/dist/components/Select/useTriggerWidth.js.map +1 -0
  217. package/dist/components/Slider/index.js +139 -0
  218. package/dist/components/Slider/index.js.map +1 -0
  219. package/dist/components/Slider/styles.js +2 -0
  220. package/dist/components/Slider/styles.js.map +1 -0
  221. package/dist/components/Slider/types.js +2 -0
  222. package/dist/components/Slider/types.js.map +1 -0
  223. package/dist/components/Switch/index.js +48 -0
  224. package/dist/components/Switch/index.js.map +1 -0
  225. package/dist/components/Switch/styles.js +2 -0
  226. package/dist/components/Switch/styles.js.map +1 -0
  227. package/dist/components/Switch/types.js +2 -0
  228. package/dist/components/Switch/types.js.map +1 -0
  229. package/dist/components/Tag/index.js +53 -0
  230. package/dist/components/Tag/index.js.map +1 -0
  231. package/dist/components/Tag/styles.js +2 -0
  232. package/dist/components/Tag/styles.js.map +1 -0
  233. package/dist/components/Tag/types.js +2 -0
  234. package/dist/components/Tag/types.js.map +1 -0
  235. package/dist/components/Text/index.js +94 -0
  236. package/dist/components/Text/index.js.map +1 -0
  237. package/dist/components/Text/styles.js +2 -0
  238. package/dist/components/Text/styles.js.map +1 -0
  239. package/dist/components/Text/types.js +2 -0
  240. package/dist/components/Text/types.js.map +1 -0
  241. package/dist/components/TextEditor/index.js +90 -0
  242. package/dist/components/TextEditor/index.js.map +1 -0
  243. package/dist/components/TextEditor/styles.js +2 -0
  244. package/dist/components/TextEditor/styles.js.map +1 -0
  245. package/dist/components/TextEditor/types.js +2 -0
  246. package/dist/components/TextEditor/types.js.map +1 -0
  247. package/dist/components/TextInput/index.js +65 -0
  248. package/dist/components/TextInput/index.js.map +1 -0
  249. package/dist/components/TextInput/styles.js +2 -0
  250. package/dist/components/TextInput/styles.js.map +1 -0
  251. package/dist/components/TextInput/types.js +2 -0
  252. package/dist/components/TextInput/types.js.map +1 -0
  253. package/dist/components/TextInput/useTextInput.js +64 -0
  254. package/dist/components/TextInput/useTextInput.js.map +1 -0
  255. package/dist/components/Tooltip/index.js +94 -0
  256. package/dist/components/Tooltip/index.js.map +1 -0
  257. package/dist/components/Tooltip/styles.js +2 -0
  258. package/dist/components/Tooltip/styles.js.map +1 -0
  259. package/dist/components/Tooltip/types.js +2 -0
  260. package/dist/components/Tooltip/types.js.map +1 -0
  261. package/dist/components/Touchable/index.js +80 -0
  262. package/dist/components/Touchable/index.js.map +1 -0
  263. package/dist/components/Touchable/styles.js +2 -0
  264. package/dist/components/Touchable/styles.js.map +1 -0
  265. package/dist/components/Touchable/types.js +2 -0
  266. package/dist/components/Touchable/types.js.map +1 -0
  267. package/dist/components/View/index.js +39 -0
  268. package/dist/components/View/index.js.map +1 -0
  269. package/dist/components/View/styles.js +2 -0
  270. package/dist/components/View/styles.js.map +1 -0
  271. package/dist/components/View/types.js +2 -0
  272. package/dist/components/View/types.js.map +1 -0
  273. package/dist/components/components.js +42 -0
  274. package/dist/components/components.js.map +1 -0
  275. package/dist/index.js +5 -0
  276. package/dist/index.js.map +1 -0
  277. package/dist/lib/ListMasonry.js +86 -0
  278. package/dist/lib/ListMasonry.js.map +1 -0
  279. package/dist/lib/ThemeVariables.js +22 -0
  280. package/dist/lib/ThemeVariables.js.map +1 -0
  281. package/dist/lib/WebStyleRegistry.js +69 -0
  282. package/dist/lib/WebStyleRegistry.js.map +1 -0
  283. package/dist/lib/hooks/index.js +23 -0
  284. package/dist/lib/hooks/index.js.map +1 -0
  285. package/dist/lib/hooks/useAnimatedStyle.js +23 -0
  286. package/dist/lib/hooks/useAnimatedStyle.js.map +1 -0
  287. package/dist/lib/hooks/useAnimatedVariantStyles.js +20 -0
  288. package/dist/lib/hooks/useAnimatedVariantStyles.js.map +1 -0
  289. package/dist/lib/hooks/useAsyncSelect.js +57 -0
  290. package/dist/lib/hooks/useAsyncSelect.js.map +1 -0
  291. package/dist/lib/hooks/useBreakpointMatch.js +108 -0
  292. package/dist/lib/hooks/useBreakpointMatch.js.map +1 -0
  293. package/dist/lib/hooks/useClick.js +38 -0
  294. package/dist/lib/hooks/useClick.js.map +1 -0
  295. package/dist/lib/hooks/useClickOutside.js +31 -0
  296. package/dist/lib/hooks/useClickOutside.js.map +1 -0
  297. package/dist/lib/hooks/useFileInput.js +17 -0
  298. package/dist/lib/hooks/useFileInput.js.map +1 -0
  299. package/dist/lib/hooks/useIsomorphicEffect.js +7 -0
  300. package/dist/lib/hooks/useIsomorphicEffect.js.map +1 -0
  301. package/dist/lib/hooks/useKeydown.js +39 -0
  302. package/dist/lib/hooks/useKeydown.js.map +1 -0
  303. package/dist/lib/hooks/useListFocus.js +46 -0
  304. package/dist/lib/hooks/useListFocus.js.map +1 -0
  305. package/dist/lib/hooks/useMediaQuery.js +25 -0
  306. package/dist/lib/hooks/useMediaQuery.js.map +1 -0
  307. package/dist/lib/hooks/usePageExitBlocker.js +44 -0
  308. package/dist/lib/hooks/usePageExitBlocker.js.map +1 -0
  309. package/dist/lib/hooks/usePagination.js +90 -0
  310. package/dist/lib/hooks/usePagination.js.map +1 -0
  311. package/dist/lib/hooks/usePopState.js +31 -0
  312. package/dist/lib/hooks/usePopState.js.map +1 -0
  313. package/dist/lib/hooks/usePopoverDismiss.js +32 -0
  314. package/dist/lib/hooks/usePopoverDismiss.js.map +1 -0
  315. package/dist/lib/hooks/useRefresh.js +67 -0
  316. package/dist/lib/hooks/useRefresh.js.map +1 -0
  317. package/dist/lib/hooks/useScrollEffect.js +19 -0
  318. package/dist/lib/hooks/useScrollEffect.js.map +1 -0
  319. package/dist/lib/hooks/useSearchParams.js +48 -0
  320. package/dist/lib/hooks/useSearchParams.js.map +1 -0
  321. package/dist/lib/hooks/useStaticAnimationStyles.js +16 -0
  322. package/dist/lib/hooks/useStaticAnimationStyles.js.map +1 -0
  323. package/dist/lib/hooks/useStylesFor.js +36 -0
  324. package/dist/lib/hooks/useStylesFor.js.map +1 -0
  325. package/dist/lib/hooks/useTouchableEvents.js +34 -0
  326. package/dist/lib/hooks/useTouchableEvents.js.map +1 -0
  327. package/dist/lib/hooks/useWindowFocus.js +30 -0
  328. package/dist/lib/hooks/useWindowFocus.js.map +1 -0
  329. package/dist/lib/hooks/useWindowSize.js +29 -0
  330. package/dist/lib/hooks/useWindowSize.js.map +1 -0
  331. package/dist/lib/index.js +7 -0
  332. package/dist/lib/index.js.map +1 -0
  333. package/dist/lib/tools/index.js +4 -0
  334. package/dist/lib/tools/index.js.map +1 -0
  335. package/dist/lib/tools/localStorage.js +155 -0
  336. package/dist/lib/tools/localStorage.js.map +1 -0
  337. package/dist/lib/tools/mediaQuery.js +33 -0
  338. package/dist/lib/tools/mediaQuery.js.map +1 -0
  339. package/dist/lib/tools/modal.js +55 -0
  340. package/dist/lib/tools/modal.js.map +1 -0
  341. package/dist/lib/utils/attributes.js +23 -0
  342. package/dist/lib/utils/attributes.js.map +1 -0
  343. package/dist/lib/utils/cache.js +10 -0
  344. package/dist/lib/utils/cache.js.map +1 -0
  345. package/dist/lib/utils/index.js +6 -0
  346. package/dist/lib/utils/index.js.map +1 -0
  347. package/dist/lib/utils/pollyfils/scroll.js +66 -0
  348. package/dist/lib/utils/pollyfils/scroll.js.map +1 -0
  349. package/dist/lib/utils/stopPropagation.js +19 -0
  350. package/dist/lib/utils/stopPropagation.js.map +1 -0
  351. package/dist/lib/utils/test.js +14 -0
  352. package/dist/lib/utils/test.js.map +1 -0
  353. package/dist/types/index.js +2 -0
  354. package/dist/types/index.js.map +1 -0
  355. package/dist/types/utility.js +2 -0
  356. package/dist/types/utility.js.map +1 -0
  357. package/package.json +18 -18
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/components/Dropzone/elements.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAAE,IAAI,EAAa,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAO9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACpE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAC/C,OAAO,CACL,MAAC,IAAI,OAAM,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAyB,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,aACrF,QAAQ,EACT,mBAAY,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAkC,GAAI,IAC1E,CACR,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE;IACpE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAE/C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY;QAAE,OAAO,IAAI,CAAA;IAE9C,OAAO,CACL,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,OAAO,YACzB,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,YAAY,YAC7B,QAAQ,GACJ,GACF,CACR,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,EAAE,QAAQ,EAAkC,EAAE,EAAE;IACxF,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAE/C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY;QAAE,OAAO,IAAI,CAAA;IAC9C,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO,IAAI,CAAA;IAEhD,oGAAoG;IACpG,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAA;IAElE,OAAO,YAAY,CACjB,KAAC,IAAI,OAAM,SAAgC,EAAE,KAAK,EAAE,MAAM,CAAC,iBAAiB,YAC1E,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,sBAAsB,YACvC,QAAQ,GACJ,GACF,EACP,QAAQ,CAAC,IAAI,CACd,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,71 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { useImperativeHandle, useRef } from 'react';
3
+ import { View } from '../View';
4
+ import { Icon } from '../Icon';
5
+ import { useStylesFor } from '../../lib/hooks/useStylesFor';
6
+ import { WebStyleRegistry } from '../../lib/WebStyleRegistry';
7
+ import { DropzoneProvider } from './context';
8
+ import { DropzoneWrapper, DropzoneOverlay, DropzoneFullscreenOverlay } from './elements';
9
+ import { useDropzone } from './useDropzone';
10
+ import { useDropzoneContext } from './context';
11
+ export * from './styles';
12
+ export * from './types';
13
+ export * from './context';
14
+ export * from './elements';
15
+ export * from './useDropzone';
16
+ /**
17
+ * Drag-and-drop file upload zone. Stateless — use the `onDrop` callback to
18
+ * receive dropped files and manage your own file state.
19
+ *
20
+ * Assign `Dropzone.Default` to replace the built-in empty-state UI.
21
+ * Augment `DropzonePropsAugmentation` to add app-specific props that flow
22
+ * through to `Dropzone.Default` via context.
23
+ *
24
+ * For custom layouts compose the primitives directly:
25
+ * `Dropzone.Provider` + `Dropzone.Wrapper` + `Dropzone.Overlay` + `Dropzone.FullscreenOverlay`.
26
+ */
27
+ export const Dropzone = (props) => {
28
+ const merged = {
29
+ ...Dropzone.defaultProps,
30
+ ...props,
31
+ };
32
+ const { icon, children, style, ref, ...dropzoneOptions } = merged;
33
+ const handle = useDropzone(dropzoneOptions);
34
+ const styles = useStylesFor(Dropzone.styleRegistryName, style);
35
+ const handleRef = useRef(handle);
36
+ handleRef.current = handle;
37
+ useImperativeHandle(ref, () => ({
38
+ open: () => handleRef.current.dropzone.open(),
39
+ }));
40
+ const extensionProps = merged;
41
+ return (_jsx(View, { style: styles.wrapper, children: _jsx(DropzoneProvider, { handle: handle, style: style, extensionProps: extensionProps, children: _jsxs(DropzoneWrapper, { children: [Dropzone.Default ? (_jsx(Dropzone.Default, {})) : (_jsx(_Fragment, { children: icon ? (_jsx(View, { style: styles.iconWrapper, children: _jsx(Icon, { debugName: 'Dropzone:Icon', icon: icon, style: styles.icon }) })) : null })), children] }) }) }));
42
+ };
43
+ Dropzone.styleRegistryName = 'Dropzone';
44
+ Dropzone.elements = [
45
+ 'wrapper',
46
+ 'dropzone',
47
+ 'overlay',
48
+ 'overlayInner',
49
+ 'fullscreenOverlay',
50
+ 'fullscreenOverlayInner',
51
+ 'icon',
52
+ 'iconWrapper',
53
+ 'title',
54
+ 'placeholder',
55
+ ];
56
+ Dropzone.rootElement = 'wrapper';
57
+ Dropzone.withVariantTypes = (styles) => {
58
+ return Dropzone;
59
+ };
60
+ Dropzone.defaultProps = {
61
+ icon: 'file-plus',
62
+ multiple: false,
63
+ };
64
+ Dropzone.Provider = DropzoneProvider;
65
+ Dropzone.Wrapper = DropzoneWrapper;
66
+ Dropzone.Overlay = DropzoneOverlay;
67
+ Dropzone.FullscreenOverlay = DropzoneFullscreenOverlay;
68
+ Dropzone.useContext = useDropzoneContext;
69
+ Dropzone.Default = null;
70
+ WebStyleRegistry.registerComponent(Dropzone);
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Dropzone/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,IAAI,EAAa,MAAM,SAAS,CAAA;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAE9C,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAE7B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC/C,MAAM,MAAM,GAAG;QACb,GAAG,QAAQ,CAAC,YAAY;QACxB,GAAG,KAAK;KACT,CAAA;IAED,MAAM,EACJ,IAAI,EAEJ,QAAQ,EACR,K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xB,MAAM;IACN,aAAa;IACb,OAAO;IACP,aAAa;CACd,CAAA;AAED,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAA;AAEhC,QAAQ,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IAC7D,OAAO,QAA+E,CAAA;AACxF,CAAC,CAAA;AAED,QAAQ,CAAC,YAAY,GAAG;IACtB,IAAI,EAAE,WAAsB;IAC5B,QAAQ,EAAE,KAAK;CACU,CAAA;AAE3B,QAAQ,CAAC,QAAQ,GAAG,gBAAgB,CAAA;AACpC,QAAQ,CAAC,OAAO,GAAG,eAAe,CAAA;AAClC,QAAQ,CAAC,OAAO,GAAG,eAAe,CAAA;AAClC,QAAQ,CAAC,iBAAiB,GAAG,yBAAyB,CAAA;AACtD,QAAQ,CAAC,UAAU,GAAG,kBAAkB,CAAA;AACxC,QAAQ,CAAC,OAAO,GAAG,IAAkC,CAAA;AAErD,gBAAgB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Dropzone/styles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Dropzone/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { useDropzone as useReactDropzone } from 'react-dropzone';
2
+ /**
3
+ * Creates a `DropzoneHandle` — the service object that owns drag-and-drop
4
+ * mechanics. The returned `dropzone` field is the full react-dropzone state
5
+ * pass-through (`getRootProps`, `getInputProps`, `open`, `isDragActive`,
6
+ * `isDragAccept`, `isDragReject`, `isDragGlobal`, etc.).
7
+ *
8
+ * Pass the handle to `Dropzone.Provider` to wire it into the component tree,
9
+ * or use it directly when you need access to the drag state outside JSX.
10
+ * File management is the caller's responsibility — use the `onDrop` callback
11
+ * to receive accepted and rejected files.
12
+ */
13
+ export function useDropzone(options = {}) {
14
+ const dropzone = useReactDropzone(options);
15
+ return { dropzone };
16
+ }
17
+ //# sourceMappingURL=useDropzone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDropzone.js","sourceRoot":"","sources":["../../../src/components/Dropzone/useDropzone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGhE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,UAA8B,EAAE;IAC1D,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAC1C,OAAO,EAAE,QAAQ,EAAE,CAAA;AACrB,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import React from 'react';
3
+ import { Icon } from '../Icon';
4
+ import { View } from '../View';
5
+ import { Text } from '../Text';
6
+ import { ActivityIndicator } from '../ActivityIndicator';
7
+ import { TypeGuards } from '@codeleap/types';
8
+ import { useStylesFor } from '../../lib/hooks/useStylesFor';
9
+ import { WebStyleRegistry } from '../../lib/WebStyleRegistry';
10
+ import { useNestedStylesByKey } from '@codeleap/styles';
11
+ export * from './styles';
12
+ export * from './types';
13
+ /**
14
+ * Communicates an empty or loading state for a content region with an optional icon/image, title, and description.
15
+ * When `loading` is `true`, replaces all content with an `ActivityIndicator`; when `renderEmpty` is provided, it takes over the entire content layout.
16
+ * Uses: `Icon`, `Text`, `ActivityIndicator`
17
+ */
18
+ export const EmptyPlaceholder = (props) => {
19
+ const { itemName, title, loading, description, style, icon: IconEmpty, renderEmpty: RenderEmpty, image, imageProps, wrapperProps, imageWrapperProps, indicatorProps, debugName, ImageComponent, } = {
20
+ ...EmptyPlaceholder.defaultProps,
21
+ ...props,
22
+ };
23
+ const styles = useStylesFor(EmptyPlaceholder.styleRegistryName, style);
24
+ const emptyText = title || (itemName && `No ${itemName} found.`) || 'No items.';
25
+ const activityIndicatorStyles = useNestedStylesByKey('loader', styles);
26
+ const _Image = React.useMemo(() => {
27
+ if (!TypeGuards.isNil(image)) {
28
+ return _jsx(ImageComponent, { ...imageProps,
29
+ // @ts-ignore
30
+ source: image, css: styles.image });
31
+ }
32
+ if (TypeGuards.isNil(IconEmpty))
33
+ return null;
34
+ if (TypeGuards.isString(IconEmpty)) {
35
+ return _jsx(Icon, { debugName: debugName, icon: IconEmpty, forceStyle: styles.icon });
36
+ }
37
+ else if (React.isValidElement(IconEmpty)) {
38
+ return _jsx(IconEmpty, { ...props });
39
+ }
40
+ }, [IconEmpty, image]);
41
+ if (loading) {
42
+ return (_jsx(View, { style: [styles.wrapper, styles['wrapper:loading']], children: _jsx(ActivityIndicator, { debugName: debugName, ...indicatorProps, style: activityIndicatorStyles }) }));
43
+ }
44
+ if (!TypeGuards.isNil(RenderEmpty)) {
45
+ return (_jsx(View, { ...wrapperProps, style: styles.wrapper, children: _jsx(RenderEmpty, { emptyText: emptyText, emptyIconName: IconEmpty, styles: {
46
+ ...styles,
47
+ activityIndicatorStyles,
48
+ } }) }));
49
+ }
50
+ return (_jsxs(View, { ...wrapperProps, style: styles.wrapper, children: [_jsx(View, { ...imageWrapperProps, style: styles.imageWrapper, children: _Image }), TypeGuards.isString(emptyText)
51
+ ? _jsx(Text, { debugName: debugName, text: emptyText, style: styles.title })
52
+ : React.isValidElement(emptyText) ? emptyText : null, TypeGuards.isString(description)
53
+ ? _jsx(Text, { debugName: debugName, text: description, style: styles.description })
54
+ : React.isValidElement(description) ? description : null] }));
55
+ };
56
+ EmptyPlaceholder.styleRegistryName = 'EmptyPlaceholder';
57
+ EmptyPlaceholder.elements = ['wrapper', 'loader', 'title', 'description', 'image', 'imageWrapper', 'icon'];
58
+ EmptyPlaceholder.rootElement = 'wrapper';
59
+ EmptyPlaceholder.ImageComponent = 'img';
60
+ EmptyPlaceholder.withVariantTypes = (styles) => {
61
+ return EmptyPlaceholder;
62
+ };
63
+ EmptyPlaceholder.defaultProps = {};
64
+ WebStyleRegistry.registerComponent(EmptyPlaceholder);
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/EmptyPlaceholder/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAkD,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAEvG,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;IAC/D,MAAM,EACJ,QAAQ,EACR,KAAK,EACL,OAAO,EACP,WAAW,EACX,KAAK,EACL,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,WAAW,EACxB,KAAK,EACL,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,cAAc,GACf,GAAG;QACF,GAAG,gBAAgB,CAAC,YAAY;QAChC,GAAG,KAAK;KACT,CAAA;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;IAEtE,MAAM,SAAS,GAAG,KAAK,IAAI,CAAC,QAAQ,IAAI,MAAM,QAAQ,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A;AACxG,CAAC,CAAA;AAED,gBAAgB,CAAC,YAAY,GAAG,EAAoC,CAAA;AAEpE,gBAAgB,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/EmptyPlaceholder/styles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/EmptyPlaceholder/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { createContext, useContext, useId } from 'react';
3
+ import { useStylesFor } from '../../lib';
4
+ /** Derives stable ARIA `label` and `helper` element IDs from a base field ID. */
5
+ export const getFieldIds = (baseId) => ({
6
+ label: baseId + '-label',
7
+ helper: baseId + '-helper',
8
+ });
9
+ const useFieldContextProvider = (props) => {
10
+ const generatedId = useId();
11
+ const baseId = props.id ?? generatedId;
12
+ const { label: labelId, helper: helperId } = getFieldIds(baseId);
13
+ const stateContext = {
14
+ disabled: props.context?.disabled,
15
+ error: props.context?.error,
16
+ focused: props.context?.focused,
17
+ hasValue: props.context?.hasValue,
18
+ };
19
+ const styles = useStylesFor('Field', props?.style, stateContext);
20
+ const getClassName = (...suffixes) => {
21
+ const getClasses = (basename) => suffixes.map(s => `${basename}__${s}`).join(' ');
22
+ let classes = getClasses('field');
23
+ if (props?.componentName) {
24
+ classes += ` ${getClasses(props.componentName)}`;
25
+ }
26
+ return classes;
27
+ };
28
+ return {
29
+ props,
30
+ styles,
31
+ stateContext,
32
+ getClassName,
33
+ labelId,
34
+ helperId,
35
+ };
36
+ };
37
+ const FieldContext = createContext({});
38
+ /**
39
+ * Context provider for `Field`; computes styles and state data from `FieldProps`
40
+ * and makes them available to all `Field.*` sub-elements.
41
+ * Must wrap any composition that uses `useFieldContext`.
42
+ */
43
+ export const FieldProvider = ({ children, ...props }) => {
44
+ const value = useFieldContextProvider(props);
45
+ return _jsx(FieldContext.Provider, { value: value, children: children });
46
+ };
47
+ /**
48
+ * Reads the nearest `FieldProvider` context.
49
+ * Must be called inside a component rendered within `FieldProvider`.
50
+ */
51
+ export const useFieldContext = () => useContext(FieldContext);
52
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/Field/context.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAGxC,iFAAiF;AACjF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC;IAC9C,KAAK,EAAE,MAAM,GAAG,QAAQ;IACxB,MAAM,EAAE,MAAM,GAAG,SAAS;CAC3B,CAAC,CAAA;AAEF,MAAM,uBAAuB,GAAG,CAAC,KAAiB,EAAE,EAAE;IACpD,MAAM,WAAW,GAAG,KAAK,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,EAAE,IAAI,WAAW,CAAA;IACtC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;IAEhE,MAAM,YAAY,GAAqB;QACrC,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ;QACjC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK;QAC3B,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO;QAC/B,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ;KAClC,CAAA;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAA;IAEhE,MAAM,YAAY,GAAG,CAAC,GAAG,QAAkB,EAAE,EAAE;QAC7C,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEjF,IAAI,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;QAEjC,IAAI,KAAK,EAAE,aAAa,EAAE,CAAC;YACzB,OAAO,IAAI,IAAI,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAA;QAClD,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC,CAAA;IACD,OAAO;QACL,KAAK;QACL,MAAM;QACN,YAAY;QACZ,YAAY;QACZ,OAAO;QACP,QAAQ;KACT,CAAA;AACH,CAAC,CAAA;AAGD,MAAM,YAAY,GAAG,aAAa,CAAC,EAAmB,CAAC,CAAA;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAsC,EAAE,EAAE;IAC1F,MAAM,KAAK,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;IAC5C,OAAO,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACvC,QAAQ,GACa,CAAA;AAC1B,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA"}
@@ -0,0 +1,84 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { TypeGuards } from '@codeleap/types';
3
+ import { Text } from '../Text';
4
+ import { View } from '../View';
5
+ import { useFieldContext } from './context';
6
+ import { toDataAttrs } from '../../lib';
7
+ import { Touchable } from '../Touchable';
8
+ /**
9
+ * Renders the field label linked to the input via `aria-labelledby`.
10
+ * Reads content from `FieldProvider` context; renders nothing when no label is present.
11
+ * Must be inside `FieldProvider`.
12
+ */
13
+ export const FieldHeading = (props) => {
14
+ const ctx = useFieldContext();
15
+ const label = props?.children ?? ctx?.props?.label;
16
+ if (!label && !props.component)
17
+ return null;
18
+ const Component = props?.component ?? Text;
19
+ return _jsx(Component, { id: ctx.labelId, component: 'label', ref: props.ref, style: [ctx?.styles?.heading, props?.style], className: ctx.getClassName('heading'), children: label });
20
+ };
21
+ /**
22
+ * Renders the field helper/description text.
23
+ * Reads content from `FieldProvider` context; renders nothing when no helper is present.
24
+ * Must be inside `FieldProvider`.
25
+ */
26
+ export const FieldHelper = (props) => {
27
+ const ctx = useFieldContext();
28
+ const label = props?.children ?? ctx?.props?.helper;
29
+ if (!label && !props.component)
30
+ return null;
31
+ const Component = props?.component ?? Text.Span;
32
+ return _jsx(Component, { id: ctx.helperId, ref: props.ref, style: [ctx?.styles?.helper, props?.style], className: ctx.getClassName('helper'), children: label });
33
+ };
34
+ /**
35
+ * Input container row that receives state `data-*` attributes from context;
36
+ * renders as `Touchable` when `onPress` is provided, otherwise as `View`.
37
+ * Must be inside `FieldProvider`.
38
+ * Uses: `View`, `Touchable`
39
+ */
40
+ export const FieldBox = ({ component = View, style, ref, children, onPress, ...rest }) => {
41
+ const ctx = useFieldContext();
42
+ const attrs = toDataAttrs(ctx.stateContext);
43
+ if (onPress) {
44
+ return (_jsx(Touchable, { debugName: 'field-box', css: [ctx?.styles?.box, style], onPress: onPress, className: ctx.getClassName('box'), ...attrs, ...rest, ref: ref ?? ctx?.props?.boxRef, children: children }));
45
+ }
46
+ return (_jsx(View, { css: [ctx?.styles?.box, style], className: ctx.getClassName('box'), ...attrs, ...rest, ref: ref ?? ctx?.props?.boxRef, children: children }));
47
+ };
48
+ /**
49
+ * Outermost container for the full field layout; forwards state `data-*`
50
+ * attributes and resolves the `wrapperRef` from context.
51
+ * Must be inside `FieldProvider`.
52
+ */
53
+ export const FieldWrapper = (props) => {
54
+ const ctx = useFieldContext();
55
+ const Component = props?.component ?? View;
56
+ const attrs = toDataAttrs(ctx.stateContext);
57
+ return _jsx(Component, { ref: props.ref ?? ctx?.props?.wrapperRef, style: [ctx.styles.wrapper, props?.style], ...attrs, className: ctx.getClassName('wrapper'), children: props?.children });
58
+ };
59
+ /**
60
+ * Renders either the `leftSection` or `rightSection` prop from `FieldProvider`
61
+ * context; supports static ReactNode and render-function forms.
62
+ * Must be inside `FieldProvider`.
63
+ */
64
+ export const SectionSlot = (props) => {
65
+ const ctx = useFieldContext();
66
+ const sectionProp = props?.position === 'left' ? ctx.props.leftSection : ctx.props.rightSection;
67
+ const style = props.position === 'left' ? ctx.styles.leftSection : ctx.styles.rightSection;
68
+ let Component = null;
69
+ if (props?.component) {
70
+ Component = props?.component;
71
+ }
72
+ else if (TypeGuards.isFunction(sectionProp)) {
73
+ Component = sectionProp;
74
+ }
75
+ else {
76
+ if (!sectionProp)
77
+ return null;
78
+ return _jsx(View, { style: [ctx.styles.section, style], className: ctx.getClassName('section', `${props.position}_section`), children: sectionProp });
79
+ }
80
+ const attrs = toDataAttrs(ctx.stateContext);
81
+ const Render = Component;
82
+ return _jsx(Render, { ...attrs, "data-section-position": props.position, style: [ctx.styles.section, style], className: ctx.getClassName('section', `${props.position}_section`) });
83
+ };
84
+ //# sourceMappingURL=elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/components/Field/elements.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAG3C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,SAAS,EAA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C,YAClH,WAAW,GACP,CAAA;IACT,CAAC;IAGD,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAC3C,MAAM,MAAM,GAAG,SAAqC,CAAA;IAEpD,OAAO,KAAC,MAAM,OACR,KAAK,2BACc,KAAK,CAAC,QAAQ,EACrC,KAAK,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAClC,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC,QAAQ,UAAU,CAAC,GACnE,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { FieldProvider, getFieldIds } from './context';
3
+ import { FieldBox, FieldHeading, FieldHelper, FieldWrapper, SectionSlot } from './elements';
4
+ import { WebStyleRegistry } from '../../lib';
5
+ /**
6
+ * Form field layout shell that composes a label, input box, helper text, and
7
+ * left/right section slots around any input child; distributes state (disabled,
8
+ * error, focused, hasValue) via context to all sub-elements.
9
+ * Exposes: `Field.Wrapper`, `Field.Box`, `Field.Heading`, `Field.Helper`,
10
+ * `Field.SectionSlot`, `Field.Provider`, `Field.getIds`.
11
+ * Uses: `FieldProvider`, `FieldWrapper`, `FieldHeading`, `FieldBox`, `FieldHelper`,
12
+ * `SectionSlot`, `WebStyleRegistry`
13
+ */
14
+ export const Field = (props) => {
15
+ return _jsx(FieldProvider, { ...props, children: _jsxs(FieldWrapper, { children: [_jsx(FieldHeading, {}), _jsxs(FieldBox, { children: [_jsx(SectionSlot, { position: 'left' }), props?.children, _jsx(SectionSlot, { position: 'right' })] }), _jsx(FieldHelper, {})] }) });
16
+ };
17
+ Field.withVariantTypes = (styles) => {
18
+ return Field;
19
+ };
20
+ Field.styleRegistryName = 'Field';
21
+ Field.rootElement = 'wrapper';
22
+ Field.elements = [
23
+ 'wrapper', 'box', 'heading', 'helper', 'section', 'leftSection', 'rightSection',
24
+ ];
25
+ Field.SectionSlot = SectionSlot;
26
+ Field.Box = FieldBox;
27
+ Field.Wrapper = FieldWrapper;
28
+ Field.Heading = FieldHeading;
29
+ Field.Helper = FieldHelper;
30
+ Field.Provider = FieldProvider;
31
+ Field.getIds = getFieldIds;
32
+ WebStyleRegistry.registerComponent(Field);
33
+ export * from './context';
34
+ export * from './styles';
35
+ export * from './types';
36
+ export * from './useFieldInput';
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Field/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAA0C,EAAE,EAAE;IAElE,OAAO,KAAC,aAAa,OAAK,KAAK,YAC7B,MAAC,YAAY,eACX,KAAC,YAAY,KAAG,EAChB,MAAC,QAAQ,eACP,KAAC,WAAW,IAAC,QAAQ,EAAC,MAAM,GAAE,EAC7B,KAAK,EAAE,QAAQ,EAChB,KAAC,WAAW,IAAC,QAAQ,EAAC,OAAO,GAAE,IACtB,EACX,KAAC,WAAW,KAAG,IACF,GACD,CAAA;AAClB,CAAC,CAAA;AAED,KAAK,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IAC1D,OAAO,KAAyE,CAAA;AAClF,CAAC,CAAA;AAED,KAAK,CAAC,iBAAiB,GAAG,OAAO,CAAA;AACjC,KAAK,CAAC,WAAW,GAAG,SAAS,CAAA;AAC7B,KAAK,CAAC,QAAQ,GAAG;IACf,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc;CAChF,CAAA;AAED,KAAK,CAAC,WAAW,GAAG,WAAW,CAAA;AAC/B,KAAK,CAAC,GAAG,GAAG,QAAQ,CAAA;AACpB,KAAK,CAAC,OAAO,GAAG,YAAY,CAAA;AAC5B,KAAK,CAAC,OAAO,GAAG,YAAY,CAAA;AAC5B,KAAK,CAAC,MAAM,GAAG,WAAW,CAAA;AAC1B,KAAK,CAAC,QAAQ,GAAG,aAAa,CAAA;AAC9B,KAAK,CAAC,MAAM,GAAG,WAAW,CAAA;AAE1B,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;AAEzC,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Field/styles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Field/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import { useMemo, useRef } from 'react';
2
+ import { fields, useField } from '@codeleap/form';
3
+ import { TypeGuards } from '@codeleap/types';
4
+ /**
5
+ * Bridges a `@codeleap/form` `Field` instance with an input element's DOM ref,
6
+ * or falls back to uncontrolled internal state when `onValueChange` and `value`
7
+ * are both provided.
8
+ *
9
+ * When a `field` instance is used, the hook registers blur/focus/getValue
10
+ * callbacks so the form layer can drive the input programmatically.
11
+ *
12
+ * Requires a `@codeleap/form` `Field` instance; does not need a React context.
13
+ */
14
+ export function useFieldInput(field, defaultField = fields.text, internalState, params = {}, deps = []) {
15
+ const { value, onValueChange } = internalState;
16
+ const hasInternalState = useMemo(() => TypeGuards.isFunction(onValueChange) && !TypeGuards.isNil(value), []);
17
+ const wrapperRef = useRef(undefined);
18
+ const innerInputRef = useRef(null);
19
+ const fieldHandle = hasInternalState ? {} : useField(field, [
20
+ {
21
+ blur() {
22
+ innerInputRef.current.blur();
23
+ },
24
+ focus() {
25
+ innerInputRef.current.focus();
26
+ },
27
+ getValue() {
28
+ return innerInputRef.current.value;
29
+ },
30
+ scrollIntoView() {
31
+ return;
32
+ },
33
+ ...params,
34
+ },
35
+ deps
36
+ ], defaultField);
37
+ const validation = fieldHandle?.validation;
38
+ return {
39
+ fieldHandle,
40
+ validation,
41
+ wrapperRef,
42
+ innerInputRef,
43
+ inputValue: (hasInternalState ? value : fieldHandle?.value),
44
+ onInputValueChange: hasInternalState ? onValueChange : fieldHandle?.setValue,
45
+ };
46
+ }
47
+ //# sourceMappingURL=useFieldInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFieldInput.js","sourceRoot":"","sources":["../../../src/components/Field/useFieldInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAoB,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAa,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEvD;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAQ,EACR,eAA2C,MAAM,CAAC,IAAe,EACjE,aAA8D,EAC9D,SAAgC,EAAE,EAClC,OAAc,EAAE;IAEhB,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,aAAa,CAAA;IAE9C,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAA;IAE5G,MAAM,UAAU,GAAG,MAAM,CAAiB,SAAS,CAAC,CAAA;IAEpD,MAAM,aAAa,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAA;IAEpD,MAAM,WAAW,GAAG,gBAAgB,CAAC,CAAC,CAAC,EAA0C,CAAC,CAAC,CAAC,QAAQ,CAAO,KAAU,EAAE;QAC7G;YACE,IAAI;gBACF,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;YAC9B,CAAC;YACD,KAAK;gBACH,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;YAC/B,CAAC;YACD,QAAQ;gBACN,OAAO,aAAa,CAAC,OAAO,CAAC,KAAU,CAAA;YACzC,CAAC;YACD,cAAc;gBACZ,OAAM;YACR,CAAC;YACD,GAAG,MAAM;SACV;QACD,IAAI;KAC8B,EAAE,YAAY,CAAC,CAAA;IAEnD,MAAM,UAAU,GAAG,WAAW,EAAE,UAAU,CAAA;IAE1C,OAAO;QACL,WAAW;QACX,UAAU;QACV,UAAU;QACV,aAAa;QACb,UAAU,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,CAAM;QAChE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,EAAE,QAAQ;KAC7E,CAAA;AACH,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { useImperativeHandle, useRef } from 'react';
3
+ import { TypeGuards } from '@codeleap/types';
4
+ import { useCallback } from '@codeleap/hooks';
5
+ export * from './types';
6
+ /**
7
+ * Invisible file-input that delegates file selection to the browser's native picker, exposed imperatively via `ref`.
8
+ * Renders a zero-size hidden `<input type="file">` — pair with a visible trigger that calls `ref.current.openFilePicker()`.
9
+ * Uses: `FileInputRef`
10
+ */
11
+ export const FileInput = (props) => {
12
+ const inputRef = useRef(null);
13
+ const { onFileSelect, autoClear, onChange, ref, ...inputProps } = {
14
+ ...FileInput.defaultProps,
15
+ ...props,
16
+ };
17
+ const resolveWithFile = useRef(undefined);
18
+ const clearInput = useCallback(() => {
19
+ if (!inputRef.current)
20
+ return;
21
+ inputRef.current.value = null;
22
+ }, []);
23
+ useImperativeHandle(ref, () => ({
24
+ openFilePicker: () => {
25
+ inputRef.current.click();
26
+ return new Promise((resolve) => {
27
+ resolveWithFile.current = resolve;
28
+ });
29
+ },
30
+ clear: clearInput,
31
+ }));
32
+ async function handleChange(e) {
33
+ if (!e.target.files.length)
34
+ return;
35
+ if (TypeGuards.isFunction(onChange))
36
+ onChange(e);
37
+ const fileArray = Array.from(e.target?.files || []);
38
+ const files = fileArray.map((obj) => ({
39
+ file: obj,
40
+ preview: URL.createObjectURL(obj),
41
+ }));
42
+ onFileSelect && onFileSelect(files);
43
+ if (resolveWithFile.current) {
44
+ await resolveWithFile.current(files);
45
+ resolveWithFile.current = undefined;
46
+ }
47
+ if (autoClear)
48
+ clearInput();
49
+ }
50
+ return (_jsx("input", { type: 'file', style: { visibility: 'hidden', width: 0, height: 0, opacity: 0, display: 'none' }, ...inputProps, ref: inputRef, onChange: handleChange }));
51
+ };
52
+ FileInput.defaultProps = {
53
+ autoClear: true,
54
+ };
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FileInput/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAgB,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG7C,cAAc,SAAS,CAAA;AAEvB;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IACjD,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAA;IAE/C,MAAM,EACJ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,EACH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,MAAM,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;YACpC,eAAe,CAAC,OAAO,GAAG,SAAS,CAAA;QACrC,CAAC;QAED,IAAI,SAAS;YAAE,UAAU,EAAE,CAAA;IAC7B,CAAC;IAED,OAAO,CACL,gBACE,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAC7E,UAAU,EACd,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,YAAY,GACtB,CACH,CAAA;AACH,CAAC,CAAA;AAED,SAAS,CAAC,YAAY,GAAG;IACvB,SAAS,EAAE,IAAI;CACW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/FileInput/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { View } from '../View';
3
+ import { useStylesFor } from '../../lib/hooks/useStylesFor';
4
+ import { useTheme } from '@codeleap/styles';
5
+ import { WebStyleRegistry } from '../../lib/WebStyleRegistry';
6
+ import { TypeGuards } from '@codeleap/types';
7
+ import { Touchable } from '../Touchable';
8
+ export * from './styles';
9
+ export * from './types';
10
+ /**
11
+ * Renders a theme-registered SVG icon; automatically wraps in `Touchable` when
12
+ * `onPress` is provided, and can render a sized empty placeholder when `icon` is absent.
13
+ * Uses: `Touchable`, `View`, `useStylesFor`, `WebStyleRegistry`
14
+ */
15
+ export const Icon = (props) => {
16
+ const { icon, style, onPress, renderEmptySpace, debugName, ...otherProps } = {
17
+ ...Icon.defaultProps,
18
+ ...props,
19
+ };
20
+ const themeIcons = useTheme(store => store.theme?.icons);
21
+ const styles = useStylesFor(Icon.styleRegistryName, style);
22
+ const Component = themeIcons?.[icon];
23
+ if (!icon) {
24
+ const iconStyle = styles.icon;
25
+ return renderEmptySpace ? (_jsx(View, { style: {
26
+ height: iconStyle.size ?? iconStyle.height,
27
+ width: iconStyle.size ?? iconStyle.width,
28
+ } })) : null;
29
+ }
30
+ if (!Component)
31
+ return null;
32
+ if (TypeGuards.isFunction(onPress)) {
33
+ return _jsx(Touchable, { debugName: debugName, component: Component, onPress: onPress, ...otherProps, css: styles.icon });
34
+ }
35
+ return _jsx(Component, { ...otherProps, css: styles.icon });
36
+ };
37
+ Icon.Accessory = (props) => {
38
+ const AcessoryIcon = (renderProps) => {
39
+ return _jsx(Icon, { ...renderProps, ...props });
40
+ };
41
+ return AcessoryIcon;
42
+ };
43
+ Icon.styleRegistryName = 'Icon';
44
+ Icon.elements = ['icon'];
45
+ Icon.rootElement = 'icon';
46
+ Icon.withVariantTypes = (styles) => {
47
+ return Icon;
48
+ };
49
+ Icon.defaultProps = {};
50
+ WebStyleRegistry.registerComponent(Icon);
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Icon/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAkD,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,KAAe,EAAE,EAAE;IACtC,MAAM,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,g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AC,CAAA;IACD,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AAED,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAA;AAC/B,IAAI,CAAC,QAAQ,GAAG,CAAC,MAAM,CAAC,CAAA;AACxB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;AAEzB,IAAI,CAAC,gBAAgB,GAAG,CAAsB,MAAS,EAAE,EAAE;IACzD,OAAO,IAAuE,CAAA;AAChF,CAAC,CAAA;AAED,IAAI,CAAC,YAAY,GAAG,EAAwB,CAAA;AAE5C,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Icon/styles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Icon/types.ts"],"names":[],"mappings":""}