@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
|
@@ -1 +1,219 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/Select.js";var _excluded = ["ref"],_excluded2 = ["value", "onChange", "onChangeSearch", "options", "placement", "placeholder", "initialLabel", "useBottomDrawer", "useSearch", "renderOption", "labelKey", "valueKey", "useRawOption", "multiple", "onEndReached", "renderFooter", "renderHeader", "pickerProps", "popoverProps", "popoverMaxHeight", "snapPoints", "startsOpen", "onOpenChange"];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 { dissoc } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { Icon, IconLabel } from "../presentation";
|
|
5
|
+
import { Link } from "../actions";
|
|
6
|
+
import { LinkInput } from "./LinkInput";
|
|
7
|
+
import { Picker, getOptionLabel, searchOptions } from "./Picker";
|
|
8
|
+
import { Popover } from "../structure/popover/Popover";
|
|
9
|
+
import { TextInput } from "./TextInput";
|
|
10
|
+
import { View } from "../structure";
|
|
11
|
+
import { useResponsiveValue } from "../../responsive";import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
|
|
13
|
+
function FullWidthInputWrapper(_ref) {var ref = _ref.ref,props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
return (
|
|
15
|
+
_jsx(View, { fullW: true, ref: ref, children:
|
|
16
|
+
_jsx(TextInput, Object.assign({}, props)) }
|
|
17
|
+
));
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function Select(_ref2)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
{var _pickerProps,_pickerProps2,_pickerProps3,_pickerProps4,_pickerProps5,_pickerProps6,_pickerProps7,_value,_this = this,_value4;var value = _ref2.value,onChange = _ref2.onChange,onChangeSearch = _ref2.onChangeSearch,options = _ref2.options,placement = _ref2.placement,placeholder = _ref2.placeholder,initialLabel = _ref2.initialLabel,_ref2$useBottomDrawer = _ref2.useBottomDrawer,useBottomDrawer = _ref2$useBottomDrawer === void 0 ? { native: true, sm: true, md: true } : _ref2$useBottomDrawer,useSearch = _ref2.useSearch,renderOption = _ref2.renderOption,labelKey = _ref2.labelKey,valueKey = _ref2.valueKey,useRawOption = _ref2.useRawOption,multiple = _ref2.multiple,onEndReached = _ref2.onEndReached,renderFooter = _ref2.renderFooter,renderHeader = _ref2.renderHeader,pickerProps = _ref2.pickerProps,popoverProps = _ref2.popoverProps,popoverMaxHeight = _ref2.popoverMaxHeight,snapPoints = _ref2.snapPoints,startsOpen = _ref2.startsOpen,_onOpenChange = _ref2.onOpenChange,props = _objectWithoutProperties(_ref2, _excluded2);
|
|
47
|
+
var _React$useState = React.useState(false),_React$useState2 = _slicedToArray(_React$useState, 2),focus = _React$useState2[0],setFocus = _React$useState2[1];
|
|
48
|
+
var _React$useState3 = React.useState(''),_React$useState4 = _slicedToArray(_React$useState3, 2),search = _React$useState4[0],setSearch = _React$useState4[1];
|
|
49
|
+
var _React$useState5 = React.useState(initialLabel || ''),_React$useState6 = _slicedToArray(_React$useState5, 2),inputValue = _React$useState6[0],setInputValue = _React$useState6[1];
|
|
50
|
+
var _React$useState7 = React.useState(value),_React$useState8 = _slicedToArray(_React$useState7, 2),localValue = _React$useState8[0],setLocalValue = _React$useState8[1];
|
|
51
|
+
|
|
52
|
+
labelKey = labelKey || ((_pickerProps = pickerProps) == null ? void 0 : _pickerProps.labelKey) || 'label';
|
|
53
|
+
valueKey = valueKey || ((_pickerProps2 = pickerProps) == null ? void 0 : _pickerProps2.valueKey) || 'value';
|
|
54
|
+
useRawOption = useRawOption || ((_pickerProps3 = pickerProps) == null ? void 0 : _pickerProps3.useRawOption);
|
|
55
|
+
multiple = multiple || ((_pickerProps4 = pickerProps) == null ? void 0 : _pickerProps4.multiple);
|
|
56
|
+
onEndReached = onEndReached || ((_pickerProps5 = pickerProps) == null ? void 0 : _pickerProps5.onEndReached);
|
|
57
|
+
renderFooter = renderFooter || ((_pickerProps6 = pickerProps) == null ? void 0 : _pickerProps6.renderFooter);
|
|
58
|
+
renderHeader = renderHeader || ((_pickerProps7 = pickerProps) == null ? void 0 : _pickerProps7.renderHeader);
|
|
59
|
+
pickerProps = Object.assign({},
|
|
60
|
+
pickerProps, {
|
|
61
|
+
|
|
62
|
+
labelKey: labelKey,
|
|
63
|
+
valueKey: valueKey,
|
|
64
|
+
useRawOption: useRawOption,
|
|
65
|
+
multiple: multiple,
|
|
66
|
+
onEndReached: onEndReached,
|
|
67
|
+
renderFooter: renderFooter,
|
|
68
|
+
renderHeader: renderHeader });
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
popoverMaxHeight = popoverMaxHeight || 300;
|
|
72
|
+
|
|
73
|
+
useBottomDrawer = useResponsiveValue(useBottomDrawer);
|
|
74
|
+
|
|
75
|
+
value = (_value = value) != null ? _value : localValue;
|
|
76
|
+
|
|
77
|
+
var handleChange = React.useCallback(
|
|
78
|
+
function (value, option) {
|
|
79
|
+
if (!!multiple) {
|
|
80
|
+
setInputValue(value.map(function (item) {return getOptionLabel(options, item, { valueKey: valueKey, labelKey: labelKey });}).join(', '));
|
|
81
|
+
} else {
|
|
82
|
+
setInputValue((option == null ? void 0 : option[labelKey]) || getOptionLabel(options, option, { valueKey: valueKey, labelKey: labelKey }));
|
|
83
|
+
}
|
|
84
|
+
setLocalValue(value);
|
|
85
|
+
onChange == null ? void 0 : onChange(value);
|
|
86
|
+
},
|
|
87
|
+
[labelKey, valueKey]
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
React.useEffect(function () {
|
|
91
|
+
if (!!multiple) {var _value2;
|
|
92
|
+
setInputValue((_value2 = value) == null ? void 0 : _value2.map == null ? void 0 : _value2.map(function (item) {return getOptionLabel(options, item, { valueKey: valueKey, labelKey: labelKey });}).join(', '));
|
|
93
|
+
} else {var _value3;
|
|
94
|
+
var label = ((_value3 = value) == null ? void 0 : _value3[labelKey]) || getOptionLabel(options, value, { valueKey: valueKey, labelKey: labelKey });
|
|
95
|
+
if (!!label || !value) setInputValue(label);
|
|
96
|
+
}
|
|
97
|
+
}, [value]);
|
|
98
|
+
|
|
99
|
+
var handleChangeSearch = React.useCallback(function (v) {
|
|
100
|
+
onChangeSearch == null ? void 0 : onChangeSearch(v);
|
|
101
|
+
setSearch(v);
|
|
102
|
+
}, []);
|
|
103
|
+
|
|
104
|
+
var Input = !useSearch || useBottomDrawer ? LinkInput : FullWidthInputWrapper;
|
|
105
|
+
var valueWatcher = multiple && localValue;
|
|
106
|
+
|
|
107
|
+
var finalRenderOption = React.useCallback(
|
|
108
|
+
function (params) {var _option, _option2, _option3;
|
|
109
|
+
if (!!renderOption) return renderOption(params);
|
|
110
|
+
var option = params.option,labelKey = params.labelKey,selected = params.selected;
|
|
111
|
+
if ((_option = option) != null && _option.id) option = dissoc('id', option);
|
|
112
|
+
if ((_option2 = option) != null && _option2.color) option = Object.assign({}, option, { color: undefined, iconColor: option.color });
|
|
113
|
+
|
|
114
|
+
return _jsx(IconLabel, Object.assign({}, option, { label: (_option3 = option) == null ? void 0 : _option3[labelKey], flex: true, strong: selected }));
|
|
115
|
+
},
|
|
116
|
+
[renderOption]
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
_jsx(Popover, Object.assign({
|
|
121
|
+
trigger: "click",
|
|
122
|
+
startsOpen: startsOpen,
|
|
123
|
+
onOpenChange: function onOpenChange(open) {
|
|
124
|
+
if (open) handleChangeSearch('');
|
|
125
|
+
_onOpenChange == null ? void 0 : _onOpenChange(open);
|
|
126
|
+
},
|
|
127
|
+
placement: placement || 'bottomLeft',
|
|
128
|
+
snapPoints: snapPoints || [450],
|
|
129
|
+
useBottomDrawer: useBottomDrawer,
|
|
130
|
+
parentWidth: true,
|
|
131
|
+
padding: 0,
|
|
132
|
+
watch: [search, options, valueWatcher],
|
|
133
|
+
unmountOnClose: true,
|
|
134
|
+
maxHeight: popoverMaxHeight },
|
|
135
|
+
popoverProps, {
|
|
136
|
+
renderContent: function renderContent(_ref3) {var onClose = _ref3.onClose;return (
|
|
137
|
+
_jsx(Picker, Object.assign({
|
|
138
|
+
row: false,
|
|
139
|
+
options: searchOptions(options, search, { labelKey: labelKey }),
|
|
140
|
+
value: value,
|
|
141
|
+
gap: 0,
|
|
142
|
+
maxHeight: !useBottomDrawer && popoverMaxHeight,
|
|
143
|
+
useFlatList: true,
|
|
144
|
+
onlyOnScreen: true,
|
|
145
|
+
itemMinHeight: 30,
|
|
146
|
+
onChange: function onChange(v, option) {
|
|
147
|
+
handleChange(v, option);
|
|
148
|
+
if (!multiple) {
|
|
149
|
+
setFocus(false);
|
|
150
|
+
onClose();
|
|
151
|
+
}
|
|
152
|
+
} },
|
|
153
|
+
pickerProps, {
|
|
154
|
+
renderHeader:
|
|
155
|
+
useBottomDrawer && useSearch ?
|
|
156
|
+
function () {return (
|
|
157
|
+
_jsxs(_Fragment, { children: [
|
|
158
|
+
_jsx(View, { padding: "md", paddingB: "xs", children:
|
|
159
|
+
_jsx(TextInput, {
|
|
160
|
+
prefixIcon: "search-line",
|
|
161
|
+
prefixIconColor: "text4",
|
|
162
|
+
value: search,
|
|
163
|
+
onChange: handleChangeSearch }
|
|
164
|
+
) }
|
|
165
|
+
),
|
|
166
|
+
renderHeader == null ? void 0 : renderHeader()] }
|
|
167
|
+
));} :
|
|
168
|
+
|
|
169
|
+
renderHeader,
|
|
170
|
+
|
|
171
|
+
renderOption: function renderOption(_ref4) {var option = _ref4.option,selected = _ref4.selected,onChange = _ref4.onChange;return (
|
|
172
|
+
_jsxs(Link, {
|
|
173
|
+
row: true,
|
|
174
|
+
paddingH: useBottomDrawer ? 'md' : 'sm',
|
|
175
|
+
paddingV: "xs",
|
|
176
|
+
minHeight: useBottomDrawer ? 'xl' : 'md',
|
|
177
|
+
gap: "sm",
|
|
178
|
+
onMouseDown: function onMouseDown(e) {return !!multiple && e.preventDefault();},
|
|
179
|
+
onPress: onChange,
|
|
180
|
+
centerV: true,
|
|
181
|
+
bg: selected && 'primary_op10', children: [
|
|
182
|
+
|
|
183
|
+
_jsx(View, { flex: true, row: true, children:
|
|
184
|
+
finalRenderOption({ option: option, labelKey: labelKey, selected: selected }) }
|
|
185
|
+
),
|
|
186
|
+
selected && _jsx(Icon, { name: "checkbox-circle-fill", primary: true })] }
|
|
187
|
+
));} })
|
|
188
|
+
|
|
189
|
+
));}, children:
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
_jsx(Input, Object.assign({
|
|
193
|
+
value: !!focus ? search : inputValue,
|
|
194
|
+
onChange: handleChangeSearch,
|
|
195
|
+
onFocus: function onFocus() {
|
|
196
|
+
handleChangeSearch('');
|
|
197
|
+
setFocus(true);
|
|
198
|
+
},
|
|
199
|
+
onBlur: function onBlur() {
|
|
200
|
+
setTimeout(function () {
|
|
201
|
+
setFocus(false);
|
|
202
|
+
}, 200);
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
placeholder: (!multiple || !((_value4 = value) != null && _value4.length)) && placeholder,
|
|
212
|
+
suffixIcon: "arrow-down-s-fill",
|
|
213
|
+
suffixIconColor: "text4",
|
|
214
|
+
fullW: true },
|
|
215
|
+
props)
|
|
216
|
+
) })
|
|
217
|
+
));
|
|
218
|
+
|
|
219
|
+
}
|
|
@@ -1 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/Switch.js";var _excluded = ["value", "onChange", "disabled", "initialValue"],_excluded2 = ["switchProps"],_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 { AbsSwitch } from "../../abstractions/Switch";
|
|
5
|
+
import { ContentLabel } from "../presentation/ContentLabel";
|
|
6
|
+
import { Picker } from "./Picker";
|
|
7
|
+
import { useColorConverter } from "../../modifiers/colorConverter";
|
|
8
|
+
import { useSizeConverter } from "../../modifiers/sizeConverter";
|
|
9
|
+
import { useThemeComponentModifier } from "../../modifiers/themeComponent";import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
export function Switch(_ref) {var value = _ref.value,onChange = _ref.onChange,disabled = _ref.disabled,initialValue = _ref.initialValue,rootProps = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
var _pipe = pipe(
|
|
13
|
+
useColorConverter('primary'),
|
|
14
|
+
useSizeConverter('elementHeights', 'md'),
|
|
15
|
+
useThemeComponentModifier('Switch')
|
|
16
|
+
)([{}, rootProps]),_pipe2 = _slicedToArray(_pipe, 2),_pipe2$ = _pipe2[0],size = _pipe2$.size,sizeCode = _pipe2$.sizeCode,color = _pipe2$.color,props = _pipe2[1];
|
|
17
|
+
|
|
18
|
+
var _React$useState = React.useState(initialValue),_React$useState2 = _slicedToArray(_React$useState, 2),localValue = _React$useState2[0],setLocalValue = _React$useState2[1];
|
|
19
|
+
value = value === undefined ? localValue : value;
|
|
20
|
+
onChange = onChange || setLocalValue;
|
|
21
|
+
|
|
22
|
+
var toggle = function toggle() {
|
|
23
|
+
if (!!disabled) return;
|
|
24
|
+
setLocalValue(!value);
|
|
25
|
+
onChange == null ? void 0 : onChange(!value);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
_jsx(ContentLabel, Object.assign({
|
|
30
|
+
className: "neko-checkbox",
|
|
31
|
+
size: sizeCode,
|
|
32
|
+
gap: 8,
|
|
33
|
+
disabled: disabled,
|
|
34
|
+
content:
|
|
35
|
+
_jsx(AbsSwitch, {
|
|
36
|
+
color: color,
|
|
37
|
+
value: value,
|
|
38
|
+
onValueChange: toggle,
|
|
39
|
+
trackColor: { true: color },
|
|
40
|
+
disabled: disabled,
|
|
41
|
+
height: size * 0.75 }
|
|
42
|
+
) },
|
|
43
|
+
|
|
44
|
+
props)
|
|
45
|
+
));
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function SwitchGroup(_ref2) {var _this = this;var switchProps = _ref2.switchProps,props = _objectWithoutProperties(_ref2, _excluded2);
|
|
50
|
+
return (
|
|
51
|
+
_jsx(Picker, Object.assign({
|
|
52
|
+
multiple: true,
|
|
53
|
+
row: false },
|
|
54
|
+
props, {
|
|
55
|
+
renderOption: function renderOption(_ref3) {var option = _ref3.option,selected = _ref3.selected,onChange = _ref3.onChange,labelKey = _ref3.labelKey,props = _objectWithoutProperties(_ref3, _excluded3);return (
|
|
56
|
+
_jsx(Switch, Object.assign({ label: option[labelKey], value: selected, onChange: onChange }, props, switchProps)));} })
|
|
57
|
+
|
|
58
|
+
));
|
|
59
|
+
|
|
60
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/TextArea.js";import { TextInput } from "./TextInput";import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
export function TextArea(props) {
|
|
4
|
+
return _jsx(TextInput, Object.assign({ multiline: true }, props));
|
|
5
|
+
}
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/TextInput.js";var _excluded = ["onChange", "multiline", "rows"];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 { AbsTextInput } from "../../abstractions/TextInput";
|
|
2
|
+
import { InputWrapper } from "./InputWrapper";
|
|
3
|
+
import { useColors } from "../../theme/ThemeHandler";import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
export function TextInput(_ref) {var onChange = _ref.onChange,multiline = _ref.multiline,rows = _ref.rows,props = _objectWithoutProperties(_ref, _excluded);
|
|
6
|
+
var colors = useColors();
|
|
7
|
+
|
|
8
|
+
var STYLE = Object.assign({
|
|
9
|
+
width: '100%',
|
|
10
|
+
borderWidth: 0,
|
|
11
|
+
background: 'transparent',
|
|
12
|
+
outline: 'none',
|
|
13
|
+
color: colors.text },
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
multiline ? { resize: 'none' } : { height: '100%' });
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
_jsx(InputWrapper, Object.assign({}, props, { multiline: multiline, children:
|
|
22
|
+
_jsx(AbsTextInput, Object.assign({
|
|
23
|
+
style: STYLE,
|
|
24
|
+
placeholderTextColor: colors.text_op30 },
|
|
25
|
+
props, {
|
|
26
|
+
multiline: multiline,
|
|
27
|
+
rows: rows,
|
|
28
|
+
onChange: onChange })
|
|
29
|
+
) })
|
|
30
|
+
));
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/UploadInput.js";var _excluded = ["value"],_excluded2 = ["value", "remove"],_excluded3 = ["isDragging"],_excluded4 = ["placeholder", "isDragging"],_excluded5 = ["value", "open", "remove", "isDragging", "multiple", "area", "grid", "maxCount"];function _objectDestructuringEmpty(t) {if (null == t) throw new TypeError("Cannot destructure " + t);}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 { Icon, Image } from "../presentation";
|
|
2
|
+
import { Link } from "../actions";
|
|
3
|
+
import { LinkInput } from "./LinkInput";
|
|
4
|
+
import { Loading } from "../state";
|
|
5
|
+
import { Text } from "../text";
|
|
6
|
+
import { Upload } from "./upload/Upload";
|
|
7
|
+
import { View } from "../structure";import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
function FilePreview(_ref) {var _value$type;var value = _ref.value,props = _objectWithoutProperties(_ref, _excluded);
|
|
10
|
+
var isImage = (_value$type = value.type) == null ? void 0 : _value$type.startsWith('image/');
|
|
11
|
+
if (!isImage) {
|
|
12
|
+
return (
|
|
13
|
+
_jsx(View, Object.assign({}, props, { bg: "text4_op10", center: true, children:
|
|
14
|
+
_jsx(Icon, { name: "file-line" }) })
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
return _jsx(Image, Object.assign({ src: (value == null ? void 0 : value.uri) || (value == null ? void 0 : value.url) }, props));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function ListItem(_ref2) {var value = _ref2.value,remove = _ref2.remove,props = _objectWithoutProperties(_ref2, _excluded2);
|
|
22
|
+
var isDone = !(value != null && value.status) || (value == null ? void 0 : value.status) !== 'uploading';
|
|
23
|
+
var loading = (value == null ? void 0 : value.status) === 'uploading';
|
|
24
|
+
var hasError = (value == null ? void 0 : value.status) === 'error';
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
_jsxs(View, { row: true, gap: "sm", centerV: true, border: true, br: "md", paddingR: "md", children: [
|
|
28
|
+
_jsx(FilePreview, { value: value, width: 50, height: 50, br: "md" }),
|
|
29
|
+
_jsx(Text, { label: value.name, flex: true }),
|
|
30
|
+
hasError && _jsx(Text, { label: "Error", sm: true, red: true }),
|
|
31
|
+
loading && _jsx(Loading, {}),
|
|
32
|
+
isDone &&
|
|
33
|
+
_jsx(Link, { onPress: function onPress() {return remove(value);}, padding: "xs", children:
|
|
34
|
+
_jsx(Icon, { name: "delete-bin-2-line", red: true, xs: true }) }
|
|
35
|
+
)] }
|
|
36
|
+
|
|
37
|
+
));
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function GridItem(_ref3) {var value = _ref3.value,remove = _ref3.remove;
|
|
42
|
+
var loading = (value == null ? void 0 : value.status) === 'uploading';
|
|
43
|
+
var hasError = (value == null ? void 0 : value.status) === 'error';
|
|
44
|
+
var isDone = !(value != null && value.status) || (value == null ? void 0 : value.status) !== 'uploading';
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
_jsxs(View, { width: 80, height: 80, br: "md", hiddenOverflow: true, relative: true, children: [
|
|
48
|
+
_jsx(FilePreview, { value: value, width: 80, height: 80, br: "md" }),
|
|
49
|
+
_jsxs(View, { absolute: true, top: 0, right: 0, children: [
|
|
50
|
+
loading &&
|
|
51
|
+
_jsx(View, { center: true, bg: "backdrop_op70", br: "md", padding: "xs", children:
|
|
52
|
+
_jsx(Loading, { sm: true }) }
|
|
53
|
+
),
|
|
54
|
+
|
|
55
|
+
hasError &&
|
|
56
|
+
_jsx(View, { center: true, bg: "backdrop_op70", br: "md", padding: "xs", children:
|
|
57
|
+
_jsx(Icon, { name: "error-warning-line", red: true }) }
|
|
58
|
+
),
|
|
59
|
+
|
|
60
|
+
isDone &&
|
|
61
|
+
_jsx(Link, { onPress: function onPress() {return remove(value);}, bg: "backdrop_op70", padding: "xs", children:
|
|
62
|
+
_jsx(Icon, { name: "delete-bin-2-line", xxs: true, red: true }) }
|
|
63
|
+
)] }
|
|
64
|
+
|
|
65
|
+
)] }
|
|
66
|
+
));
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function AddTile(_ref4) {var isDragging = _ref4.isDragging,props = _objectWithoutProperties(_ref4, _excluded3);
|
|
71
|
+
return (
|
|
72
|
+
_jsx(Link, Object.assign({
|
|
73
|
+
center: true,
|
|
74
|
+
width: 80,
|
|
75
|
+
height: 80,
|
|
76
|
+
border: true,
|
|
77
|
+
borderStyle: "dashed",
|
|
78
|
+
br: "md",
|
|
79
|
+
bg: isDragging ? 'primary_op10' : 'transparent' },
|
|
80
|
+
props, { children:
|
|
81
|
+
|
|
82
|
+
_jsx(Icon, { name: "add-line" }) })
|
|
83
|
+
));
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function DropArea(_ref5) {var placeholder = _ref5.placeholder,isDragging = _ref5.isDragging,props = _objectWithoutProperties(_ref5, _excluded4);
|
|
88
|
+
return (
|
|
89
|
+
_jsxs(Link, Object.assign({
|
|
90
|
+
center: true,
|
|
91
|
+
gap: "sm",
|
|
92
|
+
border: true,
|
|
93
|
+
borderStyle: "dashed",
|
|
94
|
+
padding: "md",
|
|
95
|
+
minH: 160,
|
|
96
|
+
br: "md",
|
|
97
|
+
bg: isDragging ? 'primary_op10' : 'transparent' },
|
|
98
|
+
props, { children: [
|
|
99
|
+
|
|
100
|
+
_jsx(Icon, { name: "upload-cloud-2-line" }),
|
|
101
|
+
_jsx(Text, { label: placeholder, text4: true, center: true })] })
|
|
102
|
+
));
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function Content(_ref6) {var _this = this;var value = _ref6.value,open = _ref6.open,remove = _ref6.remove,isDragging = _ref6.isDragging,multiple = _ref6.multiple,area = _ref6.area,grid = _ref6.grid,maxCount = _ref6.maxCount,props = _objectWithoutProperties(_ref6, _excluded5);
|
|
107
|
+
var items = multiple ? value || [] : value ? [value] : [];
|
|
108
|
+
var showAdd = multiple ? !maxCount || items.length < maxCount : !value;
|
|
109
|
+
|
|
110
|
+
if (grid) {
|
|
111
|
+
return (
|
|
112
|
+
_jsxs(View, { row: true, wrap: true, gap: "sm", children: [
|
|
113
|
+
items.map(function (item) {return (
|
|
114
|
+
_jsx(GridItem, { value: item, remove: remove }, item._id));}
|
|
115
|
+
),
|
|
116
|
+
showAdd && _jsx(AddTile, { onPress: open, isDragging: isDragging })] }
|
|
117
|
+
));
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
var placeholder = 'Upload file';
|
|
122
|
+
var link = area ?
|
|
123
|
+
_jsx(DropArea, Object.assign({ onPress: open, placeholder: placeholder, isDragging: isDragging }, props)) :
|
|
124
|
+
|
|
125
|
+
_jsx(LinkInput, Object.assign({ onPress: open, prefixIcon: "upload-cloud-2-line", placeholder: placeholder }, props));
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
_jsxs(View, { gap: "xs", children: [
|
|
130
|
+
showAdd && link,
|
|
131
|
+
items.map(function (item) {return (
|
|
132
|
+
_jsx(ListItem, { value: item, remove: remove }, item._id));}
|
|
133
|
+
)] }
|
|
134
|
+
));
|
|
135
|
+
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function UploadInput(_ref7) {var _this2 = this;var props = Object.assign({}, (_objectDestructuringEmpty(_ref7), _ref7));
|
|
139
|
+
return _jsx(Upload, Object.assign({}, props, { children: function children(params) {return _jsx(Content, Object.assign({}, props, params));} }));
|
|
140
|
+
}
|
|
@@ -1 +1,89 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/_DateInput.native.js";var _excluded = ["value", "onChange", "min", "max", "onCheckDisabled", "placement", "type", "format"];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
|
+
dayjs.extend(advancedFormat);
|
|
7
|
+
dayjs.extend(weekOfYear);
|
|
8
|
+
|
|
9
|
+
import { DatePicker } from "./datePicker/DatePicker";
|
|
10
|
+
import { MaskInput } from "./MaskInput";
|
|
11
|
+
import { Popover } from "../structure/popover/Popover";
|
|
12
|
+
import { isValidDate } from "../calendar/_helpers/dateDisabled";import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
export function getDateInputDefaultFormat(type) {
|
|
15
|
+
switch (type) {
|
|
16
|
+
case 'year':
|
|
17
|
+
return 'YYYY';
|
|
18
|
+
case 'quarter':
|
|
19
|
+
return 'YYYY-Q';
|
|
20
|
+
case 'month':
|
|
21
|
+
return 'YYYY-MM';
|
|
22
|
+
case 'week':
|
|
23
|
+
return 'YYYY-ww';
|
|
24
|
+
default:
|
|
25
|
+
return 'YYYY-MM-DD';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function DateInput(_ref) {var _this = this;var value = _ref.value,onChange = _ref.onChange,min = _ref.min,max = _ref.max,onCheckDisabled = _ref.onCheckDisabled,placement = _ref.placement,_ref$type = _ref.type,type = _ref$type === void 0 ? 'day' : _ref$type,format = _ref.format,props = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
format = format || getDateInputDefaultFormat(type);
|
|
31
|
+
var _React$useState = React.useState(''),_React$useState2 = _slicedToArray(_React$useState, 2),inputValue = _React$useState2[0],setInputValue = _React$useState2[1];
|
|
32
|
+
var _React$useState3 = React.useState(value),_React$useState4 = _slicedToArray(_React$useState3, 2),localValue = _React$useState4[0],setLocalValue = _React$useState4[1];
|
|
33
|
+
|
|
34
|
+
value = value || localValue;
|
|
35
|
+
|
|
36
|
+
var validations = { min: min, max: max, onCheckDisabled: onCheckDisabled };
|
|
37
|
+
|
|
38
|
+
var handleChange = function handleChange(v) {
|
|
39
|
+
if (!isValidDate(v, format, validations)) return;
|
|
40
|
+
v = !!v ? dayjs(v) : null;
|
|
41
|
+
setLocalValue(v);
|
|
42
|
+
onChange == null ? void 0 : onChange(v);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var handleChangeInput = function handleChangeInput(v) {
|
|
46
|
+
setInputValue(v);
|
|
47
|
+
if (!isValidDate(v, format, validations)) return;
|
|
48
|
+
handleChange(v);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var onBlur = function onBlur() {
|
|
52
|
+
if (isValidDate(inputValue, format, validations)) return;
|
|
53
|
+
handleChange(null);
|
|
54
|
+
setInputValue('');
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
React.useEffect(function () {
|
|
58
|
+
setInputValue(!!value ? dayjs(value).format(format) : '');
|
|
59
|
+
}, [value]);
|
|
60
|
+
|
|
61
|
+
return false;
|
|
62
|
+
return (
|
|
63
|
+
_jsx(Popover, {
|
|
64
|
+
trigger: "click",
|
|
65
|
+
placement: placement || 'bottomLeft',
|
|
66
|
+
renderContent: function renderContent(_ref2) {var onClose = _ref2.onClose;return (
|
|
67
|
+
_jsx(DatePicker, Object.assign({
|
|
68
|
+
value: value,
|
|
69
|
+
onChange: function onChange(v) {
|
|
70
|
+
handleChange(v);
|
|
71
|
+
onClose();
|
|
72
|
+
} },
|
|
73
|
+
validations, {
|
|
74
|
+
type: type })
|
|
75
|
+
));}, children:
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
_jsx(MaskInput, Object.assign({
|
|
79
|
+
value: inputValue,
|
|
80
|
+
onChange: handleChangeInput,
|
|
81
|
+
suffixIcon: "calendar-line",
|
|
82
|
+
suffixIconColor: "text4",
|
|
83
|
+
onBlur: onBlur,
|
|
84
|
+
mask: format.replace(/[DMYQwW]/gi, '9') },
|
|
85
|
+
props)
|
|
86
|
+
) }
|
|
87
|
+
));
|
|
88
|
+
|
|
89
|
+
}
|
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
var _jsxFileName = "/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/DatePicker.js";var _excluded = ["type"];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 { DayPicker } from "./DayPicker";
|
|
2
|
+
import { MonthPicker } from "./MonthPicker";
|
|
3
|
+
import { QuarterPicker } from "./QuarterPicker";
|
|
4
|
+
import { WeekPicker } from "./WeekPicker";
|
|
5
|
+
import { YearPicker } from "./YearPicker";import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
export function DatePicker(_ref) {var type = _ref.type,props = _objectWithoutProperties(_ref, _excluded);
|
|
8
|
+
switch (type) {
|
|
9
|
+
case 'year':
|
|
10
|
+
return _jsx(YearPicker, Object.assign({}, props));
|
|
11
|
+
|
|
12
|
+
case 'quarter':
|
|
13
|
+
return _jsx(QuarterPicker, Object.assign({}, props));
|
|
14
|
+
|
|
15
|
+
case 'month':
|
|
16
|
+
return _jsx(MonthPicker, Object.assign({}, props));
|
|
17
|
+
|
|
18
|
+
case 'week':
|
|
19
|
+
return _jsx(WeekPicker, Object.assign({}, props));
|
|
20
|
+
|
|
21
|
+
default:
|
|
22
|
+
return _jsx(DayPicker, Object.assign({}, props));
|
|
23
|
+
}
|
|
24
|
+
}
|