@draftbit/core 49.4.8 → 50.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/lib/commonjs/components/AccordionGroup.js +1 -1
  2. package/lib/commonjs/components/ActionSheet/ActionSheet.js +1 -1
  3. package/lib/commonjs/components/Button.js +1 -1
  4. package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
  5. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -1
  6. package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -1
  7. package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
  8. package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -1
  9. package/lib/commonjs/components/FormRow.js +1 -1
  10. package/lib/commonjs/components/IconButton.js +1 -1
  11. package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +1 -1
  12. package/lib/commonjs/components/MediaPlayer/MediaPlaybackWrapper.js +1 -1
  13. package/lib/commonjs/components/Picker/NativePicker.js +1 -1
  14. package/lib/commonjs/components/Picker/PickerInputContainer.js +1 -1
  15. package/lib/commonjs/components/Portal/PortalHost.js +1 -1
  16. package/lib/commonjs/components/Progress/CircularProgress/CircularProgress.js +1 -1
  17. package/lib/commonjs/components/Progress/IndeterminateProgress.js +1 -1
  18. package/lib/commonjs/components/Progress/LinearProgress/LinearProgress.js +1 -1
  19. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
  20. package/lib/commonjs/components/Row.js +1 -1
  21. package/lib/commonjs/components/Slider.js +1 -1
  22. package/lib/commonjs/components/StarRating.js +1 -1
  23. package/lib/commonjs/components/StepIndicator.js +1 -1
  24. package/lib/commonjs/components/Stepper.js +1 -1
  25. package/lib/commonjs/components/SwipeableItem/SwipeableItem.js +1 -1
  26. package/lib/commonjs/components/SwipeableItem/SwipeableList.js +1 -1
  27. package/lib/commonjs/components/TabView/TabView.js +1 -1
  28. package/lib/commonjs/components/Table/Table.js +1 -1
  29. package/lib/commonjs/components/TextField.js +1 -1
  30. package/lib/commonjs/deprecated-components/AccordionItem.js +1 -1
  31. package/lib/commonjs/deprecated-components/AvatarEdit.js +1 -1
  32. package/lib/commonjs/deprecated-components/Banner.js +1 -1
  33. package/lib/commonjs/deprecated-components/Card.js +1 -1
  34. package/lib/commonjs/deprecated-components/CircularProgress.js +1 -1
  35. package/lib/commonjs/deprecated-components/DeprecatedButton.js +1 -1
  36. package/lib/commonjs/deprecated-components/DeprecatedFAB.js +1 -1
  37. package/lib/commonjs/deprecated-components/FieldSearchBarFull.js +1 -1
  38. package/lib/commonjs/deprecated-components/ProgressBar.js +1 -1
  39. package/lib/commonjs/deprecated-components/ProgressCircle.js +1 -1
  40. package/lib/commonjs/deprecated-components/RadioButtonFieldGroup.js +1 -1
  41. package/lib/commonjs/index.js +1 -1
  42. package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.d.ts +7722 -78
  43. package/lib/typescript/src/components/Progress/CircularProgress/CircularProgress.d.ts +1 -2
  44. package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.d.ts +1 -2
  45. package/lib/typescript/src/index.d.ts +1 -1
  46. package/lib/typescript/src/index.js +1 -1
  47. package/lib/typescript/src/index.js.map +1 -1
  48. package/lib/typescript/src/styles/DefaultTheme.d.ts +2574 -26
  49. package/lib/typescript/src/utilities.d.ts +2 -2
  50. package/lib/typescript/src/utilities.js.map +1 -1
  51. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  52. package/package.json +12 -11
  53. package/src/index.js +1 -1
  54. package/src/index.js.map +1 -1
  55. package/src/index.tsx +5 -1
  56. package/src/utilities.js.map +1 -1
  57. package/src/utilities.ts +2 -2
@@ -1 +1 @@
1
- import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/StepIndicator.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import React,{Component}from"react";import{View,Text,StyleSheet,Animated,TouchableWithoutFeedback}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var STEP_STATUS={CURRENT:"current",FINISHED:"finished",UNFINISHED:"unfinished"};var StepIndicator=function(_Component){_inherits(StepIndicator,_Component);var _super=_createSuper(StepIndicator);function StepIndicator(props){var _this;_classCallCheck(this,StepIndicator);_this=_super.call(this,props);_this.renderProgressBarBackground=function(){var _this$props=_this.props,stepCount=_this$props.stepCount,direction=_this$props.direction;var progressBarBackgroundStyle;if(direction==="vertical"){progressBarBackgroundStyle={backgroundColor:_this.state.customStyles.separatorUnFinishedColor,position:"absolute",left:(_this.state.width-_this.state.customStyles.separatorStrokeWidth)/2,top:_this.state.height/(2*stepCount),bottom:_this.state.height/(2*stepCount),width:_this.state.customStyles.separatorStrokeUnfinishedWidth===0?_this.state.customStyles.separatorStrokeWidth:_this.state.customStyles.separatorStrokeUnfinishedWidth};}else{progressBarBackgroundStyle={backgroundColor:_this.state.customStyles.separatorUnFinishedColor,position:"absolute",top:(_this.state.height-_this.state.customStyles.separatorStrokeWidth)/2,left:_this.state.width/(2*stepCount),right:_this.state.width/(2*stepCount),height:_this.state.customStyles.separatorStrokeUnfinishedWidth===0?_this.state.customStyles.separatorStrokeWidth:_this.state.customStyles.separatorStrokeUnfinishedWidth};}return _jsx(View,{onLayout:function onLayout(event){if(direction==="vertical"){_this.setState({progressBarSize:event.nativeEvent.layout.height},function(){_this.onCurrentPositionChanged(_this.props.currentPosition);});}else{_this.setState({progressBarSize:event.nativeEvent.layout.width},function(){_this.onCurrentPositionChanged(_this.props.currentPosition);});}},style:progressBarBackgroundStyle});};_this.renderProgressBar=function(){var _this$props2=_this.props,stepCount=_this$props2.stepCount,direction=_this$props2.direction;var progressBarStyle;if(direction==="vertical"){progressBarStyle={backgroundColor:_this.state.customStyles.separatorFinishedColor,position:"absolute",left:(_this.state.width-_this.state.customStyles.separatorStrokeWidth)/2,top:_this.state.height/(2*stepCount),bottom:_this.state.height/(2*stepCount),width:_this.state.customStyles.separatorStrokeFinishedWidth===0?_this.state.customStyles.separatorStrokeWidth:_this.state.customStyles.separatorStrokeFinishedWidth,height:_this.progressAnim};}else{progressBarStyle={backgroundColor:_this.state.customStyles.separatorFinishedColor,position:"absolute",top:(_this.state.height-_this.state.customStyles.separatorStrokeWidth)/2,left:_this.state.width/(2*stepCount),right:_this.state.width/(2*stepCount),height:_this.state.customStyles.separatorStrokeFinishedWidth===0?_this.state.customStyles.separatorStrokeWidth:_this.state.customStyles.separatorStrokeFinishedWidth,width:_this.progressAnim};}return _jsx(Animated.View,{style:progressBarStyle});};_this.renderStepIndicator=function(){var steps=[];var _this$props3=_this.props,stepCount=_this$props3.stepCount,direction=_this$props3.direction;var _loop=function _loop(position){steps.push(_jsx(TouchableWithoutFeedback,{onPress:function onPress(){return _this.stepPressed(position);},children:_jsx(View,{style:[styles.stepContainer,direction==="vertical"?{flexDirection:"column"}:{flexDirection:"row"}],children:_this.renderStep(position)})},position));};for(var position=0;position<stepCount;position++){_loop(position);}return _jsx(View,{onLayout:function onLayout(event){return _this.setState({width:event.nativeEvent.layout.width,height:event.nativeEvent.layout.height});},style:[styles.stepIndicatorContainer,direction==="vertical"?{flexDirection:"column",width:_this.state.customStyles.currentStepIndicatorSize}:{flexDirection:"row",height:_this.state.customStyles.currentStepIndicatorSize}],children:steps});};_this.renderStepLabels=function(){var _this$props4=_this.props,labels=_this$props4.labels,direction=_this$props4.direction,currentPosition=_this$props4.currentPosition,renderLabel=_this$props4.renderLabel;var labelViews=labels.map(function(label,index){var selectedStepLabelStyle=index===currentPosition?{color:_this.state.customStyles.currentStepLabelColor}:{color:_this.state.customStyles.labelColor};return _jsx(TouchableWithoutFeedback,{style:styles.stepLabelItem,onPress:function onPress(){return _this.stepPressed(index);},children:_jsx(View,{style:styles.stepLabelItem,children:renderLabel?renderLabel({position:index,stepStatus:_this.getStepStatus(index),label:label,currentPosition:currentPosition}):_jsx(Text,{style:[styles.stepLabel,selectedStepLabelStyle,{fontSize:_this.state.customStyles.labelSize,fontFamily:_this.state.customStyles.labelFontFamily}],children:label})})},index);});return _jsx(View,{style:[styles.stepLabelsContainer,direction==="vertical"?{flexDirection:"column",paddingHorizontal:4}:{flexDirection:"row",paddingVertical:4},{alignItems:_this.state.customStyles.labelAlign}],children:labelViews});};_this.renderStep=function(position){var renderStepIndicator=_this.props.renderStepIndicator;var stepStyle;var indicatorLabelStyle;switch(_this.getStepStatus(position)){case STEP_STATUS.CURRENT:{stepStyle={backgroundColor:_this.state.customStyles.stepIndicatorCurrentColor,borderWidth:_this.state.customStyles.currentStepStrokeWidth,borderColor:_this.state.customStyles.stepStrokeCurrentColor,height:_this.sizeAnim,width:_this.sizeAnim,borderRadius:_this.borderRadiusAnim};indicatorLabelStyle={fontSize:_this.state.customStyles.currentStepIndicatorLabelFontSize,color:_this.state.customStyles.stepIndicatorLabelCurrentColor};break;}case STEP_STATUS.FINISHED:{stepStyle={backgroundColor:_this.state.customStyles.stepIndicatorFinishedColor,borderWidth:_this.state.customStyles.stepStrokeWidth,borderColor:_this.state.customStyles.stepStrokeFinishedColor,height:_this.state.customStyles.stepIndicatorSize,width:_this.state.customStyles.stepIndicatorSize,borderRadius:_this.state.customStyles.stepIndicatorSize/2};indicatorLabelStyle={fontSize:_this.state.customStyles.stepIndicatorLabelFontSize,color:_this.state.customStyles.stepIndicatorLabelFinishedColor};break;}case STEP_STATUS.UNFINISHED:{stepStyle={backgroundColor:_this.state.customStyles.stepIndicatorUnFinishedColor,borderWidth:_this.state.customStyles.stepStrokeWidth,borderColor:_this.state.customStyles.stepStrokeUnFinishedColor,height:_this.state.customStyles.stepIndicatorSize,width:_this.state.customStyles.stepIndicatorSize,borderRadius:_this.state.customStyles.stepIndicatorSize/2};indicatorLabelStyle={overflow:"hidden",fontSize:_this.state.customStyles.stepIndicatorLabelFontSize,color:_this.state.customStyles.stepIndicatorLabelUnFinishedColor};break;}default:}return _jsx(Animated.View,{style:[styles.step,stepStyle],children:renderStepIndicator?renderStepIndicator({position:position,stepStatus:_this.getStepStatus(position)}):_jsx(Text,{style:indicatorLabelStyle,children:`${position+1}`})},"step-indicator");};_this.getStepStatus=function(stepPosition){var currentPosition=_this.props.currentPosition;if(stepPosition===currentPosition){return STEP_STATUS.CURRENT;}else if(stepPosition<currentPosition){return STEP_STATUS.FINISHED;}else{return STEP_STATUS.UNFINISHED;}};_this.onCurrentPositionChanged=function(position){var stepCount=_this.props.stepCount;if(position>stepCount-1){position=stepCount-1;}var animateToPosition=_this.state.progressBarSize/(stepCount-1)*position;_this.sizeAnim.setValue(_this.state.customStyles.stepIndicatorSize);_this.borderRadiusAnim.setValue(_this.state.customStyles.stepIndicatorSize/2);Animated.sequence([Animated.timing(_this.progressAnim,{toValue:animateToPosition,duration:200}),Animated.parallel([Animated.timing(_this.sizeAnim,{toValue:_this.state.customStyles.currentStepIndicatorSize,duration:100}),Animated.timing(_this.borderRadiusAnim,{toValue:_this.state.customStyles.currentStepIndicatorSize/2,duration:100})])]).start();};var defaultStyles={stepIndicatorSize:30,currentStepIndicatorSize:40,separatorStrokeWidth:3,separatorStrokeUnfinishedWidth:0,separatorStrokeFinishedWidth:0,currentStepStrokeWidth:5,stepStrokeWidth:0,stepStrokeCurrentColor:"#4aae4f",stepStrokeFinishedColor:"#4aae4f",stepStrokeUnFinishedColor:"#4aae4f",separatorFinishedColor:"#4aae4f",separatorUnFinishedColor:"#a4d4a5",stepIndicatorFinishedColor:"#4aae4f",stepIndicatorUnFinishedColor:"#a4d4a5",stepIndicatorCurrentColor:"#ffffff",stepIndicatorLabelFontSize:15,currentStepIndicatorLabelFontSize:15,stepIndicatorLabelCurrentColor:"#000000",stepIndicatorLabelFinishedColor:"#ffffff",stepIndicatorLabelUnFinishedColor:"rgba(255,255,255,0.5)",labelColor:"#000000",labelSize:13,labelAlign:"center",currentStepLabelColor:"#4aae4f"};var customStyles=Object.assign(defaultStyles,props.customStyles);_this.state={width:0,height:1,progressBarSize:-2,customStyles:customStyles};_this.progressAnim=new Animated.Value(0);_this.sizeAnim=new Animated.Value(_this.state.customStyles.stepIndicatorSize);_this.borderRadiusAnim=new Animated.Value(_this.state.customStyles.stepIndicatorSize/2);return _this;}_createClass(StepIndicator,[{key:"stepPressed",value:function stepPressed(position){if(this.props.onPress){this.props.onPress(position);}}},{key:"render",value:function render(){var _this$props5=this.props,labels=_this$props5.labels,direction=_this$props5.direction;return _jsxs(View,{style:[styles.container,direction==="vertical"?{flexDirection:"row",flex:1}:{flexDirection:"column"}],children:[this.state.width!==0&&this.renderProgressBarBackground(),this.state.width!==0&&this.renderProgressBar(),this.renderStepIndicator(),labels&&this.renderStepLabels()]});}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){if(prevProps.currentPosition!==this.props.currentPosition){this.onCurrentPositionChanged(this.props.currentPosition);}}}]);return StepIndicator;}(Component);export{StepIndicator as default};var styles=StyleSheet.create({container:{backgroundColor:"transparent"},stepIndicatorContainer:{flexDirection:"row",alignItems:"center",justifyContent:"space-around",backgroundColor:"transparent"},stepLabelsContainer:{justifyContent:"space-around"},step:{alignItems:"center",justifyContent:"center",zIndex:2},stepContainer:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center"},stepLabel:{fontSize:12,textAlign:"center",fontWeight:"500"},stepLabelItem:{flex:1,alignItems:"center",justifyContent:"center"}});StepIndicator.defaultProps={currentPosition:0,stepCount:5,customStyles:{},direction:"horizontal"};
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/StepIndicator.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import React,{Component}from"react";import{View,Text,StyleSheet,Animated,TouchableWithoutFeedback}from"react-native";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var STEP_STATUS={CURRENT:"current",FINISHED:"finished",UNFINISHED:"unfinished"};var StepIndicator=function(_Component){_inherits(StepIndicator,_Component);var _super=_createSuper(StepIndicator);function StepIndicator(props){var _this;_classCallCheck(this,StepIndicator);_this=_super.call(this,props);_this.renderProgressBarBackground=function(){var _this$props=_this.props,stepCount=_this$props.stepCount,direction=_this$props.direction;var progressBarBackgroundStyle;if(direction==="vertical"){progressBarBackgroundStyle={backgroundColor:_this.state.customStyles.separatorUnFinishedColor,position:"absolute",left:(_this.state.width-_this.state.customStyles.separatorStrokeWidth)/2,top:_this.state.height/(2*stepCount),bottom:_this.state.height/(2*stepCount),width:_this.state.customStyles.separatorStrokeUnfinishedWidth===0?_this.state.customStyles.separatorStrokeWidth:_this.state.customStyles.separatorStrokeUnfinishedWidth};}else{progressBarBackgroundStyle={backgroundColor:_this.state.customStyles.separatorUnFinishedColor,position:"absolute",top:(_this.state.height-_this.state.customStyles.separatorStrokeWidth)/2,left:_this.state.width/(2*stepCount),right:_this.state.width/(2*stepCount),height:_this.state.customStyles.separatorStrokeUnfinishedWidth===0?_this.state.customStyles.separatorStrokeWidth:_this.state.customStyles.separatorStrokeUnfinishedWidth};}return _jsx(View,{onLayout:function onLayout(event){if(direction==="vertical"){_this.setState({progressBarSize:event.nativeEvent.layout.height},function(){_this.onCurrentPositionChanged(_this.props.currentPosition);});}else{_this.setState({progressBarSize:event.nativeEvent.layout.width},function(){_this.onCurrentPositionChanged(_this.props.currentPosition);});}},style:progressBarBackgroundStyle});};_this.renderProgressBar=function(){var _this$props2=_this.props,stepCount=_this$props2.stepCount,direction=_this$props2.direction;var progressBarStyle;if(direction==="vertical"){progressBarStyle={backgroundColor:_this.state.customStyles.separatorFinishedColor,position:"absolute",left:(_this.state.width-_this.state.customStyles.separatorStrokeWidth)/2,top:_this.state.height/(2*stepCount),bottom:_this.state.height/(2*stepCount),width:_this.state.customStyles.separatorStrokeFinishedWidth===0?_this.state.customStyles.separatorStrokeWidth:_this.state.customStyles.separatorStrokeFinishedWidth,height:_this.progressAnim};}else{progressBarStyle={backgroundColor:_this.state.customStyles.separatorFinishedColor,position:"absolute",top:(_this.state.height-_this.state.customStyles.separatorStrokeWidth)/2,left:_this.state.width/(2*stepCount),right:_this.state.width/(2*stepCount),height:_this.state.customStyles.separatorStrokeFinishedWidth===0?_this.state.customStyles.separatorStrokeWidth:_this.state.customStyles.separatorStrokeFinishedWidth,width:_this.progressAnim};}return _jsx(Animated.View,{style:progressBarStyle});};_this.renderStepIndicator=function(){var steps=[];var _this$props3=_this.props,stepCount=_this$props3.stepCount,direction=_this$props3.direction;var _loop=function _loop(position){steps.push(_jsx(TouchableWithoutFeedback,{onPress:function onPress(){return _this.stepPressed(position);},children:_jsx(View,{style:[styles.stepContainer,direction==="vertical"?{flexDirection:"column"}:{flexDirection:"row"}],children:_this.renderStep(position)})},position));};for(var position=0;position<stepCount;position++){_loop(position);}return _jsx(View,{onLayout:function onLayout(event){return _this.setState({width:event.nativeEvent.layout.width,height:event.nativeEvent.layout.height});},style:[styles.stepIndicatorContainer,direction==="vertical"?{flexDirection:"column",width:_this.state.customStyles.currentStepIndicatorSize}:{flexDirection:"row",height:_this.state.customStyles.currentStepIndicatorSize}],children:steps});};_this.renderStepLabels=function(){var _this$props4=_this.props,labels=_this$props4.labels,direction=_this$props4.direction,currentPosition=_this$props4.currentPosition,renderLabel=_this$props4.renderLabel;var labelViews=labels.map(function(label,index){var selectedStepLabelStyle=index===currentPosition?{color:_this.state.customStyles.currentStepLabelColor}:{color:_this.state.customStyles.labelColor};return _jsx(TouchableWithoutFeedback,{style:styles.stepLabelItem,onPress:function onPress(){return _this.stepPressed(index);},children:_jsx(View,{style:styles.stepLabelItem,children:renderLabel?renderLabel({position:index,stepStatus:_this.getStepStatus(index),label:label,currentPosition:currentPosition}):_jsx(Text,{style:[styles.stepLabel,selectedStepLabelStyle,{fontSize:_this.state.customStyles.labelSize,fontFamily:_this.state.customStyles.labelFontFamily}],children:label})})},index);});return _jsx(View,{style:[styles.stepLabelsContainer,direction==="vertical"?{flexDirection:"column",paddingHorizontal:4}:{flexDirection:"row",paddingVertical:4},{alignItems:_this.state.customStyles.labelAlign}],children:labelViews});};_this.renderStep=function(position){var renderStepIndicator=_this.props.renderStepIndicator;var stepStyle;var indicatorLabelStyle;switch(_this.getStepStatus(position)){case STEP_STATUS.CURRENT:{stepStyle={backgroundColor:_this.state.customStyles.stepIndicatorCurrentColor,borderWidth:_this.state.customStyles.currentStepStrokeWidth,borderColor:_this.state.customStyles.stepStrokeCurrentColor,height:_this.sizeAnim,width:_this.sizeAnim,borderRadius:_this.borderRadiusAnim};indicatorLabelStyle={fontSize:_this.state.customStyles.currentStepIndicatorLabelFontSize,color:_this.state.customStyles.stepIndicatorLabelCurrentColor};break;}case STEP_STATUS.FINISHED:{stepStyle={backgroundColor:_this.state.customStyles.stepIndicatorFinishedColor,borderWidth:_this.state.customStyles.stepStrokeWidth,borderColor:_this.state.customStyles.stepStrokeFinishedColor,height:_this.state.customStyles.stepIndicatorSize,width:_this.state.customStyles.stepIndicatorSize,borderRadius:_this.state.customStyles.stepIndicatorSize/2};indicatorLabelStyle={fontSize:_this.state.customStyles.stepIndicatorLabelFontSize,color:_this.state.customStyles.stepIndicatorLabelFinishedColor};break;}case STEP_STATUS.UNFINISHED:{stepStyle={backgroundColor:_this.state.customStyles.stepIndicatorUnFinishedColor,borderWidth:_this.state.customStyles.stepStrokeWidth,borderColor:_this.state.customStyles.stepStrokeUnFinishedColor,height:_this.state.customStyles.stepIndicatorSize,width:_this.state.customStyles.stepIndicatorSize,borderRadius:_this.state.customStyles.stepIndicatorSize/2};indicatorLabelStyle={overflow:"hidden",fontSize:_this.state.customStyles.stepIndicatorLabelFontSize,color:_this.state.customStyles.stepIndicatorLabelUnFinishedColor};break;}default:}return _jsx(Animated.View,{style:[styles.step,stepStyle],children:renderStepIndicator?renderStepIndicator({position:position,stepStatus:_this.getStepStatus(position)}):_jsx(Text,{style:indicatorLabelStyle,children:`${position+1}`})},"step-indicator");};_this.getStepStatus=function(stepPosition){var currentPosition=_this.props.currentPosition;if(stepPosition===currentPosition){return STEP_STATUS.CURRENT;}else if(stepPosition<currentPosition){return STEP_STATUS.FINISHED;}else{return STEP_STATUS.UNFINISHED;}};_this.onCurrentPositionChanged=function(position){var stepCount=_this.props.stepCount;if(position>stepCount-1){position=stepCount-1;}var animateToPosition=_this.state.progressBarSize/(stepCount-1)*position;_this.sizeAnim.setValue(_this.state.customStyles.stepIndicatorSize);_this.borderRadiusAnim.setValue(_this.state.customStyles.stepIndicatorSize/2);Animated.sequence([Animated.timing(_this.progressAnim,{toValue:animateToPosition,duration:200}),Animated.parallel([Animated.timing(_this.sizeAnim,{toValue:_this.state.customStyles.currentStepIndicatorSize,duration:100}),Animated.timing(_this.borderRadiusAnim,{toValue:_this.state.customStyles.currentStepIndicatorSize/2,duration:100})])]).start();};var defaultStyles={stepIndicatorSize:30,currentStepIndicatorSize:40,separatorStrokeWidth:3,separatorStrokeUnfinishedWidth:0,separatorStrokeFinishedWidth:0,currentStepStrokeWidth:5,stepStrokeWidth:0,stepStrokeCurrentColor:"#4aae4f",stepStrokeFinishedColor:"#4aae4f",stepStrokeUnFinishedColor:"#4aae4f",separatorFinishedColor:"#4aae4f",separatorUnFinishedColor:"#a4d4a5",stepIndicatorFinishedColor:"#4aae4f",stepIndicatorUnFinishedColor:"#a4d4a5",stepIndicatorCurrentColor:"#ffffff",stepIndicatorLabelFontSize:15,currentStepIndicatorLabelFontSize:15,stepIndicatorLabelCurrentColor:"#000000",stepIndicatorLabelFinishedColor:"#ffffff",stepIndicatorLabelUnFinishedColor:"rgba(255,255,255,0.5)",labelColor:"#000000",labelSize:13,labelAlign:"center",currentStepLabelColor:"#4aae4f"};var customStyles=Object.assign(defaultStyles,props.customStyles);_this.state={width:0,height:1,progressBarSize:-2,customStyles:customStyles};_this.progressAnim=new Animated.Value(0);_this.sizeAnim=new Animated.Value(_this.state.customStyles.stepIndicatorSize);_this.borderRadiusAnim=new Animated.Value(_this.state.customStyles.stepIndicatorSize/2);return _this;}_createClass(StepIndicator,[{key:"stepPressed",value:function stepPressed(position){if(this.props.onPress){this.props.onPress(position);}}},{key:"render",value:function render(){var _this$props5=this.props,labels=_this$props5.labels,direction=_this$props5.direction;return _jsxs(View,{style:[styles.container,direction==="vertical"?{flexDirection:"row",flex:1}:{flexDirection:"column"}],children:[this.state.width!==0&&this.renderProgressBarBackground(),this.state.width!==0&&this.renderProgressBar(),this.renderStepIndicator(),labels&&this.renderStepLabels()]});}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){if(prevProps.currentPosition!==this.props.currentPosition){this.onCurrentPositionChanged(this.props.currentPosition);}}}]);return StepIndicator;}(Component);export{StepIndicator as default};var styles=StyleSheet.create({container:{backgroundColor:"transparent"},stepIndicatorContainer:{flexDirection:"row",alignItems:"center",justifyContent:"space-around",backgroundColor:"transparent"},stepLabelsContainer:{justifyContent:"space-around"},step:{alignItems:"center",justifyContent:"center",zIndex:2},stepContainer:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center"},stepLabel:{fontSize:12,textAlign:"center",fontWeight:"500"},stepLabelItem:{flex:1,alignItems:"center",justifyContent:"center"}});StepIndicator.defaultProps={currentPosition:0,stepCount:5,customStyles:{},direction:"horizontal"};
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Stepper.tsx";import React,{useEffect,useState}from"react";import{View,Text}from"react-native";import{isNumber}from"lodash";import{withTheme}from"../theming";import IconButton from"./IconButton";import{extractStyles}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Stepper=function Stepper(_ref){var _ref$min=_ref.min,min=_ref$min===void 0?-Infinity:_ref$min,_ref$max=_ref.max,max=_ref$max===void 0?Infinity:_ref$max,valueProp=_ref.value,defaultValue=_ref.defaultValue,style=_ref.style,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?24:_ref$iconSize,iconColor=_ref.iconColor,onChange=_ref.onChange,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,Icon=_ref.Icon;var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles,textStyles=_extractStyles.textStyles;var _useState=useState(defaultValue!=null?defaultValue:0),_useState2=_slicedToArray(_useState,2),value=_useState2[0],setValue=_useState2[1];var isValidValue=function isValidValue(valueArg){return valueArg>=min&&valueArg<=max;};var handlePlusOrMinus=function handlePlusOrMinus(type){var newValue=type==="plus"?value+1:value-1;if(isValidValue(newValue)){setValue(newValue);onChange==null?void 0:onChange(newValue);}};useEffect(function(){if(valueProp!=null&&isNumber(valueProp)&&valueProp!==value&&isValidValue(valueProp)){setValue(valueProp);}},[valueProp]);return _jsxs(View,{style:[{flexDirection:"row"},viewStyles],children:[_jsx(IconButton,{Icon:Icon,icon:"MaterialIcons/remove",onPress:function onPress(){return handlePlusOrMinus("minus");},size:iconSize,color:iconColor,disabled:value===min,style:{opacity:value===min?0.5:1}}),_jsx(Text,{style:[typography.body1,{textAlign:"center",alignSelf:"center",color:colors.medium,marginHorizontal:8},textStyles],children:value}),_jsx(IconButton,{Icon:Icon,icon:"MaterialIcons/add",onPress:function onPress(){return handlePlusOrMinus("plus");},size:iconSize,color:iconColor,disabled:value===max,style:{opacity:value===max?0.5:1}})]});};export default withTheme(Stepper);
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Stepper.tsx";import React,{useEffect,useState}from"react";import{View,Text}from"react-native";import{isNumber}from"lodash";import{withTheme}from"../theming";import IconButton from"./IconButton";import{extractStyles}from"../utilities";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var Stepper=function Stepper(_ref){var _ref$min=_ref.min,min=_ref$min===void 0?-Infinity:_ref$min,_ref$max=_ref.max,max=_ref$max===void 0?Infinity:_ref$max,valueProp=_ref.value,defaultValue=_ref.defaultValue,style=_ref.style,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?24:_ref$iconSize,iconColor=_ref.iconColor,onChange=_ref.onChange,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,Icon=_ref.Icon;var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles,textStyles=_extractStyles.textStyles;var _useState=useState(defaultValue!=null?defaultValue:0),_useState2=_slicedToArray(_useState,2),value=_useState2[0],setValue=_useState2[1];var isValidValue=function isValidValue(valueArg){return valueArg>=min&&valueArg<=max;};var handlePlusOrMinus=function handlePlusOrMinus(type){var newValue=type==="plus"?value+1:value-1;if(isValidValue(newValue)){setValue(newValue);onChange==null?void 0:onChange(newValue);}};useEffect(function(){if(valueProp!=null&&isNumber(valueProp)&&valueProp!==value&&isValidValue(valueProp)){setValue(valueProp);}},[valueProp]);return _jsxs(View,{style:[{flexDirection:"row"},viewStyles],children:[_jsx(IconButton,{Icon:Icon,icon:"MaterialIcons/remove",onPress:function onPress(){return handlePlusOrMinus("minus");},size:iconSize,color:iconColor,disabled:value===min,style:{opacity:value===min?0.5:1}}),_jsx(Text,{style:[typography.body1,{textAlign:"center",alignSelf:"center",color:colors.medium,marginHorizontal:8},textStyles],children:value}),_jsx(IconButton,{Icon:Icon,icon:"MaterialIcons/add",onPress:function onPress(){return handlePlusOrMinus("plus");},size:iconSize,color:iconColor,disabled:value===max,style:{opacity:value===max?0.5:1}})]});};export default withTheme(Stepper);
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","style","children","Icon","closeOnPress","leftOpenValue","rightOpenValue","leftActivationValue","rightActivationValue","swipeActivationPercentage","stopLeftSwipe","stopRightSwipe","friction","disableLeftSwipe","disableRightSwipe"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableItem.tsx";import React from"react";import{View,StyleSheet,Text}from"react-native";import Pressable from"../Pressable";import{extractBorderAndMarginStyles,extractEffectStyles,extractFlexItemStyles,extractPositionStyles,extractSizeStyles,extractStyles,flattenReactFragments}from"../../utilities";import{SwipeRow}from"react-native-swipe-list-view";import{withTheme}from"../../theming";import SwipeableItemButton from"./SwipeableItemButton";import{SwipeableListContext}from"./SwipeableList";import{leftSwipeToSwipeableItemBehindItem,rightSwipeToSwipeableItemBehindItem,extractLeftSwipeProps,extractRightSwipeProps}from"./SwipeableItemCommon";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var SwipeableItem=function SwipeableItem(_ref){var theme=_ref.theme,style=_ref.style,childrenProp=_ref.children,Icon=_ref.Icon,closeOnPress=_ref.closeOnPress,leftOpenValue=_ref.leftOpenValue,rightOpenValue=_ref.rightOpenValue,leftActivationValue=_ref.leftActivationValue,rightActivationValue=_ref.rightActivationValue,_ref$swipeActivationP=_ref.swipeActivationPercentage,swipeActivationPercentage=_ref$swipeActivationP===void 0?80:_ref$swipeActivationP,stopLeftSwipe=_ref.stopLeftSwipe,stopRightSwipe=_ref.stopRightSwipe,_ref$friction=_ref.friction,friction=_ref$friction===void 0?20:_ref$friction,disableLeftSwipe=_ref.disableLeftSwipe,disableRightSwipe=_ref.disableRightSwipe,rest=_objectWithoutProperties(_ref,_excluded);var isEmptyObject=function isEmptyObject(object){return Object.keys(object).length===0;};var _React$useContext=React.useContext(SwipeableListContext),onStartSwiping=_React$useContext.onStartSwiping,onStopSwiping=_React$useContext.onStopSwiping;var swipeableRef=React.useRef(null);var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles,textStyles=_extractStyles.textStyles;var _extractBorderAndMarg=extractBorderAndMarginStyles(viewStyles),borderStyles=_extractBorderAndMarg.borderStyles,marginStyles=_extractBorderAndMarg.marginStyles;var sizeStyles=extractSizeStyles(viewStyles);var parentContainerStyles=StyleSheet.flatten([borderStyles,marginStyles,extractFlexItemStyles(viewStyles),extractPositionStyles(viewStyles),extractEffectStyles(viewStyles),sizeStyles]);Object.keys(parentContainerStyles).forEach(function(key){return delete viewStyles[key];});var surfaceContainerStyles=StyleSheet.flatten([viewStyles,sizeStyles]);var _React$useState=React.useState(null),_React$useState2=_slicedToArray(_React$useState,2),componentWidth=_React$useState2[0],setComponentWidth=_React$useState2[1];var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp));},[childrenProp]);var leftSwipeButtons=React.useMemo(function(){return children.filter(function(child){return React.isValidElement(child)&&child.type===SwipeableItemButton&&child.props.revealSwipeDirection==="left";});},[children]);var rightSwipeButtons=React.useMemo(function(){return children.filter(function(child){return React.isValidElement(child)&&child.type===SwipeableItemButton&&child.props.revealSwipeDirection==="right";});},[children]);var remainingChildren=React.useMemo(function(){return React.Children.toArray(children).filter(function(child){return React.isValidElement(child)&&child.type!==SwipeableItemButton;});},[children]);var leftSwipe=extractLeftSwipeProps(rest);var rightSwipe=extractRightSwipeProps(rest);var isLeftSwipeHandled=!isEmptyObject(leftSwipe);var isRightSwipeHandled=!isEmptyObject(rightSwipe);if(leftSwipeButtons.length>2||rightSwipeButtons.length>2){throw Error("Cannot have more than 2 SwipeableItemButton(s) per side");}if(leftSwipeButtons.length&&isLeftSwipeHandled||rightSwipeButtons.length&&isRightSwipeHandled){throw Error("Colliding configuration in SwipeableItem. You cannot have SwipeableItemButton(s) on the swipe direction where swipe handling is configured. Either reset swipe configuration or remove the button(s).");}var renderBehindItem=function renderBehindItem(item,index){return _jsxs(Pressable,{testID:"swipeable-behind-item",onPress:function onPress(){item.onPress==null?void 0:item.onPress();if(item.closeOnPress!==false){var _swipeableRef$current;(_swipeableRef$current=swipeableRef.current)==null?void 0:_swipeableRef$current.closeRow();}},style:[styles.buttonContainer,{backgroundColor:item.backgroundColor||theme.colors.primary}],children:[item.icon&&_jsx(Icon,{name:item.icon,size:item.iconSize||25,color:item.color||theme.colors.surface}),item.title&&_jsx(Text,{style:[textStyles,{color:item.color||theme.colors.surface}],children:item.title})]},index.toString());};var defaultLeftOpenValue=componentWidth?componentWidth/2:0;var defaultRightOpenValue=componentWidth?-componentWidth/2:0;return _jsx(View,{onLayout:function onLayout(event){setComponentWidth(event.nativeEvent.layout.width);},style:[styles.parentContainer,parentContainerStyles],children:_jsxs(SwipeRow,Object.assign({ref:swipeableRef,leftOpenValue:isRightSwipeHandled?0:leftOpenValue||defaultLeftOpenValue,rightOpenValue:isLeftSwipeHandled?0:rightOpenValue||defaultRightOpenValue,leftActivationValue:leftActivationValue||isRightSwipeHandled?defaultLeftOpenValue*(swipeActivationPercentage/100):defaultLeftOpenValue,rightActivationValue:rightActivationValue||isLeftSwipeHandled?defaultRightOpenValue*(swipeActivationPercentage/100):defaultRightOpenValue,stopLeftSwipe:stopRightSwipe||defaultLeftOpenValue,stopRightSwipe:stopLeftSwipe||defaultRightOpenValue,onLeftAction:isRightSwipeHandled?function(){return rightSwipe.onSwipedRight==null?void 0:rightSwipe.onSwipedRight();}:undefined,onRightAction:isLeftSwipeHandled?function(){return leftSwipe.onSwipedLeft==null?void 0:leftSwipe.onSwipedLeft();}:undefined,swipeGestureBegan:onStartSwiping,swipeGestureEnded:onStopSwiping,closeOnRowPress:closeOnPress,friction:friction,disableLeftSwipe:disableRightSwipe,disableRightSwipe:disableLeftSwipe},rest,{children:[_jsxs(View,{style:styles.behindContainer,children:[_jsx(View,{style:styles.behindContainerItem,children:isRightSwipeHandled?renderBehindItem(rightSwipeToSwipeableItemBehindItem(rightSwipe),0):rightSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})}),_jsx(View,{style:styles.behindContainerItem,children:isLeftSwipeHandled?renderBehindItem(leftSwipeToSwipeableItemBehindItem(leftSwipe),0):leftSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})})]}),_jsx(View,{style:[styles.surfaceContainer,{backgroundColor:theme.colors.background},surfaceContainerStyles],children:remainingChildren})]}))});};var styles=StyleSheet.create({parentContainer:{overflow:"hidden",minHeight:50},behindContainer:{flex:1,width:"100%",height:"100%",flexDirection:"row"},behindContainerItem:{flex:1,flexDirection:"row"},buttonContainer:{flex:1,alignItems:"center",justifyContent:"center"},surfaceContainer:{width:"100%",minHeight:50,overflow:"hidden"}});export default withTheme(SwipeableItem);
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","style","children","Icon","closeOnPress","leftOpenValue","rightOpenValue","leftActivationValue","rightActivationValue","swipeActivationPercentage","stopLeftSwipe","stopRightSwipe","friction","disableLeftSwipe","disableRightSwipe"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableItem.tsx";import React from"react";import{View,StyleSheet,Text}from"react-native";import Pressable from"../Pressable";import{extractBorderAndMarginStyles,extractEffectStyles,extractFlexItemStyles,extractPositionStyles,extractSizeStyles,extractStyles,flattenReactFragments}from"../../utilities";import{SwipeRow}from"react-native-swipe-list-view";import{withTheme}from"../../theming";import SwipeableItemButton from"./SwipeableItemButton";import{SwipeableListContext}from"./SwipeableList";import{leftSwipeToSwipeableItemBehindItem,rightSwipeToSwipeableItemBehindItem,extractLeftSwipeProps,extractRightSwipeProps}from"./SwipeableItemCommon";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var SwipeableItem=function SwipeableItem(_ref){var theme=_ref.theme,style=_ref.style,childrenProp=_ref.children,Icon=_ref.Icon,closeOnPress=_ref.closeOnPress,leftOpenValue=_ref.leftOpenValue,rightOpenValue=_ref.rightOpenValue,leftActivationValue=_ref.leftActivationValue,rightActivationValue=_ref.rightActivationValue,_ref$swipeActivationP=_ref.swipeActivationPercentage,swipeActivationPercentage=_ref$swipeActivationP===void 0?80:_ref$swipeActivationP,stopLeftSwipe=_ref.stopLeftSwipe,stopRightSwipe=_ref.stopRightSwipe,_ref$friction=_ref.friction,friction=_ref$friction===void 0?20:_ref$friction,disableLeftSwipe=_ref.disableLeftSwipe,disableRightSwipe=_ref.disableRightSwipe,rest=_objectWithoutProperties(_ref,_excluded);var isEmptyObject=function isEmptyObject(object){return Object.keys(object).length===0;};var _React$useContext=React.useContext(SwipeableListContext),onStartSwiping=_React$useContext.onStartSwiping,onStopSwiping=_React$useContext.onStopSwiping;var swipeableRef=React.useRef(null);var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles,textStyles=_extractStyles.textStyles;var _extractBorderAndMarg=extractBorderAndMarginStyles(viewStyles),borderStyles=_extractBorderAndMarg.borderStyles,marginStyles=_extractBorderAndMarg.marginStyles;var sizeStyles=extractSizeStyles(viewStyles);var parentContainerStyles=StyleSheet.flatten([borderStyles,marginStyles,extractFlexItemStyles(viewStyles),extractPositionStyles(viewStyles),extractEffectStyles(viewStyles),sizeStyles]);Object.keys(parentContainerStyles).forEach(function(key){return delete viewStyles[key];});var surfaceContainerStyles=StyleSheet.flatten([viewStyles,sizeStyles]);var _React$useState=React.useState(null),_React$useState2=_slicedToArray(_React$useState,2),componentWidth=_React$useState2[0],setComponentWidth=_React$useState2[1];var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp));},[childrenProp]);var leftSwipeButtons=React.useMemo(function(){return children.filter(function(child){return React.isValidElement(child)&&child.type===SwipeableItemButton&&child.props.revealSwipeDirection==="left";});},[children]);var rightSwipeButtons=React.useMemo(function(){return children.filter(function(child){return React.isValidElement(child)&&child.type===SwipeableItemButton&&child.props.revealSwipeDirection==="right";});},[children]);var remainingChildren=React.useMemo(function(){return React.Children.toArray(children).filter(function(child){return React.isValidElement(child)&&child.type!==SwipeableItemButton;});},[children]);var leftSwipe=extractLeftSwipeProps(rest);var rightSwipe=extractRightSwipeProps(rest);var isLeftSwipeHandled=!isEmptyObject(leftSwipe);var isRightSwipeHandled=!isEmptyObject(rightSwipe);if(leftSwipeButtons.length>2||rightSwipeButtons.length>2){throw Error("Cannot have more than 2 SwipeableItemButton(s) per side");}if(leftSwipeButtons.length&&isLeftSwipeHandled||rightSwipeButtons.length&&isRightSwipeHandled){throw Error("Colliding configuration in SwipeableItem. You cannot have SwipeableItemButton(s) on the swipe direction where swipe handling is configured. Either reset swipe configuration or remove the button(s).");}var renderBehindItem=function renderBehindItem(item,index){return _jsxs(Pressable,{testID:"swipeable-behind-item",onPress:function onPress(){item.onPress==null?void 0:item.onPress();if(item.closeOnPress!==false){var _swipeableRef$current;(_swipeableRef$current=swipeableRef.current)==null?void 0:_swipeableRef$current.closeRow();}},style:[styles.buttonContainer,{backgroundColor:item.backgroundColor||theme.colors.primary}],children:[item.icon&&_jsx(Icon,{name:item.icon,size:item.iconSize||25,color:item.color||theme.colors.surface}),item.title&&_jsx(Text,{style:[textStyles,{color:item.color||theme.colors.surface}],children:item.title})]},index.toString());};var defaultLeftOpenValue=componentWidth?componentWidth/2:0;var defaultRightOpenValue=componentWidth?-componentWidth/2:0;return _jsx(View,{onLayout:function onLayout(event){setComponentWidth(event.nativeEvent.layout.width);},style:[styles.parentContainer,parentContainerStyles],children:_jsxs(SwipeRow,Object.assign({ref:swipeableRef,leftOpenValue:isRightSwipeHandled?0:leftOpenValue||defaultLeftOpenValue,rightOpenValue:isLeftSwipeHandled?0:rightOpenValue||defaultRightOpenValue,leftActivationValue:leftActivationValue||isRightSwipeHandled?defaultLeftOpenValue*(swipeActivationPercentage/100):defaultLeftOpenValue,rightActivationValue:rightActivationValue||isLeftSwipeHandled?defaultRightOpenValue*(swipeActivationPercentage/100):defaultRightOpenValue,stopLeftSwipe:stopRightSwipe||defaultLeftOpenValue,stopRightSwipe:stopLeftSwipe||defaultRightOpenValue,onLeftAction:isRightSwipeHandled?function(){return rightSwipe.onSwipedRight==null?void 0:rightSwipe.onSwipedRight();}:undefined,onRightAction:isLeftSwipeHandled?function(){return leftSwipe.onSwipedLeft==null?void 0:leftSwipe.onSwipedLeft();}:undefined,swipeGestureBegan:onStartSwiping,swipeGestureEnded:onStopSwiping,closeOnRowPress:closeOnPress,friction:friction,disableLeftSwipe:disableRightSwipe,disableRightSwipe:disableLeftSwipe},rest,{children:[_jsxs(View,{style:styles.behindContainer,children:[_jsx(View,{style:styles.behindContainerItem,children:isRightSwipeHandled?renderBehindItem(rightSwipeToSwipeableItemBehindItem(rightSwipe),0):rightSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})}),_jsx(View,{style:styles.behindContainerItem,children:isLeftSwipeHandled?renderBehindItem(leftSwipeToSwipeableItemBehindItem(leftSwipe),0):leftSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})})]}),_jsx(View,{style:[styles.surfaceContainer,{backgroundColor:theme.colors.background},surfaceContainerStyles],children:remainingChildren})]}))});};var styles=StyleSheet.create({parentContainer:{overflow:"hidden",minHeight:50},behindContainer:{flex:1,width:"100%",height:"100%",flexDirection:"row"},behindContainerItem:{flex:1,flexDirection:"row"},buttonContainer:{flex:1,alignItems:"center",justifyContent:"center"},surfaceContainer:{width:"100%",minHeight:50,overflow:"hidden"}});export default withTheme(SwipeableItem);
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disableScrollWhenSwiping","listComponent"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableList.tsx";import React from"react";import{FlashList}from"@shopify/flash-list";import{FlatList}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export var SwipeableListContext=React.createContext({onStartSwiping:function onStartSwiping(){},onStopSwiping:function onStopSwiping(){}});var SwipeableList=function SwipeableList(_ref){var _ref$disableScrollWhe=_ref.disableScrollWhenSwiping,disableScrollWhenSwiping=_ref$disableScrollWhe===void 0?true:_ref$disableScrollWhe,_ref$listComponent=_ref.listComponent,listComponent=_ref$listComponent===void 0?"FlatList":_ref$listComponent,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isSwiping=_React$useState2[0],setIsSwiping=_React$useState2[1];var onStartSwiping=function onStartSwiping(){setIsSwiping(true);};var onStopSwiping=function onStopSwiping(){setIsSwiping(false);};rest.scrollEnabled=disableScrollWhenSwiping?!isSwiping:true;var renderListComponent=function renderListComponent(){switch(listComponent){case"FlatList":return _jsx(FlatList,Object.assign({},rest));case"FlashList":return _jsx(FlashList,Object.assign({},rest));}};return _jsx(SwipeableListContext.Provider,{value:{onStartSwiping:onStartSwiping,onStopSwiping:onStopSwiping},children:_jsx(_Fragment,{children:renderListComponent()})});};export default SwipeableList;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disableScrollWhenSwiping","listComponent"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableList.tsx";import React from"react";import{FlashList}from"@shopify/flash-list";import{FlatList}from"react-native";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";export var SwipeableListContext=React.createContext({onStartSwiping:function onStartSwiping(){},onStopSwiping:function onStopSwiping(){}});var SwipeableList=function SwipeableList(_ref){var _ref$disableScrollWhe=_ref.disableScrollWhenSwiping,disableScrollWhenSwiping=_ref$disableScrollWhe===void 0?true:_ref$disableScrollWhe,_ref$listComponent=_ref.listComponent,listComponent=_ref$listComponent===void 0?"FlatList":_ref$listComponent,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isSwiping=_React$useState2[0],setIsSwiping=_React$useState2[1];var onStartSwiping=function onStartSwiping(){setIsSwiping(true);};var onStopSwiping=function onStopSwiping(){setIsSwiping(false);};rest.scrollEnabled=disableScrollWhenSwiping?!isSwiping:true;var renderListComponent=function renderListComponent(){switch(listComponent){case"FlatList":return _jsx(FlatList,Object.assign({},rest));case"FlashList":return _jsx(FlashList,Object.assign({},rest));}};return _jsx(SwipeableListContext.Provider,{value:{onStartSwiping:onStartSwiping,onStopSwiping:onStopSwiping},children:_jsx(_Fragment,{children:renderListComponent()})});};export default SwipeableList;
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabView.tsx";import*as React from"react";import{TabView,TabBar}from"react-native-tab-view";import TabViewItem from"./TabViewItem";import{withTheme}from"../../theming";import{flattenReactFragments,extractStyles}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var TabViewComponent=function TabViewComponent(_ref){var Icon=_ref.Icon,onIndexChanged=_ref.onIndexChanged,onEndReached=_ref.onEndReached,_ref$initialTabIndex=_ref.initialTabIndex,initialTabIndex=_ref$initialTabIndex===void 0?0:_ref$initialTabIndex,tabBarPosition=_ref.tabBarPosition,keyboardDismissMode=_ref.keyboardDismissMode,swipeEnabled=_ref.swipeEnabled,scrollEnabled=_ref.scrollEnabled,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,pressColor=_ref.pressColor,indicatorColor=_ref.indicatorColor,tabsBackgroundColor=_ref.tabsBackgroundColor,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?16:_ref$iconSize,style=_ref.style,theme=_ref.theme,childrenProp=_ref.children;var _React$useState=React.useState(initialTabIndex),_React$useState2=_slicedToArray(_React$useState,2),index=_React$useState2[0],setIndex=_React$useState2[1];var _React$useState3=React.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),routes=_React$useState4[0],setRoutes=_React$useState4[1];var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp)).filter(function(child){return React.isValidElement(child)&&child.type===TabViewItem;});},[childrenProp]);React.useEffect(function(){var newRoutes=[];children.forEach(function(item,idx){var child=item;newRoutes.push({key:idx.toString(),title:child.props.title,icon:child.props.icon,accessibilityLabel:child.props.accessibilityLabel});});setRoutes(newRoutes);},[children]);var indexChangeHandler=function indexChangeHandler(i){setIndex(i);onIndexChanged==null?void 0:onIndexChanged(i);if(i===routes.length){onEndReached==null?void 0:onEndReached();}};var renderTabBar=function renderTabBar(props){return _jsx(TabBar,Object.assign({},props,{activeColor:activeColor||theme.colors.primary,inactiveColor:inactiveColor||"rgb(200,200,200)",pressColor:pressColor||theme.colors.primary,scrollEnabled:scrollEnabled,indicatorStyle:{backgroundColor:indicatorColor||theme.colors.primary},labelStyle:[{textTransform:"none"},textStyles],renderIcon:function renderIcon(_ref2){var route=_ref2.route,color=_ref2.color;return route!=null&&route.icon?_jsx(Icon,{name:route.icon,color:color,size:iconSize}):null;},style:{backgroundColor:tabsBackgroundColor||theme.colors.background}}));};var renderScene=function renderScene(_ref3){var route=_ref3.route;var index=Number(route.key);return children[index];};if(!routes.length){return _jsx(_Fragment,{});}return _jsx(TabView,{style:viewStyles,navigationState:{index:index,routes:routes},renderScene:renderScene,renderTabBar:renderTabBar,onIndexChange:indexChangeHandler,tabBarPosition:tabBarPosition,keyboardDismissMode:keyboardDismissMode,swipeEnabled:swipeEnabled});};export default withTheme(TabViewComponent);
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabView.tsx";import*as React from"react";import{TabView,TabBar}from"react-native-tab-view";import TabViewItem from"./TabViewItem";import{withTheme}from"../../theming";import{flattenReactFragments,extractStyles}from"../../utilities";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";var TabViewComponent=function TabViewComponent(_ref){var Icon=_ref.Icon,onIndexChanged=_ref.onIndexChanged,onEndReached=_ref.onEndReached,_ref$initialTabIndex=_ref.initialTabIndex,initialTabIndex=_ref$initialTabIndex===void 0?0:_ref$initialTabIndex,tabBarPosition=_ref.tabBarPosition,keyboardDismissMode=_ref.keyboardDismissMode,swipeEnabled=_ref.swipeEnabled,scrollEnabled=_ref.scrollEnabled,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,pressColor=_ref.pressColor,indicatorColor=_ref.indicatorColor,tabsBackgroundColor=_ref.tabsBackgroundColor,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?16:_ref$iconSize,style=_ref.style,theme=_ref.theme,childrenProp=_ref.children;var _React$useState=React.useState(initialTabIndex),_React$useState2=_slicedToArray(_React$useState,2),index=_React$useState2[0],setIndex=_React$useState2[1];var _React$useState3=React.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),routes=_React$useState4[0],setRoutes=_React$useState4[1];var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp)).filter(function(child){return React.isValidElement(child)&&child.type===TabViewItem;});},[childrenProp]);React.useEffect(function(){var newRoutes=[];children.forEach(function(item,idx){var child=item;newRoutes.push({key:idx.toString(),title:child.props.title,icon:child.props.icon,accessibilityLabel:child.props.accessibilityLabel});});setRoutes(newRoutes);},[children]);var indexChangeHandler=function indexChangeHandler(i){setIndex(i);onIndexChanged==null?void 0:onIndexChanged(i);if(i===routes.length){onEndReached==null?void 0:onEndReached();}};var renderTabBar=function renderTabBar(props){return _jsx(TabBar,Object.assign({},props,{activeColor:activeColor||theme.colors.primary,inactiveColor:inactiveColor||"rgb(200,200,200)",pressColor:pressColor||theme.colors.primary,scrollEnabled:scrollEnabled,indicatorStyle:{backgroundColor:indicatorColor||theme.colors.primary},labelStyle:[{textTransform:"none"},textStyles],renderIcon:function renderIcon(_ref2){var route=_ref2.route,color=_ref2.color;return route!=null&&route.icon?_jsx(Icon,{name:route.icon,color:color,size:iconSize}):null;},style:{backgroundColor:tabsBackgroundColor||theme.colors.background}}));};var renderScene=function renderScene(_ref3){var route=_ref3.route;var index=Number(route.key);return children[index];};if(!routes.length){return _jsx(_Fragment,{});}return _jsx(TabView,{style:viewStyles,navigationState:{index:index,routes:routes},renderScene:renderScene,renderTabBar:renderTabBar,onIndexChange:indexChangeHandler,tabBarPosition:tabBarPosition,keyboardDismissMode:keyboardDismissMode,swipeEnabled:swipeEnabled});};export default withTheme(TabViewComponent);
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","borderWidth","borderColor","borderStyle","drawTopBorder","drawBottomBorder","drawStartBorder","drawEndBorder","cellVerticalPadding","cellHorizontalPadding","data","keyExtractor","renderItem","children","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/Table.tsx";import React from"react";import{ScrollView,View,StyleSheet}from"react-native";import{withTheme}from"../../theming";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Table=function Table(_ref){var theme=_ref.theme,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,_ref$borderColor=_ref.borderColor,borderColor=_ref$borderColor===void 0?theme.colors.divider:_ref$borderColor,_ref$borderStyle=_ref.borderStyle,borderStyle=_ref$borderStyle===void 0?"solid":_ref$borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?true:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?false:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?false:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,_ref$cellVerticalPadd=_ref.cellVerticalPadding,cellVerticalPadding=_ref$cellVerticalPadd===void 0?10:_ref$cellVerticalPadd,_ref$cellHorizontalPa=_ref.cellHorizontalPadding,cellHorizontalPadding=_ref$cellHorizontalPa===void 0?10:_ref$cellHorizontalPa,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);if(data&&!renderItem||renderItem&&!data){throw new Error("'renderItem' and 'data' need to both be provided to render from 'data'. Either remove them entirley or include both");}if(data&&renderItem&&childrenProp){console.warn("'children' of Table ignored due to usage of 'data' and 'renderItem'");}var isTableHeader=React.useCallback(function(object){return object.isTableHeader;},[]);var isRenderItem=Array.isArray(data)&&renderItem;var dataAsChildren=React.useMemo(function(){if(!isRenderItem)return[];return data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index.toString();return React.cloneElement(component,{key:key});});},[data,renderItem,keyExtractor,isRenderItem]);var children=isRenderItem?dataAsChildren:React.Children.toArray(childrenProp);var validChildren=React.useMemo(function(){return children.filter(function(item){return React.isValidElement(item);});},[children]);var childrenWithoutHeader=React.useMemo(function(){var flattenedWithoutNestedHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return React.cloneElement(item,{children:nestedChildren.filter(function(child){return!isTableHeader(child.props);})});}return item;});return flattenedWithoutNestedHeaders.filter(function(item){return!isTableHeader(item.props);});},[validChildren,isTableHeader]);var header=React.useMemo(function(){var flattenedPossibleHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return nestedHeaders[0];}return item;});var allHeaders=flattenedPossibleHeaders.filter(function(item){return isTableHeader(item.props);});if(allHeaders.length){return allHeaders[0];}return null;},[validChildren,isTableHeader]);var contextValue={borderColor:borderColor,borderStyle:borderStyle,borderWidth:borderWidth,cellHorizontalPadding:cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding};var borderViewStyle=generateBorderStyles({borderColor:borderColor,borderWidth:borderWidth,borderStyle:borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});return _jsx(TableStyleContext.Provider,{value:contextValue,children:_jsxs(View,{style:[styles.container,borderViewStyle,style],children:[_jsx(_Fragment,{children:header}),_jsx(ScrollView,Object.assign({},rest,{children:childrenWithoutHeader}))]})});};var styles=StyleSheet.create({container:{flex:1}});export default withTheme(Table);
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","borderWidth","borderColor","borderStyle","drawTopBorder","drawBottomBorder","drawStartBorder","drawEndBorder","cellVerticalPadding","cellHorizontalPadding","data","keyExtractor","renderItem","children","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/Table.tsx";import React from"react";import{ScrollView,View,StyleSheet}from"react-native";import{withTheme}from"../../theming";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import{Fragment as _Fragment,jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var Table=function Table(_ref){var theme=_ref.theme,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,_ref$borderColor=_ref.borderColor,borderColor=_ref$borderColor===void 0?theme.colors.divider:_ref$borderColor,_ref$borderStyle=_ref.borderStyle,borderStyle=_ref$borderStyle===void 0?"solid":_ref$borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?true:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?false:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?false:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,_ref$cellVerticalPadd=_ref.cellVerticalPadding,cellVerticalPadding=_ref$cellVerticalPadd===void 0?10:_ref$cellVerticalPadd,_ref$cellHorizontalPa=_ref.cellHorizontalPadding,cellHorizontalPadding=_ref$cellHorizontalPa===void 0?10:_ref$cellHorizontalPa,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);if(data&&!renderItem||renderItem&&!data){throw new Error("'renderItem' and 'data' need to both be provided to render from 'data'. Either remove them entirley or include both");}if(data&&renderItem&&childrenProp){console.warn("'children' of Table ignored due to usage of 'data' and 'renderItem'");}var isTableHeader=React.useCallback(function(object){return object.isTableHeader;},[]);var isRenderItem=Array.isArray(data)&&renderItem;var dataAsChildren=React.useMemo(function(){if(!isRenderItem)return[];return data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index.toString();return React.cloneElement(component,{key:key});});},[data,renderItem,keyExtractor,isRenderItem]);var children=isRenderItem?dataAsChildren:React.Children.toArray(childrenProp);var validChildren=React.useMemo(function(){return children.filter(function(item){return React.isValidElement(item);});},[children]);var childrenWithoutHeader=React.useMemo(function(){var flattenedWithoutNestedHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return React.cloneElement(item,{children:nestedChildren.filter(function(child){return!isTableHeader(child.props);})});}return item;});return flattenedWithoutNestedHeaders.filter(function(item){return!isTableHeader(item.props);});},[validChildren,isTableHeader]);var header=React.useMemo(function(){var flattenedPossibleHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return nestedHeaders[0];}return item;});var allHeaders=flattenedPossibleHeaders.filter(function(item){return isTableHeader(item.props);});if(allHeaders.length){return allHeaders[0];}return null;},[validChildren,isTableHeader]);var contextValue={borderColor:borderColor,borderStyle:borderStyle,borderWidth:borderWidth,cellHorizontalPadding:cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding};var borderViewStyle=generateBorderStyles({borderColor:borderColor,borderWidth:borderWidth,borderStyle:borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});return _jsx(TableStyleContext.Provider,{value:contextValue,children:_jsxs(View,{style:[styles.container,borderViewStyle,style],children:[_jsx(_Fragment,{children:header}),_jsx(ScrollView,Object.assign({},rest,{children:childrenWithoutHeader}))]})});};var styles=StyleSheet.create({container:{flex:1}});export default withTheme(Table);
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextField.tsx";var _excluded=["theme","Icon","type","disabled","editable","label","error","leftIconName","leftIconMode","rightIconName","iconColor","iconSize","assistiveText","underlineColor","activeBorderColor","multiline","numberOfLines","style","render"],_excluded2=["lineHeight"],_excluded3=["backgroundColor","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import*as React from"react";import{View,Animated,StyleSheet,Text,I18nManager,Platform}from"react-native";import{withTheme}from"../theming";import{applyStyles,extractStyles}from"../utilities";import TextInput from"./TextInput";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AnimatedText=Animated.createAnimatedComponent(Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var TextField=function(_React$Component){_inherits(TextField,_React$Component);var _super=_createSuper(TextField);function TextField(){var _this;_classCallCheck(this,TextField);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={labeled:new Animated.Value(_this.props.value||_this.props.error?0:1),focused:false,placeholder:_this.props.error?_this.props.placeholder:"",labelLayout:{measured:false,width:0}};_this._timer=setTimeout(function(){},0);_this._showPlaceholder=function(){clearTimeout(_this._timer);_this._timer=setTimeout(function(){return _this.setState({placeholder:_this.props.placeholder});},50);};_this._hidePlaceholder=function(){return _this.setState({placeholder:""});};_this._restoreLabel=function(){return Animated.timing(_this.state.labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._minmizeLabel=function(){return Animated.timing(_this.state.labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._handleFocus=function(){if(_this.props.disabled){return;}_this.setState({focused:true});};_this._handleBlur=function(){if(_this.props.disabled){return;}_this.setState({focused:false});};_this._handleChangeText=function(value){if(_this.props.disabled){return;}if(typeof value==="string"){_this.setState({value:value});_this.props.onChangeText&&_this.props.onChangeText(value);}else{_this.setState({value:value.nativeEvent.text});_this.props.onChangeText&&_this.props.onChangeText(value.nativeEvent.text);}};_this._root=undefined;return _this;}_createClass(TextField,[{key:"componentDidMount",value:function componentDidMount(){if(this.props.defaultValue){this._handleChangeText(this.props.defaultValue);}if(this.props.placeholder){this._minmizeLabel();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(prevState.focused!==this.state.focused||prevState.value!==this.state.value){if(this.state.value||this.state.focused||this.props.error||this.props.placeholder){this._minmizeLabel();}else{this._restoreLabel();}}if(prevState.focused!==this.state.focused||prevProps.label!==this.props.label){if(this.state.focused||this.props.error||!this.props.label){this._showPlaceholder();}else{this._hidePlaceholder();}}}},{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this._timer);}},{key:"toggleFocus",value:function toggleFocus(){this.setState(function(prevState){return{focused:!prevState.focused};});}},{key:"isFocused",value:function isFocused(){return this._root&&this._root.isFocused();}},{key:"clear",value:function clear(){return this._root&&this._root.clear();}},{key:"focus",value:function focus(){return this._root&&this._root.focus();}},{key:"blur",value:function blur(){return this._root&&this._root.blur();}},{key:"render",value:function render(){var _this2=this;var _this$props=this.props,_this$props$theme=_this$props.theme,colors=_this$props$theme.colors,typography=_this$props$theme.typography,roundness=_this$props$theme.roundness,disabledOpacity=_this$props$theme.disabledOpacity,Icon=_this$props.Icon,_this$props$type=_this$props.type,type=_this$props$type===void 0?"underline":_this$props$type,_this$props$disabled=_this$props.disabled,disabled=_this$props$disabled===void 0?false:_this$props$disabled,_this$props$editable=_this$props.editable,editable=_this$props$editable===void 0?true:_this$props$editable,label=_this$props.label,_this$props$error=_this$props.error,error=_this$props$error===void 0?false:_this$props$error,leftIconName=_this$props.leftIconName,leftIconMode=_this$props.leftIconMode,rightIconName=_this$props.rightIconName,iconColor=_this$props.iconColor,iconSize=_this$props.iconSize,assistiveText=_this$props.assistiveText,underlineColorProp=_this$props.underlineColor,_this$props$activeBor=_this$props.activeBorderColor,activeBorderColorProp=_this$props$activeBor===void 0?colors.primary:_this$props$activeBor,_this$props$multiline=_this$props.multiline,multiline=_this$props$multiline===void 0?false:_this$props$multiline,_this$props$numberOfL=_this$props.numberOfLines,numberOfLines=_this$props$numberOfL===void 0?4:_this$props$numberOfL,style=_this$props.style,_this$props$render=_this$props.render,render=_this$props$render===void 0?function(props){return _jsx(TextInput,Object.assign({},props));}:_this$props$render,rest=_objectWithoutProperties(_this$props,_excluded);var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=typography.caption.fontSize;var hasActiveOutline=this.state.focused||error;var inputTextColor,activeColor,underlineColor,borderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.strong;if(disabled){activeColor=colors.light;placeholderColor=colors.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.divider;}else{activeColor=error?colors.error:activeBorderColorProp;placeholderColor=borderColor=colors.light;underlineColor=underlineColorProp||colors.light;backgroundColor=colors.background;}if(rest.placeholderTextColor){placeholderColor=rest.placeholderTextColor;}var _typography$subtitle=typography.subtitle1,lineHeight=_typography$subtitle.lineHeight,subtitle1=_objectWithoutProperties(_typography$subtitle,_excluded2);inputStyle=Object.assign({paddingVertical:0,color:inputTextColor,paddingLeft:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1);if(!multiline){inputStyle.height=lineHeight;}var assistiveTextLeftMargin;if(type==="underline"){containerStyle={borderTopLeftRadius:roundness,borderTopRightRadius:roundness,paddingBottom:12,marginTop:16};if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8;}else{assistiveTextLeftMargin=0;}}else{containerStyle={borderRadius:roundness,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:1,paddingTop:label?16*1.5:16,paddingBottom:label?16*0.5:16,opacity:disabled?disabledOpacity:1,backgroundColor:backgroundColor};if(leftIconName&&leftIconMode==="inset"){assistiveTextLeftMargin=16+4;}else if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8+12;}else{assistiveTextLeftMargin=12;}}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(iconColor){leftIconColor=iconColor;}else if(error){leftIconColor=colors.error;}else if(this.state.focused){leftIconColor=colors.primary;}else{leftIconColor=colors.light;}var labelStyle=Object.assign({},typography.subtitle1,type==="solid"?{marginHorizontal:12}:{},{top:type==="solid"?16:0,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,transform:[{translateY:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(this.state.labelLayout.width/2),0]})}]});var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles;var inputStyles=applyStyles([styles.input,inputStyle,type==="solid"?{marginHorizontal:16}:{marginHorizontal:6}],textStyles);var _ref=StyleSheet.flatten(style||{}),bgColor=_ref.backgroundColor,padding=_ref.padding,paddingTop=_ref.paddingTop,paddingBottom=_ref.paddingBottom,paddingLeft=_ref.paddingLeft,paddingRight=_ref.paddingRight,borderRadius=_ref.borderRadius,borderWidth=_ref.borderWidth,borderTopWidth=_ref.borderTopWidth,borderRightWidth=_ref.borderRightWidth,borderBottomWidth=_ref.borderBottomWidth,borderLeftWidth=_ref.borderLeftWidth,borderCol=_ref.borderColor,styleProp=_objectWithoutProperties(_ref,_excluded3);return _jsxs(View,{style:[styles.container,styleProp],children:[_jsxs(View,{style:applyStyles([containerStyle],{height:styleProp.height,backgroundColor:bgColor,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,borderRadius:borderRadius,borderWidth:borderWidth,borderTopWidth:borderTopWidth,borderRightWidth:borderRightWidth,borderBottomWidth:borderBottomWidth,borderLeftWidth:borderLeftWidth,borderColor:borderCol}),children:[type==="underline"?_jsx(Animated.View,{style:[styles.underline,{backgroundColor:bgColor||(error?colors.error:this.state.focused?activeColor:underlineColor),transform:[{scaleY:this.state.focused?1:0.5}]}]}):null,label?_jsxs(View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{opacity:this.state.value||this.state.focused?this.state.labelLayout.measured?1:0:1}],children:[_jsx(AnimatedText,{onLayout:function onLayout(e){return _this2.setState({labelLayout:{width:e.nativeEvent.layout.width,measured:true}});},style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),_jsx(AnimatedText,{style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:hasActiveOutline?this.state.labeled:1}],numberOfLines:1,children:label})]}):null,render(Object.assign({ref:function ref(c){_this2._root=c;},onChange:this._handleChangeText,placeholder:label?this.state.placeholder:this.props.placeholder,placeholderTextColor:placeholderColor,editable:!disabled&&editable,selectionColor:activeColor,multiline:multiline,numberOfLines:numberOfLines,onFocus:this._handleFocus,onBlur:this._handleBlur,underlineColorAndroid:"transparent",style:inputStyles},rest,{value:this.state.value}))]}),leftIconName?_jsx(Icon,{size:iconSize||ICON_SIZE,color:leftIconColor||colors.light,name:leftIconName,style:{position:"absolute",left:leftIconMode==="inset"&&type==="solid"?16:0,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,rightIconName?_jsx(Icon,{name:rightIconName,size:iconSize||ICON_SIZE,color:iconColor||colors.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,assistiveText?_jsx(Text,{style:[{color:error?colors.error:colors.light,marginTop:8,marginLeft:assistiveTextLeftMargin}],children:assistiveText}):null]});}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){return{value:typeof nextProps.value!=="undefined"?nextProps.value:prevState.value};}}]);return TextField;}(React.Component);export default withTheme(TextField);var styles=StyleSheet.create({container:{alignSelf:"stretch"},placeholder:{position:"absolute",left:0},underline:{position:"absolute",left:0,right:0,bottom:0,height:2},input:{flexGrow:1,justifyContent:"center",textAlignVertical:"center",margin:0,textAlign:I18nManager.isRTL?"right":"left"}});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextField.tsx";var _excluded=["theme","Icon","type","disabled","editable","label","error","leftIconName","leftIconMode","rightIconName","iconColor","iconSize","assistiveText","underlineColor","activeBorderColor","multiline","numberOfLines","style","render"],_excluded2=["lineHeight"],_excluded3=["backgroundColor","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import*as React from"react";import{View,Animated,StyleSheet,Text,I18nManager,Platform}from"react-native";import{withTheme}from"../theming";import{applyStyles,extractStyles}from"../utilities";import TextInput from"./TextInput";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var AnimatedText=Animated.createAnimatedComponent(Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var TextField=function(_React$Component){_inherits(TextField,_React$Component);var _super=_createSuper(TextField);function TextField(){var _this;_classCallCheck(this,TextField);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={labeled:new Animated.Value(_this.props.value||_this.props.error?0:1),focused:false,placeholder:_this.props.error?_this.props.placeholder:"",labelLayout:{measured:false,width:0}};_this._timer=setTimeout(function(){},0);_this._showPlaceholder=function(){clearTimeout(_this._timer);_this._timer=setTimeout(function(){return _this.setState({placeholder:_this.props.placeholder});},50);};_this._hidePlaceholder=function(){return _this.setState({placeholder:""});};_this._restoreLabel=function(){return Animated.timing(_this.state.labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._minmizeLabel=function(){return Animated.timing(_this.state.labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._handleFocus=function(){if(_this.props.disabled){return;}_this.setState({focused:true});};_this._handleBlur=function(){if(_this.props.disabled){return;}_this.setState({focused:false});};_this._handleChangeText=function(value){if(_this.props.disabled){return;}if(typeof value==="string"){_this.setState({value:value});_this.props.onChangeText&&_this.props.onChangeText(value);}else{_this.setState({value:value.nativeEvent.text});_this.props.onChangeText&&_this.props.onChangeText(value.nativeEvent.text);}};_this._root=undefined;return _this;}_createClass(TextField,[{key:"componentDidMount",value:function componentDidMount(){if(this.props.defaultValue){this._handleChangeText(this.props.defaultValue);}if(this.props.placeholder){this._minmizeLabel();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(prevState.focused!==this.state.focused||prevState.value!==this.state.value){if(this.state.value||this.state.focused||this.props.error||this.props.placeholder){this._minmizeLabel();}else{this._restoreLabel();}}if(prevState.focused!==this.state.focused||prevProps.label!==this.props.label){if(this.state.focused||this.props.error||!this.props.label){this._showPlaceholder();}else{this._hidePlaceholder();}}}},{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this._timer);}},{key:"toggleFocus",value:function toggleFocus(){this.setState(function(prevState){return{focused:!prevState.focused};});}},{key:"isFocused",value:function isFocused(){return this._root&&this._root.isFocused();}},{key:"clear",value:function clear(){return this._root&&this._root.clear();}},{key:"focus",value:function focus(){return this._root&&this._root.focus();}},{key:"blur",value:function blur(){return this._root&&this._root.blur();}},{key:"render",value:function render(){var _this2=this;var _this$props=this.props,_this$props$theme=_this$props.theme,colors=_this$props$theme.colors,typography=_this$props$theme.typography,roundness=_this$props$theme.roundness,disabledOpacity=_this$props$theme.disabledOpacity,Icon=_this$props.Icon,_this$props$type=_this$props.type,type=_this$props$type===void 0?"underline":_this$props$type,_this$props$disabled=_this$props.disabled,disabled=_this$props$disabled===void 0?false:_this$props$disabled,_this$props$editable=_this$props.editable,editable=_this$props$editable===void 0?true:_this$props$editable,label=_this$props.label,_this$props$error=_this$props.error,error=_this$props$error===void 0?false:_this$props$error,leftIconName=_this$props.leftIconName,leftIconMode=_this$props.leftIconMode,rightIconName=_this$props.rightIconName,iconColor=_this$props.iconColor,iconSize=_this$props.iconSize,assistiveText=_this$props.assistiveText,underlineColorProp=_this$props.underlineColor,_this$props$activeBor=_this$props.activeBorderColor,activeBorderColorProp=_this$props$activeBor===void 0?colors.primary:_this$props$activeBor,_this$props$multiline=_this$props.multiline,multiline=_this$props$multiline===void 0?false:_this$props$multiline,_this$props$numberOfL=_this$props.numberOfLines,numberOfLines=_this$props$numberOfL===void 0?4:_this$props$numberOfL,style=_this$props.style,_this$props$render=_this$props.render,render=_this$props$render===void 0?function(props){return _jsx(TextInput,Object.assign({},props));}:_this$props$render,rest=_objectWithoutProperties(_this$props,_excluded);var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=typography.caption.fontSize;var hasActiveOutline=this.state.focused||error;var inputTextColor,activeColor,underlineColor,borderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.strong;if(disabled){activeColor=colors.light;placeholderColor=colors.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.divider;}else{activeColor=error?colors.error:activeBorderColorProp;placeholderColor=borderColor=colors.light;underlineColor=underlineColorProp||colors.light;backgroundColor=colors.background;}if(rest.placeholderTextColor){placeholderColor=rest.placeholderTextColor;}var _typography$subtitle=typography.subtitle1,lineHeight=_typography$subtitle.lineHeight,subtitle1=_objectWithoutProperties(_typography$subtitle,_excluded2);inputStyle=Object.assign({paddingVertical:0,color:inputTextColor,paddingLeft:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1);if(!multiline){inputStyle.height=lineHeight;}var assistiveTextLeftMargin;if(type==="underline"){containerStyle={borderTopLeftRadius:roundness,borderTopRightRadius:roundness,paddingBottom:12,marginTop:16};if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8;}else{assistiveTextLeftMargin=0;}}else{containerStyle={borderRadius:roundness,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:1,paddingTop:label?16*1.5:16,paddingBottom:label?16*0.5:16,opacity:disabled?disabledOpacity:1,backgroundColor:backgroundColor};if(leftIconName&&leftIconMode==="inset"){assistiveTextLeftMargin=16+4;}else if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8+12;}else{assistiveTextLeftMargin=12;}}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(iconColor){leftIconColor=iconColor;}else if(error){leftIconColor=colors.error;}else if(this.state.focused){leftIconColor=colors.primary;}else{leftIconColor=colors.light;}var labelStyle=Object.assign({},typography.subtitle1,type==="solid"?{marginHorizontal:12}:{},{top:type==="solid"?16:0,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,transform:[{translateY:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(this.state.labelLayout.width/2),0]})}]});var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles;var inputStyles=applyStyles([styles.input,inputStyle,type==="solid"?{marginHorizontal:16}:{marginHorizontal:6}],textStyles);var _ref=StyleSheet.flatten(style||{}),bgColor=_ref.backgroundColor,padding=_ref.padding,paddingTop=_ref.paddingTop,paddingBottom=_ref.paddingBottom,paddingLeft=_ref.paddingLeft,paddingRight=_ref.paddingRight,borderRadius=_ref.borderRadius,borderWidth=_ref.borderWidth,borderTopWidth=_ref.borderTopWidth,borderRightWidth=_ref.borderRightWidth,borderBottomWidth=_ref.borderBottomWidth,borderLeftWidth=_ref.borderLeftWidth,borderCol=_ref.borderColor,styleProp=_objectWithoutProperties(_ref,_excluded3);return _jsxs(View,{style:[styles.container,styleProp],children:[_jsxs(View,{style:applyStyles([containerStyle],{height:styleProp.height,backgroundColor:bgColor,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,borderRadius:borderRadius,borderWidth:borderWidth,borderTopWidth:borderTopWidth,borderRightWidth:borderRightWidth,borderBottomWidth:borderBottomWidth,borderLeftWidth:borderLeftWidth,borderColor:borderCol}),children:[type==="underline"?_jsx(Animated.View,{style:[styles.underline,{backgroundColor:bgColor||(error?colors.error:this.state.focused?activeColor:underlineColor),transform:[{scaleY:this.state.focused?1:0.5}]}]}):null,label?_jsxs(View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{opacity:this.state.value||this.state.focused?this.state.labelLayout.measured?1:0:1}],children:[_jsx(AnimatedText,{onLayout:function onLayout(e){return _this2.setState({labelLayout:{width:e.nativeEvent.layout.width,measured:true}});},style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),_jsx(AnimatedText,{style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:hasActiveOutline?this.state.labeled:1}],numberOfLines:1,children:label})]}):null,render(Object.assign({ref:function ref(c){_this2._root=c;},onChange:this._handleChangeText,placeholder:label?this.state.placeholder:this.props.placeholder,placeholderTextColor:placeholderColor,editable:!disabled&&editable,selectionColor:activeColor,multiline:multiline,numberOfLines:numberOfLines,onFocus:this._handleFocus,onBlur:this._handleBlur,underlineColorAndroid:"transparent",style:inputStyles},rest,{value:this.state.value}))]}),leftIconName?_jsx(Icon,{size:iconSize||ICON_SIZE,color:leftIconColor||colors.light,name:leftIconName,style:{position:"absolute",left:leftIconMode==="inset"&&type==="solid"?16:0,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,rightIconName?_jsx(Icon,{name:rightIconName,size:iconSize||ICON_SIZE,color:iconColor||colors.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,assistiveText?_jsx(Text,{style:[{color:error?colors.error:colors.light,marginTop:8,marginLeft:assistiveTextLeftMargin}],children:assistiveText}):null]});}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){return{value:typeof nextProps.value!=="undefined"?nextProps.value:prevState.value};}}]);return TextField;}(React.Component);export default withTheme(TextField);var styles=StyleSheet.create({container:{alignSelf:"stretch"},placeholder:{position:"absolute",left:0},underline:{position:"absolute",left:0,right:0,bottom:0,height:2},input:{flexGrow:1,justifyContent:"center",textAlignVertical:"center",margin:0,textAlign:I18nManager.isRTL?"right":"left"}});
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","label","style","iconColor","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AccordionItem.tsx";import*as React from"react";import{Pressable,StyleSheet,View}from"react-native";import Text from"../components/Text";import{extractStyles}from"../utilities";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function AccordionItem(_ref){var Icon=_ref.Icon,icon=_ref.icon,label=_ref.label,style=_ref.style,iconColor=_ref.iconColor,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsx(Pressable,Object.assign({style:[styles.container,viewStyles]},rest,{children:_jsxs(View,{style:styles.row,children:[icon?_jsx(Icon,{name:icon,size:24,color:iconColor||theme.colors.primary}):null,_jsx(View,{style:[styles.item,styles.content],children:_jsx(Text,{selectable:false,style:textStyles,children:label})})]})}));};var styles=StyleSheet.create({container:{padding:8},row:{flexDirection:"row",alignItems:"center",paddingLeft:8},item:{marginVertical:6,paddingLeft:8},content:{flex:1,justifyContent:"center"}});export default withTheme(AccordionItem);
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","label","style","iconColor","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AccordionItem.tsx";import*as React from"react";import{Pressable,StyleSheet,View}from"react-native";import Text from"../components/Text";import{extractStyles}from"../utilities";import{withTheme}from"../theming";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function AccordionItem(_ref){var Icon=_ref.Icon,icon=_ref.icon,label=_ref.label,style=_ref.style,iconColor=_ref.iconColor,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsx(Pressable,Object.assign({style:[styles.container,viewStyles]},rest,{children:_jsxs(View,{style:styles.row,children:[icon?_jsx(Icon,{name:icon,size:24,color:iconColor||theme.colors.primary}):null,_jsx(View,{style:[styles.item,styles.content],children:_jsx(Text,{selectable:false,style:textStyles,children:label})})]})}));};var styles=StyleSheet.create({container:{padding:8},row:{flexDirection:"row",alignItems:"center",paddingLeft:8},item:{marginVertical:6,paddingLeft:8},content:{flex:1,justifyContent:"center"}});export default withTheme(AccordionItem);
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","image","size","onPress","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvatarEdit.tsx";import*as React from"react";import{View}from"react-native";import Touchable from"../components/Touchable";import CircleImage from"./CircleImage";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AvatarEdit=function AvatarEdit(_ref){var Icon=_ref.Icon,image=_ref.image,_ref$size=_ref.size,size=_ref$size===void 0?80:_ref$size,_ref$onPress=_ref.onPress,onPress=_ref$onPress===void 0?function(){}:_ref$onPress,style=_ref.style,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var colorStyles={editBackgroundColor:theme.colors.primary,editIconColor:theme.colors.surface,editBorderColor:theme.colors.surface};var dimensions={width:size,height:size};return _jsx(View,Object.assign({style:[style,dimensions]},rest,{children:_jsxs(Touchable,{onPress:onPress,children:[_jsx(CircleImage,{source:image,size:size}),_jsx(View,{style:{position:"absolute",top:-3,right:-3,borderColor:colorStyles.editBorderColor,backgroundColor:colorStyles.editBackgroundColor,borderRadius:size*(3/16),padding:size*(3/32)},children:_jsx(Icon,{name:"MaterialIcons/edit",color:colorStyles.editIconColor,size:size*(3/16)})})]})}));};export default withTheme(AvatarEdit);
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","image","size","onPress","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvatarEdit.tsx";import*as React from"react";import{View}from"react-native";import Touchable from"../components/Touchable";import CircleImage from"./CircleImage";import{withTheme}from"../theming";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var AvatarEdit=function AvatarEdit(_ref){var Icon=_ref.Icon,image=_ref.image,_ref$size=_ref.size,size=_ref$size===void 0?80:_ref$size,_ref$onPress=_ref.onPress,onPress=_ref$onPress===void 0?function(){}:_ref$onPress,style=_ref.style,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var colorStyles={editBackgroundColor:theme.colors.primary,editIconColor:theme.colors.surface,editBorderColor:theme.colors.surface};var dimensions={width:size,height:size};return _jsx(View,Object.assign({style:[style,dimensions]},rest,{children:_jsxs(Touchable,{onPress:onPress,children:[_jsx(CircleImage,{source:image,size:size}),_jsx(View,{style:{position:"absolute",top:-3,right:-3,borderColor:colorStyles.editBorderColor,backgroundColor:colorStyles.editBackgroundColor,borderRadius:size*(3/16),padding:size*(3/32)},children:_jsx(Icon,{name:"MaterialIcons/edit",color:colorStyles.editIconColor,size:size*(3/16)})})]})}));};export default withTheme(AvatarEdit);
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["initiallyVisible","dismissable","icon","buttonColor","content","contentStyle","style","theme","Icon"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Banner.tsx";import*as React from"react";import{Button,Text,View,StyleSheet,Animated}from"react-native";import Surface from"../components/Surface";import shadow from"../styles/shadow";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ELEVATION=1;var DEFAULT_MAX_WIDTH=960;var Banner=function Banner(_ref){var _ref$initiallyVisible=_ref.initiallyVisible,initiallyVisible=_ref$initiallyVisible===void 0?true:_ref$initiallyVisible,_ref$dismissable=_ref.dismissable,dismissable=_ref$dismissable===void 0?true:_ref$dismissable,icon=_ref.icon,buttonColor=_ref.buttonColor,content=_ref.content,contentStyle=_ref.contentStyle,style=_ref.style,theme=_ref.theme,Icon=_ref.Icon,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(initiallyVisible),_React$useState2=_slicedToArray(_React$useState,2),visible=_React$useState2[0],setVisible=_React$useState2[1];React.useEffect(function(){if(initiallyVisible){setVisible(true);}},[initiallyVisible]);var _React$useRef=React.useRef(new Animated.Value(visible?1:0)),position=_React$useRef.current;var _React$useState3=React.useState({height:0,measured:false}),_React$useState4=_slicedToArray(_React$useState3,2),layout=_React$useState4[0],setLayout=_React$useState4[1];React.useEffect(function(){if(visible){Animated.timing(position,{duration:250,toValue:1,useNativeDriver:false}).start();}else{Animated.timing(position,{duration:200,toValue:0,useNativeDriver:false}).start();}},[visible,position]);var handleLayout=function handleLayout(_ref2){var nativeEvent=_ref2.nativeEvent;var height=nativeEvent.layout.height;setLayout({height:height,measured:true});};var height=Animated.multiply(position,layout.height);var translateY=Animated.multiply(Animated.add(position,-1),layout.height);return _jsx(Surface,Object.assign({},rest,{style:[styles.container,shadow(ELEVATION),style],children:_jsxs(View,{style:[styles.wrapper,contentStyle],children:[_jsx(Animated.View,{style:{height:height}}),_jsxs(Animated.View,{onLayout:handleLayout,style:[layout.measured||!visible?[styles.absolute,{transform:[{translateY:translateY}]}]:null,!layout.measured&&!visible?{opacity:0}:null],children:[_jsxs(View,{style:[styles.content,{marginBottom:dismissable?0:16}],children:[icon?_jsx(View,{style:styles.icon,children:_jsx(Icon,{name:icon,size:40})}):null,_jsx(Text,{style:[styles.message,{color:theme.colors.text}],accessibilityLiveRegion:visible?"polite":"none",accessibilityRole:"alert",children:content})]}),dismissable?_jsx(View,{style:styles.actions,children:_jsx(Button,{color:buttonColor||theme.colors.primary,title:"Close",onPress:function onPress(){return setVisible(false);}})}):null]})]})}));};var styles=StyleSheet.create({container:{elevation:ELEVATION},wrapper:{overflow:"hidden",alignSelf:"center",width:"100%",maxWidth:DEFAULT_MAX_WIDTH},absolute:{position:"absolute",top:0,width:"100%"},content:{flexDirection:"row",justifyContent:"flex-start",marginHorizontal:8,marginTop:16,marginBottom:0},icon:{margin:8},message:{flex:1,margin:8},actions:{flexDirection:"row",justifyContent:"flex-end",margin:8}});export default withTheme(Banner);
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["initiallyVisible","dismissable","icon","buttonColor","content","contentStyle","style","theme","Icon"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Banner.tsx";import*as React from"react";import{Button,Text,View,StyleSheet,Animated}from"react-native";import Surface from"../components/Surface";import shadow from"../styles/shadow";import{withTheme}from"../theming";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var ELEVATION=1;var DEFAULT_MAX_WIDTH=960;var Banner=function Banner(_ref){var _ref$initiallyVisible=_ref.initiallyVisible,initiallyVisible=_ref$initiallyVisible===void 0?true:_ref$initiallyVisible,_ref$dismissable=_ref.dismissable,dismissable=_ref$dismissable===void 0?true:_ref$dismissable,icon=_ref.icon,buttonColor=_ref.buttonColor,content=_ref.content,contentStyle=_ref.contentStyle,style=_ref.style,theme=_ref.theme,Icon=_ref.Icon,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(initiallyVisible),_React$useState2=_slicedToArray(_React$useState,2),visible=_React$useState2[0],setVisible=_React$useState2[1];React.useEffect(function(){if(initiallyVisible){setVisible(true);}},[initiallyVisible]);var _React$useRef=React.useRef(new Animated.Value(visible?1:0)),position=_React$useRef.current;var _React$useState3=React.useState({height:0,measured:false}),_React$useState4=_slicedToArray(_React$useState3,2),layout=_React$useState4[0],setLayout=_React$useState4[1];React.useEffect(function(){if(visible){Animated.timing(position,{duration:250,toValue:1,useNativeDriver:false}).start();}else{Animated.timing(position,{duration:200,toValue:0,useNativeDriver:false}).start();}},[visible,position]);var handleLayout=function handleLayout(_ref2){var nativeEvent=_ref2.nativeEvent;var height=nativeEvent.layout.height;setLayout({height:height,measured:true});};var height=Animated.multiply(position,layout.height);var translateY=Animated.multiply(Animated.add(position,-1),layout.height);return _jsx(Surface,Object.assign({},rest,{style:[styles.container,shadow(ELEVATION),style],children:_jsxs(View,{style:[styles.wrapper,contentStyle],children:[_jsx(Animated.View,{style:{height:height}}),_jsxs(Animated.View,{onLayout:handleLayout,style:[layout.measured||!visible?[styles.absolute,{transform:[{translateY:translateY}]}]:null,!layout.measured&&!visible?{opacity:0}:null],children:[_jsxs(View,{style:[styles.content,{marginBottom:dismissable?0:16}],children:[icon?_jsx(View,{style:styles.icon,children:_jsx(Icon,{name:icon,size:40})}):null,_jsx(Text,{style:[styles.message,{color:theme.colors.text}],accessibilityLiveRegion:visible?"polite":"none",accessibilityRole:"alert",children:content})]}),dismissable?_jsx(View,{style:styles.actions,children:_jsx(Button,{color:buttonColor||theme.colors.primary,title:"Close",onPress:function onPress(){return setVisible(false);}})}):null]})]})}));};var styles=StyleSheet.create({container:{elevation:ELEVATION},wrapper:{overflow:"hidden",alignSelf:"center",width:"100%",maxWidth:DEFAULT_MAX_WIDTH},absolute:{position:"absolute",top:0,width:"100%"},content:{flexDirection:"row",justifyContent:"flex-start",marginHorizontal:8,marginTop:16,marginBottom:0},icon:{margin:8},message:{flex:1,margin:8},actions:{flexDirection:"row",justifyContent:"flex-end",margin:8}});export default withTheme(Banner);
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["backgroundColor","padding"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Card.tsx";import React from"react";import{StyleSheet,View,Pressable}from"react-native";import Image from"../components/Image";import Surface from"../components/Surface";import{Title,Subtitle,Caption}from"../components/Typography";import{withTheme}from"../theming";import Config from"../components/Config";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ICON_SIZE=Config.cardIconSize;var ICON_CONTAINER_SIZE=Config.cardIconSize*2;var ICON_CONTAINER_PADDING=Config.cardIconSize/2-1;var ICON_ELEVATION=Config.cardIconElevation;export var TopRightCircleIcon=withTheme(function(_ref){var Icon=_ref.Icon,icon=_ref.icon,theme=_ref.theme,onPress=_ref.onPress;return _jsx(Surface,{style:{justifyContent:"center",alignItems:"center",elevation:ICON_ELEVATION,position:"absolute",top:12,right:12,width:ICON_CONTAINER_SIZE,height:ICON_CONTAINER_SIZE,padding:ICON_CONTAINER_PADDING,borderRadius:ICON_CONTAINER_SIZE,backgroundColor:"rgba(0, 0, 0, 0.1)"},children:_jsx(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?0.8:1}];},children:_jsx(Icon,{name:icon,size:ICON_SIZE,color:theme.colors.surface})})});});var Card=function Card(_ref3){var Icon=_ref3.Icon,_ref3$image=_ref3.image,image=_ref3$image===void 0?Config.cardImageUrl:_ref3$image,title=_ref3.title,subtitle=_ref3.subtitle,description=_ref3.description,textCentered=_ref3.textCentered,icon=_ref3.icon,_ref3$aspectRatio=_ref3.aspectRatio,aspectRatio=_ref3$aspectRatio===void 0?1.5:_ref3$aspectRatio,_ref3$elevation=_ref3.elevation,elevation=_ref3$elevation===void 0?2:_ref3$elevation,style=_ref3.style,onPress=_ref3.onPress,onPressIcon=_ref3.onPressIcon,titleStyle=_ref3.titleStyle,subtitleStyle=_ref3.subtitleStyle,descriptionStyle=_ref3.descriptionStyle,theme=_ref3.theme,children=_ref3.children;var _StyleSheet$flatten=StyleSheet.flatten(style||{}),bgColor=_StyleSheet$flatten.backgroundColor,padding=_StyleSheet$flatten.padding,styles=_objectWithoutProperties(_StyleSheet$flatten,_excluded);var backgroundColor=bgColor?bgColor:theme.colors.surface;var innerPadding=padding?padding:12;return _jsx(Surface,{style:[{elevation:elevation,backgroundColor:backgroundColor},styles],children:_jsxs(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref4){var pressed=_ref4.pressed;return[{opacity:pressed?0.8:1}];},children:[_jsx(Image,{style:{aspectRatio:aspectRatio},source:typeof image==="string"?{uri:image}:image,resizeMode:"cover"}),_jsx(View,{style:{padding:innerPadding},children:_jsxs(View,{style:{alignItems:textCentered?"center":"flex-start"},children:[title||title&&title!==""?_jsx(Title,{text:title,style:titleStyle}):null,subtitle||subtitle&&subtitle!==""?_jsx(Subtitle,{text:subtitle,style:subtitleStyle}):null,description||description&&description!==""?_jsx(View,{style:{marginTop:4},children:_jsx(Caption,{text:description,style:descriptionStyle})}):null,children]})}),icon?_jsx(TopRightCircleIcon,{Icon:Icon,icon:icon,onPress:onPressIcon}):null]})});};export default withTheme(Card);
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["backgroundColor","padding"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Card.tsx";import React from"react";import{StyleSheet,View,Pressable}from"react-native";import Image from"../components/Image";import Surface from"../components/Surface";import{Title,Subtitle,Caption}from"../components/Typography";import{withTheme}from"../theming";import Config from"../components/Config";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var ICON_SIZE=Config.cardIconSize;var ICON_CONTAINER_SIZE=Config.cardIconSize*2;var ICON_CONTAINER_PADDING=Config.cardIconSize/2-1;var ICON_ELEVATION=Config.cardIconElevation;export var TopRightCircleIcon=withTheme(function(_ref){var Icon=_ref.Icon,icon=_ref.icon,theme=_ref.theme,onPress=_ref.onPress;return _jsx(Surface,{style:{justifyContent:"center",alignItems:"center",elevation:ICON_ELEVATION,position:"absolute",top:12,right:12,width:ICON_CONTAINER_SIZE,height:ICON_CONTAINER_SIZE,padding:ICON_CONTAINER_PADDING,borderRadius:ICON_CONTAINER_SIZE,backgroundColor:"rgba(0, 0, 0, 0.1)"},children:_jsx(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?0.8:1}];},children:_jsx(Icon,{name:icon,size:ICON_SIZE,color:theme.colors.surface})})});});var Card=function Card(_ref3){var Icon=_ref3.Icon,_ref3$image=_ref3.image,image=_ref3$image===void 0?Config.cardImageUrl:_ref3$image,title=_ref3.title,subtitle=_ref3.subtitle,description=_ref3.description,textCentered=_ref3.textCentered,icon=_ref3.icon,_ref3$aspectRatio=_ref3.aspectRatio,aspectRatio=_ref3$aspectRatio===void 0?1.5:_ref3$aspectRatio,_ref3$elevation=_ref3.elevation,elevation=_ref3$elevation===void 0?2:_ref3$elevation,style=_ref3.style,onPress=_ref3.onPress,onPressIcon=_ref3.onPressIcon,titleStyle=_ref3.titleStyle,subtitleStyle=_ref3.subtitleStyle,descriptionStyle=_ref3.descriptionStyle,theme=_ref3.theme,children=_ref3.children;var _StyleSheet$flatten=StyleSheet.flatten(style||{}),bgColor=_StyleSheet$flatten.backgroundColor,padding=_StyleSheet$flatten.padding,styles=_objectWithoutProperties(_StyleSheet$flatten,_excluded);var backgroundColor=bgColor?bgColor:theme.colors.surface;var innerPadding=padding?padding:12;return _jsx(Surface,{style:[{elevation:elevation,backgroundColor:backgroundColor},styles],children:_jsxs(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref4){var pressed=_ref4.pressed;return[{opacity:pressed?0.8:1}];},children:[_jsx(Image,{style:{aspectRatio:aspectRatio},source:typeof image==="string"?{uri:image}:image,resizeMode:"cover"}),_jsx(View,{style:{padding:innerPadding},children:_jsxs(View,{style:{alignItems:textCentered?"center":"flex-start"},children:[title||title&&title!==""?_jsx(Title,{text:title,style:titleStyle}):null,subtitle||subtitle&&subtitle!==""?_jsx(Subtitle,{text:subtitle,style:subtitleStyle}):null,description||description&&description!==""?_jsx(View,{style:{marginTop:4},children:_jsx(Caption,{text:description,style:descriptionStyle})}):null,children]})}),icon?_jsx(TopRightCircleIcon,{Icon:Icon,icon:icon,onPress:onPressIcon}):null]})});};export default withTheme(Card);
@@ -1 +1 @@
1
- import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/CircularProgress.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import React from"react";import{View}from"react-native";import{Svg,Path,G}from"react-native-svg";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularProgress=function(_React$Component){_inherits(CircularProgress,_React$Component);var _super=_createSuper(CircularProgress);function CircularProgress(){var _this;_classCallCheck(this,CircularProgress);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.polarToCartesian=function(centerX,centerY,radius,angleInDegrees){var angleInRadians=(angleInDegrees-90)*Math.PI/180.0;return{x:centerX+radius*Math.cos(angleInRadians),y:centerY+radius*Math.sin(angleInRadians)};};_this.circlePath=function(x,y,radius,startAngle,endAngle){var start=_this.polarToCartesian(x,y,radius,endAngle*0.9999);var end=_this.polarToCartesian(x,y,radius,startAngle);var largeArcFlag=endAngle-startAngle<=180?"0":"1";var d=["M",start.x,start.y,"A",radius,radius,0,largeArcFlag,0,end.x,end.y];return d.join(" ");};_this.clampFill=function(fill){return Math.min(100,Math.max(0,fill));};return _this;}_createClass(CircularProgress,[{key:"render",value:function render(){var _this$props=this.props,size=_this$props.size,width=_this$props.width,backgroundWidth=_this$props.backgroundWidth,_this$props$tintColor=_this$props.tintColor,tintColor=_this$props$tintColor===void 0?"black":_this$props$tintColor,_this$props$tintTrans=_this$props.tintTransparency,tintTransparency=_this$props$tintTrans===void 0?true:_this$props$tintTrans,backgroundColor=_this$props.backgroundColor,style=_this$props.style,_this$props$rotation=_this$props.rotation,rotation=_this$props$rotation===void 0?90:_this$props$rotation,_this$props$lineCap=_this$props.lineCap,lineCap=_this$props$lineCap===void 0?"butt":_this$props$lineCap,_this$props$arcSweepA=_this$props.arcSweepAngle,arcSweepAngle=_this$props$arcSweepA===void 0?360:_this$props$arcSweepA,fill=_this$props.fill,children=_this$props.children,childrenContainerStyle=_this$props.childrenContainerStyle,_this$props$padding=_this$props.padding,padding=_this$props$padding===void 0?0:_this$props$padding,renderCap=_this$props.renderCap,_this$props$dashedBac=_this$props.dashedBackground,dashedBackground=_this$props$dashedBac===void 0?{width:0,gap:0}:_this$props$dashedBac,_this$props$dashedTin=_this$props.dashedTint,dashedTint=_this$props$dashedTin===void 0?{width:0,gap:0}:_this$props$dashedTin;var maxWidthCircle=backgroundWidth?Math.max(width,backgroundWidth):width;var sizeWithPadding=size/2+padding/2;var radius=size/2-maxWidthCircle/2-padding/2;var currentFillAngle=arcSweepAngle*this.clampFill(fill)/100;var backgroundPath=this.circlePath(sizeWithPadding,sizeWithPadding,radius,tintTransparency?0:currentFillAngle,arcSweepAngle);var circlePathItem=this.circlePath(sizeWithPadding,sizeWithPadding,radius,0,currentFillAngle);var coordinate=this.polarToCartesian(sizeWithPadding,sizeWithPadding,radius,currentFillAngle);var cap=renderCap?renderCap({center:coordinate}):null;var offset=size-maxWidthCircle*2;var localChildrenContainerStyle=[{position:"absolute",left:maxWidthCircle+padding/2,top:maxWidthCircle+padding/2,width:offset,height:offset,borderRadius:offset/2,alignItems:"center",justifyContent:"center",overflow:"hidden"},childrenContainerStyle];var strokeDasharrayTint=dashedTint.gap>0?Object.values(dashedTint).map(function(value){return value.toString();}).join(" "):"";var strokeDasharrayBackground=dashedBackground.gap>0?Object.values(dashedBackground).map(function(value){return value.toString();}).join(" "):"";return _jsxs(View,{style:style,children:[_jsx(Svg,{width:size+padding,height:size+padding,children:_jsxs(G,{rotation:rotation,originX:(size+padding)/2,originY:(size+padding)/2,children:[backgroundColor&&_jsx(Path,{d:backgroundPath,stroke:backgroundColor,strokeWidth:backgroundWidth||width,strokeLinecap:lineCap,strokeDasharray:strokeDasharrayBackground,fill:"transparent"}),fill>0&&_jsx(Path,{d:circlePathItem,stroke:tintColor,strokeWidth:width,strokeLinecap:lineCap,strokeDasharray:strokeDasharrayTint,fill:"transparent"}),cap]})}),children&&_jsx(View,{style:localChildrenContainerStyle,children:children(fill)})]});}}]);return CircularProgress;}(React.Component);export default CircularProgress;
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/CircularProgress.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import React from"react";import{View}from"react-native";import{Svg,Path,G}from"react-native-svg";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var CircularProgress=function(_React$Component){_inherits(CircularProgress,_React$Component);var _super=_createSuper(CircularProgress);function CircularProgress(){var _this;_classCallCheck(this,CircularProgress);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.polarToCartesian=function(centerX,centerY,radius,angleInDegrees){var angleInRadians=(angleInDegrees-90)*Math.PI/180.0;return{x:centerX+radius*Math.cos(angleInRadians),y:centerY+radius*Math.sin(angleInRadians)};};_this.circlePath=function(x,y,radius,startAngle,endAngle){var start=_this.polarToCartesian(x,y,radius,endAngle*0.9999);var end=_this.polarToCartesian(x,y,radius,startAngle);var largeArcFlag=endAngle-startAngle<=180?"0":"1";var d=["M",start.x,start.y,"A",radius,radius,0,largeArcFlag,0,end.x,end.y];return d.join(" ");};_this.clampFill=function(fill){return Math.min(100,Math.max(0,fill));};return _this;}_createClass(CircularProgress,[{key:"render",value:function render(){var _this$props=this.props,size=_this$props.size,width=_this$props.width,backgroundWidth=_this$props.backgroundWidth,_this$props$tintColor=_this$props.tintColor,tintColor=_this$props$tintColor===void 0?"black":_this$props$tintColor,_this$props$tintTrans=_this$props.tintTransparency,tintTransparency=_this$props$tintTrans===void 0?true:_this$props$tintTrans,backgroundColor=_this$props.backgroundColor,style=_this$props.style,_this$props$rotation=_this$props.rotation,rotation=_this$props$rotation===void 0?90:_this$props$rotation,_this$props$lineCap=_this$props.lineCap,lineCap=_this$props$lineCap===void 0?"butt":_this$props$lineCap,_this$props$arcSweepA=_this$props.arcSweepAngle,arcSweepAngle=_this$props$arcSweepA===void 0?360:_this$props$arcSweepA,fill=_this$props.fill,children=_this$props.children,childrenContainerStyle=_this$props.childrenContainerStyle,_this$props$padding=_this$props.padding,padding=_this$props$padding===void 0?0:_this$props$padding,renderCap=_this$props.renderCap,_this$props$dashedBac=_this$props.dashedBackground,dashedBackground=_this$props$dashedBac===void 0?{width:0,gap:0}:_this$props$dashedBac,_this$props$dashedTin=_this$props.dashedTint,dashedTint=_this$props$dashedTin===void 0?{width:0,gap:0}:_this$props$dashedTin;var maxWidthCircle=backgroundWidth?Math.max(width,backgroundWidth):width;var sizeWithPadding=size/2+padding/2;var radius=size/2-maxWidthCircle/2-padding/2;var currentFillAngle=arcSweepAngle*this.clampFill(fill)/100;var backgroundPath=this.circlePath(sizeWithPadding,sizeWithPadding,radius,tintTransparency?0:currentFillAngle,arcSweepAngle);var circlePathItem=this.circlePath(sizeWithPadding,sizeWithPadding,radius,0,currentFillAngle);var coordinate=this.polarToCartesian(sizeWithPadding,sizeWithPadding,radius,currentFillAngle);var cap=renderCap?renderCap({center:coordinate}):null;var offset=size-maxWidthCircle*2;var localChildrenContainerStyle=[{position:"absolute",left:maxWidthCircle+padding/2,top:maxWidthCircle+padding/2,width:offset,height:offset,borderRadius:offset/2,alignItems:"center",justifyContent:"center",overflow:"hidden"},childrenContainerStyle];var strokeDasharrayTint=dashedTint.gap>0?Object.values(dashedTint).map(function(value){return value.toString();}).join(" "):"";var strokeDasharrayBackground=dashedBackground.gap>0?Object.values(dashedBackground).map(function(value){return value.toString();}).join(" "):"";return _jsxs(View,{style:style,children:[_jsx(Svg,{width:size+padding,height:size+padding,children:_jsxs(G,{rotation:rotation,originX:(size+padding)/2,originY:(size+padding)/2,children:[backgroundColor&&_jsx(Path,{d:backgroundPath,stroke:backgroundColor,strokeWidth:backgroundWidth||width,strokeLinecap:lineCap,strokeDasharray:strokeDasharrayBackground,fill:"transparent"}),fill>0&&_jsx(Path,{d:circlePathItem,stroke:tintColor,strokeWidth:width,strokeLinecap:lineCap,strokeDasharray:strokeDasharrayTint,fill:"transparent"}),cap]})}),children&&_jsx(View,{style:localChildrenContainerStyle,children:children(fill)})]});}}]);return CircularProgress;}(React.Component);export default CircularProgress;
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","labelColor","color","children","onPress","elevation","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedButton.tsx";import*as React from"react";import{ActivityIndicator,View,Text,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Elevation from"../components/Elevation";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Button=function Button(_ref){var Icon=_ref.Icon,icon=_ref.icon,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$type=_ref.type,type=_ref$type===void 0?"solid":_ref$type,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,labelColor=_ref.labelColor,colorOverride=_ref.color,children=_ref.children,onPress=_ref.onPress,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?0:_ref$elevation,_ref$theme=_ref.theme,colors=_ref$theme.colors,disabledOpacity=_ref$theme.disabledOpacity,roundness=_ref$theme.roundness,typography=_ref$theme.typography,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor,borderColor,textColor,borderWidth;var buttonColor=colorOverride||colors.primary;if(type==="solid"){backgroundColor=buttonColor;if(disabled){textColor=color(colors.surface).alpha(disabledOpacity).rgb().string();}else{textColor=labelColor||colors.surface;}}else{backgroundColor="transparent";if(disabled){textColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{textColor=labelColor||buttonColor;}}if(type==="outline"){if(disabled){borderColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{borderColor=buttonColor;}borderWidth=StyleSheet.hairlineWidth;}else{borderColor="transparent";borderWidth=0;}var buttonStyle={backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,borderRadius:roundness};var textStyle={textAlign:"center",color:textColor,marginVertical:16,marginHorizontal:16};var iconStyle=[styles.icon,{marginLeft:16,marginRight:-8,width:Config.buttonIconSize}];return _jsx(Elevation,{style:{elevation:elevation,alignSelf:"stretch"},children:_jsx(Pressable,Object.assign({},rest,{onPress:onPress,accessibilityState:{disabled:disabled},accessibilityRole:"button",disabled:disabled||loading,style:[styles.button,buttonStyle],children:_jsxs(View,{style:styles.content,children:[icon&&loading!==true?_jsx(View,{style:iconStyle,children:_jsx(Icon,{name:icon,size:Config.buttonIconSize,color:textColor})}):null,loading?_jsx(ActivityIndicator,{size:"small",color:textColor,style:iconStyle}):null,_jsx(Text,{numberOfLines:1,style:[textStyle,typography.button],children:children})]})}))});};var styles=StyleSheet.create({button:{minWidth:64,borderStyle:"solid"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},icon:{width:Config.buttonIconSize}});export default withTheme(Button);
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","labelColor","color","children","onPress","elevation","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedButton.tsx";import*as React from"react";import{ActivityIndicator,View,Text,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Elevation from"../components/Elevation";import{withTheme}from"../theming";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var Button=function Button(_ref){var Icon=_ref.Icon,icon=_ref.icon,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$type=_ref.type,type=_ref$type===void 0?"solid":_ref$type,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,labelColor=_ref.labelColor,colorOverride=_ref.color,children=_ref.children,onPress=_ref.onPress,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?0:_ref$elevation,_ref$theme=_ref.theme,colors=_ref$theme.colors,disabledOpacity=_ref$theme.disabledOpacity,roundness=_ref$theme.roundness,typography=_ref$theme.typography,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor,borderColor,textColor,borderWidth;var buttonColor=colorOverride||colors.primary;if(type==="solid"){backgroundColor=buttonColor;if(disabled){textColor=color(colors.surface).alpha(disabledOpacity).rgb().string();}else{textColor=labelColor||colors.surface;}}else{backgroundColor="transparent";if(disabled){textColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{textColor=labelColor||buttonColor;}}if(type==="outline"){if(disabled){borderColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{borderColor=buttonColor;}borderWidth=StyleSheet.hairlineWidth;}else{borderColor="transparent";borderWidth=0;}var buttonStyle={backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,borderRadius:roundness};var textStyle={textAlign:"center",color:textColor,marginVertical:16,marginHorizontal:16};var iconStyle=[styles.icon,{marginLeft:16,marginRight:-8,width:Config.buttonIconSize}];return _jsx(Elevation,{style:{elevation:elevation,alignSelf:"stretch"},children:_jsx(Pressable,Object.assign({},rest,{onPress:onPress,accessibilityState:{disabled:disabled},accessibilityRole:"button",disabled:disabled||loading,style:[styles.button,buttonStyle],children:_jsxs(View,{style:styles.content,children:[icon&&loading!==true?_jsx(View,{style:iconStyle,children:_jsx(Icon,{name:icon,size:Config.buttonIconSize,color:textColor})}):null,loading?_jsx(ActivityIndicator,{size:"small",color:textColor,style:iconStyle}):null,_jsx(Text,{numberOfLines:1,style:[textStyle,typography.button],children:children})]})}))});};var styles=StyleSheet.create({button:{minWidth:64,borderStyle:"solid"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},icon:{width:Config.buttonIconSize}});export default withTheme(Button);
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","color","label","onPress","elevation","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedFAB.tsx";import*as React from"react";import{ActivityIndicator,View,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Text from"../components/Text";import Elevation from"../components/Elevation";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var FAB=function FAB(_ref){var Icon=_ref.Icon,icon=_ref.icon,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$type=_ref.type,type=_ref$type===void 0?"solid":_ref$type,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,colorOverride=_ref.color,label=_ref.label,onPress=_ref.onPress,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?0:_ref$elevation,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,disabledOpacity=_ref$theme.disabledOpacity,roundness=_ref$theme.roundness,typography=_ref$theme.typography,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor,borderColor,textColor,borderWidth;var buttonColor=colorOverride||colors.primary;if(type==="standard"||type==="extended"||type==="fixed"){backgroundColor=buttonColor;if(disabled){textColor=color(colors.surface).alpha(disabledOpacity).rgb().string();}else{textColor=colors.surface;}}else{backgroundColor="transparent";if(disabled){textColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{textColor=buttonColor;}}if(type==="outline"){if(disabled){borderColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{borderColor=buttonColor;}borderWidth=StyleSheet.hairlineWidth;}else{borderColor="transparent";borderWidth=0;}var buttonStyle={backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,borderRadius:roundness,alignItems:"center",justifyContent:"center"};var buttonStyles=[styles.button,buttonStyle];var contentStyle=[styles.content];var textStyle={textAlign:"center",color:textColor};var iconStyle=[styles.icon,{width:Config.buttonIconSize}];if(type==="standard"||type==="outline"){buttonStyle.width=Config.FABSize;buttonStyle.height=Config.FABSize;buttonStyle.borderRadius=Config.FABBorderRadius;contentStyle.push({width:Config.FABSize,height:Config.FABSize});}if(type==="extended"||type==="fixed"){iconStyle.push({marginLeft:16,marginRight:-8});textStyle.margin=16;}if(type==="fixed"){buttonStyles.push({height:Config.FABFixedHeight,alignSelf:"stretch"});}return _jsx(Elevation,{style:[{elevation:elevation},style],children:_jsx(Pressable,Object.assign({},rest,{onPress:onPress,accessibilityState:{disabled:disabled},accessibilityRole:"button",disabled:disabled||loading,style:buttonStyles,children:_jsxs(View,{style:styles.content,children:[icon&&loading!==true?_jsx(View,{style:iconStyle,children:_jsx(Icon,{name:icon,size:Config.buttonIconSize,color:textColor})}):null,loading?_jsx(ActivityIndicator,{size:"small",color:textColor,style:iconStyle}):null,label?_jsx(Text,{numberOfLines:1,style:[textStyle,typography.button],children:label}):null]})}))});};var styles=StyleSheet.create({button:{borderStyle:"solid"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},icon:{alignItems:"center",justifyContent:"center",width:Config.buttonIconSize},fixed:{left:0,right:0,bottom:0,height:64,borderRadius:0}});export default withTheme(FAB);
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","color","label","onPress","elevation","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedFAB.tsx";import*as React from"react";import{ActivityIndicator,View,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Text from"../components/Text";import Elevation from"../components/Elevation";import{withTheme}from"../theming";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var FAB=function FAB(_ref){var Icon=_ref.Icon,icon=_ref.icon,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$type=_ref.type,type=_ref$type===void 0?"solid":_ref$type,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,colorOverride=_ref.color,label=_ref.label,onPress=_ref.onPress,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?0:_ref$elevation,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,disabledOpacity=_ref$theme.disabledOpacity,roundness=_ref$theme.roundness,typography=_ref$theme.typography,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor,borderColor,textColor,borderWidth;var buttonColor=colorOverride||colors.primary;if(type==="standard"||type==="extended"||type==="fixed"){backgroundColor=buttonColor;if(disabled){textColor=color(colors.surface).alpha(disabledOpacity).rgb().string();}else{textColor=colors.surface;}}else{backgroundColor="transparent";if(disabled){textColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{textColor=buttonColor;}}if(type==="outline"){if(disabled){borderColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{borderColor=buttonColor;}borderWidth=StyleSheet.hairlineWidth;}else{borderColor="transparent";borderWidth=0;}var buttonStyle={backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,borderRadius:roundness,alignItems:"center",justifyContent:"center"};var buttonStyles=[styles.button,buttonStyle];var contentStyle=[styles.content];var textStyle={textAlign:"center",color:textColor};var iconStyle=[styles.icon,{width:Config.buttonIconSize}];if(type==="standard"||type==="outline"){buttonStyle.width=Config.FABSize;buttonStyle.height=Config.FABSize;buttonStyle.borderRadius=Config.FABBorderRadius;contentStyle.push({width:Config.FABSize,height:Config.FABSize});}if(type==="extended"||type==="fixed"){iconStyle.push({marginLeft:16,marginRight:-8});textStyle.margin=16;}if(type==="fixed"){buttonStyles.push({height:Config.FABFixedHeight,alignSelf:"stretch"});}return _jsx(Elevation,{style:[{elevation:elevation},style],children:_jsx(Pressable,Object.assign({},rest,{onPress:onPress,accessibilityState:{disabled:disabled},accessibilityRole:"button",disabled:disabled||loading,style:buttonStyles,children:_jsxs(View,{style:styles.content,children:[icon&&loading!==true?_jsx(View,{style:iconStyle,children:_jsx(Icon,{name:icon,size:Config.buttonIconSize,color:textColor})}):null,loading?_jsx(ActivityIndicator,{size:"small",color:textColor,style:iconStyle}):null,label?_jsx(Text,{numberOfLines:1,style:[textStyle,typography.button],children:label}):null]})}))});};var styles=StyleSheet.create({button:{borderStyle:"solid"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},icon:{alignItems:"center",justifyContent:"center",width:Config.buttonIconSize},fixed:{left:0,right:0,bottom:0,height:64,borderRadius:0}});export default withTheme(FAB);
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["lineHeight"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/FieldSearchBarFull.tsx";import*as React from"react";import{View,TextInput,StyleSheet}from"react-native";import{withTheme}from"../theming";import Config from"../components/Config";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var FieldSearchBarFull=function FieldSearchBarFull(_ref){var showIcon=_ref.showIcon,Icon=_ref.Icon,_ref$icon=_ref.icon,icon=_ref$icon===void 0?"search":_ref$icon,_ref$placeholder=_ref.placeholder,placeholder=_ref$placeholder===void 0?"":_ref$placeholder,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,changeOverride=_ref.onChange,submitOverride=_ref.onSubmit,value=_ref.value,defaultValue=_ref.defaultValue;var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),focused=_React$useState2[0],setIsFocused=_React$useState2[1];var onBlur=function onBlur(){setIsFocused(false);};var _React$useState3=React.useState(value||defaultValue),_React$useState4=_slicedToArray(_React$useState3,2),internalValue=_React$useState4[0],setInternalValue=_React$useState4[1];React.useEffect(function(){if(value!=null){setInternalValue(value);}},[value]);React.useEffect(function(){if(defaultValue!=null){setInternalValue(defaultValue);}},[defaultValue]);var onChange=React.useCallback(function(text){changeOverride&&changeOverride(text);},[changeOverride]);var onFocus=function onFocus(){setIsFocused(true);};var onSubmit=function onSubmit(e){submitOverride&&submitOverride(e);};var _typography$body=typography.body2,lineHeight=_typography$body.lineHeight,typeStyles=_objectWithoutProperties(_typography$body,_excluded);var handleChangeText=function handleChangeText(newValue){setInternalValue(newValue);if(onChange){onChange(newValue);}};return _jsxs(View,{style:[styles.container,style],children:[showIcon&&_jsx(Icon,{name:icon,size:Config.fieldSearchBarFullIconSize,color:focused?colors.primary:colors.light}),_jsx(View,{style:{marginLeft:showIcon?12:0,flex:1},children:_jsx(TextInput,{clearButtonMode:"while-editing",placeholder:placeholder,value:internalValue,onBlur:onBlur,onFocus:onFocus,onChangeText:handleChangeText,onSubmitEditing:onSubmit,placeholderTextColor:colors.light,style:[{color:colors.medium},typeStyles]})})]});};var styles=StyleSheet.create({container:{flexDirection:"row",alignItems:"center"}});export default withTheme(FieldSearchBarFull);
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["lineHeight"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/FieldSearchBarFull.tsx";import*as React from"react";import{View,TextInput,StyleSheet}from"react-native";import{withTheme}from"../theming";import Config from"../components/Config";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var FieldSearchBarFull=function FieldSearchBarFull(_ref){var showIcon=_ref.showIcon,Icon=_ref.Icon,_ref$icon=_ref.icon,icon=_ref$icon===void 0?"search":_ref$icon,_ref$placeholder=_ref.placeholder,placeholder=_ref$placeholder===void 0?"":_ref$placeholder,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,changeOverride=_ref.onChange,submitOverride=_ref.onSubmit,value=_ref.value,defaultValue=_ref.defaultValue;var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),focused=_React$useState2[0],setIsFocused=_React$useState2[1];var onBlur=function onBlur(){setIsFocused(false);};var _React$useState3=React.useState(value||defaultValue),_React$useState4=_slicedToArray(_React$useState3,2),internalValue=_React$useState4[0],setInternalValue=_React$useState4[1];React.useEffect(function(){if(value!=null){setInternalValue(value);}},[value]);React.useEffect(function(){if(defaultValue!=null){setInternalValue(defaultValue);}},[defaultValue]);var onChange=React.useCallback(function(text){changeOverride&&changeOverride(text);},[changeOverride]);var onFocus=function onFocus(){setIsFocused(true);};var onSubmit=function onSubmit(e){submitOverride&&submitOverride(e);};var _typography$body=typography.body2,lineHeight=_typography$body.lineHeight,typeStyles=_objectWithoutProperties(_typography$body,_excluded);var handleChangeText=function handleChangeText(newValue){setInternalValue(newValue);if(onChange){onChange(newValue);}};return _jsxs(View,{style:[styles.container,style],children:[showIcon&&_jsx(Icon,{name:icon,size:Config.fieldSearchBarFullIconSize,color:focused?colors.primary:colors.light}),_jsx(View,{style:{marginLeft:showIcon?12:0,flex:1},children:_jsx(TextInput,{clearButtonMode:"while-editing",placeholder:placeholder,value:internalValue,onBlur:onBlur,onFocus:onFocus,onChangeText:handleChangeText,onSubmitEditing:onSubmit,placeholderTextColor:colors.light,style:[{color:colors.medium},typeStyles]})})]});};var styles=StyleSheet.create({container:{flexDirection:"row",alignItems:"center"}});export default withTheme(FieldSearchBarFull);
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/ProgressBar.tsx";var _excluded=["borderColor","borderRadius","borderWidth","children","color","style","unfilledColor","width"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import React,{Component}from"react";import{Animated,Easing,View,I18nManager}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var INDETERMINATE_WIDTH_FACTOR=0.3;var BAR_WIDTH_ZERO_POSITION=INDETERMINATE_WIDTH_FACTOR/(1+INDETERMINATE_WIDTH_FACTOR);var ProgressBar=function(_Component){_inherits(ProgressBar,_Component);var _super=_createSuper(ProgressBar);function ProgressBar(props){var _this;_classCallCheck(this,ProgressBar);_this=_super.call(this,props);_this.handleLayout=function(event){var _this$props=_this.props,_this$props$width=_this$props.width,width=_this$props$width===void 0?150:_this$props$width,onLayout=_this$props.onLayout;if(!width){_this.setState({width:event.nativeEvent.layout.width});}if(onLayout){onLayout(event);}};var _props$progress=props.progress,progressP=_props$progress===void 0?0:_props$progress,_props$indeterminate=props.indeterminate,indeterminate=_props$indeterminate===void 0?false:_props$indeterminate;var progress=Math.min(Math.max(progressP,0),1);_this.state={width:0,progress:new Animated.Value(indeterminate?INDETERMINATE_WIDTH_FACTOR:progress),animationValue:new Animated.Value(BAR_WIDTH_ZERO_POSITION)};return _this;}_createClass(ProgressBar,[{key:"componentDidMount",value:function componentDidMount(){var _this$props$indetermi=this.props.indeterminate,indeterminate=_this$props$indetermi===void 0?false:_this$props$indetermi;if(indeterminate){this.animate();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var _this$props2=this.props,_this$props2$indeterm=_this$props2.indeterminate,indeterminate=_this$props2$indeterm===void 0?false:_this$props2$indeterm,_this$props2$useNativ=_this$props2.useNativeDriver,useNativeDriver=_this$props2$useNativ===void 0?false:_this$props2$useNativ,_this$props2$progress=_this$props2.progress,progressP=_this$props2$progress===void 0?0:_this$props2$progress,_this$props2$animatio=_this$props2.animationType,animationType=_this$props2$animatio===void 0?"spring":_this$props2$animatio,_this$props2$animatio2=_this$props2.animationConfig,animationConfig=_this$props2$animatio2===void 0?{bounciness:0}:_this$props2$animatio2,_this$props2$animated=_this$props2.animated,animated=_this$props2$animated===void 0?true:_this$props2$animated;if(prevProps.indeterminate!==indeterminate){if(indeterminate){this.animate();}else{Animated.spring(this.state.animationValue,{toValue:BAR_WIDTH_ZERO_POSITION,useNativeDriver:useNativeDriver}).start();}}if(prevProps.indeterminate!==indeterminate||prevProps.progress!==progressP){var progress=this.props.indeterminate?INDETERMINATE_WIDTH_FACTOR:Math.min(Math.max(progressP,0),1);if(animated){Animated[animationType](this.state.progress,Object.assign({},animationConfig,{toValue:progress,velocity:0,useNativeDriver:useNativeDriver})).start();}else{this.state.progress.setValue(progress);}}}},{key:"animate",value:function animate(){var _this2=this;var _this$props3=this.props,_this$props3$useNativ=_this$props3.useNativeDriver,useNativeDriver=_this$props3$useNativ===void 0?false:_this$props3$useNativ,_this$props3$indeterm=_this$props3.indeterminateAnimationDuration,indeterminateAnimationDuration=_this$props3$indeterm===void 0?1000:_this$props3$indeterm;this.state.animationValue.setValue(0);Animated.timing(this.state.animationValue,{toValue:1,duration:indeterminateAnimationDuration,easing:Easing.linear,isInteraction:false,useNativeDriver:useNativeDriver}).start(function(endState){if(endState.finished){_this2.animate();}});}},{key:"render",value:function render(){var _this$props4=this.props,borderColor=_this$props4.borderColor,_this$props4$borderRa=_this$props4.borderRadius,borderRadius=_this$props4$borderRa===void 0?4:_this$props4$borderRa,_this$props4$borderWi=_this$props4.borderWidth,borderWidth=_this$props4$borderWi===void 0?1:_this$props4$borderWi,children=_this$props4.children,_this$props4$color=_this$props4.color,color=_this$props4$color===void 0?"rgba(0, 122, 255, 1)":_this$props4$color,style=_this$props4.style,unfilledColor=_this$props4.unfilledColor,_this$props4$width=_this$props4.width,width=_this$props4$width===void 0?150:_this$props4$width,restProps=_objectWithoutProperties(_this$props4,_excluded);var innerWidth=Math.max(0,width||this.state.width)-borderWidth*2;var containerStyle={width:width,borderWidth:borderWidth,borderColor:borderColor||color,borderRadius:borderRadius,overflow:"hidden",backgroundColor:unfilledColor};var progressStyle={backgroundColor:color,height:"100%",transform:[{translateX:this.state.animationValue.interpolate({inputRange:[0,1],outputRange:[innerWidth*-INDETERMINATE_WIDTH_FACTOR,innerWidth]})},{translateX:this.state.progress.interpolate({inputRange:[0,1],outputRange:[innerWidth/(I18nManager.isRTL?2:-2),0]})},{scaleX:this.state.progress.interpolate({inputRange:[0,1],outputRange:[0.0001,1]})}]};return _jsxs(View,Object.assign({style:[containerStyle,style],onLayout:this.handleLayout},restProps,{children:[_jsx(Animated.View,{style:progressStyle}),children]}));}}]);return ProgressBar;}(Component);export{ProgressBar as default};
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/ProgressBar.tsx";var _excluded=["borderColor","borderRadius","borderWidth","children","color","style","unfilledColor","width"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import React,{Component}from"react";import{Animated,Easing,View,I18nManager}from"react-native";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var INDETERMINATE_WIDTH_FACTOR=0.3;var BAR_WIDTH_ZERO_POSITION=INDETERMINATE_WIDTH_FACTOR/(1+INDETERMINATE_WIDTH_FACTOR);var ProgressBar=function(_Component){_inherits(ProgressBar,_Component);var _super=_createSuper(ProgressBar);function ProgressBar(props){var _this;_classCallCheck(this,ProgressBar);_this=_super.call(this,props);_this.handleLayout=function(event){var _this$props=_this.props,_this$props$width=_this$props.width,width=_this$props$width===void 0?150:_this$props$width,onLayout=_this$props.onLayout;if(!width){_this.setState({width:event.nativeEvent.layout.width});}if(onLayout){onLayout(event);}};var _props$progress=props.progress,progressP=_props$progress===void 0?0:_props$progress,_props$indeterminate=props.indeterminate,indeterminate=_props$indeterminate===void 0?false:_props$indeterminate;var progress=Math.min(Math.max(progressP,0),1);_this.state={width:0,progress:new Animated.Value(indeterminate?INDETERMINATE_WIDTH_FACTOR:progress),animationValue:new Animated.Value(BAR_WIDTH_ZERO_POSITION)};return _this;}_createClass(ProgressBar,[{key:"componentDidMount",value:function componentDidMount(){var _this$props$indetermi=this.props.indeterminate,indeterminate=_this$props$indetermi===void 0?false:_this$props$indetermi;if(indeterminate){this.animate();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps){var _this$props2=this.props,_this$props2$indeterm=_this$props2.indeterminate,indeterminate=_this$props2$indeterm===void 0?false:_this$props2$indeterm,_this$props2$useNativ=_this$props2.useNativeDriver,useNativeDriver=_this$props2$useNativ===void 0?false:_this$props2$useNativ,_this$props2$progress=_this$props2.progress,progressP=_this$props2$progress===void 0?0:_this$props2$progress,_this$props2$animatio=_this$props2.animationType,animationType=_this$props2$animatio===void 0?"spring":_this$props2$animatio,_this$props2$animatio2=_this$props2.animationConfig,animationConfig=_this$props2$animatio2===void 0?{bounciness:0}:_this$props2$animatio2,_this$props2$animated=_this$props2.animated,animated=_this$props2$animated===void 0?true:_this$props2$animated;if(prevProps.indeterminate!==indeterminate){if(indeterminate){this.animate();}else{Animated.spring(this.state.animationValue,{toValue:BAR_WIDTH_ZERO_POSITION,useNativeDriver:useNativeDriver}).start();}}if(prevProps.indeterminate!==indeterminate||prevProps.progress!==progressP){var progress=this.props.indeterminate?INDETERMINATE_WIDTH_FACTOR:Math.min(Math.max(progressP,0),1);if(animated){Animated[animationType](this.state.progress,Object.assign({},animationConfig,{toValue:progress,velocity:0,useNativeDriver:useNativeDriver})).start();}else{this.state.progress.setValue(progress);}}}},{key:"animate",value:function animate(){var _this2=this;var _this$props3=this.props,_this$props3$useNativ=_this$props3.useNativeDriver,useNativeDriver=_this$props3$useNativ===void 0?false:_this$props3$useNativ,_this$props3$indeterm=_this$props3.indeterminateAnimationDuration,indeterminateAnimationDuration=_this$props3$indeterm===void 0?1000:_this$props3$indeterm;this.state.animationValue.setValue(0);Animated.timing(this.state.animationValue,{toValue:1,duration:indeterminateAnimationDuration,easing:Easing.linear,isInteraction:false,useNativeDriver:useNativeDriver}).start(function(endState){if(endState.finished){_this2.animate();}});}},{key:"render",value:function render(){var _this$props4=this.props,borderColor=_this$props4.borderColor,_this$props4$borderRa=_this$props4.borderRadius,borderRadius=_this$props4$borderRa===void 0?4:_this$props4$borderRa,_this$props4$borderWi=_this$props4.borderWidth,borderWidth=_this$props4$borderWi===void 0?1:_this$props4$borderWi,children=_this$props4.children,_this$props4$color=_this$props4.color,color=_this$props4$color===void 0?"rgba(0, 122, 255, 1)":_this$props4$color,style=_this$props4.style,unfilledColor=_this$props4.unfilledColor,_this$props4$width=_this$props4.width,width=_this$props4$width===void 0?150:_this$props4$width,restProps=_objectWithoutProperties(_this$props4,_excluded);var innerWidth=Math.max(0,width||this.state.width)-borderWidth*2;var containerStyle={width:width,borderWidth:borderWidth,borderColor:borderColor||color,borderRadius:borderRadius,overflow:"hidden",backgroundColor:unfilledColor};var progressStyle={backgroundColor:color,height:"100%",transform:[{translateX:this.state.animationValue.interpolate({inputRange:[0,1],outputRange:[innerWidth*-INDETERMINATE_WIDTH_FACTOR,innerWidth]})},{translateX:this.state.progress.interpolate({inputRange:[0,1],outputRange:[innerWidth/(I18nManager.isRTL?2:-2),0]})},{scaleX:this.state.progress.interpolate({inputRange:[0,1],outputRange:[0.0001,1]})}]};return _jsxs(View,Object.assign({style:[containerStyle,style],onLayout:this.handleLayout},restProps,{children:[_jsx(Animated.View,{style:progressStyle}),children]}));}}]);return ProgressBar;}(Component);export{ProgressBar as default};
@@ -1 +1 @@
1
- var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/ProgressCircle.tsx";import*as React from"react";import{Text}from"react-native";import AnimatedCircularProgress from"./AnimatedCircularProgress";import{withTheme}from"../theming";import{jsxs as _jsxs}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";var ProgressCircle=function ProgressCircle(_ref){var _ref$progress=_ref.progress,progress=_ref$progress===void 0?0.5:_ref$progress,style=_ref.style,_ref$color=_ref.color,color=_ref$color===void 0?"primary":_ref$color,_ref$size=_ref.size,size=_ref$size===void 0?100:_ref$size,_ref$showsText=_ref.showsText,showsText=_ref$showsText===void 0?true:_ref$showsText,unfilledColor=_ref.unfilledColor,_ref$strokeCap=_ref.strokeCap,strokeCap=_ref$strokeCap===void 0?"butt":_ref$strokeCap,textStyle=_ref.textStyle,_ref$thickness=_ref.thickness,thickness=_ref$thickness===void 0?1:_ref$thickness,theme=_ref.theme;var progressNum=Math.round(progress*100);var tintColor=color||theme.colors.primary;var backgroundColor=unfilledColor||theme.colors.secondary;return _jsx(AnimatedCircularProgress,{size:size,width:thickness,backgroundWidth:thickness,fill:progressNum,tintColor:tintColor,backgroundColor:backgroundColor,rotation:0,lineCap:strokeCap,style:style,children:function children(fill){return showsText?_jsxs(Text,{style:[{fontSize:size*0.275,color:tintColor},textStyle],children:[Math.round(fill),"%"]}):null;}});};export default withTheme(ProgressCircle);
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/ProgressCircle.tsx";import*as React from"react";import{Text}from"react-native";import AnimatedCircularProgress from"./AnimatedCircularProgress";import{withTheme}from"../theming";import{jsxs as _jsxs,jsx as _jsx}from"react/jsx-runtime";var ProgressCircle=function ProgressCircle(_ref){var _ref$progress=_ref.progress,progress=_ref$progress===void 0?0.5:_ref$progress,style=_ref.style,_ref$color=_ref.color,color=_ref$color===void 0?"primary":_ref$color,_ref$size=_ref.size,size=_ref$size===void 0?100:_ref$size,_ref$showsText=_ref.showsText,showsText=_ref$showsText===void 0?true:_ref$showsText,unfilledColor=_ref.unfilledColor,_ref$strokeCap=_ref.strokeCap,strokeCap=_ref$strokeCap===void 0?"butt":_ref$strokeCap,textStyle=_ref.textStyle,_ref$thickness=_ref.thickness,thickness=_ref$thickness===void 0?1:_ref$thickness,theme=_ref.theme;var progressNum=Math.round(progress*100);var tintColor=color||theme.colors.primary;var backgroundColor=unfilledColor||theme.colors.secondary;return _jsx(AnimatedCircularProgress,{size:size,width:thickness,backgroundWidth:thickness,fill:progressNum,tintColor:tintColor,backgroundColor:backgroundColor,rotation:0,lineCap:strokeCap,style:style,children:function children(fill){return showsText?_jsxs(Text,{style:[{fontSize:size*0.275,color:tintColor},textStyle],children:[Math.round(fill),"%"]}):null;}});};export default withTheme(ProgressCircle);
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","children","theme","labelStyle","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RadioButtonFieldGroup.tsx";import React from"react";import{View}from"react-native";import Text from"../components/Text";import{withTheme}from"../theming";import RadioButtonGroup from"../components/RadioButton/RadioButtonGroup";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var RadioButtonFieldGroup=function RadioButtonFieldGroup(_ref){var label=_ref.label,children=_ref.children,theme=_ref.theme,labelStyle=_ref.labelStyle,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);return _jsxs(View,{style:style,children:[_jsx(Text,{style:[{fontSize:theme.typography.headline4.fontSize,color:theme.typography.headline4.color},labelStyle],children:label}),_jsx(RadioButtonGroup,Object.assign({theme:theme},rest,{children:children}))]});};export default withTheme(RadioButtonFieldGroup);
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","children","theme","labelStyle","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RadioButtonFieldGroup.tsx";import React from"react";import{View}from"react-native";import Text from"../components/Text";import{withTheme}from"../theming";import RadioButtonGroup from"../components/RadioButton/RadioButtonGroup";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var RadioButtonFieldGroup=function RadioButtonFieldGroup(_ref){var label=_ref.label,children=_ref.children,theme=_ref.theme,labelStyle=_ref.labelStyle,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);return _jsxs(View,{style:style,children:[_jsx(Text,{style:[{fontSize:theme.typography.headline4.fontSize,color:theme.typography.headline4.color},labelStyle],children:label}),_jsx(RadioButtonGroup,Object.assign({theme:theme},rest,{children:children}))]});};export default withTheme(RadioButtonFieldGroup);
@@ -1 +1 @@
1
- export{flattenReactFragments}from"./utilities";export{injectIcon}from"./interfaces/Icon";export{withTheme,ThemeProvider}from"./theming";export{default as Provider}from"./Provider";export{default as DefaultTheme}from"./styles/DefaultTheme";export{Link}from"./components/Text";export{Button}from"./components/Button";export{Checkbox,CheckboxRow}from"./components/Checkbox";export{default as Divider}from"./components/Divider";export{default as IconButton}from"./components/IconButton";export{default as Image}from"./components/Image";export{default as SVG}from"./components/SVG";export{default as NumberInput}from"./components/NumberInput";export{default as ScreenContainer}from"./components/ScreenContainer";export{default as StarRating}from"./components/StarRating";export{default as Surface}from"./components/Surface";export{default as Switch,SwitchRow}from"./components/Switch";export{default as TextField}from"./components/TextField";export{default as Touchable}from"./components/Touchable";export{default as Pressable}from"./components/Pressable";export{default as AccordionGroup}from"./components/AccordionGroup";export{ActionSheet,ActionSheetItem,ActionSheetCancel}from"./components/ActionSheet";export{Swiper,SwiperItem}from"./components/Swiper";export{RadioButton,RadioButtonGroup,RadioButtonRow}from"./components/RadioButton/index";export{default as Shadow}from"./components/Shadow";export{DeckSwiper,DeckSwiperCard}from"./components/DeckSwiper";export{TabView,TabViewItem}from"./components/TabView";export{default as Markdown}from"./components/Markdown";export{BottomSheet}from"./components/BottomSheet";export{YoutubePlayer}from"./components/YoutubePlayer";export{Table,TableRow,TableCell}from"./components/Table";export{SwipeableItem,SwipeableItemButton,SwipeableList}from"./components/SwipeableItem";export{default as AudioPlayer}from"./components/MediaPlayer/AudioPlayer";export{default as DatePicker}from"./components/DatePicker/DatePicker";export{Picker,MultiSelectPicker,PickerItem}from"./components/Picker";export{default as Slider}from"./components/Slider";export{default as Stepper}from"./components/Stepper";export{SectionList,SectionHeader}from"./components/SectionList";export{default as LinearProgress}from"./components/Progress/LinearProgress";export{default as CircularProgress}from"./components/Progress/CircularProgress";export{default as TextInput}from"./components/TextInput";export{default as VideoPlayer}from"./components/MediaPlayer/VideoPlayer";export{PinInput,CustomPinInputCell,PinInputText as CustomPinInputText}from"./components/PinInput";export{AspectRatio,Circle,Center,HStack,VStack,ZStack,Spacer,Square}from"./components/Layout";export{default as KeyboardAvoidingView}from"./components/KeyboardAvoidingView";export{default as SimpleStyleFlashList}from"./components/SimpleStyleScrollables/SimpleStyleFlashList";export{default as SimpleStyleFlatList}from"./components/SimpleStyleScrollables/SimpleStyleFlatList";export{default as SimpleStyleKeyboardAwareScrollView}from"./components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView";export{default as SimpleStyleMasonryFlashList}from"./components/SimpleStyleScrollables/SimpleStyleMasonryFlashList";export{default as SimpleStyleScrollView}from"./components/SimpleStyleScrollables/SimpleStyleScrollView";export{default as SimpleStyleSectionList}from"./components/SimpleStyleScrollables/SimpleStyleSectionList";export{default as SimpleStyleSwipeableList}from"./components/SimpleStyleScrollables/SimpleStyleSwipeableList";export{default as AccordionItem}from"./deprecated-components/AccordionItem";export{default as AvatarEdit}from"./deprecated-components/AvatarEdit";export{default as Avatar}from"./deprecated-components/CircleImage";export{default as Banner}from"./deprecated-components/Banner";export{ButtonSolid,ButtonOutline}from"./components/Button";export{default as Card}from"./deprecated-components/Card";export{default as CheckboxGroup}from"./deprecated-components/CheckboxGroup";export{default as CircleImage}from"./deprecated-components/CircleImage";export{default as Container}from"./deprecated-components/Container";export{default as FAB}from"./deprecated-components/FAB";export{default as FieldSearchBarFull}from"./deprecated-components/FieldSearchBarFull";export{Center as DeprecatedCenter,Circle as DeprecatedCircle,Square as DeprecatedSquare,Row,Stack}from"./deprecated-components/Layout";export{default as ToggleButton}from"./deprecated-components/ToggleButton";export{default as ProgressBar}from"./deprecated-components/ProgressBar";export{default as ProgressCircle}from"./deprecated-components/ProgressCircle";export{default as RadioButtonFieldGroup}from"./deprecated-components/RadioButtonFieldGroup";export{default as RowBodyIcon}from"./deprecated-components/RowBodyIcon";export{default as RowHeadlineImageCaption}from"./deprecated-components/RowHeadlineImageCaption";export{default as RowHeadlineImageIcon}from"./deprecated-components/RowHeadlineImageIcon";export{useAuthState}from"./components/useAuthState";export{default as AvoidKeyboardView}from"./deprecated-components/AvoidKeyboardView";
1
+ export{flattenReactFragments,useDeepCompareEffect,useDeepCompareMemo}from"./utilities";export{injectIcon}from"./interfaces/Icon";export{withTheme,ThemeProvider}from"./theming";export{default as Provider}from"./Provider";export{default as DefaultTheme}from"./styles/DefaultTheme";export{Link}from"./components/Text";export{Button}from"./components/Button";export{Checkbox,CheckboxRow}from"./components/Checkbox";export{default as Divider}from"./components/Divider";export{default as IconButton}from"./components/IconButton";export{default as Image}from"./components/Image";export{default as SVG}from"./components/SVG";export{default as NumberInput}from"./components/NumberInput";export{default as ScreenContainer}from"./components/ScreenContainer";export{default as StarRating}from"./components/StarRating";export{default as Surface}from"./components/Surface";export{default as Switch,SwitchRow}from"./components/Switch";export{default as TextField}from"./components/TextField";export{default as Touchable}from"./components/Touchable";export{default as Pressable}from"./components/Pressable";export{default as AccordionGroup}from"./components/AccordionGroup";export{ActionSheet,ActionSheetItem,ActionSheetCancel}from"./components/ActionSheet";export{Swiper,SwiperItem}from"./components/Swiper";export{RadioButton,RadioButtonGroup,RadioButtonRow}from"./components/RadioButton/index";export{default as Shadow}from"./components/Shadow";export{DeckSwiper,DeckSwiperCard}from"./components/DeckSwiper";export{TabView,TabViewItem}from"./components/TabView";export{default as Markdown}from"./components/Markdown";export{BottomSheet}from"./components/BottomSheet";export{YoutubePlayer}from"./components/YoutubePlayer";export{Table,TableRow,TableCell}from"./components/Table";export{SwipeableItem,SwipeableItemButton,SwipeableList}from"./components/SwipeableItem";export{default as AudioPlayer}from"./components/MediaPlayer/AudioPlayer";export{default as DatePicker}from"./components/DatePicker/DatePicker";export{Picker,MultiSelectPicker,PickerItem}from"./components/Picker";export{default as Slider}from"./components/Slider";export{default as Stepper}from"./components/Stepper";export{SectionList,SectionHeader}from"./components/SectionList";export{default as LinearProgress}from"./components/Progress/LinearProgress";export{default as CircularProgress}from"./components/Progress/CircularProgress";export{default as TextInput}from"./components/TextInput";export{default as VideoPlayer}from"./components/MediaPlayer/VideoPlayer";export{PinInput,CustomPinInputCell,PinInputText as CustomPinInputText}from"./components/PinInput";export{AspectRatio,Circle,Center,HStack,VStack,ZStack,Spacer,Square}from"./components/Layout";export{default as KeyboardAvoidingView}from"./components/KeyboardAvoidingView";export{default as SimpleStyleFlashList}from"./components/SimpleStyleScrollables/SimpleStyleFlashList";export{default as SimpleStyleFlatList}from"./components/SimpleStyleScrollables/SimpleStyleFlatList";export{default as SimpleStyleKeyboardAwareScrollView}from"./components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView";export{default as SimpleStyleMasonryFlashList}from"./components/SimpleStyleScrollables/SimpleStyleMasonryFlashList";export{default as SimpleStyleScrollView}from"./components/SimpleStyleScrollables/SimpleStyleScrollView";export{default as SimpleStyleSectionList}from"./components/SimpleStyleScrollables/SimpleStyleSectionList";export{default as SimpleStyleSwipeableList}from"./components/SimpleStyleScrollables/SimpleStyleSwipeableList";export{default as AccordionItem}from"./deprecated-components/AccordionItem";export{default as AvatarEdit}from"./deprecated-components/AvatarEdit";export{default as Avatar}from"./deprecated-components/CircleImage";export{default as Banner}from"./deprecated-components/Banner";export{ButtonSolid,ButtonOutline}from"./components/Button";export{default as Card}from"./deprecated-components/Card";export{default as CheckboxGroup}from"./deprecated-components/CheckboxGroup";export{default as CircleImage}from"./deprecated-components/CircleImage";export{default as Container}from"./deprecated-components/Container";export{default as FAB}from"./deprecated-components/FAB";export{default as FieldSearchBarFull}from"./deprecated-components/FieldSearchBarFull";export{Center as DeprecatedCenter,Circle as DeprecatedCircle,Square as DeprecatedSquare,Row,Stack}from"./deprecated-components/Layout";export{default as ToggleButton}from"./deprecated-components/ToggleButton";export{default as ProgressBar}from"./deprecated-components/ProgressBar";export{default as ProgressCircle}from"./deprecated-components/ProgressCircle";export{default as RadioButtonFieldGroup}from"./deprecated-components/RadioButtonFieldGroup";export{default as RowBodyIcon}from"./deprecated-components/RowBodyIcon";export{default as RowHeadlineImageCaption}from"./deprecated-components/RowHeadlineImageCaption";export{default as RowHeadlineImageIcon}from"./deprecated-components/RowHeadlineImageIcon";export{useAuthState}from"./components/useAuthState";export{default as AvoidKeyboardView}from"./deprecated-components/AvoidKeyboardView";