@neko-os/ui 0.0.7 → 0.0.9
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/NekoUI.js +1 -1
- package/dist/abstractions/ActivityIndicator.native.js +1 -1
- package/dist/abstractions/ActivityIndicator.web.js +1 -0
- package/dist/abstractions/AnimatedView.js +1 -1
- package/dist/abstractions/BlurView.js +1 -0
- package/dist/abstractions/BlurView.native.js +1 -0
- package/dist/abstractions/BlurView.web.js +1 -0
- package/dist/abstractions/FlatList.js +1 -0
- package/dist/abstractions/FlatList.native.js +1 -0
- package/dist/abstractions/FlatList.web.js +1 -0
- package/dist/abstractions/GradientView.js +1 -0
- package/dist/abstractions/GradientView.native.js +1 -0
- package/dist/abstractions/Icon.native.js +1 -1
- package/dist/abstractions/ImageBackground.js +1 -0
- package/dist/abstractions/ImageBackground.native.js +1 -0
- package/dist/abstractions/ImageBackground.web.js +1 -0
- package/dist/abstractions/Pressable.js +1 -0
- package/dist/abstractions/Pressable.native.js +1 -0
- package/dist/abstractions/Pressable.web.js +1 -0
- package/dist/abstractions/ScrollView.js +1 -0
- package/dist/abstractions/ScrollView.native.js +1 -0
- package/dist/abstractions/ScrollView.web.js +1 -0
- package/dist/abstractions/TextInput.js +1 -1
- package/dist/abstractions/helpers/storage.js +1 -0
- package/dist/abstractions/helpers/storage.native.js +1 -0
- package/dist/components/actions/Button.js +1 -1
- package/dist/components/actions/Dropdown.js +1 -1
- package/dist/components/actions/Link.js +1 -1
- package/dist/components/actions/Pressable.js +1 -0
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/menu/HorizontalMenu.js +1 -1
- package/dist/components/actions/menu/VerticalMenu.js +1 -1
- package/dist/components/animations/ReanimatedView.js +1 -0
- package/dist/components/calendar/CalendarNav.js +1 -0
- package/dist/components/calendar/WeekDaysBar.js +1 -0
- package/dist/components/calendar/_helpers/calendarDays.js +1 -1
- package/dist/components/calendar/_helpers/dateDisabled.js +1 -0
- package/dist/components/calendar/index.js +0 -1
- package/dist/components/feedback/alerter.js +1 -0
- package/dist/components/feedback/confirmer.js +1 -0
- package/dist/components/feedback/index.js +1 -1
- package/dist/components/feedback/notifications/Notification.js +1 -1
- package/dist/components/feedback/notifications/NotificationsHandler.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/inputs/DateInput.js +1 -0
- package/dist/components/inputs/InputWrapper.js +1 -1
- package/dist/components/inputs/LinkInput.js +1 -0
- package/dist/components/inputs/MaskInput.js +1 -0
- package/dist/components/inputs/TextInput.js +1 -1
- package/dist/components/inputs/_DateInput.native.js +1 -0
- package/dist/components/inputs/datePicker/DatePicker.js +1 -0
- package/dist/components/inputs/datePicker/DayPicker.js +1 -0
- package/dist/components/inputs/datePicker/MonthPicker.js +1 -0
- package/dist/components/inputs/datePicker/QuarterPicker.js +1 -0
- package/dist/components/inputs/datePicker/WeekPicker.js +1 -0
- package/dist/components/inputs/datePicker/YearPicker.js +1 -0
- package/dist/components/inputs/index.js +1 -1
- package/dist/components/layout/Layout.js +1 -1
- package/dist/components/list/FlatList.js +1 -0
- package/dist/components/list/ScrollView.js +1 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/presentation/ImageBackground.js +1 -0
- package/dist/components/presentation/Result.js +1 -1
- package/dist/components/presentation/index.js +1 -1
- package/dist/components/state/LoadingView.js +1 -1
- package/dist/components/structure/Accordion.js +1 -1
- package/dist/components/structure/BlurView.js +1 -0
- package/dist/components/structure/GradientView.js +1 -0
- package/dist/components/structure/View.js +1 -1
- package/dist/components/structure/bottomDrawer/index.js +1 -0
- package/dist/components/structure/bottomDrawer/index.native.js +1 -0
- package/dist/components/structure/bottomDrawer/index.web.js +1 -0
- package/dist/components/structure/bottomDrawer/native/BottomDrawer.js +1 -0
- package/dist/components/structure/bottomDrawer/native/DrawerContext.js +1 -0
- package/dist/components/structure/bottomDrawer/native/DrawerHandle.js +1 -0
- package/dist/components/structure/bottomDrawer/native/DrawerScrollView.js +1 -0
- package/dist/components/structure/bottomDrawer/native/utils.js +1 -0
- package/dist/components/structure/bottomDrawer/web/BottomDrawer.js +1 -0
- package/dist/components/structure/drawer/Drawer.js +1 -0
- package/dist/components/structure/drawer/Drawer.native.js +1 -0
- package/dist/components/structure/drawer/index.js +1 -0
- package/dist/components/structure/index.js +1 -1
- package/dist/components/structure/modal/Modal.js +1 -0
- package/dist/components/structure/modal/Modal.native.js +1 -0
- package/dist/components/structure/modal/ModalBackdrop.js +1 -0
- package/dist/components/structure/modal/ModalContent.js +1 -0
- package/dist/components/structure/modal/ModalFooter.js +1 -0
- package/dist/components/structure/modal/ModalHeader.js +1 -0
- package/dist/components/structure/modal/handler/ModalsHandler.js +1 -0
- package/dist/components/structure/modal/index.js +1 -0
- package/dist/components/structure/overlay/OverlayWrapper.js +1 -1
- package/dist/components/structure/popover/Popover.js +1 -1
- package/dist/components/structure/popover/Popover.native.js +1 -1
- package/dist/components/theme/ThemePicker.js +1 -0
- package/dist/components/theme/ThemePickerDrawer.js +1 -0
- package/dist/components/theme/ThemeStatusBar.js +1 -0
- package/dist/components/theme/ThemeStatusBar.native.js +1 -0
- package/dist/components/theme/ThemeThumb.js +1 -0
- package/dist/components/theme/index.js +1 -0
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/storage.js +1 -0
- package/dist/modifiers/animations/animatedEffects.js +1 -1
- package/dist/modifiers/animations/animatedEffects.native.js +1 -1
- package/dist/modifiers/animations/fadeEffect.js +1 -1
- package/dist/modifiers/animations/scaleEffect.js +1 -0
- package/dist/modifiers/animations/scaleEffect.native.js +1 -0
- package/dist/modifiers/animations/slideEffect.js +1 -1
- package/dist/modifiers/background.js +1 -1
- package/dist/modifiers/cursor.js +1 -0
- package/dist/modifiers/display.js +1 -1
- package/dist/modifiers/fullColor.js +1 -1
- package/dist/modifiers/hover.js +1 -0
- package/dist/modifiers/position.js +1 -1
- package/dist/modifiers/size.js +1 -1
- package/dist/modifiers/state.js +1 -1
- package/dist/responsive/responsiveHooks.js +1 -1
- package/dist/theme/ThemeHandler.js +1 -1
- package/dist/theme/default/base.js +1 -1
- package/dist/theme/default/blackTheme.js +1 -0
- package/dist/theme/default/cyberpunkTheme.js +1 -1
- package/dist/theme/default/darkTheme.js +1 -1
- package/dist/theme/default/deepWoodsTheme.js +1 -1
- package/dist/theme/default/forestTheme.js +1 -1
- package/dist/theme/default/hackerTheme.js +1 -1
- package/dist/theme/default/lightTheme.js +1 -1
- package/dist/theme/default/midnightTheme.js +1 -1
- package/dist/theme/default/msdosTheme.js +1 -1
- package/dist/theme/default/oceanTheme.js +1 -1
- package/dist/theme/default/paperTheme.js +1 -0
- package/dist/theme/default/pastelTheme.js +1 -1
- package/dist/theme/default/sunsetTheme.js +1 -1
- package/dist/theme/default/themes.js +1 -1
- package/dist/theme/format/formatTheme.js +1 -1
- package/dist/theme/helpers/contrastColor.js +1 -1
- package/package.json +8 -3
- package/src/NekoUI.js +18 -3
- package/src/abstractions/ActivityIndicator.native.js +3 -4
- package/src/abstractions/ActivityIndicator.web.js +43 -0
- package/src/abstractions/AnimatedView.js +3 -3
- package/src/abstractions/BlurView.js +43 -0
- package/src/abstractions/BlurView.native.js +39 -0
- package/src/abstractions/BlurView.web.js +39 -0
- package/src/abstractions/FlatList.js +39 -0
- package/src/abstractions/FlatList.native.js +32 -0
- package/src/abstractions/FlatList.web.js +3 -0
- package/src/abstractions/GradientView.js +5 -0
- package/src/abstractions/GradientView.native.js +32 -0
- package/src/abstractions/Icon.native.js +4 -2
- package/src/abstractions/ImageBackground.js +17 -0
- package/src/abstractions/ImageBackground.native.js +27 -0
- package/src/abstractions/ImageBackground.web.js +7 -0
- package/src/abstractions/Pressable.js +4 -0
- package/src/abstractions/Pressable.native.js +3 -0
- package/src/abstractions/Pressable.web.js +3 -0
- package/src/abstractions/ScrollView.js +3 -0
- package/src/abstractions/ScrollView.native.js +5 -0
- package/src/abstractions/ScrollView.web.js +3 -0
- package/src/abstractions/Text.web.js +15 -0
- package/src/abstractions/TextInput.js +2 -2
- package/src/abstractions/helpers/storage.js +32 -0
- package/src/abstractions/helpers/storage.native.js +34 -0
- package/src/components/actions/Button.js +8 -0
- package/src/components/actions/Dropdown.js +18 -2
- package/src/components/actions/Link.js +16 -2
- package/src/components/actions/Pressable.js +38 -0
- package/src/components/actions/index.js +1 -0
- package/src/components/actions/menu/HorizontalMenu.js +2 -1
- package/src/components/actions/menu/VerticalMenu.js +5 -4
- package/src/components/animations/ReanimatedView.js +40 -0
- package/src/components/calendar/CalendarNav.js +67 -0
- package/src/components/calendar/WeekDaysBar.js +18 -0
- package/src/components/calendar/_helpers/calendarDays.js +1 -3
- package/src/components/calendar/_helpers/dateDisabled.js +24 -0
- package/src/components/calendar/index.js +1 -1
- package/src/components/feedback/alerter.js +31 -0
- package/src/components/feedback/confirmer.js +70 -0
- package/src/components/feedback/index.js +2 -0
- package/src/components/feedback/notifications/Notification.js +1 -1
- package/src/components/feedback/notifications/NotificationsHandler.js +3 -3
- package/src/components/index.js +2 -0
- package/src/components/inputs/DateInput.js +111 -0
- package/src/components/inputs/InputWrapper.js +18 -6
- package/src/components/inputs/LinkInput.js +17 -0
- package/src/components/inputs/MaskInput.js +67 -0
- package/src/components/inputs/TextInput.js +2 -2
- package/src/components/inputs/_DateInput.native.js +89 -0
- package/src/components/inputs/datePicker/DatePicker.js +24 -0
- package/src/components/inputs/datePicker/DayPicker.js +65 -0
- package/src/components/inputs/datePicker/MonthPicker.js +62 -0
- package/src/components/inputs/datePicker/QuarterPicker.js +65 -0
- package/src/components/inputs/datePicker/WeekPicker.js +74 -0
- package/src/components/inputs/datePicker/YearPicker.js +67 -0
- package/src/components/inputs/index.js +4 -0
- package/src/components/layout/Layout.js +1 -1
- package/src/components/list/FlatList.js +54 -0
- package/src/components/list/ScrollView.js +58 -0
- package/src/components/list/index.js +2 -0
- package/src/components/presentation/ImageBackground.js +38 -0
- package/src/components/presentation/Result.js +2 -2
- package/src/components/presentation/index.js +1 -0
- package/src/components/state/LoadingView.js +10 -1
- package/src/components/structure/Accordion.js +1 -1
- package/src/components/structure/BlurView.js +58 -0
- package/src/components/structure/GradientView.js +42 -0
- package/src/components/structure/View.js +2 -0
- package/src/components/structure/bottomDrawer/index.js +1 -0
- package/src/components/structure/bottomDrawer/index.native.js +4 -0
- package/src/components/structure/bottomDrawer/index.web.js +4 -0
- package/src/components/structure/bottomDrawer/native/BottomDrawer.js +242 -0
- package/src/components/structure/bottomDrawer/native/DrawerContext.js +21 -0
- package/src/components/structure/bottomDrawer/native/DrawerHandle.js +12 -0
- package/src/components/structure/bottomDrawer/native/DrawerScrollView.js +83 -0
- package/src/components/structure/bottomDrawer/native/utils.js +58 -0
- package/src/components/structure/bottomDrawer/web/BottomDrawer.js +3 -0
- package/src/components/structure/drawer/Drawer.js +5 -0
- package/src/components/structure/drawer/Drawer.native.js +3 -0
- package/src/components/structure/drawer/index.js +1 -0
- package/src/components/structure/index.js +5 -0
- package/src/components/structure/modal/Modal.js +84 -0
- package/src/components/structure/modal/Modal.native.js +83 -0
- package/src/components/structure/modal/ModalBackdrop.js +58 -0
- package/src/components/structure/modal/ModalContent.js +28 -0
- package/src/components/structure/modal/ModalFooter.js +31 -0
- package/src/components/structure/modal/ModalHeader.js +50 -0
- package/src/components/structure/modal/handler/ModalsHandler.js +61 -0
- package/src/components/structure/modal/index.js +6 -0
- package/src/components/structure/overlay/OverlayWrapper.js +1 -1
- package/src/components/structure/popover/Popover.js +37 -2
- package/src/components/structure/popover/Popover.native.js +46 -16
- package/src/components/theme/ThemePicker.js +49 -0
- package/src/components/theme/ThemePickerDrawer.js +13 -0
- package/src/components/theme/ThemeStatusBar.js +3 -0
- package/src/components/theme/ThemeStatusBar.native.js +9 -0
- package/src/components/theme/ThemeThumb.js +98 -0
- package/src/components/theme/index.js +3 -0
- package/src/helpers/index.js +1 -0
- package/src/helpers/storage.js +54 -0
- package/src/modifiers/animations/animatedEffects.js +2 -0
- package/src/modifiers/animations/animatedEffects.native.js +3 -1
- package/src/modifiers/animations/fadeEffect.js +4 -2
- package/src/modifiers/animations/scaleEffect.js +45 -0
- package/src/modifiers/animations/scaleEffect.native.js +33 -0
- package/src/modifiers/animations/slideEffect.js +3 -1
- package/src/modifiers/background.js +16 -4
- package/src/modifiers/cursor.js +21 -0
- package/src/modifiers/display.js +2 -2
- package/src/modifiers/fullColor.js +2 -2
- package/src/modifiers/hover.js +28 -0
- package/src/modifiers/position.js +24 -3
- package/src/modifiers/size.js +2 -1
- package/src/modifiers/state.js +1 -1
- package/src/responsive/responsiveHooks.js +7 -0
- package/src/theme/ThemeHandler.js +18 -2
- package/src/theme/default/base.js +6 -6
- package/src/theme/default/blackTheme.js +35 -0
- package/src/theme/default/cyberpunkTheme.js +4 -1
- package/src/theme/default/darkTheme.js +4 -1
- package/src/theme/default/deepWoodsTheme.js +5 -2
- package/src/theme/default/forestTheme.js +4 -1
- package/src/theme/default/hackerTheme.js +4 -1
- package/src/theme/default/lightTheme.js +4 -1
- package/src/theme/default/midnightTheme.js +4 -1
- package/src/theme/default/msdosTheme.js +19 -4
- package/src/theme/default/oceanTheme.js +5 -2
- package/src/theme/default/paperTheme.js +35 -0
- package/src/theme/default/pastelTheme.js +5 -2
- package/src/theme/default/sunsetTheme.js +7 -4
- package/src/theme/default/themes.js +9 -10
- package/src/theme/format/formatTheme.js +9 -3
- package/src/theme/helpers/contrastColor.js +49 -11
- package/dist/abstractions/TouchableOpacity.web.js +0 -1
- package/dist/components/calendar/DayPicker.js +0 -1
- package/src/abstractions/TouchableOpacity.web.js +0 -3
- package/src/components/calendar/DayPicker.js +0 -94
package/dist/NekoUI.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/NekoUI.js";var _excluded=["children"];import{NotificationsHandler}from"./components/feedback/notifications/NotificationsHandler";import{OverlayHandler}from"./components/structure/overlay/OverlayHandler";import{PortalHandler}from"./components/helpers/PortalHandler";import{ResponsiveHandler}from"./responsive/ResponsiveHandler";import{ThemeHandler}from"./theme/ThemeHandler";import{jsx as _jsx}from"react/jsx-runtime";export function NekoUI(_ref){var children=_ref.children,props=_objectWithoutProperties(_ref,_excluded);return _jsx(ThemeHandler,Object.assign({},props,{children:_jsx(ResponsiveHandler,{children:_jsx(PortalHandler,{children:_jsx(
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/NekoUI.js";var _excluded=["children"];import{ModalsHandler}from"./components/structure/modal/handler/ModalsHandler";import{NotificationsHandler}from"./components/feedback/notifications/NotificationsHandler";import{OverlayHandler}from"./components/structure/overlay/OverlayHandler";import{PortalHandler}from"./components/helpers/PortalHandler";import{ResponsiveHandler}from"./responsive/ResponsiveHandler";import{ThemeHandler}from"./theme/ThemeHandler";import{ThemePickerDrawer}from"./components/theme";import{useThemeHandler}from"./theme";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function NekoUI(_ref){var children=_ref.children,props=_objectWithoutProperties(_ref,_excluded);return _jsx(ThemeHandler,Object.assign({},props,{children:_jsx(ResponsiveHandler,{children:_jsx(PortalHandler,{children:_jsx(ModalsHandler,{children:_jsx(NotificationsHandler,{children:_jsxs(OverlayHandler,{children:[children,_jsx(FixedComponents,{})]})})})})})}));}function FixedComponents(){var _useThemeHandler=useThemeHandler(),themePickerOpen=_useThemeHandler.themePickerOpen,setThemePickerOpen=_useThemeHandler.setThemePickerOpen;return _jsx(ThemePickerDrawer,{open:themePickerOpen,onClose:function onClose(){return setThemePickerOpen(false);}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/ActivityIndicator.native.js";import
|
|
1
|
+
var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/ActivityIndicator.native.js";import{Animated,Easing,Platform}from"react-native-web";import React from'react';import tinycolor from'tinycolor2';import{jsx as _jsx}from"react/jsx-runtime";export function AbsActivityIndicator(_ref){var _ref$size=_ref.size,size=_ref$size===void 0?20:_ref$size,color=_ref.color,style=_ref.style;var spinValue=React.useRef(new Animated.Value(0)).current;var bg=tinycolor(color).setAlpha(0.2).toString();React.useEffect(function(){var spinAnimation=Animated.loop(Animated.timing(spinValue,{toValue:1,duration:1000,easing:Easing.linear,useNativeDriver:Platform.OS!=='web'}));spinAnimation.start();return function(){return spinAnimation.stop();};},[spinValue]);var spin=spinValue.interpolate({inputRange:[0,1],outputRange:['0deg','360deg']});var borderWidth=size/8;return _jsx(Animated.View,{style:Object.assign({width:size,height:size,borderRadius:size/2,borderWidth:borderWidth,borderColor:`${bg}`,borderTopColor:color,transform:[{rotate:spin}]},style)});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/ActivityIndicator.web.js";import tinycolor from'tinycolor2';import{Animated,Easing}from"react-native-web";import React from'react';import{jsx as _jsx}from"react/jsx-runtime";export function AbsActivityIndicator(_ref){var _ref$size=_ref.size,size=_ref$size===void 0?20:_ref$size,color=_ref.color,style=_ref.style;var spinValue=React.useRef(new Animated.Value(0)).current;var bg=tinycolor(color).setAlpha(0.2).toString();React.useEffect(function(){var spinAnimation=Animated.loop(Animated.timing(spinValue,{toValue:1,duration:1000,easing:Easing.linear,useNativeDriver:false}));spinAnimation.start();return function(){return spinAnimation.stop();};},[spinValue]);var spin=spinValue.interpolate({inputRange:[0,1],outputRange:['0deg','360deg']});var borderWidth=size/8;return _jsx(Animated.View,{style:Object.assign({width:size,height:size,borderRadius:size/2,borderWidth:borderWidth,borderColor:`${bg}`,borderTopColor:color,transform:[{rotate:spin}]},style)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{AbsView}from"./View";export var AbsAnimatedView=AbsView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["tint","intensity","style"];var _this=this,_jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/BlurView.js";import{AbsView}from"./View";import{jsx as _jsx}from"react/jsx-runtime";var tintMap={light:'rgba(255,255,255,0.3)',dark:'rgba(0,0,0,0.3)',default:'rgba(255,255,255,0.2)',extraLight:'rgba(255,255,255,0.5)',regular:'rgba(255,255,255,0.3)',prominent:'rgba(255,255,255,0.7)',systemUltraThinMaterial:'rgba(255,255,255,0.1)',systemThinMaterial:'rgba(255,255,255,0.2)',systemMaterial:'rgba(255,255,255,0.3)',systemThickMaterial:'rgba(255,255,255,0.4)',systemChromeMaterial:'rgba(255,255,255,0.5)',systemUltraThinMaterialLight:'rgba(255,255,255,0.1)',systemThinMaterialLight:'rgba(255,255,255,0.2)',systemMaterialLight:'rgba(255,255,255,0.3)',systemThickMaterialLight:'rgba(255,255,255,0.4)',systemChromeMaterialLight:'rgba(255,255,255,0.5)',systemUltraThinMaterialDark:'rgba(0,0,0,0.1)',systemThinMaterialDark:'rgba(0,0,0,0.2)',systemMaterialDark:'rgba(0,0,0,0.3)',systemThickMaterialDark:'rgba(0,0,0,0.4)',systemChromeMaterialDark:'rgba(0,0,0,0.5)'};export var AbsBlurView=function AbsBlurView(_ref){var tint=_ref.tint,intensity=_ref.intensity,style=_ref.style,props=_objectWithoutProperties(_ref,_excluded);var blurPx=Math.round(intensity/100*25);var backgroundColor=tintMap[tint]||tintMap.default;return _jsx(AbsView,Object.assign({},props,{style:Object.assign({width:'100%',backgroundColor:backgroundColor},style,{backdropFilter:`blur(${blurPx}px)`,WebkitBackdropFilter:`blur(${blurPx}px)`})}));};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["intensity","tint","disabledForAndroid","style","children"];var _this=this,_jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/BlurView.native.js";import{AbsView}from"./View";import{jsx as _jsx}from"react/jsx-runtime";var AbsBlurView;try{var _ref=require('expo-blur')||{},BlurView=_ref.BlurView;AbsBlurView=function AbsBlurView(_ref2){var intensity=_ref2.intensity,tint=_ref2.tint,disabledForAndroid=_ref2.disabledForAndroid,style=_ref2.style,children=_ref2.children,props=_objectWithoutProperties(_ref2,_excluded);return _jsx(BlurView,{intensity:intensity,tint:tint,style:[style,{overflow:'hidden'}],experimentalBlurMethod:disabledForAndroid?'none':'dimezisBlurView',children:children});};}catch(_unused){AbsBlurView=function AbsBlurView(props){console.warn('expo-blur not instaled.');return _jsx(AbsView,Object.assign({},props));};}export{AbsBlurView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["intensity","tint","disabledForAndroid","style","children"];var _this=this,_jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/BlurView.web.js";import{AbsView}from"./View";import{jsx as _jsx}from"react/jsx-runtime";var AbsBlurView;try{var _ref=require('expo-blur')||{},BlurView=_ref.BlurView;AbsBlurView=function AbsBlurView(_ref2){var intensity=_ref2.intensity,tint=_ref2.tint,disabledForAndroid=_ref2.disabledForAndroid,style=_ref2.style,children=_ref2.children,props=_objectWithoutProperties(_ref2,_excluded);return _jsx(BlurView,{intensity:intensity,tint:tint,style:[style,{overflow:'hidden'}],experimentalBlurMethod:disabledForAndroid?'none':'dimezisBlurView',children:children});};}catch(_unused){AbsBlurView=function AbsBlurView(props){console.warn('expo-blur not instaled.');return _jsx(AbsView,Object.assign({},props));};}export{AbsBlurView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/FlatList.js";var _excluded=["data","renderItem","ListEmptyComponent","Empty","renderEmpty","ListFooterComponent","Footer","renderFooter","ListHeaderComponent","Header","renderHeader","keyExtractor"];import React from'react';import{AbsView}from"./View";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var defaultRender=function defaultRender(){return false;};export function AbsFlatList(_ref){var _this=this;var data=_ref.data,renderItem=_ref.renderItem,ListEmptyComponent=_ref.ListEmptyComponent,Empty=_ref.Empty,renderEmpty=_ref.renderEmpty,ListFooterComponent=_ref.ListFooterComponent,Footer=_ref.Footer,renderFooter=_ref.renderFooter,ListHeaderComponent=_ref.ListHeaderComponent,Header=_ref.Header,renderHeader=_ref.renderHeader,keyExtractor=_ref.keyExtractor,props=_objectWithoutProperties(_ref,_excluded);ListEmptyComponent=ListEmptyComponent||Empty||defaultRender;ListFooterComponent=ListFooterComponent||Footer||renderFooter||defaultRender;ListHeaderComponent=ListHeaderComponent||Header||renderHeader||defaultRender;keyExtractor=keyExtractor||function(item,index){return index;};renderItem=renderItem||defaultRender;return _jsxs(AbsView,Object.assign({},props,{children:[_jsx(ListHeaderComponent,{}),!(data!=null&&data.length)&&_jsx(ListEmptyComponent,{}),data==null?void 0:data.map==null?void 0:data.map(function(item,index){return _jsx(React.Fragment,{children:renderItem({item:item,index:index})},keyExtractor(item,index));}),_jsx(ListFooterComponent,{})]}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["height","width"],_excluded2=["style","ListEmptyComponent","Empty","renderEmpty","ListFooterComponent","Footer","renderFooter","ListHeaderComponent","Header","renderHeader"];var _this=this,_jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/FlatList.native.js";import{FlatList}from"react-native-web";import{jsx as _jsx}from"react/jsx-runtime";export var AbsFlatList=function AbsFlatList(_ref){var _ref$style=_ref.style,height=_ref$style.height,width=_ref$style.width,style=_objectWithoutProperties(_ref$style,_excluded),ListEmptyComponent=_ref.ListEmptyComponent,Empty=_ref.Empty,renderEmpty=_ref.renderEmpty,ListFooterComponent=_ref.ListFooterComponent,Footer=_ref.Footer,renderFooter=_ref.renderFooter,ListHeaderComponent=_ref.ListHeaderComponent,Header=_ref.Header,renderHeader=_ref.renderHeader,props=_objectWithoutProperties(_ref,_excluded2);ListEmptyComponent=ListEmptyComponent||Empty||defaultRender;ListFooterComponent=ListFooterComponent||Footer||renderFooter||defaultRender;ListHeaderComponent=ListHeaderComponent||Header||renderHeader||defaultRender;return _jsx(FlatList,Object.assign({height:height,width:width},props,{ListEmptyComponent:ListEmptyComponent,ListFooterComponent:ListFooterComponent,ListHeaderComponent:ListHeaderComponent,contentContainerStyle:style}));};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AbsFlatList as NativeFlatList}from"./FlatList.native";export var AbsFlatList=NativeFlatList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["colors","style"];var _this=this,_jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/GradientView.js";import{AbsView}from"./View";import{jsx as _jsx}from"react/jsx-runtime";export var AbsGradientView=function AbsGradientView(_ref){var colors=_ref.colors,style=_ref.style,props=_objectWithoutProperties(_ref,_excluded);return _jsx(AbsView,Object.assign({},props,{style:Object.assign({},style)}));};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["angle","colors"];var _this=this,_jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/GradientView.native.js";import{AbsView}from"./View";import{jsx as _jsx}from"react/jsx-runtime";function angleToPoints(angle){var a=angle%360*(Math.PI/180);var x=Math.cos(a);var y=Math.sin(a);return{start:{x:0.5-x/2,y:0.5-y/2},end:{x:0.5+x/2,y:0.5+y/2}};}var AbsGradientView;try{var _ref=require('expo-linear-gradient')||{},LinearGradient=_ref.LinearGradient;AbsGradientView=function AbsGradientView(_ref2){var _ref2$angle=_ref2.angle,angle=_ref2$angle===void 0?45:_ref2$angle,colors=_ref2.colors,props=_objectWithoutProperties(_ref2,_excluded);var _angleToPoints=angleToPoints(angle),start=_angleToPoints.start,end=_angleToPoints.end;if(!(colors!=null&&colors.length))return _jsx(AbsView,Object.assign({},props));return _jsx(LinearGradient,Object.assign({start:start,end:end,colors:colors},props));};}catch(_unused){AbsGradientView=function AbsGradientView(props){console.warn('expo-linear-gradient not instaled.');return _jsx(AbsView,Object.assign({},props));};}export{AbsGradientView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/Icon.native.js";import{jsx as _jsx}from"react/jsx-runtime";var AbsIcon;try{var _require;var RmIcon=(_require=require('react-native-remix-icon'))==null?void 0:_require.default;
|
|
1
|
+
var _this=this,_jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/Icon.native.js";import{jsx as _jsx}from"react/jsx-runtime";var AbsIcon;try{var _require;var RmIcon=(_require=require('react-native-remix-icon'))==null?void 0:_require.default;AbsIcon=function AbsIcon(props){return _jsx(RmIcon,Object.assign({},props));};}catch(_unused){AbsIcon=function AbsIcon(){console.warn('react-native-remix-icon not instaled.');return false;};}export{AbsIcon};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/ImageBackground.js";var _excluded=["src","resizeMode","style"];import{jsx as _jsx}from"react/jsx-runtime";export function AbsImageBackground(_ref){var src=_ref.src,_ref$resizeMode=_ref.resizeMode,resizeMode=_ref$resizeMode===void 0?'cover':_ref$resizeMode,style=_ref.style,props=_objectWithoutProperties(_ref,_excluded);var objectFitMap={cover:'cover',contain:'contain',stretch:'fill',center:'none'};var objectFit=objectFitMap[resizeMode]||'cover';return _jsx("div",Object.assign({style:Object.assign({backgroundSize:objectFit,backgroundPosition:'center',backgroundImage:`url(${src})`},style)},props));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/ImageBackground.native.js";var _excluded=["src","source","resizeMode","style","children"];import{pick}from'ramda';import{ImageBackground as RNImageBackground}from"react-native-web";import{AbsView}from"./View";import{jsx as _jsx}from"react/jsx-runtime";var allBorderRadiusProps=['borderRadius','borderTopLeftRadius','borderTopRightRadius','borderBottomLeftRadius','borderBottomRightRadius','borderTopStartRadius','borderTopEndRadius','borderBottomStartRadius','borderBottomEndRadius'];export function AbsImageBackground(_ref){var src=_ref.src,source=_ref.source,_ref$resizeMode=_ref.resizeMode,resizeMode=_ref$resizeMode===void 0?'cover':_ref$resizeMode,style=_ref.style,children=_ref.children,props=_objectWithoutProperties(_ref,_excluded);if(!source&&!!src)source={uri:src};var imageStyle=pick(allBorderRadiusProps,style);return _jsx(RNImageBackground,Object.assign({source:source,resizeMode:resizeMode,style:style,imageStyle:imageStyle},props,{children:children}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/ImageBackground.web.js";var _excluded=["src","source","resizeMode"];import{ImageBackground as RNImageBackground}from"react-native-web";import{jsx as _jsx}from"react/jsx-runtime";export function AbsImageBackground(_ref){var src=_ref.src,source=_ref.source,_ref$resizeMode=_ref.resizeMode,resizeMode=_ref$resizeMode===void 0?'cover':_ref$resizeMode,props=_objectWithoutProperties(_ref,_excluded);if(!source&&!!src)source={uri:src};return _jsx(RNImageBackground,Object.assign({source:source,resizeMode:resizeMode},props));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/Pressable.js";var _excluded=["link","onPress","onClick"];import{jsx as _jsx}from"react/jsx-runtime";export function AbsPressable(_ref){var link=_ref.link,onPress=_ref.onPress,onClick=_ref.onClick,props=_objectWithoutProperties(_ref,_excluded);var Component=link?'a':'button';return _jsx(Component,Object.assign({onClick:onClick||onPress},props));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Pressable as RNPressable}from"react-native-web";export var AbsPressable=RNPressable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Pressable as RNPressable}from"react-native-web";export var AbsPressable=RNPressable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AbsView}from"./View";export var AbsScrollView=AbsView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["height","width"],_excluded2=["style"];var _this=this,_jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/ScrollView.native.js";import{ScrollView}from"react-native-web";import{jsx as _jsx}from"react/jsx-runtime";export var AbsScrollView=function AbsScrollView(_ref){var _ref$style=_ref.style,height=_ref$style.height,width=_ref$style.width,style=_objectWithoutProperties(_ref$style,_excluded),props=_objectWithoutProperties(_ref,_excluded2);return _jsx(ScrollView,Object.assign({height:height,width:width},props,{contentContainerStyle:style}));};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AbsScrollView as NativeAbsScrollView}from"./ScrollView.native";export var AbsScrollView=NativeAbsScrollView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/TextInput.js";import{jsx as _jsx}from"react/jsx-runtime";export function AbsTextInput(props)
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/abstractions/TextInput.js";var _excluded=["onChange"];import{jsx as _jsx}from"react/jsx-runtime";export function AbsTextInput(_ref){var _onChange=_ref.onChange,props=_objectWithoutProperties(_ref,_excluded);return _jsx("input",Object.assign({type:"text",onChange:function onChange(e){var _e$target;return _onChange==null?void 0:_onChange(e==null?void 0:(_e$target=e.target)==null?void 0:_e$target.value,e);}},props));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function set(key,value){return localStorage.setItem(key,value);}function setAsync(key,value){return Promise.resulve(set(key,value));}function get(key){return localStorage.getItem(key);}function getAsync(key){return Promise.resulve(get(key));}function remove(key){return localStorage.removeItem(key);}function removeAsync(key){return Promise.resulve(remove(key));}export var AbsStorage={set:set,setAsync:setAsync,get:get,getAsync:getAsync,remove:remove,removeAsync:removeAsync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var set=function set(){return console.warn('expo-sqlite not installed. Neko Storage needs expo-sqlite to work properly');};var setAsync=function setAsync(){return Promise.resolve(set());};var get=function get(){return console.warn('expo-sqlite not installed. Neko Storage needs expo-sqlite to work properly');};var getAsync=function getAsync(){return Promise.resolve(get());};var remove=function remove(){return console.warn('expo-sqlite not installed. Neko Storage needs expo-sqlite to work properly');};var removeAsync=function removeAsync(){return Promise.resolve(remove());};try{var StorageModule=require('expo-sqlite/kv-store');if(StorageModule!=null&&StorageModule.default){var Storage=StorageModule.default;set=Storage.setItemSync.bind(Storage);setAsync=Storage.setItem.bind(Storage);get=Storage.getItemSync.bind(Storage);getAsync=Storage.getItem.bind(Storage);remove=Storage.removeItemSync.bind(Storage);removeAsync=Storage.removeItem.bind(Storage);}}catch(e){console.log('expo-sqlite not available:',e);}export var AbsStorage={set:set,setAsync:setAsync,get:get,getAsync:getAsync,remove:remove,removeAsync:removeAsync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/Button.js";var _excluded=["label","icon","textProps","iconProps","gap","invert","size"];import{pipe}from'ramda';import{AbsTouchableOpacity}from"../../abstractions/TouchableOpacity";import{IconLabel}from"../presentation/IconLabel";import{useBackgroundModifier}from"../../modifiers/background";import{useBorderModifier}from"../../modifiers/border";import{useColorConverter}from"../../modifiers/colorConverter";import{useDefaultModifier}from"../../modifiers/default";import{useDisplayModifier}from"../../modifiers/display";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useFullColorModifier}from"../../modifiers/fullColor";import{useMarginModifier}from"../../modifiers/margin";import{usePaddingModifier}from"../../modifiers/padding";import{usePositionModifier}from"../../modifiers/position";import{useSizeConverter}from"../../modifiers/sizeConverter";import{useSizeModifier}from"../../modifiers/size";import{useStateModifier}from"../../modifiers/state";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_PROPS=function DEFAULT_PROPS(_ref){var _ref2=_slicedToArray(_ref,1),sizeCode=_ref2[0].sizeCode;return{paddingH:sizeCode,paddingV:2,height:sizeCode,br:sizeCode,border:1,center:true};};export function Button(rootProps){var _pipe=pipe(useColorConverter('primary'),useSizeConverter('elementHeights','md'),useThemeComponentModifier('Button'),useDefaultModifier(DEFAULT_PROPS),useFullColorModifier,useDisplayModifier,useStateModifier,useSizeModifier,usePositionModifier,usePaddingModifier,useMarginModifier,useFlexModifier,useFlexWrapperModifier,useBackgroundModifier,useBorderModifier)([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_pipe2$=_pipe2[0],loading=_pipe2$.loading,fontColor=_pipe2$.fontColor,sizeCode=_pipe2$.sizeCode,formattedProps=_pipe2[1];var label=formattedProps.label,icon=formattedProps.icon,textProps=formattedProps.textProps,iconProps=formattedProps.iconProps,gap=formattedProps.gap,invert=formattedProps.invert,size=formattedProps.size,props=_objectWithoutProperties(formattedProps,_excluded);return _jsx(AbsTouchableOpacity,Object.assign({className:"neko-button neko-wave-click-effect",type:"button"},props,{children:_jsx(IconLabel,{center:true,color:fontColor,size:sizeCode,label:label,icon:icon,gap:gap,invert:invert,textProps:Object.assign({strong:true},textProps),iconProps:iconProps,loading:loading})}));}
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/Button.js";var _excluded=["label","icon","textProps","iconProps","gap","invert","size"];import{pipe}from'ramda';import{AbsTouchableOpacity}from"../../abstractions/TouchableOpacity";import{IconLabel}from"../presentation/IconLabel";import{useBackgroundModifier}from"../../modifiers/background";import{useBorderModifier}from"../../modifiers/border";import{useColorConverter}from"../../modifiers/colorConverter";import{useCursorModifier}from"../../modifiers/cursor";import{useDefaultModifier}from"../../modifiers/default";import{useDisplayModifier}from"../../modifiers/display";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useFullColorModifier}from"../../modifiers/fullColor";import{useHoverConverter}from"../../modifiers/hover";import{useMarginModifier}from"../../modifiers/margin";import{usePaddingModifier}from"../../modifiers/padding";import{usePositionModifier}from"../../modifiers/position";import{useSizeConverter}from"../../modifiers/sizeConverter";import{useSizeModifier}from"../../modifiers/size";import{useStateModifier}from"../../modifiers/state";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_PROPS=function DEFAULT_PROPS(_ref){var _ref2=_slicedToArray(_ref,1),sizeCode=_ref2[0].sizeCode;return{paddingH:sizeCode,paddingV:2,height:sizeCode,br:sizeCode,border:1,center:true,pointer:true,hover:{opacity:0.7}};};export function Button(rootProps){var _pipe=pipe(useColorConverter('primary'),useSizeConverter('elementHeights','md'),useThemeComponentModifier('Button'),useDefaultModifier(DEFAULT_PROPS),useHoverConverter,useCursorModifier,useFullColorModifier,useDisplayModifier,useStateModifier,useSizeModifier,usePositionModifier,usePaddingModifier,useMarginModifier,useFlexModifier,useFlexWrapperModifier,useBackgroundModifier,useBorderModifier)([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_pipe2$=_pipe2[0],loading=_pipe2$.loading,fontColor=_pipe2$.fontColor,sizeCode=_pipe2$.sizeCode,formattedProps=_pipe2[1];var label=formattedProps.label,icon=formattedProps.icon,textProps=formattedProps.textProps,iconProps=formattedProps.iconProps,gap=formattedProps.gap,invert=formattedProps.invert,size=formattedProps.size,props=_objectWithoutProperties(formattedProps,_excluded);return _jsx(AbsTouchableOpacity,Object.assign({className:"neko-button neko-wave-click-effect",type:"button"},props,{children:_jsx(IconLabel,{center:true,color:fontColor,size:sizeCode,label:label,icon:icon,gap:gap,invert:invert,textProps:Object.assign({strong:true},textProps),iconProps:iconProps,loading:loading})}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/Dropdown.js";var _excluded=["items"],_excluded2=["onChange","label","trigger","icon","strong","color","popoverProps","iconLabelProps","children"];import{pipe}from'ramda';import{IconLabel}from"../presentation/IconLabel";import{Link}from"./Link";import{Menu}from"./menu/Menu";import{Popover}from"../structure/popover/Popover";import{View}from"../structure/View";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";export function Dropdown(_ref){var _this=this;var items=_ref.items,rootProps=_objectWithoutProperties(_ref,_excluded);var _pipe=pipe(useThemeComponentModifier('Dropdown'))([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_=_pipe2[0],formattedProps=_pipe2[1];var onChange=formattedProps.onChange,label=formattedProps.label,_formattedProps$trigg=formattedProps.trigger,trigger=_formattedProps$trigg===void 0?'click':_formattedProps$trigg,icon=formattedProps.icon,strong=formattedProps.strong,color=formattedProps.color,popoverProps=formattedProps.popoverProps,iconLabelProps=formattedProps.iconLabelProps,children=formattedProps.children,props=_objectWithoutProperties(formattedProps,_excluded2);return _jsx(View,Object.assign({className:"neko-dropdown"},props,{children:_jsx(Popover,Object.assign({useParentMinWidth:true,placement:
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/Dropdown.js";var _excluded=["items"],_excluded2=["onChange","label","trigger","icon","strong","color","popoverProps","iconLabelProps","children","placement","gap"];import{pipe}from'ramda';import{IconLabel}from"../presentation/IconLabel";import{Link}from"./Link";import{Menu}from"./menu/Menu";import{Popover}from"../structure/popover/Popover";import{View}from"../structure/View";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";export function Dropdown(_ref){var _this=this;var items=_ref.items,rootProps=_objectWithoutProperties(_ref,_excluded);var _pipe=pipe(useThemeComponentModifier('Dropdown'))([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_=_pipe2[0],formattedProps=_pipe2[1];var onChange=formattedProps.onChange,label=formattedProps.label,_formattedProps$trigg=formattedProps.trigger,trigger=_formattedProps$trigg===void 0?'click':_formattedProps$trigg,icon=formattedProps.icon,strong=formattedProps.strong,color=formattedProps.color,popoverProps=formattedProps.popoverProps,iconLabelProps=formattedProps.iconLabelProps,children=formattedProps.children,placement=formattedProps.placement,gap=formattedProps.gap,props=_objectWithoutProperties(formattedProps,_excluded2);return _jsx(View,Object.assign({className:"neko-dropdown"},props,{children:_jsx(Popover,Object.assign({useParentMinWidth:true,placement:placement||'bottomLeft',trigger:trigger,padding:"xs",useBottomDrawer:{native:true,sm:true,md:true},bottomDrawerProps:{bg:'mainBG',contentProps:{bg:'overlayBG',br:'lg',margin:'md'}}},popoverProps,{renderContent:function renderContent(_ref2){var onClose=_ref2.onClose;var handleChange=function handleChange(){if(onChange)onChange.apply(void 0,arguments);onClose();};return _jsx(Menu,{vertical:true,items:items,onChange:handleChange,_linkPaddingV:"lg",_linkProps:{borderB:true,padding:'lg',borderL:0,brColor:'divider'}});},children:children||_jsx(Link,{children:_jsx(IconLabel,Object.assign({label:label||'---',icon:icon||'arrow-down-s-fill',strong:strong,color:color,invert:true,gap:gap},iconLabelProps))})}))}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/Link.js";var _excluded=["label","children","href","target"];import{pipe,is}from'ramda';import{AbsTouchableOpacity}from"../../abstractions/TouchableOpacity";import{LoadingView}from"../state/LoadingView";import{Text}from"../text/Text";import{useAnimationModifier}from"../../modifiers/animation";import{useBackgroundModifier}from"../../modifiers/background";import{useBorderModifier}from"../../modifiers/border";import{useColorConverter}from"../../modifiers/colorConverter";import{useDisplayModifier}from"../../modifiers/display";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useMarginModifier}from"../../modifiers/margin";import{usePaddingModifier}from"../../modifiers/padding";import{usePositionModifier}from"../../modifiers/position";import{useSizeModifier}from"../../modifiers/size";import{useStateModifier}from"../../modifiers/state";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";export function Link(_ref){var label=_ref.label,children=_ref.children,href=_ref.href,target=_ref.target,rootProps=_objectWithoutProperties(_ref,_excluded);var _pipe=pipe(
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/Link.js";var _excluded=["label","children","href","target"];import{pipe,is}from'ramda';import{AbsTouchableOpacity}from"../../abstractions/TouchableOpacity";import{LoadingView}from"../state/LoadingView";import{Text}from"../text/Text";import{useAnimationModifier}from"../../modifiers/animation";import{useBackgroundModifier}from"../../modifiers/background";import{useBorderModifier}from"../../modifiers/border";import{useColorConverter}from"../../modifiers/colorConverter";import{useCursorModifier}from"../../modifiers/cursor";import{useDefaultModifier}from"../../modifiers/default";import{useDisplayModifier}from"../../modifiers/display";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useHoverConverter}from"../../modifiers/hover";import{useMarginModifier}from"../../modifiers/margin";import{usePaddingModifier}from"../../modifiers/padding";import{usePositionModifier}from"../../modifiers/position";import{useSizeModifier}from"../../modifiers/size";import{useStateModifier}from"../../modifiers/state";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_PROPS={pointer:true,hover:{br:'md',bg:'text4_op10'}};export function Link(_ref){var label=_ref.label,children=_ref.children,href=_ref.href,target=_ref.target,rootProps=_objectWithoutProperties(_ref,_excluded);var _pipe=pipe(useDefaultModifier(DEFAULT_PROPS),useHoverConverter,useBackgroundModifier,useColorConverter('primary'),useThemeComponentModifier('Link'),useCursorModifier,useAnimationModifier,useSizeModifier,useFlexWrapperModifier,useDisplayModifier,useStateModifier,useBorderModifier,usePositionModifier,usePaddingModifier,useMarginModifier,useFlexModifier)([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_pipe2$=_pipe2[0],isHover=_pipe2$.isHover,loading=_pipe2$.loading,color=_pipe2$.color,props=_pipe2[1];if(!!label||is(String,children)){children=_jsx(Text,Object.assign({color:color},props,{children:label||children}));}return _jsx(LoadingView,{active:loading,noWrapper:true,replaceChildren:true,children:_jsx(AbsTouchableOpacity,Object.assign({className:"neko-link",link:true,target:target,href:!props.disabled&&href},props,{children:children}))});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectDestructuringEmpty from"@babel/runtime/helpers/objectDestructuringEmpty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/Pressable.js";var _excluded=["children","href","target"];import{pipe}from'ramda';import{AbsPressable}from"../../abstractions/Pressable";import{useAnimationModifier}from"../../modifiers/animation";import{useBackgroundModifier}from"../../modifiers/background";import{useBorderModifier}from"../../modifiers/border";import{useDisplayModifier}from"../../modifiers/display";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useMarginModifier}from"../../modifiers/margin";import{usePaddingModifier}from"../../modifiers/padding";import{usePositionModifier}from"../../modifiers/position";import{useSizeModifier}from"../../modifiers/size";import{useStateModifier}from"../../modifiers/state";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";export function Pressable(_ref){var children=_ref.children,href=_ref.href,target=_ref.target,rootProps=_objectWithoutProperties(_ref,_excluded);var _pipe=pipe(useThemeComponentModifier('Pressable'),useBackgroundModifier,useAnimationModifier,useSizeModifier,useFlexWrapperModifier,useDisplayModifier,useStateModifier,useBorderModifier,usePositionModifier,usePaddingModifier,useMarginModifier,useFlexModifier)([{},rootProps]),_pipe2=_slicedToArray(_pipe,2);_objectDestructuringEmpty(_pipe2[0]);var props=_pipe2[1];return _jsx(AbsPressable,Object.assign({className:"neko-pressable",link:true,target:target,href:!props.disabled&&href},props,{children:children}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./Button";export*from"./Link";export*from"./Dropdown";export*from"./Breadcrumb";export*from"./menu/Menu";
|
|
1
|
+
export*from"./Button";export*from"./Link";export*from"./Pressable";export*from"./Dropdown";export*from"./Breadcrumb";export*from"./menu/Menu";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/menu/HorizontalMenu.js";var _excluded=["item","linkPaddingH","handlePress","linkProps","activeIndex","activeKey","activeColor","color","sizeCode","index"],_excluded2=["active","key"],_excluded3=["gap","height","items","onChange","onChangeIndex"];import{omit,pipe}from'ramda';import React from'react';import{IconText}from"../../presentation/IconLabel";import{Link}from"../Link";import{SubmenuWrapper}from"./SubmenuWrapper";import{View}from"../../structure/View";import{useColorConverter}from"../../../modifiers/colorConverter";import{useSizeConverter}from"../../../modifiers/sizeConverter";import{useThemeComponentModifier}from"../../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";function Item(_ref){var item=_ref.item,_ref$linkPaddingH=_ref.linkPaddingH,linkPaddingH=_ref$linkPaddingH===void 0?'md':_ref$linkPaddingH,handlePress=_ref.handlePress,linkProps=_ref.linkProps,activeIndex=_ref.activeIndex,activeKey=_ref.activeKey,_ref$activeColor=_ref.activeColor,activeColor=_ref$activeColor===void 0?'primary':_ref$activeColor,color=_ref.color,sizeCode=_ref.sizeCode,index=_ref.index,props=_objectWithoutProperties(_ref,_excluded);activeColor=activeColor||'primary';var _omit=omit(['onClick','onPress'],item),active=_omit.active,key=_omit.key,childProps=_objectWithoutProperties(_omit,_excluded2);if(!active&&activeIndex>=0)active=activeIndex===index;if(!active&&activeKey!==undefined)active=activeKey===item.key;return _jsx(SubmenuWrapper,{item:item,onChange:handlePress,activeKey:activeKey,color:color,placement:"bottomRight",hideIcon:true,children:_jsx(Link,Object.assign({fullH:true,center:true,paddingH:linkPaddingH},linkProps,{onPress:function onPress(){return handlePress(item,index);},children:_jsx(IconText,Object.assign({color:active?activeColor:color,fullH:true,marginT:3,borderB:3,borderColor:active?activeColor:'transparent',transition:"border-color 0.6s ease",size:sizeCode},childProps))}),key||index)});}export function HorizontalMenu(rootProps){var _this=this;var _pipe=pipe(useColorConverter(),useSizeConverter('icons','md'),useThemeComponentModifier('HorizontalMenu'))([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_pipe2$=_pipe2[0],sizeCode=_pipe2$.sizeCode,color=_pipe2$.color,formattedProps=_pipe2[1];var _formattedProps$gap=formattedProps.gap,gap=_formattedProps$gap===void 0?'sm':_formattedProps$gap,_formattedProps$heigh=formattedProps.height,height=_formattedProps$heigh===void 0?50:_formattedProps$heigh,items=formattedProps.items,onChange=formattedProps.onChange,onChangeIndex=formattedProps.onChangeIndex,props=_objectWithoutProperties(formattedProps,_excluded3);var handlePress=React.useCallback(function(item,index){if(!!onChange)onChange(item,index);if(!!onChangeIndex)onChangeIndex(index);if(!!item.onPress)item.onPress();if(!!item.onClick)item.onClick();},[onChange,onChangeIndex]);return _jsx(View,Object.assign({className:"neko-horizontal-menu",row:true,gap:gap,height:height,centerV:true},props,{children:items.map(function(item,index){return _jsx(Item,Object.assign({item:item,handlePress:handlePress,color:color,sizeCode:sizeCode,index:index},props),item.key||index);})}));}
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/menu/HorizontalMenu.js";var _excluded=["item","linkPaddingH","handlePress","linkProps","activeIndex","activeKey","activeColor","color","sizeCode","index"],_excluded2=["active","key"],_excluded3=["gap","height","items","onChange","onChangeIndex","activeIndex"];import{omit,pipe}from'ramda';import React from'react';import{IconText}from"../../presentation/IconLabel";import{Link}from"../Link";import{SubmenuWrapper}from"./SubmenuWrapper";import{View}from"../../structure/View";import{useColorConverter}from"../../../modifiers/colorConverter";import{useSizeConverter}from"../../../modifiers/sizeConverter";import{useThemeComponentModifier}from"../../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";function Item(_ref){var item=_ref.item,_ref$linkPaddingH=_ref.linkPaddingH,linkPaddingH=_ref$linkPaddingH===void 0?'md':_ref$linkPaddingH,handlePress=_ref.handlePress,linkProps=_ref.linkProps,activeIndex=_ref.activeIndex,activeKey=_ref.activeKey,_ref$activeColor=_ref.activeColor,activeColor=_ref$activeColor===void 0?'primary':_ref$activeColor,color=_ref.color,sizeCode=_ref.sizeCode,index=_ref.index,props=_objectWithoutProperties(_ref,_excluded);activeColor=activeColor||'primary';var _omit=omit(['onClick','onPress'],item),active=_omit.active,key=_omit.key,childProps=_objectWithoutProperties(_omit,_excluded2);if(!active&&activeIndex>=0)active=activeIndex===index;if(!active&&activeKey!==undefined)active=activeKey===item.key;return _jsx(SubmenuWrapper,{item:item,onChange:handlePress,activeKey:activeKey,color:color,placement:"bottomRight",hideIcon:true,children:_jsx(Link,Object.assign({fullH:true,center:true,paddingH:linkPaddingH},linkProps,{onPress:function onPress(){return handlePress(item,index);},children:_jsx(IconText,Object.assign({color:active?activeColor:color,fullH:true,marginT:3,borderB:3,borderColor:active?activeColor:'transparent',transition:"border-color 0.6s ease",size:sizeCode},childProps))}),key||index)});}export function HorizontalMenu(rootProps){var _this=this;var _pipe=pipe(useColorConverter(),useSizeConverter('icons','md'),useThemeComponentModifier('HorizontalMenu'))([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_pipe2$=_pipe2[0],sizeCode=_pipe2$.sizeCode,color=_pipe2$.color,formattedProps=_pipe2[1];var _formattedProps$gap=formattedProps.gap,gap=_formattedProps$gap===void 0?'sm':_formattedProps$gap,_formattedProps$heigh=formattedProps.height,height=_formattedProps$heigh===void 0?50:_formattedProps$heigh,items=formattedProps.items,onChange=formattedProps.onChange,onChangeIndex=formattedProps.onChangeIndex,activeIndex=formattedProps.activeIndex,props=_objectWithoutProperties(formattedProps,_excluded3);var handlePress=React.useCallback(function(item,index){if(!!onChange)onChange(item,index);if(!!onChangeIndex)onChangeIndex(index);if(!!item.onPress)item.onPress();if(!!item.onClick)item.onClick();},[onChange,onChangeIndex]);return _jsx(View,Object.assign({className:"neko-horizontal-menu",row:true,gap:gap,height:height,centerV:true},props,{children:items.map(function(item,index){return _jsx(Item,Object.assign({item:item,handlePress:handlePress,color:color,sizeCode:sizeCode,index:index,activeIndex:activeIndex},props),item.key||index);})}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/menu/VerticalMenu.js";var _excluded=["item","linkPaddingH","linkPaddingV","handlePress","linkProps","activeIndex","activeKey","activeColor","color","sizeCode","index"],_excluded2=["active","key"],_excluded3=["item"],_excluded4=["gap","items","onChange","onChangeIndex"];import{omit,pipe}from'ramda';import React from'react';import tinycolor from'tinycolor2';import{Divider}from"../../helpers/Separator";import{IconText}from"../../presentation/IconLabel";import{Link}from"../Link";import{SubmenuWrapper}from"./SubmenuWrapper";import{Text}from"../../text/Text";import{View}from"../../structure/View";import{useColorConverter}from"../../../modifiers/colorConverter";import{useSizeConverter}from"../../../modifiers/sizeConverter";import{useThemeComponentModifier}from"../../../modifiers/themeComponent";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";function LinkItem(_ref){var item=_ref.item,_ref$linkPaddingH=_ref.linkPaddingH,linkPaddingH=_ref$linkPaddingH===void 0?'md':_ref$linkPaddingH,_ref$linkPaddingV=_ref.linkPaddingV,linkPaddingV=_ref$linkPaddingV===void 0?'
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/actions/menu/VerticalMenu.js";var _excluded=["item","linkPaddingH","linkPaddingV","handlePress","linkProps","activeIndex","activeKey","activeColor","color","sizeCode","index"],_excluded2=["active","key"],_excluded3=["item"],_excluded4=["gap","items","onChange","onChangeIndex"];import{omit,pipe}from'ramda';import React from'react';import tinycolor from'tinycolor2';import{Divider}from"../../helpers/Separator";import{IconText}from"../../presentation/IconLabel";import{Link}from"../Link";import{SubmenuWrapper}from"./SubmenuWrapper";import{Text}from"../../text/Text";import{View}from"../../structure/View";import{useColorConverter}from"../../../modifiers/colorConverter";import{useSizeConverter}from"../../../modifiers/sizeConverter";import{useThemeComponentModifier}from"../../../modifiers/themeComponent";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";function LinkItem(_ref){var item=_ref.item,_ref$linkPaddingH=_ref.linkPaddingH,linkPaddingH=_ref$linkPaddingH===void 0?'md':_ref$linkPaddingH,_ref$linkPaddingV=_ref.linkPaddingV,linkPaddingV=_ref$linkPaddingV===void 0?'sm':_ref$linkPaddingV,handlePress=_ref.handlePress,linkProps=_ref.linkProps,activeIndex=_ref.activeIndex,activeKey=_ref.activeKey,_ref$activeColor=_ref.activeColor,activeColor=_ref$activeColor===void 0?'primary':_ref$activeColor,color=_ref.color,sizeCode=_ref.sizeCode,index=_ref.index,props=_objectWithoutProperties(_ref,_excluded);activeColor=activeColor||'primary';var _omit=omit(['onClick','onPress'],item),active=_omit.active,key=_omit.key,childProps=_objectWithoutProperties(_omit,_excluded2);if(!active&&activeIndex>=0)active=activeIndex===index;if(!active&&activeKey!==undefined)active=activeKey===item.key;var bg=active&&tinycolor(color).setAlpha(0.03).toString();return _jsx(SubmenuWrapper,{item:item,onChange:handlePress,activeKey:activeKey,color:color,children:_jsx(Link,Object.assign({fullW:true,center:true,paddingH:linkPaddingH,paddingV:linkPaddingV,marginR:3,borderL:3,marginV:-4,brColor:active?activeColor:'transparent',bg:bg,transition:"border-color 0.5s ease, background 0.3s ease",hover:{br:0}},linkProps,{onPress:function onPress(){return handlePress(item,index);},children:_jsx(IconText,Object.assign({addingV:active&&4,color:active?activeColor:color,fullW:true,size:sizeCode},childProps))}))});}function DividerItem(_ref2){var _ref2$linkPaddingH=_ref2.linkPaddingH,linkPaddingH=_ref2$linkPaddingH===void 0?'md':_ref2$linkPaddingH,item=_ref2.item;var content=_jsx(Divider,Object.assign({height:"xxs",line:true},item));if(!item.label)return content;return _jsxs(_Fragment,{children:[content,_jsx(Text,Object.assign({size:"xs",color:"text4",paddingH:linkPaddingH||'md',strong:true},item))]});}function Item(_ref3){var item=_ref3.item,props=_objectWithoutProperties(_ref3,_excluded3);if(item.type==='divider')return _jsx(DividerItem,Object.assign({item:item},props));return _jsx(LinkItem,Object.assign({item:item},props));}export function VerticalMenu(rootProps){var _this=this;var _pipe=pipe(useColorConverter('text'),useSizeConverter('icons','md'),useThemeComponentModifier('VerticalMenu'))([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_pipe2$=_pipe2[0],sizeCode=_pipe2$.sizeCode,color=_pipe2$.color,formattedProps=_pipe2[1];var _formattedProps$gap=formattedProps.gap,gap=_formattedProps$gap===void 0?'sm':_formattedProps$gap,items=formattedProps.items,onChange=formattedProps.onChange,onChangeIndex=formattedProps.onChangeIndex,props=_objectWithoutProperties(formattedProps,_excluded4);var handlePress=React.useCallback(function(item,index){if(!!onChange)onChange(item,index);if(!!onChangeIndex)onChangeIndex(index);if(!!item.onPress)item.onPress();if(!!item.onClick)item.onClick();},[onChange,onChangeIndex]);return _jsx(View,Object.assign({className:"neko-vertical-menu",gap:gap,width:"100%"},props,{children:items.map(function(item,index){return _jsx(Item,Object.assign({item:item,handlePress:handlePress,color:color,sizeCode:sizeCode,index:index},props),item.key||index);})}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectDestructuringEmpty from"@babel/runtime/helpers/objectDestructuringEmpty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/animations/ReanimatedView.js";var _excluded=["children"];import{pipe}from'ramda';import{AbsAnimatedView}from"../../abstractions/AnimatedView";import{useBackgroundModifier}from"../../modifiers/background";import{useBorderModifier}from"../../modifiers/border";import{useDisplayModifier}from"../../modifiers/display";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useMarginModifier}from"../../modifiers/margin";import{useOverflowModifier}from"../../modifiers/overflow";import{usePaddingModifier}from"../../modifiers/padding";import{usePositionModifier}from"../../modifiers/position";import{useShadowModifier}from"../../modifiers/shadow";import{useSizeModifier}from"../../modifiers/size";import{useStateModifier}from"../../modifiers/state";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";export function ReanimatedView(_ref){var children=_ref.children,rootProps=_objectWithoutProperties(_ref,_excluded);var _pipe=pipe(useThemeComponentModifier('ReanimatedView'),useFlexWrapperModifier,useDisplayModifier,useStateModifier,useSizeModifier,usePositionModifier,useOverflowModifier,usePaddingModifier,useMarginModifier,useFlexModifier,useBackgroundModifier,useBorderModifier,useShadowModifier)([{},rootProps]),_pipe2=_slicedToArray(_pipe,2);_objectDestructuringEmpty(_pipe2[0]);var props=_pipe2[1];return _jsx(AbsAnimatedView,Object.assign({className:"neko-reanimated-view"},props,{children:children}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/calendar/CalendarNav.js";var _excluded=["value","onChange","level"];import{Icon}from"../presentation/Icon";import{Link}from"../actions/Link";import{Text}from"../text/Text";import{View}from"../structure/View";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function CalendarNav(_ref){var value=_ref.value,onChange=_ref.onChange,level=_ref.level,props=_objectWithoutProperties(_ref,_excluded);var prevMonth=function prevMonth(){return onChange(function(m){return m.subtract(1,'month');});};var nextMonth=function nextMonth(){return onChange(function(m){return m.add(1,'month');});};var prevYear=function prevYear(){return onChange(function(m){return m.subtract(1,'year');});};var nextYear=function nextYear(){return onChange(function(m){return m.add(1,'year');});};var prevDecade=function prevDecade(){return onChange(function(m){return m.subtract(10,'year');});};var nextDecade=function nextDecade(){return onChange(function(m){return m.add(10,'year');});};var showMonth=level!=='year';if(level==='decade'){var year=value.year();return _jsxs(View,Object.assign({className:"neko-calendar-nav",row:true,centerV:true,gap:"xxs",height:30},props,{children:[_jsx(Link,{onPress:prevDecade,"aria-label":"Previous decade",padding:"xxs",paddingL:0,children:_jsx(Icon,{name:"arrow-left-double-line"})}),_jsxs(Text,{center:true,flex:true,children:[year,"-",year+9]}),_jsx(Link,{onPress:nextDecade,"aria-label":"Next decade",padding:"xxs",paddingR:0,children:_jsx(Icon,{name:"arrow-right-double-line"})})]}));}return _jsxs(View,Object.assign({className:"neko-calendar-nav",row:true,centerV:true,gap:"xxs",height:30},props,{children:[_jsx(Link,{onPress:prevYear,"aria-label":"Previous year",padding:"xxs",paddingL:0,children:_jsx(Icon,{name:"arrow-left-double-line"})}),showMonth&&_jsx(Link,{onPress:prevMonth,"aria-label":"Previous month",padding:"xxs",children:_jsx(Icon,{name:"arrow-left-s-line"})}),_jsxs(View,{center:true,flex:true,gap:"xxs",row:true,children:[showMonth&&_jsx(Text,{center:true,children:value.format==null?void 0:value.format('MMM')}),_jsx(Text,{center:true,children:value.format==null?void 0:value.format('YYYY')})]}),showMonth&&_jsx(Link,{onPress:nextMonth,"aria-label":"Next month",padding:"xxs",children:_jsx(Icon,{name:"arrow-right-s-line"})}),_jsx(Link,{onPress:nextYear,"aria-label":"Next year",padding:"xxs",paddingR:0,children:_jsx(Icon,{name:"arrow-right-double-line"})})]}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/calendar/WeekDaysBar.js";import{Text}from"../text/Text";import{View}from"../structure/View";import{jsx as _jsx}from"react/jsx-runtime";var weekdayLabels=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];export function WeekDaysBar(){var _this=this;return _jsx(View,{className:"neko-week-days-bar",row:true,center:true,gap:"sm",children:weekdayLabels.map(function(w){return _jsx(View,{flex:true,height:30,center:true,children:_jsx(Text,{center:true,sm:true,text4:true,children:w})},w);})});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from'react';export function useCalendarDays(currentMonth){return React.useMemo(function(){var startWeekday=currentMonth.startOf('month').day();var daysInMonth=currentMonth.daysInMonth();var blanks=Array.from({length:startWeekday},function(){return null;});var days=Array.from({length:daysInMonth},function(_,i){return i+1;});var cells=[].concat(blanks,days);
|
|
1
|
+
import React from'react';export function useCalendarDays(currentMonth){return React.useMemo(function(){var startWeekday=currentMonth.startOf('month').day();var daysInMonth=currentMonth.daysInMonth();var blanks=Array.from({length:startWeekday},function(){return null;});var days=Array.from({length:daysInMonth},function(_,i){return i+1;});var cells=[].concat(blanks,days);return{cells:cells};},[currentMonth.month(),currentMonth.year()]);}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{is}from'ramda';import dayjs from'dayjs';export function isDateDisabled(date){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},min=_ref.min,max=_ref.max,onCheckDisabled=_ref.onCheckDisabled;var dateVal=!!date&&dayjs(date);if(!dateVal||!dateVal.isValid())return true;if(!!min&&dateVal.isBefore(min))return true;if(!!max&&dateVal.isAfter(max))return true;return(onCheckDisabled==null?void 0:onCheckDisabled(dateVal))||false;}export function isValidDate(v,format){var validations=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(v===null||v==='')return true;var dateVal=dayjs(v);if(is(String,v)){if(v.length!==format.length)return false;dateVal=dayjs(v,format,true);if(!dateVal.isValid())return false;}return!isDateDisabled(v,validations);}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./DayPicker";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/alerter.js";var _excluded=["width","closeLabel","hideClose"];import{is}from'ramda';import{Button}from"../actions";import{Result}from"../presentation";import{useModalOpener}from"../structure/modal";import{jsx as _jsx}from"react/jsx-runtime";export function useAlerter(){var _this=this;var _useModalOpener=useModalOpener(),open=_useModalOpener.open;var alert=function alert(data,type){if(is(String,data))data={title:data};var _ref=data||{},width=_ref.width,closeLabel=_ref.closeLabel,hideClose=_ref.hideClose,resultProps=_objectWithoutProperties(_ref,_excluded);open(function(_ref2){var onClose=_ref2.onClose;return{content:_jsx(Result,Object.assign({},resultProps,{type:type,padding:0,paddingT:"lg",paddingB:"sm"})),footer:!hideClose&&_jsx(Button,{sm:true,label:closeLabel||'Close',outline:true,color:"text_op40",onPress:onClose,fullW:true}),footerProps:{borderT:false},width:width||350};});};return{alert:alert,info:function info(data){return alert(data,'info');},error:function error(data){return alert(data,'error');},warning:function warning(data){return alert(data,'warning');},success:function success(data){return alert(data,'success');}};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["width","cancelLabel","confirmLabel","onConfirm"];var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/confirmer.js";import{is}from'ramda';import React from'react';import{Button}from"../actions";import{RESULT_TYPES}from"../presentation/Result";import{Result}from"../presentation";import{View}from"../structure/View";import{useModalOpener}from"../structure/modal";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function Footer(_ref){var _RESULT_TYPES$type;var cancelLabel=_ref.cancelLabel,confirmLabel=_ref.confirmLabel,onConfirm=_ref.onConfirm,type=_ref.type,onClose=_ref.onClose;var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),loading=_React$useState2[0],setLoading=_React$useState2[1];var color=((_RESULT_TYPES$type=RESULT_TYPES[type])==null?void 0:_RESULT_TYPES$type.color)||'primary';return _jsxs(View,{row:true,gap:"sm",centerV:true,children:[_jsx(Button,{sm:true,label:cancelLabel||'Cancel',outline:true,color:"text_op40",onPress:onClose,flex:true,disabled:loading}),_jsx(Button,{disabled:loading,loading:loading,sm:true,label:confirmLabel||'Confirm',color:color,onPress:function onPress(){setLoading(true);Promise.resolve(onConfirm==null?void 0:onConfirm()).then(function(result){if(result!==false){onClose();}}).finally(function(){setLoading(false);});},flex:true})]});}export function useConfirmer(){var _this=this;var _useModalOpener=useModalOpener(),open=_useModalOpener.open;var confirm=function confirm(data,type){var _ref2=data||{},width=_ref2.width,cancelLabel=_ref2.cancelLabel,confirmLabel=_ref2.confirmLabel,onConfirm=_ref2.onConfirm,resultProps=_objectWithoutProperties(_ref2,_excluded);open(function(_ref3){var onClose=_ref3.onClose;return{content:_jsx(Result,Object.assign({},resultProps,{type:type,padding:0,paddingT:"lg",paddingB:"sm"})),footer:_jsx(Footer,{cancelLabel:cancelLabel,confirmLabel:confirmLabel,onConfirm:onConfirm,type:type,onClose:onClose}),footerProps:{borderT:false},width:width||350};});};return{confirm:confirm,info:function info(data){return confirm(data,'info');},error:function error(data){return confirm(data,'error');},warning:function warning(data){return confirm(data,'warning');},success:function success(data){return confirm(data,'success');}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./notifications/NotificationsHandler";
|
|
1
|
+
export*from"./notifications/NotificationsHandler";export*from"./alerter";export*from"./confirmer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/notifications/Notification.js";var _excluded=["time"];import React from'react';import{AnimatedView}from"../../animations/AnimatedView";import{Icon}from"../../presentation/Icon";import{Link}from"../../actions/Link";import{ResultBar}from"../../presentation/ResultBar";import{jsx as _jsx}from"react/jsx-runtime";export function Notification(_ref){var time=_ref.time,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(true),_React$useState2=_slicedToArray(_React$useState,2),open=_React$useState2[0],setOpen=_React$useState2[1];React.useEffect(function(){setTimeout(function(){return setOpen(false);},time-500);},[]);return _jsx(AnimatedView,{open:open,className:"neko-notification",slide:{from:'right'},fade:true,zIndex:
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/notifications/Notification.js";var _excluded=["time"];import React from'react';import{AnimatedView}from"../../animations/AnimatedView";import{Icon}from"../../presentation/Icon";import{Link}from"../../actions/Link";import{ResultBar}from"../../presentation/ResultBar";import{jsx as _jsx}from"react/jsx-runtime";export function Notification(_ref){var time=_ref.time,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(true),_React$useState2=_slicedToArray(_React$useState,2),open=_React$useState2[0],setOpen=_React$useState2[1];React.useEffect(function(){setTimeout(function(){return setOpen(false);},time-500);},[]);return _jsx(AnimatedView,{open:open,className:"neko-notification",slide:{from:'right'},fade:true,zIndex:520,maxWidth:"100%",bg:"overlayBG",br:"sm",unmountOnClose:true,children:_jsx(ResultBar,Object.assign({},props,{rightContent:_jsx(Link,{onPress:function onPress(){return setOpen(false);},children:_jsx(Icon,{name:"close-line",text4:true})})}))});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["key"];var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/notifications/NotificationsHandler.js";import{is}from'ramda';import React from'react';import{Notification}from"./Notification";import{SafeAreaView}from"../../structure/SafeAreaView";import{View}from"../../structure/View";import{useResponsiveValue}from"../../../responsive/responsiveHooks";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var NotificationsContext=React.createContext(null);export var useNotifications=function useNotifications(){return React.useContext(NotificationsContext)||{};};var idCounter=0;export function useNotifier(){var _useNotifications=useNotifications(),add=_useNotifications.add,remove=_useNotifications.remove;var notify=function notify(data,opts,type){var key=++idCounter;var time=(opts==null?void 0:opts.time)||6000;if(is(String,data))data={title:data};var timerId=setTimeout(function(){return remove(key);},time);add(key,Object.assign({},data,{type:type,opts:opts,timerId:timerId,time:time}));};return{notify:notify,info:function info(data,opts){return notify(data,opts,'info');},error:function error(data,opts){return notify(data,opts,'error');},warning:function warning(data,opts){return notify(data,opts,'warning');},success:function success(data,opts){return notify(data,opts,'success');}};}export function NotificationsHandler(_ref){var _this=this;var children=_ref.children;var width=useResponsiveValue({sm:'100%',df:400});var _React$useState=React.useState([]),_React$useState2=_slicedToArray(_React$useState,2),messages=_React$useState2[0],setMessages=_React$useState2[1];var add=React.useCallback(function(key,data){setMessages(function(prev){return[Object.assign({key:key},data)].concat(_toConsumableArray(prev));});},[]);var remove=React.useCallback(function(key){setMessages(function(prev){return prev.filter(function(p){return p.key!==key;});});},[]);var value=React.useMemo(function(){return{add:add,remove:remove};},[add,remove]);return _jsxs(NotificationsContext.Provider,{value:value,children:[children,!!messages.length&&_jsx(View,{fixed:true,top:0,right:0,padding:"md",width:width,maxWidth:"100%",pointerEvents:"box-none",children:_jsx(SafeAreaView,{gap:"xs",children:messages.map(function(_ref2){var key=_ref2.key,item=_objectWithoutProperties(_ref2,_excluded);return _jsx(Notification,Object.assign({},item),key);})})})]});}
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["key"];var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/feedback/notifications/NotificationsHandler.js";import{is}from'ramda';import React from'react';import{Notification}from"./Notification";import{SafeAreaView}from"../../structure/SafeAreaView";import{View}from"../../structure/View";import{useResponsiveValue}from"../../../responsive/responsiveHooks";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var NotificationsContext=React.createContext(null);export var useNotifications=function useNotifications(){return React.useContext(NotificationsContext)||{};};var idCounter=0;export function useNotifier(){var _useNotifications=useNotifications(),add=_useNotifications.add,remove=_useNotifications.remove;var notify=function notify(data,opts,type){var key=++idCounter;var time=(opts==null?void 0:opts.time)||6000;if(is(String,data))data={title:data};var timerId=setTimeout(function(){return remove==null?void 0:remove(key);},time);add==null?void 0:add(key,Object.assign({},data,{type:type,opts:opts,timerId:timerId,time:time}));};return{notify:notify,info:function info(data,opts){return notify(data,opts,'info');},error:function error(data,opts){return notify(data,opts,'error');},warning:function warning(data,opts){return notify(data,opts,'warning');},success:function success(data,opts){return notify(data,opts,'success');}};}export function NotificationsHandler(_ref){var _this=this;var children=_ref.children;var width=useResponsiveValue({sm:'100%',df:400});var _React$useState=React.useState([]),_React$useState2=_slicedToArray(_React$useState,2),messages=_React$useState2[0],setMessages=_React$useState2[1];var add=React.useCallback(function(key,data){setMessages(function(prev){return[Object.assign({key:key},data)].concat(_toConsumableArray(prev));});},[]);var remove=React.useCallback(function(key){setMessages(function(prev){return prev.filter(function(p){return p.key!==key;});});},[]);var value=React.useMemo(function(){return{add:add,remove:remove};},[add,remove]);return _jsxs(NotificationsContext.Provider,{value:value,children:[children,!!messages.length&&_jsx(View,{fixed:true,top:0,right:0,padding:"md",width:width,maxWidth:"100%",pointerEvents:"box-none",zIndex:600,children:_jsx(SafeAreaView,{gap:"xs",children:messages.map(function(_ref2){var key=_ref2.key,item=_objectWithoutProperties(_ref2,_excluded);return _jsx(Notification,Object.assign({},item),key);})})})]});}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./actions";export*from"./animations";export*from"./form";export*from"./presentation";export*from"./structure";export*from"./text";export*from"./helpers";export*from"./inputs";export*from"./state";export*from"./layout";export*from"./table";export*from"./feedback";export*from"./calendar";
|
|
1
|
+
export*from"./actions";export*from"./animations";export*from"./form";export*from"./presentation";export*from"./structure";export*from"./text";export*from"./helpers";export*from"./inputs";export*from"./state";export*from"./layout";export*from"./table";export*from"./feedback";export*from"./calendar";export*from"./list";export*from"./theme";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/DateInput.js";var _excluded=["value","onChange","min","max","onCheckDisabled","placement","type","format","useBottomDrawer"];import React from'react';import advancedFormat from'dayjs/esm/plugin/advancedFormat';import dayjs from'dayjs';import weekOfYear from'dayjs/esm/plugin/weekOfYear';import{LinkInput}from"./LinkInput";import{View}from"../structure/View";import{useResponsiveValue}from"../../responsive";dayjs.extend(advancedFormat);dayjs.extend(weekOfYear);import{DatePicker}from"./datePicker/DatePicker";import{MaskInput}from"./MaskInput";import{Popover}from"../structure/popover/Popover";import{isValidDate}from"../calendar/_helpers/dateDisabled";import{jsx as _jsx}from"react/jsx-runtime";export function getDateInputDefaultFormat(type){switch(type){case'year':return'YYYY';case'quarter':return'YYYY-Q';case'month':return'YYYY-MM';case'week':return'YYYY-ww';default:return'YYYY-MM-DD';}}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,_ref$useBottomDrawer=_ref.useBottomDrawer,useBottomDrawer=_ref$useBottomDrawer===void 0?{native:true,sm:true,md:true}:_ref$useBottomDrawer,props=_objectWithoutProperties(_ref,_excluded);useBottomDrawer=useResponsiveValue(useBottomDrawer);format=format||getDateInputDefaultFormat(type);if(value==='')value=undefined;var _React$useState=React.useState(''),_React$useState2=_slicedToArray(_React$useState,2),inputValue=_React$useState2[0],setInputValue=_React$useState2[1];var _React$useState3=React.useState(value),_React$useState4=_slicedToArray(_React$useState3,2),localValue=_React$useState4[0],setLocalValue=_React$useState4[1];value=value||localValue;var validations={min:min,max:max,onCheckDisabled:onCheckDisabled};var handleChange=function handleChange(v){if(!isValidDate(v,format,validations))return;v=!!v?dayjs(v):null;setLocalValue(v);onChange==null?void 0:onChange(v);};var handleChangeInput=function handleChangeInput(v){setInputValue(v);if(!isValidDate(v,format,validations))return;handleChange(v);};var onBlur=function onBlur(){if(isValidDate(inputValue,format,validations))return;handleChange(null);setInputValue('');};React.useEffect(function(){setInputValue(!!value?dayjs(value).format(format):'');},[value]);var Input=useBottomDrawer?LinkInput:MaskInput;return _jsx(Popover,{trigger:"click",placement:placement||'bottomLeft',snapPoints:[350],useBottomDrawer:useBottomDrawer,renderContent:function renderContent(_ref2){var onClose=_ref2.onClose;return _jsx(View,{flex:true,centerH:true,children:_jsx(DatePicker,Object.assign({value:value,onChange:function onChange(v){handleChange(v);onClose();}},validations,{type:type}))});},children:_jsx(Input,Object.assign({value:inputValue,onChange:handleChangeInput,suffixIcon:"calendar-line",suffixIconColor:"text4",onBlur:onBlur,mask:format.replace(/[DMYQwW]/gi,'9')},props))});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/InputWrapper.js";var _excluded=["prefix","suffix","prefixIcon","suffixIcon","loading","error","children"];import{pipe,is}from'ramda';import React from'react';import{Icon}from"../presentation/Icon";import{Loading}from"../state/Loading";import{Text}from"../text/Text";import{View}from"../structure/View";import{useDefaultModifier}from"../../modifiers/default";import{useSizeConverter}from"../../modifiers/sizeConverter";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_PROPS={fullW:'100%',paddingH:'sm',bg:'overlayBG',border:true,br:'md',row:true,gap:'sm'};export function InputWrapper(_ref){var prefix=_ref.prefix,suffix=_ref.suffix,prefixIcon=_ref.prefixIcon,suffixIcon=_ref.suffixIcon,loading=_ref.loading,error=_ref.error,children=_ref.children,rootProps=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),hover=_React$useState2[0],setHover=_React$useState2[1];var
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/InputWrapper.js";var _excluded=["prefix","suffix","prefixIcon","prefixIconColor","suffixIcon","suffixIconColor","loading","error","children","ref"];import{pipe,is}from'ramda';import React from'react';import{Icon}from"../presentation/Icon";import{Loading}from"../state/Loading";import{Text}from"../text/Text";import{View}from"../structure/View";import{useDefaultModifier}from"../../modifiers/default";import{useSizeConverter}from"../../modifiers/sizeConverter";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_PROPS={fullW:'100%',paddingH:'sm',bg:'overlayBG',border:true,br:'md',row:true,gap:'sm'};export function InputWrapper(_ref){var prefix=_ref.prefix,suffix=_ref.suffix,prefixIcon=_ref.prefixIcon,prefixIconColor=_ref.prefixIconColor,suffixIcon=_ref.suffixIcon,suffixIconColor=_ref.suffixIconColor,loading=_ref.loading,error=_ref.error,children=_ref.children,ref=_ref.ref,rootProps=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),hover=_React$useState2[0],setHover=_React$useState2[1];var fallbackInputRef=React.useRef();var inputRef=ref||fallbackInputRef;var _pipe=pipe(useSizeConverter('elementHeights','md'),useThemeComponentModifier('InputWrapper'),useDefaultModifier(DEFAULT_PROPS))([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_pipe2$=_pipe2[0],size=_pipe2$.size,sizeCode=_pipe2$.sizeCode,props=_pipe2[1];var handlePress=function handlePress(){var _inputRef$current;inputRef==null?void 0:(_inputRef$current=inputRef.current)==null?void 0:_inputRef$current.focus==null?void 0:_inputRef$current.focus();};if(!!prefix&&is(String,prefix))prefix=_jsx(Text,{children:prefix});if(!!suffix&&is(String,suffix))suffix=_jsx(Text,{children:suffix});if(!prefix&&!!prefixIcon)prefix=_jsx(Icon,{name:prefixIcon,size:sizeCode,color:prefixIconColor});if(!suffix&&!!suffixIcon)suffix=_jsx(Icon,{name:suffixIcon,size:sizeCode,color:suffixIconColor});if(!prefix&&!!error)suffix=_jsx(Icon,{name:"close-circle-fill",size:sizeCode,red:true});if(!!loading)suffix=_jsx(Loading,{size:sizeCode});var borderColor=!!hover?'primary_op40':'divider';if(!!error)borderColor='red_op40';var child=React.Children.only(children);var childWithProps=React.cloneElement(child,Object.assign({},child.props,{ref:inputRef}));return _jsxs(View,Object.assign({className:"neko-input-wrapper",height:size,onPress:handlePress,borderColor:borderColor,onMouseEnter:function onMouseEnter(){return setHover(true);},onMouseLeave:function onMouseLeave(){return setHover(false);}},props,{children:[!!prefix&&_jsx(View,{paddingV:5,fullHeight:true,center:true,children:prefix}),_jsx(View,{flex:true,fullH:true,children:childWithProps}),!!suffix&&_jsx(View,{paddingV:5,fullHeight:true,center:true,children:suffix})]}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/LinkInput.js";var _excluded=["onPress","onClick","placeholder","value","disabled"];import{InputWrapper}from"./InputWrapper";import{Link}from"../actions/Link";import{Text}from"../text/Text";import{View}from"../structure/View";import{useColors}from"../../theme/ThemeHandler";import{jsx as _jsx}from"react/jsx-runtime";export function LinkInput(_ref){var onPress=_ref.onPress,onClick=_ref.onClick,placeholder=_ref.placeholder,value=_ref.value,disabled=_ref.disabled,props=_objectWithoutProperties(_ref,_excluded);return _jsx(Link,{onPress:!props.loading?onPress||onClick:undefined,flex:true,fullW:true,centerV:true,disabled:disabled,children:_jsx(InputWrapper,Object.assign({},props,{children:_jsx(View,{centerV:true,flex:true,fullW:true,children:_jsx(Text,{color:!!value?'text':'text_op30',label:value||placeholder})})}))});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/MaskInput.js";var _excluded=["value","onChange","mask","useRawValue"];import React from'react';import{TextInput}from"./TextInput";import{jsx as _jsx}from"react/jsx-runtime";function removeMask(value){var mask=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'';var result='';for(var i=0;i<mask.length;i++){var maskChar=mask[i];var valueChar=value[i];if(!valueChar)break;if(maskChar==='A'&&/[A-Za-z]/.test(valueChar)){result+=valueChar;}else if(maskChar==='9'&&/\d/.test(valueChar)){result+=valueChar;}}return result;}function applyMask(value,mask){var clean=value.replace(/[^0-9A-Za-z]/g,'');var result='';var index=0;for(var i=0;i<mask.length;i++){if(index>=clean.length)break;var char=mask[i];if(char==='9'&&/[0-9]/.test(clean[index])){result+=clean[index];index++;}else if(char==='A'&&/[A-Za-z]/.test(clean[index])){result+=clean[index].toUpperCase();index++;}else if(char==='9'||char==='A'){index++;i--;}else{result+=char;}}return result;}export function MaskInput(_ref){var _ref$value=_ref.value,value=_ref$value===void 0?'':_ref$value,onChange=_ref.onChange,_ref$mask=_ref.mask,mask=_ref$mask===void 0?'':_ref$mask,useRawValue=_ref.useRawValue,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(applyMask(value,mask)),_React$useState2=_slicedToArray(_React$useState,2),localValue=_React$useState2[0],setLocalValue=_React$useState2[1];var handleChange=React.useCallback(function(text){var masked=applyMask(text,mask);onChange==null?void 0:onChange(useRawValue?removeMask(masked,mask):masked);setLocalValue(masked);},[mask,onChange]);React.useEffect(function(){setLocalValue(applyMask(value,mask));},[value]);return _jsx(TextInput,Object.assign({value:localValue,onChange:handleChange},props));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/TextInput.js";var _excluded=["
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/TextInput.js";var _excluded=["onChange"];import{AbsTextInput}from"../../abstractions/TextInput";import{InputWrapper}from"./InputWrapper";import{useColors}from"../../theme/ThemeHandler";import{jsx as _jsx}from"react/jsx-runtime";export function TextInput(_ref){var onChange=_ref.onChange,props=_objectWithoutProperties(_ref,_excluded);var colors=useColors();var STYLE={width:'100%',height:'100%',borderWidth:0,background:'transparent',outline:'none',color:colors.text};return _jsx(InputWrapper,Object.assign({},props,{children:_jsx(AbsTextInput,Object.assign({style:STYLE,placeholderTextColor:colors.text_op30},props,{onChange:onChange}))}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/_DateInput.native.js";var _excluded=["value","onChange","min","max","onCheckDisabled","placement","type","format"];import React from'react';import advancedFormat from'dayjs/esm/plugin/advancedFormat';import dayjs from'dayjs';import weekOfYear from'dayjs/esm/plugin/weekOfYear';dayjs.extend(advancedFormat);dayjs.extend(weekOfYear);import{DatePicker}from"./datePicker/DatePicker";import{MaskInput}from"./MaskInput";import{Popover}from"../structure/popover/Popover";import{isValidDate}from"../calendar/_helpers/dateDisabled";import{jsx as _jsx}from"react/jsx-runtime";export function getDateInputDefaultFormat(type){switch(type){case'year':return'YYYY';case'quarter':return'YYYY-Q';case'month':return'YYYY-MM';case'week':return'YYYY-ww';default:return'YYYY-MM-DD';}}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);format=format||getDateInputDefaultFormat(type);var _React$useState=React.useState(''),_React$useState2=_slicedToArray(_React$useState,2),inputValue=_React$useState2[0],setInputValue=_React$useState2[1];var _React$useState3=React.useState(value),_React$useState4=_slicedToArray(_React$useState3,2),localValue=_React$useState4[0],setLocalValue=_React$useState4[1];value=value||localValue;var validations={min:min,max:max,onCheckDisabled:onCheckDisabled};var handleChange=function handleChange(v){if(!isValidDate(v,format,validations))return;v=!!v?dayjs(v):null;setLocalValue(v);onChange==null?void 0:onChange(v);};var handleChangeInput=function handleChangeInput(v){setInputValue(v);if(!isValidDate(v,format,validations))return;handleChange(v);};var onBlur=function onBlur(){if(isValidDate(inputValue,format,validations))return;handleChange(null);setInputValue('');};React.useEffect(function(){setInputValue(!!value?dayjs(value).format(format):'');},[value]);return false;return _jsx(Popover,{trigger:"click",placement:placement||'bottomLeft',renderContent:function renderContent(_ref2){var onClose=_ref2.onClose;return _jsx(DatePicker,Object.assign({value:value,onChange:function onChange(v){handleChange(v);onClose();}},validations,{type:type}));},children:_jsx(MaskInput,Object.assign({value:inputValue,onChange:handleChangeInput,suffixIcon:"calendar-line",suffixIconColor:"text4",onBlur:onBlur,mask:format.replace(/[DMYQwW]/gi,'9')},props))});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/DatePicker.js";var _excluded=["type"];import{DayPicker}from"./DayPicker";import{MonthPicker}from"./MonthPicker";import{QuarterPicker}from"./QuarterPicker";import{WeekPicker}from"./WeekPicker";import{YearPicker}from"./YearPicker";import{jsx as _jsx}from"react/jsx-runtime";export function DatePicker(_ref){var type=_ref.type,props=_objectWithoutProperties(_ref,_excluded);switch(type){case'year':return _jsx(YearPicker,Object.assign({},props));case'quarter':return _jsx(QuarterPicker,Object.assign({},props));case'month':return _jsx(MonthPicker,Object.assign({},props));case'week':return _jsx(WeekPicker,Object.assign({},props));default:return _jsx(DayPicker,Object.assign({},props));}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/DayPicker.js";var _excluded=["value","onChange","min","max","onCheckDisabled"];import React from'react';import dayjs from'dayjs';import{CalendarNav}from"../../calendar/CalendarNav";import{Col}from"../../structure/Col";import{Grid}from"../../structure/Row";import{Link}from"../../actions/Link";import{Text}from"../../text/Text";import{View}from"../../structure/View";import{WeekDaysBar}from"../../calendar/WeekDaysBar";import{isDateDisabled}from"../../calendar/_helpers/dateDisabled";import{useCalendarDays}from"../../calendar/_helpers/calendarDays";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function DayPicker(_ref){var _this=this;var value=_ref.value,onChange=_ref.onChange,min=_ref.min,max=_ref.max,onCheckDisabled=_ref.onCheckDisabled,props=_objectWithoutProperties(_ref,_excluded);if(!!value)value=dayjs(value);var _React$useState=React.useState(value),_React$useState2=_slicedToArray(_React$useState,2),localValue=_React$useState2[0],setLocalValue=_React$useState2[1];React.useEffect(function(){setLocalValue(value);},[value]);value=value===undefined?localValue:value;var handleChange=function handleChange(v){setLocalValue(v);onChange==null?void 0:onChange(v);};var _React$useState3=React.useState(function(){return dayjs(value).startOf('month');}),_React$useState4=_slicedToArray(_React$useState3,2),currentMonth=_React$useState4[0],setCurrentMonth=_React$useState4[1];var _useCalendarDays=useCalendarDays(currentMonth),cells=_useCalendarDays.cells;return _jsxs(View,Object.assign({className:"neko-day-picker",width:275},props,{children:[_jsx(CalendarNav,{value:currentMonth,onChange:setCurrentMonth}),_jsx(WeekDaysBar,{}),_jsx(Grid,{className:"neko-day-picker-days",colSpan:24/7,gap:"sm",children:cells.map(function(day,i){var dateVal=currentMonth.date(day);var isActive=!!value&&!!day&&dateVal.isSame(value,'day');var disabled=isDateDisabled(dateVal,{min:min,max:max,onCheckDisabled:onCheckDisabled});return _jsx(Col,{className:"day-cell",center:true,children:_jsx(Link,{ratio:1,fullW:true,center:true,br:"md",onPress:function onPress(){return!!day&&handleChange(dateVal);},bg:isActive&&'primary',disabled:disabled,children:_jsx(Text,{sm:true,text2:true,center:true,strong:isActive,children:day||''})})},day?dateVal.format('YYYYMMDD'):i);})})]}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/MonthPicker.js";var _excluded=["value","onChange","min","max","onCheckDisabled"];import React from'react';import dayjs from'dayjs';import{CalendarNav}from"../../calendar/CalendarNav";import{Col}from"../../structure/Col";import{Divider}from"../../helpers";import{Grid}from"../../structure/Row";import{Link}from"../../actions/Link";import{Text}from"../../text/Text";import{View}from"../../structure/View";import{isDateDisabled}from"../../calendar/_helpers/dateDisabled";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var months=[0,1,2,3,4,5,6,7,8,9,10,11];export function MonthPicker(_ref){var _value,_value2,_this=this;var value=_ref.value,onChange=_ref.onChange,min=_ref.min,max=_ref.max,onCheckDisabled=_ref.onCheckDisabled,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(value),_React$useState2=_slicedToArray(_React$useState,2),localValue=_React$useState2[0],setLocalValue=_React$useState2[1];value=value===undefined?localValue:value;React.useEffect(function(){setLocalValue(value);},[(_value=value)==null?void 0:_value.month==null?void 0:_value.month(),(_value2=value)==null?void 0:_value2.year==null?void 0:_value2.year()]);var handleChange=function handleChange(v){var newValue=v.startOf('month');setLocalValue(newValue);onChange==null?void 0:onChange(newValue);};var _React$useState3=React.useState(function(){return dayjs(value).startOf('year');}),_React$useState4=_slicedToArray(_React$useState3,2),currentYear=_React$useState4[0],setCurrentYear=_React$useState4[1];return _jsxs(View,Object.assign({className:"neko-day-picker",width:275},props,{children:[_jsx(CalendarNav,{value:currentYear,onChange:setCurrentYear,level:"year"}),_jsx(Divider,{}),_jsx(Grid,{colSpan:8,gap:"xs",children:months.map(function(month){var dateVal=currentYear.month(month);var isActive=!!value&&dateVal.isSame(value,'week');var disabled=isDateDisabled(dateVal,{min:min,max:max,onCheckDisabled:onCheckDisabled});return _jsx(Col,{children:_jsx(Link,{fullW:true,br:"md",padding:"sm",onPress:function onPress(){return handleChange(dateVal);},bg:isActive&&'primary',disabled:disabled,children:_jsx(Text,{text2:!isActive,strong:isActive,center:true,children:dateVal.format('MMM')})})},month);})})]}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/QuarterPicker.js";var _excluded=["value","onChange","min","max","onCheckDisabled"];import React from'react';import dayjs from'dayjs';import quarterOfYear from'dayjs/esm/plugin/quarterOfYear';import{CalendarNav}from"../../calendar/CalendarNav";import{Col}from"../../structure/Col";import{Divider}from"../../helpers";import{Grid}from"../../structure/Row";import{Link}from"../../actions/Link";import{Text}from"../../text/Text";import{View}from"../../structure/View";import{isDateDisabled}from"../../calendar/_helpers/dateDisabled";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";dayjs.extend(quarterOfYear);var quarters=[1,2,3,4];export function QuarterPicker(_ref){var _value,_value2,_this=this;var value=_ref.value,onChange=_ref.onChange,min=_ref.min,max=_ref.max,onCheckDisabled=_ref.onCheckDisabled,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(value),_React$useState2=_slicedToArray(_React$useState,2),localValue=_React$useState2[0],setLocalValue=_React$useState2[1];value=value===undefined?localValue:value;React.useEffect(function(){setLocalValue(value);},[(_value=value)==null?void 0:_value.quarter==null?void 0:_value.quarter(),(_value2=value)==null?void 0:_value2.year==null?void 0:_value2.year()]);var handleChange=function handleChange(v){var newValue=v.startOf('quarter');setLocalValue(newValue);onChange==null?void 0:onChange(newValue);};var _React$useState3=React.useState(function(){return dayjs(value).startOf('year');}),_React$useState4=_slicedToArray(_React$useState3,2),currentYear=_React$useState4[0],setCurrentYear=_React$useState4[1];return _jsxs(View,Object.assign({className:"neko-day-picker",width:275},props,{children:[_jsx(CalendarNav,{value:currentYear,onChange:setCurrentYear,level:"year"}),_jsx(Divider,{}),_jsx(Grid,{colSpan:6,gap:"xs",children:quarters.map(function(quarter){var dateVal=currentYear.quarter(quarter);var isActive=!!value&&dateVal.isSame(value,'week');var disabled=isDateDisabled(dateVal,{min:min,max:max,onCheckDisabled:onCheckDisabled});return _jsx(Col,{children:_jsx(Link,{fullW:true,br:"md",padding:"sm",onPress:function onPress(){return handleChange(dateVal);},bg:isActive&&'primary',disabled:disabled,children:_jsxs(Text,{text2:!isActive,strong:isActive,center:true,children:["Q",dateVal.quarter()]})})},quarter);})})]}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/WeekPicker.js";var _excluded=["value","onChange","min","max","onCheckDisabled"];import{splitEvery,identity}from'ramda';import React from'react';import dayjs from'dayjs';import{CalendarNav}from"../../calendar/CalendarNav";import{Col}from"../../structure/Col";import{Link}from"../../actions/Link";import{Row}from"../../structure/Row";import{Text}from"../../text/Text";import{View}from"../../structure/View";import{WeekDaysBar}from"../../calendar/WeekDaysBar";import{isDateDisabled}from"../../calendar/_helpers/dateDisabled";import{useCalendarDays}from"../../calendar/_helpers/calendarDays";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function WeekPicker(_ref){var _value,_value2,_value3,_this=this;var value=_ref.value,onChange=_ref.onChange,min=_ref.min,max=_ref.max,onCheckDisabled=_ref.onCheckDisabled,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(value),_React$useState2=_slicedToArray(_React$useState,2),localValue=_React$useState2[0],setLocalValue=_React$useState2[1];value=value===undefined?localValue:value;React.useEffect(function(){setLocalValue(value);},[(_value=value)==null?void 0:_value.day==null?void 0:_value.day(),(_value2=value)==null?void 0:_value2.month==null?void 0:_value2.month(),(_value3=value)==null?void 0:_value3.year==null?void 0:_value3.year()]);var handleChange=function handleChange(v){var newValue=v.startOf('week');setLocalValue(newValue);onChange==null?void 0:onChange(newValue);};var _React$useState3=React.useState(function(){return dayjs(value).startOf('month');}),_React$useState4=_slicedToArray(_React$useState3,2),currentMonth=_React$useState4[0],setCurrentMonth=_React$useState4[1];var _useCalendarDays=useCalendarDays(currentMonth),cells=_useCalendarDays.cells;var weeks=splitEvery(7,cells);return _jsxs(View,Object.assign({className:"neko-day-picker",width:275},props,{children:[_jsx(CalendarNav,{value:currentMonth,onChange:setCurrentMonth}),_jsx(WeekDaysBar,{}),_jsx(View,{colSpan:24/7,gap:"sm",children:weeks.map(function(week,wi){var firstDay=week.find(identity);var dateVal=currentMonth.date(firstDay);var isActive=!!value&&!!firstDay&&dateVal.isSame(value,'week');var disabled=isDateDisabled(dateVal,{min:min,max:max,onCheckDisabled:onCheckDisabled});return _jsx(Link,{fullW:true,br:"md",onPress:function onPress(){return!!firstDay&&handleChange(dateVal);},bg:isActive&&'primary',disabled:disabled,children:_jsx(Row,{colSpan:24/7,gap:"sm",children:week.map(function(day,i){var dateVal=currentMonth.date(day);return _jsx(Col,{className:"day-cell",center:true,ratio:1,children:_jsx(Text,{sm:true,text2:true,center:true,strong:isActive,children:day||''})},day?dateVal.format('YYYYMMDD'):i);})})},firstDay?dateVal.format('YYYYMMDD'):wi);})})]}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/inputs/datePicker/YearPicker.js";var _excluded=["value","onChange","min","max","onCheckDisabled"];import{range}from'ramda';import React from'react';import dayjs from'dayjs';import{CalendarNav}from"../../calendar/CalendarNav";import{Col}from"../../structure/Col";import{Divider}from"../../helpers";import{Grid}from"../../structure/Row";import{Link}from"../../actions/Link";import{Text}from"../../text/Text";import{View}from"../../structure/View";import{isDateDisabled}from"../../calendar/_helpers/dateDisabled";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function YearPicker(_ref){var _value,_this=this;var value=_ref.value,onChange=_ref.onChange,min=_ref.min,max=_ref.max,onCheckDisabled=_ref.onCheckDisabled,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(value),_React$useState2=_slicedToArray(_React$useState,2),localValue=_React$useState2[0],setLocalValue=_React$useState2[1];value=value===undefined?localValue:value;React.useEffect(function(){setLocalValue(value);},[(_value=value)==null?void 0:_value.year==null?void 0:_value.year()]);var handleChange=function handleChange(v){var newValue=v.startOf('year');setLocalValue(newValue);onChange==null?void 0:onChange(newValue);};var _React$useState3=React.useState(function(){var year=dayjs(value).year();var decadeStartYear=Math.floor(year/10)*10;return dayjs().year(decadeStartYear).startOf('year');}),_React$useState4=_slicedToArray(_React$useState3,2),currentDecade=_React$useState4[0],setCurrentDecade=_React$useState4[1];var years=range(currentDecade.year(),currentDecade.year()+10);return _jsxs(View,Object.assign({className:"neko-day-picker",width:275},props,{children:[_jsx(CalendarNav,{value:currentDecade,onChange:setCurrentDecade,level:"decade"}),_jsx(Divider,{}),_jsx(Grid,{colSpan:12,gap:"xs",children:years.map(function(year){var dateVal=currentDecade.year(year);var isActive=!!value&&dateVal.isSame(value,'week');var disabled=isDateDisabled(dateVal,{min:min,max:max,onCheckDisabled:onCheckDisabled});return _jsx(Col,{children:_jsx(Link,{fullW:true,br:"md",padding:"sm",onPress:function onPress(){return handleChange(dateVal);},bg:isActive&&'primary',disabled:disabled,children:_jsx(Text,{text2:!isActive,strong:isActive,center:true,children:dateVal.year()})})},year);})})]}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./Checkbox";export*from"./Radio";export*from"./Switch";export*from"./InputWrapper";export*from"./TextInput";export*from"./Picker";
|
|
1
|
+
export*from"./Checkbox";export*from"./Radio";export*from"./Switch";export*from"./InputWrapper";export*from"./TextInput";export*from"./LinkInput";export*from"./MaskInput";export*from"./DateInput";export*from"./datePicker/DatePicker";export*from"./Picker";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/layout/Layout.js";var _excluded=["children"];import React from'react';import{View}from"../structure/View";import{getElementSize}from"../../abstractions/helpers/componentSize";import{jsx as _jsx}from"react/jsx-runtime";var LayoutContext=React.createContext({});export var useLayout=function useLayout(){return React.useContext(LayoutContext)||{};};export function Layout(_ref){var children=_ref.children,rootProps=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),layoutHeaderSpace=_React$useState2[0],setLayoutHeaderSpace=_React$useState2[1];var _React$useState3=React.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),layoutSiderSpace=_React$useState4[0],setLayoutSiderSpace=_React$useState4[1];var registerHeader=function registerHeader(space){return setLayoutHeaderSpace(function(v){return v+space;});};var unregisterHeader=function unregisterHeader(space){return setLayoutHeaderSpace(function(v){return v-space;});};var _React$useState5=React.useState({}),_React$useState6=_slicedToArray(_React$useState5,2),layoutSize=_React$useState6[0],setLayoutSize=_React$useState6[1];var layoutRef=React.useRef(null);React.useLayoutEffect(function(){getElementSize(layoutRef,setLayoutSize);},[]);var value={layoutSize:layoutSize,layoutHeaderSpace:layoutHeaderSpace,setLayoutHeaderSpace:setLayoutHeaderSpace,layoutSiderSpace:layoutSiderSpace,layoutSiderSpace:layoutSiderSpace,registerHeader:registerHeader,unregisterHeader:unregisterHeader};return _jsx(LayoutContext.Provider,{value:value,children:_jsx(View,Object.assign({className:"neko-layout",bg:"
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/layout/Layout.js";var _excluded=["children"];import React from'react';import{View}from"../structure/View";import{getElementSize}from"../../abstractions/helpers/componentSize";import{jsx as _jsx}from"react/jsx-runtime";var LayoutContext=React.createContext({});export var useLayout=function useLayout(){return React.useContext(LayoutContext)||{};};export function Layout(_ref){var children=_ref.children,rootProps=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),layoutHeaderSpace=_React$useState2[0],setLayoutHeaderSpace=_React$useState2[1];var _React$useState3=React.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),layoutSiderSpace=_React$useState4[0],setLayoutSiderSpace=_React$useState4[1];var registerHeader=function registerHeader(space){return setLayoutHeaderSpace(function(v){return v+space;});};var unregisterHeader=function unregisterHeader(space){return setLayoutHeaderSpace(function(v){return v-space;});};var _React$useState5=React.useState({}),_React$useState6=_slicedToArray(_React$useState5,2),layoutSize=_React$useState6[0],setLayoutSize=_React$useState6[1];var layoutRef=React.useRef(null);React.useLayoutEffect(function(){getElementSize(layoutRef,setLayoutSize);},[]);var value={layoutSize:layoutSize,layoutHeaderSpace:layoutHeaderSpace,setLayoutHeaderSpace:setLayoutHeaderSpace,layoutSiderSpace:layoutSiderSpace,layoutSiderSpace:layoutSiderSpace,registerHeader:registerHeader,unregisterHeader:unregisterHeader};return _jsx(LayoutContext.Provider,{value:value,children:_jsx(View,Object.assign({className:"neko-layout",bg:"mainBG",flex:true,relative:true},rootProps,{ref:layoutRef,children:children}))});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/list/FlatList.js";var _excluded=["children"];import{pipe}from'ramda';import{AbsFlatList}from"../../abstractions/FlatList";import{useAnimationModifier}from"../../modifiers/animation";import{useBackgroundModifier}from"../../modifiers/background";import{useBorderModifier}from"../../modifiers/border";import{useDefaultModifier}from"../../modifiers/default";import{useDisplayModifier}from"../../modifiers/display";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useMarginModifier}from"../../modifiers/margin";import{useOverflowModifier}from"../../modifiers/overflow";import{usePaddingModifier}from"../../modifiers/padding";import{usePositionModifier}from"../../modifiers/position";import{useShadowModifier}from"../../modifiers/shadow";import{useSizeModifier}from"../../modifiers/size";import{useStateModifier}from"../../modifiers/state";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_PROPS=function DEFAULT_PROPS(_ref){var _ref2=_slicedToArray(_ref,2),_=_ref2[0],horizontal=_ref2[1].horizontal;var overflowKey=horizontal?'scrollX':'scrollY';return _defineProperty(_defineProperty({},overflowKey,true),"row",!!horizontal);};export function FlatList(_ref4){var children=_ref4.children,rootProps=_objectWithoutProperties(_ref4,_excluded);var _pipe=pipe(useThemeComponentModifier('FlatList'),useDefaultModifier(DEFAULT_PROPS),useFlexWrapperModifier,useDisplayModifier,useAnimationModifier,useStateModifier,useSizeModifier,usePositionModifier,useOverflowModifier,usePaddingModifier,useMarginModifier,useFlexModifier,useBackgroundModifier,useBorderModifier,useShadowModifier)([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_=_pipe2[0],props=_pipe2[1];return _jsx(AbsFlatList,Object.assign({className:"neko-flat-list"},props,{children:children}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/list/ScrollView.js";var _excluded=["children","useNormalView"];import{pipe}from'ramda';import{AbsScrollView}from"../../abstractions/ScrollView";import{View}from"../structure/View";import{useAnimationModifier}from"../../modifiers/animation";import{useBackgroundModifier}from"../../modifiers/background";import{useBorderModifier}from"../../modifiers/border";import{useDefaultModifier}from"../../modifiers/default";import{useDisplayModifier}from"../../modifiers/display";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useMarginModifier}from"../../modifiers/margin";import{useOverflowModifier}from"../../modifiers/overflow";import{usePaddingModifier}from"../../modifiers/padding";import{usePositionModifier}from"../../modifiers/position";import{useResponsiveValue}from"../../responsive";import{useShadowModifier}from"../../modifiers/shadow";import{useSizeModifier}from"../../modifiers/size";import{useStateModifier}from"../../modifiers/state";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_PROPS=function DEFAULT_PROPS(_ref){var _ref2=_slicedToArray(_ref,2),_=_ref2[0],horizontal=_ref2[1].horizontal;var overflowKey=horizontal?'scrollX':'scrollY';return _defineProperty(_defineProperty({},overflowKey,true),"row",!!horizontal);};export function ScrollView(_ref4){var children=_ref4.children,useNormalView=_ref4.useNormalView,rootProps=_objectWithoutProperties(_ref4,_excluded);var _pipe=pipe(useThemeComponentModifier('ScrollView'),useDefaultModifier(DEFAULT_PROPS),useFlexWrapperModifier,useDisplayModifier,useAnimationModifier,useStateModifier,useSizeModifier,usePositionModifier,useOverflowModifier,usePaddingModifier,useMarginModifier,useFlexModifier,useBackgroundModifier,useBorderModifier,useShadowModifier)([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_=_pipe2[0],props=_pipe2[1];useNormalView=useResponsiveValue(useNormalView);if(useNormalView)return _jsx(View,Object.assign({},rootProps,{children:children}));return _jsx(AbsScrollView,Object.assign({className:"neko-scroll-view"},props,{children:children}));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./ScrollView";export*from"./FlatList";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectDestructuringEmpty from"@babel/runtime/helpers/objectDestructuringEmpty";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/presentation/ImageBackground.js";import{pipe}from'ramda';import{AbsImageBackground}from"../../abstractions/ImageBackground";import{useAnimationModifier}from"../../modifiers/animation";import{useBackgroundModifier}from"../../modifiers/background";import{useBorderModifier}from"../../modifiers/border";import{useDisplayModifier}from"../../modifiers/display";import{useFlexModifier}from"../../modifiers/flex";import{useFlexWrapperModifier}from"../../modifiers/flexWrapper";import{useMarginModifier}from"../../modifiers/margin";import{useOverflowModifier}from"../../modifiers/overflow";import{usePaddingModifier}from"../../modifiers/padding";import{usePositionModifier}from"../../modifiers/position";import{useShadowModifier}from"../../modifiers/shadow";import{useSizeModifier}from"../../modifiers/size";import{useStateModifier}from"../../modifiers/state";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx}from"react/jsx-runtime";export function ImageBackground(_ref){var rootProps=Object.assign({},(_objectDestructuringEmpty(_ref),_ref));var _pipe=pipe(useThemeComponentModifier('ImageBackground'),useFlexWrapperModifier,useDisplayModifier,useAnimationModifier,useStateModifier,useSizeModifier,usePositionModifier,useOverflowModifier,usePaddingModifier,useMarginModifier,useFlexModifier,useBackgroundModifier,useBorderModifier,useShadowModifier)([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),_=_pipe2[0],props=_pipe2[1];return _jsx(AbsImageBackground,Object.assign({className:"neko-image-background"},props));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/presentation/Result.js";var _excluded=["type","icon","iconColor","title","description","footer","titleProps","descriptionProps","textProps","iconProps"];import{Divider}from"../helpers/Separator";import{Icon}from"./Icon";import{Text}from"../text/Text";import{View}from"../structure/View";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var RESULT_TYPES={error:{icon:'close-circle-fill',color:'red'},success:{icon:'checkbox-circle-fill',color:'green'},warning:{icon:'error-warning-fill',color:'yellow'},info:{icon:'information-2-fill',color:'blue'}};export function Result(_ref){var type=_ref.type,icon=_ref.icon,iconColor=_ref.iconColor,title=_ref.title,description=_ref.description,footer=_ref.footer,titleProps=_ref.titleProps,descriptionProps=_ref.descriptionProps,textProps=_ref.textProps,iconProps=_ref.iconProps,props=_objectWithoutProperties(_ref,_excluded);var typeProps=RESULT_TYPES[type]||{};icon=icon||typeProps.icon;iconColor=iconColor||typeProps.color||'primary';return _jsxs(View,Object.assign({className:"neko-result",center:true,padding:"lg"},props,{children:[_jsx(Icon,Object.assign({name:icon,color:iconColor,size:42,primary:true},iconProps))
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/presentation/Result.js";var _excluded=["type","icon","iconColor","title","description","footer","titleProps","descriptionProps","textProps","iconProps"];import{Divider}from"../helpers/Separator";import{Icon}from"./Icon";import{Text}from"../text/Text";import{View}from"../structure/View";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var RESULT_TYPES={error:{icon:'close-circle-fill',color:'red'},success:{icon:'checkbox-circle-fill',color:'green'},warning:{icon:'error-warning-fill',color:'yellow'},info:{icon:'information-2-fill',color:'blue'}};export function Result(_ref){var type=_ref.type,icon=_ref.icon,iconColor=_ref.iconColor,title=_ref.title,description=_ref.description,footer=_ref.footer,titleProps=_ref.titleProps,descriptionProps=_ref.descriptionProps,textProps=_ref.textProps,iconProps=_ref.iconProps,props=_objectWithoutProperties(_ref,_excluded);var typeProps=RESULT_TYPES[type]||{};icon=icon||typeProps.icon;iconColor=iconColor||typeProps.color||'primary';return _jsxs(View,Object.assign({className:"neko-result",center:true,padding:"lg"},props,{children:[!!icon&&_jsx(Icon,Object.assign({name:icon,color:iconColor,size:42,primary:true},iconProps)),!!icon&&_jsx(Divider,{height:10}),_jsx(Text,Object.assign({h3:true},textProps,titleProps,{children:title})),!!description&&_jsx(Text,Object.assign({text3:true,sm:true},textProps,descriptionProps,{children:description})),!!footer&&_jsx(View,{marginT:"lg",children:footer})]}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./Tag";export*from"./Icon";export*from"./IconLabel";export*from"./Result";export*from"./ResultBar";export*from"./Tooltip";export*from"./Badge";export*from"./Avatar";export*from"./AvatarLabel";export*from"./Image";export*from"./LabelValue";
|
|
1
|
+
export*from"./Tag";export*from"./Icon";export*from"./IconLabel";export*from"./Result";export*from"./ResultBar";export*from"./Tooltip";export*from"./Badge";export*from"./Avatar";export*from"./AvatarLabel";export*from"./Image";export*from"./ImageBackground";export*from"./LabelValue";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/state/LoadingView.js";var _excluded=["active","children","size","color","replaceChildren","noWrapper"];import{Loading}from"./Loading";import{View}from"../structure/View";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function LoadingView(_ref){var active=_ref.active,children=_ref.children,size=_ref.size,color=_ref.color,replaceChildren=_ref.replaceChildren,noWrapper=_ref.noWrapper,props=_objectWithoutProperties(_ref,_excluded);if(!active&&!!noWrapper)return children;if(!active)return _jsx(View,Object.assign({},props,{children:children}));var loader=_jsx(Loading,{size:size,color:color});if(!!replaceChildren&&!!noWrapper)return loader;if(!!replaceChildren){return _jsx(View,Object.assign({},props,{center:true,children:loader}));}return _jsxs(View,Object.assign({className:"neko-loading-view",relative:true},props,{children:[children,_jsx(View,{className:"neko-laoding-view-overlay",bg:"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/state/LoadingView.js";var _excluded=["active","children","size","color","replaceChildren","noWrapper"];import{Loading}from"./Loading";import{View}from"../structure/View";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function LoadingView(_ref){var active=_ref.active,children=_ref.children,size=_ref.size,color=_ref.color,replaceChildren=_ref.replaceChildren,noWrapper=_ref.noWrapper,props=_objectWithoutProperties(_ref,_excluded);if(!active&&!!noWrapper)return children;if(!active)return _jsx(View,Object.assign({},props,{children:children}));var loader=_jsx(Loading,{size:size,color:color});if(!!replaceChildren&&!!noWrapper)return loader;if(!!replaceChildren){return _jsx(View,Object.assign({},props,{center:true,children:loader}));}return _jsxs(View,Object.assign({className:"neko-loading-view",relative:true},props,{children:[children,_jsx(View,{className:"neko-laoding-view-overlay",bg:"mainBG_op90",absolute:true,top:0,left:0,right:0,bottom:0,center:true,children:loader})]}));}export var LoadingWrapper=LoadingView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/structure/Accordion.js";var _excluded=["children","title","open","onChange"],_excluded2=["contentProps","titleProps","headerProps","initOpen"];import{pipe}from'ramda';import React from'react';import{AbsView}from"../../abstractions/View";import{Card}from"./Card";import{Icon}from"../presentation/Icon";import{Link}from"../actions/Link";import{Text}from"../text/Text";import{View}from"./View";import{moveScale}from"../../theme/helpers/sizeScale";import{useDefaultModifier}from"../../modifiers/default";import{useSizeConverter}from"../../modifiers/sizeConverter";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_PROPS={padding:0,br:'xl',bg:'overlayBG',hiddenOverflow:true};export function Accordion(_ref){var children=_ref.children,title=_ref.title,open=_ref.open,onChange=_ref.onChange,rootProps=_objectWithoutProperties(_ref,_excluded);var _pipe=pipe(useSizeConverter('elementHeights','md'),useThemeComponentModifier('Accordion'),useDefaultModifier(DEFAULT_PROPS))([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),sizeCode=_pipe2[0].sizeCode,formattedProps=_pipe2[1];var contentProps=formattedProps.contentProps,titleProps=formattedProps.titleProps,headerProps=formattedProps.headerProps,initOpen=formattedProps.initOpen,props=_objectWithoutProperties(formattedProps,_excluded2);var _React$useState=React.useState(initOpen),_React$useState2=_slicedToArray(_React$useState,2),localOpen=_React$useState2[0],setLocalOpen=_React$useState2[1];open=open===undefined?localOpen:open;var toggle=function toggle(){setLocalOpen(!open);onChange==null?void 0:onChange(!open);};return _jsxs(Card,Object.assign({},props,{children:[_jsxs(Link,Object.assign({padding:sizeCode,row:true,gap:moveScale(sizeCode,-2),borderB:open?props.border||true:open,borderColor:props.borderColor,centerV:true},headerProps,{onPress:toggle,children:[_jsx(Icon,{name:!!open?'arrow-down-s-line':'arrow-right-s-line'}),_jsx(Text,Object.assign({flex:true},titleProps,{children:title}))]})),!!open&&_jsx(View,Object.assign({padding:sizeCode},contentProps,{children:children}))]}));return _jsx(AbsView,Object.assign({className:"neko-accordion"},props,{children:children}));}
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/components/structure/Accordion.js";var _excluded=["children","title","open","onChange"],_excluded2=["contentProps","titleProps","headerProps","initOpen"];import{pipe}from'ramda';import React from'react';import{AbsView}from"../../abstractions/View";import{Card}from"./Card";import{Icon}from"../presentation/Icon";import{Link}from"../actions/Link";import{Text}from"../text/Text";import{View}from"./View";import{moveScale}from"../../theme/helpers/sizeScale";import{useDefaultModifier}from"../../modifiers/default";import{useSizeConverter}from"../../modifiers/sizeConverter";import{useThemeComponentModifier}from"../../modifiers/themeComponent";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_PROPS={padding:0,br:'xl',bg:'overlayBG',hiddenOverflow:true};export function Accordion(_ref){var children=_ref.children,title=_ref.title,open=_ref.open,onChange=_ref.onChange,rootProps=_objectWithoutProperties(_ref,_excluded);var _pipe=pipe(useSizeConverter('elementHeights','md'),useThemeComponentModifier('Accordion'),useDefaultModifier(DEFAULT_PROPS))([{},rootProps]),_pipe2=_slicedToArray(_pipe,2),sizeCode=_pipe2[0].sizeCode,formattedProps=_pipe2[1];var contentProps=formattedProps.contentProps,titleProps=formattedProps.titleProps,headerProps=formattedProps.headerProps,initOpen=formattedProps.initOpen,props=_objectWithoutProperties(formattedProps,_excluded2);var _React$useState=React.useState(initOpen),_React$useState2=_slicedToArray(_React$useState,2),localOpen=_React$useState2[0],setLocalOpen=_React$useState2[1];open=open===undefined?localOpen:open;var toggle=function toggle(){setLocalOpen(!open);onChange==null?void 0:onChange(!open);};return _jsxs(Card,Object.assign({},props,{children:[_jsxs(Link,Object.assign({padding:sizeCode,row:true,gap:moveScale(sizeCode,-2),borderB:open?props.border||true:open,borderColor:props.borderColor||'bg',centerV:true},headerProps,{onPress:toggle,children:[_jsx(Icon,{name:!!open?'arrow-down-s-line':'arrow-right-s-line'}),_jsx(Text,Object.assign({flex:true},titleProps,{children:title}))]})),!!open&&_jsx(View,Object.assign({padding:sizeCode},contentProps,{children:children}))]}));return _jsx(AbsView,Object.assign({className:"neko-accordion"},props,{children:children}));}
|