@neko-os/ui 0.2.3 → 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.
- package/dist/DynamicStyleTag.js +18 -2
- package/dist/DynamicStyleTag.native.js +3 -1
- package/dist/NekoUI.js +39 -1
- package/dist/abstractions/ActivityIndicator.js +19 -1
- package/dist/abstractions/ActivityIndicator.native.js +43 -1
- package/dist/abstractions/ActivityIndicator.web.js +43 -1
- package/dist/abstractions/AnimatedView.js +3 -1
- package/dist/abstractions/AnimatedView.native.js +5 -1
- package/dist/abstractions/AnimatedView.web.js +3 -1
- package/dist/abstractions/BlurView.js +43 -1
- package/dist/abstractions/BlurView.native.js +39 -1
- package/dist/abstractions/BlurView.web.js +39 -1
- package/dist/abstractions/DraggableSlideView.js +3 -1
- package/dist/abstractions/DraggableSlideView.native.js +62 -1
- package/dist/abstractions/FlatList.js +3 -1
- package/dist/abstractions/FlatList.native.js +37 -1
- package/dist/abstractions/FlatList.web.js +3 -1
- package/dist/abstractions/GradientView.js +5 -1
- package/dist/abstractions/GradientView.native.js +32 -1
- package/dist/abstractions/HiddenInput.js +3 -1
- package/dist/abstractions/HiddenInput.native.js +3 -1
- package/dist/abstractions/Icon.js +10 -1
- package/dist/abstractions/Icon.native.js +13 -1
- package/dist/abstractions/Icon.web.js +11 -1
- package/dist/abstractions/Image.js +12 -1
- package/dist/abstractions/Image.native.js +7 -1
- package/dist/abstractions/Image.web.js +7 -1
- package/dist/abstractions/ImageBackground.js +17 -1
- package/dist/abstractions/ImageBackground.native.js +27 -1
- package/dist/abstractions/ImageBackground.web.js +7 -1
- package/dist/abstractions/KeyboardAvoidingView.js +3 -1
- package/dist/abstractions/KeyboardAvoidingView.native.js +3 -1
- package/dist/abstractions/Platform.js +1 -1
- package/dist/abstractions/Platform.native.js +3 -1
- package/dist/abstractions/Platform.web.js +3 -1
- package/dist/abstractions/Pressable.js +4 -1
- package/dist/abstractions/Pressable.native.js +3 -1
- package/dist/abstractions/Pressable.web.js +3 -1
- package/dist/abstractions/SafeAreaView.js +3 -1
- package/dist/abstractions/SafeAreaView.native.js +3 -1
- package/dist/abstractions/ScrollView.js +3 -1
- package/dist/abstractions/ScrollView.native.js +5 -1
- package/dist/abstractions/ScrollView.web.js +3 -1
- package/dist/abstractions/StaticList.js +51 -1
- package/dist/abstractions/Switch.js +97 -1
- package/dist/abstractions/Switch.native.js +12 -1
- package/dist/abstractions/Table.js +29 -1
- package/dist/abstractions/Table.native.js +19 -1
- package/dist/abstractions/Text.js +14 -1
- package/dist/abstractions/Text.native.js +3 -1
- package/dist/abstractions/Text.web.js +18 -1
- package/dist/abstractions/TextInput.js +12 -1
- package/dist/abstractions/TextInput.native.js +5 -1
- package/dist/abstractions/TextInput.web.js +5 -1
- package/dist/abstractions/TouchableOpacity.js +4 -1
- package/dist/abstractions/TouchableOpacity.native.js +3 -1
- package/dist/abstractions/View.js +3 -1
- package/dist/abstractions/View.native.js +3 -1
- package/dist/abstractions/View.web.js +3 -1
- package/dist/abstractions/helpers/componentSize.js +13 -1
- package/dist/abstractions/helpers/componentSize.native.js +12 -1
- package/dist/abstractions/helpers/storage.js +32 -1
- package/dist/abstractions/helpers/storage.native.js +34 -1
- package/dist/abstractions/helpers/transformStyle.js +8 -1
- package/dist/abstractions/helpers/transformStyle.native.js +3 -1
- package/dist/abstractions/helpers/useSafeAreaInsets.js +3 -1
- package/dist/abstractions/helpers/useSafeAreaInsets.native.js +3 -1
- package/dist/abstractions/helpers/windowWidth.js +13 -1
- package/dist/abstractions/helpers/windowWidth.native.js +6 -1
- package/dist/abstractions/helpers/windowWidth.web.js +6 -1
- package/dist/components/actions/ActionsDrawer.js +81 -1
- package/dist/components/actions/Breadcrumb.js +47 -1
- package/dist/components/actions/Button.js +82 -1
- package/dist/components/actions/Dropdown.js +91 -1
- package/dist/components/actions/FloatingButton.js +87 -1
- package/dist/components/actions/FloatingMenu.js +39 -1
- package/dist/components/actions/Link.js +66 -1
- package/dist/components/actions/Pressable.js +38 -1
- package/dist/components/actions/index.js +9 -1
- package/dist/components/actions/menu/HorizontalMenu.js +98 -1
- package/dist/components/actions/menu/Menu.js +7 -1
- package/dist/components/actions/menu/SubmenuWrapper.js +16 -1
- package/dist/components/actions/menu/VerticalMenu.js +133 -1
- package/dist/components/animations/AnimatedTopBar.js +10 -1
- package/dist/components/animations/AnimatedTopBar.native.js +34 -1
- package/dist/components/animations/AnimatedTopBar.web.js +1 -1
- package/dist/components/animations/AnimatedView.js +45 -1
- package/dist/components/animations/DraggableSlideView.js +42 -1
- package/dist/components/animations/ParallaxHeader.js +9 -1
- package/dist/components/animations/ParallaxHeader.native.js +32 -1
- package/dist/components/animations/ParallaxHeader.web.js +32 -1
- package/dist/components/animations/ReanimatedScrollHandler.js +8 -1
- package/dist/components/animations/ReanimatedScrollHandler.native.js +24 -1
- package/dist/components/animations/ReanimatedScrollHandler.web.js +1 -1
- package/dist/components/animations/ReanimatedView.js +40 -1
- package/dist/components/animations/index.js +5 -1
- package/dist/components/calendar/CalendarNav.js +67 -1
- package/dist/components/calendar/WeekDaysBar.js +18 -1
- package/dist/components/calendar/_helpers/calendarDays.js +16 -1
- package/dist/components/calendar/_helpers/dateDisabled.js +24 -1
- package/dist/components/feedback/alerter.js +31 -1
- package/dist/components/feedback/confirmer.js +70 -1
- package/dist/components/feedback/index.js +3 -1
- package/dist/components/feedback/notifications/Notification.js +37 -1
- package/dist/components/feedback/notifications/NotificationsHandler.js +65 -1
- package/dist/components/filter/DateFilter.js +72 -0
- package/dist/components/filter/FilterGroup.js +17 -0
- package/dist/components/filter/FilterHandler.js +54 -0
- package/dist/components/filter/FilterItem.js +30 -0
- package/dist/components/filter/PopoverFilterItem.js +84 -0
- package/dist/components/filter/SearchInput.js +49 -0
- package/dist/components/filter/index.js +6 -0
- package/dist/components/form/Form.js +31 -1
- package/dist/components/form/FormGroup.js +21 -1
- package/dist/components/form/FormItem.js +118 -1
- package/dist/components/form/FormList.js +143 -1
- package/dist/components/form/FormWrapperComponent.js +52 -1
- package/dist/components/form/FormWrapperComponent.native.js +5 -1
- package/dist/components/form/SubmitButton.js +22 -1
- package/dist/components/form/index.js +9 -1
- package/dist/components/form/useNewForm.js +211 -1
- package/dist/components/form/useWatch.js +70 -1
- package/dist/components/form/validation/defaultMessages.js +20 -1
- package/dist/components/form/validation/index.js +5 -1
- package/dist/components/form/validation/normalizeRules.js +22 -1
- package/dist/components/form/validation/shouldValidateOn.js +21 -1
- package/dist/components/form/validation/validateRules.js +83 -1
- package/dist/components/form/validation/validators.js +82 -1
- package/dist/components/helpers/ConditionalLazyRender.js +6 -1
- package/dist/components/helpers/LazyAction.js +22 -1
- package/dist/components/helpers/LazyRender.js +55 -1
- package/dist/components/helpers/LazyRender.native.js +58 -1
- package/dist/components/helpers/Portal.js +21 -1
- package/dist/components/helpers/PortalHandler.js +32 -1
- package/dist/components/helpers/Responsive.js +18 -1
- package/dist/components/helpers/Separator.js +49 -1
- package/dist/components/helpers/VerticalView.js +34 -1
- package/dist/components/helpers/index.js +8 -1
- package/dist/components/index.js +20 -1
- package/dist/components/inputs/BooleanSelect.js +14 -0
- package/dist/components/inputs/Checkbox.js +56 -1
- package/dist/components/inputs/DateInput.js +123 -1
- package/dist/components/inputs/DateRangeInput.js +41 -0
- package/dist/components/inputs/Editable.js +129 -0
- package/dist/components/inputs/EnabledSelect.js +14 -0
- package/dist/components/inputs/InputWrapper.js +93 -1
- package/dist/components/inputs/LinkInput.js +17 -1
- package/dist/components/inputs/MaskInput.js +67 -1
- package/dist/components/inputs/NumberInput.js +111 -1
- package/dist/components/inputs/NumberRangeInput.js +41 -0
- package/dist/components/inputs/PasswordInput.js +24 -0
- package/dist/components/inputs/Picker.js +169 -1
- package/dist/components/inputs/Radio.js +55 -1
- package/dist/components/inputs/RateInput.js +62 -1
- package/dist/components/inputs/SegmentedPicker.js +62 -1
- package/dist/components/inputs/Select.js +219 -1
- package/dist/components/inputs/Switch.js +60 -1
- package/dist/components/inputs/TextArea.js +5 -0
- package/dist/components/inputs/TextInput.js +32 -1
- package/dist/components/inputs/UploadInput.js +140 -0
- package/dist/components/inputs/_DateInput.native.js +89 -1
- package/dist/components/inputs/datePicker/DatePicker.js +24 -1
- package/dist/components/inputs/datePicker/DayPicker.js +64 -1
- package/dist/components/inputs/datePicker/MonthPicker.js +62 -1
- package/dist/components/inputs/datePicker/QuarterPicker.js +65 -1
- package/dist/components/inputs/datePicker/WeekPicker.js +74 -1
- package/dist/components/inputs/datePicker/YearPicker.js +70 -1
- package/dist/components/inputs/index.js +23 -1
- package/dist/components/inputs/upload/Upload.js +99 -0
- package/dist/components/inputs/upload/Upload.native.js +154 -0
- package/dist/components/inputs/upload/useUploadState.js +143 -0
- package/dist/components/layout/Layout.js +40 -1
- package/dist/components/layout/LayoutContent.js +42 -1
- package/dist/components/layout/LayoutHeader.js +70 -1
- package/dist/components/layout/LayoutSider.js +64 -1
- package/dist/components/layout/index.js +4 -1
- package/dist/components/list/FlatList.js +91 -1
- package/dist/components/list/ScrollView.js +58 -1
- package/dist/components/list/index.js +2 -1
- package/dist/components/modals/bottomDrawer/index.js +3 -1
- package/dist/components/modals/bottomDrawer/index.native.js +5 -1
- package/dist/components/modals/bottomDrawer/index.web.js +5 -1
- package/dist/components/modals/bottomDrawer/native/BottomDrawer.js +239 -1
- package/dist/components/modals/bottomDrawer/native/DrawerContext.js +17 -1
- package/dist/components/modals/bottomDrawer/native/DrawerHandle.js +12 -1
- package/dist/components/modals/bottomDrawer/native/DrawerScrollView.js +5 -1
- package/dist/components/modals/bottomDrawer/native/createDrawerScrollComponent.js +139 -1
- package/dist/components/modals/bottomDrawer/native/utils.js +65 -1
- package/dist/components/modals/bottomDrawer/web/BottomDrawer.js +5 -1
- package/dist/components/modals/drawer/Drawer.js +5 -1
- package/dist/components/modals/drawer/Drawer.native.js +3 -1
- package/dist/components/modals/drawer/Drawer.web.js +3 -1
- package/dist/components/modals/drawer/index.js +1 -1
- package/dist/components/modals/index.js +4 -1
- package/dist/components/modals/modal/Modal.js +84 -1
- package/dist/components/modals/modal/Modal.native.js +83 -1
- package/dist/components/modals/modal/ModalBackdrop.js +58 -1
- package/dist/components/modals/modal/ModalContent.js +28 -1
- package/dist/components/modals/modal/ModalFooter.js +31 -1
- package/dist/components/modals/modal/ModalHeader.js +50 -1
- package/dist/components/modals/modal/handler/ModalsHandler.js +61 -1
- package/dist/components/modals/modal/index.js +6 -1
- package/dist/components/modals/router/ModalRoute.js +15 -1
- package/dist/components/modals/router/ModalsRouter.js +120 -1
- package/dist/components/modals/router/ModalsRouterContext.js +16 -1
- package/dist/components/modals/router/index.js +6 -1
- package/dist/components/modals/router/useAllModalsParams.js +6 -1
- package/dist/components/modals/router/useModalParams.js +6 -1
- package/dist/components/modals/router/useModalsNavigation.js +6 -1
- package/dist/components/modals/router/useUpdateModalContainer.js +6 -1
- package/dist/components/presentation/Avatar.js +79 -1
- package/dist/components/presentation/AvatarLabel.js +60 -1
- package/dist/components/presentation/AvatarsGroup.js +30 -0
- package/dist/components/presentation/Badge.js +91 -1
- package/dist/components/presentation/ContentLabel.js +43 -1
- package/dist/components/presentation/Icon.js +20 -1
- package/dist/components/presentation/IconLabel.js +40 -1
- package/dist/components/presentation/Image.js +33 -1
- package/dist/components/presentation/ImageBackground.js +38 -1
- package/dist/components/presentation/LabelValue.js +51 -1
- package/dist/components/presentation/Progress.js +20 -0
- package/dist/components/presentation/Rate.js +58 -1
- package/dist/components/presentation/RateTag.js +35 -1
- package/dist/components/presentation/Result.js +60 -1
- package/dist/components/presentation/ResultBar.js +56 -1
- package/dist/components/presentation/Tag.js +69 -1
- package/dist/components/presentation/Tooltip.js +44 -1
- package/dist/components/presentation/index.js +16 -1
- package/dist/components/sections/Section.js +50 -1
- package/dist/components/sections/SectionItem.js +24 -1
- package/dist/components/sections/SectionItemDropdown.js +68 -1
- package/dist/components/sections/SectionItemLink.js +35 -1
- package/dist/components/sections/index.js +4 -1
- package/dist/components/state/Loading.js +20 -1
- package/dist/components/state/LoadingView.js +37 -1
- package/dist/components/state/StatePresenter.js +41 -1
- package/dist/components/state/index.js +3 -1
- package/dist/components/steps/ActiveStepContent.js +16 -0
- package/dist/components/steps/StepsHandler.js +53 -0
- package/dist/components/steps/StepsMenu.js +14 -0
- package/dist/components/steps/StepsNavigation.js +37 -0
- package/dist/components/steps/index.js +4 -0
- package/dist/components/structure/Accordion.js +69 -1
- package/dist/components/structure/AccordionGroup.js +35 -1
- package/dist/components/structure/Affix.js +34 -0
- package/dist/components/structure/Affix.native.js +3 -0
- package/dist/components/structure/BlurView.js +59 -1
- package/dist/components/structure/Card.js +46 -1
- package/dist/components/structure/Col.js +22 -1
- package/dist/components/structure/GradientView.js +42 -1
- package/dist/components/structure/KeyboardAvoidingView.js +52 -1
- package/dist/components/structure/Row.js +50 -1
- package/dist/components/structure/SafeAreaView.js +42 -1
- package/dist/components/structure/Segment.js +51 -1
- package/dist/components/structure/TopBar.js +57 -1
- package/dist/components/structure/View.js +44 -1
- package/dist/components/structure/index.js +14 -1
- package/dist/components/structure/overlay/OverlayHandler.js +83 -1
- package/dist/components/structure/overlay/OverlayHandler.native.js +6 -1
- package/dist/components/structure/overlay/OverlayWrapper.js +52 -1
- package/dist/components/structure/overlay/calculatePosition.js +29 -1
- package/dist/components/structure/overlay/smartPlacement.js +32 -1
- package/dist/components/structure/popover/Popover.js +135 -1
- package/dist/components/structure/popover/Popover.native.js +105 -1
- package/dist/components/structure/popover/PopoverContent.js +18 -1
- package/dist/components/structure/popover/Popover_BU.js +157 -1
- package/dist/components/table/DataTable.js +62 -1
- package/dist/components/table/Pagination.js +128 -1
- package/dist/components/table/Table.js +66 -1
- package/dist/components/table/TableCol.js +67 -1
- package/dist/components/table/TableHeader.js +69 -1
- package/dist/components/table/TableHeaderRow.js +31 -1
- package/dist/components/table/TableRow.js +30 -1
- package/dist/components/table/index.js +7 -1
- package/dist/components/tabs/ActiveTabContent.js +38 -1
- package/dist/components/tabs/TabsHandler.js +16 -1
- package/dist/components/tabs/TabsMenu.js +15 -1
- package/dist/components/tabs/index.js +3 -1
- package/dist/components/text/DateText.js +24 -1
- package/dist/components/text/Text.js +32 -1
- package/dist/components/text/VerticalText.js +29 -1
- package/dist/components/text/index.js +3 -1
- package/dist/components/theme/ThemePicker.js +48 -1
- package/dist/components/theme/ThemePickerDrawer.js +12 -1
- package/dist/components/theme/ThemeStatusBar.js +3 -1
- package/dist/components/theme/ThemeStatusBar.native.js +9 -1
- package/dist/components/theme/ThemeThumb.js +98 -1
- package/dist/components/theme/index.js +3 -1
- package/dist/helpers/debounce.js +9 -1
- package/dist/helpers/index.js +5 -1
- package/dist/helpers/options.js +65 -1
- package/dist/helpers/random.js +5 -1
- package/dist/helpers/storage.js +76 -1
- package/dist/helpers/string.js +74 -1
- package/dist/i18n/I18n.js +96 -1
- package/dist/i18n/I18nProvider.js +40 -1
- package/dist/i18n/index.js +2 -1
- package/dist/index.js +8 -1
- package/dist/modifiers/_helpers.js +6 -1
- package/dist/modifiers/alignConverter.js +11 -1
- package/dist/modifiers/animation.js +18 -1
- package/dist/modifiers/animations/animatedEffects.js +64 -1
- package/dist/modifiers/animations/animatedEffects.native.js +55 -1
- package/dist/modifiers/animations/animatedEffects.web.js +55 -1
- package/dist/modifiers/animations/fadeEffect.js +46 -1
- package/dist/modifiers/animations/fadeEffect.native.js +33 -1
- package/dist/modifiers/animations/fadeEffect.web.js +3 -1
- package/dist/modifiers/animations/scaleEffect.js +46 -1
- package/dist/modifiers/animations/scaleEffect.native.js +33 -1
- package/dist/modifiers/animations/scrollEffect.web.js +3 -1
- package/dist/modifiers/animations/slideEffect.js +64 -1
- package/dist/modifiers/animations/slideEffect.native.js +53 -1
- package/dist/modifiers/animations/slideEffect.web.js +3 -1
- package/dist/modifiers/applyStyles.js +7 -1
- package/dist/modifiers/background.js +34 -1
- package/dist/modifiers/border.js +86 -1
- package/dist/modifiers/colorConverter.js +13 -1
- package/dist/modifiers/cursor.js +21 -1
- package/dist/modifiers/default.js +9 -1
- package/dist/modifiers/display.js +22 -1
- package/dist/modifiers/flex.js +20 -1
- package/dist/modifiers/flexWrapper.js +87 -1
- package/dist/modifiers/fullColor.js +32 -1
- package/dist/modifiers/grid.js +27 -1
- package/dist/modifiers/hover.js +28 -1
- package/dist/modifiers/logger.js +6 -1
- package/dist/modifiers/margin.js +25 -1
- package/dist/modifiers/overflow.js +28 -1
- package/dist/modifiers/padding.js +25 -1
- package/dist/modifiers/position.js +57 -1
- package/dist/modifiers/responsiveConverter.js +19 -1
- package/dist/modifiers/shadow.js +35 -1
- package/dist/modifiers/size.js +59 -1
- package/dist/modifiers/sizeConverter.js +12 -1
- package/dist/modifiers/state.js +33 -1
- package/dist/modifiers/text.js +62 -1
- package/dist/modifiers/textConverter.js +12 -1
- package/dist/modifiers/themeComponent.js +11 -1
- package/dist/responsive/ResponsiveHandler.js +28 -1
- package/dist/responsive/index.js +2 -1
- package/dist/responsive/responsiveHooks.js +67 -1
- package/dist/theme/ThemeHandler.js +81 -1
- package/dist/theme/default/base.js +95 -1
- package/dist/theme/default/blackTheme.js +47 -1
- package/dist/theme/default/cyberpunkTheme.js +36 -1
- package/dist/theme/default/darkTheme.js +35 -1
- package/dist/theme/default/hackerTheme.js +55 -1
- package/dist/theme/default/lightTheme.js +35 -1
- package/dist/theme/default/paperTheme.js +36 -1
- package/dist/theme/default/themes.js +15 -1
- package/dist/theme/format/colorsVariations.js +31 -1
- package/dist/theme/format/formatTheme.js +28 -1
- package/dist/theme/helpers/colorScale.js +12 -1
- package/dist/theme/helpers/contrastColor.js +18 -1
- package/dist/theme/helpers/dynamicColor.js +32 -1
- package/dist/theme/helpers/mergePreset.js +7 -1
- package/dist/theme/helpers/relatedScales.js +34 -1
- package/dist/theme/helpers/sizeScale.js +20 -1
- package/dist/theme/helpers/textScale.js +15 -1
- package/dist/theme/index.js +2 -1
- package/package.json +1 -3
- package/src/abstractions/Icon.js +1 -1
- package/src/abstractions/TextInput.js +10 -1
- package/src/components/actions/ActionsDrawer.js +1 -1
- package/src/components/actions/Button.js +3 -1
- package/src/components/actions/FloatingMenu.js +1 -1
- package/src/components/actions/menu/HorizontalMenu.js +2 -1
- package/src/components/actions/menu/VerticalMenu.js +2 -1
- package/src/components/filter/DateFilter.js +72 -0
- package/src/components/filter/FilterGroup.js +17 -0
- package/src/components/filter/FilterHandler.js +54 -0
- package/src/components/filter/FilterItem.js +30 -0
- package/src/components/filter/PopoverFilterItem.js +84 -0
- package/src/components/filter/SearchInput.js +49 -0
- package/src/components/filter/index.js +6 -0
- package/src/components/form/Form.js +9 -3
- package/src/components/form/FormItem.js +26 -1
- package/src/components/form/FormWrapperComponent.js +12 -3
- package/src/components/form/useNewForm.js +55 -4
- package/src/components/helpers/Separator.js +15 -11
- package/src/components/helpers/index.js +1 -0
- package/src/components/index.js +2 -0
- package/src/components/inputs/BooleanSelect.js +14 -0
- package/src/components/inputs/DateInput.js +3 -1
- package/src/components/inputs/DateRangeInput.js +41 -0
- package/src/components/inputs/Editable.js +129 -0
- package/src/components/inputs/EnabledSelect.js +14 -0
- package/src/components/inputs/InputWrapper.js +7 -4
- package/src/components/inputs/NumberInput.js +10 -5
- package/src/components/inputs/NumberRangeInput.js +41 -0
- package/src/components/inputs/PasswordInput.js +24 -0
- package/src/components/inputs/Picker.js +2 -2
- package/src/components/inputs/Select.js +61 -47
- package/src/components/inputs/TextArea.js +5 -0
- package/src/components/inputs/TextInput.js +14 -4
- package/src/components/inputs/UploadInput.js +140 -0
- package/src/components/inputs/index.js +9 -0
- package/src/components/inputs/upload/Upload.js +99 -0
- package/src/components/inputs/upload/Upload.native.js +154 -0
- package/src/components/inputs/upload/useUploadState.js +143 -0
- package/src/components/layout/LayoutHeader.js +1 -0
- package/src/components/presentation/AvatarLabel.js +1 -1
- package/src/components/presentation/AvatarsGroup.js +30 -0
- package/src/components/presentation/Badge.js +3 -2
- package/src/components/presentation/ContentLabel.js +1 -1
- package/src/components/presentation/IconLabel.js +1 -0
- package/src/components/presentation/Progress.js +20 -0
- package/src/components/presentation/index.js +2 -0
- package/src/components/sections/Section.js +1 -1
- package/src/components/sections/SectionItemLink.js +4 -2
- package/src/components/steps/ActiveStepContent.js +16 -0
- package/src/components/steps/StepsHandler.js +53 -0
- package/src/components/steps/StepsMenu.js +14 -0
- package/src/components/steps/StepsNavigation.js +37 -0
- package/src/components/steps/index.js +4 -0
- package/src/components/structure/Affix.js +34 -0
- package/src/components/structure/Affix.native.js +3 -0
- package/src/components/structure/Card.js +1 -0
- package/src/components/structure/TopBar.js +13 -1
- package/src/components/structure/index.js +1 -0
- package/src/components/structure/overlay/OverlayHandler.js +9 -1
- package/src/components/structure/popover/Popover.js +22 -5
- package/src/components/table/DataTable.js +7 -2
- package/src/components/table/Table.js +2 -1
- package/src/components/tabs/ActiveTabContent.js +4 -1
- package/src/components/text/DateText.js +15 -2
- package/src/modifiers/border.js +15 -9
- package/src/modifiers/size.js +8 -5
- package/src/theme/default/base.js +2 -0
- package/src/theme/default/hackerTheme.js +1 -10
- package/src/theme/default/paperTheme.js +1 -14
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/upload/Upload.native.js";var _excluded = ["children", "onChange", "onUpload", "value", "accept", "multiple", "maxCount", "disabled"];function asyncGeneratorStep(n, t, e, r, o, a, c) {try {var i = n[a](c),u = i.value;} catch (n) {return void e(n);}i.done ? t(u) : Promise.resolve(u).then(r, o);}function _asyncToGenerator(n) {return function () {var t = this,e = arguments;return new Promise(function (r, o) {var a = n.apply(t, e);function _next(n) {asyncGeneratorStep(a, r, o, _next, _throw, "next", n);}function _throw(n) {asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);}_next(void 0);});};}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, { useState, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
import { BottomDrawer } from "../../modals/bottomDrawer";
|
|
4
|
+
import { Icon } from "../../presentation/Icon";
|
|
5
|
+
import { Link } from "../../actions/Link";
|
|
6
|
+
import { Text } from "../../text/Text";
|
|
7
|
+
import { View } from "../../structure/View";
|
|
8
|
+
import { useUploadState } from "./useUploadState";import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
var ImagePicker;
|
|
11
|
+
try {
|
|
12
|
+
ImagePicker = require('expo-image-picker');
|
|
13
|
+
} catch (_unused) {}
|
|
14
|
+
|
|
15
|
+
var DocumentPicker;
|
|
16
|
+
try {
|
|
17
|
+
DocumentPicker = require('expo-document-picker');
|
|
18
|
+
} catch (_unused2) {}
|
|
19
|
+
|
|
20
|
+
function acceptsImages(accept) {
|
|
21
|
+
if (!accept) return true;
|
|
22
|
+
return accept.includes('image/') || accept.includes('image/*');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function needsFilePicker(accept) {
|
|
26
|
+
if (!accept) return true;
|
|
27
|
+
var parts = accept.split(',').map(function (s) {return s.trim();});
|
|
28
|
+
return parts.some(function (p) {return !p.startsWith('image/');});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function normalizeImageResult(asset) {
|
|
32
|
+
return {
|
|
33
|
+
uri: asset.uri,
|
|
34
|
+
name: asset.fileName || asset.uri.split('/').pop(),
|
|
35
|
+
type: asset.mimeType || asset.type || 'image/jpeg',
|
|
36
|
+
size: asset.fileSize || asset.filesize,
|
|
37
|
+
width: asset.width,
|
|
38
|
+
height: asset.height
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function normalizeDocumentResult(doc) {
|
|
43
|
+
return {
|
|
44
|
+
uri: doc.uri,
|
|
45
|
+
name: doc.name,
|
|
46
|
+
type: doc.mimeType || doc.type,
|
|
47
|
+
size: doc.size
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getMediaTypes(accept) {
|
|
52
|
+
if (!accept) return undefined;
|
|
53
|
+
if (accept.includes('video/') && !accept.includes('image/')) return ['videos'];
|
|
54
|
+
if (accept.includes('image/') && !accept.includes('video/')) return ['images'];
|
|
55
|
+
if (accept.includes('video/') && accept.includes('image/')) return ['images', 'videos'];
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function Upload(_ref) {var children = _ref.children,onChange = _ref.onChange,onUpload = _ref.onUpload,valueProp = _ref.value,accept = _ref.accept,_ref$multiple = _ref.multiple,multiple = _ref$multiple === void 0 ? false : _ref$multiple,maxCount = _ref.maxCount,_ref$disabled = _ref.disabled,disabled = _ref$disabled === void 0 ? false : _ref$disabled,props = _objectWithoutProperties(_ref, _excluded);
|
|
60
|
+
var _useUploadState = useUploadState({ onUpload: onUpload, onChange: onChange, multiple: multiple, maxCount: maxCount, value: valueProp }),value = _useUploadState.value,addFiles = _useUploadState.addFiles,remove = _useUploadState.remove;
|
|
61
|
+
var _useState = useState(false),_useState2 = _slicedToArray(_useState, 2),open = _useState2[0],setOpen = _useState2[1];
|
|
62
|
+
|
|
63
|
+
var handlePress = useCallback(function () {
|
|
64
|
+
if (disabled) return;
|
|
65
|
+
setOpen(true);
|
|
66
|
+
}, [disabled]);
|
|
67
|
+
|
|
68
|
+
var handleCamera = useCallback(_asyncToGenerator(function* () {
|
|
69
|
+
setOpen(false);
|
|
70
|
+
if (!ImagePicker) return;
|
|
71
|
+
var permission = yield ImagePicker.requestCameraPermissionsAsync();
|
|
72
|
+
if (!permission.granted) return;
|
|
73
|
+
var result = yield ImagePicker.launchCameraAsync({
|
|
74
|
+
allowsMultipleSelection: multiple,
|
|
75
|
+
selectionLimit: maxCount || 0,
|
|
76
|
+
mediaTypes: getMediaTypes(accept)
|
|
77
|
+
});
|
|
78
|
+
if (result.canceled) return;
|
|
79
|
+
addFiles(result.assets.map(normalizeImageResult));
|
|
80
|
+
}), [multiple, maxCount, accept, addFiles]);
|
|
81
|
+
|
|
82
|
+
var handleLibrary = useCallback(_asyncToGenerator(function* () {
|
|
83
|
+
setOpen(false);
|
|
84
|
+
if (!ImagePicker) return;
|
|
85
|
+
var permission = yield ImagePicker.requestMediaLibraryPermissionsAsync();
|
|
86
|
+
if (!permission.granted) return;
|
|
87
|
+
var result = yield ImagePicker.launchImageLibraryAsync({
|
|
88
|
+
allowsMultipleSelection: multiple,
|
|
89
|
+
selectionLimit: maxCount || 0,
|
|
90
|
+
mediaTypes: getMediaTypes(accept)
|
|
91
|
+
});
|
|
92
|
+
if (result.canceled) return;
|
|
93
|
+
addFiles(result.assets.map(normalizeImageResult));
|
|
94
|
+
}), [multiple, maxCount, accept, addFiles]);
|
|
95
|
+
|
|
96
|
+
var handleFiles = useCallback(_asyncToGenerator(function* () {
|
|
97
|
+
setOpen(false);
|
|
98
|
+
if (!DocumentPicker) return;
|
|
99
|
+
var result = yield DocumentPicker.getDocumentAsync({
|
|
100
|
+
multiple: multiple,
|
|
101
|
+
type: accept || '*/*'
|
|
102
|
+
});
|
|
103
|
+
if (result.canceled) return;
|
|
104
|
+
addFiles(result.assets.map(normalizeDocumentResult));
|
|
105
|
+
}), [multiple, accept, addFiles]);
|
|
106
|
+
|
|
107
|
+
var showCamera = acceptsImages(accept);
|
|
108
|
+
var showLibrary = acceptsImages(accept);
|
|
109
|
+
var showFiles = needsFilePicker(accept);
|
|
110
|
+
|
|
111
|
+
var isRenderFn = typeof children === 'function';
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
_jsxs(_Fragment, { children: [
|
|
115
|
+
isRenderFn ?
|
|
116
|
+
_jsx(View, Object.assign({}, props, { children:
|
|
117
|
+
children({ value: value, remove: remove, isDragging: false, open: handlePress }) })
|
|
118
|
+
) :
|
|
119
|
+
|
|
120
|
+
_jsx(Link, Object.assign({ onPress: handlePress, disabled: disabled }, props, { children:
|
|
121
|
+
children })
|
|
122
|
+
),
|
|
123
|
+
|
|
124
|
+
_jsx(BottomDrawer, { open: open, onClose: function onClose() {return setOpen(false);}, snapPoints: [200], children:
|
|
125
|
+
_jsxs(View, { padding: "md", gap: "xs", children: [
|
|
126
|
+
showCamera &&
|
|
127
|
+
_jsx(Link, { onPress: handleCamera, children:
|
|
128
|
+
_jsxs(View, { row: true, gap: "md", padding: "sm", centerV: true, children: [
|
|
129
|
+
_jsx(Icon, { name: "camera-line" }),
|
|
130
|
+
_jsx(Text, { children: "Camera" })] }
|
|
131
|
+
) }
|
|
132
|
+
),
|
|
133
|
+
|
|
134
|
+
showLibrary &&
|
|
135
|
+
_jsx(Link, { onPress: handleLibrary, children:
|
|
136
|
+
_jsxs(View, { row: true, gap: "md", padding: "sm", centerV: true, children: [
|
|
137
|
+
_jsx(Icon, { name: "image-line" }),
|
|
138
|
+
_jsx(Text, { children: "Photo Library" })] }
|
|
139
|
+
) }
|
|
140
|
+
),
|
|
141
|
+
|
|
142
|
+
showFiles &&
|
|
143
|
+
_jsx(Link, { onPress: handleFiles, children:
|
|
144
|
+
_jsxs(View, { row: true, gap: "md", padding: "sm", centerV: true, children: [
|
|
145
|
+
_jsx(Icon, { name: "file-line" }),
|
|
146
|
+
_jsx(Text, { children: "Files" })] }
|
|
147
|
+
) }
|
|
148
|
+
)] }
|
|
149
|
+
|
|
150
|
+
) }
|
|
151
|
+
)] }
|
|
152
|
+
));
|
|
153
|
+
|
|
154
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
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 { useState, useRef, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
function toArray(val) {
|
|
4
|
+
if (!val) return [];
|
|
5
|
+
return Array.isArray(val) ? val : [val];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function useUploadState(_ref) {var onUpload = _ref.onUpload,onChange = _ref.onChange,multiple = _ref.multiple,maxCount = _ref.maxCount,valueProp = _ref.value;
|
|
9
|
+
var _useState = useState([]),_useState2 = _slicedToArray(_useState, 2),inFlight = _useState2[0],setInFlight = _useState2[1];
|
|
10
|
+
var _useState3 = useState(null),_useState4 = _slicedToArray(_useState3, 2),committed = _useState4[0],setCommitted = _useState4[1];
|
|
11
|
+
var idRef = useRef(0);
|
|
12
|
+
var genRef = useRef(0);
|
|
13
|
+
|
|
14
|
+
var isControlled = valueProp !== undefined;
|
|
15
|
+
var externalValue = isControlled ? valueProp : committed;
|
|
16
|
+
var externalArray = toArray(externalValue);
|
|
17
|
+
|
|
18
|
+
var externalArrayRef = useRef(externalArray);
|
|
19
|
+
externalArrayRef.current = externalArray;
|
|
20
|
+
var onChangeRef = useRef(onChange);
|
|
21
|
+
onChangeRef.current = onChange;
|
|
22
|
+
var inFlightRef = useRef(inFlight);
|
|
23
|
+
inFlightRef.current = inFlight;
|
|
24
|
+
|
|
25
|
+
var value = multiple ? [].concat(_toConsumableArray(
|
|
26
|
+
externalArray), _toConsumableArray(inFlight)) :
|
|
27
|
+
inFlight[0] || externalArray[0] || null;
|
|
28
|
+
|
|
29
|
+
var addFiles = useCallback(
|
|
30
|
+
function (normalizedFiles) {
|
|
31
|
+
if (!(normalizedFiles != null && normalizedFiles.length)) return;
|
|
32
|
+
|
|
33
|
+
if (!onUpload) {
|
|
34
|
+
if (!multiple) {
|
|
35
|
+
var entry = Object.assign({}, normalizedFiles[0], { _id: ++idRef.current });
|
|
36
|
+
if (!isControlled) setCommitted(entry);
|
|
37
|
+
onChangeRef.current == null ? void 0 : onChangeRef.current(entry);
|
|
38
|
+
} else {
|
|
39
|
+
var _files = normalizedFiles;
|
|
40
|
+
if (maxCount) {
|
|
41
|
+
var available = maxCount - externalArrayRef.current.length;
|
|
42
|
+
if (available <= 0) return;
|
|
43
|
+
_files = _files.slice(0, available);
|
|
44
|
+
}
|
|
45
|
+
var _entries = _files.map(function (file) {return Object.assign({}, file, { _id: ++idRef.current });});
|
|
46
|
+
if (!isControlled) {
|
|
47
|
+
setCommitted(function (prev) {
|
|
48
|
+
var next = [].concat(_toConsumableArray(toArray(prev)), _toConsumableArray(_entries));
|
|
49
|
+
onChangeRef.current == null ? void 0 : onChangeRef.current(next);
|
|
50
|
+
return next;
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
onChangeRef.current == null ? void 0 : onChangeRef.current([].concat(_toConsumableArray(externalArrayRef.current), _toConsumableArray(_entries)));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!multiple) {
|
|
60
|
+
var gen = ++genRef.current;
|
|
61
|
+
var file = normalizedFiles[0];
|
|
62
|
+
var _id = ++idRef.current;
|
|
63
|
+
var _entry = Object.assign({}, file, { _id: _id, status: 'uploading' });
|
|
64
|
+
|
|
65
|
+
setInFlight([_entry]);
|
|
66
|
+
|
|
67
|
+
onUpload(file).
|
|
68
|
+
then(function (result) {
|
|
69
|
+
if (genRef.current !== gen) return;
|
|
70
|
+
var done = Object.assign({}, _entry, result, { status: 'done' });
|
|
71
|
+
setInFlight([]);
|
|
72
|
+
if (!isControlled) setCommitted(done);
|
|
73
|
+
onChangeRef.current == null ? void 0 : onChangeRef.current(done);
|
|
74
|
+
}).
|
|
75
|
+
catch(function (error) {
|
|
76
|
+
if (genRef.current !== gen) return;
|
|
77
|
+
setInFlight(function (prev) {return (
|
|
78
|
+
prev.map(function (f) {return f._id === _id ? Object.assign({}, f, { status: 'error', error: error }) : f;}));}
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
var files = normalizedFiles;
|
|
86
|
+
if (maxCount) {
|
|
87
|
+
var _available = maxCount - externalArrayRef.current.length - inFlightRef.current.length;
|
|
88
|
+
if (_available <= 0) return;
|
|
89
|
+
files = files.slice(0, _available);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
var entries = files.map(function (file) {return Object.assign({},
|
|
93
|
+
file, {
|
|
94
|
+
_id: ++idRef.current,
|
|
95
|
+
status: 'uploading' });}
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
setInFlight(function (prev) {return [].concat(_toConsumableArray(prev), _toConsumableArray(entries));});
|
|
99
|
+
|
|
100
|
+
entries.forEach(function (entry, i) {
|
|
101
|
+
onUpload(files[i]).
|
|
102
|
+
then(function (result) {
|
|
103
|
+
var done = Object.assign({}, entry, result, { status: 'done' });
|
|
104
|
+
setInFlight(function (prev) {return prev.filter(function (f) {return f._id !== entry._id;});});
|
|
105
|
+
if (!isControlled) {
|
|
106
|
+
setCommitted(function (prev) {
|
|
107
|
+
var next = [].concat(_toConsumableArray(toArray(prev)), [done]);
|
|
108
|
+
onChangeRef.current == null ? void 0 : onChangeRef.current(next);
|
|
109
|
+
return next;
|
|
110
|
+
});
|
|
111
|
+
} else {
|
|
112
|
+
onChangeRef.current == null ? void 0 : onChangeRef.current([].concat(_toConsumableArray(externalArrayRef.current), [done]));
|
|
113
|
+
}
|
|
114
|
+
}).
|
|
115
|
+
catch(function (error) {
|
|
116
|
+
setInFlight(function (prev) {return (
|
|
117
|
+
prev.map(function (f) {return f._id === entry._id ? Object.assign({}, f, { status: 'error', error: error }) : f;}));}
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
[onUpload, multiple, maxCount, isControlled]
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
var remove = useCallback(
|
|
126
|
+
function (file) {
|
|
127
|
+
if (!file) return;
|
|
128
|
+
|
|
129
|
+
setInFlight(function (prev) {return prev.filter(function (f) {return f._id !== file._id;});});
|
|
130
|
+
|
|
131
|
+
var ext = externalArrayRef.current;
|
|
132
|
+
if (ext.some(function (f) {return f._id === file._id;})) {
|
|
133
|
+
var next = ext.filter(function (f) {return f._id !== file._id;});
|
|
134
|
+
var val = multiple ? next : next[0] || null;
|
|
135
|
+
if (!isControlled) setCommitted(val);
|
|
136
|
+
onChangeRef.current == null ? void 0 : onChangeRef.current(val);
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
[multiple, isControlled]
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
return { value: value, addFiles: addFiles, remove: remove };
|
|
143
|
+
}
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/layout/Layout.js";var _excluded = ["children"];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 { getElementSize } from "../../abstractions/helpers/componentSize";import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
var LayoutContext = React.createContext({});
|
|
7
|
+
export var useLayout = function useLayout() {return React.useContext(LayoutContext) || {};};
|
|
8
|
+
|
|
9
|
+
export function Layout(_ref) {var children = _ref.children,rootProps = _objectWithoutProperties(_ref, _excluded);
|
|
10
|
+
var _React$useState = React.useState(0),_React$useState2 = _slicedToArray(_React$useState, 2),layoutHeaderSpace = _React$useState2[0],setLayoutHeaderSpace = _React$useState2[1];
|
|
11
|
+
var _React$useState3 = React.useState(0),_React$useState4 = _slicedToArray(_React$useState3, 2),layoutSiderSpace = _React$useState4[0],setLayoutSiderSpace = _React$useState4[1];
|
|
12
|
+
|
|
13
|
+
var registerHeader = function registerHeader(space) {return setLayoutHeaderSpace(function (v) {return v + space;});};
|
|
14
|
+
var unregisterHeader = function unregisterHeader(space) {return setLayoutHeaderSpace(function (v) {return v - space;});};
|
|
15
|
+
|
|
16
|
+
var _React$useState5 = React.useState({}),_React$useState6 = _slicedToArray(_React$useState5, 2),layoutSize = _React$useState6[0],setLayoutSize = _React$useState6[1];
|
|
17
|
+
var layoutRef = React.useRef(null);
|
|
18
|
+
|
|
19
|
+
React.useLayoutEffect(function () {
|
|
20
|
+
getElementSize(layoutRef, setLayoutSize);
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
var value = {
|
|
24
|
+
layoutSize: layoutSize,
|
|
25
|
+
layoutHeaderSpace: layoutHeaderSpace,
|
|
26
|
+
setLayoutHeaderSpace: setLayoutHeaderSpace,
|
|
27
|
+
layoutSiderSpace: layoutSiderSpace,
|
|
28
|
+
layoutSiderSpace: layoutSiderSpace,
|
|
29
|
+
registerHeader: registerHeader,
|
|
30
|
+
unregisterHeader: unregisterHeader
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
_jsx(LayoutContext.Provider, { value: value, children:
|
|
35
|
+
_jsx(View, Object.assign({ className: "neko-layout", bg: "mainBG", flex: true, relative: true }, rootProps, { ref: layoutRef, children:
|
|
36
|
+
children })
|
|
37
|
+
) }
|
|
38
|
+
));
|
|
39
|
+
|
|
40
|
+
}
|
|
@@ -1 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/layout/LayoutContent.js";var _excluded = ["children"];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
|
+
|
|
3
|
+
import { AbsView } from "../../abstractions/View";
|
|
4
|
+
import { useBackgroundModifier } from "../../modifiers/background";
|
|
5
|
+
import { useBorderModifier } from "../../modifiers/border";
|
|
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 { useOverflowModifier } from "../../modifiers/overflow";
|
|
11
|
+
import { usePaddingModifier } from "../../modifiers/padding";
|
|
12
|
+
import { usePositionModifier } from "../../modifiers/position";
|
|
13
|
+
import { useSizeModifier } from "../../modifiers/size";
|
|
14
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
|
|
16
|
+
var DEFAULT_PROPS = {
|
|
17
|
+
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function LayoutContent(_ref) {var children = _ref.children,rootProps = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var _pipe = pipe(
|
|
22
|
+
useThemeComponentModifier('LayoutContent'),
|
|
23
|
+
useDefaultModifier(DEFAULT_PROPS),
|
|
24
|
+
useSizeModifier,
|
|
25
|
+
usePositionModifier,
|
|
26
|
+
useOverflowModifier,
|
|
27
|
+
usePaddingModifier,
|
|
28
|
+
useMarginModifier,
|
|
29
|
+
useFlexWrapperModifier,
|
|
30
|
+
useFlexModifier,
|
|
31
|
+
useBackgroundModifier,
|
|
32
|
+
useBorderModifier
|
|
33
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_ = _pipe2[0],props = _pipe2[1];
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
_jsx(_Fragment, { children:
|
|
37
|
+
_jsx(AbsView, Object.assign({ className: "neko-layout-content" }, props, { children:
|
|
38
|
+
children })
|
|
39
|
+
) }
|
|
40
|
+
));
|
|
41
|
+
|
|
42
|
+
}
|
|
@@ -1 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/layout/LayoutHeader.js";var _excluded = ["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;}function _objectDestructuringEmpty(t) {if (null == t) throw new TypeError("Cannot destructure " + 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 } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { AbsView } from "../../abstractions/View";
|
|
5
|
+
import { getElementSize } from "../../abstractions/helpers/componentSize";
|
|
6
|
+
import { useBackgroundModifier } from "../../modifiers/background";
|
|
7
|
+
import { useBorderModifier } from "../../modifiers/border";
|
|
8
|
+
import { useDefaultModifier } from "../../modifiers/default";
|
|
9
|
+
import { useFlexModifier } from "../../modifiers/flex";
|
|
10
|
+
import { useFlexWrapperModifier } from "../../modifiers/flexWrapper";
|
|
11
|
+
import { useLayout } from "./Layout";
|
|
12
|
+
import { useMarginModifier } from "../../modifiers/margin";
|
|
13
|
+
import { useOverflowModifier } from "../../modifiers/overflow";
|
|
14
|
+
import { usePaddingModifier } from "../../modifiers/padding";
|
|
15
|
+
import { usePositionModifier } from "../../modifiers/position";
|
|
16
|
+
import { useShadowModifier } from "../../modifiers/shadow";
|
|
17
|
+
import { useSizeModifier } from "../../modifiers/size";
|
|
18
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
|
|
20
|
+
var DEFAULT_PROPS = function DEFAULT_PROPS(_ref) {var _ref2 = _slicedToArray(_ref, 2);_objectDestructuringEmpty(_ref2[0]);var sticky = _ref2[1].sticky;return {
|
|
21
|
+
bg: 'overlayBG',
|
|
22
|
+
fullW: true,
|
|
23
|
+
row: true,
|
|
24
|
+
centerV: true,
|
|
25
|
+
padding: 'md',
|
|
26
|
+
borderB: 'overlayDivider',
|
|
27
|
+
top: 0,
|
|
28
|
+
left: 0,
|
|
29
|
+
right: 0,
|
|
30
|
+
zIndex: sticky ? 90 : undefined
|
|
31
|
+
};};
|
|
32
|
+
|
|
33
|
+
export function LayoutHeader(_ref3) {var children = _ref3.children,rootProps = _objectWithoutProperties(_ref3, _excluded);
|
|
34
|
+
var _pipe = pipe(
|
|
35
|
+
useThemeComponentModifier('LayoutHeader'),
|
|
36
|
+
useDefaultModifier(DEFAULT_PROPS),
|
|
37
|
+
useSizeModifier,
|
|
38
|
+
usePositionModifier,
|
|
39
|
+
useOverflowModifier,
|
|
40
|
+
usePaddingModifier,
|
|
41
|
+
useMarginModifier,
|
|
42
|
+
useFlexWrapperModifier,
|
|
43
|
+
useFlexModifier,
|
|
44
|
+
useBackgroundModifier,
|
|
45
|
+
useBorderModifier,
|
|
46
|
+
useShadowModifier
|
|
47
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_ = _pipe2[0],props = _pipe2[1];
|
|
48
|
+
|
|
49
|
+
var _useLayout = useLayout(),registerHeader = _useLayout.registerHeader,unregisterHeader = _useLayout.unregisterHeader;
|
|
50
|
+
var headerRef = React.useRef(null);
|
|
51
|
+
var headerHeightRef = React.useRef(null);
|
|
52
|
+
|
|
53
|
+
React.useLayoutEffect(function () {
|
|
54
|
+
if (headerRef.current && !!rootProps.sticky) {
|
|
55
|
+
getElementSize(headerRef, function (_ref4) {var height = _ref4.height;
|
|
56
|
+
headerHeightRef.current = height;
|
|
57
|
+
registerHeader == null ? void 0 : registerHeader(height);
|
|
58
|
+
});
|
|
59
|
+
return function () {return unregisterHeader == null ? void 0 : unregisterHeader(headerHeightRef.current);};
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
_jsx(_Fragment, { children:
|
|
65
|
+
_jsx(AbsView, Object.assign({ className: "neko-layout-header" }, props, { ref: headerRef, children:
|
|
66
|
+
children })
|
|
67
|
+
) }
|
|
68
|
+
));
|
|
69
|
+
|
|
70
|
+
}
|
|
@@ -1 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/layout/LayoutSider.js";var _excluded = ["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;}function _objectDestructuringEmpty(t) {if (null == t) throw new TypeError("Cannot destructure " + 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 } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { AbsView } from "../../abstractions/View";
|
|
5
|
+
import { getElementSize } from "../../abstractions/helpers/componentSize";
|
|
6
|
+
import { useBackgroundModifier } from "../../modifiers/background";
|
|
7
|
+
import { useBorderModifier } from "../../modifiers/border";
|
|
8
|
+
import { useDefaultModifier } from "../../modifiers/default";
|
|
9
|
+
import { useFlexModifier } from "../../modifiers/flex";
|
|
10
|
+
import { useFlexWrapperModifier } from "../../modifiers/flexWrapper";
|
|
11
|
+
import { useLayout } from "./Layout";
|
|
12
|
+
import { useMarginModifier } from "../../modifiers/margin";
|
|
13
|
+
import { useOverflowModifier } from "../../modifiers/overflow";
|
|
14
|
+
import { usePaddingModifier } from "../../modifiers/padding";
|
|
15
|
+
import { usePositionModifier } from "../../modifiers/position";
|
|
16
|
+
import { useShadowModifier } from "../../modifiers/shadow";
|
|
17
|
+
import { useSizeModifier } from "../../modifiers/size";
|
|
18
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
|
|
20
|
+
var DEFAULT_PROPS =
|
|
21
|
+
function DEFAULT_PROPS(layoutSize, headerSpace) {return (
|
|
22
|
+
function (_ref) {var _ref2 = _slicedToArray(_ref, 2);_objectDestructuringEmpty(_ref2[0]);var sticky = _ref2[1].sticky;return {
|
|
23
|
+
top: headerSpace || 0,
|
|
24
|
+
bottom: 0,
|
|
25
|
+
maxHeight: !!sticky ? '100vh' : undefined,
|
|
26
|
+
paddingB: !!sticky ? headerSpace : undefined
|
|
27
|
+
};});};
|
|
28
|
+
|
|
29
|
+
export function LayoutSider(_ref3) {var children = _ref3.children,rootProps = _objectWithoutProperties(_ref3, _excluded);
|
|
30
|
+
var _useLayout = useLayout(),layoutSize = _useLayout.layoutSize,layoutHeaderSpace = _useLayout.layoutHeaderSpace,registerSider = _useLayout.registerSider,unregisterHeader = _useLayout.unregisterHeader;
|
|
31
|
+
|
|
32
|
+
var _pipe = pipe(
|
|
33
|
+
useThemeComponentModifier('LayoutSider'),
|
|
34
|
+
useDefaultModifier(DEFAULT_PROPS(layoutSize, layoutHeaderSpace)),
|
|
35
|
+
useSizeModifier,
|
|
36
|
+
usePositionModifier,
|
|
37
|
+
useOverflowModifier,
|
|
38
|
+
usePaddingModifier,
|
|
39
|
+
useMarginModifier,
|
|
40
|
+
useFlexWrapperModifier,
|
|
41
|
+
useFlexModifier,
|
|
42
|
+
useBackgroundModifier,
|
|
43
|
+
useBorderModifier,
|
|
44
|
+
useShadowModifier
|
|
45
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_ = _pipe2[0],props = _pipe2[1];
|
|
46
|
+
|
|
47
|
+
var siderRef = React.useRef(null);
|
|
48
|
+
var _React$useState = React.useState(rootProps.width || 0),_React$useState2 = _slicedToArray(_React$useState, 2),siderWidth = _React$useState2[0],setSiderWidth = _React$useState2[1];
|
|
49
|
+
|
|
50
|
+
React.useLayoutEffect(function () {
|
|
51
|
+
getElementSize(siderRef, function (_ref4) {var width = _ref4.width;return setSiderWidth(width);});
|
|
52
|
+
}, []);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
_jsxs(_Fragment, { children: [
|
|
56
|
+
rootProps.fixed &&
|
|
57
|
+
_jsx(AbsView, { className: "neko-layout-sider-empty-space", style: { width: siderWidth, height: '100%' } }),
|
|
58
|
+
|
|
59
|
+
_jsx(AbsView, Object.assign({ className: "neko-layout-sider" }, props, { ref: siderRef, children:
|
|
60
|
+
children })
|
|
61
|
+
)] }
|
|
62
|
+
));
|
|
63
|
+
|
|
64
|
+
}
|