@draftbit/core 49.4.8-21b409.2 → 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 _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
+ 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,jsxs as _jsxs,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 _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
+ 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,jsxs as _jsxs,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
- 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
+ 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,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
- 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
+ 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,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
- 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
+ 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,Fragment as _Fragment,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
- 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
+ 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,Fragment as _Fragment,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
- 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
+ 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,jsxs as _jsxs,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 _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
+ 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,jsx as _jsx,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
- 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
+ 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,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
- 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
+ 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,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
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","theme","thumbColor","completedTrackColor","remainingTrackColor","togglePlaybackIconSize","togglePlaybackIconColor","onPlaybackStatusUpdate","onPlaybackFinish","hidePlaybackIcon","hideDuration","hideSlider"],_excluded2=["color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx";import*as React from"react";import{Text,View,StyleSheet}from"react-native";import{AntDesign}from"@expo/vector-icons";import{withTheme}from"../../../theming";import Slider from"@react-native-community/slider";import HeadlessAudioPlayer from"./HeadlessAudioPlayer";import Pressable from"../../Pressable";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 AudioPlayerWithInterface=React.forwardRef(function(_ref,ref){var style=_ref.style,theme=_ref.theme,_ref$thumbColor=_ref.thumbColor,thumbColor=_ref$thumbColor===void 0?theme.colors.primary:_ref$thumbColor,_ref$completedTrackCo=_ref.completedTrackColor,completedTrackColor=_ref$completedTrackCo===void 0?theme.colors.primary:_ref$completedTrackCo,_ref$remainingTrackCo=_ref.remainingTrackColor,remainingTrackColor=_ref$remainingTrackCo===void 0?theme.colors.divider:_ref$remainingTrackCo,_ref$togglePlaybackIc=_ref.togglePlaybackIconSize,togglePlaybackIconSize=_ref$togglePlaybackIc===void 0?24:_ref$togglePlaybackIc,_ref$togglePlaybackIc2=_ref.togglePlaybackIconColor,togglePlaybackIconColor=_ref$togglePlaybackIc2===void 0?theme.colors.primary:_ref$togglePlaybackIc2,onPlaybackStatusUpdateProp=_ref.onPlaybackStatusUpdate,onPlaybackFinishProp=_ref.onPlaybackFinish,_ref$hidePlaybackIcon=_ref.hidePlaybackIcon,hidePlaybackIcon=_ref$hidePlaybackIcon===void 0?false:_ref$hidePlaybackIcon,_ref$hideDuration=_ref.hideDuration,hideDuration=_ref$hideDuration===void 0?false:_ref$hideDuration,_ref$hideSlider=_ref.hideSlider,hideSlider=_ref$hideSlider===void 0?false:_ref$hideSlider,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isPlaying=_React$useState2[0],setIsPlaying=_React$useState2[1];var _React$useState3=React.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),isLoading=_React$useState4[0],setIsLoading=_React$useState4[1];var _React$useState5=React.useState(1),_React$useState6=_slicedToArray(_React$useState5,2),durationMillis=_React$useState6[0],setDurationMillis=_React$useState6[1];var _React$useState7=React.useState(false),_React$useState8=_slicedToArray(_React$useState7,2),isDraggingSlider=_React$useState8[0],setIsDraggingSlider=_React$useState8[1];var _React$useState9=React.useState(0),_React$useState10=_slicedToArray(_React$useState9,2),sliderPositionMillis=_React$useState10[0],setSliderPositionMillis=_React$useState10[1];var newHeadlessAudioPlayerRef=React.useRef(null);var headlessAudioPlayerRef=ref?ref:newHeadlessAudioPlayerRef;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,viewStyles=_objectWithoutProperties(_StyleSheet$flatten,_excluded2);var textStyles={color:color,fontFamily:fontFamily,fontWeight:fontWeight,fontSize:fontSize,lineHeight:lineHeight,letterSpacing:letterSpacing,textTransform:textTransform,textAlign:textAlign,textDecorationLine:textDecorationLine,textDecorationColor:textDecorationColor,textDecorationStyle:textDecorationStyle};var onPlaybackStatusUpdate=function onPlaybackStatusUpdate(status){setIsLoading(status.isLoading);setDurationMillis(status.durationMillis);setSliderPositionMillis(status.currentPositionMillis);setIsPlaying(status.isPlaying);onPlaybackStatusUpdateProp==null?void 0:onPlaybackStatusUpdateProp(status);};var onPlaybackFinish=function onPlaybackFinish(){var _headlessAudioPlayerR,_headlessAudioPlayerR2;setIsPlaying(false);setSliderPositionMillis(0);(_headlessAudioPlayerR=headlessAudioPlayerRef.current)==null?void 0:_headlessAudioPlayerR.togglePlayback();(_headlessAudioPlayerR2=headlessAudioPlayerRef.current)==null?void 0:_headlessAudioPlayerR2.seekToPosition(0);onPlaybackFinishProp==null?void 0:onPlaybackFinishProp();};var onSlidingComplete=function onSlidingComplete(sliderValue){var _headlessAudioPlayerR3;if(isDraggingSlider){setIsDraggingSlider(false);}(_headlessAudioPlayerR3=headlessAudioPlayerRef.current)==null?void 0:_headlessAudioPlayerR3.seekToPosition(sliderValue);};var onSliderChange=function onSliderChange(){if(!isDraggingSlider){setIsDraggingSlider(true);}};var iconName;if(isLoading){iconName="loading1";}else if(isPlaying){iconName="pause";}else{iconName="play";}return _jsxs(_Fragment,{children:[_jsx(HeadlessAudioPlayer,Object.assign({},rest,{ref:headlessAudioPlayerRef,onPlaybackStatusUpdate:onPlaybackStatusUpdate,onPlaybackFinish:onPlaybackFinish})),_jsxs(View,{testID:"audio-player-interface",style:[{backgroundColor:theme.colors.background,borderColor:theme.colors.divider},styles.container,viewStyles],children:[!hidePlaybackIcon&&_jsx(Pressable,{testID:"audio-player-playback-icon",onPress:function onPress(){var _headlessAudioPlayerR4;return(_headlessAudioPlayerR4=headlessAudioPlayerRef.current)==null?void 0:_headlessAudioPlayerR4.togglePlayback();},style:styles.spacingEnd,children:_jsx(AntDesign,{name:iconName,size:togglePlaybackIconSize,color:togglePlaybackIconColor})}),!hideDuration&&_jsxs(Text,{testID:"audio-player-duration",style:[{color:theme.colors.strong},styles.spacingEnd,Object.assign({},textStyles)],children:[formatDuration(sliderPositionMillis!=null?sliderPositionMillis:0)," /"," ",formatDuration(durationMillis||0)]}),!hideSlider&&_jsx(Slider,{testID:"audio-player-slider",style:styles.slider,minimumTrackTintColor:completedTrackColor,maximumTrackTintColor:remainingTrackColor,thumbTintColor:thumbColor,minimumValue:0,value:sliderPositionMillis,maximumValue:durationMillis,onValueChange:onSliderChange,onSlidingComplete:onSlidingComplete})]})]});});var styles=StyleSheet.create({container:{padding:8,flexDirection:"row",alignItems:"center",borderRadius:8,borderWidth:1},spacingEnd:{marginEnd:8},slider:{flex:1}});function formatDuration(duration){if(duration===0)return"00:00";var seconds=Math.floor(duration/1000%60);var minutes=Math.floor(duration/(1000*60)%60);var hours=Math.floor(duration/(1000*60*60)%24);var renderedHours=hours<10?"0"+hours:hours;var renderedMinutes=minutes<10?"0"+minutes:minutes;var renderedSeconds=seconds<10?"0"+seconds:seconds;if(hours>0){return renderedHours+":"+renderedMinutes+":"+renderedSeconds;}return renderedMinutes+":"+renderedSeconds;}export default withTheme(AudioPlayerWithInterface);
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","theme","thumbColor","completedTrackColor","remainingTrackColor","togglePlaybackIconSize","togglePlaybackIconColor","onPlaybackStatusUpdate","onPlaybackFinish","hidePlaybackIcon","hideDuration","hideSlider"],_excluded2=["color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx";import*as React from"react";import{Text,View,StyleSheet}from"react-native";import{AntDesign}from"@expo/vector-icons";import{withTheme}from"../../../theming";import Slider from"@react-native-community/slider";import HeadlessAudioPlayer from"./HeadlessAudioPlayer";import Pressable from"../../Pressable";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";var AudioPlayerWithInterface=React.forwardRef(function(_ref,ref){var style=_ref.style,theme=_ref.theme,_ref$thumbColor=_ref.thumbColor,thumbColor=_ref$thumbColor===void 0?theme.colors.primary:_ref$thumbColor,_ref$completedTrackCo=_ref.completedTrackColor,completedTrackColor=_ref$completedTrackCo===void 0?theme.colors.primary:_ref$completedTrackCo,_ref$remainingTrackCo=_ref.remainingTrackColor,remainingTrackColor=_ref$remainingTrackCo===void 0?theme.colors.divider:_ref$remainingTrackCo,_ref$togglePlaybackIc=_ref.togglePlaybackIconSize,togglePlaybackIconSize=_ref$togglePlaybackIc===void 0?24:_ref$togglePlaybackIc,_ref$togglePlaybackIc2=_ref.togglePlaybackIconColor,togglePlaybackIconColor=_ref$togglePlaybackIc2===void 0?theme.colors.primary:_ref$togglePlaybackIc2,onPlaybackStatusUpdateProp=_ref.onPlaybackStatusUpdate,onPlaybackFinishProp=_ref.onPlaybackFinish,_ref$hidePlaybackIcon=_ref.hidePlaybackIcon,hidePlaybackIcon=_ref$hidePlaybackIcon===void 0?false:_ref$hidePlaybackIcon,_ref$hideDuration=_ref.hideDuration,hideDuration=_ref$hideDuration===void 0?false:_ref$hideDuration,_ref$hideSlider=_ref.hideSlider,hideSlider=_ref$hideSlider===void 0?false:_ref$hideSlider,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isPlaying=_React$useState2[0],setIsPlaying=_React$useState2[1];var _React$useState3=React.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),isLoading=_React$useState4[0],setIsLoading=_React$useState4[1];var _React$useState5=React.useState(1),_React$useState6=_slicedToArray(_React$useState5,2),durationMillis=_React$useState6[0],setDurationMillis=_React$useState6[1];var _React$useState7=React.useState(false),_React$useState8=_slicedToArray(_React$useState7,2),isDraggingSlider=_React$useState8[0],setIsDraggingSlider=_React$useState8[1];var _React$useState9=React.useState(0),_React$useState10=_slicedToArray(_React$useState9,2),sliderPositionMillis=_React$useState10[0],setSliderPositionMillis=_React$useState10[1];var newHeadlessAudioPlayerRef=React.useRef(null);var headlessAudioPlayerRef=ref?ref:newHeadlessAudioPlayerRef;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,viewStyles=_objectWithoutProperties(_StyleSheet$flatten,_excluded2);var textStyles={color:color,fontFamily:fontFamily,fontWeight:fontWeight,fontSize:fontSize,lineHeight:lineHeight,letterSpacing:letterSpacing,textTransform:textTransform,textAlign:textAlign,textDecorationLine:textDecorationLine,textDecorationColor:textDecorationColor,textDecorationStyle:textDecorationStyle};var onPlaybackStatusUpdate=function onPlaybackStatusUpdate(status){setIsLoading(status.isLoading);setDurationMillis(status.durationMillis);setSliderPositionMillis(status.currentPositionMillis);setIsPlaying(status.isPlaying);onPlaybackStatusUpdateProp==null?void 0:onPlaybackStatusUpdateProp(status);};var onPlaybackFinish=function onPlaybackFinish(){var _headlessAudioPlayerR,_headlessAudioPlayerR2;setIsPlaying(false);setSliderPositionMillis(0);(_headlessAudioPlayerR=headlessAudioPlayerRef.current)==null?void 0:_headlessAudioPlayerR.togglePlayback();(_headlessAudioPlayerR2=headlessAudioPlayerRef.current)==null?void 0:_headlessAudioPlayerR2.seekToPosition(0);onPlaybackFinishProp==null?void 0:onPlaybackFinishProp();};var onSlidingComplete=function onSlidingComplete(sliderValue){var _headlessAudioPlayerR3;if(isDraggingSlider){setIsDraggingSlider(false);}(_headlessAudioPlayerR3=headlessAudioPlayerRef.current)==null?void 0:_headlessAudioPlayerR3.seekToPosition(sliderValue);};var onSliderChange=function onSliderChange(){if(!isDraggingSlider){setIsDraggingSlider(true);}};var iconName;if(isLoading){iconName="loading1";}else if(isPlaying){iconName="pause";}else{iconName="play";}return _jsxs(_Fragment,{children:[_jsx(HeadlessAudioPlayer,Object.assign({},rest,{ref:headlessAudioPlayerRef,onPlaybackStatusUpdate:onPlaybackStatusUpdate,onPlaybackFinish:onPlaybackFinish})),_jsxs(View,{testID:"audio-player-interface",style:[{backgroundColor:theme.colors.background,borderColor:theme.colors.divider},styles.container,viewStyles],children:[!hidePlaybackIcon&&_jsx(Pressable,{testID:"audio-player-playback-icon",onPress:function onPress(){var _headlessAudioPlayerR4;return(_headlessAudioPlayerR4=headlessAudioPlayerRef.current)==null?void 0:_headlessAudioPlayerR4.togglePlayback();},style:styles.spacingEnd,children:_jsx(AntDesign,{name:iconName,size:togglePlaybackIconSize,color:togglePlaybackIconColor})}),!hideDuration&&_jsxs(Text,{testID:"audio-player-duration",style:[{color:theme.colors.strong},styles.spacingEnd,Object.assign({},textStyles)],children:[formatDuration(sliderPositionMillis!=null?sliderPositionMillis:0)," /"," ",formatDuration(durationMillis||0)]}),!hideSlider&&_jsx(Slider,{testID:"audio-player-slider",style:styles.slider,minimumTrackTintColor:completedTrackColor,maximumTrackTintColor:remainingTrackColor,thumbTintColor:thumbColor,minimumValue:0,value:sliderPositionMillis,maximumValue:durationMillis,onValueChange:onSliderChange,onSlidingComplete:onSlidingComplete})]})]});});var styles=StyleSheet.create({container:{padding:8,flexDirection:"row",alignItems:"center",borderRadius:8,borderWidth:1},spacingEnd:{marginEnd:8},slider:{flex:1}});function formatDuration(duration){if(duration===0)return"00:00";var seconds=Math.floor(duration/1000%60);var minutes=Math.floor(duration/(1000*60)%60);var hours=Math.floor(duration/(1000*60*60)%24);var renderedHours=hours<10?"0"+hours:hours;var renderedMinutes=minutes<10?"0"+minutes:minutes;var renderedSeconds=seconds<10?"0"+seconds:seconds;if(hours>0){return renderedHours+":"+renderedMinutes+":"+renderedSeconds;}return renderedMinutes+":"+renderedSeconds;}export default withTheme(AudioPlayerWithInterface);
@@ -1 +1 @@
1
- import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import*as React from"react";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";var MediaPlaybackWrapper=React.forwardRef(function(_ref,ref){var media=_ref.media,isPlaying=_ref.isPlaying,onTogglePlayback=_ref.onTogglePlayback,children=_ref.children;var togglePlayback=React.useCallback(_asyncToGenerator(function*(){onTogglePlayback==null?void 0:onTogglePlayback();if(isPlaying){yield media==null?void 0:media.pauseAsync();}else{yield media==null?void 0:media.playAsync();}}),[media,isPlaying,onTogglePlayback]);var pause=React.useCallback(_asyncToGenerator(function*(){onTogglePlayback==null?void 0:onTogglePlayback();yield media==null?void 0:media.pauseAsync();}),[media,onTogglePlayback]);var play=React.useCallback(_asyncToGenerator(function*(){onTogglePlayback==null?void 0:onTogglePlayback();yield media==null?void 0:media.playAsync();}),[media,onTogglePlayback]);var seekToPosition=React.useCallback(function(){var _ref5=_asyncToGenerator(function*(positionMillis){yield media==null?void 0:media.setPositionAsync(positionMillis);});return function(_x){return _ref5.apply(this,arguments);};}(),[media]);React.useEffect(function(){return media?function(){media.unloadAsync();}:undefined;},[media]);React.useImperativeHandle(ref,function(){return{seekToPosition:seekToPosition,togglePlayback:togglePlayback,pause:pause,play:play};},[seekToPosition,togglePlayback,pause,play]);return _jsx(_Fragment,{children:children});});export default MediaPlaybackWrapper;
1
+ import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import*as React from"react";import{Fragment as _Fragment,jsx as _jsx}from"react/jsx-runtime";var MediaPlaybackWrapper=React.forwardRef(function(_ref,ref){var media=_ref.media,isPlaying=_ref.isPlaying,onTogglePlayback=_ref.onTogglePlayback,children=_ref.children;var togglePlayback=React.useCallback(_asyncToGenerator(function*(){onTogglePlayback==null?void 0:onTogglePlayback();if(isPlaying){yield media==null?void 0:media.pauseAsync();}else{yield media==null?void 0:media.playAsync();}}),[media,isPlaying,onTogglePlayback]);var pause=React.useCallback(_asyncToGenerator(function*(){onTogglePlayback==null?void 0:onTogglePlayback();yield media==null?void 0:media.pauseAsync();}),[media,onTogglePlayback]);var play=React.useCallback(_asyncToGenerator(function*(){onTogglePlayback==null?void 0:onTogglePlayback();yield media==null?void 0:media.playAsync();}),[media,onTogglePlayback]);var seekToPosition=React.useCallback(function(){var _ref5=_asyncToGenerator(function*(positionMillis){yield media==null?void 0:media.setPositionAsync(positionMillis);});return function(_x){return _ref5.apply(this,arguments);};}(),[media]);React.useEffect(function(){return media?function(){media.unloadAsync();}:undefined;},[media]);React.useImperativeHandle(ref,function(){return{seekToPosition:seekToPosition,togglePlayback:togglePlayback,pause:pause,play:play};},[seekToPosition,togglePlayback,pause,play]);return _jsx(_Fragment,{children:children});});export default MediaPlaybackWrapper;
@@ -1 +1 @@
1
- import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["options","onValueChange","Icon","placeholder","value","autoDismissKeyboard","theme","disabled"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Picker/NativePicker.tsx";import*as React from"react";import{StyleSheet,Platform,Keyboard}from"react-native";import{SafeAreaView}from"react-native-safe-area-context";import{Picker as NativePickerComponent}from"@react-native-picker/picker";import Portal from"../Portal/Portal";import{Button}from"../Button";import{useDeepCompareMemo}from"../../utilities";import{normalizeToPickerOptions}from"./PickerCommon";import PickerInputContainer from"./PickerInputContainer";import{withTheme}from"../../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var isIos=Platform.OS==="ios";var isWeb=Platform.OS==="web";var NativePicker=function NativePicker(_ref){var _ref$options=_ref.options,optionsProp=_ref$options===void 0?[]:_ref$options,_onValueChange=_ref.onValueChange,Icon=_ref.Icon,placeholder=_ref.placeholder,value=_ref.value,_ref$autoDismissKeybo=_ref.autoDismissKeyboard,autoDismissKeyboard=_ref$autoDismissKeybo===void 0?true:_ref$autoDismissKeybo,theme=_ref.theme,disabled=_ref.disabled,rest=_objectWithoutProperties(_ref,_excluded);var pickerRef=React.useRef(null);var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),pickerVisible=_React$useState2[0],setPickerVisible=_React$useState2[1];var options=useDeepCompareMemo(function(){var normalizedOptions=normalizeToPickerOptions(optionsProp);if(placeholder){return[{label:placeholder,value:placeholder}].concat(_toConsumableArray(normalizedOptions));}else{return normalizedOptions;}},[placeholder,optionsProp]);if(!placeholder&&options.length&&!value&&value!==options[0].value){_onValueChange==null?void 0:_onValueChange(options[0].value);}var renderNativePicker=function renderNativePicker(){return _jsx(NativePickerComponent,{ref:pickerRef,testID:"native-picker-component",selectedValue:value,onValueChange:function onValueChange(newValue){if(newValue!==placeholder){_onValueChange==null?void 0:_onValueChange(newValue);}else if(newValue===placeholder){_onValueChange==null?void 0:_onValueChange("");}},style:isIos?styles.iosNativePicker:styles.nativePicker,onBlur:function onBlur(){return setPickerVisible(false);},children:options.map(function(option){return _jsx(NativePickerComponent.Item,{testID:"native-picker-item",label:option.label.toString(),value:option.value},option.value);})});};var renderPicker=function renderPicker(){if(isIos){return _jsx(Portal,{children:_jsxs(SafeAreaView,{style:styles.iosPickerContent,children:[_jsx(Button,{Icon:Icon,onPress:function onPress(){return setPickerVisible(!pickerVisible);},style:[styles.iosButton,{color:theme.colors.primary}],title:"Close"}),renderNativePicker()]})});}else{return renderNativePicker();}};React.useEffect(function(){if(pickerVisible&&pickerRef.current){var _pickerRef$current;pickerRef==null?void 0:(_pickerRef$current=pickerRef.current)==null?void 0:_pickerRef$current.focus();}},[pickerVisible,pickerRef]);React.useEffect(function(){if(pickerVisible&&autoDismissKeyboard){Keyboard.dismiss();}},[pickerVisible,autoDismissKeyboard]);return _jsx(PickerInputContainer,Object.assign({testID:"native-picker",Icon:Icon,placeholder:placeholder,selectedValue:value,options:options,onPress:function onPress(){return setPickerVisible(!pickerVisible);},disabled:disabled},rest,{children:(pickerVisible||isWeb)&&!disabled&&renderPicker()}));};var styles=StyleSheet.create({nativePicker:Object.assign({position:"absolute",bottom:0,left:0,right:0,flexDirection:"row",justifyContent:"center",width:"100%",backgroundColor:"white",opacity:0},Platform.select({web:{height:"100%"}})),iosNativePicker:{backgroundColor:"white"},iosPickerContent:{width:"100%",position:"absolute",bottom:0,backgroundColor:"white"},iosButton:{backgroundColor:"transparent",borderWidth:0}});export default withTheme(NativePicker);
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["options","onValueChange","Icon","placeholder","value","autoDismissKeyboard","theme","disabled"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Picker/NativePicker.tsx";import*as React from"react";import{StyleSheet,Platform,Keyboard}from"react-native";import{SafeAreaView}from"react-native-safe-area-context";import{Picker as NativePickerComponent}from"@react-native-picker/picker";import Portal from"../Portal/Portal";import{Button}from"../Button";import{useDeepCompareMemo}from"../../utilities";import{normalizeToPickerOptions}from"./PickerCommon";import PickerInputContainer from"./PickerInputContainer";import{withTheme}from"../../theming";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var isIos=Platform.OS==="ios";var isWeb=Platform.OS==="web";var NativePicker=function NativePicker(_ref){var _ref$options=_ref.options,optionsProp=_ref$options===void 0?[]:_ref$options,_onValueChange=_ref.onValueChange,Icon=_ref.Icon,placeholder=_ref.placeholder,value=_ref.value,_ref$autoDismissKeybo=_ref.autoDismissKeyboard,autoDismissKeyboard=_ref$autoDismissKeybo===void 0?true:_ref$autoDismissKeybo,theme=_ref.theme,disabled=_ref.disabled,rest=_objectWithoutProperties(_ref,_excluded);var pickerRef=React.useRef(null);var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),pickerVisible=_React$useState2[0],setPickerVisible=_React$useState2[1];var options=useDeepCompareMemo(function(){var normalizedOptions=normalizeToPickerOptions(optionsProp);if(placeholder){return[{label:placeholder,value:placeholder}].concat(_toConsumableArray(normalizedOptions));}else{return normalizedOptions;}},[placeholder,optionsProp]);if(!placeholder&&options.length&&!value&&value!==options[0].value){_onValueChange==null?void 0:_onValueChange(options[0].value);}var renderNativePicker=function renderNativePicker(){return _jsx(NativePickerComponent,{ref:pickerRef,testID:"native-picker-component",selectedValue:value,onValueChange:function onValueChange(newValue){if(newValue!==placeholder){_onValueChange==null?void 0:_onValueChange(newValue);}else if(newValue===placeholder){_onValueChange==null?void 0:_onValueChange("");}},style:isIos?styles.iosNativePicker:styles.nativePicker,onBlur:function onBlur(){return setPickerVisible(false);},children:options.map(function(option){return _jsx(NativePickerComponent.Item,{testID:"native-picker-item",label:option.label.toString(),value:option.value},option.value);})});};var renderPicker=function renderPicker(){if(isIos){return _jsx(Portal,{children:_jsxs(SafeAreaView,{style:styles.iosPickerContent,children:[_jsx(Button,{Icon:Icon,onPress:function onPress(){return setPickerVisible(!pickerVisible);},style:[styles.iosButton,{color:theme.colors.primary}],title:"Close"}),renderNativePicker()]})});}else{return renderNativePicker();}};React.useEffect(function(){if(pickerVisible&&pickerRef.current){var _pickerRef$current;pickerRef==null?void 0:(_pickerRef$current=pickerRef.current)==null?void 0:_pickerRef$current.focus();}},[pickerVisible,pickerRef]);React.useEffect(function(){if(pickerVisible&&autoDismissKeyboard){Keyboard.dismiss();}},[pickerVisible,autoDismissKeyboard]);return _jsx(PickerInputContainer,Object.assign({testID:"native-picker",Icon:Icon,placeholder:placeholder,selectedValue:value,options:options,onPress:function onPress(){return setPickerVisible(!pickerVisible);},disabled:disabled},rest,{children:(pickerVisible||isWeb)&&!disabled&&renderPicker()}));};var styles=StyleSheet.create({nativePicker:Object.assign({position:"absolute",bottom:0,left:0,right:0,flexDirection:"row",justifyContent:"center",width:"100%",backgroundColor:"white",opacity:0},Platform.select({web:{height:"100%"}})),iosNativePicker:{backgroundColor:"white"},iosPickerContent:{width:"100%",position:"absolute",bottom:0,backgroundColor:"white"},iosButton:{backgroundColor:"transparent",borderWidth:0}});export default withTheme(NativePicker);
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["options","onPress","Icon","style","selectedValue","disabled","zIndex","children","testID"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Picker/PickerInputContainer.tsx";import React from"react";import{View,StyleSheet}from"react-native";import omit from"lodash.omit";import{extractSizeStyles,extractPositionStyles,extractFlexItemStyles,extractBorderAndMarginStyles}from"../../utilities";import TextField from"../TextField";import Touchable from"../Touchable";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var PickerInputContainer=function PickerInputContainer(_ref){var _selectedLabel;var _ref$options=_ref.options,options=_ref$options===void 0?[]:_ref$options,onPress=_ref.onPress,Icon=_ref.Icon,style=_ref.style,selectedValue=_ref.selectedValue,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,zIndex=_ref.zIndex,children=_ref.children,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var containerStyle=StyleSheet.flatten([extractSizeStyles(style),extractPositionStyles(style),extractFlexItemStyles(style),extractBorderAndMarginStyles(style).marginStyles]);var textFieldStyle=omit(StyleSheet.flatten(style),Object.keys(containerStyle));var selectedLabel="";if(Array.isArray(selectedValue)){selectedLabel=selectedValue.map(function(value){var _options$find;return((_options$find=options.find(function(option){return option.value.toString()===value.toString();}))==null?void 0:_options$find.label.toString())||value;}).join(", ");}else{var _options$find2;selectedLabel=((_options$find2=options.find(function(option){return option.value.toString()===(selectedValue==null?void 0:selectedValue.toString());}))==null?void 0:_options$find2.label.toString())||selectedValue;}return _jsxs(View,{testID:testID,style:[containerStyle,{zIndex:zIndex}],children:[_jsx(TextField,Object.assign({Icon:Icon,numberOfLines:1,onChangeText:function onChangeText(){},value:(_selectedLabel=selectedLabel)==null?void 0:_selectedLabel.toString(),editable:false,disabled:disabled,style:textFieldStyle},rest)),_jsx(Touchable,{style:StyleSheet.absoluteFillObject,disabled:disabled,onPress:onPress,onLongPress:onPress}),children]});};export default PickerInputContainer;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["options","onPress","Icon","style","selectedValue","disabled","zIndex","children","testID"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Picker/PickerInputContainer.tsx";import React from"react";import{View,StyleSheet}from"react-native";import omit from"lodash.omit";import{extractSizeStyles,extractPositionStyles,extractFlexItemStyles,extractBorderAndMarginStyles}from"../../utilities";import TextField from"../TextField";import Touchable from"../Touchable";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var PickerInputContainer=function PickerInputContainer(_ref){var _selectedLabel;var _ref$options=_ref.options,options=_ref$options===void 0?[]:_ref$options,onPress=_ref.onPress,Icon=_ref.Icon,style=_ref.style,selectedValue=_ref.selectedValue,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,zIndex=_ref.zIndex,children=_ref.children,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var containerStyle=StyleSheet.flatten([extractSizeStyles(style),extractPositionStyles(style),extractFlexItemStyles(style),extractBorderAndMarginStyles(style).marginStyles]);var textFieldStyle=omit(StyleSheet.flatten(style),Object.keys(containerStyle));var selectedLabel="";if(Array.isArray(selectedValue)){selectedLabel=selectedValue.map(function(value){var _options$find;return((_options$find=options.find(function(option){return option.value.toString()===value.toString();}))==null?void 0:_options$find.label.toString())||value;}).join(", ");}else{var _options$find2;selectedLabel=((_options$find2=options.find(function(option){return option.value.toString()===(selectedValue==null?void 0:selectedValue.toString());}))==null?void 0:_options$find2.label.toString())||selectedValue;}return _jsxs(View,{testID:testID,style:[containerStyle,{zIndex:zIndex}],children:[_jsx(TextField,Object.assign({Icon:Icon,numberOfLines:1,onChangeText:function onChangeText(){},value:(_selectedLabel=selectedLabel)==null?void 0:_selectedLabel.toString(),editable:false,disabled:disabled,style:textFieldStyle},rest)),_jsx(Touchable,{style:StyleSheet.absoluteFillObject,disabled:disabled,onPress:onPress,onLongPress:onPress}),children]});};export default PickerInputContainer;
@@ -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/components/Portal/PortalHost.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{View,StyleSheet}from"react-native";import PortalManager from"./PortalManager";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var PortalContext=React.createContext(null);var PortalHost=function(_React$Component){_inherits(PortalHost,_React$Component);var _super=_createSuper(PortalHost);function PortalHost(){var _this;_classCallCheck(this,PortalHost);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.setManager=function(manager){_this.manager=manager;};_this.mount=function(children){var key=_this.nextKey++;if(_this.manager){_this.manager.mount(key,children);}else{_this.queue.push({type:"mount",key:key,children:children});}return key;};_this.update=function(key,children){if(_this.manager){_this.manager.update(key,children);}else{var op={type:"mount",key:key,children:children};var index=_this.queue.findIndex(function(o){return o.type==="mount"||o.type==="update"&&o.key===key;});if(index>-1){_this.queue[index]=op;}else{_this.queue.push(op);}}};_this.unmount=function(key){if(_this.manager){_this.manager.unmount(key);}else{_this.queue.push({type:"unmount",key:key});}};_this.nextKey=0;_this.queue=[];return _this;}_createClass(PortalHost,[{key:"componentDidMount",value:function componentDidMount(){var manager=this.manager;var queue=this.queue;while(queue.length&&manager){var action=queue.pop();if(action){switch(action.type){case"mount":manager.mount(action.key,action.children);break;case"update":manager.update(action.key,action.children);break;case"unmount":manager.unmount(action.key);break;}}}}},{key:"render",value:function render(){return _jsxs(PortalContext.Provider,{value:{mount:this.mount,update:this.update,unmount:this.unmount},children:[_jsx(View,{style:styles.container,collapsable:false,pointerEvents:"box-none",children:this.props.children}),_jsx(PortalManager,{ref:this.setManager})]});}}]);return PortalHost;}(React.Component);PortalHost.displayName="Portal.Host";export{PortalHost as default};var styles=StyleSheet.create({container:{flex: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/components/Portal/PortalHost.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{View,StyleSheet}from"react-native";import PortalManager from"./PortalManager";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var PortalContext=React.createContext(null);var PortalHost=function(_React$Component){_inherits(PortalHost,_React$Component);var _super=_createSuper(PortalHost);function PortalHost(){var _this;_classCallCheck(this,PortalHost);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.setManager=function(manager){_this.manager=manager;};_this.mount=function(children){var key=_this.nextKey++;if(_this.manager){_this.manager.mount(key,children);}else{_this.queue.push({type:"mount",key:key,children:children});}return key;};_this.update=function(key,children){if(_this.manager){_this.manager.update(key,children);}else{var op={type:"mount",key:key,children:children};var index=_this.queue.findIndex(function(o){return o.type==="mount"||o.type==="update"&&o.key===key;});if(index>-1){_this.queue[index]=op;}else{_this.queue.push(op);}}};_this.unmount=function(key){if(_this.manager){_this.manager.unmount(key);}else{_this.queue.push({type:"unmount",key:key});}};_this.nextKey=0;_this.queue=[];return _this;}_createClass(PortalHost,[{key:"componentDidMount",value:function componentDidMount(){var manager=this.manager;var queue=this.queue;while(queue.length&&manager){var action=queue.pop();if(action){switch(action.type){case"mount":manager.mount(action.key,action.children);break;case"update":manager.update(action.key,action.children);break;case"unmount":manager.unmount(action.key);break;}}}}},{key:"render",value:function render(){return _jsxs(PortalContext.Provider,{value:{mount:this.mount,update:this.update,unmount:this.unmount},children:[_jsx(View,{style:styles.container,collapsable:false,pointerEvents:"box-none",children:this.props.children}),_jsx(PortalManager,{ref:this.setManager})]});}}]);return PortalHost;}(React.Component);PortalHost.displayName="Portal.Host";export{PortalHost as default};var styles=StyleSheet.create({container:{flex: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/Progress/CircularProgress/CircularProgress.tsx";import React from"react";import Svg,{Path}from"react-native-svg";import{View}from"react-native";import Animated,{useAnimatedProps,useSharedValue,withTiming}from"react-native-reanimated";import{DEFAULT_ANIMATION_DURATION}from"../ProgressCommon";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var AnimatedPath=Animated.createAnimatedComponent(Path);var _worklet_16562771247151_init_data={code:"function anonymous() {\n const {\n currentAngle,\n startAngle,\n circlePath,\n radius,\n thicknessOffset\n } = this._closure;\n const isBelowMinAngle = currentAngle.value <= startAngle;\n return {\n d: circlePath(radius, radius, radius - thicknessOffset, startAngle, Math.min(currentAngle.value, startAngle + 360)),\n strokeOpacity: isBelowMinAngle ? 0.0 : 1.0\n };\n}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/CircularProgress/CircularProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"anonymous\",\"currentAngle\",\"startAngle\",\"circlePath\",\"radius\",\"thicknessOffset\",\"_closure\",\"isBelowMinAngle\",\"value\",\"d\",\"Math\",\"min\",\"strokeOpacity\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/CircularProgress/CircularProgress.tsx\"],\"mappings\":\"AAoFgE,SAAAA,SAAMA,CAAA;EAAA;IAAAC,YAAA;IAAAC,UAAA;IAAAC,UAAA;IAAAC,MAAA;IAAAC;EAAA,SAAAC,QAAA;EAClE,MAAMC,eAAe,GAAGN,YAAY,CAACO,KAAK,IAAIN,UAAU;EACxD,OAAO;IACLO,CAAC,EAAEN,UAAU,CACXC,MAAM,EACNA,MAAM,EACNA,MAAM,GAAGC,eAAe,EACxBH,UAAU,EACVQ,IAAI,CAACC,GAAG,CAACV,YAAY,CAACO,KAAK,EAAEN,UAAU,GAAG,GAAG,CAC/C,CAAC;IACDU,aAAa,EAAEL,eAAe,GAAG,GAAG,GAAG;EACzC,CAAC;AACH\"}"};export var CircularProgress=function CircularProgress(_ref){var theme=_ref.theme,_ref$minimumValue=_ref.minimumValue,minimumValue=_ref$minimumValue===void 0?0:_ref$minimumValue,_ref$maximumValue=_ref.maximumValue,maximumValue=_ref$maximumValue===void 0?100:_ref$maximumValue,_ref$value=_ref.value,value=_ref$value===void 0?minimumValue:_ref$value,_ref$thickness=_ref.thickness,thickness=_ref$thickness===void 0?10:_ref$thickness,_ref$trackThickness=_ref.trackThickness,trackThickness=_ref$trackThickness===void 0?thickness:_ref$trackThickness,_ref$color=_ref.color,color=_ref$color===void 0?theme.colors.primary:_ref$color,_ref$trackColor=_ref.trackColor,trackColor=_ref$trackColor===void 0?theme.colors.divider:_ref$trackColor,_ref$trackOpacity=_ref.trackOpacity,trackOpacity=_ref$trackOpacity===void 0?1:_ref$trackOpacity,_ref$showTrack=_ref.showTrack,showTrack=_ref$showTrack===void 0?true:_ref$showTrack,_ref$animationDuratio=_ref.animationDuration,animationDuration=_ref$animationDuratio===void 0?DEFAULT_ANIMATION_DURATION:_ref$animationDuratio,_ref$isAnimated=_ref.isAnimated,isAnimated=_ref$isAnimated===void 0?true:_ref$isAnimated,_ref$lineCap=_ref.lineCap,lineCap=_ref$lineCap===void 0?"round":_ref$lineCap,_ref$trackLineCap=_ref.trackLineCap,trackLineCap=_ref$trackLineCap===void 0?lineCap:_ref$trackLineCap,dashWidth=_ref.dashWidth,trackDashWidth=_ref.trackDashWidth,dashGap=_ref.dashGap,trackDashGap=_ref.trackDashGap,dashOffset=_ref.dashOffset,trackDashOffset=_ref.trackDashOffset,customDashArray=_ref.customDashArray,trackCustomDashArray=_ref.trackCustomDashArray,onFullPathWidth=_ref.onFullPathWidth,_ref$startPosition=_ref.startPosition,startPosition=_ref$startPosition===void 0?"top":_ref$startPosition,style=_ref.style,testID=_ref.testID;var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),svgContainerWidth=_React$useState2[0],setSvgContainerWidth=_React$useState2[1];var _React$useState3=React.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),circumfrence=_React$useState4[0],setCircumefrence=_React$useState4[1];var dashArray=dashWidth!==undefined?`${dashWidth} ${dashGap||dashWidth}`:undefined;var trackDashArray=trackDashWidth!==undefined?`${trackDashWidth} ${trackDashGap||trackDashWidth}`:undefined;var maxThickness=Math.max(thickness,trackThickness);var thicknessOffset=maxThickness/2;var radius=svgContainerWidth/2;var c=2*Math.PI*radius;if(c!==circumfrence){setCircumefrence(c);}var startAngle=React.useMemo(function(){switch(startPosition){case"top":return 0;case"right":return 90;case"bottom":return 180;case"left":return 270;}},[startPosition]);var currentFillPercentage=value/(maximumValue+minimumValue);var currentAngle=useSharedValue(startAngle);var progressPathAnimatedProps=useAnimatedProps(function(){var _e=[new global.Error(),-6,-27];var _f=function _f(){var isBelowMinAngle=currentAngle.value<=startAngle;return{d:circlePath(radius,radius,radius-thicknessOffset,startAngle,Math.min(currentAngle.value,startAngle+360)),strokeOpacity:isBelowMinAngle?0.0:1.0};};_f._closure={currentAngle:currentAngle,startAngle:startAngle,circlePath:circlePath,radius:radius,thicknessOffset:thicknessOffset};_f.__initData=_worklet_16562771247151_init_data;_f.__workletHash=16562771247151;_f.__stackDetails=_e;_f.__version="3.3.0";return _f;}());React.useEffect(function(){currentAngle.value=withTiming(startAngle+currentFillPercentage*360,{duration:isAnimated?animationDuration:0});},[value,currentFillPercentage,animationDuration,currentAngle,maximumValue,minimumValue,isAnimated,startAngle]);React.useEffect(function(){onFullPathWidth==null?void 0:onFullPathWidth(circumfrence);},[circumfrence,onFullPathWidth]);return _jsx(View,{onLayout:function onLayout(event){var width=event.nativeEvent.layout.width;setSvgContainerWidth(width);},style:[{height:svgContainerWidth},style],children:_jsxs(Svg,{testID:testID!=null?testID:"circular-progress-component",style:{flex:1},children:[showTrack&&_jsx(Path,{d:circlePath(radius,radius,radius-thicknessOffset,startAngle,startAngle+360),stroke:trackColor,strokeWidth:trackThickness,strokeOpacity:trackOpacity,strokeLinecap:trackLineCap,strokeDasharray:trackCustomDashArray||trackDashArray,strokeDashoffset:trackDashOffset,fill:"rgba(0,0,0,0)"}),_jsx(AnimatedPath,{animatedProps:progressPathAnimatedProps,stroke:color,strokeWidth:thickness,strokeLinecap:lineCap,strokeDasharray:customDashArray||dashArray,strokeDashoffset:dashOffset,fill:"rgba(0,0,0,0)",onPress:function onPress(){}})]})});};var _worklet_13438583604277_init_data={code:"function circlePath(x, y, radius, startAngle, endAngle) {\n function polarToCartesian(centerX, centerY, radius, angleInDegrees) {\n var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;\n return {\n x: centerX + radius * Math.cos(angleInRadians),\n y: centerY + radius * Math.sin(angleInRadians)\n };\n }\n var start = polarToCartesian(x, y, radius, endAngle * 0.9999);\n var end = polarToCartesian(x, y, radius, startAngle);\n var largeArcFlag = endAngle - startAngle <= 180 ? \"0\" : \"1\";\n var d = [\"M\", start.x, start.y, \"A\", radius, radius, 0, largeArcFlag, 0, end.x, end.y];\n return d.join(\" \");\n}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/CircularProgress/CircularProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"circlePath\",\"x\",\"y\",\"radius\",\"startAngle\",\"endAngle\",\"polarToCartesian\",\"centerX\",\"centerY\",\"angleInDegrees\",\"Math\",\"cos\",\"angleInRadians\",\"sin\",\"start\",\"end\",\"largeArcFlag\",\"d\",\"join\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/CircularProgress/CircularProgress.tsx\"],\"mappings\":\"AAoKA,SAAAA,WAAAC,CAAA,EAAAC,CAAA,EAAAC,MAAA,EAAAC,UAAA,EAAAC,QAAA;EAQa,SAAAC,iBAAAC,OAAA,EAAAC,OAAA,EAAAL,MAAA,EAAAM,cAAA;;IAEX,OAAS;MAMPR,CAAA,EAAIM,OAAA,GAAAJ,MAAkB,GAACO,IAAA,CAAAC,GAAA,CAAAC,cAAuB;MAC9CV,CAAA,EAAAM,OAAO,GAAAL,MAAA,GAAAO,IAAA,CAAAG,GAAA,CAAAD,cAAA;;;MAGNE,KAAA,GAAAR,gBAAA,CAAAL,CAAA,EAAAC,CAAA,EAAAC,MAAA,EAAAE,QAAA;EACH,IAAAU,GAAA,GAAAT,gBAAA,CAAAL,CAAA,EAAAC,CAAA,EAAAC,MAAA,EAAAC,UAAA;EAEA,IAAIY,YAAQ,GAAAX,QAAA,GAAkBD,UAAK,IAAQ,SAAQ,GAAG;EACtD,IAAIa,CAAA,GAAG,IAAG,EAAAH,KAAA,CAAAb,CAAA,EAAAa,KAAkB,CAAAZ,CAAE,EAAC,GAAE,EAAAC,MAAQ,EAAAA,MAAU,EAAC,GAAAa,YAAA,KAAAD,GAAA,CAAAd,CAAA,EAAAc,GAAA,CAAAb,CAAA;EACpD,OAAIe,CAAA,CAAAC,IAAA,IAAY\"}"};var circlePath=function(){var _e=[new global.Error(),1,-27];var _f=function _f(x,y,radius,startAngle,endAngle){function polarToCartesian(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)};}var start=polarToCartesian(x,y,radius,endAngle*0.9999);var end=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(" ");};_f._closure={};_f.__initData=_worklet_13438583604277_init_data;_f.__workletHash=13438583604277;_f.__stackDetails=_e;_f.__version="3.3.0";return _f;}();
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/Progress/CircularProgress/CircularProgress.tsx";import React from"react";import Svg,{Path}from"react-native-svg";import{View}from"react-native";import Animated,{useAnimatedProps,useSharedValue,withTiming}from"react-native-reanimated";import{DEFAULT_ANIMATION_DURATION}from"../ProgressCommon";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var AnimatedPath=Animated.createAnimatedComponent(Path);var _worklet_16765260741242_init_data={code:"function anonymous(){const{currentAngle,startAngle,circlePath,radius,thicknessOffset}=this.__closure;const isBelowMinAngle=currentAngle.value<=startAngle;return{d:circlePath(radius,radius,radius-thicknessOffset,startAngle,Math.min(currentAngle.value,startAngle+360)),strokeOpacity:isBelowMinAngle?0.0:1.0};}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/CircularProgress/CircularProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"anonymous\",\"currentAngle\",\"startAngle\",\"circlePath\",\"radius\",\"thicknessOffset\",\"__closure\",\"isBelowMinAngle\",\"value\",\"d\",\"Math\",\"min\",\"strokeOpacity\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/CircularProgress/CircularProgress.tsx\"],\"mappings\":\"AAoFgE,SAAAA,SAAMA,CAAA,QAAAC,YAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,MAAA,CAAAC,eAAA,OAAAC,SAAA,CAClE,KAAM,CAAAC,eAAe,CAAGN,YAAY,CAACO,KAAK,EAAIN,UAAU,CACxD,MAAO,CACLO,CAAC,CAAEN,UAAU,CACXC,MAAM,CACNA,MAAM,CACNA,MAAM,CAAGC,eAAe,CACxBH,UAAU,CACVQ,IAAI,CAACC,GAAG,CAACV,YAAY,CAACO,KAAK,CAAEN,UAAU,CAAG,GAAG,CAC/C,CAAC,CACDU,aAAa,CAAEL,eAAe,CAAG,GAAG,CAAG,GACzC,CAAC,CACH\",\"ignoreList\":[]}",version:"3.6.3"};export var CircularProgress=function CircularProgress(_ref){var theme=_ref.theme,_ref$minimumValue=_ref.minimumValue,minimumValue=_ref$minimumValue===void 0?0:_ref$minimumValue,_ref$maximumValue=_ref.maximumValue,maximumValue=_ref$maximumValue===void 0?100:_ref$maximumValue,_ref$value=_ref.value,value=_ref$value===void 0?minimumValue:_ref$value,_ref$thickness=_ref.thickness,thickness=_ref$thickness===void 0?10:_ref$thickness,_ref$trackThickness=_ref.trackThickness,trackThickness=_ref$trackThickness===void 0?thickness:_ref$trackThickness,_ref$color=_ref.color,color=_ref$color===void 0?theme.colors.primary:_ref$color,_ref$trackColor=_ref.trackColor,trackColor=_ref$trackColor===void 0?theme.colors.divider:_ref$trackColor,_ref$trackOpacity=_ref.trackOpacity,trackOpacity=_ref$trackOpacity===void 0?1:_ref$trackOpacity,_ref$showTrack=_ref.showTrack,showTrack=_ref$showTrack===void 0?true:_ref$showTrack,_ref$animationDuratio=_ref.animationDuration,animationDuration=_ref$animationDuratio===void 0?DEFAULT_ANIMATION_DURATION:_ref$animationDuratio,_ref$isAnimated=_ref.isAnimated,isAnimated=_ref$isAnimated===void 0?true:_ref$isAnimated,_ref$lineCap=_ref.lineCap,lineCap=_ref$lineCap===void 0?"round":_ref$lineCap,_ref$trackLineCap=_ref.trackLineCap,trackLineCap=_ref$trackLineCap===void 0?lineCap:_ref$trackLineCap,dashWidth=_ref.dashWidth,trackDashWidth=_ref.trackDashWidth,dashGap=_ref.dashGap,trackDashGap=_ref.trackDashGap,dashOffset=_ref.dashOffset,trackDashOffset=_ref.trackDashOffset,customDashArray=_ref.customDashArray,trackCustomDashArray=_ref.trackCustomDashArray,onFullPathWidth=_ref.onFullPathWidth,_ref$startPosition=_ref.startPosition,startPosition=_ref$startPosition===void 0?"top":_ref$startPosition,style=_ref.style,testID=_ref.testID;var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),svgContainerWidth=_React$useState2[0],setSvgContainerWidth=_React$useState2[1];var _React$useState3=React.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),circumfrence=_React$useState4[0],setCircumefrence=_React$useState4[1];var dashArray=dashWidth!==undefined?`${dashWidth} ${dashGap||dashWidth}`:undefined;var trackDashArray=trackDashWidth!==undefined?`${trackDashWidth} ${trackDashGap||trackDashWidth}`:undefined;var maxThickness=Math.max(thickness,trackThickness);var thicknessOffset=maxThickness/2;var radius=svgContainerWidth/2;var c=2*Math.PI*radius;if(c!==circumfrence){setCircumefrence(c);}var startAngle=React.useMemo(function(){switch(startPosition){case"top":return 0;case"right":return 90;case"bottom":return 180;case"left":return 270;}},[startPosition]);var currentFillPercentage=value/(maximumValue+minimumValue);var currentAngle=useSharedValue(startAngle);var progressPathAnimatedProps=useAnimatedProps(function(){var _e=[new global.Error(),-6,-27];var anonymous=function anonymous(){var isBelowMinAngle=currentAngle.value<=startAngle;return{d:circlePath(radius,radius,radius-thicknessOffset,startAngle,Math.min(currentAngle.value,startAngle+360)),strokeOpacity:isBelowMinAngle?0.0:1.0};};anonymous.__closure={currentAngle:currentAngle,startAngle:startAngle,circlePath:circlePath,radius:radius,thicknessOffset:thicknessOffset};anonymous.__workletHash=16765260741242;anonymous.__initData=_worklet_16765260741242_init_data;anonymous.__stackDetails=_e;return anonymous;}());React.useEffect(function(){currentAngle.value=withTiming(startAngle+currentFillPercentage*360,{duration:isAnimated?animationDuration:0});},[value,currentFillPercentage,animationDuration,currentAngle,maximumValue,minimumValue,isAnimated,startAngle]);React.useEffect(function(){onFullPathWidth==null?void 0:onFullPathWidth(circumfrence);},[circumfrence,onFullPathWidth]);return _jsx(View,{onLayout:function onLayout(event){var width=event.nativeEvent.layout.width;setSvgContainerWidth(width);},style:[{height:svgContainerWidth},style],children:_jsxs(Svg,{testID:testID!=null?testID:"circular-progress-component",style:{flex:1},children:[showTrack&&_jsx(Path,{d:circlePath(radius,radius,radius-thicknessOffset,startAngle,startAngle+360),stroke:trackColor,strokeWidth:trackThickness,strokeOpacity:trackOpacity,strokeLinecap:trackLineCap,strokeDasharray:trackCustomDashArray||trackDashArray,strokeDashoffset:trackDashOffset,fill:"rgba(0,0,0,0)"}),_jsx(AnimatedPath,{animatedProps:progressPathAnimatedProps,stroke:color,strokeWidth:thickness,strokeLinecap:lineCap,strokeDasharray:customDashArray||dashArray,strokeDashoffset:dashOffset,fill:"rgba(0,0,0,0)",onPress:function onPress(){}})]})});};var _worklet_3990955206175_init_data={code:"function circlePath(x,y,radius,startAngle,endAngle){function polarToCartesian(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)};}var start=polarToCartesian(x,y,radius,endAngle*0.9999);var end=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(\" \");}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/CircularProgress/CircularProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"circlePath\",\"x\",\"y\",\"radius\",\"startAngle\",\"endAngle\",\"polarToCartesian\",\"centerX\",\"centerY\",\"angleInDegrees\",\"Math\",\"cos\",\"angleInRadians\",\"sin\",\"start\",\"end\",\"largeArcFlag\",\"d\",\"join\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/CircularProgress/CircularProgress.tsx\"],\"mappings\":\"AAoKA,SAAAA,WAAAC,CAAA,CAAAC,CAAA,CAAAC,MAAA,CAAAC,UAAA,CAAAC,QAAA,EAQa,SAAAC,iBAAAC,OAAA,CAAAC,OAAA,CAAAL,MAAA,CAAAM,cAAA,E,qDAEX,MAAS,CAMPR,CAAA,CAAIM,OAAA,CAAAJ,MAAkB,CAACO,IAAA,CAAAC,GAAA,CAAAC,cAAuB,EAC9CV,CAAA,CAAAM,OAAO,CAAAL,MAAA,CAAAO,IAAA,CAAAG,GAAA,CAAAD,cAAA,C,MAGN,CAAAE,KAAA,CAAAR,gBAAA,CAAAL,CAAA,CAAAC,CAAA,CAAAC,MAAA,CAAAE,QAAA,SACH,IAAAU,GAAA,CAAAT,gBAAA,CAAAL,CAAA,CAAAC,CAAA,CAAAC,MAAA,CAAAC,UAAA,EAEA,GAAI,CAAAY,YAAQ,CAAAX,QAAA,CAAkBD,UAAK,EAAQ,OAAQ,CAAG,IACtD,GAAI,CAAAa,CAAA,CAAG,IAAG,CAAAH,KAAA,CAAAb,CAAA,CAAAa,KAAkB,CAAAZ,CAAE,CAAC,GAAE,CAAAC,MAAQ,CAAAA,MAAU,CAAC,EAAAa,YAAA,GAAAD,GAAA,CAAAd,CAAA,CAAAc,GAAA,CAAAb,CAAA,EACpD,MAAI,CAAAe,CAAA,CAAAC,IAAA,IAAY,E\",\"ignoreList\":[]}",version:"3.6.3"};var circlePath=function(){var _e=[new global.Error(),1,-27];var circlePath=function circlePath(x,y,radius,startAngle,endAngle){function polarToCartesian(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)};}var start=polarToCartesian(x,y,radius,endAngle*0.9999);var end=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(" ");};circlePath.__closure={};circlePath.__workletHash=3990955206175;circlePath.__initData=_worklet_3990955206175_init_data;circlePath.__stackDetails=_e;return circlePath;}();
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["ProgressComponent"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx";import React from"react";import{runOnJS,useAnimatedReaction,useSharedValue,withTiming}from"react-native-reanimated";import{DEFAULT_ANIMATION_DURATION}from"./ProgressCommon";import{jsx as _jsx}from"react/jsx-runtime";var _worklet_7042433682028_init_data={code:"function anonymous() {\n const {\n currentOffset\n } = this._closure;\n return currentOffset.value;\n}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"anonymous\",\"currentOffset\",\"_closure\",\"value\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx\"],\"mappings\":\"AA+BI,SAAAA,UAAA;EAAA;IAAAC;EAAA,SAAAC,QAAA;EAAA,OAAMD,aAAc,CAAAE,KAAA;AAAA\"}"};var _worklet_6348489877103_init_data={code:"function anonymous(result) {\n const {\n runOnJS,\n setDashOffset\n } = this._closure;\n return runOnJS(setDashOffset)(result);\n}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"anonymous\",\"result\",\"runOnJS\",\"setDashOffset\",\"_closure\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx\"],\"mappings\":\"AAgCK,SAAAA,SAAMA,CAAAC,MAAA;EAAA;IAAAC,OAAA;IAAAC;EAAA,SAAAC,QAAA;EAAA,OAAKF,OAAQ,CAAAC,aAAc,CAAC,CAAAF,MAAM;AAAA\"}"};var IndeterminateProgress=function IndeterminateProgress(_ref){var ProgressComponent=_ref.ProgressComponent,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),pathWidth=_React$useState2[0],setPathWidth=_React$useState2[1];var _React$useState3=React.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),value=_React$useState4[0],setValue=_React$useState4[1];var _React$useState5=React.useState(0),_React$useState6=_slicedToArray(_React$useState5,2),dashOffset=_React$useState6[0],setDashOffset=_React$useState6[1];var animationDuration=rest.animationDuration||DEFAULT_ANIMATION_DURATION;var currentOffset=useSharedValue(0);useAnimatedReaction(function(){var _e=[new global.Error(),-2,-27];var _f=function _f(){return currentOffset.value;};_f._closure={currentOffset:currentOffset};_f.__initData=_worklet_7042433682028_init_data;_f.__workletHash=7042433682028;_f.__stackDetails=_e;_f.__version="3.3.0";return _f;}(),function(){var _e=[new global.Error(),-3,-27];var _f=function _f(result){return runOnJS(setDashOffset)(result);};_f._closure={runOnJS:runOnJS,setDashOffset:setDashOffset};_f.__initData=_worklet_6348489877103_init_data;_f.__workletHash=6348489877103;_f.__stackDetails=_e;_f.__version="3.3.0";return _f;}());var repeatIndeterminateAnimation=React.useCallback(function(){if(value===0){setValue(100);currentOffset.value=withTiming(pathWidth,{duration:animationDuration});}else{setValue(0);currentOffset.value=withTiming(0,{duration:animationDuration});}},[currentOffset,value,animationDuration,pathWidth]);React.useEffect(function(){var timeout=setTimeout(function(){repeatIndeterminateAnimation();},animationDuration);return function(){return clearTimeout(timeout);};},[animationDuration,repeatIndeterminateAnimation]);return _jsx(ProgressComponent,Object.assign({},rest,{testID:rest.testID||"indeterminate-progress",onFullPathWidth:function onFullPathWidth(width){setPathWidth(width);rest.onFullPathWidth==null?void 0:rest.onFullPathWidth(width);},dashOffset:dashOffset,dashGap:pathWidth/2,dashWidth:pathWidth/2,animationDuration:animationDuration,minimumValue:0,maximumValue:100,value:100}));};export default IndeterminateProgress;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["ProgressComponent"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx";import React from"react";import{runOnJS,useAnimatedReaction,useSharedValue,withTiming}from"react-native-reanimated";import{DEFAULT_ANIMATION_DURATION}from"./ProgressCommon";import{jsx as _jsx}from"react/jsx-runtime";var _worklet_10307048936953_init_data={code:"function anonymous(){const{currentOffset}=this.__closure;return currentOffset.value;}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"anonymous\",\"currentOffset\",\"__closure\",\"value\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx\"],\"mappings\":\"AA+BI,SAAAA,UAAA,QAAAC,aAAA,OAAAC,SAAA,OAAM,CAAAD,aAAc,CAAAE,KAAA\",\"ignoreList\":[]}",version:"3.6.3"};var _worklet_9653584320688_init_data={code:"function anonymous(result){const{runOnJS,setDashOffset}=this.__closure;return runOnJS(setDashOffset)(result);}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"anonymous\",\"result\",\"runOnJS\",\"setDashOffset\",\"__closure\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/IndeterminateProgress.tsx\"],\"mappings\":\"AAgCK,SAAAA,SAAMA,CAAAC,MAAA,QAAAC,OAAA,CAAAC,aAAA,OAAAC,SAAA,OAAK,CAAAF,OAAQ,CAAAC,aAAc,CAAC,CAAAF,MAAM\",\"ignoreList\":[]}",version:"3.6.3"};var IndeterminateProgress=function IndeterminateProgress(_ref){var ProgressComponent=_ref.ProgressComponent,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),pathWidth=_React$useState2[0],setPathWidth=_React$useState2[1];var _React$useState3=React.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),value=_React$useState4[0],setValue=_React$useState4[1];var _React$useState5=React.useState(0),_React$useState6=_slicedToArray(_React$useState5,2),dashOffset=_React$useState6[0],setDashOffset=_React$useState6[1];var animationDuration=rest.animationDuration||DEFAULT_ANIMATION_DURATION;var currentOffset=useSharedValue(0);useAnimatedReaction(function(){var _e=[new global.Error(),-2,-27];var anonymous=function anonymous(){return currentOffset.value;};anonymous.__closure={currentOffset:currentOffset};anonymous.__workletHash=10307048936953;anonymous.__initData=_worklet_10307048936953_init_data;anonymous.__stackDetails=_e;return anonymous;}(),function(){var _e=[new global.Error(),-3,-27];var anonymous=function anonymous(result){return runOnJS(setDashOffset)(result);};anonymous.__closure={runOnJS:runOnJS,setDashOffset:setDashOffset};anonymous.__workletHash=9653584320688;anonymous.__initData=_worklet_9653584320688_init_data;anonymous.__stackDetails=_e;return anonymous;}());var repeatIndeterminateAnimation=React.useCallback(function(){if(value===0){setValue(100);currentOffset.value=withTiming(pathWidth,{duration:animationDuration});}else{setValue(0);currentOffset.value=withTiming(0,{duration:animationDuration});}},[currentOffset,value,animationDuration,pathWidth]);React.useEffect(function(){var timeout=setTimeout(function(){repeatIndeterminateAnimation();},animationDuration);return function(){return clearTimeout(timeout);};},[animationDuration,repeatIndeterminateAnimation]);return _jsx(ProgressComponent,Object.assign({},rest,{testID:rest.testID||"indeterminate-progress",onFullPathWidth:function onFullPathWidth(width){setPathWidth(width);rest.onFullPathWidth==null?void 0:rest.onFullPathWidth(width);},dashOffset:dashOffset,dashGap:pathWidth/2,dashWidth:pathWidth/2,animationDuration:animationDuration,minimumValue:0,maximumValue:100,value:100}));};export default IndeterminateProgress;
@@ -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/Progress/LinearProgress/LinearProgress.tsx";import React from"react";import Svg,{Line}from"react-native-svg";import{View}from"react-native";import Animated,{useAnimatedProps,useSharedValue,withTiming}from"react-native-reanimated";import{DEFAULT_ANIMATION_DURATION}from"../ProgressCommon";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var AnimatedLine=Animated.createAnimatedComponent(Line);var _worklet_2308108033703_init_data={code:"function anonymous() {\n const {\n currentProgressLineWidth,\n thicknessOffset,\n progressLineWidth\n } = this._closure;\n const isBelowMinWidth = currentProgressLineWidth.value <= thicknessOffset;\n return {\n x2: Math.min(progressLineWidth, currentProgressLineWidth.value),\n strokeOpacity: isBelowMinWidth ? 0.0 : 1.0\n };\n}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/LinearProgress/LinearProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"anonymous\",\"currentProgressLineWidth\",\"thicknessOffset\",\"progressLineWidth\",\"_closure\",\"isBelowMinWidth\",\"value\",\"x2\",\"Math\",\"min\",\"strokeOpacity\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/LinearProgress/LinearProgress.tsx\"],\"mappings\":\"AA8DgE,SAAAA,SAAMA,CAAA;EAAA;IAAAC,wBAAA;IAAAC,eAAA;IAAAC;EAAA,SAAAC,QAAA;EAClE,MAAMC,eAAe,GAAGJ,wBAAwB,CAACK,KAAK,IAAIJ,eAAe;EACzE,OAAO;IACLK,EAAE,EAAEC,IAAI,CAACC,GAAG,CAACN,iBAAiB,EAAEF,wBAAwB,CAACK,KAAK,CAAC;IAC/DI,aAAa,EAAEL,eAAe,GAAG,GAAG,GAAG;EACzC,CAAC;AACH\"}"};export var LinearProgress=function LinearProgress(_ref){var theme=_ref.theme,_ref$minimumValue=_ref.minimumValue,minimumValue=_ref$minimumValue===void 0?0:_ref$minimumValue,_ref$maximumValue=_ref.maximumValue,maximumValue=_ref$maximumValue===void 0?100:_ref$maximumValue,_ref$value=_ref.value,value=_ref$value===void 0?minimumValue:_ref$value,_ref$thickness=_ref.thickness,thickness=_ref$thickness===void 0?10:_ref$thickness,_ref$trackThickness=_ref.trackThickness,trackThickness=_ref$trackThickness===void 0?thickness:_ref$trackThickness,_ref$color=_ref.color,color=_ref$color===void 0?theme.colors.primary:_ref$color,_ref$trackColor=_ref.trackColor,trackColor=_ref$trackColor===void 0?theme.colors.divider:_ref$trackColor,_ref$trackOpacity=_ref.trackOpacity,trackOpacity=_ref$trackOpacity===void 0?1:_ref$trackOpacity,_ref$showTrack=_ref.showTrack,showTrack=_ref$showTrack===void 0?true:_ref$showTrack,_ref$animationDuratio=_ref.animationDuration,animationDuration=_ref$animationDuratio===void 0?DEFAULT_ANIMATION_DURATION:_ref$animationDuratio,_ref$isAnimated=_ref.isAnimated,isAnimated=_ref$isAnimated===void 0?true:_ref$isAnimated,_ref$lineCap=_ref.lineCap,lineCap=_ref$lineCap===void 0?"round":_ref$lineCap,_ref$trackLineCap=_ref.trackLineCap,trackLineCap=_ref$trackLineCap===void 0?lineCap:_ref$trackLineCap,dashWidth=_ref.dashWidth,trackDashWidth=_ref.trackDashWidth,dashGap=_ref.dashGap,trackDashGap=_ref.trackDashGap,dashOffset=_ref.dashOffset,trackDashOffset=_ref.trackDashOffset,customDashArray=_ref.customDashArray,trackCustomDashArray=_ref.trackCustomDashArray,onFullPathWidth=_ref.onFullPathWidth,style=_ref.style,testID=_ref.testID;var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),svgContainerWidth=_React$useState2[0],setSvgContainerWidth=_React$useState2[1];var dashArray=dashWidth!==undefined?`${dashWidth} ${dashGap||dashWidth}`:undefined;var trackDashArray=trackDashWidth!==undefined?`${trackDashWidth} ${trackDashGap||trackDashWidth}`:undefined;var maxThickness=Math.max(thickness,trackThickness);var thicknessOffset=maxThickness/2;var progressLineWidth=svgContainerWidth-thicknessOffset;var trackProgressLineWidth=svgContainerWidth-thicknessOffset;var currentFillPercentage=value/(maximumValue+minimumValue);var currentProgressLineWidth=useSharedValue(0);var progressLineAnimatedProps=useAnimatedProps(function(){var _e=[new global.Error(),-4,-27];var _f=function _f(){var isBelowMinWidth=currentProgressLineWidth.value<=thicknessOffset;return{x2:Math.min(progressLineWidth,currentProgressLineWidth.value),strokeOpacity:isBelowMinWidth?0.0:1.0};};_f._closure={currentProgressLineWidth:currentProgressLineWidth,thicknessOffset:thicknessOffset,progressLineWidth:progressLineWidth};_f.__initData=_worklet_2308108033703_init_data;_f.__workletHash=2308108033703;_f.__stackDetails=_e;_f.__version="3.3.0";return _f;}());React.useEffect(function(){currentProgressLineWidth.value=withTiming(progressLineWidth*currentFillPercentage,{duration:isAnimated?animationDuration:0});},[value,progressLineWidth,currentFillPercentage,animationDuration,currentProgressLineWidth,maximumValue,minimumValue,isAnimated]);return _jsx(View,{onLayout:function onLayout(event){var width=event.nativeEvent.layout.width;setSvgContainerWidth(width);onFullPathWidth==null?void 0:onFullPathWidth(width);},style:[{height:maxThickness},style],children:_jsxs(Svg,{testID:testID!=null?testID:"linear-progress-component",style:{flex:1},children:[showTrack&&_jsx(Line,{x1:thicknessOffset,y1:thicknessOffset,x2:trackProgressLineWidth,y2:thicknessOffset,stroke:trackColor,strokeWidth:trackThickness,strokeOpacity:trackOpacity,strokeLinecap:trackLineCap,strokeDasharray:trackCustomDashArray||trackDashArray,strokeDashoffset:trackDashOffset}),_jsx(AnimatedLine,{animatedProps:progressLineAnimatedProps,x1:thicknessOffset,y1:thicknessOffset,y2:thicknessOffset,stroke:color,strokeWidth:thickness,strokeLinecap:lineCap,strokeDasharray:customDashArray||dashArray,strokeDashoffset:dashOffset,onPress:function onPress(){}})]})});};
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/Progress/LinearProgress/LinearProgress.tsx";import React from"react";import Svg,{Line}from"react-native-svg";import{View}from"react-native";import Animated,{useAnimatedProps,useSharedValue,withTiming}from"react-native-reanimated";import{DEFAULT_ANIMATION_DURATION}from"../ProgressCommon";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export var AnimatedLine=Animated.createAnimatedComponent(Line);var _worklet_12336175905426_init_data={code:"function anonymous(){const{currentProgressLineWidth,thicknessOffset,progressLineWidth}=this.__closure;const isBelowMinWidth=currentProgressLineWidth.value<=thicknessOffset;return{x2:Math.min(progressLineWidth,currentProgressLineWidth.value),strokeOpacity:isBelowMinWidth?0.0:1.0};}",location:"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/LinearProgress/LinearProgress.tsx",sourceMap:"{\"version\":3,\"names\":[\"anonymous\",\"currentProgressLineWidth\",\"thicknessOffset\",\"progressLineWidth\",\"__closure\",\"isBelowMinWidth\",\"value\",\"x2\",\"Math\",\"min\",\"strokeOpacity\"],\"sources\":[\"/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Progress/LinearProgress/LinearProgress.tsx\"],\"mappings\":\"AA8DgE,SAAAA,SAAMA,CAAA,QAAAC,wBAAA,CAAAC,eAAA,CAAAC,iBAAA,OAAAC,SAAA,CAClE,KAAM,CAAAC,eAAe,CAAGJ,wBAAwB,CAACK,KAAK,EAAIJ,eAAe,CACzE,MAAO,CACLK,EAAE,CAAEC,IAAI,CAACC,GAAG,CAACN,iBAAiB,CAAEF,wBAAwB,CAACK,KAAK,CAAC,CAC/DI,aAAa,CAAEL,eAAe,CAAG,GAAG,CAAG,GACzC,CAAC,CACH\",\"ignoreList\":[]}",version:"3.6.3"};export var LinearProgress=function LinearProgress(_ref){var theme=_ref.theme,_ref$minimumValue=_ref.minimumValue,minimumValue=_ref$minimumValue===void 0?0:_ref$minimumValue,_ref$maximumValue=_ref.maximumValue,maximumValue=_ref$maximumValue===void 0?100:_ref$maximumValue,_ref$value=_ref.value,value=_ref$value===void 0?minimumValue:_ref$value,_ref$thickness=_ref.thickness,thickness=_ref$thickness===void 0?10:_ref$thickness,_ref$trackThickness=_ref.trackThickness,trackThickness=_ref$trackThickness===void 0?thickness:_ref$trackThickness,_ref$color=_ref.color,color=_ref$color===void 0?theme.colors.primary:_ref$color,_ref$trackColor=_ref.trackColor,trackColor=_ref$trackColor===void 0?theme.colors.divider:_ref$trackColor,_ref$trackOpacity=_ref.trackOpacity,trackOpacity=_ref$trackOpacity===void 0?1:_ref$trackOpacity,_ref$showTrack=_ref.showTrack,showTrack=_ref$showTrack===void 0?true:_ref$showTrack,_ref$animationDuratio=_ref.animationDuration,animationDuration=_ref$animationDuratio===void 0?DEFAULT_ANIMATION_DURATION:_ref$animationDuratio,_ref$isAnimated=_ref.isAnimated,isAnimated=_ref$isAnimated===void 0?true:_ref$isAnimated,_ref$lineCap=_ref.lineCap,lineCap=_ref$lineCap===void 0?"round":_ref$lineCap,_ref$trackLineCap=_ref.trackLineCap,trackLineCap=_ref$trackLineCap===void 0?lineCap:_ref$trackLineCap,dashWidth=_ref.dashWidth,trackDashWidth=_ref.trackDashWidth,dashGap=_ref.dashGap,trackDashGap=_ref.trackDashGap,dashOffset=_ref.dashOffset,trackDashOffset=_ref.trackDashOffset,customDashArray=_ref.customDashArray,trackCustomDashArray=_ref.trackCustomDashArray,onFullPathWidth=_ref.onFullPathWidth,style=_ref.style,testID=_ref.testID;var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),svgContainerWidth=_React$useState2[0],setSvgContainerWidth=_React$useState2[1];var dashArray=dashWidth!==undefined?`${dashWidth} ${dashGap||dashWidth}`:undefined;var trackDashArray=trackDashWidth!==undefined?`${trackDashWidth} ${trackDashGap||trackDashWidth}`:undefined;var maxThickness=Math.max(thickness,trackThickness);var thicknessOffset=maxThickness/2;var progressLineWidth=svgContainerWidth-thicknessOffset;var trackProgressLineWidth=svgContainerWidth-thicknessOffset;var currentFillPercentage=value/(maximumValue+minimumValue);var currentProgressLineWidth=useSharedValue(0);var progressLineAnimatedProps=useAnimatedProps(function(){var _e=[new global.Error(),-4,-27];var anonymous=function anonymous(){var isBelowMinWidth=currentProgressLineWidth.value<=thicknessOffset;return{x2:Math.min(progressLineWidth,currentProgressLineWidth.value),strokeOpacity:isBelowMinWidth?0.0:1.0};};anonymous.__closure={currentProgressLineWidth:currentProgressLineWidth,thicknessOffset:thicknessOffset,progressLineWidth:progressLineWidth};anonymous.__workletHash=12336175905426;anonymous.__initData=_worklet_12336175905426_init_data;anonymous.__stackDetails=_e;return anonymous;}());React.useEffect(function(){currentProgressLineWidth.value=withTiming(progressLineWidth*currentFillPercentage,{duration:isAnimated?animationDuration:0});},[value,progressLineWidth,currentFillPercentage,animationDuration,currentProgressLineWidth,maximumValue,minimumValue,isAnimated]);return _jsx(View,{onLayout:function onLayout(event){var width=event.nativeEvent.layout.width;setSvgContainerWidth(width);onFullPathWidth==null?void 0:onFullPathWidth(width);},style:[{height:maxThickness},style],children:_jsxs(Svg,{testID:testID!=null?testID:"linear-progress-component",style:{flex:1},children:[showTrack&&_jsx(Line,{x1:thicknessOffset,y1:thicknessOffset,x2:trackProgressLineWidth,y2:thicknessOffset,stroke:trackColor,strokeWidth:trackThickness,strokeOpacity:trackOpacity,strokeLinecap:trackLineCap,strokeDasharray:trackCustomDashArray||trackDashArray,strokeDashoffset:trackDashOffset}),_jsx(AnimatedLine,{animatedProps:progressLineAnimatedProps,x1:thicknessOffset,y1:thicknessOffset,y2:thicknessOffset,stroke:color,strokeWidth:thickness,strokeLinecap:lineCap,strokeDasharray:customDashArray||dashArray,strokeDashoffset:dashOffset,onPress:function onPress(){}})]})});};
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","label","value","color","unselectedColor","onPress","labelContainerStyle","labelStyle","radioButtonStyle","direction","selected","disabled","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/RadioButton/RadioButtonRow.tsx";import*as React from"react";import{StyleSheet,View,Platform}from"react-native";import RadioButton from"./RadioButton";import Text from"../Text";import{useRadioButtonGroupContext}from"./context";import{Direction as GroupDirection}from"./context";import Touchable from"../Touchable";import{extractStyles,getValueForRadioButton}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 getRadioButtonAlignment=function getRadioButtonAlignment(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 RadioButtonRow=function RadioButtonRow(_ref){var Icon=_ref.Icon,label=_ref.label,_ref$value=_ref.value,value=_ref$value===void 0?"":_ref$value,color=_ref.color,unselectedColor=_ref.unselectedColor,onPress=_ref.onPress,labelContainerStyle=_ref.labelContainerStyle,labelStyle=_ref.labelStyle,radioButtonStyle=_ref.radioButtonStyle,_ref$direction=_ref.direction,direction=_ref$direction===void 0?Direction.Row:_ref$direction,selected=_ref.selected,disabled=_ref.disabled,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var _useRadioButtonGroupC=useRadioButtonGroupContext(),contextValue=_useRadioButtonGroupC.value,onValueChange=_useRadioButtonGroupC.onValueChange,parentDirection=_useRadioButtonGroupC.direction;var realValue=getValueForRadioButton(value);var realContextValue=getValueForRadioButton(contextValue);var isSelected=selected!=null?selected:realContextValue===realValue;var handlePress=function handlePress(){onPress==null?void 0:onPress(realValue);onValueChange==null?void 0:onValueChange(realValue);};var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsxs(Touchable,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:getRadioButtonAlignment(parentDirection,direction)},children:_jsx(RadioButton,{Icon:Icon,selected:isSelected,value:realValue,color:color,unselectedColor:unselectedColor,style:radioButtonStyle})})]}));};var styles=StyleSheet.create({mainParent:Object.assign({flex:1,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 RadioButtonRow;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","label","value","color","unselectedColor","onPress","labelContainerStyle","labelStyle","radioButtonStyle","direction","selected","disabled","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/RadioButton/RadioButtonRow.tsx";import*as React from"react";import{StyleSheet,View,Platform}from"react-native";import RadioButton from"./RadioButton";import Text from"../Text";import{useRadioButtonGroupContext}from"./context";import{Direction as GroupDirection}from"./context";import Touchable from"../Touchable";import{extractStyles,getValueForRadioButton}from"../../utilities";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";export var Direction=function(Direction){Direction["Row"]="row";Direction["RowReverse"]="row-reverse";return Direction;}({});var getRadioButtonAlignment=function getRadioButtonAlignment(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 RadioButtonRow=function RadioButtonRow(_ref){var Icon=_ref.Icon,label=_ref.label,_ref$value=_ref.value,value=_ref$value===void 0?"":_ref$value,color=_ref.color,unselectedColor=_ref.unselectedColor,onPress=_ref.onPress,labelContainerStyle=_ref.labelContainerStyle,labelStyle=_ref.labelStyle,radioButtonStyle=_ref.radioButtonStyle,_ref$direction=_ref.direction,direction=_ref$direction===void 0?Direction.Row:_ref$direction,selected=_ref.selected,disabled=_ref.disabled,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var _useRadioButtonGroupC=useRadioButtonGroupContext(),contextValue=_useRadioButtonGroupC.value,onValueChange=_useRadioButtonGroupC.onValueChange,parentDirection=_useRadioButtonGroupC.direction;var realValue=getValueForRadioButton(value);var realContextValue=getValueForRadioButton(contextValue);var isSelected=selected!=null?selected:realContextValue===realValue;var handlePress=function handlePress(){onPress==null?void 0:onPress(realValue);onValueChange==null?void 0:onValueChange(realValue);};var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsxs(Touchable,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:getRadioButtonAlignment(parentDirection,direction)},children:_jsx(RadioButton,{Icon:Icon,selected:isSelected,value:realValue,color:color,unselectedColor:unselectedColor,style:radioButtonStyle})})]}));};var styles=StyleSheet.create({mainParent:Object.assign({flex:1,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 RadioButtonRow;
@@ -1 +1 @@
1
- var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Row.tsx";import*as React from"react";import{View,Text,Image,StyleSheet}from"react-native";import{withTheme}from"../theming";import Config from"./Config";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Row=function Row(_ref){var titleTypeStyle=_ref.titleTypeStyle,titleColor=_ref.titleColor,subtitleTypeStyle=_ref.subtitleTypeStyle,subtitleColor=_ref.subtitleColor,title=_ref.title,subtitle=_ref.subtitle,multilineSubtitle=_ref.multilineSubtitle,image=_ref.image,right=_ref.right,style=_ref.style;return _jsxs(View,{style:[styles.container,{padding:16},style],children:[_jsxs(View,{style:styles.leftContainer,children:[image&&_jsx(Image,{source:typeof image==="string"?{uri:image}:image,style:{marginRight:12,width:subtitle?Config.rowMultiLineImageSize:Config.rowSingleLineImageSize,height:subtitle?Config.rowMultiLineImageSize:Config.rowSingleLineImageSize}}),_jsxs(View,{style:styles.textContainer,children:[_jsx(Text,{style:[titleTypeStyle,{color:titleColor}],numberOfLines:1,children:title}),subtitle?_jsx(Text,{style:[subtitleTypeStyle,{color:subtitleColor,marginTop:4}],numberOfLines:multilineSubtitle?undefined:1,children:subtitle}):null]})]}),right&&right()]});};var styles=StyleSheet.create({leftContainer:{flexDirection:"row",flex:1},container:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},textContainer:{flex:1,justifyContent:"center"}});export default withTheme(Row);
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Row.tsx";import*as React from"react";import{View,Text,Image,StyleSheet}from"react-native";import{withTheme}from"../theming";import Config from"./Config";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var Row=function Row(_ref){var titleTypeStyle=_ref.titleTypeStyle,titleColor=_ref.titleColor,subtitleTypeStyle=_ref.subtitleTypeStyle,subtitleColor=_ref.subtitleColor,title=_ref.title,subtitle=_ref.subtitle,multilineSubtitle=_ref.multilineSubtitle,image=_ref.image,right=_ref.right,style=_ref.style;return _jsxs(View,{style:[styles.container,{padding:16},style],children:[_jsxs(View,{style:styles.leftContainer,children:[image&&_jsx(Image,{source:typeof image==="string"?{uri:image}:image,style:{marginRight:12,width:subtitle?Config.rowMultiLineImageSize:Config.rowSingleLineImageSize,height:subtitle?Config.rowMultiLineImageSize:Config.rowSingleLineImageSize}}),_jsxs(View,{style:styles.textContainer,children:[_jsx(Text,{style:[titleTypeStyle,{color:titleColor}],numberOfLines:1,children:title}),subtitle?_jsx(Text,{style:[subtitleTypeStyle,{color:subtitleColor,marginTop:4}],numberOfLines:multilineSubtitle?undefined:1,children:subtitle}):null]})]}),right&&right()]});};var styles=StyleSheet.create({leftContainer:{flexDirection:"row",flex:1},container:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},textContainer:{flex:1,justifyContent:"center"}});export default withTheme(Row);
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Slider.tsx";var _excluded=["Icon","leftIcon","rightIcon","leftIconColor","rightIconColor","value","defaultValue","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","minimumValue","maximumValue","tapToSeek","step","onValueChange","style","theme"];import*as React from"react";import{View,StyleSheet,Platform}from"react-native";import NativeSlider from"@react-native-community/slider";import isNumber from"lodash.isnumber";import toNumber from"lodash.tonumber";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function maybeParseValue(value){if(value===undefined){return undefined;}if(isNumber(value)){return value;}try{var maybe=toNumber(value);if(isNumber(maybe)){return maybe;}}catch(_unused){return undefined;}return undefined;}function Slider(_ref){var Icon=_ref.Icon,leftIcon=_ref.leftIcon,rightIcon=_ref.rightIcon,leftIconColor=_ref.leftIconColor,rightIconColor=_ref.rightIconColor,value=_ref.value,defaultValue=_ref.defaultValue,minimumTrackTintColor=_ref.minimumTrackTintColor,maximumTrackTintColor=_ref.maximumTrackTintColor,thumbTintColor=_ref.thumbTintColor,_ref$minimumValue=_ref.minimumValue,minimumValue=_ref$minimumValue===void 0?0:_ref$minimumValue,_ref$maximumValue=_ref.maximumValue,maximumValue=_ref$maximumValue===void 0?100:_ref$maximumValue,tapToSeek=_ref.tapToSeek,_ref$step=_ref.step,step=_ref$step===void 0?1:_ref$step,_ref$onValueChange=_ref.onValueChange,onValueChange=_ref$onValueChange===void 0?function(){}:_ref$onValueChange,style=_ref.style,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(value||defaultValue),_React$useState2=_slicedToArray(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];var _React$useState3=React.useState({width:0,height:0}),_React$useState4=_slicedToArray(_React$useState3,2),tempThumbStyle=_React$useState4[0],setTempThumbStyle=_React$useState4[1];React.useEffect(function(){setTempThumbStyle({width:undefined,height:undefined});},[]);React.useEffect(function(){if(value!=null){setInternalValue(value);}},[value]);React.useEffect(function(){if(defaultValue!=null){setInternalValue(defaultValue);}},[defaultValue]);var minTrackColor=minimumTrackTintColor||theme.colors.primary;var maxTrackColor=maximumTrackTintColor||theme.colors.light;var thumbColor=thumbTintColor||theme.colors.primary;var leftIconThemeColor=leftIconColor||theme.colors.light;var rightIconThemeColor=rightIconColor||theme.colors.light;var parsedValue=maybeParseValue(internalValue);var handleSlidingComplete=function handleSlidingComplete(newValue){setInternalValue(newValue);onValueChange(newValue);};return _jsxs(View,Object.assign({style:[styles.container,style]},rest,{children:[leftIcon?_jsx(Icon,{color:leftIconThemeColor,name:leftIcon,size:24}):null,_jsx(NativeSlider,{value:parsedValue,step:step,minimumValue:minimumValue,maximumValue:maximumValue,tapToSeek:tapToSeek,minimumTrackTintColor:minTrackColor,maximumTrackTintColor:maxTrackColor,thumbTintColor:thumbColor,onSlidingComplete:handleSlidingComplete,style:styles.slider,thumbStyle:Platform.OS==="web"?tempThumbStyle:undefined}),rightIcon?_jsx(Icon,{color:rightIconThemeColor,name:rightIcon,size:24}):null]}));}var styles=StyleSheet.create({container:{height:40,flexDirection:"row",alignItems:"center"},slider:{flex:1,marginHorizontal:12}});export default withTheme(Slider);
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Slider.tsx";var _excluded=["Icon","leftIcon","rightIcon","leftIconColor","rightIconColor","value","defaultValue","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","minimumValue","maximumValue","tapToSeek","step","onValueChange","style","theme"];import*as React from"react";import{View,StyleSheet,Platform}from"react-native";import NativeSlider from"@react-native-community/slider";import isNumber from"lodash.isnumber";import toNumber from"lodash.tonumber";import{withTheme}from"../theming";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function maybeParseValue(value){if(value===undefined){return undefined;}if(isNumber(value)){return value;}try{var maybe=toNumber(value);if(isNumber(maybe)){return maybe;}}catch(_unused){return undefined;}return undefined;}function Slider(_ref){var Icon=_ref.Icon,leftIcon=_ref.leftIcon,rightIcon=_ref.rightIcon,leftIconColor=_ref.leftIconColor,rightIconColor=_ref.rightIconColor,value=_ref.value,defaultValue=_ref.defaultValue,minimumTrackTintColor=_ref.minimumTrackTintColor,maximumTrackTintColor=_ref.maximumTrackTintColor,thumbTintColor=_ref.thumbTintColor,_ref$minimumValue=_ref.minimumValue,minimumValue=_ref$minimumValue===void 0?0:_ref$minimumValue,_ref$maximumValue=_ref.maximumValue,maximumValue=_ref$maximumValue===void 0?100:_ref$maximumValue,tapToSeek=_ref.tapToSeek,_ref$step=_ref.step,step=_ref$step===void 0?1:_ref$step,_ref$onValueChange=_ref.onValueChange,onValueChange=_ref$onValueChange===void 0?function(){}:_ref$onValueChange,style=_ref.style,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(value||defaultValue),_React$useState2=_slicedToArray(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];var _React$useState3=React.useState({width:0,height:0}),_React$useState4=_slicedToArray(_React$useState3,2),tempThumbStyle=_React$useState4[0],setTempThumbStyle=_React$useState4[1];React.useEffect(function(){setTempThumbStyle({width:undefined,height:undefined});},[]);React.useEffect(function(){if(value!=null){setInternalValue(value);}},[value]);React.useEffect(function(){if(defaultValue!=null){setInternalValue(defaultValue);}},[defaultValue]);var minTrackColor=minimumTrackTintColor||theme.colors.primary;var maxTrackColor=maximumTrackTintColor||theme.colors.light;var thumbColor=thumbTintColor||theme.colors.primary;var leftIconThemeColor=leftIconColor||theme.colors.light;var rightIconThemeColor=rightIconColor||theme.colors.light;var parsedValue=maybeParseValue(internalValue);var handleSlidingComplete=function handleSlidingComplete(newValue){setInternalValue(newValue);onValueChange(newValue);};return _jsxs(View,Object.assign({style:[styles.container,style]},rest,{children:[leftIcon?_jsx(Icon,{color:leftIconThemeColor,name:leftIcon,size:24}):null,_jsx(NativeSlider,{value:parsedValue,step:step,minimumValue:minimumValue,maximumValue:maximumValue,tapToSeek:tapToSeek,minimumTrackTintColor:minTrackColor,maximumTrackTintColor:maxTrackColor,thumbTintColor:thumbColor,onSlidingComplete:handleSlidingComplete,style:styles.slider,thumbStyle:Platform.OS==="web"?tempThumbStyle:undefined}),rightIcon?_jsx(Icon,{color:rightIconThemeColor,name:rightIcon,size:24}):null]}));}var styles=StyleSheet.create({container:{height:40,flexDirection:"row",alignItems:"center"},slider:{flex:1,marginHorizontal:12}});export default withTheme(Slider);
@@ -1 +1 @@
1
- import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/StarRating.tsx";import*as React from"react";import{View,StyleSheet,Pressable}from"react-native";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var StarRating=function StarRating(_ref){var Icon=_ref.Icon,_ref$starSize=_ref.starSize,starSize=_ref$starSize===void 0?16:_ref$starSize,_ref$maxStars=_ref.maxStars,maxStars=_ref$maxStars===void 0?5:_ref$maxStars,_ref$rating=_ref.rating,rating=_ref$rating===void 0?0:_ref$rating,defaultValue=_ref.defaultValue,_ref$isEditable=_ref.isEditable,isEditable=_ref$isEditable===void 0?false:_ref$isEditable,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,style=_ref.style,onPress=_ref.onPress,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(rating||defaultValue||0),_React$useState2=_slicedToArray(_React$useState,2),localRating=_React$useState2[0],setLocalRating=_React$useState2[1];React.useEffect(function(){if(rating!=null){setLocalRating(rating);}},[rating]);React.useEffect(function(){if(defaultValue!=null){setLocalRating(defaultValue);}},[defaultValue]);var ratingHandler=React.useCallback(function(r){setLocalRating(r);!!onPress&&onPress(r);},[onPress]);var ratingRounded=Math.round(localRating*2)/2;return _jsx(View,Object.assign({style:[styles.container,style]},rest,{children:_toConsumableArray(Array(maxStars)).map(function(_,i){return _jsxs(View,{style:{display:"flex"},children:[_jsx(Icon,{name:ratingRounded-i===0.5?"MaterialIcons/star-half":"MaterialIcons/star",size:starSize,color:ratingRounded>i?activeColor:inactiveColor}),isEditable&&_jsxs(View,{style:styles.touchContainer,children:[_jsx(Pressable,{style:styles.pressable,onPress:function onPress(){return ratingHandler(i+0.5);}}),_jsx(Pressable,{style:styles.pressable,onPress:function onPress(){return ratingHandler(i+1);}})]})]},i);})}));};var styles=StyleSheet.create({container:{flexDirection:"row",alignItems:"center"},touchContainer:{display:"flex",flexDirection:"row",position:"absolute",top:0,right:0,left:0,bottom:0,zIndex:1},pressable:{flex:1,height:"100%",width:"50%"}});export default withTheme(StarRating);
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/StarRating.tsx";import*as React from"react";import{View,StyleSheet,Pressable}from"react-native";import{withTheme}from"../theming";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var StarRating=function StarRating(_ref){var Icon=_ref.Icon,_ref$starSize=_ref.starSize,starSize=_ref$starSize===void 0?16:_ref$starSize,_ref$maxStars=_ref.maxStars,maxStars=_ref$maxStars===void 0?5:_ref$maxStars,_ref$rating=_ref.rating,rating=_ref$rating===void 0?0:_ref$rating,defaultValue=_ref.defaultValue,_ref$isEditable=_ref.isEditable,isEditable=_ref$isEditable===void 0?false:_ref$isEditable,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,style=_ref.style,onPress=_ref.onPress,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(rating||defaultValue||0),_React$useState2=_slicedToArray(_React$useState,2),localRating=_React$useState2[0],setLocalRating=_React$useState2[1];React.useEffect(function(){if(rating!=null){setLocalRating(rating);}},[rating]);React.useEffect(function(){if(defaultValue!=null){setLocalRating(defaultValue);}},[defaultValue]);var ratingHandler=React.useCallback(function(r){setLocalRating(r);!!onPress&&onPress(r);},[onPress]);var ratingRounded=Math.round(localRating*2)/2;return _jsx(View,Object.assign({style:[styles.container,style]},rest,{children:_toConsumableArray(Array(maxStars)).map(function(_,i){return _jsxs(View,{style:{display:"flex"},children:[_jsx(Icon,{name:ratingRounded-i===0.5?"MaterialIcons/star-half":"MaterialIcons/star",size:starSize,color:ratingRounded>i?activeColor:inactiveColor}),isEditable&&_jsxs(View,{style:styles.touchContainer,children:[_jsx(Pressable,{style:styles.pressable,onPress:function onPress(){return ratingHandler(i+0.5);}}),_jsx(Pressable,{style:styles.pressable,onPress:function onPress(){return ratingHandler(i+1);}})]})]},i);})}));};var styles=StyleSheet.create({container:{flexDirection:"row",alignItems:"center"},touchContainer:{display:"flex",flexDirection:"row",position:"absolute",top:0,right:0,left:0,bottom:0,zIndex:1},pressable:{flex:1,height:"100%",width:"50%"}});export default withTheme(StarRating);