@neko-os/ui 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/README.md +0 -76
  2. package/dist/DynamicStyleTag.js +18 -2
  3. package/dist/DynamicStyleTag.native.js +3 -1
  4. package/dist/NekoUI.js +39 -1
  5. package/dist/abstractions/ActivityIndicator.js +19 -1
  6. package/dist/abstractions/ActivityIndicator.native.js +43 -1
  7. package/dist/abstractions/ActivityIndicator.web.js +43 -1
  8. package/dist/abstractions/AnimatedView.js +3 -1
  9. package/dist/abstractions/AnimatedView.native.js +5 -1
  10. package/dist/abstractions/AnimatedView.web.js +3 -1
  11. package/dist/abstractions/BlurView.js +43 -1
  12. package/dist/abstractions/BlurView.native.js +39 -1
  13. package/dist/abstractions/BlurView.web.js +39 -1
  14. package/dist/abstractions/DraggableSlideView.js +3 -1
  15. package/dist/abstractions/DraggableSlideView.native.js +62 -1
  16. package/dist/abstractions/FlatList.js +3 -1
  17. package/dist/abstractions/FlatList.native.js +37 -1
  18. package/dist/abstractions/FlatList.web.js +3 -1
  19. package/dist/abstractions/GradientView.js +5 -1
  20. package/dist/abstractions/GradientView.native.js +32 -1
  21. package/dist/abstractions/HiddenInput.js +3 -1
  22. package/dist/abstractions/HiddenInput.native.js +3 -1
  23. package/dist/abstractions/Icon.js +10 -1
  24. package/dist/abstractions/Icon.native.js +13 -1
  25. package/dist/abstractions/Icon.web.js +11 -1
  26. package/dist/abstractions/Image.js +12 -1
  27. package/dist/abstractions/Image.native.js +7 -1
  28. package/dist/abstractions/Image.web.js +7 -1
  29. package/dist/abstractions/ImageBackground.js +17 -1
  30. package/dist/abstractions/ImageBackground.native.js +27 -1
  31. package/dist/abstractions/ImageBackground.web.js +7 -1
  32. package/dist/abstractions/KeyboardAvoidingView.js +3 -1
  33. package/dist/abstractions/KeyboardAvoidingView.native.js +3 -1
  34. package/dist/abstractions/Platform.js +1 -1
  35. package/dist/abstractions/Platform.native.js +3 -1
  36. package/dist/abstractions/Platform.web.js +3 -1
  37. package/dist/abstractions/Pressable.js +4 -1
  38. package/dist/abstractions/Pressable.native.js +3 -1
  39. package/dist/abstractions/Pressable.web.js +3 -1
  40. package/dist/abstractions/SafeAreaView.js +3 -1
  41. package/dist/abstractions/SafeAreaView.native.js +3 -1
  42. package/dist/abstractions/ScrollView.js +3 -1
  43. package/dist/abstractions/ScrollView.native.js +5 -1
  44. package/dist/abstractions/ScrollView.web.js +3 -1
  45. package/dist/abstractions/StaticList.js +51 -1
  46. package/dist/abstractions/Switch.js +97 -1
  47. package/dist/abstractions/Switch.native.js +12 -1
  48. package/dist/abstractions/Table.js +29 -1
  49. package/dist/abstractions/Table.native.js +19 -1
  50. package/dist/abstractions/Text.js +14 -1
  51. package/dist/abstractions/Text.native.js +3 -1
  52. package/dist/abstractions/Text.web.js +18 -1
  53. package/dist/abstractions/TextInput.js +12 -1
  54. package/dist/abstractions/TextInput.native.js +5 -1
  55. package/dist/abstractions/TextInput.web.js +5 -1
  56. package/dist/abstractions/TouchableOpacity.js +4 -1
  57. package/dist/abstractions/TouchableOpacity.native.js +3 -1
  58. package/dist/abstractions/View.js +3 -1
  59. package/dist/abstractions/View.native.js +3 -1
  60. package/dist/abstractions/View.web.js +3 -1
  61. package/dist/abstractions/helpers/componentSize.js +13 -1
  62. package/dist/abstractions/helpers/componentSize.native.js +12 -1
  63. package/dist/abstractions/helpers/storage.js +32 -1
  64. package/dist/abstractions/helpers/storage.native.js +34 -1
  65. package/dist/abstractions/helpers/transformStyle.js +8 -1
  66. package/dist/abstractions/helpers/transformStyle.native.js +3 -1
  67. package/dist/abstractions/helpers/useSafeAreaInsets.js +3 -1
  68. package/dist/abstractions/helpers/useSafeAreaInsets.native.js +3 -1
  69. package/dist/abstractions/helpers/windowWidth.js +13 -1
  70. package/dist/abstractions/helpers/windowWidth.native.js +6 -1
  71. package/dist/abstractions/helpers/windowWidth.web.js +6 -1
  72. package/dist/components/actions/ActionsDrawer.js +81 -1
  73. package/dist/components/actions/Breadcrumb.js +47 -1
  74. package/dist/components/actions/Button.js +82 -1
  75. package/dist/components/actions/Dropdown.js +91 -1
  76. package/dist/components/actions/FloatingButton.js +87 -1
  77. package/dist/components/actions/FloatingMenu.js +39 -1
  78. package/dist/components/actions/Link.js +66 -1
  79. package/dist/components/actions/Pressable.js +38 -1
  80. package/dist/components/actions/index.js +9 -1
  81. package/dist/components/actions/menu/HorizontalMenu.js +98 -1
  82. package/dist/components/actions/menu/Menu.js +7 -1
  83. package/dist/components/actions/menu/SubmenuWrapper.js +16 -1
  84. package/dist/components/actions/menu/VerticalMenu.js +133 -1
  85. package/dist/components/animations/AnimatedTopBar.js +10 -1
  86. package/dist/components/animations/AnimatedTopBar.native.js +34 -1
  87. package/dist/components/animations/AnimatedTopBar.web.js +1 -1
  88. package/dist/components/animations/AnimatedView.js +45 -1
  89. package/dist/components/animations/DraggableSlideView.js +42 -1
  90. package/dist/components/animations/ParallaxHeader.js +9 -1
  91. package/dist/components/animations/ParallaxHeader.native.js +32 -1
  92. package/dist/components/animations/ParallaxHeader.web.js +32 -1
  93. package/dist/components/animations/ReanimatedScrollHandler.js +8 -1
  94. package/dist/components/animations/ReanimatedScrollHandler.native.js +24 -1
  95. package/dist/components/animations/ReanimatedScrollHandler.web.js +1 -1
  96. package/dist/components/animations/ReanimatedView.js +40 -1
  97. package/dist/components/animations/index.js +5 -1
  98. package/dist/components/calendar/CalendarNav.js +67 -1
  99. package/dist/components/calendar/WeekDaysBar.js +18 -1
  100. package/dist/components/calendar/_helpers/calendarDays.js +16 -1
  101. package/dist/components/calendar/_helpers/dateDisabled.js +24 -1
  102. package/dist/components/feedback/alerter.js +31 -1
  103. package/dist/components/feedback/confirmer.js +70 -1
  104. package/dist/components/feedback/index.js +3 -1
  105. package/dist/components/feedback/notifications/Notification.js +37 -1
  106. package/dist/components/feedback/notifications/NotificationsHandler.js +65 -1
  107. package/dist/components/filter/DateFilter.js +72 -0
  108. package/dist/components/filter/FilterGroup.js +17 -0
  109. package/dist/components/filter/FilterHandler.js +54 -0
  110. package/dist/components/filter/FilterItem.js +30 -0
  111. package/dist/components/filter/PopoverFilterItem.js +84 -0
  112. package/dist/components/filter/SearchInput.js +49 -0
  113. package/dist/components/filter/index.js +6 -0
  114. package/dist/components/form/Form.js +31 -1
  115. package/dist/components/form/FormGroup.js +21 -1
  116. package/dist/components/form/FormItem.js +118 -1
  117. package/dist/components/form/FormList.js +143 -1
  118. package/dist/components/form/FormWrapperComponent.js +52 -1
  119. package/dist/components/form/FormWrapperComponent.native.js +5 -1
  120. package/dist/components/form/SubmitButton.js +22 -1
  121. package/dist/components/form/index.js +9 -1
  122. package/dist/components/form/useNewForm.js +211 -1
  123. package/dist/components/form/useWatch.js +70 -1
  124. package/dist/components/form/validation/defaultMessages.js +20 -1
  125. package/dist/components/form/validation/index.js +5 -1
  126. package/dist/components/form/validation/normalizeRules.js +22 -1
  127. package/dist/components/form/validation/shouldValidateOn.js +21 -1
  128. package/dist/components/form/validation/validateRules.js +83 -1
  129. package/dist/components/form/validation/validators.js +82 -1
  130. package/dist/components/helpers/ConditionalLazyRender.js +6 -1
  131. package/dist/components/helpers/LazyAction.js +22 -1
  132. package/dist/components/helpers/LazyRender.js +55 -1
  133. package/dist/components/helpers/LazyRender.native.js +58 -1
  134. package/dist/components/helpers/Portal.js +21 -1
  135. package/dist/components/helpers/PortalHandler.js +32 -1
  136. package/dist/components/helpers/Responsive.js +18 -1
  137. package/dist/components/helpers/Separator.js +49 -1
  138. package/dist/components/helpers/VerticalView.js +34 -1
  139. package/dist/components/helpers/index.js +8 -1
  140. package/dist/components/index.js +20 -1
  141. package/dist/components/inputs/BooleanSelect.js +14 -0
  142. package/dist/components/inputs/Checkbox.js +56 -1
  143. package/dist/components/inputs/DateInput.js +123 -1
  144. package/dist/components/inputs/DateRangeInput.js +41 -0
  145. package/dist/components/inputs/Editable.js +129 -0
  146. package/dist/components/inputs/EnabledSelect.js +14 -0
  147. package/dist/components/inputs/InputWrapper.js +93 -1
  148. package/dist/components/inputs/LinkInput.js +17 -1
  149. package/dist/components/inputs/MaskInput.js +67 -1
  150. package/dist/components/inputs/NumberInput.js +111 -1
  151. package/dist/components/inputs/NumberRangeInput.js +41 -0
  152. package/dist/components/inputs/PasswordInput.js +24 -0
  153. package/dist/components/inputs/Picker.js +169 -1
  154. package/dist/components/inputs/Radio.js +55 -1
  155. package/dist/components/inputs/RateInput.js +62 -1
  156. package/dist/components/inputs/SegmentedPicker.js +62 -1
  157. package/dist/components/inputs/Select.js +219 -1
  158. package/dist/components/inputs/Switch.js +60 -1
  159. package/dist/components/inputs/TextArea.js +5 -0
  160. package/dist/components/inputs/TextInput.js +32 -1
  161. package/dist/components/inputs/UploadInput.js +140 -0
  162. package/dist/components/inputs/_DateInput.native.js +89 -1
  163. package/dist/components/inputs/datePicker/DatePicker.js +24 -1
  164. package/dist/components/inputs/datePicker/DayPicker.js +64 -1
  165. package/dist/components/inputs/datePicker/MonthPicker.js +62 -1
  166. package/dist/components/inputs/datePicker/QuarterPicker.js +65 -1
  167. package/dist/components/inputs/datePicker/WeekPicker.js +74 -1
  168. package/dist/components/inputs/datePicker/YearPicker.js +70 -1
  169. package/dist/components/inputs/index.js +23 -1
  170. package/dist/components/inputs/upload/Upload.js +99 -0
  171. package/dist/components/inputs/upload/Upload.native.js +154 -0
  172. package/dist/components/inputs/upload/useUploadState.js +143 -0
  173. package/dist/components/layout/Layout.js +40 -1
  174. package/dist/components/layout/LayoutContent.js +42 -1
  175. package/dist/components/layout/LayoutHeader.js +70 -1
  176. package/dist/components/layout/LayoutSider.js +64 -1
  177. package/dist/components/layout/index.js +4 -1
  178. package/dist/components/list/FlatList.js +91 -1
  179. package/dist/components/list/ScrollView.js +58 -1
  180. package/dist/components/list/index.js +2 -1
  181. package/dist/components/modals/bottomDrawer/index.js +3 -1
  182. package/dist/components/modals/bottomDrawer/index.native.js +5 -1
  183. package/dist/components/modals/bottomDrawer/index.web.js +5 -1
  184. package/dist/components/modals/bottomDrawer/native/BottomDrawer.js +239 -1
  185. package/dist/components/modals/bottomDrawer/native/DrawerContext.js +17 -1
  186. package/dist/components/modals/bottomDrawer/native/DrawerHandle.js +12 -1
  187. package/dist/components/modals/bottomDrawer/native/DrawerScrollView.js +5 -1
  188. package/dist/components/modals/bottomDrawer/native/createDrawerScrollComponent.js +139 -1
  189. package/dist/components/modals/bottomDrawer/native/utils.js +65 -1
  190. package/dist/components/modals/bottomDrawer/web/BottomDrawer.js +5 -1
  191. package/dist/components/modals/drawer/Drawer.js +5 -1
  192. package/dist/components/modals/drawer/Drawer.native.js +3 -1
  193. package/dist/components/modals/drawer/Drawer.web.js +3 -1
  194. package/dist/components/modals/drawer/index.js +1 -1
  195. package/dist/components/modals/index.js +4 -1
  196. package/dist/components/modals/modal/Modal.js +84 -1
  197. package/dist/components/modals/modal/Modal.native.js +83 -1
  198. package/dist/components/modals/modal/ModalBackdrop.js +58 -1
  199. package/dist/components/modals/modal/ModalContent.js +28 -1
  200. package/dist/components/modals/modal/ModalFooter.js +31 -1
  201. package/dist/components/modals/modal/ModalHeader.js +50 -1
  202. package/dist/components/modals/modal/handler/ModalsHandler.js +61 -1
  203. package/dist/components/modals/modal/index.js +6 -1
  204. package/dist/components/modals/router/ModalRoute.js +15 -1
  205. package/dist/components/modals/router/ModalsRouter.js +120 -1
  206. package/dist/components/modals/router/ModalsRouterContext.js +16 -1
  207. package/dist/components/modals/router/index.js +6 -1
  208. package/dist/components/modals/router/useAllModalsParams.js +6 -1
  209. package/dist/components/modals/router/useModalParams.js +6 -1
  210. package/dist/components/modals/router/useModalsNavigation.js +6 -1
  211. package/dist/components/modals/router/useUpdateModalContainer.js +6 -1
  212. package/dist/components/presentation/Avatar.js +79 -1
  213. package/dist/components/presentation/AvatarLabel.js +60 -1
  214. package/dist/components/presentation/AvatarsGroup.js +30 -0
  215. package/dist/components/presentation/Badge.js +91 -1
  216. package/dist/components/presentation/ContentLabel.js +43 -1
  217. package/dist/components/presentation/Icon.js +20 -1
  218. package/dist/components/presentation/IconLabel.js +40 -1
  219. package/dist/components/presentation/Image.js +33 -1
  220. package/dist/components/presentation/ImageBackground.js +38 -1
  221. package/dist/components/presentation/LabelValue.js +51 -1
  222. package/dist/components/presentation/Progress.js +20 -0
  223. package/dist/components/presentation/Rate.js +58 -1
  224. package/dist/components/presentation/RateTag.js +35 -1
  225. package/dist/components/presentation/Result.js +60 -1
  226. package/dist/components/presentation/ResultBar.js +56 -1
  227. package/dist/components/presentation/Tag.js +69 -1
  228. package/dist/components/presentation/Tooltip.js +44 -1
  229. package/dist/components/presentation/index.js +16 -1
  230. package/dist/components/sections/Section.js +50 -1
  231. package/dist/components/sections/SectionItem.js +24 -1
  232. package/dist/components/sections/SectionItemDropdown.js +68 -1
  233. package/dist/components/sections/SectionItemLink.js +35 -1
  234. package/dist/components/sections/index.js +4 -1
  235. package/dist/components/state/Loading.js +20 -1
  236. package/dist/components/state/LoadingView.js +37 -1
  237. package/dist/components/state/StatePresenter.js +41 -1
  238. package/dist/components/state/index.js +3 -1
  239. package/dist/components/steps/ActiveStepContent.js +16 -0
  240. package/dist/components/steps/StepsHandler.js +53 -0
  241. package/dist/components/steps/StepsMenu.js +14 -0
  242. package/dist/components/steps/StepsNavigation.js +37 -0
  243. package/dist/components/steps/index.js +4 -0
  244. package/dist/components/structure/Accordion.js +69 -1
  245. package/dist/components/structure/AccordionGroup.js +35 -1
  246. package/dist/components/structure/Affix.js +34 -0
  247. package/dist/components/structure/Affix.native.js +3 -0
  248. package/dist/components/structure/BlurView.js +59 -1
  249. package/dist/components/structure/Card.js +46 -1
  250. package/dist/components/structure/Col.js +22 -1
  251. package/dist/components/structure/GradientView.js +42 -1
  252. package/dist/components/structure/KeyboardAvoidingView.js +52 -1
  253. package/dist/components/structure/Row.js +50 -1
  254. package/dist/components/structure/SafeAreaView.js +42 -1
  255. package/dist/components/structure/Segment.js +51 -1
  256. package/dist/components/structure/TopBar.js +57 -1
  257. package/dist/components/structure/View.js +44 -1
  258. package/dist/components/structure/index.js +14 -1
  259. package/dist/components/structure/overlay/OverlayHandler.js +83 -1
  260. package/dist/components/structure/overlay/OverlayHandler.native.js +6 -1
  261. package/dist/components/structure/overlay/OverlayWrapper.js +52 -1
  262. package/dist/components/structure/overlay/calculatePosition.js +29 -1
  263. package/dist/components/structure/overlay/smartPlacement.js +32 -1
  264. package/dist/components/structure/popover/Popover.js +135 -1
  265. package/dist/components/structure/popover/Popover.native.js +105 -1
  266. package/dist/components/structure/popover/PopoverContent.js +18 -1
  267. package/dist/components/structure/popover/Popover_BU.js +157 -1
  268. package/dist/components/table/DataTable.js +62 -1
  269. package/dist/components/table/Pagination.js +128 -1
  270. package/dist/components/table/Table.js +66 -1
  271. package/dist/components/table/TableCol.js +67 -1
  272. package/dist/components/table/TableHeader.js +69 -1
  273. package/dist/components/table/TableHeaderRow.js +31 -1
  274. package/dist/components/table/TableRow.js +30 -1
  275. package/dist/components/table/index.js +7 -1
  276. package/dist/components/tabs/ActiveTabContent.js +38 -1
  277. package/dist/components/tabs/TabsHandler.js +16 -1
  278. package/dist/components/tabs/TabsMenu.js +15 -1
  279. package/dist/components/tabs/index.js +3 -1
  280. package/dist/components/text/DateText.js +24 -1
  281. package/dist/components/text/Text.js +32 -1
  282. package/dist/components/text/VerticalText.js +29 -1
  283. package/dist/components/text/index.js +3 -1
  284. package/dist/components/theme/ThemePicker.js +48 -1
  285. package/dist/components/theme/ThemePickerDrawer.js +12 -1
  286. package/dist/components/theme/ThemeStatusBar.js +3 -1
  287. package/dist/components/theme/ThemeStatusBar.native.js +9 -1
  288. package/dist/components/theme/ThemeThumb.js +98 -1
  289. package/dist/components/theme/index.js +3 -1
  290. package/dist/helpers/debounce.js +9 -1
  291. package/dist/helpers/index.js +5 -1
  292. package/dist/helpers/options.js +65 -1
  293. package/dist/helpers/random.js +5 -1
  294. package/dist/helpers/storage.js +76 -1
  295. package/dist/helpers/string.js +74 -1
  296. package/dist/i18n/I18n.js +96 -1
  297. package/dist/i18n/I18nProvider.js +40 -1
  298. package/dist/i18n/index.js +2 -1
  299. package/dist/index.js +8 -1
  300. package/dist/modifiers/_helpers.js +6 -1
  301. package/dist/modifiers/alignConverter.js +11 -1
  302. package/dist/modifiers/animation.js +18 -1
  303. package/dist/modifiers/animations/animatedEffects.js +64 -1
  304. package/dist/modifiers/animations/animatedEffects.native.js +55 -1
  305. package/dist/modifiers/animations/animatedEffects.web.js +55 -1
  306. package/dist/modifiers/animations/fadeEffect.js +46 -1
  307. package/dist/modifiers/animations/fadeEffect.native.js +33 -1
  308. package/dist/modifiers/animations/fadeEffect.web.js +3 -1
  309. package/dist/modifiers/animations/scaleEffect.js +46 -1
  310. package/dist/modifiers/animations/scaleEffect.native.js +33 -1
  311. package/dist/modifiers/animations/scrollEffect.web.js +3 -1
  312. package/dist/modifiers/animations/slideEffect.js +64 -1
  313. package/dist/modifiers/animations/slideEffect.native.js +53 -1
  314. package/dist/modifiers/animations/slideEffect.web.js +3 -1
  315. package/dist/modifiers/applyStyles.js +7 -1
  316. package/dist/modifiers/background.js +34 -1
  317. package/dist/modifiers/border.js +86 -1
  318. package/dist/modifiers/colorConverter.js +13 -1
  319. package/dist/modifiers/cursor.js +21 -1
  320. package/dist/modifiers/default.js +9 -1
  321. package/dist/modifiers/display.js +22 -1
  322. package/dist/modifiers/flex.js +20 -1
  323. package/dist/modifiers/flexWrapper.js +87 -1
  324. package/dist/modifiers/fullColor.js +32 -1
  325. package/dist/modifiers/grid.js +27 -1
  326. package/dist/modifiers/hover.js +28 -1
  327. package/dist/modifiers/logger.js +6 -1
  328. package/dist/modifiers/margin.js +25 -1
  329. package/dist/modifiers/overflow.js +28 -1
  330. package/dist/modifiers/padding.js +25 -1
  331. package/dist/modifiers/position.js +57 -1
  332. package/dist/modifiers/responsiveConverter.js +19 -1
  333. package/dist/modifiers/shadow.js +35 -1
  334. package/dist/modifiers/size.js +59 -1
  335. package/dist/modifiers/sizeConverter.js +12 -1
  336. package/dist/modifiers/state.js +33 -1
  337. package/dist/modifiers/text.js +62 -1
  338. package/dist/modifiers/textConverter.js +12 -1
  339. package/dist/modifiers/themeComponent.js +11 -1
  340. package/dist/responsive/ResponsiveHandler.js +28 -1
  341. package/dist/responsive/index.js +2 -1
  342. package/dist/responsive/responsiveHooks.js +67 -1
  343. package/dist/theme/ThemeHandler.js +81 -1
  344. package/dist/theme/default/base.js +95 -1
  345. package/dist/theme/default/blackTheme.js +47 -1
  346. package/dist/theme/default/cyberpunkTheme.js +36 -1
  347. package/dist/theme/default/darkTheme.js +35 -1
  348. package/dist/theme/default/hackerTheme.js +55 -1
  349. package/dist/theme/default/lightTheme.js +35 -1
  350. package/dist/theme/default/paperTheme.js +36 -1
  351. package/dist/theme/default/themes.js +15 -1
  352. package/dist/theme/format/colorsVariations.js +31 -1
  353. package/dist/theme/format/formatTheme.js +28 -1
  354. package/dist/theme/helpers/colorScale.js +12 -1
  355. package/dist/theme/helpers/contrastColor.js +18 -1
  356. package/dist/theme/helpers/dynamicColor.js +32 -1
  357. package/dist/theme/helpers/mergePreset.js +7 -1
  358. package/dist/theme/helpers/relatedScales.js +34 -1
  359. package/dist/theme/helpers/sizeScale.js +20 -1
  360. package/dist/theme/helpers/textScale.js +15 -1
  361. package/dist/theme/index.js +2 -1
  362. package/package.json +1 -3
  363. package/src/abstractions/Icon.js +1 -1
  364. package/src/abstractions/TextInput.js +10 -1
  365. package/src/components/actions/ActionsDrawer.js +17 -4
  366. package/src/components/actions/Button.js +5 -1
  367. package/src/components/actions/FloatingMenu.js +1 -1
  368. package/src/components/actions/menu/HorizontalMenu.js +2 -1
  369. package/src/components/actions/menu/VerticalMenu.js +2 -1
  370. package/src/components/filter/DateFilter.js +72 -0
  371. package/src/components/filter/FilterGroup.js +17 -0
  372. package/src/components/filter/FilterHandler.js +54 -0
  373. package/src/components/filter/FilterItem.js +30 -0
  374. package/src/components/filter/PopoverFilterItem.js +84 -0
  375. package/src/components/filter/SearchInput.js +49 -0
  376. package/src/components/filter/index.js +6 -0
  377. package/src/components/form/Form.js +9 -3
  378. package/src/components/form/FormItem.js +26 -1
  379. package/src/components/form/FormWrapperComponent.js +12 -3
  380. package/src/components/form/useNewForm.js +55 -4
  381. package/src/components/helpers/Separator.js +15 -11
  382. package/src/components/helpers/index.js +1 -0
  383. package/src/components/index.js +2 -0
  384. package/src/components/inputs/BooleanSelect.js +14 -0
  385. package/src/components/inputs/DateInput.js +3 -1
  386. package/src/components/inputs/DateRangeInput.js +41 -0
  387. package/src/components/inputs/Editable.js +129 -0
  388. package/src/components/inputs/EnabledSelect.js +14 -0
  389. package/src/components/inputs/InputWrapper.js +7 -4
  390. package/src/components/inputs/NumberInput.js +10 -5
  391. package/src/components/inputs/NumberRangeInput.js +41 -0
  392. package/src/components/inputs/PasswordInput.js +24 -0
  393. package/src/components/inputs/Picker.js +2 -2
  394. package/src/components/inputs/Select.js +61 -47
  395. package/src/components/inputs/TextArea.js +5 -0
  396. package/src/components/inputs/TextInput.js +14 -4
  397. package/src/components/inputs/UploadInput.js +140 -0
  398. package/src/components/inputs/index.js +9 -0
  399. package/src/components/inputs/upload/Upload.js +99 -0
  400. package/src/components/inputs/upload/Upload.native.js +154 -0
  401. package/src/components/inputs/upload/useUploadState.js +143 -0
  402. package/src/components/layout/LayoutHeader.js +1 -0
  403. package/src/components/presentation/AvatarLabel.js +1 -1
  404. package/src/components/presentation/AvatarsGroup.js +30 -0
  405. package/src/components/presentation/Badge.js +3 -2
  406. package/src/components/presentation/ContentLabel.js +1 -1
  407. package/src/components/presentation/IconLabel.js +1 -0
  408. package/src/components/presentation/Progress.js +20 -0
  409. package/src/components/presentation/index.js +2 -0
  410. package/src/components/sections/Section.js +1 -1
  411. package/src/components/sections/SectionItemLink.js +4 -2
  412. package/src/components/steps/ActiveStepContent.js +16 -0
  413. package/src/components/steps/StepsHandler.js +53 -0
  414. package/src/components/steps/StepsMenu.js +14 -0
  415. package/src/components/steps/StepsNavigation.js +37 -0
  416. package/src/components/steps/index.js +4 -0
  417. package/src/components/structure/Affix.js +34 -0
  418. package/src/components/structure/Affix.native.js +3 -0
  419. package/src/components/structure/Card.js +1 -0
  420. package/src/components/structure/TopBar.js +14 -2
  421. package/src/components/structure/index.js +1 -0
  422. package/src/components/structure/overlay/OverlayHandler.js +9 -1
  423. package/src/components/structure/popover/Popover.js +22 -5
  424. package/src/components/table/DataTable.js +7 -2
  425. package/src/components/table/Table.js +2 -1
  426. package/src/components/tabs/ActiveTabContent.js +4 -1
  427. package/src/components/text/DateText.js +15 -2
  428. package/src/modifiers/border.js +15 -9
  429. package/src/modifiers/fullColor.js +2 -2
  430. package/src/modifiers/size.js +8 -5
  431. package/src/theme/default/base.js +2 -0
  432. package/src/theme/default/hackerTheme.js +1 -10
  433. package/src/theme/default/paperTheme.js +1 -14
  434. package/src/theme/format/colorsVariations.js +1 -1
  435. package/src/theme/helpers/colorScale.js +2 -1
@@ -1 +1,70 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["width","cancelLabel","confirmLabel","onConfirm"];var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/confirmer.js";import{is}from'ramda';import React from'react';import{Button}from"../actions";import{RESULT_TYPES}from"../presentation/Result";import{Result}from"../presentation";import{View}from"../structure/View";import{useModalOpener}from"../modals/modal";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function Footer(_ref){var _RESULT_TYPES$type;var cancelLabel=_ref.cancelLabel,confirmLabel=_ref.confirmLabel,onConfirm=_ref.onConfirm,type=_ref.type,onClose=_ref.onClose;var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),loading=_React$useState2[0],setLoading=_React$useState2[1];var color=((_RESULT_TYPES$type=RESULT_TYPES[type])==null?void 0:_RESULT_TYPES$type.color)||'primary';return _jsxs(View,{row:true,gap:"xs",centerV:true,children:[_jsx(Button,{sm:true,label:cancelLabel||'Cancel',outline:true,color:"text_op40",onPress:onClose,flex:true,disabled:loading}),_jsx(Button,{disabled:loading,loading:loading,sm:true,label:confirmLabel||'Confirm',color:color,onPress:function onPress(){setLoading(true);Promise.resolve(onConfirm==null?void 0:onConfirm()).then(function(result){if(result!==false){onClose();}}).finally(function(){setLoading(false);});},flex:true})]});}export function useConfirmer(){var _this=this;var _useModalOpener=useModalOpener(),open=_useModalOpener.open;var confirm=function confirm(data,type){var _ref2=data||{},width=_ref2.width,cancelLabel=_ref2.cancelLabel,confirmLabel=_ref2.confirmLabel,onConfirm=_ref2.onConfirm,resultProps=_objectWithoutProperties(_ref2,_excluded);open(function(_ref3){var onClose=_ref3.onClose;return{content:_jsx(Result,Object.assign({},resultProps,{type:type,padding:0,paddingT:"lg",paddingB:"sm"})),footer:_jsx(Footer,{cancelLabel:cancelLabel,confirmLabel:confirmLabel,onConfirm:onConfirm,type:type,onClose:onClose}),footerProps:{borderT:false,paddingV:'md'},width:width||350};});};return{confirm:confirm,info:function info(data){return confirm(data,'info');},error:function error(data){return confirm(data,'error');},warning:function warning(data){return confirm(data,'warning');},success:function success(data){return confirm(data,'success');}};}
1
+ var _excluded = ["width", "cancelLabel", "confirmLabel", "onConfirm"];var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/confirmer.js";function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import { is } from 'ramda';
2
+ import React from 'react';
3
+
4
+ import { Button } from "../actions";
5
+ import { RESULT_TYPES } from "../presentation/Result";
6
+ import { Result } from "../presentation";
7
+ import { View } from "../structure/View";
8
+ import { useModalOpener } from "../modals/modal";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+
10
+ function Footer(_ref) {var _RESULT_TYPES$type;var cancelLabel = _ref.cancelLabel,confirmLabel = _ref.confirmLabel,onConfirm = _ref.onConfirm,type = _ref.type,onClose = _ref.onClose;
11
+ var _React$useState = React.useState(false),_React$useState2 = _slicedToArray(_React$useState, 2),loading = _React$useState2[0],setLoading = _React$useState2[1];
12
+ var color = ((_RESULT_TYPES$type = RESULT_TYPES[type]) == null ? void 0 : _RESULT_TYPES$type.color) || 'primary';
13
+
14
+ return (
15
+ _jsxs(View, { row: true, gap: "xs", centerV: true, children: [
16
+ _jsx(Button, { sm: true, label: cancelLabel || 'Cancel', outline: true, color: "text_op40", onPress: onClose, flex: true, disabled: loading }),
17
+ _jsx(Button, {
18
+ disabled: loading,
19
+ loading: loading,
20
+ sm: true,
21
+ label: confirmLabel || 'Confirm',
22
+ color: color,
23
+ onPress: function onPress() {
24
+ setLoading(true);
25
+ Promise.resolve(onConfirm == null ? void 0 : onConfirm()).
26
+ then(function (result) {
27
+ if (result !== false) {
28
+ onClose();
29
+ }
30
+ }).
31
+ finally(function () {
32
+ setLoading(false);
33
+ });
34
+ },
35
+ flex: true }
36
+ )] }
37
+ ));
38
+
39
+ }
40
+
41
+ export function useConfirmer() {var _this = this;
42
+ var _useModalOpener = useModalOpener(),open = _useModalOpener.open;
43
+
44
+ var confirm = function confirm(data, type) {
45
+ var _ref2 = data || {},width = _ref2.width,cancelLabel = _ref2.cancelLabel,confirmLabel = _ref2.confirmLabel,onConfirm = _ref2.onConfirm,resultProps = _objectWithoutProperties(_ref2, _excluded);
46
+
47
+ open(function (_ref3) {var onClose = _ref3.onClose;return {
48
+ content: _jsx(Result, Object.assign({}, resultProps, { type: type, padding: 0, paddingT: "lg", paddingB: "sm" })),
49
+ footer:
50
+ _jsx(Footer, {
51
+ cancelLabel: cancelLabel,
52
+ confirmLabel: confirmLabel,
53
+ onConfirm: onConfirm,
54
+ type: type,
55
+ onClose: onClose }
56
+ ),
57
+
58
+ footerProps: { borderT: false, paddingV: 'md' },
59
+ width: width || 350
60
+ };});
61
+ };
62
+
63
+ return {
64
+ confirm: confirm,
65
+ info: function info(data) {return confirm(data, 'info');},
66
+ error: function error(data) {return confirm(data, 'error');},
67
+ warning: function warning(data) {return confirm(data, 'warning');},
68
+ success: function success(data) {return confirm(data, 'success');}
69
+ };
70
+ }
@@ -1 +1,3 @@
1
- export*from"./notifications/NotificationsHandler";export*from"./alerter";export*from"./confirmer";
1
+ export * from "./notifications/NotificationsHandler";
2
+ export * from "./alerter";
3
+ export * from "./confirmer";
@@ -1 +1,37 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/notifications/Notification.js";var _excluded=["time"];import React from'react';import{AnimatedView}from"../../animations/AnimatedView";import{Icon}from"../../presentation/Icon";import{Link}from"../../actions/Link";import{ResultBar}from"../../presentation/ResultBar";import{jsx as _jsx}from"react/jsx-runtime";export function Notification(_ref){var time=_ref.time,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(true),_React$useState2=_slicedToArray(_React$useState,2),open=_React$useState2[0],setOpen=_React$useState2[1];React.useEffect(function(){setTimeout(function(){return setOpen(false);},time-500);},[]);return _jsx(AnimatedView,{open:open,className:"neko-notification",slide:{from:'right'},fade:true,zIndex:520,maxWidth:"100%",bg:"overlayBG",br:"sm",unmountOnClose:true,children:_jsx(ResultBar,Object.assign({},props,{rightContent:_jsx(Link,{onPress:function onPress(){return setOpen(false);},children:_jsx(Icon,{name:"close-line",text4:true})})}))});}
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/notifications/Notification.js";var _excluded = ["time"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React from 'react';
2
+
3
+ import { AnimatedView } from "../../animations/AnimatedView";
4
+ import { Icon } from "../../presentation/Icon";
5
+ import { Link } from "../../actions/Link";
6
+ import { ResultBar } from "../../presentation/ResultBar";import { jsx as _jsx } from "react/jsx-runtime";
7
+
8
+ export function Notification(_ref) {var time = _ref.time,props = _objectWithoutProperties(_ref, _excluded);
9
+ var _React$useState = React.useState(true),_React$useState2 = _slicedToArray(_React$useState, 2),open = _React$useState2[0],setOpen = _React$useState2[1];
10
+
11
+ React.useEffect(function () {
12
+ setTimeout(function () {return setOpen(false);}, time - 500);
13
+ }, []);
14
+
15
+ return (
16
+ _jsx(AnimatedView, {
17
+ open: open,
18
+ className: "neko-notification",
19
+ slide: { from: 'right' },
20
+ fade: true,
21
+ zIndex: 520,
22
+ maxWidth: "100%",
23
+ bg: "overlayBG",
24
+ br: "sm",
25
+ unmountOnClose: true, children:
26
+
27
+ _jsx(ResultBar, Object.assign({},
28
+ props, {
29
+ rightContent:
30
+ _jsx(Link, { onPress: function onPress() {return setOpen(false);}, children:
31
+ _jsx(Icon, { name: "close-line", text4: true }) }
32
+ ) })
33
+
34
+ ) }
35
+ ));
36
+
37
+ }
@@ -1 +1,65 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["key"];var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/notifications/NotificationsHandler.js";import{is}from'ramda';import React from'react';import{Notification}from"./Notification";import{SafeAreaView}from"../../structure/SafeAreaView";import{View}from"../../structure/View";import{useResponsiveValue}from"../../../responsive/responsiveHooks";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var NotificationsContext=React.createContext(null);export var useNotifications=function useNotifications(){return React.useContext(NotificationsContext)||{};};var idCounter=0;export function useNotifier(){var _useNotifications=useNotifications(),add=_useNotifications.add,remove=_useNotifications.remove;var notify=function notify(data,opts,type){var key=++idCounter;var time=(opts==null?void 0:opts.time)||6000;if(is(String,data))data={title:data};var timerId=setTimeout(function(){return remove==null?void 0:remove(key);},time);add==null?void 0:add(key,Object.assign({},data,{type:type,opts:opts,timerId:timerId,time:time}));};return{notify:notify,info:function info(data,opts){return notify(data,opts,'info');},error:function error(data,opts){return notify(data,opts,'error');},warning:function warning(data,opts){return notify(data,opts,'warning');},success:function success(data,opts){return notify(data,opts,'success');}};}export function NotificationsHandler(_ref){var _this=this;var children=_ref.children;var width=useResponsiveValue({sm:'100%',df:400});var _React$useState=React.useState([]),_React$useState2=_slicedToArray(_React$useState,2),messages=_React$useState2[0],setMessages=_React$useState2[1];var add=React.useCallback(function(key,data){setMessages(function(prev){return[Object.assign({key:key},data)].concat(_toConsumableArray(prev));});},[]);var remove=React.useCallback(function(key){setMessages(function(prev){return prev.filter(function(p){return p.key!==key;});});},[]);var value=React.useMemo(function(){return{add:add,remove:remove};},[add,remove]);return _jsxs(NotificationsContext.Provider,{value:value,children:[children,!!messages.length&&_jsx(View,{fixed:true,top:0,right:0,padding:"md",width:width,maxWidth:"100%",pointerEvents:"box-none",zIndex:600,children:_jsx(SafeAreaView,{gap:"xs",children:messages.map(function(_ref2){var key=_ref2.key,item=_objectWithoutProperties(_ref2,_excluded);return _jsx(Notification,Object.assign({},item),key);})})})]});}
1
+ var _excluded = ["key"];var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/notifications/NotificationsHandler.js";function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}function _toConsumableArray(r) {return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r) {if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);}function _arrayWithoutHoles(r) {if (Array.isArray(r)) return _arrayLikeToArray(r);}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import { is } from 'ramda';
2
+ import React from 'react';
3
+
4
+ import { Notification } from "./Notification";
5
+ import { SafeAreaView } from "../../structure/SafeAreaView";
6
+ import { View } from "../../structure/View";
7
+ import { useResponsiveValue } from "../../../responsive/responsiveHooks";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+
9
+ var NotificationsContext = React.createContext(null);
10
+
11
+ export var useNotifications = function useNotifications() {return React.useContext(NotificationsContext) || {};};
12
+
13
+ var idCounter = 0;
14
+
15
+ export function useNotifier() {
16
+ var _useNotifications = useNotifications(),add = _useNotifications.add,remove = _useNotifications.remove;
17
+ var notify = function notify(data, opts, type) {
18
+ var key = ++idCounter;
19
+ var time = (opts == null ? void 0 : opts.time) || 6000;
20
+
21
+ if (is(String, data)) data = { title: data };
22
+
23
+ var timerId = setTimeout(function () {return remove == null ? void 0 : remove(key);}, time);
24
+ add == null ? void 0 : add(key, Object.assign({}, data, { type: type, opts: opts, timerId: timerId, time: time }));
25
+ };
26
+
27
+ return {
28
+ notify: notify,
29
+ info: function info(data, opts) {return notify(data, opts, 'info');},
30
+ error: function error(data, opts) {return notify(data, opts, 'error');},
31
+ warning: function warning(data, opts) {return notify(data, opts, 'warning');},
32
+ success: function success(data, opts) {return notify(data, opts, 'success');}
33
+ };
34
+ }
35
+
36
+ export function NotificationsHandler(_ref) {var _this = this;var children = _ref.children;
37
+ var width = useResponsiveValue({ sm: '100%', df: 400 });
38
+ var _React$useState = React.useState([]),_React$useState2 = _slicedToArray(_React$useState, 2),messages = _React$useState2[0],setMessages = _React$useState2[1];
39
+
40
+ var add = React.useCallback(function (key, data) {
41
+ setMessages(function (prev) {return [Object.assign({ key: key }, data)].concat(_toConsumableArray(prev));});
42
+ }, []);
43
+
44
+ var remove = React.useCallback(function (key) {
45
+ setMessages(function (prev) {return prev.filter(function (p) {return p.key !== key;});});
46
+ }, []);
47
+
48
+ var value = React.useMemo(function () {return { add: add, remove: remove };}, [add, remove]);
49
+
50
+ return (
51
+ _jsxs(NotificationsContext.Provider, { value: value, children: [
52
+ children,
53
+
54
+ !!messages.length &&
55
+ _jsx(View, { fixed: true, top: 0, right: 0, padding: "md", width: width, maxWidth: "100%", pointerEvents: "box-none", zIndex: 600, children:
56
+ _jsx(SafeAreaView, { gap: "xs", children:
57
+ messages.map(function (_ref2) {var key = _ref2.key,item = _objectWithoutProperties(_ref2, _excluded);return (
58
+ _jsx(Notification, Object.assign({}, item), key));}
59
+ ) }
60
+ ) }
61
+ )] }
62
+
63
+ ));
64
+
65
+ }
@@ -0,0 +1,72 @@
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/filter/DateFilter.js";var _excluded = ["name", "label", "type", "format", "useMapValue"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React from 'react';
2
+ import dayjs from 'dayjs';
3
+ import { is } from 'ramda';
4
+
5
+ import { DateInput } from "../inputs";
6
+ import { FilterItem } from "./FilterItem";
7
+ import { useFilter } from "./FilterHandler";import { jsx as _jsx } from "react/jsx-runtime";
8
+
9
+ function getFormat(type) {
10
+ switch (type) {
11
+ case 'year':
12
+ return 'YYYY';
13
+ case 'quarter':
14
+ return 'YYYY [Q]Q';
15
+ case 'month':
16
+ return 'YYYY MMM';
17
+ case 'week':
18
+ return 'YYYY wo';
19
+ default:
20
+ return 'YYYY-MM-DD';
21
+ }
22
+ }
23
+
24
+ function formatValue(value, type) {
25
+ if (!value) return null;
26
+ var date = dayjs(value);
27
+
28
+ switch (type) {
29
+ case 'year':
30
+ return [date.startOf('year'), date.endOf('year')];
31
+ case 'quarter':
32
+ return [date.startOf('quarter'), date.endOf('quarter')];
33
+ case 'month':
34
+ return [date.startOf('month'), date.endOf('month')];
35
+ case 'week':
36
+ return [date.startOf('isoWeek'), date.endOf('isoWeek')];
37
+ default:
38
+ return [date.startOf('day'), date.endOf('day')];
39
+ }
40
+ }
41
+
42
+ export function DateFilter(_ref) {var _value,_value2,_this = this;var name = _ref.name,label = _ref.label,type = _ref.type,format = _ref.format,useMapValue = _ref.useMapValue,rest = _objectWithoutProperties(_ref, _excluded);
43
+ var _useFilter = useFilter(),filters = _useFilter.filters,onChangeFilter = _useFilter.onChangeFilter;
44
+ var value = filters == null ? void 0 : filters[name];
45
+ format = format || getFormat(type);
46
+
47
+ if (!!((_value = value) != null && _value.init) && !!value.end) {
48
+ value = value.init;
49
+ }
50
+ if (is(Array, value) && ((_value2 = value) == null ? void 0 : _value2.length) === 2) {
51
+ value = value[0];
52
+ }
53
+
54
+ if (!!value && !!value.format) {
55
+ label = value.format(format);
56
+ }
57
+
58
+ var handleChange = function handleChange(val) {var _result;
59
+ var result = formatValue(val, type);
60
+ if (!!((_result = result) != null && _result.length) && !!useMapValue) {
61
+ var _result2 = result,_result3 = _slicedToArray(_result2, 2),init = _result3[0],end = _result3[1];
62
+ result = { init: init, end: end };
63
+ }
64
+ onChangeFilter(name, result);
65
+ };
66
+
67
+ return (
68
+ _jsx(FilterItem, { name: name, children:
69
+ function children(_ref2) {var _v = _ref2.value;return _jsx(DateInput, Object.assign({ value: value, onChange: handleChange, type: type }, rest));} }
70
+ ));
71
+
72
+ }
@@ -0,0 +1,17 @@
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/filter/FilterGroup.js";function _toConsumableArray(r) {return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _iterableToArray(r) {if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);}function _arrayWithoutHoles(r) {if (Array.isArray(r)) return _arrayLikeToArray(r);}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}import React from 'react';import { jsx as _jsx } from "react/jsx-runtime";
2
+
3
+ var FilterGroupContext = React.createContext(null);
4
+ var useGroupPath = function useGroupPath() {var _React$useContext;return ((_React$useContext = React.useContext(FilterGroupContext)) == null ? void 0 : _React$useContext.path) || [];};
5
+
6
+ export function useFilterPath(name) {
7
+ var listPath = !!name ? Array.isArray(name) ? name : [name] : [];
8
+ var parentPath = useGroupPath();
9
+ return [].concat(_toConsumableArray(parentPath), _toConsumableArray(listPath));
10
+ }
11
+
12
+ export function FilterGroup(_ref) {var name = _ref.name,children = _ref.children;
13
+ var path = useFilterPath(name);
14
+ var value = { path: path };
15
+
16
+ return _jsx(FilterGroupContext.Provider, { value: value, children: children });
17
+ }
@@ -0,0 +1,54 @@
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/filter/FilterHandler.js";function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import { assocPath, curry } from 'ramda';
2
+ import React from 'react';import { jsx as _jsx } from "react/jsx-runtime";
3
+
4
+ var FilterContext = React.createContext();
5
+ export var useFilter = function useFilter() {return React.useContext(FilterContext) || {};};
6
+
7
+ export function FilterHandler(_ref)
8
+
9
+
10
+
11
+
12
+
13
+ {var children = _ref.children,_ref$initialFilters = _ref.initialFilters,initialFilters = _ref$initialFilters === void 0 ? {} : _ref$initialFilters,initialSearch = _ref.initialSearch,initialSort = _ref.initialSort,onChange = _ref.onChange;
14
+ var _React$useState = React.useState(initialFilters),_React$useState2 = _slicedToArray(_React$useState, 2),filters = _React$useState2[0],setFilters = _React$useState2[1];
15
+ var _React$useState3 = React.useState(initialSearch),_React$useState4 = _slicedToArray(_React$useState3, 2),search = _React$useState4[0],setSearch = _React$useState4[1];
16
+ var _React$useState5 = React.useState(initialSort),_React$useState6 = _slicedToArray(_React$useState5, 2),sort = _React$useState6[0],setSort = _React$useState6[1];
17
+
18
+ React.useEffect(function () {
19
+ onChange == null ? void 0 : onChange({ filters: filters, search: search, sort: sort });
20
+ }, [filters, search, sort]);
21
+
22
+ var onChangeFilter = curry(function (name, value) {
23
+ var listPath = Array.isArray(name) ? name : [name];
24
+ setFilters(function (prev) {return assocPath(listPath, value, prev);});
25
+ });
26
+ var onChangeSearch = setSearch;
27
+ var onChangeSort = setSort;
28
+
29
+ var onReset = function onReset() {
30
+ setFilters(initialFilters);
31
+ setSearch(initialSearch);
32
+ setSort(initialSort);
33
+ };
34
+
35
+ var onClear = function onClear() {
36
+ setFilters({});
37
+ setSearch(undefined);
38
+ setSort(undefined);
39
+ };
40
+
41
+ var value = {
42
+ filters: filters,
43
+ setFilters: setFilters,
44
+ onChangeFilter: onChangeFilter,
45
+ search: search,
46
+ onChangeSearch: onChangeSearch,
47
+ sort: sort,
48
+ onChangeSort: onChangeSort,
49
+ onReset: onReset,
50
+ onClear: onClear
51
+ };
52
+
53
+ return _jsx(FilterContext.Provider, { value: value, children: children });
54
+ }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { path } from 'ramda';
3
+
4
+ import { clearProps } from "../../modifiers/_helpers";
5
+ import { useFilter } from "./FilterHandler";
6
+ import { useFilterPath } from "./FilterGroup";
7
+
8
+ export function FilterItem(_ref) {var name = _ref.name,children = _ref.children;
9
+ var _useFilter = useFilter(),filters = _useFilter.filters,onChangeFilter = _useFilter.onChangeFilter;
10
+ var listPath = useFilterPath(name);
11
+
12
+ var value = path(listPath, filters);
13
+
14
+ var handleChange = function handleChange(e) {var _e$target$value, _e$target;
15
+ var val = (_e$target$value = e == null ? void 0 : (_e$target = e.target) == null ? void 0 : _e$target.value) != null ? _e$target$value : e;
16
+ onChangeFilter(listPath, val);
17
+ };
18
+
19
+ var childProps = clearProps({
20
+ value: value === undefined ? '' : value,
21
+ onChange: handleChange
22
+ });
23
+
24
+ if (typeof children === 'function') {
25
+ return children(childProps);
26
+ }
27
+
28
+ var child = React.Children.only(children);
29
+ return React.cloneElement(child, Object.assign({}, child.props, childProps));
30
+ }
@@ -0,0 +1,84 @@
1
+ var _excluded = ["name", "label", "placeholder", "children", "submitOnClose", "popoverProps", "formatValue"];var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/filter/PopoverFilterItem.js";function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import React from 'react';
2
+ import { path } from 'ramda';
3
+
4
+ import { Button } from "../actions/Button";
5
+ import { LinkInput } from "../inputs/LinkInput";
6
+ import { Popover } from "../structure/popover/Popover";
7
+ import { View } from "../structure/View";
8
+ import { useFilter } from "./FilterHandler";
9
+ import { useFilterPath } from "./FilterGroup";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+
11
+ function autoFormat(value) {
12
+ if (value == null) return undefined;
13
+
14
+ if ('min' in value || 'max' in value) {
15
+ var min = value.min,max = value.max;
16
+ if (min != null && max != null) return `${min} – ${max}`;
17
+ if (min != null) return `≥ ${min}`;
18
+ if (max != null) return `≤ ${max}`;
19
+ return undefined;
20
+ }
21
+
22
+ if ('start' in value || 'end' in value) {var _value$start, _value$end;
23
+ var fmt = 'YYYY-MM-DD';
24
+ var s = ((_value$start = value.start) == null ? void 0 : _value$start.format == null ? void 0 : _value$start.format(fmt)) || value.start;
25
+ var e = ((_value$end = value.end) == null ? void 0 : _value$end.format == null ? void 0 : _value$end.format(fmt)) || value.end;
26
+ if (s && e) return `${s} – ${e}`;
27
+ if (s) return `${s} →`;
28
+ if (e) return `→ ${e}`;
29
+ return undefined;
30
+ }
31
+
32
+ return String(value);
33
+ }
34
+
35
+ function PopoverFilterContent(_ref) {var value = _ref.value,onApply = _ref.onApply,submitOnClose = _ref.submitOnClose,children = _ref.children,onClose = _ref.onClose;
36
+ var _React$useState = React.useState(value),_React$useState2 = _slicedToArray(_React$useState, 2),local = _React$useState2[0],setLocal = _React$useState2[1];
37
+ var localRef = React.useRef(local);
38
+ localRef.current = local;
39
+
40
+ React.useEffect(function () {
41
+ if (!submitOnClose) return;
42
+ return function () {return onApply(localRef.current);};
43
+ }, []);
44
+
45
+ var handleApply = function handleApply() {
46
+ onApply(local);
47
+ onClose();
48
+ };
49
+
50
+ return (
51
+ _jsxs(View, { gap: "sm", children: [
52
+ typeof children === 'function' ?
53
+ children({ value: local, onChange: setLocal }) :
54
+ React.cloneElement(React.Children.only(children), { value: local, onChange: setLocal }),
55
+ _jsx(View, { row: true, toRight: true, children:
56
+ _jsx(Button, { label: "Apply", onPress: handleApply, xs: true }) }
57
+ )] }
58
+ ));
59
+
60
+ }
61
+
62
+ export function PopoverFilterItem(_ref2) {var _formatValue,_this = this;var name = _ref2.name,label = _ref2.label,placeholder = _ref2.placeholder,children = _ref2.children,submitOnClose = _ref2.submitOnClose,popoverProps = _ref2.popoverProps,formatValue = _ref2.formatValue,props = _objectWithoutProperties(_ref2, _excluded);
63
+ var _useFilter = useFilter(),filters = _useFilter.filters,onChangeFilter = _useFilter.onChangeFilter;
64
+ var listPath = useFilterPath(name);
65
+ var value = path(listPath, filters);
66
+
67
+ var displayText = value != null ? (_formatValue = formatValue == null ? void 0 : formatValue(value)) != null ? _formatValue : autoFormat(value) : undefined;
68
+
69
+ return (
70
+ _jsx(Popover, Object.assign({
71
+ trigger: "click",
72
+ placement: "bottomLeft",
73
+ unmountOnClose: true },
74
+ popoverProps, {
75
+ renderContent: function renderContent(_ref3) {var onClose = _ref3.onClose;return (
76
+ _jsx(PopoverFilterContent, { value: value, onApply: function onApply(val) {return onChangeFilter(listPath, val);}, submitOnClose: submitOnClose, onClose: onClose, children:
77
+ children }
78
+ ));}, children:
79
+
80
+
81
+ _jsx(LinkInput, Object.assign({ value: displayText, placeholder: placeholder || label, suffixIcon: "arrow-down-s-fill", suffixIconColor: "text4" }, props)) })
82
+ ));
83
+
84
+ }
@@ -0,0 +1,49 @@
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/filter/SearchInput.js";var _excluded = ["value", "onChange", "placeholder"];function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React from 'react';
2
+
3
+ import { Icon } from "../presentation";
4
+ import { Link } from "../actions";
5
+ import { TextInput } from "../inputs";
6
+ import { useFilter } from "./FilterHandler";import { jsx as _jsx } from "react/jsx-runtime";
7
+
8
+ export function SearchInput(_ref) {var valueProp = _ref.value,onChangeProp = _ref.onChange,_ref$placeholder = _ref.placeholder,placeholder = _ref$placeholder === void 0 ? 'Search...' : _ref$placeholder,rest = _objectWithoutProperties(_ref, _excluded);
9
+ var filter = useFilter();
10
+
11
+ var value = valueProp != null ? valueProp : filter.search;
12
+ var onChange = onChangeProp != null ? onChangeProp : filter.onChangeSearch;
13
+
14
+ var _React$useState = React.useState(value || ''),_React$useState2 = _slicedToArray(_React$useState, 2),local = _React$useState2[0],setLocal = _React$useState2[1];
15
+
16
+ React.useEffect(function () {
17
+ setLocal(value || '');
18
+ }, [value]);
19
+
20
+ var push = function push() {
21
+ onChange == null ? void 0 : onChange(local);
22
+ };
23
+
24
+ var clear = function clear() {
25
+ setLocal('');
26
+ onChange == null ? void 0 : onChange('');
27
+ };
28
+
29
+ var suffix = !!local &&
30
+ _jsx(Link, { onPress: clear, children:
31
+ _jsx(Icon, { name: "close-line" }) }
32
+ );
33
+
34
+
35
+ return (
36
+ _jsx(TextInput, Object.assign({
37
+ prefixIcon: "search-line",
38
+ prefixIconColor: "text4",
39
+ placeholder: placeholder,
40
+ value: local,
41
+ onChange: setLocal,
42
+ onBlur: push,
43
+ onKeyDown: function onKeyDown(e) {return e.key === 'Enter' && push();},
44
+ onSubmitEditing: push,
45
+ suffix: suffix },
46
+ rest)
47
+ ));
48
+
49
+ }
@@ -0,0 +1,6 @@
1
+ export * from "./FilterHandler";
2
+ export * from "./FilterGroup";
3
+ export * from "./FilterItem";
4
+ export * from "./PopoverFilterItem";
5
+ export * from "./SearchInput";
6
+ export * from "./DateFilter";
@@ -1 +1,31 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/form/Form.js";var _excluded=["form","onSubmit","initialValues","children","loading","disabled"];import React from'react';import{FormWrapperComponent}from"./FormWrapperComponent";import{LoadingView}from"../state/LoadingView";import{useNewForm}from"./useNewForm";import{jsx as _jsx}from"react/jsx-runtime";var FormContext=React.createContext(null);export var useFormState=function useFormState(){return React.useContext(FormContext);};export var useFormInstance=function useFormInstance(){var _useFormState;return(_useFormState=useFormState())==null?void 0:_useFormState.form;};export var useForm=useFormInstance;export function Form(_ref){var form=_ref.form,onSubmit=_ref.onSubmit,initialValues=_ref.initialValues,children=_ref.children,loading=_ref.loading,disabled=_ref.disabled,props=_objectWithoutProperties(_ref,_excluded);var defaultForm=useNewForm({onSubmit:onSubmit,initialValues:initialValues});form=form||defaultForm;return _jsx(FormContext.Provider,{value:{loading:loading,disabled:disabled,form:form},children:_jsx(LoadingView,{active:loading,noWrapper:true,children:_jsx(FormWrapperComponent,Object.assign({form:form,gap:"md"},props,{children:children}))})});}
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/form/Form.js";var _excluded = ["form", "onSubmit", "onValuesChange", "initialValues", "children", "loading", "disabled"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import React from 'react';
2
+
3
+ import { FormWrapperComponent } from "./FormWrapperComponent";
4
+ import { LoadingView } from "../state/LoadingView";
5
+ import { useNewForm } from "./useNewForm";import { jsx as _jsx } from "react/jsx-runtime";
6
+
7
+ var FormContext = React.createContext(null);
8
+ export var useFormState = function useFormState() {return React.useContext(FormContext);};
9
+ export var useFormInstance = function useFormInstance() {var _useFormState;return (_useFormState = useFormState()) == null ? void 0 : _useFormState.form;};
10
+ export var useForm = useFormInstance;
11
+
12
+ export function Form(_ref) {var form = _ref.form,onSubmit = _ref.onSubmit,onValuesChange = _ref.onValuesChange,initialValues = _ref.initialValues,children = _ref.children,loading = _ref.loading,disabled = _ref.disabled,props = _objectWithoutProperties(_ref, _excluded);
13
+ var defaultForm = useNewForm({ onSubmit: onSubmit, onValuesChange: onValuesChange, initialValues: initialValues });
14
+ form = form || defaultForm;
15
+
16
+
17
+ if (form._callbacksRef) {
18
+ if (onSubmit) form._callbacksRef.current.onSubmit = onSubmit;
19
+ if (onValuesChange) form._callbacksRef.current.onValuesChange = onValuesChange;
20
+ }
21
+
22
+ return (
23
+ _jsx(FormContext.Provider, { value: { loading: loading, disabled: disabled, form: form }, children:
24
+ _jsx(LoadingView, { active: loading, noWrapper: true, children:
25
+ _jsx(FormWrapperComponent, Object.assign({ form: form, onSubmit: onSubmit, gap: "md" }, props, { children:
26
+ children })
27
+ ) }
28
+ ) }
29
+ ));
30
+
31
+ }
@@ -1 +1,21 @@
1
- import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/form/FormGroup.js";import React from'react';import{jsx as _jsx}from"react/jsx-runtime";var FormGroupContext=React.createContext(null);var useGroupPath=function useGroupPath(){var _React$useContext;return((_React$useContext=React.useContext(FormGroupContext))==null?void 0:_React$useContext.path)||[];};export function useRelativePath(name,opts){var isAbsolutePath=opts.isAbsolutePath;var listPath=!!name?Array.isArray(name)?name:[name]:[];var parentPath=useGroupPath();if(!!isAbsolutePath)return listPath;return[].concat(_toConsumableArray(parentPath),_toConsumableArray(listPath));}export function FormGroup(_ref){var name=_ref.name,children=_ref.children;var path=useRelativePath(name,{isAbsolutePath:false});var value={path:path};return _jsx(FormGroupContext.Provider,{value:value,children:children});}
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/form/FormGroup.js";function _toConsumableArray(r) {return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _iterableToArray(r) {if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);}function _arrayWithoutHoles(r) {if (Array.isArray(r)) return _arrayLikeToArray(r);}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}import React from 'react';import { jsx as _jsx } from "react/jsx-runtime";
2
+
3
+ var FormGroupContext = React.createContext(null);
4
+ var useGroupPath = function useGroupPath() {var _React$useContext;return ((_React$useContext = React.useContext(FormGroupContext)) == null ? void 0 : _React$useContext.path) || [];};
5
+
6
+ export function useRelativePath(name, opts) {
7
+ var isAbsolutePath = opts.isAbsolutePath;
8
+ var listPath = !!name ? Array.isArray(name) ? name : [name] : [];
9
+ var parentPath = useGroupPath();
10
+
11
+ if (!!isAbsolutePath) return listPath;
12
+
13
+ return [].concat(_toConsumableArray(parentPath), _toConsumableArray(listPath));
14
+ }
15
+
16
+ export function FormGroup(_ref) {var name = _ref.name,children = _ref.children;
17
+ var path = useRelativePath(name, { isAbsolutePath: false });
18
+ var value = { path: path };
19
+
20
+ return _jsx(FormGroupContext.Provider, { value: value, children: children });
21
+ }