@draftbit/core 49.4.4-7c77a4.2 → 49.4.4-a81bb6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Provider.js +1 -1
- package/lib/commonjs/components/AccordionGroup.js +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheet.js +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetItem.js +1 -1
- package/lib/commonjs/components/ActionSheet/index.js +1 -1
- package/lib/commonjs/components/AspectRatio.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/BottomSheet/index.js +1 -1
- package/lib/commonjs/components/Button.js +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -1
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Checkbox/index.js +1 -1
- package/lib/commonjs/components/Config.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponentType.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +1 -1
- package/lib/commonjs/components/DeckSwiper/index.js +1 -1
- package/lib/commonjs/components/Divider.js +1 -1
- package/lib/commonjs/components/Elevation.js +1 -1
- package/lib/commonjs/components/FormRow.js +1 -1
- package/lib/commonjs/components/IconButton.js +1 -1
- package/lib/commonjs/components/Image.js +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView.js +1 -1
- package/lib/commonjs/components/Layout/AspectRatio.js +1 -1
- package/lib/commonjs/components/Layout/Center.js +1 -1
- package/lib/commonjs/components/Layout/Circle.js +1 -1
- package/lib/commonjs/components/Layout/HStack.js +1 -1
- package/lib/commonjs/components/Layout/LayoutCommon.js +1 -1
- package/lib/commonjs/components/Layout/Spacer.js +1 -1
- package/lib/commonjs/components/Layout/Square.js +1 -1
- package/lib/commonjs/components/Layout/VStack.js +1 -1
- package/lib/commonjs/components/Layout/ZStack.js +1 -1
- package/lib/commonjs/components/Layout/index.js +1 -1
- package/lib/commonjs/components/Markdown.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/index.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlaybackWrapper.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlayerCommon.js +1 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +1 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/index.js +1 -1
- package/lib/commonjs/components/NumberInput.js +1 -1
- package/lib/commonjs/components/Picker/NativePicker.js +1 -1
- package/lib/commonjs/components/Picker/PickerCommon.js +1 -1
- package/lib/commonjs/components/Picker/PickerInputContainer.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownPicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/PickerItem.js +1 -1
- package/lib/commonjs/components/Picker/index.js +1 -1
- package/lib/commonjs/components/PinInput/CustomPinInputCell.js +1 -1
- package/lib/commonjs/components/PinInput/PinInput.js +1 -1
- package/lib/commonjs/components/PinInput/PinInputText.js +1 -1
- package/lib/commonjs/components/PinInput/index.js +1 -1
- package/lib/commonjs/components/Portal/Portal.js +1 -1
- package/lib/commonjs/components/Portal/PortalConsumer.js +1 -1
- package/lib/commonjs/components/Portal/PortalHost.js +1 -1
- package/lib/commonjs/components/Portal/PortalManager.js +1 -1
- package/lib/commonjs/components/Pressable.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/index.js +1 -1
- package/lib/commonjs/components/Progress/IndeterminateProgress.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/index.js +1 -1
- package/lib/commonjs/components/Progress/ProgressCommon.js +1 -1
- package/lib/commonjs/components/ProgressIndicator.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/RadioButton/index.js +1 -1
- package/lib/commonjs/components/Row.js +1 -1
- package/lib/commonjs/components/SVG.js +1 -1
- package/lib/commonjs/components/SVG.native.js +1 -1
- package/lib/commonjs/components/ScreenContainer.js +1 -1
- package/lib/commonjs/components/SectionList/SectionHeader.js +1 -1
- package/lib/commonjs/components/SectionList/SectionList.js +1 -1
- package/lib/commonjs/components/SectionList/index.js +1 -1
- package/lib/commonjs/components/Shadow.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlashList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleScrollView.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSectionList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +1 -1
- package/lib/commonjs/components/Slider.js +1 -1
- package/lib/commonjs/components/StarRating.js +1 -1
- package/lib/commonjs/components/StepIndicator.js +1 -1
- package/lib/commonjs/components/Stepper.js +1 -1
- package/lib/commonjs/components/Surface.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItem.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItemButton.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItemCommon.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableList.js +1 -1
- package/lib/commonjs/components/SwipeableItem/index.js +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js +1 -1
- package/lib/commonjs/components/Swiper/SwiperItem.js +1 -1
- package/lib/commonjs/components/Swiper/index.js +1 -1
- package/lib/commonjs/components/Switch.js +1 -1
- package/lib/commonjs/components/TabView/TabView.js +1 -1
- package/lib/commonjs/components/TabView/TabViewItem.js +1 -1
- package/lib/commonjs/components/TabView/index.js +1 -1
- package/lib/commonjs/components/Table/Table.js +1 -1
- package/lib/commonjs/components/Table/TableCell.js +1 -1
- package/lib/commonjs/components/Table/TableCommon.js +1 -1
- package/lib/commonjs/components/Table/TableRow.js +1 -1
- package/lib/commonjs/components/Table/index.js +1 -1
- package/lib/commonjs/components/Text.js +1 -1
- package/lib/commonjs/components/TextField.js +1 -1
- package/lib/commonjs/components/TextInput.js +1 -1
- package/lib/commonjs/components/Touchable.js +1 -1
- package/lib/commonjs/components/Touchable.web.js +1 -1
- package/lib/commonjs/components/Typography.js +1 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.js +1 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.native.js +2 -2
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayerProps.js +1 -1
- package/lib/commonjs/components/YoutubePlayer/index.js +1 -1
- package/lib/commonjs/components/useAuthState.js +1 -1
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/deprecated-components/AccordionItem.js +1 -1
- package/lib/commonjs/deprecated-components/AnimatedCircularProgress.js +1 -1
- package/lib/commonjs/deprecated-components/AvatarEdit.js +1 -1
- package/lib/commonjs/deprecated-components/AvoidKeyboardView.js +1 -1
- package/lib/commonjs/deprecated-components/Banner.js +1 -1
- package/lib/commonjs/deprecated-components/Card.js +1 -1
- package/lib/commonjs/deprecated-components/CheckboxGroup.js +1 -1
- package/lib/commonjs/deprecated-components/CircleImage.js +1 -1
- package/lib/commonjs/deprecated-components/CircularProgress.js +1 -1
- package/lib/commonjs/deprecated-components/Container.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedButton.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedFAB.js +1 -1
- package/lib/commonjs/deprecated-components/FAB.js +1 -1
- package/lib/commonjs/deprecated-components/FieldSearchBarFull.js +1 -1
- package/lib/commonjs/deprecated-components/Layout.js +1 -1
- package/lib/commonjs/deprecated-components/ProgressBar.js +1 -1
- package/lib/commonjs/deprecated-components/ProgressCircle.js +1 -1
- package/lib/commonjs/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/lib/commonjs/deprecated-components/RowBodyIcon.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageCaption.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageIcon.js +1 -1
- package/lib/commonjs/deprecated-components/ToggleButton.js +1 -1
- package/lib/commonjs/hooks.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/interfaces/Icon.js +1 -1
- package/lib/commonjs/styles/DarkTheme.js +1 -1
- package/lib/commonjs/styles/DefaultTheme.js +1 -1
- package/lib/commonjs/styles/fonts.js +1 -1
- package/lib/commonjs/styles/overlay.js +1 -1
- package/lib/commonjs/styles/shadow.js +1 -1
- package/lib/commonjs/theming.js +1 -1
- package/lib/commonjs/utilities.js +1 -1
- package/lib/typescript/src/index.js +3 -0
- package/lib/typescript/src/index.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/index.js +3 -0
- package/src/index.js.map +1 -1
- package/src/index.tsx +4 -0
package/lib/commonjs/Provider.js
CHANGED
|
@@ -1 +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/Provider.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*as React from"react";import{ThemeProvider}from"./theming";import PortalHost from"./components/Portal/PortalHost";import{jsx as _jsx}from"react/jsx-runtime";var Provider=function(_React$Component){_inherits(Provider,_React$Component);var _super=_createSuper(Provider);function Provider(){_classCallCheck(this,Provider);return _super.apply(this,arguments);}_createClass(Provider,[{key:"render",value:function render(){return _jsx(PortalHost,{children:_jsx(ThemeProvider,{theme:this.props.theme,children:this.props.children})});}}]);return Provider;}(React.Component);export{Provider as default};
|
|
@@ -1 +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/AccordionGroup.tsx";import*as React from"react";import{View,StyleSheet,Pressable}from"react-native";import Text from"./Text";import{withTheme}from"../theming";import{extractStyles}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var AccordionGroup=function AccordionGroup(_ref){var label=_ref.label,_ref$expanded=_ref.expanded,expandedProp=_ref$expanded===void 0?false:_ref$expanded,openColor=_ref.openColor,closedColor=_ref.closedColor,caretColorProp=_ref.caretColor,_ref$caretSize=_ref.caretSize,caretSize=_ref$caretSize===void 0?24:_ref$caretSize,icon=_ref.icon,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?24:_ref$iconSize,style=_ref.style,children=_ref.children,theme=_ref.theme,Icon=_ref.Icon;var _React$useState=React.useState(expandedProp),_React$useState2=_slicedToArray(_React$useState,2),expanded=_React$useState2[0],setExpanded=_React$useState2[1];var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var expandedColor=openColor||theme.colors.primary;var collapsedColor=closedColor||theme.colors.primary;var labelColor=expanded?expandedColor:collapsedColor;var caretColor=caretColorProp||labelColor;var handlePressAction=function handlePressAction(){setExpanded(!expanded);};return _jsxs(_Fragment,{children:[_jsxs(Pressable,{style:[styles.row,viewStyles],onPress:handlePressAction,accessibilityRole:"button",children:[icon?_jsx(Icon,{name:icon,size:iconSize,color:labelColor,style:styles.icon}):null,_jsx(View,{style:styles.content,children:_jsx(Text,{selectable:false,style:[textStyles,{color:labelColor}],children:label})}),_jsx(Icon,{name:expanded?"MaterialIcons/keyboard-arrow-up":"MaterialIcons/keyboard-arrow-down",color:caretColor,size:caretSize})]}),expanded?children:null]});};var styles=StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},content:{flex:1,justifyContent:"center"},icon:{marginRight:8}});export default withTheme(AccordionGroup);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ActionSheet/ActionSheet.tsx";import React from"react";import{View,StyleSheet}from"react-native";import Portal from"../Portal/Portal";import Touchable from"../Touchable";import ActionSheetCancel from"./ActionSheetCancel";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var ActionSheet=function ActionSheet(_ref){var _ref$visible=_ref.visible,visible=_ref$visible===void 0?false:_ref$visible,onClose=_ref.onClose,children=_ref.children;return visible?_jsx(Portal,{children:_jsxs(Touchable,{style:styles.wrapper,onPress:onClose,children:[_jsx(View,{style:styles.overlay}),_jsxs(View,{style:styles.groupWrapper,children:[_jsx(View,{style:styles.group,children:React.Children.toArray(children).filter(function(child){return(child==null?void 0:child.type)!==ActionSheetCancel;})}),_jsx(View,{style:styles.group,children:React.Children.toArray(children).filter(function(child){return child.type===ActionSheetCancel;})})]})]})}):_jsx(_Fragment,{});};var styles=StyleSheet.create({wrapper:{flex:1,display:"flex",flexDirection:"column"},overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"#000000",opacity:0.3},groupWrapper:{flex:1,flexDirection:"column",justifyContent:"flex-end",display:"flex",marginBottom:25},group:{display:"flex",flexDirection:"column",borderRadius:10,marginHorizontal:7,marginVertical:2.5,overflow:"hidden"}});export default ActionSheet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ActionSheet/ActionSheetCancel.tsx";import React from"react";import ActionSheetItem from"./ActionSheetItem";import{jsx as _jsx}from"react/jsx-runtime";var ActionSheetCancel=function ActionSheetCancel(_ref){var _ref$label=_ref.label,label=_ref$label===void 0?"Cancel":_ref$label,color=_ref.color,style=_ref.style,onPress=_ref.onPress;return _jsx(ActionSheetItem,{label:label,color:color||"#FF453A",style:[style],onPress:onPress});};export default ActionSheetCancel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ActionSheet/ActionSheetItem.tsx";import React from"react";import{Text,StyleSheet,TouchableOpacity}from"react-native";import{extractStyles}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";var ActionSheetItem=function ActionSheetItem(_ref){var label=_ref.label,style=_ref.style,color=_ref.color,onPress=_ref.onPress;var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsx(TouchableOpacity,{activeOpacity:0.7,style:[styles.wrapper,viewStyles],onPress:onPress,children:_jsx(Text,{style:[styles.label,textStyles,{color:color}],children:label})});};var styles=StyleSheet.create({wrapper:{borderBottomWidth:StyleSheet.hairlineWidth,borderBottomColor:"#CCCCCC",backgroundColor:"#F1F1F1",minHeight:50,overflow:"hidden",display:"flex",justifyContent:"center"},label:{fontSize:16,textAlign:"center",color:"#0A84FF",fontWeight:"500",overflow:"hidden",paddingHorizontal:20,paddingVertical:10,alignSelf:"center"}});export default ActionSheetItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{default as ActionSheet}from"./ActionSheet";export{default as ActionSheetItem}from"./ActionSheetItem";export{default as ActionSheetCancel}from"./ActionSheetCancel";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["aspectRatio"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/AspectRatio.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var AspectRatio=function AspectRatio(props){var _React$useState=React.useState(null),_React$useState2=_slicedToArray(_React$useState,2),layout=_React$useState2[0],setLayout=_React$useState2[1];var _ref=StyleSheet.flatten(props.style)||{},_ref$aspectRatio=_ref.aspectRatio,aspectRatio=_ref$aspectRatio===void 0?1:_ref$aspectRatio,inputStyle=_objectWithoutProperties(_ref,_excluded);var style=[inputStyle,{aspectRatio:aspectRatio}];if(layout){var _layout$width=layout.width,width=_layout$width===void 0?0:_layout$width,_layout$height=layout.height,height=_layout$height===void 0?0:_layout$height;if(width===0){style.push({width:height*(1/+aspectRatio),height:height});}else{style.push({width:width,height:width*(1/+aspectRatio)});}}return _jsx(View,Object.assign({},props,{style:style,onLayout:function onLayout(_ref2){var l=_ref2.nativeEvent.layout;return setLayout(l);},children:props.children}));};export default AspectRatio;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","snapPoints","topSnapPosition","middleSnapPosition","bottomSnapPosition","initialSnapIndex","initialSnapPosition","showHandle","handleColor","topBorderRadius","borderWidth","borderColor","onSettle","style","children"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/BottomSheet/BottomSheet.tsx";import React from"react";import{StyleSheet,Dimensions}from"react-native";import BottomSheetComponent,{BottomSheetScrollView}from"@gorhom/bottom-sheet";import{withTheme}from"../../theming";import{useDeepCompareMemo}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";var windowHeight=Dimensions.get("window").height;var BottomSheet=React.forwardRef(function(_ref,ref){var theme=_ref.theme,snapPointsProp=_ref.snapPoints,_ref$topSnapPosition=_ref.topSnapPosition,topSnapPosition=_ref$topSnapPosition===void 0?"10%":_ref$topSnapPosition,_ref$middleSnapPositi=_ref.middleSnapPosition,middleSnapPosition=_ref$middleSnapPositi===void 0?"50%":_ref$middleSnapPositi,_ref$bottomSnapPositi=_ref.bottomSnapPosition,bottomSnapPosition=_ref$bottomSnapPositi===void 0?"80%":_ref$bottomSnapPositi,initialSnapIndex=_ref.initialSnapIndex,_ref$initialSnapPosit=_ref.initialSnapPosition,initialSnapPosition=_ref$initialSnapPosit===void 0?"bottom":_ref$initialSnapPosit,_ref$showHandle=_ref.showHandle,showHandle=_ref$showHandle===void 0?true:_ref$showHandle,_ref$handleColor=_ref.handleColor,handleColor=_ref$handleColor===void 0?theme.colors.divider:_ref$handleColor,_ref$topBorderRadius=_ref.topBorderRadius,topBorderRadius=_ref$topBorderRadius===void 0?20:_ref$topBorderRadius,_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,onSettle=_ref.onSettle,style=_ref.style,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor=(style==null?void 0:style.backgroundColor)||theme.colors.background;var snapPoints=snapPointsProp!=null?snapPointsProp:[topSnapPosition,middleSnapPosition,bottomSnapPosition];var mappedSnapPoints=useDeepCompareMemo(function(){return convertSnapPointsForNewImplementation(snapPoints);},snapPoints);var getSnapIndexFromPosition=function getSnapIndexFromPosition(position){switch(position){case"bottom":return 0;case"middle":return 1;case"top":return 2;}};return _jsx(BottomSheetComponent,{ref:ref,snapPoints:mappedSnapPoints,index:initialSnapIndex!=undefined?mappedSnapPoints.length-initialSnapIndex-1:getSnapIndexFromPosition(initialSnapPosition),handleIndicatorStyle:[{backgroundColor:handleColor},!showHandle?{display:"none"}:{}],backgroundStyle:{backgroundColor:backgroundColor,borderTopLeftRadius:topBorderRadius,borderTopRightRadius:topBorderRadius,borderWidth:borderWidth,borderColor:borderColor},onChange:function onChange(index){return onSettle==null?void 0:onSettle(mappedSnapPoints.length-index-1);},children:_jsx(BottomSheetScrollView,Object.assign({contentContainerStyle:[styles.contentContainerStyle,style]},rest,{children:children}))});});function convertSnapPointsForNewImplementation(snapPoints){var reversedSnapPoints=_toConsumableArray(snapPoints).reverse();return reversedSnapPoints.map(function(point){if(typeof point==="string"){var percentNumber=extractPercentNumber(point);if(percentNumber!==undefined){return`${100-percentNumber}%`;}return point;}else if(typeof point==="number"){return windowHeight-point;}else{return point;}});}function extractPercentNumber(percentString){var percentRegex=/(\d+)?%/;var matches=percentString.match(percentRegex);if(matches!=null&&matches.length){var percentNumber=Number(matches[1]);if(!isNaN(percentNumber)){return percentNumber;}}return undefined;}var styles=StyleSheet.create({contentContainerStyle:{paddingHorizontal:16,paddingVertical:10}});export default withTheme(BottomSheet);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{default as BottomSheet}from"./BottomSheet";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Button.tsx",_this=this;var _excluded=["Icon","icon","title","loading","disabled","style","activeOpacity","disabledOpacity"],_excluded2=["color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle"],_excluded3=["style","theme"],_excluded4=["style","theme"];import*as React from"react";import{Text,Pressable,Platform,StyleSheet,ActivityIndicator}from"react-native";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CONSTANTS={baseHeight:42,borderRadius:4,padding:8,icon:24};function Base(_ref){var Icon=_ref.Icon,icon=_ref.icon,title=_ref.title,loading=_ref.loading,disabled=_ref.disabled,style=_ref.style,_ref$activeOpacity=_ref.activeOpacity,activeOpacity=_ref$activeOpacity===void 0?0.8:_ref$activeOpacity,_ref$disabledOpacity=_ref.disabledOpacity,disabledOpacity=_ref$disabledOpacity===void 0?0.8:_ref$disabledOpacity,props=_objectWithoutProperties(_ref,_excluded);var _StyleSheet$flatten=StyleSheet.flatten(style||{}),color=_StyleSheet$flatten.color,fontFamily=_StyleSheet$flatten.fontFamily,fontWeight=_StyleSheet$flatten.fontWeight,fontSize=_StyleSheet$flatten.fontSize,lineHeight=_StyleSheet$flatten.lineHeight,letterSpacing=_StyleSheet$flatten.letterSpacing,textTransform=_StyleSheet$flatten.textTransform,textAlign=_StyleSheet$flatten.textAlign,textDecorationLine=_StyleSheet$flatten.textDecorationLine,textDecorationColor=_StyleSheet$flatten.textDecorationColor,textDecorationStyle=_StyleSheet$flatten.textDecorationStyle,buttonStyles=_objectWithoutProperties(_StyleSheet$flatten,_excluded2);var titleStyles={color:color,fontFamily:fontFamily,fontWeight:fontWeight,fontSize:fontSize,lineHeight:lineHeight,letterSpacing:letterSpacing,textTransform:textTransform,textAlign:textAlign,textDecorationLine:textDecorationLine,textDecorationColor:textDecorationColor,textDecorationStyle:textDecorationStyle};if(textAlign==="left"){buttonStyles.justifyContent="flex-start";}if(textAlign==="right"){buttonStyles.justifyContent="flex-end";}return _jsxs(Pressable,Object.assign({disabled:disabled||loading,style:function style(_ref2){var pressed=_ref2.pressed;return[styles.base,{opacity:pressed?activeOpacity:disabled?disabledOpacity:1},buttonStyles];}},props,{children:[loading?_jsx(ActivityIndicator,{size:"small",color:color,style:styles.loading}):null,icon&&!loading?_jsx(Icon,{name:icon,color:color,style:styles.icon,size:CONSTANTS.icon}):null,_jsx(Text,{style:titleStyles,children:title})]}));}var Solid=function Solid(_ref3){var style=_ref3.style,theme=_ref3.theme,props=_objectWithoutProperties(_ref3,_excluded3);return _jsx(Base,Object.assign({style:[{color:"#FFF",borderRadius:theme.roundness,backgroundColor:theme.colors.primary},style]},props));};var ButtonSolid=withTheme(Solid);export{ButtonSolid};var Button=withTheme(Solid);export{Button};var Outline=function Outline(_ref4){var style=_ref4.style,theme=_ref4.theme,props=_objectWithoutProperties(_ref4,_excluded4);return _jsx(Base,Object.assign({style:[styles.outline,{borderRadius:theme.roundness,borderColor:theme.colors.primary,color:theme.colors.primary},style]},props));};var ButtonOutline=withTheme(Outline);export{ButtonOutline};var styles=StyleSheet.create({base:Object.assign({position:"relative",flexDirection:"row",alignItems:"center",justifyContent:"center",minHeight:CONSTANTS.baseHeight,paddingHorizontal:12,fontFamily:"System",fontWeight:"700"},Platform.select({web:{cursor:"pointer",userSelect:"none"}})),outline:{backgroundColor:"transparent",borderWidth:1},bare:{backgroundColor:"transparent",padding:0,minHeight:undefined},loading:{marginRight:6},icon:Object.assign({},Platform.select({web:{marginTop:1,marginRight:4,alignSelf:"center"},default:{marginBottom:2,marginRight:4,alignSelf:"center"}}))});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","status","disabled","onPress","onCheck","onUncheck","color","uncheckedColor","defaultValue","checkedIcon","uncheckedIcon","size","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Checkbox/Checkbox.tsx";import*as React from"react";import{View,StyleSheet,Pressable}from"react-native";import{useTheme}from"../../theming";import{usePrevious}from"../../hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function Checkbox(_ref){var Icon=_ref.Icon,status=_ref.status,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,onPress=_ref.onPress,onCheck=_ref.onCheck,onUncheck=_ref.onUncheck,color=_ref.color,uncheckedColor=_ref.uncheckedColor,defaultValue=_ref.defaultValue,_ref$checkedIcon=_ref.checkedIcon,checkedIcon=_ref$checkedIcon===void 0?"MaterialCommunityIcons/checkbox-marked":_ref$checkedIcon,_ref$uncheckedIcon=_ref.uncheckedIcon,uncheckedIcon=_ref$uncheckedIcon===void 0?"MaterialCommunityIcons/checkbox-blank-outline":_ref$uncheckedIcon,_ref$size=_ref.size,size=_ref$size===void 0?24:_ref$size,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(status||defaultValue||false),_React$useState2=_slicedToArray(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];React.useEffect(function(){if(status!=null){setInternalValue(status);}},[status]);var previousDefaultValue=usePrevious(defaultValue);React.useEffect(function(){if(defaultValue!==previousDefaultValue){setInternalValue(Boolean(defaultValue));}},[defaultValue,previousDefaultValue]);var _useTheme=useTheme(),colors=_useTheme.colors;var checkboxColor=internalValue?color||colors.primary:uncheckedColor||colors.primary;var handlePress=function handlePress(){var newValue=!internalValue;setInternalValue(newValue);onPress==null?void 0:onPress(newValue);if(newValue){onCheck==null?void 0:onCheck();}if(!newValue){onUncheck==null?void 0:onUncheck();}};return _jsxs(Pressable,Object.assign({},rest,{onPress:handlePress,disabled:disabled,accessibilityState:{disabled:disabled},accessibilityRole:"button",accessibilityLiveRegion:"polite",style:[styles.container,style,{width:size,height:size}],children:[_jsx(Icon,{style:styles.icon,name:internalValue?checkedIcon:uncheckedIcon,size:size,color:checkboxColor}),_jsx(View,{style:[StyleSheet.absoluteFill,styles.fillContainer],children:_jsx(View,{style:[styles.fill,{opacity:disabled?0.5:1},{borderColor:checkboxColor}]})})]}));};var styles=StyleSheet.create({container:{borderRadius:18},fillContainer:{alignItems:"center",justifyContent:"center"},icon:{alignSelf:"center"},fill:{borderRadius:5,width:30,height:30,alignSelf:"center"}});export default Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","label","status","value","onPress","labelContainerStyle","labelStyle","checkboxStyle","direction","disabled","style","color","uncheckedColor"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Checkbox/CheckboxGroupRow.tsx";import*as React from"react";import{StyleSheet,View,Platform,Pressable}from"react-native";import Checkbox from"./Checkbox";import Text from"../Text";import{useCheckboxGroupContext}from"./context";import{Direction as GroupDirection}from"./context";import{extractStyles}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var Direction=function(Direction){Direction["Row"]="row";Direction["RowReverse"]="row-reverse";return Direction;}({});var getCheckboxAlignment=function getCheckboxAlignment(parentDirection,direction){if(parentDirection===GroupDirection.Horizontal){return direction===Direction.Row?"flex-start":"flex-end";}else if(direction===Direction.RowReverse){return"flex-start";}else{return"flex-end";}};var renderLabel=function renderLabel(value,labelStyle,textStyle){if(typeof value==="string"){return _jsx(Text,{style:[labelStyle,textStyle],children:value});}else{return _jsx(_Fragment,{children:value});}};var CheckboxGroupRow=function CheckboxGroupRow(_ref){var Icon=_ref.Icon,_ref$label=_ref.label,label=_ref$label===void 0?"Label":_ref$label,status=_ref.status,value=_ref.value,onPress=_ref.onPress,labelContainerStyle=_ref.labelContainerStyle,labelStyle=_ref.labelStyle,checkboxStyle=_ref.checkboxStyle,_ref$direction=_ref.direction,direction=_ref$direction===void 0?Direction.Row:_ref$direction,disabled=_ref.disabled,style=_ref.style,color=_ref.color,uncheckedColor=_ref.uncheckedColor,rest=_objectWithoutProperties(_ref,_excluded);var _useCheckboxGroupCont=useCheckboxGroupContext(),selectedValues=_useCheckboxGroupCont.values,onValueChange=_useCheckboxGroupCont.onValueChange,parentDirection=_useCheckboxGroupCont.direction;var values=Array.isArray(selectedValues)?selectedValues:[];var isChecked=status||values.includes(value);var handlePress=function handlePress(){if(!disabled){onPress==null?void 0:onPress(!isChecked);onValueChange==null?void 0:onValueChange(value,!isChecked);}};var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsxs(Pressable,Object.assign({onPress:handlePress,style:[styles.mainParent,{flexDirection:direction},viewStyles],disabled:disabled},rest,{children:[_jsx(View,{style:[styles.label,{alignItems:direction===Direction.Row?"flex-start":"flex-end"},labelContainerStyle],children:renderLabel(label,labelStyle,textStyles)}),_jsx(View,{style:{flex:1,alignItems:getCheckboxAlignment(parentDirection,direction)},children:_jsx(Checkbox,{Icon:Icon,status:isChecked,onPress:handlePress,style:checkboxStyle,disabled:disabled,color:color,uncheckedColor:uncheckedColor})})]}));};var styles=StyleSheet.create({mainParent:Object.assign({alignItems:"center",justifyContent:"space-around",paddingStart:20,minHeight:50,paddingEnd:20,display:"flex"},Platform.select({web:{cursor:"pointer",userSelect:"none"}})),label:{flex:3}});export default CheckboxGroupRow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","labelStyle","labelContainerStyle","checkboxStyle","direction","Icon","status","disabled","onPress","onCheck","onUncheck","color","uncheckedColor","defaultValue","checkedIcon","uncheckedIcon","size","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Checkbox/CheckboxRow.tsx";import*as React from"react";import{StyleSheet,View,Platform,Pressable}from"react-native";import{isString}from"lodash";import{extractStyles}from"../../utilities";import{usePrevious}from"../../hooks";import Text from"../Text";import Checkbox from"./Checkbox";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var Direction=function(Direction){Direction["Row"]="row";Direction["RowReverse"]="row-reverse";return Direction;}({});var renderLabel=function renderLabel(value,labelStyle,textStyle){if(isString(value)){return _jsx(Text,{style:[textStyle,labelStyle],children:value});}else{return _jsx(_Fragment,{children:value});}};var CheckboxRow=function CheckboxRow(_ref){var _ref$label=_ref.label,label=_ref$label===void 0?"Label":_ref$label,labelStyle=_ref.labelStyle,labelContainerStyle=_ref.labelContainerStyle,checkboxStyle=_ref.checkboxStyle,_ref$direction=_ref.direction,direction=_ref$direction===void 0?Direction.Row:_ref$direction,Icon=_ref.Icon,status=_ref.status,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,onPress=_ref.onPress,onCheck=_ref.onCheck,onUncheck=_ref.onUncheck,color=_ref.color,uncheckedColor=_ref.uncheckedColor,defaultValue=_ref.defaultValue,checkedIcon=_ref.checkedIcon,uncheckedIcon=_ref.uncheckedIcon,size=_ref.size,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(status||defaultValue||false),_React$useState2=_slicedToArray(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];React.useEffect(function(){if(status!=null){setInternalValue(status);}},[status]);var previousDefaultValue=usePrevious(defaultValue);React.useEffect(function(){if(defaultValue!==previousDefaultValue){setInternalValue(Boolean(defaultValue));}},[defaultValue,previousDefaultValue]);var handlePress=function handlePress(){var newValue=!internalValue;setInternalValue(newValue);onPress==null?void 0:onPress(newValue);if(newValue){onCheck==null?void 0:onCheck();}if(!newValue){onUncheck==null?void 0:onUncheck();}};var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsxs(Pressable,Object.assign({onPress:handlePress,style:[viewStyles,styles.mainParent,{flexDirection:direction}],disabled:disabled},rest,{children:[_jsx(View,{style:[styles.label,{alignItems:direction===Direction.Row?"flex-start":"flex-end"},labelContainerStyle],children:renderLabel(label,textStyles,labelStyle)}),_jsx(Checkbox,{Icon:Icon,status:internalValue,style:checkboxStyle,disabled:disabled,onPress:handlePress,color:color,uncheckedColor:uncheckedColor,checkedIcon:checkedIcon,uncheckedIcon:uncheckedIcon,size:size})]}));};var styles=StyleSheet.create({mainParent:Object.assign({alignItems:"center",justifyContent:"space-around",paddingStart:20,minHeight:50,paddingEnd:20,display:"flex"},Platform.select({web:{cursor:"pointer",userSelect:"none"}})),label:{flex:3}});export default CheckboxRow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{createContext,useContext}from"react";export var Direction=function(Direction){Direction["Horizontal"]="horizontal";Direction["Vertical"]="vertical";return Direction;}({});export var checkboxGroupContext=createContext({onValueChange:function onValueChange(){},values:[],direction:undefined});export function useCheckboxGroupContext(){return useContext(checkboxGroupContext);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{default as Checkbox}from"./Checkbox";export{default as CheckboxRow}from"./CheckboxRow";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{Dimensions,Platform}from"react-native";var getWindowDimensions=function getWindowDimensions(){var _Dimensions$get=Dimensions.get("window"),width=_Dimensions$get.width,height=_Dimensions$get.height;return{windowWidth:width,windowHeight:height};};var _getWindowDimensions=getWindowDimensions(),windowWidth=_getWindowDimensions.windowWidth,windowHeight=_getWindowDimensions.windowHeight;var getFilters=function getFilters(options){var width=options.width,height=options.height;var filters=["c_scale","q_auto","dpr_auto"];if(width)filters.push(`w_${width}`);if(height)filters.push(`h_${height}`);return filters.join(",");};var buildImageUrl=function buildImageUrl(options,name){var filters=getFilters(options);return["https://res.cloudinary.com/altos/image/upload",filters,`${name}.png`].join("/");};var getExtension=function getExtension(){return Platform.OS==="web"?".svg":".png";};export default{windowWidth:windowWidth,windowHeight:windowHeight,avatarImageUrl:buildImageUrl({width:60,height:60},"Avatar"),avatarImageSize:60,cardImageSize:200,cardImageUrl:"https://static.draftbit.com/images/placeholder-image"+getExtension(),cardIconSize:16,cardIconBackgroundOpacity:0.24,cardIconElevation:1,placeholderImageURL:"https://static.draftbit.com/images/placeholder-image"+getExtension(),getPlaceholderImageUrl:function getPlaceholderImageUrl(size){return buildImageUrl({width:size.width,height:size.height},"image-placeholder_1");},placeholderSvgURL:"https://static.draftbit.com/images/placeholder-image.svg",squareImageUrl:buildImageUrl({width:100,height:100},"Avatar"),FABSize:40,FABBorderRadius:20,FABFixedHeight:64,cardContainerShortImageAspectRatio:1,rowSingleLineImageSize:24,rowMultiLineImageSize:48,rowSingleLineIconSize:24,rowMultiLineIconSize:16,headerIconSize:24,buttonIconSize:24,swiperInactiveDotSize:6,swiperActiveDotSize:10,fieldSearchBarFullIconSize:24,stepperButtonSize:40,radioButtonSize:24,topSafeAreaViewHeight:0};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _lodash=_interopRequireDefault(require("lodash.omit"));var _dateformat=_interopRequireDefault(require("dateformat"));var _theming=require("../../theming");var _Portal=_interopRequireDefault(require("../Portal/Portal"));var _Touchable=_interopRequireDefault(require("../Touchable"));var _DatePickerComponent=_interopRequireDefault(require("./DatePickerComponent"));var _utilities=require("../../utilities");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["Icon","style","theme","date","onDateChange","defaultValue","disabled","mode","format","type","leftIconName","rightIconName","leftIconMode","label","labelSize","labelColor","placeholder","borderColor","borderColorActive","autoDismissKeyboard","minimumDate","maximumDate","hideLabel"],_excluded2=["lineHeight"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/DatePicker/DatePicker.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var AnimatedText=_reactNative.Animated.createAnimatedComponent(_reactNative.Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];var DatePicker=function DatePicker(_ref){var _viewStyles$borderCol;var Icon=_ref.Icon,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,roundness=_ref$theme.roundness,disabledOpacity=_ref$theme.disabledOpacity,date=_ref.date,_ref$onDateChange=_ref.onDateChange,onDateChange=_ref$onDateChange===void 0?function(){}:_ref$onDateChange,defaultValue=_ref.defaultValue,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$mode=_ref.mode,mode=_ref$mode===void 0?"date":_ref$mode,format=_ref.format,_ref$type=_ref.type,type=_ref$type===void 0?"underline":_ref$type,leftIconName=_ref.leftIconName,rightIconName=_ref.rightIconName,_ref$leftIconMode=_ref.leftIconMode,leftIconMode=_ref$leftIconMode===void 0?"inset":_ref$leftIconMode,label=_ref.label,labelSize=_ref.labelSize,labelColor=_ref.labelColor,placeholder=_ref.placeholder,inputBorderColor=_ref.borderColor,inputBorderColorActive=_ref.borderColorActive,_ref$autoDismissKeybo=_ref.autoDismissKeyboard,autoDismissKeyboard=_ref$autoDismissKeybo===void 0?true:_ref$autoDismissKeybo,minimumDate=_ref.minimumDate,maximumDate=_ref.maximumDate,_ref$hideLabel=_ref.hideLabel,hideLabel=_ref$hideLabel===void 0?false:_ref$hideLabel,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _React$useState=React.useState(parseDate(date)||parseDate(defaultValue)),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];React.useEffect(function(){if(defaultValue!=null){setValue(parseDate(defaultValue));}},[defaultValue]);var _React$useState3=React.useState(false),_React$useState4=(0,_slicedToArray2.default)(_React$useState3,2),pickerVisible=_React$useState4[0],setPickerVisible=_React$useState4[1];var _React$useState5=React.useState(new _reactNative.Animated.Value(date?0:1)),_React$useState6=(0,_slicedToArray2.default)(_React$useState5,1),labeled=_React$useState6[0];var _React$useState7=React.useState(""),_React$useState8=(0,_slicedToArray2.default)(_React$useState7,2),placeholder1=_React$useState8[0],setPlaceholder1=_React$useState8[1];var _React$useState9=React.useState(false),_React$useState10=(0,_slicedToArray2.default)(_React$useState9,2),focused=_React$useState10[0],setFocused=_React$useState10[1];var _React$useState11=React.useState({measured:false,width:0}),_React$useState12=(0,_slicedToArray2.default)(_React$useState11,2),labelLayout=_React$useState12[0],setLabelLayout=_React$useState12[1];var _extractStyles=(0,_utilities.extractStyles)(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var getValidDate=function getValidDate(){if(!value){return new Date();}return typeof(value==null?void 0:value.getMonth)==="function"?value:new Date();};var formatDate=function formatDate(){if(!value)return"";var newDate=getValidDate();if(format)return(0,_dateformat.default)(newDate,format);if(mode==="time"){return`${newDate.toLocaleTimeString()}`;}if(mode==="datetime"){return`${newDate.toLocaleString()}`;}return`${MONTHS[newDate.getMonth()]} ${newDate.getDate()}, ${newDate.getFullYear()}`;};var toggleVisibility=function(){var _ref2=(0,_asyncToGenerator2.default)(function*(){setPickerVisible(!pickerVisible);focused?_handleBlur():_handleFocus();});return function toggleVisibility(){return _ref2.apply(this,arguments);};}();var insets=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)();var _hidePlaceholder=function _hidePlaceholder(){setPlaceholder1("");};React.useEffect(function(){setValue(parseDate(date));},[date]);React.useEffect(function(){if(value||focused||placeholder1){_reactNative.Animated.timing(labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:_reactNative.Platform.OS!=="web"}).start();}else{_reactNative.Animated.timing(labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:_reactNative.Platform.OS!=="web"}).start();}},[value,focused,placeholder1,labeled]);React.useEffect(function(){var _showPlaceholder=function _showPlaceholder(){return setTimeout(function(){return setPlaceholder1(placeholder||"");},50);};if(focused||!label){_showPlaceholder();}else{_hidePlaceholder();}return function(){clearTimeout(_showPlaceholder());};},[focused,label,placeholder]);React.useEffect(function(){if(pickerVisible&&autoDismissKeyboard){_reactNative.Keyboard.dismiss();}},[pickerVisible,autoDismissKeyboard]);var _handleFocus=function _handleFocus(){if(disabled){return;}setFocused(true);};var _handleBlur=function _handleBlur(){if(disabled){return;}setFocused(false);};var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=textStyles.fontSize||typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=labelSize?labelSize:typography.caption.fontSize;var hasActiveOutline=focused;var propOrStyleBorderColor=(_viewStyles$borderCol=viewStyles.borderColor)!=null?_viewStyles$borderCol:inputBorderColor;var inputTextColor,activeColor,underlineColor,borderColor=propOrStyleBorderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.strong;if(disabled){activeColor=colors.light;placeholderColor=colors.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.divider;}else{activeColor=inputBorderColorActive||colors.primary;placeholderColor=colors.light;underlineColor=propOrStyleBorderColor||colors.light;backgroundColor=colors.background;}var _typography$subtitle=typography.subtitle1,lineHeight=_typography$subtitle.lineHeight,subtitle1=(0,_objectWithoutProperties2.default)(_typography$subtitle,_excluded2);inputStyle=Object.assign({paddingVertical:0,color:inputTextColor,paddingLeft:leftIconName&&leftIconMode==="inset"?ICON_SIZE+(type==="solid"?16:12):0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1,{height:lineHeight});if(type==="underline"){containerStyle={borderTopLeftRadius:roundness,borderTopRightRadius:roundness,paddingBottom:12,marginTop:16};}else{var _viewStyles$borderWid;containerStyle={borderRadius:roundness,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:(_viewStyles$borderWid=viewStyles.borderWidth)!=null?_viewStyles$borderWid:1,paddingTop:labeled&&!hideLabel?16*1.5:16,paddingBottom:labeled&&!hideLabel?16*0.5:16,opacity:disabled?disabledOpacity:1,backgroundColor:backgroundColor};inputStyle.paddingHorizontal=12;}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(focused){leftIconColor=colors.primary;}else{leftIconColor=colors.light;}var leftIconProps={size:24,color:leftIconColor,name:leftIconName||""};var leftIconStyle={position:"absolute",top:0,marginTop:type==="solid"?leftIconMode==="inset"?MINIMIZED_LABEL_FONT_SIZE+4:16:leftIconMode==="outset"?16:0};var labelStyle=Object.assign({},typography.subtitle1,{top:type==="solid"?16:0,fontFamily:textStyles==null?void 0:textStyles.fontFamily,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+(type==="solid"?16:12):0,transform:[{translateY:labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(labelLayout.width/2),0]})}]});var inputStyles=[styles.input,inputStyle,type==="solid"?{marginHorizontal:12}:{}];return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_Touchable.default,{disabled:disabled,onPress:toggleVisibility,children:(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_reactNative.StyleSheet.flatten([styles.container,(0,_lodash.default)(style,[].concat((0,_toConsumableArray2.default)(_utilities.paddingStyleNames),["backgroundColor","borderWidth"]))]),children:[leftIconName&&leftIconMode==="outset"?(0,_jsxRuntime.jsx)(Icon,Object.assign({},leftIconProps,{style:leftIconStyle})):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_reactNative.StyleSheet.flatten([containerStyle,style?{height:style.height}:{},(0,_lodash.default)(style,[].concat((0,_toConsumableArray2.default)(_utilities.marginStyleNames),(0,_toConsumableArray2.default)(_utilities.positionStyleNames),["borderColor","borderWidth"]))]),children:[type==="underline"?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.underline,{backgroundColor:focused?activeColor:underlineColor,transform:[{scaleY:focused?1:0.5}]}]}):null,label&&!hideLabel?(0,_jsxRuntime.jsxs)(_reactNative.View,{pointerEvents:"none",style:[_reactNative.StyleSheet.absoluteFill,{opacity:date||focused?labelLayout.measured?1:0:1}],children:[(0,_jsxRuntime.jsx)(AnimatedText,{onLayout:function onLayout(e){return setLabelLayout({width:e.nativeEvent.layout.width,measured:true});},style:[styles.placeholder,type==="solid"?{paddingHorizontal:12}:{},labelStyle,{color:labelColor||colors.light,opacity:labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),(0,_jsxRuntime.jsx)(AnimatedText,{style:[styles.placeholder,type==="solid"?{paddingHorizontal:12}:{},labelStyle,{color:labelColor||placeholderColor,opacity:hasActiveOutline?labeled:1}],numberOfLines:1,children:label})]}):null,leftIconName&&leftIconMode==="inset"?(0,_jsxRuntime.jsx)(Icon,Object.assign({},leftIconProps,{style:Object.assign({},leftIconStyle,{marginLeft:type==="solid"?16:0})})):null,(0,_jsxRuntime.jsx)(_reactNative.TextInput,Object.assign({value:formatDate(),placeholder:label&&!hideLabel?placeholder1:placeholder,editable:!disabled,placeholderTextColor:placeholderColor,selectionColor:activeColor,onFocus:_handleFocus,onBlur:_handleBlur,underlineColorAndroid:"transparent",style:[inputStyles,textStyles]},props))]}),rightIconName?(0,_jsxRuntime.jsx)(Icon,{name:rightIconName,size:ICON_SIZE,color:colors.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null]})})}),pickerVisible&&(0,_jsxRuntime.jsx)(_Portal.default,{children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.picker,{backgroundColor:colors.divider}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.pickerContainer,{paddingTop:insets.top,paddingBottom:insets.bottom,paddingLeft:insets.left,paddingRight:insets.right}],children:(0,_jsxRuntime.jsx)(_DatePickerComponent.default,{value:getValidDate(),mode:mode,isVisible:pickerVisible,toggleVisibility:toggleVisibility,minimumDate:parseDate(minimumDate),maximumDate:parseDate(maximumDate),onChange:function onChange(_event,data){toggleVisibility();setValue(data);onDateChange(data);}})})})})]});};var styles=_reactNative.StyleSheet.create({container:{alignSelf:"stretch"},picker:{position:"absolute",bottom:0,left:0,right:0,flexDirection:"row",justifyContent:"center"},underline:{position:"absolute",left:0,right:0,bottom:0,height:2},input:{flexGrow:1,justifyContent:"center",textAlignVertical:"center",margin:0,textAlign:_reactNative.I18nManager.isRTL?"right":"left"},placeholder:{position:"absolute",left:0},pickerContainer:{flexDirection:"column",width:"100%",zIndex:100},closeButton:{alignSelf:"flex-end"}});function parseDate(date){if(typeof date==="string"){var parsed=Date.parse(date);if(!isNaN(parsed)){return new Date(parsed);}console.warn("Invalid date string:",`'${date}'.`,"See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format");return undefined;}return date;}var _default=(0,_theming.withTheme)(DatePicker);exports.default=_default;
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","style","theme","date","onDateChange","defaultValue","disabled","mode","format","type","leftIconName","rightIconName","leftIconMode","label","labelSize","labelColor","placeholder","borderColor","borderColorActive","autoDismissKeyboard","minimumDate","maximumDate","hideLabel"],_excluded2=["lineHeight"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/DatePicker/DatePicker.tsx";import*as React from"react";import{View,Animated,Text,StyleSheet,I18nManager,TextInput as NativeTextInput,Keyboard,Platform}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import omit from"lodash.omit";import dateFormat from"dateformat";import{withTheme}from"../../theming";import Portal from"../Portal/Portal";import Touchable from"../Touchable";import DateTimePicker from"./DatePickerComponent";import{extractStyles,marginStyleNames,paddingStyleNames,positionStyleNames}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var AnimatedText=Animated.createAnimatedComponent(Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];var DatePicker=function DatePicker(_ref){var _viewStyles$borderCol;var Icon=_ref.Icon,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,roundness=_ref$theme.roundness,disabledOpacity=_ref$theme.disabledOpacity,date=_ref.date,_ref$onDateChange=_ref.onDateChange,onDateChange=_ref$onDateChange===void 0?function(){}:_ref$onDateChange,defaultValue=_ref.defaultValue,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$mode=_ref.mode,mode=_ref$mode===void 0?"date":_ref$mode,format=_ref.format,_ref$type=_ref.type,type=_ref$type===void 0?"underline":_ref$type,leftIconName=_ref.leftIconName,rightIconName=_ref.rightIconName,_ref$leftIconMode=_ref.leftIconMode,leftIconMode=_ref$leftIconMode===void 0?"inset":_ref$leftIconMode,label=_ref.label,labelSize=_ref.labelSize,labelColor=_ref.labelColor,placeholder=_ref.placeholder,inputBorderColor=_ref.borderColor,inputBorderColorActive=_ref.borderColorActive,_ref$autoDismissKeybo=_ref.autoDismissKeyboard,autoDismissKeyboard=_ref$autoDismissKeybo===void 0?true:_ref$autoDismissKeybo,minimumDate=_ref.minimumDate,maximumDate=_ref.maximumDate,_ref$hideLabel=_ref.hideLabel,hideLabel=_ref$hideLabel===void 0?false:_ref$hideLabel,props=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(parseDate(date)||parseDate(defaultValue)),_React$useState2=_slicedToArray(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];React.useEffect(function(){if(defaultValue!=null){setValue(parseDate(defaultValue));}},[defaultValue]);var _React$useState3=React.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),pickerVisible=_React$useState4[0],setPickerVisible=_React$useState4[1];var _React$useState5=React.useState(new Animated.Value(date?0:1)),_React$useState6=_slicedToArray(_React$useState5,1),labeled=_React$useState6[0];var _React$useState7=React.useState(""),_React$useState8=_slicedToArray(_React$useState7,2),placeholder1=_React$useState8[0],setPlaceholder1=_React$useState8[1];var _React$useState9=React.useState(false),_React$useState10=_slicedToArray(_React$useState9,2),focused=_React$useState10[0],setFocused=_React$useState10[1];var _React$useState11=React.useState({measured:false,width:0}),_React$useState12=_slicedToArray(_React$useState11,2),labelLayout=_React$useState12[0],setLabelLayout=_React$useState12[1];var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var getValidDate=function getValidDate(){if(!value){return new Date();}return typeof(value==null?void 0:value.getMonth)==="function"?value:new Date();};var formatDate=function formatDate(){if(!value)return"";var newDate=getValidDate();if(format)return dateFormat(newDate,format);if(mode==="time"){return`${newDate.toLocaleTimeString()}`;}if(mode==="datetime"){return`${newDate.toLocaleString()}`;}return`${MONTHS[newDate.getMonth()]} ${newDate.getDate()}, ${newDate.getFullYear()}`;};var toggleVisibility=function(){var _ref2=_asyncToGenerator(function*(){setPickerVisible(!pickerVisible);focused?_handleBlur():_handleFocus();});return function toggleVisibility(){return _ref2.apply(this,arguments);};}();var insets=useSafeAreaInsets();var _hidePlaceholder=function _hidePlaceholder(){setPlaceholder1("");};React.useEffect(function(){setValue(parseDate(date));},[date]);React.useEffect(function(){if(value||focused||placeholder1){Animated.timing(labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();}else{Animated.timing(labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();}},[value,focused,placeholder1,labeled]);React.useEffect(function(){var _showPlaceholder=function _showPlaceholder(){return setTimeout(function(){return setPlaceholder1(placeholder||"");},50);};if(focused||!label){_showPlaceholder();}else{_hidePlaceholder();}return function(){clearTimeout(_showPlaceholder());};},[focused,label,placeholder]);React.useEffect(function(){if(pickerVisible&&autoDismissKeyboard){Keyboard.dismiss();}},[pickerVisible,autoDismissKeyboard]);var _handleFocus=function _handleFocus(){if(disabled){return;}setFocused(true);};var _handleBlur=function _handleBlur(){if(disabled){return;}setFocused(false);};var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=textStyles.fontSize||typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=labelSize?labelSize:typography.caption.fontSize;var hasActiveOutline=focused;var propOrStyleBorderColor=(_viewStyles$borderCol=viewStyles.borderColor)!=null?_viewStyles$borderCol:inputBorderColor;var inputTextColor,activeColor,underlineColor,borderColor=propOrStyleBorderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.strong;if(disabled){activeColor=colors.light;placeholderColor=colors.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.divider;}else{activeColor=inputBorderColorActive||colors.primary;placeholderColor=colors.light;underlineColor=propOrStyleBorderColor||colors.light;backgroundColor=colors.background;}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+(type==="solid"?16:12):0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1,{height:lineHeight});if(type==="underline"){containerStyle={borderTopLeftRadius:roundness,borderTopRightRadius:roundness,paddingBottom:12,marginTop:16};}else{var _viewStyles$borderWid;containerStyle={borderRadius:roundness,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:(_viewStyles$borderWid=viewStyles.borderWidth)!=null?_viewStyles$borderWid:1,paddingTop:labeled&&!hideLabel?16*1.5:16,paddingBottom:labeled&&!hideLabel?16*0.5:16,opacity:disabled?disabledOpacity:1,backgroundColor:backgroundColor};inputStyle.paddingHorizontal=12;}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(focused){leftIconColor=colors.primary;}else{leftIconColor=colors.light;}var leftIconProps={size:24,color:leftIconColor,name:leftIconName||""};var leftIconStyle={position:"absolute",top:0,marginTop:type==="solid"?leftIconMode==="inset"?MINIMIZED_LABEL_FONT_SIZE+4:16:leftIconMode==="outset"?16:0};var labelStyle=Object.assign({},typography.subtitle1,{top:type==="solid"?16:0,fontFamily:textStyles==null?void 0:textStyles.fontFamily,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+(type==="solid"?16:12):0,transform:[{translateY:labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(labelLayout.width/2),0]})}]});var inputStyles=[styles.input,inputStyle,type==="solid"?{marginHorizontal:12}:{}];return _jsxs(_Fragment,{children:[_jsx(Touchable,{disabled:disabled,onPress:toggleVisibility,children:_jsx(View,{pointerEvents:"none",children:_jsxs(View,{style:StyleSheet.flatten([styles.container,omit(style,[].concat(_toConsumableArray(paddingStyleNames),["backgroundColor","borderWidth"]))]),children:[leftIconName&&leftIconMode==="outset"?_jsx(Icon,Object.assign({},leftIconProps,{style:leftIconStyle})):null,_jsxs(View,{style:StyleSheet.flatten([containerStyle,style?{height:style.height}:{},omit(style,[].concat(_toConsumableArray(marginStyleNames),_toConsumableArray(positionStyleNames),["borderColor","borderWidth"]))]),children:[type==="underline"?_jsx(Animated.View,{style:[styles.underline,{backgroundColor:focused?activeColor:underlineColor,transform:[{scaleY:focused?1:0.5}]}]}):null,label&&!hideLabel?_jsxs(View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{opacity:date||focused?labelLayout.measured?1:0:1}],children:[_jsx(AnimatedText,{onLayout:function onLayout(e){return setLabelLayout({width:e.nativeEvent.layout.width,measured:true});},style:[styles.placeholder,type==="solid"?{paddingHorizontal:12}:{},labelStyle,{color:labelColor||colors.light,opacity:labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),_jsx(AnimatedText,{style:[styles.placeholder,type==="solid"?{paddingHorizontal:12}:{},labelStyle,{color:labelColor||placeholderColor,opacity:hasActiveOutline?labeled:1}],numberOfLines:1,children:label})]}):null,leftIconName&&leftIconMode==="inset"?_jsx(Icon,Object.assign({},leftIconProps,{style:Object.assign({},leftIconStyle,{marginLeft:type==="solid"?16:0})})):null,_jsx(NativeTextInput,Object.assign({value:formatDate(),placeholder:label&&!hideLabel?placeholder1:placeholder,editable:!disabled,placeholderTextColor:placeholderColor,selectionColor:activeColor,onFocus:_handleFocus,onBlur:_handleBlur,underlineColorAndroid:"transparent",style:[inputStyles,textStyles]},props))]}),rightIconName?_jsx(Icon,{name:rightIconName,size:ICON_SIZE,color:colors.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null]})})}),pickerVisible&&_jsx(Portal,{children:_jsx(View,{style:[styles.picker,{backgroundColor:colors.divider}],children:_jsx(View,{style:[styles.pickerContainer,{paddingTop:insets.top,paddingBottom:insets.bottom,paddingLeft:insets.left,paddingRight:insets.right}],children:_jsx(DateTimePicker,{value:getValidDate(),mode:mode,isVisible:pickerVisible,toggleVisibility:toggleVisibility,minimumDate:parseDate(minimumDate),maximumDate:parseDate(maximumDate),onChange:function onChange(_event,data){toggleVisibility();setValue(data);onDateChange(data);}})})})})]});};var styles=StyleSheet.create({container:{alignSelf:"stretch"},picker:{position:"absolute",bottom:0,left:0,right:0,flexDirection:"row",justifyContent:"center"},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"},placeholder:{position:"absolute",left:0},pickerContainer:{flexDirection:"column",width:"100%",zIndex:100},closeButton:{alignSelf:"flex-end"}});function parseDate(date){if(typeof date==="string"){var parsed=Date.parse(date);if(!isNaN(parsed)){return new Date(parsed);}console.warn("Invalid date string:",`'${date}'.`,"See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format");return undefined;}return date;}export default withTheme(DatePicker);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/DatePicker/DatePickerComponent.tsx";import React from"react";import{Platform}from"react-native";import DateTimePicker from"@react-native-community/datetimepicker";import DateTimePickerModal from"react-native-modal-datetime-picker";import{jsx as _jsx}from"react/jsx-runtime";var DatePickerComponent=function DatePickerComponent(_ref){var value=_ref.value,onChange=_ref.onChange,mode=_ref.mode,minimumDate=_ref.minimumDate,maximumDate=_ref.maximumDate,toggleVisibility=_ref.toggleVisibility;return Platform.OS==="ios"||Platform.OS==="android"?_jsx(DateTimePickerModal,{date:value,mode:mode,isVisible:true,display:Platform.OS==="ios"?"spinner":"default",minimumDate:minimumDate,maximumDate:maximumDate,onCancel:function onCancel(){console.log("Picker cancelled before selecting anything.");toggleVisibility();},onConfirm:function onConfirm(data){onChange(null,data);}}):_jsx(DateTimePicker,{value:value,mode:mode,onChange:onChange,display:"default",minimumDate:minimumDate,maximumDate:maximumDate});};export default DatePickerComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/DatePicker/DatePickerComponent.web.tsx";import React from"react";import DateFnsUtils from"@date-io/date-fns";import{MuiPickersUtilsProvider,DatePicker,TimePicker,DateTimePicker}from"@material-ui/pickers";import{createMuiTheme,ThemeProvider}from"@material-ui/core/styles";import{withTheme}from"../../theming";import Theme from"../../styles/DefaultTheme";import{jsx as _jsx}from"react/jsx-runtime";var DatePickerComponent=function DatePickerComponent(_ref){var value=_ref.value,_onChange=_ref.onChange,mode=_ref.mode,toggleVisibility=_ref.toggleVisibility,isVisible=_ref.isVisible,minimumDate=_ref.minimumDate,maximumDate=_ref.maximumDate,theme=_ref.theme;var internalTheme=createMuiTheme({palette:{primary:{main:theme.colors.primary||Theme.colors.primary},secondary:{main:theme.colors.secondary||Theme.colors.secondary}}});var Picker=mode==="date"?DatePicker:mode==="time"?TimePicker:DateTimePicker;return _jsx(MuiPickersUtilsProvider,{utils:DateFnsUtils,children:_jsx(ThemeProvider,{theme:internalTheme,children:_jsx(Picker,{value:value,open:isVisible,onChange:function onChange(d){toggleVisibility();_onChange(null,d);},onClose:function onClose(){return toggleVisibility();},variant:"dialog",TextFieldComponent:function TextFieldComponent(){return null;},minDate:minimumDate,maxDate:maximumDate})})});};export default withTheme(DatePickerComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/DeckSwiper/DeckSwiper.tsx";import React from"react";import{StyleSheet,View}from"react-native";import DeckSwiperComponent from"react-native-deck-swiper";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 DeckSwiper=function DeckSwiper(_ref){var onStartSwipe=_ref.onStartSwipe,onEndSwipe=_ref.onEndSwipe,onSwipe=_ref.onSwipe,_onSwipedLeft=_ref.onSwipedLeft,_onSwipedRight=_ref.onSwipedRight,onSwipedUp=_ref.onSwipedUp,onSwipedDown=_ref.onSwipedDown,onIndexChanged=_ref.onIndexChanged,onEndReached=_ref.onEndReached,_ref$startCardIndex=_ref.startCardIndex,startCardIndex=_ref$startCardIndex===void 0?0:_ref$startCardIndex,_ref$infiniteSwiping=_ref.infiniteSwiping,infiniteSwiping=_ref$infiniteSwiping===void 0?false:_ref$infiniteSwiping,_ref$verticalEnabled=_ref.verticalEnabled,verticalEnabled=_ref$verticalEnabled===void 0?true:_ref$verticalEnabled,_ref$horizontalEnable=_ref.horizontalEnabled,horizontalEnabled=_ref$horizontalEnable===void 0?true:_ref$horizontalEnable,_ref$visibleCardCount=_ref.visibleCardCount,visibleCardCount=_ref$visibleCardCount===void 0?1:_ref$visibleCardCount,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,style=_ref.style,children=_ref.children;if(data&&!renderItem||renderItem&&!data){throw new Error("'renderItem' and 'data' need to both be provided to lazily render. Either remove them entirley or include both");}if(data&&renderItem&&children){console.warn("'children' of DeckSwiper ignored due to usage of 'data' and 'renderItem'");}var deckSwiperRef=React.useRef(null);var childrenArray=React.useMemo(function(){return React.Children.toArray(children);},[children]);var cardsFillerData=React.useMemo(function(){return Array.from(Array(childrenArray.length).keys());},[childrenArray]);var cardsData=Array.isArray(data)?data:cardsFillerData;var renderCard=function renderCard(card,index){if(renderItem){return renderItem({item:card,index:index});}else{return _jsx(_Fragment,{children:childrenArray[index]});}};var renderFirstCard=function renderFirstCard(){if(cardsData.length){return renderCard(cardsData[0],0);}return undefined;};var cardKeyExtractor=function cardKeyExtractor(card){if(keyExtractor){return keyExtractor(card);}else{return card==null?void 0:card.toString();}};React.useEffect(function(){var _deckSwiperRef$curren;(_deckSwiperRef$curren=deckSwiperRef.current)==null?void 0:_deckSwiperRef$curren.forceUpdate();});return _jsxs(View,{children:[_jsx(View,{style:styles.containerHeightFiller,children:renderFirstCard()}),_jsx(DeckSwiperComponent,{ref:deckSwiperRef,cards:cardsData,renderCard:renderCard,keyExtractor:cardKeyExtractor,containerStyle:StyleSheet.flatten([styles.cardsContainer,style]),cardStyle:styles.card,onSwiped:onIndexChanged,onSwipedAll:onEndReached,cardIndex:startCardIndex,infinite:infiniteSwiping,verticalSwipe:verticalEnabled,horizontalSwipe:horizontalEnabled,showSecondCard:visibleCardCount>1,stackSize:visibleCardCount,backgroundColor:"transparent",cardVerticalMargin:0,cardHorizontalMargin:0,onSwipedLeft:function onSwipedLeft(index){_onSwipedLeft==null?void 0:_onSwipedLeft(index);onSwipe==null?void 0:onSwipe(index);},onSwipedRight:function onSwipedRight(index){_onSwipedRight==null?void 0:_onSwipedRight(index);onSwipe==null?void 0:onSwipe(index);},onSwipedTop:function onSwipedTop(index){onSwipedUp==null?void 0:onSwipedUp(index);onSwipe==null?void 0:onSwipe(index);},onSwipedBottom:function onSwipedBottom(index){onSwipedDown==null?void 0:onSwipedDown(index);onSwipe==null?void 0:onSwipe(index);},dragStart:onStartSwipe,dragEnd:onEndSwipe})]});};var styles=StyleSheet.create({cardsContainer:{position:"absolute"},card:{left:0,right:0,width:"auto",height:"auto"},containerHeightFiller:{opacity:0.0}});export default DeckSwiper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/DeckSwiper/DeckSwiperCard.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{withTheme}from"../../theming";import{jsx as _jsx}from"react/jsx-runtime";var DeckSwiperCard=function DeckSwiperCard(_ref){var style=_ref.style,children=_ref.children,theme=_ref.theme;return _jsx(View,{style:[styles.card,{backgroundColor:theme.colors.background,borderColor:theme.colors.divider},style],children:children});};var styles=StyleSheet.create({card:{alignItems:"center",justifyContent:"center",padding:20,borderWidth:2}});export default withTheme(DeckSwiperCard);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{default as DeckSwiper}from"./DeckSwiper";export{default as DeckSwiperCard}from"./DeckSwiperCard";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","color","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Divider.tsx";import*as React from"react";import{StyleSheet,View}from"react-native";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";var Divider=function Divider(_ref){var style=_ref.style,color=_ref.color,colors=_ref.theme.colors,rest=_objectWithoutProperties(_ref,_excluded);return _jsx(View,Object.assign({style:[{backgroundColor:color||colors.divider,height:StyleSheet.hairlineWidth},style]},rest));};export default withTheme(Divider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","theme","children"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Elevation.tsx";import*as React from"react";import{Animated,StyleSheet,View}from"react-native";import shadow from"../styles/shadow";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";var Elevation=function Elevation(_ref){var style=_ref.style,theme=_ref.theme,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var _ref2=StyleSheet.flatten(style)||{},_ref2$elevation=_ref2.elevation,elevation=_ref2$elevation===void 0?4:_ref2$elevation,radius=_ref2.borderRadius;var colors=theme.colors;var borderRadius=radius;return _jsx(Animated.View,Object.assign({},rest,{style:[{borderRadius:borderRadius,backgroundColor:colors.surface},elevation?shadow(elevation):null,style],children:_jsx(View,{style:{overflow:"hidden",borderRadius:borderRadius},children:children})}));};export default withTheme(Elevation);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/FormRow.tsx";var _excluded=["disabled","direction","children","label","style","onPress"];import*as React from"react";import{Text,StyleSheet}from"react-native";import{extractStyles}from"../utilities";import Touchable from"./Touchable";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default function FormRow(_ref){var disabled=_ref.disabled,direction=_ref.direction,children=_ref.children,label=_ref.label,style=_ref.style,onPress=_ref.onPress,rest=_objectWithoutProperties(_ref,_excluded);var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsxs(Touchable,Object.assign({disabled:disabled,onPress:onPress,style:[styles.row,{flexDirection:direction},viewStyles]},rest,{children:[_jsx(Text,{style:textStyles,children:label}),children]}));}var styles=StyleSheet.create({row:{marginLeft:8,marginRight:8,flexDirection:"row",justifyContent:"space-between",alignItems:"center"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","color","size","disabled","loading","onPress","theme","style","activeOpacity","disabledOpacity"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/IconButton.tsx";import*as React from"react";import{View,StyleSheet,ActivityIndicator,Pressable,Platform}from"react-native";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var IconButton=function IconButton(_ref){var Icon=_ref.Icon,icon=_ref.icon,customColor=_ref.color,_ref$size=_ref.size,size=_ref$size===void 0?32:_ref$size,disabled=_ref.disabled,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,onPress=_ref.onPress,theme=_ref.theme,_style=_ref.style,_ref$activeOpacity=_ref.activeOpacity,activeOpacity=_ref$activeOpacity===void 0?0.8:_ref$activeOpacity,_ref$disabledOpacity=_ref.disabledOpacity,disabledOpacity=_ref$disabledOpacity===void 0?0.8:_ref$disabledOpacity,props=_objectWithoutProperties(_ref,_excluded);var iconColor=customColor||theme.colors.primary;return _jsx(Pressable,Object.assign({onPress:onPress,disabled:disabled||loading,style:function style(_ref2){var pressed=_ref2.pressed;return[styles.container,{opacity:pressed?activeOpacity:disabled?disabledOpacity:1,width:size,height:size,alignItems:"center",justifyContent:"center"},_style];}},props,{children:_jsxs(View,{children:[icon&&!loading?_jsx(Icon,{name:icon,size:size-2,color:iconColor}):null,loading?_jsx(ActivityIndicator,{size:"small",color:iconColor}):null]})}));};var styles=StyleSheet.create({container:Object.assign({alignItems:"center",justifyContent:"center"},Platform.select({web:{cursor:"pointer",userSelect:"none"}}))});export default withTheme(IconButton);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["source","resizeMode","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Image.tsx";import React from"react";import{Image as NativeImage,StyleSheet}from"react-native";import Config from"./Config";import AspectRatio from"./AspectRatio";import{jsx as _jsx}from"react/jsx-runtime";var generateDimensions=function generateDimensions(_ref){var aspectRatio=_ref.aspectRatio,width=_ref.width,height=_ref.height;if(aspectRatio&&!width&&!height){return{aspectRatio:aspectRatio,width:"100%"};}if(aspectRatio&&height){return{aspectRatio:aspectRatio,height:height,width:aspectRatio*height};}if(aspectRatio&&width){return{aspectRatio:aspectRatio,width:width,height:width/aspectRatio};}return{width:width,height:height};};var Image=function Image(_ref2){var source=_ref2.source,_ref2$resizeMode=_ref2.resizeMode,resizeMode=_ref2$resizeMode===void 0?"cover":_ref2$resizeMode,style=_ref2.style,props=_objectWithoutProperties(_ref2,_excluded);var imageSource=source===null||source===undefined?Config.placeholderImageURL:source;var styles=StyleSheet.flatten(style||{});var _generateDimensions=generateDimensions(styles),aspectRatio=_generateDimensions.aspectRatio,width=_generateDimensions.width,height=_generateDimensions.height;if(aspectRatio){return _jsx(AspectRatio,{style:[style,{width:width,height:height,aspectRatio:aspectRatio}],children:_jsx(NativeImage,Object.assign({},props,{source:imageSource,resizeMode:resizeMode,style:[style,{height:"100%",width:"100%"}]}))});}return _jsx(NativeImage,Object.assign({},props,{source:source,resizeMode:resizeMode,style:style}));};export default Image;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["behavior","keyboardVerticalOffset","androidBehavior","androidKeyboardVerticalOffset","iosBehavior","iosKeyboardVerticalOffset"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/KeyboardAvoidingView.tsx";import React from"react";import{KeyboardAvoidingView as KeyboardAvoidingViewComponent,Platform}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var isIos=Platform.OS==="ios";var isAndroid=Platform.OS==="android";var KeyboardAvoidingView=function KeyboardAvoidingView(_ref){var _ref$behavior=_ref.behavior,behavior=_ref$behavior===void 0?"padding":_ref$behavior,_ref$keyboardVertical=_ref.keyboardVerticalOffset,keyboardVerticalOffset=_ref$keyboardVertical===void 0?0:_ref$keyboardVertical,androidBehavior=_ref.androidBehavior,androidKeyboardVerticalOffset=_ref.androidKeyboardVerticalOffset,iosBehavior=_ref.iosBehavior,iosKeyboardVerticalOffset=_ref.iosKeyboardVerticalOffset,rest=_objectWithoutProperties(_ref,_excluded);var behaviorResult;if(isIos&&iosBehavior!==undefined){behaviorResult=iosBehavior;}else if(isAndroid&&androidBehavior!==undefined){behaviorResult=androidBehavior;}else{behaviorResult=behavior;}var keyboardVerticalOffsetResult;if(isIos&&iosKeyboardVerticalOffset!==undefined){keyboardVerticalOffsetResult=iosKeyboardVerticalOffset;}else if(isAndroid&&androidKeyboardVerticalOffset!==undefined){keyboardVerticalOffsetResult=androidKeyboardVerticalOffset;}else{keyboardVerticalOffsetResult=keyboardVerticalOffset;}return _jsx(KeyboardAvoidingViewComponent,Object.assign({behavior:behaviorResult,keyboardVerticalOffset:keyboardVerticalOffsetResult},rest));};export default KeyboardAvoidingView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["aspectRatio","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/AspectRatio.tsx";import React from"react";import{View}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var AspectRatio=function AspectRatio(_ref){var _ref$aspectRatio=_ref.aspectRatio,aspectRatio=_ref$aspectRatio===void 0?1:_ref$aspectRatio,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);return _jsx(View,Object.assign({},rest,{style:[{aspectRatio:aspectRatio},style]}));};export default AspectRatio;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Center.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{convertBackwardCompatiblePropsToStyle}from"./LayoutCommon";import{jsx as _jsx}from"react/jsx-runtime";var Center=function Center(_ref){var style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var backwardsCompatibleStyle=convertBackwardCompatiblePropsToStyle(rest);return _jsx(View,Object.assign({},rest,{style:[styles.center,backwardsCompatibleStyle,style]}));};var styles=StyleSheet.create({center:{alignItems:"center",justifyContent:"center"}});export default Center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Circle.tsx";import React from"react";import{StyleSheet}from"react-native";import Square from"./Square";import{pick}from"lodash";import{convertBackwardCompatiblePropsToStyle}from"./LayoutCommon";import{jsx as _jsx}from"react/jsx-runtime";var Circle=function Circle(_ref){var size=_ref.size,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var backwardsCompatibleStyle=pick(convertBackwardCompatiblePropsToStyle(rest),"backgroundColor");return _jsx(Square,Object.assign({},rest,{size:size,style:[backwardsCompatibleStyle,style,styles.circle]}));};var styles=StyleSheet.create({circle:{borderRadius:1000}});export default Circle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/HStack.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var HStack=function HStack(_ref){var style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);return _jsx(View,Object.assign({},rest,{style:[styles.hStack,style]}));};var styles=StyleSheet.create({hStack:{flexDirection:"row"}});export default HStack;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export function convertBackwardCompatiblePropsToStyle(props){return{width:props.width,height:props.height,backgroundColor:props.bgColor};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Spacer.tsx";import React from"react";import{View}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var Spacer=function Spacer(_ref){var _ref$top=_ref.top,top=_ref$top===void 0?8:_ref$top,_ref$right=_ref.right,right=_ref$right===void 0?8:_ref$right,_ref$bottom=_ref.bottom,bottom=_ref$bottom===void 0?8:_ref$bottom,_ref$left=_ref.left,left=_ref$left===void 0?8:_ref$left,style=_ref.style;return _jsx(View,{style:[style,{paddingRight:right,paddingTop:top,paddingLeft:left,paddingBottom:bottom}]});};export default Spacer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["size","style","onLayout"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Square.tsx";import React from"react";import Center from"./Center";import{pick}from"lodash";import{convertBackwardCompatiblePropsToStyle}from"./LayoutCommon";import{jsx as _jsx}from"react/jsx-runtime";var Square=function Square(_ref){var size=_ref.size,style=_ref.style,_onLayout=_ref.onLayout,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),calculatedSize=_React$useState2[0],setCalculatedSize=_React$useState2[1];var backwardsCompatibleStyle=pick(convertBackwardCompatiblePropsToStyle(rest),"backgroundColor");return _jsx(Center,Object.assign({onLayout:function onLayout(e){var layout=e.nativeEvent.layout;setCalculatedSize(Math.max(layout.width,layout.height));_onLayout==null?void 0:_onLayout(e);}},rest,{style:[backwardsCompatibleStyle,style,size!=undefined?{width:size,height:size}:{},calculatedSize>0?{width:calculatedSize,height:calculatedSize}:{}]}));};export default Square;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/VStack.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var VStack=function VStack(_ref){var style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);return _jsx(View,Object.assign({},rest,{style:[styles.vStack,style]}));};var styles=StyleSheet.create({vStack:{flexDirection:"column"}});export default VStack;
|