@neko-os/ui 0.2.3 → 0.4.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 (433) hide show
  1. package/dist/DynamicStyleTag.js +18 -2
  2. package/dist/DynamicStyleTag.native.js +3 -1
  3. package/dist/NekoUI.js +39 -1
  4. package/dist/abstractions/ActivityIndicator.js +19 -1
  5. package/dist/abstractions/ActivityIndicator.native.js +43 -1
  6. package/dist/abstractions/ActivityIndicator.web.js +43 -1
  7. package/dist/abstractions/AnimatedView.js +3 -1
  8. package/dist/abstractions/AnimatedView.native.js +5 -1
  9. package/dist/abstractions/AnimatedView.web.js +3 -1
  10. package/dist/abstractions/BlurView.js +43 -1
  11. package/dist/abstractions/BlurView.native.js +39 -1
  12. package/dist/abstractions/BlurView.web.js +39 -1
  13. package/dist/abstractions/DraggableSlideView.js +3 -1
  14. package/dist/abstractions/DraggableSlideView.native.js +62 -1
  15. package/dist/abstractions/FlatList.js +3 -1
  16. package/dist/abstractions/FlatList.native.js +37 -1
  17. package/dist/abstractions/FlatList.web.js +3 -1
  18. package/dist/abstractions/GradientView.js +5 -1
  19. package/dist/abstractions/GradientView.native.js +32 -1
  20. package/dist/abstractions/HiddenInput.js +3 -1
  21. package/dist/abstractions/HiddenInput.native.js +3 -1
  22. package/dist/abstractions/Icon.js +10 -1
  23. package/dist/abstractions/Icon.native.js +13 -1
  24. package/dist/abstractions/Icon.web.js +11 -1
  25. package/dist/abstractions/Image.js +12 -1
  26. package/dist/abstractions/Image.native.js +7 -1
  27. package/dist/abstractions/Image.web.js +7 -1
  28. package/dist/abstractions/ImageBackground.js +17 -1
  29. package/dist/abstractions/ImageBackground.native.js +27 -1
  30. package/dist/abstractions/ImageBackground.web.js +7 -1
  31. package/dist/abstractions/KeyboardAvoidingView.js +3 -1
  32. package/dist/abstractions/KeyboardAvoidingView.native.js +3 -1
  33. package/dist/abstractions/Platform.js +1 -1
  34. package/dist/abstractions/Platform.native.js +3 -1
  35. package/dist/abstractions/Platform.web.js +3 -1
  36. package/dist/abstractions/Pressable.js +4 -1
  37. package/dist/abstractions/Pressable.native.js +3 -1
  38. package/dist/abstractions/Pressable.web.js +3 -1
  39. package/dist/abstractions/SafeAreaView.js +3 -1
  40. package/dist/abstractions/SafeAreaView.native.js +3 -1
  41. package/dist/abstractions/ScrollView.js +3 -1
  42. package/dist/abstractions/ScrollView.native.js +5 -1
  43. package/dist/abstractions/ScrollView.web.js +3 -1
  44. package/dist/abstractions/StaticList.js +51 -1
  45. package/dist/abstractions/Switch.js +97 -1
  46. package/dist/abstractions/Switch.native.js +12 -1
  47. package/dist/abstractions/Table.js +29 -1
  48. package/dist/abstractions/Table.native.js +19 -1
  49. package/dist/abstractions/Text.js +14 -1
  50. package/dist/abstractions/Text.native.js +3 -1
  51. package/dist/abstractions/Text.web.js +18 -1
  52. package/dist/abstractions/TextInput.js +12 -1
  53. package/dist/abstractions/TextInput.native.js +5 -1
  54. package/dist/abstractions/TextInput.web.js +5 -1
  55. package/dist/abstractions/TouchableOpacity.js +4 -1
  56. package/dist/abstractions/TouchableOpacity.native.js +9 -1
  57. package/dist/abstractions/View.js +3 -1
  58. package/dist/abstractions/View.native.js +3 -1
  59. package/dist/abstractions/View.web.js +3 -1
  60. package/dist/abstractions/helpers/componentSize.js +13 -1
  61. package/dist/abstractions/helpers/componentSize.native.js +12 -1
  62. package/dist/abstractions/helpers/storage.js +32 -1
  63. package/dist/abstractions/helpers/storage.native.js +34 -1
  64. package/dist/abstractions/helpers/transformStyle.js +8 -1
  65. package/dist/abstractions/helpers/transformStyle.native.js +3 -1
  66. package/dist/abstractions/helpers/useSafeAreaInsets.js +3 -1
  67. package/dist/abstractions/helpers/useSafeAreaInsets.native.js +3 -1
  68. package/dist/abstractions/helpers/windowWidth.js +13 -1
  69. package/dist/abstractions/helpers/windowWidth.native.js +6 -1
  70. package/dist/abstractions/helpers/windowWidth.web.js +6 -1
  71. package/dist/components/actions/ActionsDrawer.js +81 -1
  72. package/dist/components/actions/Breadcrumb.js +47 -1
  73. package/dist/components/actions/Button.js +82 -1
  74. package/dist/components/actions/Dropdown.js +91 -1
  75. package/dist/components/actions/FloatingButton.js +87 -1
  76. package/dist/components/actions/FloatingMenu.js +39 -1
  77. package/dist/components/actions/Link.js +66 -1
  78. package/dist/components/actions/Pressable.js +38 -1
  79. package/dist/components/actions/index.js +9 -1
  80. package/dist/components/actions/menu/HorizontalMenu.js +98 -1
  81. package/dist/components/actions/menu/Menu.js +7 -1
  82. package/dist/components/actions/menu/SubmenuWrapper.js +16 -1
  83. package/dist/components/actions/menu/VerticalMenu.js +133 -1
  84. package/dist/components/animations/AnimatedTopBar.js +10 -1
  85. package/dist/components/animations/AnimatedTopBar.native.js +34 -1
  86. package/dist/components/animations/AnimatedTopBar.web.js +1 -1
  87. package/dist/components/animations/AnimatedView.js +45 -1
  88. package/dist/components/animations/DraggableSlideView.js +42 -1
  89. package/dist/components/animations/ParallaxHeader.js +9 -1
  90. package/dist/components/animations/ParallaxHeader.native.js +32 -1
  91. package/dist/components/animations/ParallaxHeader.web.js +32 -1
  92. package/dist/components/animations/ReanimatedScrollHandler.js +8 -1
  93. package/dist/components/animations/ReanimatedScrollHandler.native.js +24 -1
  94. package/dist/components/animations/ReanimatedScrollHandler.web.js +1 -1
  95. package/dist/components/animations/ReanimatedView.js +40 -1
  96. package/dist/components/animations/index.js +5 -1
  97. package/dist/components/calendar/CalendarNav.js +67 -1
  98. package/dist/components/calendar/WeekDaysBar.js +18 -1
  99. package/dist/components/calendar/_helpers/calendarDays.js +16 -1
  100. package/dist/components/calendar/_helpers/dateDisabled.js +24 -1
  101. package/dist/components/feedback/alerter.js +31 -1
  102. package/dist/components/feedback/confirmer.js +70 -1
  103. package/dist/components/feedback/index.js +3 -1
  104. package/dist/components/feedback/notifications/Notification.js +37 -1
  105. package/dist/components/feedback/notifications/NotificationsHandler.js +65 -1
  106. package/dist/components/filter/DateFilter.js +72 -0
  107. package/dist/components/filter/FilterGroup.js +17 -0
  108. package/dist/components/filter/FilterHandler.js +54 -0
  109. package/dist/components/filter/FilterItem.js +30 -0
  110. package/dist/components/filter/PopoverFilterItem.js +84 -0
  111. package/dist/components/filter/SearchInput.js +49 -0
  112. package/dist/components/filter/index.js +6 -0
  113. package/dist/components/form/Form.js +31 -1
  114. package/dist/components/form/FormGroup.js +21 -1
  115. package/dist/components/form/FormItem.js +118 -1
  116. package/dist/components/form/FormList.js +143 -1
  117. package/dist/components/form/FormWrapperComponent.js +52 -1
  118. package/dist/components/form/FormWrapperComponent.native.js +5 -1
  119. package/dist/components/form/SubmitButton.js +22 -1
  120. package/dist/components/form/index.js +9 -1
  121. package/dist/components/form/useNewForm.js +211 -1
  122. package/dist/components/form/useWatch.js +70 -1
  123. package/dist/components/form/validation/defaultMessages.js +20 -1
  124. package/dist/components/form/validation/index.js +5 -1
  125. package/dist/components/form/validation/normalizeRules.js +22 -1
  126. package/dist/components/form/validation/shouldValidateOn.js +21 -1
  127. package/dist/components/form/validation/validateRules.js +83 -1
  128. package/dist/components/form/validation/validators.js +82 -1
  129. package/dist/components/helpers/ConditionalLazyRender.js +6 -1
  130. package/dist/components/helpers/LazyAction.js +22 -1
  131. package/dist/components/helpers/LazyRender.js +55 -1
  132. package/dist/components/helpers/LazyRender.native.js +58 -1
  133. package/dist/components/helpers/Portal.js +21 -1
  134. package/dist/components/helpers/PortalHandler.js +32 -1
  135. package/dist/components/helpers/Responsive.js +18 -1
  136. package/dist/components/helpers/Separator.js +49 -1
  137. package/dist/components/helpers/VerticalView.js +34 -1
  138. package/dist/components/helpers/index.js +8 -1
  139. package/dist/components/index.js +20 -1
  140. package/dist/components/inputs/BooleanSelect.js +14 -0
  141. package/dist/components/inputs/Checkbox.js +56 -1
  142. package/dist/components/inputs/DateInput.js +123 -1
  143. package/dist/components/inputs/DateRangeInput.js +41 -0
  144. package/dist/components/inputs/Editable.js +129 -0
  145. package/dist/components/inputs/EnabledSelect.js +14 -0
  146. package/dist/components/inputs/InputWrapper.js +93 -1
  147. package/dist/components/inputs/LinkInput.js +17 -1
  148. package/dist/components/inputs/MaskInput.js +67 -1
  149. package/dist/components/inputs/NumberInput.js +111 -1
  150. package/dist/components/inputs/NumberRangeInput.js +41 -0
  151. package/dist/components/inputs/PasswordInput.js +24 -0
  152. package/dist/components/inputs/Picker.js +169 -1
  153. package/dist/components/inputs/Radio.js +55 -1
  154. package/dist/components/inputs/RateInput.js +62 -1
  155. package/dist/components/inputs/SegmentedPicker.js +62 -1
  156. package/dist/components/inputs/Select.js +219 -1
  157. package/dist/components/inputs/Switch.js +60 -1
  158. package/dist/components/inputs/TextArea.js +5 -0
  159. package/dist/components/inputs/TextInput.js +32 -1
  160. package/dist/components/inputs/UploadInput.js +140 -0
  161. package/dist/components/inputs/_DateInput.native.js +89 -1
  162. package/dist/components/inputs/datePicker/DatePicker.js +24 -1
  163. package/dist/components/inputs/datePicker/DayPicker.js +64 -1
  164. package/dist/components/inputs/datePicker/MonthPicker.js +62 -1
  165. package/dist/components/inputs/datePicker/QuarterPicker.js +65 -1
  166. package/dist/components/inputs/datePicker/WeekPicker.js +74 -1
  167. package/dist/components/inputs/datePicker/YearPicker.js +70 -1
  168. package/dist/components/inputs/index.js +23 -1
  169. package/dist/components/inputs/upload/Upload.js +99 -0
  170. package/dist/components/inputs/upload/Upload.native.js +154 -0
  171. package/dist/components/inputs/upload/useUploadState.js +143 -0
  172. package/dist/components/layout/Layout.js +40 -1
  173. package/dist/components/layout/LayoutContent.js +42 -1
  174. package/dist/components/layout/LayoutHeader.js +70 -1
  175. package/dist/components/layout/LayoutSider.js +64 -1
  176. package/dist/components/layout/index.js +4 -1
  177. package/dist/components/list/FlatList.js +91 -1
  178. package/dist/components/list/ScrollView.js +58 -1
  179. package/dist/components/list/index.js +2 -1
  180. package/dist/components/modals/bottomDrawer/index.js +3 -1
  181. package/dist/components/modals/bottomDrawer/index.native.js +5 -1
  182. package/dist/components/modals/bottomDrawer/index.web.js +5 -1
  183. package/dist/components/modals/bottomDrawer/native/BottomDrawer.js +239 -1
  184. package/dist/components/modals/bottomDrawer/native/DrawerContext.js +17 -1
  185. package/dist/components/modals/bottomDrawer/native/DrawerHandle.js +12 -1
  186. package/dist/components/modals/bottomDrawer/native/DrawerScrollView.js +5 -1
  187. package/dist/components/modals/bottomDrawer/native/createDrawerScrollComponent.js +139 -1
  188. package/dist/components/modals/bottomDrawer/native/utils.js +65 -1
  189. package/dist/components/modals/bottomDrawer/web/BottomDrawer.js +5 -1
  190. package/dist/components/modals/drawer/Drawer.js +5 -1
  191. package/dist/components/modals/drawer/Drawer.native.js +3 -1
  192. package/dist/components/modals/drawer/Drawer.web.js +3 -1
  193. package/dist/components/modals/drawer/index.js +1 -1
  194. package/dist/components/modals/index.js +4 -1
  195. package/dist/components/modals/modal/Modal.js +84 -1
  196. package/dist/components/modals/modal/Modal.native.js +83 -1
  197. package/dist/components/modals/modal/ModalBackdrop.js +58 -1
  198. package/dist/components/modals/modal/ModalContent.js +28 -1
  199. package/dist/components/modals/modal/ModalFooter.js +31 -1
  200. package/dist/components/modals/modal/ModalHeader.js +50 -1
  201. package/dist/components/modals/modal/handler/ModalsHandler.js +61 -1
  202. package/dist/components/modals/modal/index.js +6 -1
  203. package/dist/components/modals/router/ModalRoute.js +15 -1
  204. package/dist/components/modals/router/ModalsRouter.js +120 -1
  205. package/dist/components/modals/router/ModalsRouterContext.js +16 -1
  206. package/dist/components/modals/router/index.js +6 -1
  207. package/dist/components/modals/router/useAllModalsParams.js +6 -1
  208. package/dist/components/modals/router/useModalParams.js +6 -1
  209. package/dist/components/modals/router/useModalsNavigation.js +6 -1
  210. package/dist/components/modals/router/useUpdateModalContainer.js +6 -1
  211. package/dist/components/presentation/Avatar.js +79 -1
  212. package/dist/components/presentation/AvatarLabel.js +60 -1
  213. package/dist/components/presentation/AvatarsGroup.js +30 -0
  214. package/dist/components/presentation/Badge.js +91 -1
  215. package/dist/components/presentation/ContentLabel.js +43 -1
  216. package/dist/components/presentation/Icon.js +20 -1
  217. package/dist/components/presentation/IconLabel.js +40 -1
  218. package/dist/components/presentation/Image.js +33 -1
  219. package/dist/components/presentation/ImageBackground.js +38 -1
  220. package/dist/components/presentation/LabelValue.js +51 -1
  221. package/dist/components/presentation/Progress.js +20 -0
  222. package/dist/components/presentation/Rate.js +58 -1
  223. package/dist/components/presentation/RateTag.js +35 -1
  224. package/dist/components/presentation/Result.js +60 -1
  225. package/dist/components/presentation/ResultBar.js +56 -1
  226. package/dist/components/presentation/Tag.js +69 -1
  227. package/dist/components/presentation/Tooltip.js +44 -1
  228. package/dist/components/presentation/index.js +16 -1
  229. package/dist/components/sections/Section.js +50 -1
  230. package/dist/components/sections/SectionItem.js +24 -1
  231. package/dist/components/sections/SectionItemDropdown.js +68 -1
  232. package/dist/components/sections/SectionItemLink.js +35 -1
  233. package/dist/components/sections/index.js +4 -1
  234. package/dist/components/state/Loading.js +20 -1
  235. package/dist/components/state/LoadingView.js +37 -1
  236. package/dist/components/state/StatePresenter.js +41 -1
  237. package/dist/components/state/index.js +3 -1
  238. package/dist/components/steps/ActiveStepContent.js +16 -0
  239. package/dist/components/steps/StepsHandler.js +53 -0
  240. package/dist/components/steps/StepsMenu.js +14 -0
  241. package/dist/components/steps/StepsNavigation.js +37 -0
  242. package/dist/components/steps/index.js +4 -0
  243. package/dist/components/structure/Accordion.js +69 -1
  244. package/dist/components/structure/AccordionGroup.js +35 -1
  245. package/dist/components/structure/Affix.js +34 -0
  246. package/dist/components/structure/Affix.native.js +3 -0
  247. package/dist/components/structure/BlurView.js +59 -1
  248. package/dist/components/structure/Card.js +46 -1
  249. package/dist/components/structure/Col.js +22 -1
  250. package/dist/components/structure/GradientView.js +42 -1
  251. package/dist/components/structure/KeyboardAvoidingView.js +52 -1
  252. package/dist/components/structure/Row.js +50 -1
  253. package/dist/components/structure/SafeAreaView.js +42 -1
  254. package/dist/components/structure/Segment.js +51 -1
  255. package/dist/components/structure/TopBar.js +57 -1
  256. package/dist/components/structure/View.js +44 -1
  257. package/dist/components/structure/index.js +14 -1
  258. package/dist/components/structure/overlay/OverlayHandler.js +83 -1
  259. package/dist/components/structure/overlay/OverlayHandler.native.js +6 -1
  260. package/dist/components/structure/overlay/OverlayWrapper.js +52 -1
  261. package/dist/components/structure/overlay/calculatePosition.js +29 -1
  262. package/dist/components/structure/overlay/smartPlacement.js +32 -1
  263. package/dist/components/structure/popover/Popover.js +135 -1
  264. package/dist/components/structure/popover/Popover.native.js +105 -1
  265. package/dist/components/structure/popover/PopoverContent.js +18 -1
  266. package/dist/components/structure/popover/Popover_BU.js +157 -1
  267. package/dist/components/table/DataTable.js +62 -1
  268. package/dist/components/table/Pagination.js +128 -1
  269. package/dist/components/table/Table.js +66 -1
  270. package/dist/components/table/TableCol.js +67 -1
  271. package/dist/components/table/TableHeader.js +69 -1
  272. package/dist/components/table/TableHeaderRow.js +31 -1
  273. package/dist/components/table/TableRow.js +30 -1
  274. package/dist/components/table/index.js +7 -1
  275. package/dist/components/tabs/ActiveTabContent.js +38 -1
  276. package/dist/components/tabs/TabsHandler.js +16 -1
  277. package/dist/components/tabs/TabsMenu.js +15 -1
  278. package/dist/components/tabs/index.js +3 -1
  279. package/dist/components/text/DateText.js +24 -1
  280. package/dist/components/text/Text.js +32 -1
  281. package/dist/components/text/VerticalText.js +29 -1
  282. package/dist/components/text/index.js +3 -1
  283. package/dist/components/theme/ThemePicker.js +48 -1
  284. package/dist/components/theme/ThemePickerDrawer.js +12 -1
  285. package/dist/components/theme/ThemeStatusBar.js +3 -1
  286. package/dist/components/theme/ThemeStatusBar.native.js +9 -1
  287. package/dist/components/theme/ThemeThumb.js +98 -1
  288. package/dist/components/theme/index.js +3 -1
  289. package/dist/helpers/debounce.js +9 -1
  290. package/dist/helpers/index.js +5 -1
  291. package/dist/helpers/options.js +65 -1
  292. package/dist/helpers/random.js +5 -1
  293. package/dist/helpers/storage.js +76 -1
  294. package/dist/helpers/string.js +74 -1
  295. package/dist/i18n/I18n.js +96 -1
  296. package/dist/i18n/I18nProvider.js +40 -1
  297. package/dist/i18n/index.js +2 -1
  298. package/dist/index.js +8 -1
  299. package/dist/modifiers/_helpers.js +6 -1
  300. package/dist/modifiers/alignConverter.js +11 -1
  301. package/dist/modifiers/animation.js +18 -1
  302. package/dist/modifiers/animations/animatedEffects.js +64 -1
  303. package/dist/modifiers/animations/animatedEffects.native.js +55 -1
  304. package/dist/modifiers/animations/animatedEffects.web.js +55 -1
  305. package/dist/modifiers/animations/fadeEffect.js +46 -1
  306. package/dist/modifiers/animations/fadeEffect.native.js +33 -1
  307. package/dist/modifiers/animations/fadeEffect.web.js +3 -1
  308. package/dist/modifiers/animations/scaleEffect.js +46 -1
  309. package/dist/modifiers/animations/scaleEffect.native.js +33 -1
  310. package/dist/modifiers/animations/scrollEffect.web.js +3 -1
  311. package/dist/modifiers/animations/slideEffect.js +64 -1
  312. package/dist/modifiers/animations/slideEffect.native.js +53 -1
  313. package/dist/modifiers/animations/slideEffect.web.js +3 -1
  314. package/dist/modifiers/applyStyles.js +7 -1
  315. package/dist/modifiers/background.js +34 -1
  316. package/dist/modifiers/border.js +86 -1
  317. package/dist/modifiers/colorConverter.js +13 -1
  318. package/dist/modifiers/cursor.js +21 -1
  319. package/dist/modifiers/default.js +9 -1
  320. package/dist/modifiers/display.js +22 -1
  321. package/dist/modifiers/flex.js +20 -1
  322. package/dist/modifiers/flexWrapper.js +87 -1
  323. package/dist/modifiers/fullColor.js +32 -1
  324. package/dist/modifiers/grid.js +27 -1
  325. package/dist/modifiers/hover.js +28 -1
  326. package/dist/modifiers/logger.js +6 -1
  327. package/dist/modifiers/margin.js +25 -1
  328. package/dist/modifiers/overflow.js +28 -1
  329. package/dist/modifiers/padding.js +25 -1
  330. package/dist/modifiers/position.js +57 -1
  331. package/dist/modifiers/responsiveConverter.js +19 -1
  332. package/dist/modifiers/shadow.js +35 -1
  333. package/dist/modifiers/size.js +59 -1
  334. package/dist/modifiers/sizeConverter.js +12 -1
  335. package/dist/modifiers/state.js +33 -1
  336. package/dist/modifiers/text.js +62 -1
  337. package/dist/modifiers/textConverter.js +12 -1
  338. package/dist/modifiers/themeComponent.js +11 -1
  339. package/dist/responsive/ResponsiveHandler.js +28 -1
  340. package/dist/responsive/index.js +2 -1
  341. package/dist/responsive/responsiveHooks.js +67 -1
  342. package/dist/theme/ThemeHandler.js +81 -1
  343. package/dist/theme/default/base.js +95 -1
  344. package/dist/theme/default/blackTheme.js +47 -1
  345. package/dist/theme/default/cyberpunkTheme.js +36 -1
  346. package/dist/theme/default/darkTheme.js +35 -1
  347. package/dist/theme/default/hackerTheme.js +55 -1
  348. package/dist/theme/default/lightTheme.js +35 -1
  349. package/dist/theme/default/paperTheme.js +36 -1
  350. package/dist/theme/default/themes.js +15 -1
  351. package/dist/theme/format/colorsVariations.js +31 -1
  352. package/dist/theme/format/formatTheme.js +28 -1
  353. package/dist/theme/helpers/colorScale.js +12 -1
  354. package/dist/theme/helpers/contrastColor.js +18 -1
  355. package/dist/theme/helpers/dynamicColor.js +32 -1
  356. package/dist/theme/helpers/mergePreset.js +7 -1
  357. package/dist/theme/helpers/relatedScales.js +34 -1
  358. package/dist/theme/helpers/sizeScale.js +20 -1
  359. package/dist/theme/helpers/textScale.js +15 -1
  360. package/dist/theme/index.js +2 -1
  361. package/package.json +1 -3
  362. package/src/abstractions/Icon.js +1 -1
  363. package/src/abstractions/TextInput.js +10 -1
  364. package/src/abstractions/TouchableOpacity.native.js +8 -2
  365. package/src/components/actions/ActionsDrawer.js +1 -1
  366. package/src/components/actions/Button.js +3 -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/LinkInput.js +1 -1
  391. package/src/components/inputs/NumberInput.js +10 -5
  392. package/src/components/inputs/NumberRangeInput.js +41 -0
  393. package/src/components/inputs/PasswordInput.js +24 -0
  394. package/src/components/inputs/Picker.js +3 -3
  395. package/src/components/inputs/Select.js +61 -47
  396. package/src/components/inputs/TextArea.js +5 -0
  397. package/src/components/inputs/TextInput.js +14 -4
  398. package/src/components/inputs/UploadInput.js +140 -0
  399. package/src/components/inputs/index.js +9 -0
  400. package/src/components/inputs/upload/Upload.js +99 -0
  401. package/src/components/inputs/upload/Upload.native.js +154 -0
  402. package/src/components/inputs/upload/useUploadState.js +143 -0
  403. package/src/components/layout/LayoutHeader.js +1 -0
  404. package/src/components/presentation/AvatarLabel.js +1 -1
  405. package/src/components/presentation/AvatarsGroup.js +30 -0
  406. package/src/components/presentation/Badge.js +3 -2
  407. package/src/components/presentation/ContentLabel.js +1 -1
  408. package/src/components/presentation/IconLabel.js +1 -0
  409. package/src/components/presentation/Progress.js +20 -0
  410. package/src/components/presentation/index.js +2 -0
  411. package/src/components/sections/Section.js +1 -1
  412. package/src/components/sections/SectionItemLink.js +4 -2
  413. package/src/components/steps/ActiveStepContent.js +16 -0
  414. package/src/components/steps/StepsHandler.js +53 -0
  415. package/src/components/steps/StepsMenu.js +14 -0
  416. package/src/components/steps/StepsNavigation.js +37 -0
  417. package/src/components/steps/index.js +4 -0
  418. package/src/components/structure/Affix.js +34 -0
  419. package/src/components/structure/Affix.native.js +3 -0
  420. package/src/components/structure/Card.js +1 -0
  421. package/src/components/structure/TopBar.js +13 -1
  422. package/src/components/structure/index.js +1 -0
  423. package/src/components/structure/overlay/OverlayHandler.js +9 -1
  424. package/src/components/structure/popover/Popover.js +22 -5
  425. package/src/components/table/DataTable.js +7 -2
  426. package/src/components/table/Table.js +2 -1
  427. package/src/components/tabs/ActiveTabContent.js +4 -1
  428. package/src/components/text/DateText.js +15 -2
  429. package/src/modifiers/border.js +15 -9
  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
@@ -1 +1,55 @@
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/helpers/LazyRender.js";var _excluded=["children","delay","whenVisible","destroyOffScreen","minHeight"];import React from'react';import{View}from"../structure/View";import{jsx as _jsx}from"react/jsx-runtime";export function LazyRender(_ref){var children=_ref.children,_ref$delay=_ref.delay,delay=_ref$delay===void 0?0:_ref$delay,_ref$whenVisible=_ref.whenVisible,whenVisible=_ref$whenVisible===void 0?false:_ref$whenVisible,_ref$destroyOffScreen=_ref.destroyOffScreen,destroyOffScreen=_ref$destroyOffScreen===void 0?false:_ref$destroyOffScreen,initMinHeight=_ref.minHeight,props=_objectWithoutProperties(_ref,_excluded);var ref=React.useRef(null);var _React$useState=React.useState(!whenVisible&&!delay),_React$useState2=_slicedToArray(_React$useState,2),open=_React$useState2[0],setOpen=_React$useState2[1];var _React$useState3=React.useState(initMinHeight),_React$useState4=_slicedToArray(_React$useState3,2),minHeight=_React$useState4[0],setMinHeight=_React$useState4[1];React.useEffect(function(){if(!whenVisible)return;var observer=new IntersectionObserver(function(_ref2){var _ref3=_slicedToArray(_ref2,1),entry=_ref3[0];setOpen(function(open){if(entry.isIntersecting)return true;return destroyOffScreen?false:open;});},{threshold:0});if(ref.current)observer.observe(ref.current);return function(){if(ref.current)observer.unobserve(ref.current);};},[whenVisible,destroyOffScreen]);React.useEffect(function(){if(delay>0&&!whenVisible){var timer=setTimeout(function(){return setOpen(true);},delay);return function(){return clearTimeout(timer);};}},[]);React.useEffect(function(){if(ref.current){setMinHeight(ref.current.offsetHeight);}},[open]);return _jsx(View,Object.assign({className:"neko-lazy-render",flex:"0 0 auto"},props,{minHeight:minHeight,ref:ref,children:open?children:null}));}
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/helpers/LazyRender.js";var _excluded = ["children", "delay", "whenVisible", "destroyOffScreen", "minHeight"];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 { View } from "../structure/View";import { jsx as _jsx } from "react/jsx-runtime";
4
+
5
+ export function LazyRender(_ref)
6
+
7
+
8
+
9
+
10
+
11
+
12
+ {var children = _ref.children,_ref$delay = _ref.delay,delay = _ref$delay === void 0 ? 0 : _ref$delay,_ref$whenVisible = _ref.whenVisible,whenVisible = _ref$whenVisible === void 0 ? false : _ref$whenVisible,_ref$destroyOffScreen = _ref.destroyOffScreen,destroyOffScreen = _ref$destroyOffScreen === void 0 ? false : _ref$destroyOffScreen,initMinHeight = _ref.minHeight,props = _objectWithoutProperties(_ref, _excluded);
13
+ var ref = React.useRef(null);
14
+ var _React$useState = React.useState(!whenVisible && !delay),_React$useState2 = _slicedToArray(_React$useState, 2),open = _React$useState2[0],setOpen = _React$useState2[1];
15
+ var _React$useState3 = React.useState(initMinHeight),_React$useState4 = _slicedToArray(_React$useState3, 2),minHeight = _React$useState4[0],setMinHeight = _React$useState4[1];
16
+
17
+ React.useEffect(function () {
18
+ if (!whenVisible) return;
19
+
20
+ var observer = new IntersectionObserver(
21
+ function (_ref2) {var _ref3 = _slicedToArray(_ref2, 1),entry = _ref3[0];
22
+ setOpen(function (open) {
23
+ if (entry.isIntersecting) return true;
24
+ return destroyOffScreen ? false : open;
25
+ });
26
+ },
27
+ { threshold: 0 }
28
+ );
29
+
30
+ if (ref.current) observer.observe(ref.current);
31
+
32
+ return function () {
33
+ if (ref.current) observer.unobserve(ref.current);
34
+ };
35
+ }, [whenVisible, destroyOffScreen]);
36
+
37
+ React.useEffect(function () {
38
+ if (delay > 0 && !whenVisible) {
39
+ var timer = setTimeout(function () {return setOpen(true);}, delay);
40
+ return function () {return clearTimeout(timer);};
41
+ }
42
+ }, []);
43
+
44
+ React.useEffect(function () {
45
+ if (ref.current) {
46
+ setMinHeight(ref.current.offsetHeight);
47
+ }
48
+ }, [open]);
49
+
50
+ return (
51
+ _jsx(View, Object.assign({ className: "neko-lazy-render", flex: "0 0 auto" }, props, { minHeight: minHeight, ref: ref, children:
52
+ open ? children : null })
53
+ ));
54
+
55
+ }
@@ -1 +1,58 @@
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/helpers/LazyRender.native.js";var _excluded=["children","delay","whenVisible","destroyOffScreen","minHeight"];import{Dimensions}from"react-native-web";import React from'react';import{View}from"../structure/View";import{jsx as _jsx}from"react/jsx-runtime";export function LazyRender(_ref){var children=_ref.children,_ref$delay=_ref.delay,delay=_ref$delay===void 0?0:_ref$delay,_ref$whenVisible=_ref.whenVisible,whenVisible=_ref$whenVisible===void 0?false:_ref$whenVisible,_ref$destroyOffScreen=_ref.destroyOffScreen,destroyOffScreen=_ref$destroyOffScreen===void 0?false:_ref$destroyOffScreen,initMinHeight=_ref.minHeight,props=_objectWithoutProperties(_ref,_excluded);var ref=React.useRef(null);var _React$useState=React.useState(!whenVisible&&!delay),_React$useState2=_slicedToArray(_React$useState,2),open=_React$useState2[0],setOpen=_React$useState2[1];var _React$useState3=React.useState(initMinHeight),_React$useState4=_slicedToArray(_React$useState3,2),minHeight=_React$useState4[0],setMinHeight=_React$useState4[1];var windowHeight=Dimensions.get('window').height;var checkVisibility=React.useCallback(function(){if(!ref.current)return;ref.current.measureInWindow(function(x,y,width,height){var isVisible=y+height>0&&y<windowHeight;setOpen(function(prev){if(isVisible)return true;return destroyOffScreen?false:prev;});});},[windowHeight,destroyOffScreen]);React.useEffect(function(){if(whenVisible){checkVisibility();var interval=setInterval(checkVisibility,100);return function(){return clearInterval(interval);};}},[whenVisible,checkVisibility]);React.useEffect(function(){if(delay>0&&!whenVisible){var timer=setTimeout(function(){return setOpen(true);},delay);return function(){return clearTimeout(timer);};}},[]);React.useEffect(function(){if(ref.current&&open){ref.current.measure(function(x,y,width,height){setMinHeight(height);});}},[open]);return _jsx(View,Object.assign({className:"neko-lazy-render",flex:"0 0 auto"},props,{minHeight:minHeight,ref:ref,children:open?children:null}));}
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/helpers/LazyRender.native.js";var _excluded = ["children", "delay", "whenVisible", "destroyOffScreen", "minHeight"];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 { Dimensions } from "react-native-web";
2
+ import React from 'react';
3
+
4
+ import { View } from "../structure/View";import { jsx as _jsx } from "react/jsx-runtime";
5
+
6
+ export function LazyRender(_ref)
7
+
8
+
9
+
10
+
11
+
12
+
13
+ {var children = _ref.children,_ref$delay = _ref.delay,delay = _ref$delay === void 0 ? 0 : _ref$delay,_ref$whenVisible = _ref.whenVisible,whenVisible = _ref$whenVisible === void 0 ? false : _ref$whenVisible,_ref$destroyOffScreen = _ref.destroyOffScreen,destroyOffScreen = _ref$destroyOffScreen === void 0 ? false : _ref$destroyOffScreen,initMinHeight = _ref.minHeight,props = _objectWithoutProperties(_ref, _excluded);
14
+ var ref = React.useRef(null);
15
+ var _React$useState = React.useState(!whenVisible && !delay),_React$useState2 = _slicedToArray(_React$useState, 2),open = _React$useState2[0],setOpen = _React$useState2[1];
16
+ var _React$useState3 = React.useState(initMinHeight),_React$useState4 = _slicedToArray(_React$useState3, 2),minHeight = _React$useState4[0],setMinHeight = _React$useState4[1];
17
+ var windowHeight = Dimensions.get('window').height;
18
+
19
+ var checkVisibility = React.useCallback(function () {
20
+ if (!ref.current) return;
21
+ ref.current.measureInWindow(function (x, y, width, height) {
22
+ var isVisible = y + height > 0 && y < windowHeight;
23
+ setOpen(function (prev) {
24
+ if (isVisible) return true;
25
+ return destroyOffScreen ? false : prev;
26
+ });
27
+ });
28
+ }, [windowHeight, destroyOffScreen]);
29
+
30
+ React.useEffect(function () {
31
+ if (whenVisible) {
32
+ checkVisibility();
33
+ var interval = setInterval(checkVisibility, 100);
34
+ return function () {return clearInterval(interval);};
35
+ }
36
+ }, [whenVisible, checkVisibility]);
37
+
38
+ React.useEffect(function () {
39
+ if (delay > 0 && !whenVisible) {
40
+ var timer = setTimeout(function () {return setOpen(true);}, delay);
41
+ return function () {return clearTimeout(timer);};
42
+ }
43
+ }, []);
44
+
45
+ React.useEffect(function () {
46
+ if (ref.current && open) {
47
+ ref.current.measure(function (x, y, width, height) {
48
+ setMinHeight(height);
49
+ });
50
+ }
51
+ }, [open]);
52
+
53
+ return (
54
+ _jsx(View, Object.assign({ className: "neko-lazy-render", flex: "0 0 auto" }, props, { minHeight: minHeight, ref: ref, children:
55
+ open ? children : null })
56
+ ));
57
+
58
+ }
@@ -1 +1,21 @@
1
- import React from'react';import{usePortal}from"./PortalHandler";var idCounter=0;export function Portal(_ref){var children=_ref.children;var keyRef=React.useRef(++idCounter);var _usePortal=usePortal(),mount=_usePortal.mount,update=_usePortal.update,unmount=_usePortal.unmount;React.useEffect(function(){mount(keyRef.current,children);return function(){return unmount(keyRef.current);};},[]);React.useEffect(function(){update(keyRef.current,children);},[children]);return null;}
1
+ import React from 'react';
2
+
3
+ import { usePortal } from "./PortalHandler";
4
+
5
+ var idCounter = 0;
6
+
7
+ export function Portal(_ref) {var children = _ref.children;
8
+ var keyRef = React.useRef(++idCounter);
9
+ var _usePortal = usePortal(),mount = _usePortal.mount,update = _usePortal.update,unmount = _usePortal.unmount;
10
+
11
+ React.useEffect(function () {
12
+ mount(keyRef.current, children);
13
+ return function () {return unmount(keyRef.current);};
14
+ }, []);
15
+
16
+ React.useEffect(function () {
17
+ update(keyRef.current, children);
18
+ }, [children]);
19
+
20
+ return null;
21
+ }
@@ -1 +1,32 @@
1
- import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/helpers/PortalHandler.js";import React from'react';import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var PortalContext=React.createContext(null);export var usePortal=function usePortal(){return React.useContext(PortalContext)||{};};export function PortalHandler(_ref){var _this=this;var children=_ref.children;var _React$useState=React.useState([]),_React$useState2=_slicedToArray(_React$useState,2),portals=_React$useState2[0],setPortals=_React$useState2[1];var mount=React.useCallback(function(key,element){setPortals(function(prev){return[].concat(_toConsumableArray(prev),[{key:key,element:element}]);});},[]);var update=React.useCallback(function(key,element){setPortals(function(prev){return prev.map(function(p){return p.key===key?Object.assign({},p,{element:element}):p;});});},[]);var unmount=React.useCallback(function(key){setPortals(function(prev){return prev.filter(function(p){return p.key!==key;});});},[]);var value=React.useMemo(function(){return{mount:mount,update:update,unmount:unmount};},[mount,update,unmount]);return _jsxs(PortalContext.Provider,{value:value,children:[children,portals.map(function(p){return _jsx(React.Fragment,{children:p.element},p.key);})]});}
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/helpers/PortalHandler.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 _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 React from 'react';import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+
3
+ var PortalContext = React.createContext(null);
4
+
5
+ export var usePortal = function usePortal() {return React.useContext(PortalContext) || {};};
6
+
7
+ export function PortalHandler(_ref) {var _this = this;var children = _ref.children;
8
+ var _React$useState = React.useState([]),_React$useState2 = _slicedToArray(_React$useState, 2),portals = _React$useState2[0],setPortals = _React$useState2[1];
9
+
10
+ var mount = React.useCallback(function (key, element) {
11
+ setPortals(function (prev) {return [].concat(_toConsumableArray(prev), [{ key: key, element: element }]);});
12
+ }, []);
13
+
14
+ var update = React.useCallback(function (key, element) {
15
+ setPortals(function (prev) {return prev.map(function (p) {return p.key === key ? Object.assign({}, p, { element: element }) : p;});});
16
+ }, []);
17
+
18
+ var unmount = React.useCallback(function (key) {
19
+ setPortals(function (prev) {return prev.filter(function (p) {return p.key !== key;});});
20
+ }, []);
21
+
22
+ var value = React.useMemo(function () {return { mount: mount, update: update, unmount: unmount };}, [mount, update, unmount]);
23
+
24
+ return (
25
+ _jsxs(PortalContext.Provider, { value: value, children: [
26
+ children,
27
+ portals.map(function (p) {return (
28
+ _jsx(React.Fragment, { children: p.element }, p.key));}
29
+ )] }
30
+ ));
31
+
32
+ }
@@ -1 +1,18 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["children"],_excluded2=["children"];import{useResponsiveValue}from"../../responsive/responsiveHooks";export function ResponsiveRender(props){var value=useResponsiveValue(props)||props.df;return typeof value==='function'?value():value;}export function HideOn(_ref){var children=_ref.children,props=_objectWithoutProperties(_ref,_excluded);var hide=useResponsiveValue(props);if(!!hide)return false;return children;}export function ShowOn(_ref2){var children=_ref2.children,props=_objectWithoutProperties(_ref2,_excluded2);var show=useResponsiveValue(props);if(!show)return false;return children;}
1
+ var _excluded = ["children"],_excluded2 = ["children"];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 { useResponsiveValue } from "../../responsive/responsiveHooks";
2
+
3
+ export function ResponsiveRender(props) {
4
+ var value = useResponsiveValue(props) || props.df;
5
+ return typeof value === 'function' ? value() : value;
6
+ }
7
+
8
+ export function HideOn(_ref) {var children = _ref.children,props = _objectWithoutProperties(_ref, _excluded);
9
+ var hide = useResponsiveValue(props);
10
+ if (!!hide) return false;
11
+ return children;
12
+ }
13
+
14
+ export function ShowOn(_ref2) {var children = _ref2.children,props = _objectWithoutProperties(_ref2, _excluded2);
15
+ var show = useResponsiveValue(props);
16
+ if (!show) return false;
17
+ return children;
18
+ }
@@ -1 +1,49 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/helpers/Separator.js";var _excluded=["line","lineProps"];import{pipe,is}from'ramda';import{AbsView}from"../../abstractions/View";import{View}from"../structure/View";import{useColorConverter}from"../../modifiers/colorConverter";import{useDefaultModifier}from"../../modifiers/default";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useMarginModifier}from"../../modifiers/margin";import{useSizeConverter}from"../../modifiers/sizeConverter";import{useSizeModifier}from"../../modifiers/size";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_PROPS=function DEFAULT_PROPS(_ref){var _ref2=_slicedToArray(_ref,2),_ref2$=_ref2[0],size=_ref2$.size,sizeCode=_ref2$.sizeCode,line=_ref2[1].line;return{height:!!line?2*size:size,br:sizeCode,center:true,fullW:true};};export function Separator(rootProps){var _pipe=pipe(useColorConverter('divider'),useSizeConverter('spaces','md'),useThemeComponentModifier('Separator'),useDefaultModifier(DEFAULT_PROPS),useSizeModifier,useMarginModifier,useFlexModifier,useFlexWrapperModifier)([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),color=_pipe2[0].color,formattedProps=_pipe2[1];var line=formattedProps.line,lineProps=formattedProps.lineProps,props=_objectWithoutProperties(formattedProps,_excluded);var lineHeight=is(Number,line)?line:1;return _jsx(AbsView,Object.assign({className:"neko-separator"},props,{children:!!line&&_jsx(View,Object.assign({bg:color,br:lineHeight,height:lineHeight,fullW:true,className:"neko-separator-line"},lineProps))}));}export var Divider=Separator;
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/helpers/Separator.js";var _excluded = ["line", "vertical", "lineProps"];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 { pipe, is } from 'ramda';
2
+
3
+ import { AbsView } from "../../abstractions/View";
4
+ import { View } from "../structure/View";
5
+ import { useColorConverter } from "../../modifiers/colorConverter";
6
+ import { useDefaultModifier } from "../../modifiers/default";
7
+ import { useFlexModifier } from "../../modifiers/flex";
8
+ import { useFlexWrapperModifier } from "../../modifiers/flexWrapper";
9
+ import { useMarginModifier } from "../../modifiers/margin";
10
+ import { useSizeConverter } from "../../modifiers/sizeConverter";
11
+ import { useSizeModifier } from "../../modifiers/size";
12
+ import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx } from "react/jsx-runtime";
13
+
14
+ var DEFAULT_PROPS = function DEFAULT_PROPS(_ref) {var _ref2 = _slicedToArray(_ref, 2),_ref2$ = _ref2[0],size = _ref2$.size,sizeCode = _ref2$.sizeCode,_ref2$2 = _ref2[1],line = _ref2$2.line,vertical = _ref2$2.vertical;
15
+ var lineSize = is(Number, line) ? line : 1;
16
+ return Object.assign({},
17
+ vertical ?
18
+ { width: !!line ? 2 * size : size, fullH: true, row: true } :
19
+ { height: !!line ? 2 * size : size, fullW: true }, {
20
+ br: sizeCode,
21
+ center: true,
22
+ lineProps: vertical ?
23
+ { width: lineSize, fullH: true, br: lineSize } :
24
+ { height: lineSize, fullW: true, br: lineSize } });
25
+
26
+ };
27
+
28
+ export function Separator(rootProps) {
29
+ var _pipe = pipe(
30
+ useColorConverter('divider'),
31
+ useSizeConverter('spaces', 'md'),
32
+ useThemeComponentModifier('Separator'),
33
+ useDefaultModifier(DEFAULT_PROPS),
34
+ useSizeModifier,
35
+ useMarginModifier,
36
+ useFlexModifier,
37
+ useFlexWrapperModifier
38
+ )([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),color = _pipe2[0].color,formattedProps = _pipe2[1];
39
+
40
+ var line = formattedProps.line,vertical = formattedProps.vertical,lineProps = formattedProps.lineProps,props = _objectWithoutProperties(formattedProps, _excluded);
41
+
42
+ return (
43
+ _jsx(AbsView, Object.assign({ className: "neko-separator" }, props, { children:
44
+ !!line && _jsx(View, Object.assign({ bg: color, className: "neko-separator-line" }, lineProps)) })
45
+ ));
46
+
47
+ }
48
+
49
+ export var Divider = Separator;
@@ -1 +1,34 @@
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/helpers/VerticalView.js";var _excluded=["children","invert"];import React from'react';import{View}from"../structure/View";import{formatTransform}from"../../abstractions/helpers/transformStyle";import{getElementSize}from"../../abstractions/helpers/componentSize";import{jsx as _jsx}from"react/jsx-runtime";export function VerticalView(_ref){var children=_ref.children,invert=_ref.invert,props=_objectWithoutProperties(_ref,_excluded);var wrapperRef=React.useRef(null);var _React$useState=React.useState({}),_React$useState2=_slicedToArray(_React$useState,2),size=_React$useState2[0],setSize=_React$useState2[1];React.useLayoutEffect(function(){getElementSize(wrapperRef,setSize);},[]);var height=size.height,width=size.width;return _jsx(View,Object.assign({width:"100%",height:"100%"},props,{relative:true,ref:wrapperRef,children:_jsx(View,{style:{position:'absolute',width:height,height:width,transform:formatTransform([{rotate:!!invert?'90deg':'-90deg'}]),left:width/2-height/2,top:'50%',marginTop:-width/2},children:children})}));}
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/helpers/VerticalView.js";var _excluded = ["children", "invert"];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 { View } from "../structure/View";
4
+ import { formatTransform } from "../../abstractions/helpers/transformStyle";
5
+ import { getElementSize } from "../../abstractions/helpers/componentSize";import { jsx as _jsx } from "react/jsx-runtime";
6
+
7
+ export function VerticalView(_ref) {var children = _ref.children,invert = _ref.invert,props = _objectWithoutProperties(_ref, _excluded);
8
+ var wrapperRef = React.useRef(null);
9
+ var _React$useState = React.useState({}),_React$useState2 = _slicedToArray(_React$useState, 2),size = _React$useState2[0],setSize = _React$useState2[1];
10
+
11
+ React.useLayoutEffect(function () {
12
+ getElementSize(wrapperRef, setSize);
13
+ }, []);
14
+
15
+ var height = size.height,width = size.width;
16
+
17
+ return (
18
+ _jsx(View, Object.assign({ width: "100%", height: "100%" }, props, { relative: true, ref: wrapperRef, children:
19
+ _jsx(View, {
20
+ style: {
21
+ position: 'absolute',
22
+ width: height,
23
+ height: width,
24
+ transform: formatTransform([{ rotate: !!invert ? '90deg' : '-90deg' }]),
25
+ left: width / 2 - height / 2,
26
+ top: '50%',
27
+ marginTop: -width / 2
28
+ }, children:
29
+
30
+ children }
31
+ ) })
32
+ ));
33
+
34
+ }
@@ -1 +1,8 @@
1
- export*from"./Separator";export*from"./Responsive";export*from"./VerticalView";export*from"./PortalHandler";export*from"./Portal";export*from"./LazyRender";export*from"./ConditionalLazyRender";
1
+ export * from "./Separator";
2
+ export * from "./Responsive";
3
+ export * from "./VerticalView";
4
+ export * from "./PortalHandler";
5
+ export * from "./Portal";
6
+ export * from "./LazyAction";
7
+ export * from "./LazyRender";
8
+ export * from "./ConditionalLazyRender";
@@ -1 +1,20 @@
1
- export*from"./actions";export*from"./animations";export*from"./form";export*from"./presentation";export*from"./structure";export*from"./modals";export*from"./text";export*from"./helpers";export*from"./inputs";export*from"./state";export*from"./layout";export*from"./table";export*from"./feedback";export*from"./calendar";export*from"./list";export*from"./tabs";export*from"./theme";export*from"./sections";
1
+ export * from "./actions";
2
+ export * from "./animations";
3
+ export * from "./form";
4
+ export * from "./presentation";
5
+ export * from "./structure";
6
+ export * from "./modals";
7
+ export * from "./text";
8
+ export * from "./helpers";
9
+ export * from "./inputs";
10
+ export * from "./state";
11
+ export * from "./layout";
12
+ export * from "./table";
13
+ export * from "./feedback";
14
+ export * from "./calendar";
15
+ export * from "./list";
16
+ export * from "./tabs";
17
+ export * from "./theme";
18
+ export * from "./sections";
19
+ export * from "./filter";
20
+ export * from "./steps";
@@ -0,0 +1,14 @@
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/BooleanSelect.js";var _excluded = ["trueLabel", "falseLabel", "placeholder"];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 { Select } from "./Select";import { jsx as _jsx } from "react/jsx-runtime";
2
+
3
+ export function BooleanSelect(_ref) {var _ref$trueLabel = _ref.trueLabel,trueLabel = _ref$trueLabel === void 0 ? 'True' : _ref$trueLabel,_ref$falseLabel = _ref.falseLabel,falseLabel = _ref$falseLabel === void 0 ? 'False' : _ref$falseLabel,placeholder = _ref.placeholder,props = _objectWithoutProperties(_ref, _excluded);
4
+ return (
5
+ _jsx(Select, Object.assign({
6
+ placeholder: placeholder,
7
+ options: [
8
+ { label: trueLabel, value: true },
9
+ { label: falseLabel, value: false }] },
10
+
11
+ props)
12
+ ));
13
+
14
+ }
@@ -1 +1,56 @@
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/inputs/Checkbox.js";var _excluded=["value","onChange","disabled","initialValue"],_excluded2=["checkboxProps"],_excluded3=["option","selected","onChange","labelKey"];import{pipe}from'ramda';import React from'react';import{AbsHiddenInput}from"../../abstractions/HiddenInput";import{ContentLabel}from"../presentation/ContentLabel";import{Link}from"../actions/Link";import{Picker}from"./Picker";import{View}from"../structure/View";import{useColorConverter}from"../../modifiers/colorConverter";import{useSizeConverter}from"../../modifiers/sizeConverter";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function Checkbox(_ref){var value=_ref.value,onChange=_ref.onChange,disabled=_ref.disabled,initialValue=_ref.initialValue,rootProps=_objectWithoutProperties(_ref,_excluded);var _pipe=pipe(useColorConverter('primary'),useSizeConverter('elementHeights','md'),useThemeComponentModifier('Checkbox'))([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_pipe2$=_pipe2[0],size=_pipe2$.size,sizeCode=_pipe2$.sizeCode,color=_pipe2$.color,props=_pipe2[1];var _React$useState=React.useState(initialValue),_React$useState2=_slicedToArray(_React$useState,2),localValue=_React$useState2[0],setLocalValue=_React$useState2[1];value=value===undefined?localValue:value;var toggle=function toggle(){if(!!disabled)return;setLocalValue(!value);onChange==null?void 0:onChange(!value);};return _jsxs(Link,{onPress:toggle,className:"neko-checkbox",disabled:disabled,children:[_jsx(AbsHiddenInput,{checked:value,onChange:toggle,type:"checkbox",disabled:disabled}),_jsx(ContentLabel,Object.assign({size:sizeCode,gap:8,content:_jsx(View,{height:size*0.65,ratio:1,border:2,padding:2,borderColor:color,br:3,center:true,children:!!value&&_jsx(View,{bg:color,br:2,flex:true,fullW:true,fullH:true})})},props))]});}export function CheckboxGroup(_ref2){var _this=this;var checkboxProps=_ref2.checkboxProps,props=_objectWithoutProperties(_ref2,_excluded2);return _jsx(Picker,Object.assign({},props,{multiple:true,renderOption:function renderOption(_ref3){var option=_ref3.option,selected=_ref3.selected,onChange=_ref3.onChange,labelKey=_ref3.labelKey,props=_objectWithoutProperties(_ref3,_excluded3);return _jsx(Checkbox,Object.assign({label:option[labelKey],value:selected,onChange:onChange},props,checkboxProps));}}));}
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/Checkbox.js";var _excluded = ["value", "onChange", "disabled", "initialValue"],_excluded2 = ["checkboxProps"],_excluded3 = ["option", "selected", "onChange", "labelKey"];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 { pipe } from 'ramda';
2
+ import React from 'react';
3
+
4
+ import { AbsHiddenInput } from "../../abstractions/HiddenInput";
5
+ import { ContentLabel } from "../presentation/ContentLabel";
6
+ import { Link } from "../actions/Link";
7
+ import { Picker } from "./Picker";
8
+ import { View } from "../structure/View";
9
+ import { useColorConverter } from "../../modifiers/colorConverter";
10
+ import { useSizeConverter } from "../../modifiers/sizeConverter";
11
+ import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+
13
+ export function Checkbox(_ref) {var value = _ref.value,onChange = _ref.onChange,disabled = _ref.disabled,initialValue = _ref.initialValue,rootProps = _objectWithoutProperties(_ref, _excluded);
14
+ var _pipe = pipe(
15
+ useColorConverter('primary'),
16
+ useSizeConverter('elementHeights', 'md'),
17
+ useThemeComponentModifier('Checkbox')
18
+ )([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_pipe2$ = _pipe2[0],size = _pipe2$.size,sizeCode = _pipe2$.sizeCode,color = _pipe2$.color,props = _pipe2[1];
19
+
20
+ var _React$useState = React.useState(initialValue),_React$useState2 = _slicedToArray(_React$useState, 2),localValue = _React$useState2[0],setLocalValue = _React$useState2[1];
21
+ value = value === undefined ? localValue : value;
22
+
23
+ var toggle = function toggle() {
24
+ if (!!disabled) return;
25
+ setLocalValue(!value);
26
+ onChange == null ? void 0 : onChange(!value);
27
+ };
28
+
29
+ return (
30
+ _jsxs(Link, { onPress: toggle, className: "neko-checkbox", disabled: disabled, children: [
31
+ _jsx(AbsHiddenInput, { checked: value, onChange: toggle, type: "checkbox", disabled: disabled }),
32
+ _jsx(ContentLabel, Object.assign({
33
+ size: sizeCode,
34
+ gap: 8,
35
+ content:
36
+ _jsx(View, { height: size * 0.65, ratio: 1, border: 2, padding: 2, borderColor: color, br: 3, center: true, children:
37
+ !!value && _jsx(View, { bg: color, br: 2, flex: true, fullW: true, fullH: true }) }
38
+ ) },
39
+
40
+ props)
41
+ )] }
42
+ ));
43
+
44
+ }
45
+
46
+ export function CheckboxGroup(_ref2) {var _this = this;var checkboxProps = _ref2.checkboxProps,props = _objectWithoutProperties(_ref2, _excluded2);
47
+ return (
48
+ _jsx(Picker, Object.assign({},
49
+ props, {
50
+ multiple: true,
51
+ renderOption: function renderOption(_ref3) {var option = _ref3.option,selected = _ref3.selected,onChange = _ref3.onChange,labelKey = _ref3.labelKey,props = _objectWithoutProperties(_ref3, _excluded3);return (
52
+ _jsx(Checkbox, Object.assign({ label: option[labelKey], value: selected, onChange: onChange }, props, checkboxProps)));} })
53
+
54
+ ));
55
+
56
+ }
@@ -1 +1,123 @@
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/inputs/DateInput.js";var _excluded=["ref"],_excluded2=["value","onChange","min","max","onCheckDisabled","placement","type","format","useBottomDrawer"];import React from'react';import advancedFormat from'dayjs/esm/plugin/advancedFormat';import dayjs from'dayjs';import weekOfYear from'dayjs/esm/plugin/weekOfYear';import{LinkInput}from"./LinkInput";import{View}from"../structure/View";import{useResponsiveValue}from"../../responsive";dayjs.extend(advancedFormat);dayjs.extend(weekOfYear);import{DatePicker}from"./datePicker/DatePicker";import{MaskInput}from"./MaskInput";import{Popover}from"../structure/popover/Popover";import{isValidDate}from"../calendar/_helpers/dateDisabled";import{jsx as _jsx}from"react/jsx-runtime";export function getDateInputDefaultFormat(type){switch(type){case'year':return'YYYY';case'quarter':return'YYYY-Q';case'month':return'YYYY-MM';case'week':return'YYYY-ww';default:return'YYYY-MM-DD';}}function FullWidthInputWrapper(_ref){var ref=_ref.ref,props=_objectWithoutProperties(_ref,_excluded);return _jsx(View,{fullW:true,ref:ref,children:_jsx(MaskInput,Object.assign({},props))});}export function DateInput(_ref2){var _value,_this=this;var value=_ref2.value,onChange=_ref2.onChange,min=_ref2.min,max=_ref2.max,onCheckDisabled=_ref2.onCheckDisabled,placement=_ref2.placement,_ref2$type=_ref2.type,type=_ref2$type===void 0?'day':_ref2$type,format=_ref2.format,_ref2$useBottomDrawer=_ref2.useBottomDrawer,useBottomDrawer=_ref2$useBottomDrawer===void 0?{native:true,sm:true,md:true}:_ref2$useBottomDrawer,props=_objectWithoutProperties(_ref2,_excluded2);useBottomDrawer=useResponsiveValue(useBottomDrawer);format=format||getDateInputDefaultFormat(type);if(value==='')value=undefined;var _React$useState=React.useState(''),_React$useState2=_slicedToArray(_React$useState,2),inputValue=_React$useState2[0],setInputValue=_React$useState2[1];var _React$useState3=React.useState(value),_React$useState4=_slicedToArray(_React$useState3,2),localValue=_React$useState4[0],setLocalValue=_React$useState4[1];value=value||localValue;var validations={min:min,max:max,onCheckDisabled:onCheckDisabled};var handleChange=function handleChange(v){if(!isValidDate(v,format,validations))return;v=!!v?dayjs(v):null;setLocalValue(v);onChange==null?void 0:onChange(v);};var handleChangeInput=function handleChangeInput(v){setInputValue(v);if(!isValidDate(v,format,validations))return;handleChange(v);};var onBlur=function onBlur(){if(isValidDate(inputValue,format,validations))return;handleChange(null);setInputValue('');};React.useEffect(function(){setInputValue(!!value?dayjs(value).format(format):'');},[value]);var Input=useBottomDrawer?LinkInput:FullWidthInputWrapper;return _jsx(Popover,{trigger:"click",placement:placement||'bottomLeft',snapPoints:[350],useBottomDrawer:useBottomDrawer,bottomDrawerProps:{contentProps:{padding:'md'}},watch:[(_value=value)==null?void 0:_value.format==null?void 0:_value.format('YYYYMMDD')],renderContent:function renderContent(_ref3){var onClose=_ref3.onClose;return _jsx(View,{flex:true,centerH:true,children:_jsx(DatePicker,Object.assign({value:value,onChange:function onChange(v){handleChange(v);onClose();}},validations,{type:type}))});},children:_jsx(Input,Object.assign({value:inputValue,onChange:handleChangeInput,suffixIcon:"calendar-line",suffixIconColor:"text4",onBlur:onBlur,mask:format.replace(/[DMYQwW]/gi,'9')},props))});}
1
+ var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/DateInput.js";var _excluded = ["ref"],_excluded2 = ["value", "onChange", "min", "max", "onCheckDisabled", "placement", "type", "format", "startsOpen", "useBottomDrawer"];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 advancedFormat from 'dayjs/esm/plugin/advancedFormat';
3
+ import dayjs from 'dayjs';
4
+ import weekOfYear from 'dayjs/esm/plugin/weekOfYear';
5
+
6
+ import { LinkInput } from "./LinkInput";
7
+ import { View } from "../structure/View";
8
+ import { useResponsiveValue } from "../../responsive";
9
+
10
+ dayjs.extend(advancedFormat);
11
+ dayjs.extend(weekOfYear);
12
+
13
+ import { DatePicker } from "./datePicker/DatePicker";
14
+ import { MaskInput } from "./MaskInput";
15
+ import { Popover } from "../structure/popover/Popover";
16
+ import { isValidDate } from "../calendar/_helpers/dateDisabled";import { jsx as _jsx } from "react/jsx-runtime";
17
+
18
+ export function getDateInputDefaultFormat(type) {
19
+ switch (type) {
20
+ case 'year':
21
+ return 'YYYY';
22
+ case 'quarter':
23
+ return 'YYYY-Q';
24
+ case 'month':
25
+ return 'YYYY-MM';
26
+ case 'week':
27
+ return 'YYYY-ww';
28
+ default:
29
+ return 'YYYY-MM-DD';
30
+ }
31
+ }
32
+
33
+ function FullWidthInputWrapper(_ref) {var ref = _ref.ref,props = _objectWithoutProperties(_ref, _excluded);
34
+ return (
35
+ _jsx(View, { fullW: true, ref: ref, children:
36
+ _jsx(MaskInput, Object.assign({}, props)) }
37
+ ));
38
+
39
+ }
40
+
41
+ export function DateInput(_ref2)
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ {var _value,_this = this;var value = _ref2.value,onChange = _ref2.onChange,min = _ref2.min,max = _ref2.max,onCheckDisabled = _ref2.onCheckDisabled,placement = _ref2.placement,_ref2$type = _ref2.type,type = _ref2$type === void 0 ? 'day' : _ref2$type,format = _ref2.format,startsOpen = _ref2.startsOpen,_ref2$useBottomDrawer = _ref2.useBottomDrawer,useBottomDrawer = _ref2$useBottomDrawer === void 0 ? { native: true, sm: true, md: true } : _ref2$useBottomDrawer,props = _objectWithoutProperties(_ref2, _excluded2);
54
+ useBottomDrawer = useResponsiveValue(useBottomDrawer);
55
+ format = format || getDateInputDefaultFormat(type);
56
+ if (value === '') value = undefined;
57
+ var _React$useState = React.useState(''),_React$useState2 = _slicedToArray(_React$useState, 2),inputValue = _React$useState2[0],setInputValue = _React$useState2[1];
58
+ var _React$useState3 = React.useState(value),_React$useState4 = _slicedToArray(_React$useState3, 2),localValue = _React$useState4[0],setLocalValue = _React$useState4[1];
59
+
60
+ value = value || localValue;
61
+
62
+ var validations = { min: min, max: max, onCheckDisabled: onCheckDisabled };
63
+
64
+ var handleChange = function handleChange(v) {
65
+ if (!isValidDate(v, format, validations)) return;
66
+ v = !!v ? dayjs(v) : null;
67
+ setLocalValue(v);
68
+ onChange == null ? void 0 : onChange(v);
69
+ };
70
+
71
+ var handleChangeInput = function handleChangeInput(v) {
72
+ setInputValue(v);
73
+ if (!isValidDate(v, format, validations)) return;
74
+ handleChange(v);
75
+ };
76
+
77
+ var onBlur = function onBlur() {
78
+ if (isValidDate(inputValue, format, validations)) return;
79
+ handleChange(null);
80
+ setInputValue('');
81
+ };
82
+
83
+ React.useEffect(function () {
84
+ setInputValue(!!value ? dayjs(value).format(format) : '');
85
+ }, [value]);
86
+
87
+ var Input = useBottomDrawer ? LinkInput : FullWidthInputWrapper;
88
+
89
+ return (
90
+ _jsx(Popover, {
91
+ trigger: "click",
92
+ startsOpen: startsOpen,
93
+ placement: placement || 'bottomLeft',
94
+ snapPoints: [350],
95
+ useBottomDrawer: useBottomDrawer,
96
+ bottomDrawerProps: { contentProps: { padding: 'md' } },
97
+ watch: [(_value = value) == null ? void 0 : _value.format == null ? void 0 : _value.format('YYYYMMDD')],
98
+ renderContent: function renderContent(_ref3) {var onClose = _ref3.onClose;return (
99
+ _jsx(View, { flex: true, centerH: true, onMouseDown: function onMouseDown(e) {return e.preventDefault();}, children:
100
+ _jsx(DatePicker, Object.assign({
101
+ value: value,
102
+ onChange: function onChange(v) {
103
+ handleChange(v);
104
+ onClose();
105
+ } },
106
+ validations, {
107
+ type: type })
108
+ ) }
109
+ ));}, children:
110
+
111
+
112
+ _jsx(Input, Object.assign({
113
+ value: inputValue,
114
+ onChange: handleChangeInput,
115
+ suffixIcon: "calendar-line",
116
+ suffixIconColor: "text4",
117
+ onBlur: onBlur,
118
+ mask: format.replace(/[DMYQwW]/gi, '9') },
119
+ props)
120
+ ) }
121
+ ));
122
+
123
+ }