@neko-os/ui 0.1.0 → 0.2.1
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/FlatList.native.js +1 -1
- package/dist/abstractions/ScrollView.native.js +1 -1
- package/dist/components/actions/ActionsDrawer.js +1 -1
- package/dist/components/actions/Dropdown.js +1 -1
- package/dist/components/actions/FloatingMenu.js +1 -1
- package/dist/components/feedback/alerter.js +1 -1
- package/dist/components/feedback/confirmer.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/inputs/Picker.js +1 -1
- package/dist/components/modals/bottomDrawer/native/BottomDrawer.js +1 -0
- package/dist/components/modals/bottomDrawer/native/DrawerContext.js +1 -0
- package/dist/components/modals/bottomDrawer/native/DrawerHandle.js +1 -0
- package/dist/components/modals/bottomDrawer/native/createDrawerScrollComponent.js +1 -0
- package/dist/components/modals/bottomDrawer/web/BottomDrawer.js +1 -0
- package/dist/components/modals/drawer/Drawer.js +1 -0
- package/dist/components/modals/index.js +1 -0
- package/dist/components/modals/modal/Modal.js +1 -0
- package/dist/components/modals/modal/Modal.native.js +1 -0
- package/dist/components/modals/modal/ModalBackdrop.js +1 -0
- package/dist/components/modals/modal/ModalContent.js +1 -0
- package/dist/components/modals/modal/ModalFooter.js +1 -0
- package/dist/components/modals/modal/ModalHeader.js +1 -0
- package/dist/components/modals/modal/handler/ModalsHandler.js +1 -0
- package/dist/components/modals/router/ModalRoute.js +1 -0
- package/dist/components/modals/router/ModalsRouter.js +1 -0
- package/dist/components/modals/router/ModalsRouterContext.js +1 -0
- package/dist/components/modals/router/index.js +1 -0
- package/dist/components/modals/router/useAllModalsParams.js +1 -0
- package/dist/components/modals/router/useModalParams.js +1 -0
- package/dist/components/modals/router/useModalsNavigation.js +1 -0
- package/dist/components/modals/router/useUpdateModalContainer.js +1 -0
- package/dist/components/sections/SectionItemDropdown.js +1 -0
- package/dist/components/sections/index.js +1 -1
- package/dist/components/structure/index.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/structure/popover/Popover_BU.js +1 -1
- package/dist/components/theme/ThemePickerDrawer.js +1 -1
- package/dist/modifiers/_helpers.js +1 -1
- package/dist/modifiers/animation.js +1 -1
- package/dist/modifiers/animations/fadeEffect.js +1 -1
- package/dist/modifiers/animations/scaleEffect.js +1 -1
- package/dist/modifiers/animations/slideEffect.js +1 -1
- package/dist/modifiers/background.js +1 -1
- package/dist/modifiers/border.js +1 -1
- package/dist/modifiers/cursor.js +1 -1
- package/dist/modifiers/display.js +1 -1
- package/dist/modifiers/flex.js +1 -1
- package/dist/modifiers/flexWrapper.js +1 -1
- package/dist/modifiers/margin.js +1 -1
- package/dist/modifiers/overflow.js +1 -1
- package/dist/modifiers/padding.js +1 -1
- package/dist/modifiers/position.js +1 -1
- package/dist/modifiers/shadow.js +1 -1
- package/dist/modifiers/size.js +1 -1
- package/dist/modifiers/state.js +1 -1
- package/dist/modifiers/text.js +1 -1
- package/dist/theme/default/blackTheme.js +1 -1
- package/dist/theme/default/cyberpunkTheme.js +1 -1
- package/dist/theme/default/hackerTheme.js +1 -1
- package/dist/theme/default/paperTheme.js +1 -1
- package/dist/theme/default/themes.js +1 -1
- package/package.json +1 -1
- package/src/NekoUI.js +1 -1
- package/src/abstractions/FlatList.native.js +2 -1
- package/src/abstractions/ScrollView.native.js +2 -2
- package/src/components/actions/ActionsDrawer.js +2 -2
- package/src/components/actions/Dropdown.js +3 -3
- package/src/components/actions/FloatingMenu.js +1 -1
- package/src/components/feedback/alerter.js +1 -1
- package/src/components/feedback/confirmer.js +1 -1
- package/src/components/index.js +1 -0
- package/src/components/inputs/Picker.js +1 -1
- package/src/components/{structure → modals}/bottomDrawer/native/BottomDrawer.js +1 -1
- package/src/components/{structure → modals}/bottomDrawer/native/DrawerHandle.js +1 -1
- package/src/components/modals/index.js +4 -0
- package/src/components/{structure → modals}/modal/Modal.native.js +1 -1
- package/src/components/{structure → modals}/modal/ModalBackdrop.js +1 -1
- package/src/components/{structure → modals}/modal/ModalContent.js +1 -1
- package/src/components/{structure → modals}/modal/ModalFooter.js +1 -1
- package/src/components/{structure → modals}/modal/ModalHeader.js +1 -1
- package/src/components/modals/router/ModalRoute.js +15 -0
- package/src/components/modals/router/ModalsRouter.js +120 -0
- package/src/components/modals/router/ModalsRouterContext.js +16 -0
- package/src/components/modals/router/index.js +6 -0
- package/src/components/modals/router/useAllModalsParams.js +6 -0
- package/src/components/modals/router/useModalParams.js +6 -0
- package/src/components/modals/router/useModalsNavigation.js +6 -0
- package/src/components/modals/router/useUpdateModalContainer.js +6 -0
- package/src/components/sections/SectionItemDropdown.js +68 -0
- package/src/components/sections/index.js +1 -0
- package/src/components/structure/index.js +0 -3
- package/src/components/structure/popover/Popover.js +1 -1
- package/src/components/structure/popover/Popover.native.js +1 -1
- package/src/components/structure/popover/Popover_BU.js +1 -1
- package/src/components/theme/ThemePickerDrawer.js +3 -4
- package/src/modifiers/_helpers.js +3 -0
- package/src/modifiers/animation.js +2 -2
- package/src/modifiers/animations/fadeEffect.js +2 -1
- package/src/modifiers/animations/scaleEffect.js +2 -1
- package/src/modifiers/animations/slideEffect.js +2 -1
- package/src/modifiers/background.js +2 -2
- package/src/modifiers/border.js +2 -2
- package/src/modifiers/cursor.js +2 -2
- package/src/modifiers/display.js +2 -2
- package/src/modifiers/flex.js +2 -2
- package/src/modifiers/flexWrapper.js +2 -2
- package/src/modifiers/margin.js +2 -2
- package/src/modifiers/overflow.js +2 -2
- package/src/modifiers/padding.js +2 -2
- package/src/modifiers/position.js +2 -2
- package/src/modifiers/shadow.js +2 -2
- package/src/modifiers/size.js +2 -2
- package/src/modifiers/state.js +2 -2
- package/src/modifiers/text.js +2 -2
- package/src/theme/default/blackTheme.js +32 -21
- package/src/theme/default/cyberpunkTheme.js +24 -32
- package/src/theme/default/hackerTheme.js +23 -16
- package/src/theme/default/paperTheme.js +4 -0
- package/src/theme/default/themes.js +0 -9
- package/dist/components/structure/bottomDrawer/native/BottomDrawer.js +0 -1
- package/dist/components/structure/bottomDrawer/native/DrawerContext.js +0 -1
- package/dist/components/structure/bottomDrawer/native/DrawerHandle.js +0 -1
- package/dist/components/structure/bottomDrawer/native/createDrawerScrollComponent.js +0 -1
- package/dist/components/structure/bottomDrawer/web/BottomDrawer.js +0 -1
- package/dist/components/structure/drawer/Drawer.js +0 -1
- package/dist/components/structure/modal/Modal.js +0 -1
- package/dist/components/structure/modal/Modal.native.js +0 -1
- package/dist/components/structure/modal/ModalBackdrop.js +0 -1
- package/dist/components/structure/modal/ModalContent.js +0 -1
- package/dist/components/structure/modal/ModalFooter.js +0 -1
- package/dist/components/structure/modal/ModalHeader.js +0 -1
- package/dist/components/structure/modal/handler/ModalsHandler.js +0 -1
- package/dist/theme/default/deepWoodsTheme.js +0 -1
- package/dist/theme/default/forestTheme.js +0 -1
- package/dist/theme/default/midnightTheme.js +0 -1
- package/dist/theme/default/msdosTheme.js +0 -1
- package/dist/theme/default/oceanTheme.js +0 -1
- package/dist/theme/default/pastelTheme.js +0 -1
- package/dist/theme/default/sunsetTheme.js +0 -1
- package/src/theme/default/deepWoodsTheme.js +0 -34
- package/src/theme/default/forestTheme.js +0 -34
- package/src/theme/default/midnightTheme.js +0 -34
- package/src/theme/default/msdosTheme.js +0 -54
- package/src/theme/default/oceanTheme.js +0 -34
- package/src/theme/default/pastelTheme.js +0 -34
- package/src/theme/default/sunsetTheme.js +0 -35
- /package/dist/components/{structure → modals}/bottomDrawer/index.js +0 -0
- /package/dist/components/{structure → modals}/bottomDrawer/index.native.js +0 -0
- /package/dist/components/{structure → modals}/bottomDrawer/index.web.js +0 -0
- /package/dist/components/{structure → modals}/bottomDrawer/native/DrawerScrollView.js +0 -0
- /package/dist/components/{structure → modals}/bottomDrawer/native/utils.js +0 -0
- /package/dist/components/{structure → modals}/drawer/Drawer.native.js +0 -0
- /package/dist/components/{structure → modals}/drawer/Drawer.web.js +0 -0
- /package/dist/components/{structure → modals}/drawer/index.js +0 -0
- /package/dist/components/{structure → modals}/modal/index.js +0 -0
- /package/src/components/{structure → modals}/bottomDrawer/index.js +0 -0
- /package/src/components/{structure → modals}/bottomDrawer/index.native.js +0 -0
- /package/src/components/{structure → modals}/bottomDrawer/index.web.js +0 -0
- /package/src/components/{structure → modals}/bottomDrawer/native/DrawerContext.js +0 -0
- /package/src/components/{structure → modals}/bottomDrawer/native/DrawerScrollView.js +0 -0
- /package/src/components/{structure → modals}/bottomDrawer/native/createDrawerScrollComponent.js +0 -0
- /package/src/components/{structure → modals}/bottomDrawer/native/utils.js +0 -0
- /package/src/components/{structure → modals}/bottomDrawer/web/BottomDrawer.js +0 -0
- /package/src/components/{structure → modals}/drawer/Drawer.js +0 -0
- /package/src/components/{structure → modals}/drawer/Drawer.native.js +0 -0
- /package/src/components/{structure → modals}/drawer/Drawer.web.js +0 -0
- /package/src/components/{structure → modals}/drawer/index.js +0 -0
- /package/src/components/{structure → modals}/modal/Modal.js +0 -0
- /package/src/components/{structure → modals}/modal/handler/ModalsHandler.js +0 -0
- /package/src/components/{structure → modals}/modal/index.js +0 -0
package/dist/modifiers/shadow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["shadow"];import{clearProps}from"./_helpers";import{useGetColor}from"../theme/ThemeHandler";export function useShadowModifier(_ref){var _ref2=_slicedToArray(_ref,2),values=_ref2[0],props=_ref2[1];var getColor=useGetColor();var shadow=props.shadow,restProps=_objectWithoutProperties(props,_excluded);var boxShadow,shadowRadius,shadowOffset,shadowOpacity,shadowColor,elevation;if(shadow===true){shadow=getColor('shadow');}else if(!!shadow){shadow=getColor(shadow);}if(!!shadow){boxShadow=`0 1px 10px ${shadow}`;shadowRadius=10;shadowOffset={width:0,height:1};shadowOpacity=1;elevation=10;shadowColor=shadow;}var style=clearProps({boxShadow:boxShadow,shadowRadius:shadowRadius,shadowOffset:shadowOffset,shadowOpacity:shadowOpacity,shadowColor:shadowColor,elevation:elevation});return[values,Object.assign({},restProps,{style:Object.assign({},props.style,style)})];}
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["shadow"];import{clearProps,flattenStyle}from"./_helpers";import{useGetColor}from"../theme/ThemeHandler";export function useShadowModifier(_ref){var _ref2=_slicedToArray(_ref,2),values=_ref2[0],props=_ref2[1];var getColor=useGetColor();var shadow=props.shadow,restProps=_objectWithoutProperties(props,_excluded);var boxShadow,shadowRadius,shadowOffset,shadowOpacity,shadowColor,elevation;if(shadow===true){shadow=getColor('shadow');}else if(!!shadow){shadow=getColor(shadow);}if(!!shadow){boxShadow=`0 1px 10px ${shadow}`;shadowRadius=10;shadowOffset={width:0,height:1};shadowOpacity=1;elevation=10;shadowColor=shadow;}var style=clearProps({boxShadow:boxShadow,shadowRadius:shadowRadius,shadowOffset:shadowOffset,shadowOpacity:shadowOpacity,shadowColor:shadowColor,elevation:elevation});return[values,Object.assign({},restProps,{style:Object.assign({},flattenStyle(props.style),style)})];}
|
package/dist/modifiers/size.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["width","height","minH","minHeight","maxH","maxHeight","minWidth","minW","maxWidth","maxW","fullWidth","fullW","fullHeight","fullH","ratio","square","span","parentSpan"];import{Platform}from"../abstractions/Platform";import{clearProps}from"./_helpers";import{useGetElementHeight}from"../theme/ThemeHandler";export function useSizeModifier(_ref){var _span;var _ref2=_slicedToArray(_ref,2),values=_ref2[0],props=_ref2[1];var getHeight=useGetElementHeight();var _ref3=props||{},width=_ref3.width,height=_ref3.height,minH=_ref3.minH,minHeight=_ref3.minHeight,maxH=_ref3.maxH,maxHeight=_ref3.maxHeight,minWidth=_ref3.minWidth,minW=_ref3.minW,maxWidth=_ref3.maxWidth,maxW=_ref3.maxW,fullWidth=_ref3.fullWidth,fullW=_ref3.fullW,fullHeight=_ref3.fullHeight,fullH=_ref3.fullH,ratio=_ref3.ratio,square=_ref3.square,span=_ref3.span,parentSpan=_ref3.parentSpan,restProps=_objectWithoutProperties(_ref3,_excluded);minHeight=getHeight(minHeight||minH);minWidth=getHeight(minWidth||minW);maxHeight=getHeight(maxHeight||maxH);maxWidth=getHeight(maxWidth||maxW);height=getHeight(height);width=getHeight(width);span=(_span=span)!=null?_span:parentSpan;if(span)width=span/24*100+'%';if(fullWidth||fullW)width='100%';if((fullHeight||fullH)&&Platform.OS==='web')height='100%';var aspectRatio=ratio;if(!!square)aspectRatio=1;var style=clearProps({height:height,width:width,minHeight:minHeight,minHeight:minHeight,maxHeight:maxHeight,minWidth:minWidth,maxWidth:maxWidth,aspectRatio:aspectRatio});return[values,Object.assign({},restProps,{style:Object.assign({},props.style,style)})];}
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["width","height","minH","minHeight","maxH","maxHeight","minWidth","minW","maxWidth","maxW","fullWidth","fullW","fullHeight","fullH","ratio","square","span","parentSpan"];import{Platform}from"../abstractions/Platform";import{clearProps,flattenStyle}from"./_helpers";import{useGetElementHeight}from"../theme/ThemeHandler";export function useSizeModifier(_ref){var _span;var _ref2=_slicedToArray(_ref,2),values=_ref2[0],props=_ref2[1];var getHeight=useGetElementHeight();var _ref3=props||{},width=_ref3.width,height=_ref3.height,minH=_ref3.minH,minHeight=_ref3.minHeight,maxH=_ref3.maxH,maxHeight=_ref3.maxHeight,minWidth=_ref3.minWidth,minW=_ref3.minW,maxWidth=_ref3.maxWidth,maxW=_ref3.maxW,fullWidth=_ref3.fullWidth,fullW=_ref3.fullW,fullHeight=_ref3.fullHeight,fullH=_ref3.fullH,ratio=_ref3.ratio,square=_ref3.square,span=_ref3.span,parentSpan=_ref3.parentSpan,restProps=_objectWithoutProperties(_ref3,_excluded);minHeight=getHeight(minHeight||minH);minWidth=getHeight(minWidth||minW);maxHeight=getHeight(maxHeight||maxH);maxWidth=getHeight(maxWidth||maxW);height=getHeight(height);width=getHeight(width);span=(_span=span)!=null?_span:parentSpan;if(span)width=span/24*100+'%';if(fullWidth||fullW)width='100%';if((fullHeight||fullH)&&Platform.OS==='web')height='100%';var aspectRatio=ratio;if(!!square)aspectRatio=1;var style=clearProps({height:height,width:width,minHeight:minHeight,minHeight:minHeight,maxHeight:maxHeight,minWidth:minWidth,maxWidth:maxWidth,aspectRatio:aspectRatio});return[values,Object.assign({},restProps,{style:Object.assign({},flattenStyle(props.style),style)})];}
|
package/dist/modifiers/state.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["disabled","loading","onClick","onPress","onChange"];import{clearProps}from"./_helpers";export function useStateModifier(_ref){var _ref2=_slicedToArray(_ref,2),values=_ref2[0],props=_ref2[1];var disabled=props.disabled,loading=props.loading,onClick=props.onClick,onPress=props.onPress,onChange=props.onChange,restProps=_objectWithoutProperties(props,_excluded);var cursor=undefined;var opacity=props.opacity;if(!!disabled){opacity=0.3;onChange=undefined;cursor='not-allowed';}if(!!disabled||!!loading){onPress=undefined;onClick=undefined;}var style=clearProps({opacity:opacity,cursor:cursor});var newProps=clearProps({onPress:onPress,onClick:onClick,onChange:onChange});return[Object.assign({disabled:disabled,loading:loading},values),Object.assign({},newProps,restProps,{style:Object.assign({},props.style,style)})];}
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["disabled","loading","onClick","onPress","onChange"];import{clearProps,flattenStyle}from"./_helpers";export function useStateModifier(_ref){var _ref2=_slicedToArray(_ref,2),values=_ref2[0],props=_ref2[1];var disabled=props.disabled,loading=props.loading,onClick=props.onClick,onPress=props.onPress,onChange=props.onChange,restProps=_objectWithoutProperties(props,_excluded);var cursor=undefined;var opacity=props.opacity;if(!!disabled){opacity=0.3;onChange=undefined;cursor='not-allowed';}if(!!disabled||!!loading){onPress=undefined;onClick=undefined;}var style=clearProps({opacity:opacity,cursor:cursor});var newProps=clearProps({onPress:onPress,onClick:onClick,onChange:onChange});return[Object.assign({disabled:disabled,loading:loading},values),Object.assign({},newProps,restProps,{style:Object.assign({},flattenStyle(props.style),style)})];}
|
package/dist/modifiers/text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectDestructuringEmpty from"@babel/runtime/helpers/objectDestructuringEmpty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["color","textCode"],_excluded2=["opacity","bold","strong","fontWeight","weight","italic","underline","lineHeight","align","center","toRight","inherit","fontSize"];import{clearProps}from"./_helpers";import{mergePreset}from"../theme/helpers/mergePreset";import{useGetColor,useTexts}from"../theme/ThemeHandler";export function useTextModifier(_ref){var _ref2=_slicedToArray(_ref,2),_ref2$=_ref2[0],color=_ref2$.color,textCode=_ref2$.textCode,values=_objectWithoutProperties(_ref2$,_excluded),props=Object.assign({},(_objectDestructuringEmpty(_ref2[1]),_ref2[1]));var getColor=useGetColor();var texts=useTexts();if(!textCode&&!props.inherit)textCode='p';var _mergePreset=mergePreset(texts,textCode,props,'p'),opacity=_mergePreset.opacity,bold=_mergePreset.bold,strong=_mergePreset.strong,fontWeight=_mergePreset.fontWeight,weight=_mergePreset.weight,italic=_mergePreset.italic,underline=_mergePreset.underline,lineHeight=_mergePreset.lineHeight,align=_mergePreset.align,center=_mergePreset.center,toRight=_mergePreset.toRight,inherit=_mergePreset.inherit,fontSize=_mergePreset.fontSize,restProps=_objectWithoutProperties(_mergePreset,_excluded2);var fontStyle;if(italic)fontStyle='italic';var textDecorationLine;if(underline)textDecorationLine='underline';var textAlign=align;if(center)textAlign='center';if(toRight)textAlign='right';fontWeight=fontWeight||weight;if(bold||strong)fontWeight=600;var style=clearProps({fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:lineHeight,textAlign:textAlign,opacity:opacity,color:color,fontSize:fontSize});return[values,Object.assign({},restProps,{style:Object.assign({},props.style,style)})];}
|
|
1
|
+
import _objectDestructuringEmpty from"@babel/runtime/helpers/objectDestructuringEmpty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["color","textCode"],_excluded2=["opacity","bold","strong","fontWeight","weight","italic","underline","lineHeight","align","center","toRight","inherit","fontSize"];import{clearProps,flattenStyle}from"./_helpers";import{mergePreset}from"../theme/helpers/mergePreset";import{useGetColor,useTexts}from"../theme/ThemeHandler";export function useTextModifier(_ref){var _ref2=_slicedToArray(_ref,2),_ref2$=_ref2[0],color=_ref2$.color,textCode=_ref2$.textCode,values=_objectWithoutProperties(_ref2$,_excluded),props=Object.assign({},(_objectDestructuringEmpty(_ref2[1]),_ref2[1]));var getColor=useGetColor();var texts=useTexts();if(!textCode&&!props.inherit)textCode='p';var _mergePreset=mergePreset(texts,textCode,props,'p'),opacity=_mergePreset.opacity,bold=_mergePreset.bold,strong=_mergePreset.strong,fontWeight=_mergePreset.fontWeight,weight=_mergePreset.weight,italic=_mergePreset.italic,underline=_mergePreset.underline,lineHeight=_mergePreset.lineHeight,align=_mergePreset.align,center=_mergePreset.center,toRight=_mergePreset.toRight,inherit=_mergePreset.inherit,fontSize=_mergePreset.fontSize,restProps=_objectWithoutProperties(_mergePreset,_excluded2);var fontStyle;if(italic)fontStyle='italic';var textDecorationLine;if(underline)textDecorationLine='underline';var textAlign=align;if(center)textAlign='center';if(toRight)textAlign='right';fontWeight=fontWeight||weight;if(bold||strong)fontWeight=600;var style=clearProps({fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:lineHeight,textAlign:textAlign,opacity:opacity,color:color,fontSize:fontSize});return[values,Object.assign({},restProps,{style:Object.assign({},flattenStyle(props.style),style)})];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeDeepRight}from'ramda';import{BASE_THEME}from"./base";export var DEFAULT_BLACK_THEME=mergeDeepRight(BASE_THEME,{label:'Pitch Black',colors:{primary:'#818DF9',text:'#
|
|
1
|
+
import{mergeDeepRight}from'ramda';import{BASE_THEME}from"./base";export var DEFAULT_BLACK_THEME=mergeDeepRight(BASE_THEME,{label:'Pitch Black',colors:{primary:'#818DF9',text:'#F2F2F2',text2:'#CFCFCF',text3:'#A6A6A6',text4:'#737373',mainBG:'#0A0A0A',overlayBG:'#141414',backdrop:'#1f1f1f',shadow:'rgba(0, 0, 0, 0.7)',transparent:'rgba(0, 0, 0, 0)',divider:'#262626',blue:'#3A7BFF',yellow:'#FFC857',green:'#2ECC71',purple:'#9B5DE5',orange:'#FF8C42',cyan:'#00C2D1',red:'#FF4D4F',navy:'#1F2A44',indigo:'#5C6BC0',gray:'#8E8E93',brown:'#8B5E3C',lylac:'#C77DFF',pink:'#FF6FAE'}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeDeepRight}from'ramda';import{BASE_THEME}from"./base";export var CYBERPUNK_DARK_THEME=mergeDeepRight(BASE_THEME,{label:'Cyberpunk',colors:{primary:'#
|
|
1
|
+
import{mergeDeepRight}from'ramda';import{BASE_THEME}from"./base";export var CYBERPUNK_DARK_THEME=mergeDeepRight(BASE_THEME,{label:'Cyberpunk',colors:{primary:'#FF4FD8',text:'#F5EFFF',text2:'#D6C8FF',text3:'#A78BFA',text4:'#7C6BB3',mainBG:'#0A0614',overlayBG:'#140A26',backdrop:'#0A0A0F',shadow:'rgba(0, 0, 0, 0.7)',transparent:'rgba(0, 0, 0, 0)',divider:'#24123A',blue:'#00B3FF',yellow:'#FFD166',green:'#00F5A0',purple:'#9D4EDD',orange:'#FF7A18',cyan:'#00E5FF',red:'#FF3D6E',navy:'#1B1B3A',indigo:'#5A67FF',gray:'#8E8EAA',brown:'#8B5CF6',lylac:'#C77DFF',pink:'#FF4FD8'}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeDeepRight}from'ramda';import{BASE_THEME}from"./base";export var DEFAULT_MATRIX_THEME=mergeDeepRight(BASE_THEME,{label:'Hacker',colors:{primary:'#00FF41',text:'#
|
|
1
|
+
import{mergeDeepRight}from'ramda';import{BASE_THEME}from"./base";export var DEFAULT_MATRIX_THEME=mergeDeepRight(BASE_THEME,{label:'Hacker',colors:{primary:'#00FF41',text:'#D2FFE9',text2:'#A6F5D0',text3:'#6EE7B7',text4:'#3FAF85',mainBG:'#000000',overlayBG:'#0A0A0A',backdrop:'#000000',shadow:'rgba(0, 255, 65, 0.2)',transparent:'rgba(0, 0, 0, 0)',divider:'rgba(0,255,65, 0.3)',blue:'#00B3FF',yellow:'#E6FF3F',green:'#00FF41',purple:'#9B5DE5',orange:'#FF9F1C',cyan:'#00FFE0',red:'#FF3B3B',navy:'#001F2F',indigo:'#4B6BFF',gray:'#2E2E2E',brown:'#5C4033',lylac:'#C084FC',pink:'#FF4FD8'},radius:{xxxs:0,xxs:1,xs:2,sm:3,md:4,lg:5,xl:6,xxl:7,xxxl:8},components:{Card:{border:true},Section:{border:true}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeDeepRight}from'ramda';import{BASE_THEME}from"./base";export var DEFAULT_PAPER_THEME=mergeDeepRight(BASE_THEME,{label:'Paper',colors:{primary:'#5A5A5A',text:'#000000',text2:'#333333',text3:'#555555',text4:'#777777',mainBG:'#F8F1E3',overlayBG:'#F8F1E3',backdrop:'#383E44',shadow:'rgba(0, 0, 0, 0.04)',divider:'#E3D9C9',blue:'#6B8EAE',yellow:'#EADCA6',green:'#88A288',purple:'#A391B8',orange:'#D9A066',cyan:'#9CC9C2',red:'#B85C5C',navy:'#4A4A4A',indigo:'#70788C',gray:'#B8B8B8',brown:'#8B7355',lylac:'#C7B7D4',pink:'#E4A1B2'},components:{Card:{border:true},Section:{border:true}}});
|
|
1
|
+
import{mergeDeepRight}from'ramda';import{BASE_THEME}from"./base";export var DEFAULT_PAPER_THEME=mergeDeepRight(BASE_THEME,{label:'Paper',colors:{primary:'#5A5A5A',text:'#000000',text2:'#333333',text3:'#555555',text4:'#777777',mainBG:'#F8F1E3',overlayBG:'#F8F1E3',backdrop:'#383E44',shadow:'rgba(0, 0, 0, 0.04)',divider:'#E3D9C9',blue:'#6B8EAE',yellow:'#EADCA6',green:'#88A288',purple:'#A391B8',orange:'#D9A066',cyan:'#9CC9C2',red:'#B85C5C',navy:'#4A4A4A',indigo:'#70788C',gray:'#B8B8B8',brown:'#8B7355',lylac:'#C7B7D4',pink:'#E4A1B2'},components:{Card:{border:true},Section:{border:true},TopBar:{borderB:true}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CYBERPUNK_DARK_THEME}from"./cyberpunkTheme";import{DEFAULT_BLACK_THEME}from"./blackTheme";import{DEFAULT_DARK_THEME}from"./darkTheme";import{DEFAULT_LIGHT_THEME}from"./lightTheme";import{DEFAULT_MATRIX_THEME}from"./hackerTheme";import{
|
|
1
|
+
import{CYBERPUNK_DARK_THEME}from"./cyberpunkTheme";import{DEFAULT_BLACK_THEME}from"./blackTheme";import{DEFAULT_DARK_THEME}from"./darkTheme";import{DEFAULT_LIGHT_THEME}from"./lightTheme";import{DEFAULT_MATRIX_THEME}from"./hackerTheme";import{DEFAULT_PAPER_THEME}from"./paperTheme";export var DEFAULT_THEMES={light:DEFAULT_LIGHT_THEME,dark:DEFAULT_DARK_THEME,paper:DEFAULT_PAPER_THEME,black:DEFAULT_BLACK_THEME,cyberpunk:CYBERPUNK_DARK_THEME,hacker:DEFAULT_MATRIX_THEME};
|
package/package.json
CHANGED
package/src/NekoUI.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicStyleTag } from './DynamicStyleTag'
|
|
2
2
|
import { I18nProvider } from './i18n'
|
|
3
|
-
import { ModalsHandler } from './components/
|
|
3
|
+
import { ModalsHandler } from './components/modals/modal/handler/ModalsHandler'
|
|
4
4
|
import { NotificationsHandler } from './components/feedback/notifications/NotificationsHandler'
|
|
5
5
|
import { OverlayHandler } from './components/structure/overlay/OverlayHandler'
|
|
6
6
|
import { PortalHandler } from './components/helpers/PortalHandler'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FlatList } from 'react-native'
|
|
2
2
|
|
|
3
3
|
export const AbsFlatList = ({
|
|
4
|
-
style: { height, width, ...style },
|
|
4
|
+
style: { height, width, flex, ...style },
|
|
5
5
|
ItemSeparatorComponent,
|
|
6
6
|
Separator,
|
|
7
7
|
renderSeparator,
|
|
@@ -25,6 +25,7 @@ export const AbsFlatList = ({
|
|
|
25
25
|
<FlatList
|
|
26
26
|
height={height}
|
|
27
27
|
width={width}
|
|
28
|
+
style={{ flex }}
|
|
28
29
|
{...props}
|
|
29
30
|
ItemSeparatorComponent={ItemSeparatorComponent}
|
|
30
31
|
ListEmptyComponent={ListEmptyComponent}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScrollView } from 'react-native'
|
|
2
2
|
|
|
3
|
-
export const AbsScrollView = ({ style: { height, width, ...style }, ...props }) => {
|
|
4
|
-
return <ScrollView height={height} width={width} {...props} contentContainerStyle={style} />
|
|
3
|
+
export const AbsScrollView = ({ style: { height, width, flex, ...style }, ...props }) => {
|
|
4
|
+
return <ScrollView height={height} width={width} style={{ flex }} {...props} contentContainerStyle={style} />
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { pipe } from 'ramda'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { DrawerScrollView } from '../
|
|
3
|
+
import { TopBar, View } from '../structure'
|
|
4
|
+
import { BottomDrawer, DrawerScrollView } from '../modals/bottomDrawer'
|
|
5
5
|
import { Menu } from './menu/Menu'
|
|
6
6
|
import { Section } from '../sections'
|
|
7
7
|
import { useDefaultModifier } from '../../modifiers/default'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { pipe } from 'ramda'
|
|
2
2
|
|
|
3
|
+
import { DrawerScrollView } from '../modals'
|
|
3
4
|
import { IconLabel } from '../presentation/IconLabel'
|
|
4
5
|
import { Link } from './Link'
|
|
5
6
|
import { Menu } from './menu/Menu'
|
|
6
7
|
import { Popover } from '../structure/popover/Popover'
|
|
7
|
-
import { ScrollView } from '../list'
|
|
8
8
|
import { View } from '../structure/View'
|
|
9
9
|
import { useResponsiveValue } from '../../responsive'
|
|
10
10
|
import { useThemeComponentModifier } from '../../modifiers/themeComponent'
|
|
@@ -59,7 +59,7 @@ export function Dropdown({ items, ...rootProps }) {
|
|
|
59
59
|
onClose()
|
|
60
60
|
}
|
|
61
61
|
return (
|
|
62
|
-
<
|
|
62
|
+
<DrawerScrollView>
|
|
63
63
|
<Menu
|
|
64
64
|
vertical
|
|
65
65
|
items={items}
|
|
@@ -68,7 +68,7 @@ export function Dropdown({ items, ...rootProps }) {
|
|
|
68
68
|
linkMinHeight={useBottomDrawer ? 'xl' : 'md'}
|
|
69
69
|
withDivider={useBottomDrawer}
|
|
70
70
|
/>
|
|
71
|
-
</
|
|
71
|
+
</DrawerScrollView>
|
|
72
72
|
)
|
|
73
73
|
}}
|
|
74
74
|
>
|
|
@@ -26,7 +26,7 @@ export function FloatingMenu({ fixed, onChange, items, activeIndex, size = 'md',
|
|
|
26
26
|
color={isActive ? 'primary' : 'text3'}
|
|
27
27
|
/>
|
|
28
28
|
{!!item.label && (
|
|
29
|
-
<Text size="xxs" center color={isActive ? 'primary' : 'text3'} strong>
|
|
29
|
+
<Text size="xxs" center color={isActive ? 'primary' : 'text3'} strong numberOfLines={1}>
|
|
30
30
|
{item.label}
|
|
31
31
|
</Text>
|
|
32
32
|
)}
|
|
@@ -2,7 +2,7 @@ import { is } from 'ramda'
|
|
|
2
2
|
|
|
3
3
|
import { Button } from '../actions'
|
|
4
4
|
import { Result } from '../presentation'
|
|
5
|
-
import { useModalOpener } from '../
|
|
5
|
+
import { useModalOpener } from '../modals/modal'
|
|
6
6
|
|
|
7
7
|
export function useAlerter() {
|
|
8
8
|
const { open } = useModalOpener()
|
|
@@ -5,7 +5,7 @@ import { Button } from '../actions'
|
|
|
5
5
|
import { RESULT_TYPES } from '../presentation/Result'
|
|
6
6
|
import { Result } from '../presentation'
|
|
7
7
|
import { View } from '../structure/View'
|
|
8
|
-
import { useModalOpener } from '../
|
|
8
|
+
import { useModalOpener } from '../modals/modal'
|
|
9
9
|
|
|
10
10
|
function Footer({ cancelLabel, confirmLabel, onConfirm, type, onClose }) {
|
|
11
11
|
const [loading, setLoading] = React.useState(false)
|
package/src/components/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { is } from 'ramda'
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
4
|
import { Col } from '../structure/Col'
|
|
5
|
-
import { DrawerFlatList } from '../
|
|
5
|
+
import { DrawerFlatList } from '../modals/bottomDrawer'
|
|
6
6
|
import { LoadingView } from '../state/LoadingView'
|
|
7
7
|
import { Row } from '../structure/Row'
|
|
8
8
|
import { View } from '../structure'
|
|
@@ -12,7 +12,7 @@ import React from 'react'
|
|
|
12
12
|
import { DrawerHandle } from './DrawerHandle'
|
|
13
13
|
import { DrawerProvider } from './DrawerContext'
|
|
14
14
|
import { Pressable } from '../../../actions/Pressable'
|
|
15
|
-
import { View } from '
|
|
15
|
+
import { View } from '../../../structure/View'
|
|
16
16
|
import { normalizeSnapPoints, findClosestSnapPoint } from './utils'
|
|
17
17
|
import { useColors } from '../../../../theme/ThemeHandler'
|
|
18
18
|
|
|
@@ -6,7 +6,7 @@ import { ModalContent } from './ModalContent'
|
|
|
6
6
|
import { ModalFooter } from './ModalFooter'
|
|
7
7
|
import { ModalHeader } from './ModalHeader'
|
|
8
8
|
import { Pressable } from '../../actions/Pressable'
|
|
9
|
-
import { View } from '
|
|
9
|
+
import { View } from '../../structure/View'
|
|
10
10
|
import { useDefaultModifier } from '../../../modifiers/default'
|
|
11
11
|
import { useThemeComponentModifier } from '../../../modifiers/themeComponent'
|
|
12
12
|
|
|
@@ -2,7 +2,7 @@ import { pipe } from 'ramda'
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
4
|
import { AnimatedView } from '../../animations/AnimatedView'
|
|
5
|
-
import { SafeAreaView } from '
|
|
5
|
+
import { SafeAreaView } from '../../structure/SafeAreaView'
|
|
6
6
|
import { useDefaultModifier } from '../../../modifiers/default'
|
|
7
7
|
import { useThemeComponentModifier } from '../../../modifiers/themeComponent'
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pipe } from 'ramda'
|
|
2
2
|
|
|
3
|
-
import { View } from '
|
|
3
|
+
import { View } from '../../structure/View'
|
|
4
4
|
import { moveScale } from '../../../theme/helpers/sizeScale'
|
|
5
5
|
import { useDefaultModifier } from '../../../modifiers/default'
|
|
6
6
|
import { useSizeConverter } from '../../../modifiers/sizeConverter'
|
|
@@ -3,7 +3,7 @@ import { pipe } from 'ramda'
|
|
|
3
3
|
import { Icon } from '../../presentation/Icon'
|
|
4
4
|
import { Link } from '../../actions/Link'
|
|
5
5
|
import { Text } from '../../text/Text'
|
|
6
|
-
import { View } from '
|
|
6
|
+
import { View } from '../../structure/View'
|
|
7
7
|
import { moveScale } from '../../../theme/helpers/sizeScale'
|
|
8
8
|
import { useDefaultModifier } from '../../../modifiers/default'
|
|
9
9
|
import { useSizeConverter } from '../../../modifiers/sizeConverter'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect } from 'react'
|
|
2
|
+
|
|
3
|
+
import { useModalsRouterContext } from './ModalsRouterContext'
|
|
4
|
+
|
|
5
|
+
export function ModalRoute({ name, component, type = 'modal', ...containerProps }) {
|
|
6
|
+
const { registerRoute, unregisterRoute } = useModalsRouterContext()
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!name || !registerRoute) return
|
|
10
|
+
registerRoute(name, { component, type, containerProps })
|
|
11
|
+
return () => unregisterRoute?.(name)
|
|
12
|
+
}, [name])
|
|
13
|
+
|
|
14
|
+
return null
|
|
15
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { BottomDrawer } from '../bottomDrawer'
|
|
4
|
+
import { Drawer } from '../drawer'
|
|
5
|
+
import { Modal } from '../modal/Modal'
|
|
6
|
+
import { ModalRouteContext, ModalsRouterContext, ModalsStackContext } from './ModalsRouterContext'
|
|
7
|
+
|
|
8
|
+
const CONTAINERS = {
|
|
9
|
+
modal: Modal,
|
|
10
|
+
drawer: Drawer,
|
|
11
|
+
bottomDrawer: BottomDrawer,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function ModalsRouter({ children }) {
|
|
15
|
+
const [stack, setStack] = useState([])
|
|
16
|
+
const [renderStack, setRenderStack] = useState([])
|
|
17
|
+
const [containerOverrides, setContainerOverrides] = useState({})
|
|
18
|
+
const keyRef = useRef(0)
|
|
19
|
+
const routesRef = useRef({})
|
|
20
|
+
|
|
21
|
+
const registerRoute = useCallback((name, config) => {
|
|
22
|
+
routesRef.current[name] = config
|
|
23
|
+
}, [])
|
|
24
|
+
|
|
25
|
+
const unregisterRoute = useCallback((name) => {
|
|
26
|
+
delete routesRef.current[name]
|
|
27
|
+
}, [])
|
|
28
|
+
|
|
29
|
+
const updateContainerProps = useCallback((key, props) => {
|
|
30
|
+
setContainerOverrides((prev) => ({
|
|
31
|
+
...prev,
|
|
32
|
+
[key]: { ...prev[key], ...props },
|
|
33
|
+
}))
|
|
34
|
+
}, [])
|
|
35
|
+
|
|
36
|
+
const push = useCallback((path, params) => {
|
|
37
|
+
const key = ++keyRef.current
|
|
38
|
+
const entry = { key, path, params }
|
|
39
|
+
setStack((prev) => [...prev, entry])
|
|
40
|
+
setRenderStack((prev) => [...prev, { ...entry, open: true }])
|
|
41
|
+
}, [])
|
|
42
|
+
|
|
43
|
+
const closeByKey = useCallback((key) => {
|
|
44
|
+
setStack((prev) => prev.filter((e) => e.key !== key))
|
|
45
|
+
setRenderStack((prev) => prev.map((e) => (e.key === key ? { ...e, open: false } : e)))
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
setRenderStack((prev) => prev.filter((e) => e.key !== key))
|
|
48
|
+
}, 600)
|
|
49
|
+
}, [])
|
|
50
|
+
|
|
51
|
+
const goBack = useCallback(() => {
|
|
52
|
+
setStack((prev) => {
|
|
53
|
+
if (prev.length === 0) return prev
|
|
54
|
+
const last = prev[prev.length - 1]
|
|
55
|
+
setRenderStack((rs) => rs.map((e) => (e.key === last.key ? { ...e, open: false } : e)))
|
|
56
|
+
setTimeout(() => {
|
|
57
|
+
setRenderStack((rs) => rs.filter((e) => e.key !== last.key))
|
|
58
|
+
}, 600)
|
|
59
|
+
return prev.slice(0, -1)
|
|
60
|
+
})
|
|
61
|
+
}, [])
|
|
62
|
+
|
|
63
|
+
const closeAll = useCallback(() => {
|
|
64
|
+
setStack([])
|
|
65
|
+
setRenderStack((prev) => {
|
|
66
|
+
const closing = prev.map((e) => ({ ...e, open: false }))
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
setRenderStack([])
|
|
69
|
+
}, 600)
|
|
70
|
+
return closing
|
|
71
|
+
})
|
|
72
|
+
}, [])
|
|
73
|
+
|
|
74
|
+
// Static — never changes, so consumers like useModalsNavigation
|
|
75
|
+
// and ModalRoute don't re-render when the stack changes
|
|
76
|
+
const actionsValue = useMemo(
|
|
77
|
+
() => ({ push, goBack, closeAll, registerRoute, unregisterRoute }),
|
|
78
|
+
[push, goBack, closeAll, registerRoute, unregisterRoute]
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
// Dynamic — only useAllModalsParams subscribes to this
|
|
82
|
+
const stackValue = useMemo(() => ({ stack }), [stack])
|
|
83
|
+
|
|
84
|
+
// Nest modals inside each other so each RN Modal presents from
|
|
85
|
+
// the previous modal's view controller (required for iOS stacking).
|
|
86
|
+
// Context providers go INSIDE Container children so they survive
|
|
87
|
+
// the Portal teleport on web (Portal re-mounts content at PortalHandler level).
|
|
88
|
+
const nestedModals = renderStack.reduceRight((inner, entry) => {
|
|
89
|
+
const route = routesRef.current[entry.path]
|
|
90
|
+
if (!route) return inner
|
|
91
|
+
|
|
92
|
+
const Container = CONTAINERS[route.type] || Modal
|
|
93
|
+
const Component = route.component
|
|
94
|
+
|
|
95
|
+
const overrides = containerOverrides[entry.key]
|
|
96
|
+
const updateContainer = (props) => updateContainerProps(entry.key, props)
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<Container key={entry.key} open={entry.open} onClose={() => closeByKey(entry.key)} {...route.containerProps} {...overrides}>
|
|
100
|
+
<ModalsRouterContext.Provider value={actionsValue}>
|
|
101
|
+
<ModalsStackContext.Provider value={stackValue}>
|
|
102
|
+
<ModalRouteContext.Provider value={{ params: entry.params, path: entry.path, key: entry.key, updateContainer }}>
|
|
103
|
+
<Component />
|
|
104
|
+
{inner}
|
|
105
|
+
</ModalRouteContext.Provider>
|
|
106
|
+
</ModalsStackContext.Provider>
|
|
107
|
+
</ModalsRouterContext.Provider>
|
|
108
|
+
</Container>
|
|
109
|
+
)
|
|
110
|
+
}, null)
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<ModalsRouterContext.Provider value={actionsValue}>
|
|
114
|
+
<ModalsStackContext.Provider value={stackValue}>
|
|
115
|
+
{children}
|
|
116
|
+
{nestedModals}
|
|
117
|
+
</ModalsStackContext.Provider>
|
|
118
|
+
</ModalsRouterContext.Provider>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
// Static context — actions that never change (push, goBack, etc.)
|
|
4
|
+
const ModalsRouterContext = React.createContext(null)
|
|
5
|
+
export const useModalsRouterContext = () => React.useContext(ModalsRouterContext) || {}
|
|
6
|
+
export { ModalsRouterContext }
|
|
7
|
+
|
|
8
|
+
// Dynamic context — stack data that changes on push/goBack
|
|
9
|
+
const ModalsStackContext = React.createContext(null)
|
|
10
|
+
export const useModalsStackContext = () => React.useContext(ModalsStackContext) || {}
|
|
11
|
+
export { ModalsStackContext }
|
|
12
|
+
|
|
13
|
+
// Per-entry context — params for each rendered modal
|
|
14
|
+
const ModalRouteContext = React.createContext(null)
|
|
15
|
+
export const useModalRouteContext = () => React.useContext(ModalRouteContext) || {}
|
|
16
|
+
export { ModalRouteContext }
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ModalsRouter } from './ModalsRouter'
|
|
2
|
+
export { ModalRoute } from './ModalRoute'
|
|
3
|
+
export { useModalsNavigation } from './useModalsNavigation'
|
|
4
|
+
export { useModalParams } from './useModalParams'
|
|
5
|
+
export { useAllModalsParams } from './useAllModalsParams'
|
|
6
|
+
export { useUpdateModalContainer } from './useUpdateModalContainer'
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { pipe } from 'ramda'
|
|
2
|
+
|
|
3
|
+
import { IconLabel } from '../presentation'
|
|
4
|
+
import { Link } from '../actions'
|
|
5
|
+
import { Menu } from '../actions/menu/Menu'
|
|
6
|
+
import { Popover } from '../structure/popover/Popover'
|
|
7
|
+
import { ScrollView } from '../list'
|
|
8
|
+
import { SectionItem } from './SectionItem'
|
|
9
|
+
import { useColorConverter } from '../../modifiers/colorConverter'
|
|
10
|
+
import { useDefaultModifier } from '../../modifiers/default'
|
|
11
|
+
import { useResponsiveValue } from '../../responsive'
|
|
12
|
+
import { useThemeComponentModifier } from '../../modifiers/themeComponent'
|
|
13
|
+
|
|
14
|
+
const DEFAULT_PROPS = {
|
|
15
|
+
paddingV: 'sm',
|
|
16
|
+
minH: 'md',
|
|
17
|
+
icon: 'arrow-down-s-fill',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function SectionItemDropdown({ children, value, valueLabel, items, onChange, ...rootProps }) {
|
|
21
|
+
const [{ color }, formattedProps] = pipe(
|
|
22
|
+
useColorConverter(),
|
|
23
|
+
useThemeComponentModifier('SectionItemDropdown'),
|
|
24
|
+
useDefaultModifier(DEFAULT_PROPS)
|
|
25
|
+
)([{}, rootProps])
|
|
26
|
+
|
|
27
|
+
let { icon, iconLabelProps, trigger = 'click', placement, popoverProps, useBottomDrawer, ...props } = formattedProps
|
|
28
|
+
|
|
29
|
+
useBottomDrawer = useResponsiveValue(useBottomDrawer || { native: true, sm: true, md: true })
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Popover
|
|
33
|
+
useParentMinWidth
|
|
34
|
+
placement={placement || 'bottomRight'}
|
|
35
|
+
trigger={trigger}
|
|
36
|
+
padding={0}
|
|
37
|
+
contentProps={{ padding: 0 }}
|
|
38
|
+
useBottomDrawer={useBottomDrawer}
|
|
39
|
+
{...popoverProps}
|
|
40
|
+
renderContent={({ onClose }) => {
|
|
41
|
+
const handleChange = (...params) => {
|
|
42
|
+
if (onChange) onChange(...params)
|
|
43
|
+
onClose()
|
|
44
|
+
}
|
|
45
|
+
return (
|
|
46
|
+
<ScrollView>
|
|
47
|
+
<Menu
|
|
48
|
+
vertical
|
|
49
|
+
items={items}
|
|
50
|
+
onChange={handleChange}
|
|
51
|
+
linkPaddingH={useBottomDrawer ? 'md' : 'sm'}
|
|
52
|
+
linkMinHeight={useBottomDrawer ? 'xl' : 'md'}
|
|
53
|
+
withDivider={useBottomDrawer}
|
|
54
|
+
/>
|
|
55
|
+
</ScrollView>
|
|
56
|
+
)
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
<Link className="neko-section-item-dropdown">
|
|
60
|
+
<SectionItem color={color} {...props}>
|
|
61
|
+
{children || (
|
|
62
|
+
<IconLabel gap={2} invert color={color} {...iconLabelProps} label={valueLabel || value} icon={icon} />
|
|
63
|
+
)}
|
|
64
|
+
</SectionItem>
|
|
65
|
+
</Link>
|
|
66
|
+
</Popover>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -7,9 +7,6 @@ export * from './SafeAreaView'
|
|
|
7
7
|
export * from './Card'
|
|
8
8
|
export * from './Row'
|
|
9
9
|
export * from './Col'
|
|
10
|
-
export * from './modal'
|
|
11
|
-
export * from './drawer'
|
|
12
|
-
export * from './bottomDrawer'
|
|
13
10
|
export * from './popover/Popover'
|
|
14
11
|
export * from './Segment'
|
|
15
12
|
export * from './TopBar'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import { BottomDrawer } from '
|
|
3
|
+
import { BottomDrawer } from '../../modals/bottomDrawer'
|
|
4
4
|
import { PopoverContent } from './PopoverContent'
|
|
5
5
|
import { useRegisterOverlay } from '../overlay/OverlayHandler'
|
|
6
6
|
import { useResponsiveValue } from '../../../responsive'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Modal, TouchableWithoutFeedback } from 'react-native'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
|
-
import { BottomDrawer } from '
|
|
4
|
+
import { BottomDrawer } from '../../modals/bottomDrawer'
|
|
5
5
|
import { PopoverContent } from './PopoverContent'
|
|
6
6
|
import { View } from '../View'
|
|
7
7
|
import { calculatePosition } from '../overlay/calculatePosition'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import { BottomDrawer } from '
|
|
3
|
+
import { BottomDrawer } from '../../modals/bottomDrawer'
|
|
4
4
|
import { PopoverContent } from './PopoverContent'
|
|
5
5
|
import { useRegisterOverlay } from '../overlay/OverlayHandler'
|
|
6
6
|
import { useResponsiveValue } from '../../../responsive'
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { BottomDrawer } from '../
|
|
2
|
-
import { ScrollView } from '../list/ScrollView'
|
|
1
|
+
import { BottomDrawer, DrawerScrollView } from '../modals/bottomDrawer'
|
|
3
2
|
import { ThemePicker } from './ThemePicker'
|
|
4
3
|
|
|
5
4
|
export function ThemePickerDrawer({ open, onClose, onChange }) {
|
|
6
5
|
return (
|
|
7
6
|
<BottomDrawer open={open} onClose={onClose} maxWidth={550} snapPoints={['50%', '85%']}>
|
|
8
|
-
<
|
|
7
|
+
<DrawerScrollView padding="md">
|
|
9
8
|
<ThemePicker onChange={onChange} />
|
|
10
|
-
</
|
|
9
|
+
</DrawerScrollView>
|
|
11
10
|
</BottomDrawer>
|
|
12
11
|
)
|
|
13
12
|
}
|