@draftbit/core 49.2.5 → 49.2.6-faee0d.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Provider.js +1 -1
- package/lib/commonjs/components/AccordionGroup.js +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheet.js +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetItem.js +1 -1
- package/lib/commonjs/components/ActionSheet/index.js +1 -1
- package/lib/commonjs/components/AspectRatio.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/BottomSheet/index.js +1 -1
- package/lib/commonjs/components/Button.js +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -1
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Checkbox/index.js +1 -1
- package/lib/commonjs/components/Config.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponentType.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +1 -1
- package/lib/commonjs/components/DeckSwiper/index.js +1 -1
- package/lib/commonjs/components/Divider.js +1 -1
- package/lib/commonjs/components/Elevation.js +1 -1
- package/lib/commonjs/components/FormRow.js +1 -1
- package/lib/commonjs/components/IconButton.js +1 -1
- package/lib/commonjs/components/Image.js +1 -1
- package/lib/commonjs/components/KeyboardAvoidingView.js +1 -1
- package/lib/commonjs/components/Layout/AspectRatio.js +1 -1
- package/lib/commonjs/components/Layout/Center.js +1 -1
- package/lib/commonjs/components/Layout/Circle.js +1 -1
- package/lib/commonjs/components/Layout/HStack.js +1 -1
- package/lib/commonjs/components/Layout/LayoutCommon.js +1 -1
- package/lib/commonjs/components/Layout/Spacer.js +1 -1
- package/lib/commonjs/components/Layout/Square.js +1 -1
- package/lib/commonjs/components/Layout/VStack.js +1 -1
- package/lib/commonjs/components/Layout/ZStack.js +1 -1
- package/lib/commonjs/components/Layout/index.js +1 -1
- package/lib/commonjs/components/Markdown.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/index.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlaybackWrapper.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlayerCommon.js +1 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +1 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/index.js +1 -1
- package/lib/commonjs/components/NumberInput.js +1 -1
- package/lib/commonjs/components/Picker/NativePicker.js +1 -1
- package/lib/commonjs/components/Picker/PickerCommon.js +1 -1
- package/lib/commonjs/components/Picker/PickerInputContainer.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownPicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/PickerItem.js +1 -1
- package/lib/commonjs/components/Picker/index.js +1 -1
- package/lib/commonjs/components/PinInput/CustomPinInputCell.js +1 -1
- package/lib/commonjs/components/PinInput/PinInput.js +1 -1
- package/lib/commonjs/components/PinInput/PinInputText.js +1 -1
- package/lib/commonjs/components/PinInput/index.js +1 -1
- package/lib/commonjs/components/Portal/Portal.js +1 -1
- package/lib/commonjs/components/Portal/PortalConsumer.js +1 -1
- package/lib/commonjs/components/Portal/PortalHost.js +1 -1
- package/lib/commonjs/components/Portal/PortalManager.js +1 -1
- package/lib/commonjs/components/Pressable.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/index.js +1 -1
- package/lib/commonjs/components/Progress/IndeterminateProgress.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/index.js +1 -1
- package/lib/commonjs/components/Progress/ProgressCommon.js +1 -1
- package/lib/commonjs/components/ProgressIndicator.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/RadioButton/index.js +1 -1
- package/lib/commonjs/components/Row.js +1 -1
- package/lib/commonjs/components/SVG.js +1 -1
- package/lib/commonjs/components/ScreenContainer.js +1 -1
- package/lib/commonjs/components/SectionList/SectionHeader.js +1 -1
- package/lib/commonjs/components/SectionList/SectionList.js +1 -1
- package/lib/commonjs/components/SectionList/index.js +1 -1
- package/lib/commonjs/components/Shadow.js +1 -1
- package/lib/commonjs/components/Slider.js +1 -1
- package/lib/commonjs/components/StarRating.js +1 -1
- package/lib/commonjs/components/StepIndicator.js +1 -1
- package/lib/commonjs/components/Stepper.js +1 -1
- package/lib/commonjs/components/Surface.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItem.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItemButton.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItemCommon.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableList.js +1 -1
- package/lib/commonjs/components/SwipeableItem/index.js +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js +1 -1
- package/lib/commonjs/components/Swiper/SwiperItem.js +1 -1
- package/lib/commonjs/components/Swiper/index.js +1 -1
- package/lib/commonjs/components/Switch.js +1 -1
- package/lib/commonjs/components/TabView/TabView.js +1 -1
- package/lib/commonjs/components/TabView/TabViewItem.js +1 -1
- package/lib/commonjs/components/TabView/index.js +1 -1
- package/lib/commonjs/components/Table/Table.js +1 -1
- package/lib/commonjs/components/Table/TableCell.js +1 -1
- package/lib/commonjs/components/Table/TableCommon.js +1 -1
- package/lib/commonjs/components/Table/TableRow.js +1 -1
- package/lib/commonjs/components/Table/index.js +1 -1
- package/lib/commonjs/components/Text.js +1 -1
- package/lib/commonjs/components/TextField.js +1 -1
- package/lib/commonjs/components/TextInput.js +1 -1
- package/lib/commonjs/components/Touchable.js +1 -1
- package/lib/commonjs/components/Touchable.web.js +1 -1
- package/lib/commonjs/components/Typography.js +1 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.js +1 -1
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.native.js +2 -2
- package/lib/commonjs/components/YoutubePlayer/YoutubePlayerProps.js +1 -1
- package/lib/commonjs/components/YoutubePlayer/index.js +1 -1
- package/lib/commonjs/components/useAuthState.js +1 -1
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/deprecated-components/AccordionItem.js +1 -1
- package/lib/commonjs/deprecated-components/AnimatedCircularProgress.js +1 -1
- package/lib/commonjs/deprecated-components/AvatarEdit.js +1 -1
- package/lib/commonjs/deprecated-components/AvoidKeyboardView.js +1 -1
- package/lib/commonjs/deprecated-components/Banner.js +1 -1
- package/lib/commonjs/deprecated-components/Card.js +1 -1
- package/lib/commonjs/deprecated-components/CheckboxGroup.js +1 -1
- package/lib/commonjs/deprecated-components/CircleImage.js +1 -1
- package/lib/commonjs/deprecated-components/CircularProgress.js +1 -1
- package/lib/commonjs/deprecated-components/Container.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedButton.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedFAB.js +1 -1
- package/lib/commonjs/deprecated-components/FAB.js +1 -1
- package/lib/commonjs/deprecated-components/FieldSearchBarFull.js +1 -1
- package/lib/commonjs/deprecated-components/Layout.js +1 -1
- package/lib/commonjs/deprecated-components/ProgressBar.js +1 -1
- package/lib/commonjs/deprecated-components/ProgressCircle.js +1 -1
- package/lib/commonjs/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/lib/commonjs/deprecated-components/RowBodyIcon.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageCaption.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageIcon.js +1 -1
- package/lib/commonjs/deprecated-components/ToggleButton.js +1 -1
- package/lib/commonjs/hooks.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/interfaces/Icon.js +1 -1
- package/lib/commonjs/styles/DarkTheme.js +1 -1
- package/lib/commonjs/styles/DefaultTheme.js +1 -1
- package/lib/commonjs/styles/fonts.js +1 -1
- package/lib/commonjs/styles/overlay.js +1 -1
- package/lib/commonjs/styles/shadow.js +1 -1
- package/lib/commonjs/theming.js +1 -1
- package/lib/commonjs/utilities.js +1 -1
- package/package.json +3 -3
|
@@ -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/TabView/TabView.tsx";import*as React from"react";import{TabView,TabBar}from"react-native-tab-view";import TabViewItem from"./TabViewItem";import{withTheme}from"../../theming";import{flattenReactFragments,extractStyles}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var TabViewComponent=function TabViewComponent(_ref){var Icon=_ref.Icon,onIndexChanged=_ref.onIndexChanged,onEndReached=_ref.onEndReached,_ref$initialTabIndex=_ref.initialTabIndex,initialTabIndex=_ref$initialTabIndex===void 0?0:_ref$initialTabIndex,tabBarPosition=_ref.tabBarPosition,keyboardDismissMode=_ref.keyboardDismissMode,swipeEnabled=_ref.swipeEnabled,scrollEnabled=_ref.scrollEnabled,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,pressColor=_ref.pressColor,indicatorColor=_ref.indicatorColor,tabsBackgroundColor=_ref.tabsBackgroundColor,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?16:_ref$iconSize,style=_ref.style,theme=_ref.theme,childrenProp=_ref.children;var _React$useState=React.useState(initialTabIndex),_React$useState2=_slicedToArray(_React$useState,2),index=_React$useState2[0],setIndex=_React$useState2[1];var _React$useState3=React.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),routes=_React$useState4[0],setRoutes=_React$useState4[1];var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp)).filter(function(child){return React.isValidElement(child)&&child.type===TabViewItem;});},[childrenProp]);React.useEffect(function(){var newRoutes=[];children.forEach(function(item,idx){var child=item;newRoutes.push({key:idx.toString(),title:child.props.title,icon:child.props.icon,accessibilityLabel:child.props.accessibilityLabel});});setRoutes(newRoutes);},[children]);var indexChangeHandler=function indexChangeHandler(i){setIndex(i);onIndexChanged==null?void 0:onIndexChanged(i);if(i===routes.length){onEndReached==null?void 0:onEndReached();}};var renderTabBar=function renderTabBar(props){return _jsx(TabBar,Object.assign({},props,{activeColor:activeColor||theme.colors.primary,inactiveColor:inactiveColor||"rgb(200,200,200)",pressColor:pressColor||theme.colors.primary,scrollEnabled:scrollEnabled,indicatorStyle:{backgroundColor:indicatorColor||theme.colors.primary},labelStyle:[{textTransform:"none"},textStyles],renderIcon:function renderIcon(_ref2){var route=_ref2.route,color=_ref2.color;return route!=null&&route.icon?_jsx(Icon,{name:route.icon,color:color,size:iconSize}):null;},style:{backgroundColor:tabsBackgroundColor||theme.colors.background}}));};var renderScene=function renderScene(_ref3){var route=_ref3.route;var index=Number(route.key);return children[index];};if(!routes.length){return _jsx(_Fragment,{});}return _jsx(TabView,{style:viewStyles,navigationState:{index:index,routes:routes},renderScene:renderScene,renderTabBar:renderTabBar,onIndexChange:indexChangeHandler,tabBarPosition:tabBarPosition,keyboardDismissMode:keyboardDismissMode,swipeEnabled:swipeEnabled});};export default withTheme(TabViewComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabViewItem.tsx";import React from"react";import{StyleSheet,View}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var TabViewItem=function TabViewItem(_ref){var style=_ref.style,children=_ref.children;return _jsx(View,{style:[styles.parentContainer,style],children:children});};var styles=StyleSheet.create({parentContainer:{flex:1}});export default TabViewItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{default as TabView}from"./TabView";export{default as TabViewItem}from"./TabViewItem";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","borderWidth","borderColor","borderStyle","drawTopBorder","drawBottomBorder","drawStartBorder","drawEndBorder","cellVerticalPadding","cellHorizontalPadding","data","keyExtractor","renderItem","children","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/Table.tsx";import React from"react";import{ScrollView,View,StyleSheet}from"react-native";import{withTheme}from"../../theming";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Table=function Table(_ref){var theme=_ref.theme,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,_ref$borderColor=_ref.borderColor,borderColor=_ref$borderColor===void 0?theme.colors.divider:_ref$borderColor,_ref$borderStyle=_ref.borderStyle,borderStyle=_ref$borderStyle===void 0?"solid":_ref$borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?true:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?false:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?false:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,_ref$cellVerticalPadd=_ref.cellVerticalPadding,cellVerticalPadding=_ref$cellVerticalPadd===void 0?10:_ref$cellVerticalPadd,_ref$cellHorizontalPa=_ref.cellHorizontalPadding,cellHorizontalPadding=_ref$cellHorizontalPa===void 0?10:_ref$cellHorizontalPa,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);if(data&&!renderItem||renderItem&&!data){throw new Error("'renderItem' and 'data' need to both be provided to render from 'data'. Either remove them entirley or include both");}if(data&&renderItem&&childrenProp){console.warn("'children' of Table ignored due to usage of 'data' and 'renderItem'");}var isTableHeader=React.useCallback(function(object){return object.isTableHeader;},[]);var isRenderItem=Array.isArray(data)&&renderItem;var dataAsChildren=React.useMemo(function(){if(!isRenderItem)return[];return data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index.toString();return React.cloneElement(component,{key:key});});},[data,renderItem,keyExtractor,isRenderItem]);var children=isRenderItem?dataAsChildren:React.Children.toArray(childrenProp);var validChildren=React.useMemo(function(){return children.filter(function(item){return React.isValidElement(item);});},[children]);var childrenWithoutHeader=React.useMemo(function(){var flattenedWithoutNestedHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return React.cloneElement(item,{children:nestedChildren.filter(function(child){return!isTableHeader(child.props);})});}return item;});return flattenedWithoutNestedHeaders.filter(function(item){return!isTableHeader(item.props);});},[validChildren,isTableHeader]);var header=React.useMemo(function(){var flattenedPossibleHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return nestedHeaders[0];}return item;});var allHeaders=flattenedPossibleHeaders.filter(function(item){return isTableHeader(item.props);});if(allHeaders.length){return allHeaders[0];}return null;},[validChildren,isTableHeader]);var contextValue={borderColor:borderColor,borderStyle:borderStyle,borderWidth:borderWidth,cellHorizontalPadding:cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding};var borderViewStyle=generateBorderStyles({borderColor:borderColor,borderWidth:borderWidth,borderStyle:borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});return _jsx(TableStyleContext.Provider,{value:contextValue,children:_jsxs(View,{style:[styles.container,borderViewStyle,style],children:[_jsx(_Fragment,{children:header}),_jsx(ScrollView,Object.assign({},rest,{children:childrenWithoutHeader}))]})});};var styles=StyleSheet.create({container:{flex:1}});export default withTheme(Table);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/TableCell.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import Pressable from"../Pressable";import{jsx as _jsx}from"react/jsx-runtime";var TableCell=function TableCell(_ref){var borderWidth=_ref.borderWidth,borderColor=_ref.borderColor,borderStyle=_ref.borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?false:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?false:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?false:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?true:_ref$drawEndBorder,cellVerticalPadding=_ref.cellVerticalPadding,cellHorizontalPadding=_ref.cellHorizontalPadding,children=_ref.children,onPress=_ref.onPress,style=_ref.style;var parentContextValue=React.useContext(TableStyleContext);var borderViewStyle=generateBorderStyles({borderColor:borderColor||parentContextValue.borderColor,borderWidth:borderWidth||parentContextValue.borderWidth,borderStyle:borderStyle||parentContextValue.borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});var ContainerComponent=onPress?Pressable:View;return _jsx(ContainerComponent,{onPress:onPress,style:[styles.cellContainer,borderViewStyle,{paddingVertical:cellVerticalPadding||parentContextValue.cellVerticalPadding,paddingHorizontal:cellHorizontalPadding||parentContextValue.cellHorizontalPadding},style],children:children});};var styles=StyleSheet.create({cellContainer:{flex:1,flexDirection:"row"}});export default TableCell;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import React from"react";export var TableStyleContext=React.createContext({});export function generateBorderStyles(_ref){var borderColor=_ref.borderColor,borderWidth=_ref.borderWidth,borderStyle=_ref.borderStyle,drawTopBorder=_ref.drawTopBorder,drawBottomBorder=_ref.drawBottomBorder,drawStartBorder=_ref.drawStartBorder,drawEndBorder=_ref.drawEndBorder;return{borderColor:borderColor,borderStyle:borderStyle,borderTopWidth:drawTopBorder?borderWidth:0,borderBottomWidth:drawBottomBorder?borderWidth:0,borderStartWidth:drawStartBorder?borderWidth:0,borderEndWidth:drawEndBorder?borderWidth:0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/TableRow.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import{withTheme}from"../../theming";import Pressable from"../Pressable";import{jsx as _jsx}from"react/jsx-runtime";var TableRow=function TableRow(_ref){var borderWidth=_ref.borderWidth,borderColor=_ref.borderColor,borderStyle=_ref.borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?false:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?true:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?true:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,cellVerticalPadding=_ref.cellVerticalPadding,cellHorizontalPadding=_ref.cellHorizontalPadding,_ref$isTableHeader=_ref.isTableHeader,isTableHeader=_ref$isTableHeader===void 0?false:_ref$isTableHeader,children=_ref.children,onPress=_ref.onPress,style=_ref.style,theme=_ref.theme;var parentContextValue=React.useContext(TableStyleContext);var contextValue={borderColor:borderColor||parentContextValue.borderColor,borderStyle:borderStyle||parentContextValue.borderStyle,borderWidth:borderWidth||parentContextValue.borderWidth,cellHorizontalPadding:cellHorizontalPadding||parentContextValue.cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding||parentContextValue.cellVerticalPadding};var borderViewStyle=generateBorderStyles({borderColor:contextValue.borderColor,borderWidth:contextValue.borderWidth,borderStyle:contextValue.borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});var ContainerComponent=onPress?Pressable:View;return _jsx(TableStyleContext.Provider,{value:contextValue,children:_jsx(ContainerComponent,{onPress:onPress,style:[borderViewStyle,isTableHeader?{backgroundColor:theme.colors.primary}:{},style,styles.cellsContainer],children:children})});};var styles=StyleSheet.create({cellsContainer:{flexDirection:"row"}});export default withTheme(TableRow);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{default as Table}from"./Table";export{default as TableRow}from"./TableRow";export{default as TableCell}from"./TableCell";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Text.tsx",_this2=this;var _excluded=["style"],_excluded2=["style","theme","title"];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{Text as NativeText,I18nManager}from"react-native";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";var Text=function(_React$Component){_inherits(Text,_React$Component);var _super=_createSuper(Text);function Text(){_classCallCheck(this,Text);return _super.apply(this,arguments);}_createClass(Text,[{key:"render",value:function render(){var _this=this;var _this$props=this.props,style=_this$props.style,rest=_objectWithoutProperties(_this$props,_excluded);var writingDirection=I18nManager.isRTL?"rtl":"ltr";return _jsx(NativeText,Object.assign({},rest,{ref:function ref(c){_this._root=c;},style:[{textAlign:"left",writingDirection:writingDirection},style]}));}}]);return Text;}(React.Component);export var BaseLink=function BaseLink(_ref){var style=_ref.style,theme=_ref.theme,title=_ref.title,props=_objectWithoutProperties(_ref,_excluded2);return _jsx(Text,Object.assign({hitSlop:8,style:[{color:theme.colors.primary},style],theme:theme},props,{children:title}));};var Link=withTheme(BaseLink);export{Link};export default withTheme(Text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _theming=require("../theming");var _utilities=require("../utilities");var _TextInput=_interopRequireDefault(require("./TextInput"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextField.tsx";var _excluded=["theme","Icon","type","disabled","editable","label","error","leftIconName","leftIconMode","rightIconName","iconColor","iconSize","assistiveText","underlineColor","activeBorderColor","multiline","numberOfLines","style","render"],_excluded2=["lineHeight"],_excluded3=["backgroundColor","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(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;}}var AnimatedText=_reactNative.Animated.createAnimatedComponent(_reactNative.Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var TextField=function(_React$Component){(0,_inherits2.default)(TextField,_React$Component);var _super=_createSuper(TextField);function TextField(){var _this;(0,_classCallCheck2.default)(this,TextField);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={labeled:new _reactNative.Animated.Value(_this.props.value||_this.props.error?0:1),focused:false,placeholder:_this.props.error?_this.props.placeholder:"",labelLayout:{measured:false,width:0}};_this._timer=setTimeout(function(){},0);_this._showPlaceholder=function(){clearTimeout(_this._timer);_this._timer=setTimeout(function(){return _this.setState({placeholder:_this.props.placeholder});},50);};_this._hidePlaceholder=function(){return _this.setState({placeholder:""});};_this._restoreLabel=function(){return _reactNative.Animated.timing(_this.state.labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:_reactNative.Platform.OS!=="web"}).start();};_this._minmizeLabel=function(){return _reactNative.Animated.timing(_this.state.labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:_reactNative.Platform.OS!=="web"}).start();};_this._handleFocus=function(){if(_this.props.disabled){return;}_this.setState({focused:true});};_this._handleBlur=function(){if(_this.props.disabled){return;}_this.setState({focused:false});};_this._handleChangeText=function(value){if(_this.props.disabled){return;}if(typeof value==="string"){_this.setState({value:value});_this.props.onChangeText&&_this.props.onChangeText(value);}else{_this.setState({value:value.nativeEvent.text});_this.props.onChangeText&&_this.props.onChangeText(value.nativeEvent.text);}};_this._root=undefined;return _this;}(0,_createClass2.default)(TextField,[{key:"componentDidMount",value:function componentDidMount(){if(this.props.defaultValue){this._handleChangeText(this.props.defaultValue);}if(this.props.placeholder){this._minmizeLabel();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(prevState.focused!==this.state.focused||prevState.value!==this.state.value){if(this.state.value||this.state.focused||this.props.error||this.props.placeholder){this._minmizeLabel();}else{this._restoreLabel();}}if(prevState.focused!==this.state.focused||prevProps.label!==this.props.label){if(this.state.focused||this.props.error||!this.props.label){this._showPlaceholder();}else{this._hidePlaceholder();}}}},{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this._timer);}},{key:"toggleFocus",value:function toggleFocus(){this.setState(function(prevState){return{focused:!prevState.focused};});}},{key:"isFocused",value:function isFocused(){return this._root&&this._root.isFocused();}},{key:"clear",value:function clear(){return this._root&&this._root.clear();}},{key:"focus",value:function focus(){return this._root&&this._root.focus();}},{key:"blur",value:function blur(){return this._root&&this._root.blur();}},{key:"render",value:function render(){var _this2=this;var _this$props=this.props,_this$props$theme=_this$props.theme,colors=_this$props$theme.colors,typography=_this$props$theme.typography,roundness=_this$props$theme.roundness,disabledOpacity=_this$props$theme.disabledOpacity,Icon=_this$props.Icon,_this$props$type=_this$props.type,type=_this$props$type===void 0?"underline":_this$props$type,_this$props$disabled=_this$props.disabled,disabled=_this$props$disabled===void 0?false:_this$props$disabled,_this$props$editable=_this$props.editable,editable=_this$props$editable===void 0?true:_this$props$editable,label=_this$props.label,_this$props$error=_this$props.error,error=_this$props$error===void 0?false:_this$props$error,leftIconName=_this$props.leftIconName,leftIconMode=_this$props.leftIconMode,rightIconName=_this$props.rightIconName,iconColor=_this$props.iconColor,iconSize=_this$props.iconSize,assistiveText=_this$props.assistiveText,underlineColorProp=_this$props.underlineColor,_this$props$activeBor=_this$props.activeBorderColor,activeBorderColorProp=_this$props$activeBor===void 0?colors.primary:_this$props$activeBor,_this$props$multiline=_this$props.multiline,multiline=_this$props$multiline===void 0?false:_this$props$multiline,_this$props$numberOfL=_this$props.numberOfLines,numberOfLines=_this$props$numberOfL===void 0?4:_this$props$numberOfL,style=_this$props.style,_this$props$render=_this$props.render,render=_this$props$render===void 0?function(props){return(0,_jsxRuntime.jsx)(_TextInput.default,Object.assign({},props));}:_this$props$render,rest=(0,_objectWithoutProperties2.default)(_this$props,_excluded);var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=typography.caption.fontSize;var hasActiveOutline=this.state.focused||error;var inputTextColor,activeColor,underlineColor,borderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.strong;if(disabled){activeColor=colors.light;placeholderColor=colors.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.divider;}else{activeColor=error?colors.error:activeBorderColorProp;placeholderColor=borderColor=colors.light;underlineColor=underlineColorProp||colors.light;backgroundColor=colors.background;}if(rest.placeholderTextColor){placeholderColor=rest.placeholderTextColor;}var _typography$subtitle=typography.subtitle1,lineHeight=_typography$subtitle.lineHeight,subtitle1=(0,_objectWithoutProperties2.default)(_typography$subtitle,_excluded2);inputStyle=Object.assign({paddingVertical:0,color:inputTextColor,paddingLeft:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1);if(!multiline){inputStyle.height=lineHeight;}var assistiveTextLeftMargin;if(type==="underline"){containerStyle={borderTopLeftRadius:roundness,borderTopRightRadius:roundness,paddingBottom:12,marginTop:16};if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8;}else{assistiveTextLeftMargin=0;}}else{containerStyle={borderRadius:roundness,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:1,paddingTop:label?16*1.5:16,paddingBottom:label?16*0.5:16,opacity:disabled?disabledOpacity:1,backgroundColor:backgroundColor};if(leftIconName&&leftIconMode==="inset"){assistiveTextLeftMargin=16+4;}else if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8+12;}else{assistiveTextLeftMargin=12;}}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(iconColor){leftIconColor=iconColor;}else if(error){leftIconColor=colors.error;}else if(this.state.focused){leftIconColor=colors.primary;}else{leftIconColor=colors.light;}var labelStyle=Object.assign({},typography.subtitle1,type==="solid"?{marginHorizontal:12}:{},{top:type==="solid"?16:0,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,transform:[{translateY:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(this.state.labelLayout.width/2),0]})}]});var _extractStyles=(0,_utilities.extractStyles)(style),textStyles=_extractStyles.textStyles;var inputStyles=(0,_utilities.applyStyles)([styles.input,inputStyle,type==="solid"?{marginHorizontal:16}:{marginHorizontal:6}],textStyles);var _ref=_reactNative.StyleSheet.flatten(style||{}),bgColor=_ref.backgroundColor,padding=_ref.padding,paddingTop=_ref.paddingTop,paddingBottom=_ref.paddingBottom,paddingLeft=_ref.paddingLeft,paddingRight=_ref.paddingRight,borderRadius=_ref.borderRadius,borderWidth=_ref.borderWidth,borderTopWidth=_ref.borderTopWidth,borderRightWidth=_ref.borderRightWidth,borderBottomWidth=_ref.borderBottomWidth,borderLeftWidth=_ref.borderLeftWidth,borderCol=_ref.borderColor,styleProp=(0,_objectWithoutProperties2.default)(_ref,_excluded3);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.container,styleProp],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:(0,_utilities.applyStyles)([containerStyle],{height:styleProp.height,backgroundColor:bgColor,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,borderRadius:borderRadius,borderWidth:borderWidth,borderTopWidth:borderTopWidth,borderRightWidth:borderRightWidth,borderBottomWidth:borderBottomWidth,borderLeftWidth:borderLeftWidth,borderColor:borderCol}),children:[type==="underline"?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.underline,{backgroundColor:bgColor||(error?colors.error:this.state.focused?activeColor:underlineColor),transform:[{scaleY:this.state.focused?1:0.5}]}]}):null,label?(0,_jsxRuntime.jsxs)(_reactNative.View,{pointerEvents:"none",style:[_reactNative.StyleSheet.absoluteFill,{opacity:this.state.value||this.state.focused?this.state.labelLayout.measured?1:0:1}],children:[(0,_jsxRuntime.jsx)(AnimatedText,{onLayout:function onLayout(e){return _this2.setState({labelLayout:{width:e.nativeEvent.layout.width,measured:true}});},style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),(0,_jsxRuntime.jsx)(AnimatedText,{style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:hasActiveOutline?this.state.labeled:1}],numberOfLines:1,children:label})]}):null,render(Object.assign({ref:function ref(c){_this2._root=c;},onChange:this._handleChangeText,placeholder:label?this.state.placeholder:this.props.placeholder,placeholderTextColor:placeholderColor,editable:!disabled&&editable,selectionColor:activeColor,multiline:multiline,numberOfLines:numberOfLines,onFocus:this._handleFocus,onBlur:this._handleBlur,underlineColorAndroid:"transparent",style:inputStyles},rest,{value:this.state.value}))]}),leftIconName?(0,_jsxRuntime.jsx)(Icon,{size:iconSize||ICON_SIZE,color:leftIconColor||colors.light,name:leftIconName,style:{position:"absolute",left:leftIconMode==="inset"&&type==="solid"?16:0,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,rightIconName?(0,_jsxRuntime.jsx)(Icon,{name:rightIconName,size:iconSize||ICON_SIZE,color:iconColor||colors.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,assistiveText?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[{color:error?colors.error:colors.light,marginTop:8,marginLeft:assistiveTextLeftMargin}],children:assistiveText}):null]});}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){return{value:typeof nextProps.value!=="undefined"?nextProps.value:prevState.value};}}]);return TextField;}(React.Component);var _default=(0,_theming.withTheme)(TextField);exports.default=_default;var styles=_reactNative.StyleSheet.create({container:{alignSelf:"stretch"},placeholder:{position:"absolute",left:0},underline:{position:"absolute",left:0,right:0,bottom:0,height:2},input:{flexGrow:1,justifyContent:"center",textAlignVertical:"center",margin:0,textAlign:_reactNative.I18nManager.isRTL?"right":"left"}});
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextField.tsx";var _excluded=["theme","Icon","type","disabled","editable","label","error","leftIconName","leftIconMode","rightIconName","iconColor","iconSize","assistiveText","underlineColor","activeBorderColor","multiline","numberOfLines","style","render"],_excluded2=["lineHeight"],_excluded3=["backgroundColor","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import*as React from"react";import{View,Animated,StyleSheet,Text,I18nManager,Platform}from"react-native";import{withTheme}from"../theming";import{applyStyles,extractStyles}from"../utilities";import TextInput from"./TextInput";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AnimatedText=Animated.createAnimatedComponent(Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var TextField=function(_React$Component){_inherits(TextField,_React$Component);var _super=_createSuper(TextField);function TextField(){var _this;_classCallCheck(this,TextField);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={labeled:new Animated.Value(_this.props.value||_this.props.error?0:1),focused:false,placeholder:_this.props.error?_this.props.placeholder:"",labelLayout:{measured:false,width:0}};_this._timer=setTimeout(function(){},0);_this._showPlaceholder=function(){clearTimeout(_this._timer);_this._timer=setTimeout(function(){return _this.setState({placeholder:_this.props.placeholder});},50);};_this._hidePlaceholder=function(){return _this.setState({placeholder:""});};_this._restoreLabel=function(){return Animated.timing(_this.state.labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._minmizeLabel=function(){return Animated.timing(_this.state.labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._handleFocus=function(){if(_this.props.disabled){return;}_this.setState({focused:true});};_this._handleBlur=function(){if(_this.props.disabled){return;}_this.setState({focused:false});};_this._handleChangeText=function(value){if(_this.props.disabled){return;}if(typeof value==="string"){_this.setState({value:value});_this.props.onChangeText&&_this.props.onChangeText(value);}else{_this.setState({value:value.nativeEvent.text});_this.props.onChangeText&&_this.props.onChangeText(value.nativeEvent.text);}};_this._root=undefined;return _this;}_createClass(TextField,[{key:"componentDidMount",value:function componentDidMount(){if(this.props.defaultValue){this._handleChangeText(this.props.defaultValue);}if(this.props.placeholder){this._minmizeLabel();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(prevState.focused!==this.state.focused||prevState.value!==this.state.value){if(this.state.value||this.state.focused||this.props.error||this.props.placeholder){this._minmizeLabel();}else{this._restoreLabel();}}if(prevState.focused!==this.state.focused||prevProps.label!==this.props.label){if(this.state.focused||this.props.error||!this.props.label){this._showPlaceholder();}else{this._hidePlaceholder();}}}},{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this._timer);}},{key:"toggleFocus",value:function toggleFocus(){this.setState(function(prevState){return{focused:!prevState.focused};});}},{key:"isFocused",value:function isFocused(){return this._root&&this._root.isFocused();}},{key:"clear",value:function clear(){return this._root&&this._root.clear();}},{key:"focus",value:function focus(){return this._root&&this._root.focus();}},{key:"blur",value:function blur(){return this._root&&this._root.blur();}},{key:"render",value:function render(){var _this2=this;var _this$props=this.props,_this$props$theme=_this$props.theme,colors=_this$props$theme.colors,typography=_this$props$theme.typography,roundness=_this$props$theme.roundness,disabledOpacity=_this$props$theme.disabledOpacity,Icon=_this$props.Icon,_this$props$type=_this$props.type,type=_this$props$type===void 0?"underline":_this$props$type,_this$props$disabled=_this$props.disabled,disabled=_this$props$disabled===void 0?false:_this$props$disabled,_this$props$editable=_this$props.editable,editable=_this$props$editable===void 0?true:_this$props$editable,label=_this$props.label,_this$props$error=_this$props.error,error=_this$props$error===void 0?false:_this$props$error,leftIconName=_this$props.leftIconName,leftIconMode=_this$props.leftIconMode,rightIconName=_this$props.rightIconName,iconColor=_this$props.iconColor,iconSize=_this$props.iconSize,assistiveText=_this$props.assistiveText,underlineColorProp=_this$props.underlineColor,_this$props$activeBor=_this$props.activeBorderColor,activeBorderColorProp=_this$props$activeBor===void 0?colors.primary:_this$props$activeBor,_this$props$multiline=_this$props.multiline,multiline=_this$props$multiline===void 0?false:_this$props$multiline,_this$props$numberOfL=_this$props.numberOfLines,numberOfLines=_this$props$numberOfL===void 0?4:_this$props$numberOfL,style=_this$props.style,_this$props$render=_this$props.render,render=_this$props$render===void 0?function(props){return _jsx(TextInput,Object.assign({},props));}:_this$props$render,rest=_objectWithoutProperties(_this$props,_excluded);var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=typography.caption.fontSize;var hasActiveOutline=this.state.focused||error;var inputTextColor,activeColor,underlineColor,borderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.strong;if(disabled){activeColor=colors.light;placeholderColor=colors.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.divider;}else{activeColor=error?colors.error:activeBorderColorProp;placeholderColor=borderColor=colors.light;underlineColor=underlineColorProp||colors.light;backgroundColor=colors.background;}if(rest.placeholderTextColor){placeholderColor=rest.placeholderTextColor;}var _typography$subtitle=typography.subtitle1,lineHeight=_typography$subtitle.lineHeight,subtitle1=_objectWithoutProperties(_typography$subtitle,_excluded2);inputStyle=Object.assign({paddingVertical:0,color:inputTextColor,paddingLeft:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1);if(!multiline){inputStyle.height=lineHeight;}var assistiveTextLeftMargin;if(type==="underline"){containerStyle={borderTopLeftRadius:roundness,borderTopRightRadius:roundness,paddingBottom:12,marginTop:16};if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8;}else{assistiveTextLeftMargin=0;}}else{containerStyle={borderRadius:roundness,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:1,paddingTop:label?16*1.5:16,paddingBottom:label?16*0.5:16,opacity:disabled?disabledOpacity:1,backgroundColor:backgroundColor};if(leftIconName&&leftIconMode==="inset"){assistiveTextLeftMargin=16+4;}else if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8+12;}else{assistiveTextLeftMargin=12;}}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(iconColor){leftIconColor=iconColor;}else if(error){leftIconColor=colors.error;}else if(this.state.focused){leftIconColor=colors.primary;}else{leftIconColor=colors.light;}var labelStyle=Object.assign({},typography.subtitle1,type==="solid"?{marginHorizontal:12}:{},{top:type==="solid"?16:0,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,transform:[{translateY:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(this.state.labelLayout.width/2),0]})}]});var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles;var inputStyles=applyStyles([styles.input,inputStyle,type==="solid"?{marginHorizontal:16}:{marginHorizontal:6}],textStyles);var _ref=StyleSheet.flatten(style||{}),bgColor=_ref.backgroundColor,padding=_ref.padding,paddingTop=_ref.paddingTop,paddingBottom=_ref.paddingBottom,paddingLeft=_ref.paddingLeft,paddingRight=_ref.paddingRight,borderRadius=_ref.borderRadius,borderWidth=_ref.borderWidth,borderTopWidth=_ref.borderTopWidth,borderRightWidth=_ref.borderRightWidth,borderBottomWidth=_ref.borderBottomWidth,borderLeftWidth=_ref.borderLeftWidth,borderCol=_ref.borderColor,styleProp=_objectWithoutProperties(_ref,_excluded3);return _jsxs(View,{style:[styles.container,styleProp],children:[_jsxs(View,{style:applyStyles([containerStyle],{height:styleProp.height,backgroundColor:bgColor,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,borderRadius:borderRadius,borderWidth:borderWidth,borderTopWidth:borderTopWidth,borderRightWidth:borderRightWidth,borderBottomWidth:borderBottomWidth,borderLeftWidth:borderLeftWidth,borderColor:borderCol}),children:[type==="underline"?_jsx(Animated.View,{style:[styles.underline,{backgroundColor:bgColor||(error?colors.error:this.state.focused?activeColor:underlineColor),transform:[{scaleY:this.state.focused?1:0.5}]}]}):null,label?_jsxs(View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{opacity:this.state.value||this.state.focused?this.state.labelLayout.measured?1:0:1}],children:[_jsx(AnimatedText,{onLayout:function onLayout(e){return _this2.setState({labelLayout:{width:e.nativeEvent.layout.width,measured:true}});},style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),_jsx(AnimatedText,{style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:hasActiveOutline?this.state.labeled:1}],numberOfLines:1,children:label})]}):null,render(Object.assign({ref:function ref(c){_this2._root=c;},onChange:this._handleChangeText,placeholder:label?this.state.placeholder:this.props.placeholder,placeholderTextColor:placeholderColor,editable:!disabled&&editable,selectionColor:activeColor,multiline:multiline,numberOfLines:numberOfLines,onFocus:this._handleFocus,onBlur:this._handleBlur,underlineColorAndroid:"transparent",style:inputStyles},rest,{value:this.state.value}))]}),leftIconName?_jsx(Icon,{size:iconSize||ICON_SIZE,color:leftIconColor||colors.light,name:leftIconName,style:{position:"absolute",left:leftIconMode==="inset"&&type==="solid"?16:0,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,rightIconName?_jsx(Icon,{name:rightIconName,size:iconSize||ICON_SIZE,color:iconColor||colors.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,assistiveText?_jsx(Text,{style:[{color:error?colors.error:colors.light,marginTop:8,marginLeft:assistiveTextLeftMargin}],children:assistiveText}):null]});}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){return{value:typeof nextProps.value!=="undefined"?nextProps.value:prevState.value};}}]);return TextField;}(React.Component);export default withTheme(TextField);var styles=StyleSheet.create({container:{alignSelf:"stretch"},placeholder:{position:"absolute",left:0},underline:{position:"absolute",left:0,right:0,bottom:0,height:2},input:{flexGrow:1,justifyContent:"center",textAlignVertical:"center",margin:0,textAlign:I18nManager.isRTL?"right":"left"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onChangeTextDelayed","changeTextDelay","value"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextInput.tsx";import React from"react";import{TextInput as NativeTextInput}from"react-native";import{useDebounce,useOnUpdate}from"../hooks";import{jsx as _jsx}from"react/jsx-runtime";var TextInput=React.forwardRef(function(_ref,ref){var onChangeTextDelayed=_ref.onChangeTextDelayed,_ref$changeTextDelay=_ref.changeTextDelay,changeTextDelay=_ref$changeTextDelay===void 0?500:_ref$changeTextDelay,value=_ref.value,rest=_objectWithoutProperties(_ref,_excluded);var delayedValue=useDebounce(value,changeTextDelay);useOnUpdate(function(){if(delayedValue!==undefined){onChangeTextDelayed==null?void 0:onChangeTextDelayed(delayedValue);}},[delayedValue]);return _jsx(NativeTextInput,Object.assign({testID:"native-text-input",ref:ref,value:value},rest));});export default TextInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Touchable.tsx";var _excluded=["children","disabled","onPress","activeOpacity","disabledOpacity","delayLongPress","hitSlop","style"];import React from"react";import{Pressable}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";export default function Touchable(_ref){var children=_ref.children,disabled=_ref.disabled,onPress=_ref.onPress,_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,delayLongPress=_ref.delayLongPress,hitSlop=_ref.hitSlop,_style=_ref.style,props=_objectWithoutProperties(_ref,_excluded);return _jsx(Pressable,Object.assign({disabled:disabled,onPress:onPress,delayLongPress:delayLongPress?delayLongPress:500,hitSlop:hitSlop?hitSlop:8,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?activeOpacity:disabled?disabledOpacity:1},_style];}},props,{children:children}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{TouchableOpacity}from"react-native";export default TouchableOpacity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Typography.tsx";import React from"react";import{Text}from"react-native";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";export var Title=withTheme(function(_ref){var text=_ref.text,theme=_ref.theme,style=_ref.style;return _jsx(Text,{style:[{fontSize:20,letterSpacing:0,lineHeight:26,color:theme.colors.text},style],children:text});});export var Subtitle=withTheme(function(_ref2){var text=_ref2.text,theme=_ref2.theme,style=_ref2.style;return _jsx(Text,{style:[{fontSize:14,letterSpacing:0,lineHeight:16,color:theme.colors.medium},style],children:text});});export var Caption=withTheme(function(_ref3){var text=_ref3.text,theme=_ref3.theme,style=_ref3.style;return _jsx(Text,{style:[{fontSize:12,letterSpacing:0,lineHeight:14,color:theme.colors.light},style],children:text});});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/YoutubePlayer/YoutubePlayer.tsx";import React from"react";import{View}from"react-native";import{extractStyles}from"../../utilities";import YouTube from"react-youtube";import{jsx as _jsx}from"react/jsx-runtime";var YoutubePlayer=function YoutubePlayer(_ref){var videoId=_ref.videoId,playlist=_ref.playlist,_ref$autoplay=_ref.autoplay,autoplay=_ref$autoplay===void 0?false:_ref$autoplay,style=_ref.style;var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles;var defaultVideoId="nwMUpDESXrI";var options={width:viewStyles.width,height:viewStyles.height,playerVars:{autoplay:autoplay?1:0,list:playlist,listType:"playlist"}};return _jsx(View,{style:viewStyles,children:_jsx(YouTube,{style:{flex:1},videoId:!videoId&&!playlist?defaultVideoId:videoId,opts:options})});};export default YoutubePlayer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/YoutubePlayer/YoutubePlayer.native.tsx";import React from"react";import YoutubePlayerIFrame from"react-native-youtube-iframe";import{extractStyles}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";var YoutubePlayer=function YoutubePlayer(_ref){var videoId=_ref.videoId,playlist=_ref.playlist,_ref$autoplay=_ref.autoplay,autoplay=_ref$autoplay===void 0?false:_ref$autoplay,style=_ref.style;var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles;var defaultVideoId="nwMUpDESXrI";return _jsx(YoutubePlayerIFrame,{width:viewStyles.width,height:viewStyles.height,play:autoplay,videoId:!videoId&&!playlist?defaultVideoId:videoId,playList:playlist,webViewStyle:[viewStyles,{opacity:viewStyles.opacity<0.99?viewStyles.opacity:0.99}],webViewProps:{injectedJavaScript:`
|
|
2
2
|
var element = document.getElementsByClassName('container')[0];
|
|
3
3
|
element.style.position = 'unset';
|
|
4
4
|
true;
|
|
5
|
-
`}});};
|
|
5
|
+
`}});};export default YoutubePlayer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{default as YoutubePlayer}from"./YoutubePlayer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import*as React from"react";export var useAuthState=function useAuthState(auth){var _React$useState=React.useState(),_React$useState2=_slicedToArray(_React$useState,2),error=_React$useState2[0],setError=_React$useState2[1];var _React$useState3=React.useState(auth.currentUser),_React$useState4=_slicedToArray(_React$useState3,2),value=_React$useState4[0],setValue=_React$useState4[1];React.useEffect(function(){var list=auth.onAuthStateChanged(setValue,setError);return function(){list();};},[auth]);var signInWithEmailAndPassword=function signInWithEmailAndPassword(user,password){auth.signInWithEmailAndPassword(user,password).then(setValue).catch(setError);};var createUserWithEmailAndPassword=function createUserWithEmailAndPassword(user,password){auth.signInWithEmailAndPassword(user,password).then(setValue).catch(setError);};var signOut=function signOut(){return auth.signOut();};return[value,error,signInWithEmailAndPassword,signOut,createUserWithEmailAndPassword];};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{Platform}from"react-native";var expo=global.__expo;var DEFAULT_STATUSBAR_HEIGHT_EXPO=expo!=null&&expo.Constants?expo.Constants.statusBarHeight:0;export var APPROX_STATUSBAR_HEIGHT=Platform.select({android:DEFAULT_STATUSBAR_HEIGHT_EXPO,ios:Platform.Version<11?DEFAULT_STATUSBAR_HEIGHT_EXPO:0});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","label","style","iconColor","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AccordionItem.tsx";import*as React from"react";import{Pressable,StyleSheet,View}from"react-native";import Text from"../components/Text";import{extractStyles}from"../utilities";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function AccordionItem(_ref){var Icon=_ref.Icon,icon=_ref.icon,label=_ref.label,style=_ref.style,iconColor=_ref.iconColor,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsx(Pressable,Object.assign({style:[styles.container,viewStyles]},rest,{children:_jsxs(View,{style:styles.row,children:[icon?_jsx(Icon,{name:icon,size:24,color:iconColor||theme.colors.primary}):null,_jsx(View,{style:[styles.item,styles.content],children:_jsx(Text,{selectable:false,style:textStyles,children:label})})]})}));};var styles=StyleSheet.create({container:{padding:8},row:{flexDirection:"row",alignItems:"center",paddingLeft:8},item:{marginVertical:6,paddingLeft:8},content:{flex:1,justifyContent:"center"}});export default withTheme(AccordionItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["duration","easing","fill","prefill","useNativeDriver","tintColorSecondary","onAnimationComplete","tintColor"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AnimatedCircularProgress.tsx";import*as React from"react";import{Animated,Easing}from"react-native";import CircularProgress from"./CircularProgress";import{jsx as _jsx}from"react/jsx-runtime";var AnimatedProgress=Animated.createAnimatedComponent(CircularProgress);var AnimatedCircularProgress=function AnimatedCircularProgress(_ref){var _ref$duration=_ref.duration,duration=_ref$duration===void 0?500:_ref$duration,_ref$easing=_ref.easing,easing=_ref$easing===void 0?Easing.out(Easing.ease):_ref$easing,fill=_ref.fill,_ref$prefill=_ref.prefill,prefill=_ref$prefill===void 0?0:_ref$prefill,_ref$useNativeDriver=_ref.useNativeDriver,useNativeDriver=_ref$useNativeDriver===void 0?false:_ref$useNativeDriver,tintColorSecondary=_ref.tintColorSecondary,onAnimationComplete=_ref.onAnimationComplete,_ref$tintColor=_ref.tintColor,tintColor=_ref$tintColor===void 0?"black":_ref$tintColor,other=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(new Animated.Value(prefill)),_React$useState2=_slicedToArray(_React$useState,1),fillAnimation=_React$useState2[0];var animate=React.useCallback(function(){var toVal=arguments.length>0&&arguments[0]!==undefined?arguments[0]:-1;var dur=arguments.length>1?arguments[1]:undefined;var ease=arguments.length>2?arguments[2]:undefined;var toValue=toVal>=0?toVal:fill;var dura=dur||duration;var eas=ease||easing;var useNative=useNativeDriver;var anim=Animated.timing(fillAnimation,{useNativeDriver:useNative,toValue:toValue,easing:eas,duration:dura});anim.start(onAnimationComplete);return anim;},[duration,easing,fill,useNativeDriver,fillAnimation,onAnimationComplete]);var animateColor=function animateColor(){if(!tintColorSecondary){return tintColor;}var tintAnimation=fillAnimation.interpolate({inputRange:[0,100],outputRange:[tintColor,tintColorSecondary]});return tintAnimation;};React.useEffect(function(){animate();},[fill,animate]);return _jsx(AnimatedProgress,Object.assign({},other,{style:other.style,childrenContainerStyle:other.childrenContainerStyle,fill:fillAnimation,tintColor:animateColor()}));};export default AnimatedCircularProgress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","image","size","onPress","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvatarEdit.tsx";import*as React from"react";import{View}from"react-native";import Touchable from"../components/Touchable";import CircleImage from"./CircleImage";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AvatarEdit=function AvatarEdit(_ref){var Icon=_ref.Icon,image=_ref.image,_ref$size=_ref.size,size=_ref$size===void 0?80:_ref$size,_ref$onPress=_ref.onPress,onPress=_ref$onPress===void 0?function(){}:_ref$onPress,style=_ref.style,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var colorStyles={editBackgroundColor:theme.colors.primary,editIconColor:theme.colors.surface,editBorderColor:theme.colors.surface};var dimensions={width:size,height:size};return _jsx(View,Object.assign({style:[style,dimensions]},rest,{children:_jsxs(Touchable,{onPress:onPress,children:[_jsx(CircleImage,{source:image,size:size}),_jsx(View,{style:{position:"absolute",top:-3,right:-3,borderColor:colorStyles.editBorderColor,backgroundColor:colorStyles.editBackgroundColor,borderRadius:size*(3/16),padding:size*(3/32)},children:_jsx(Icon,{name:"MaterialIcons/edit",color:colorStyles.editIconColor,size:size*(3/16)})})]})}));};export default withTheme(AvatarEdit);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onKeyboardHidden","onKeyboardShown"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvoidKeyboardView.tsx";import React from"react";import{View}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var AvoidSoftInput=null;var AvoidSoftInputView=null;try{var avoidSoftInputPackage=require("react-native-avoid-softinput");AvoidSoftInput=avoidSoftInputPackage.AvoidSoftInput;AvoidSoftInputView=avoidSoftInputPackage.AvoidSoftInputView;}catch(_){console.warn("AvoidKeyboardView: `react-native-avoid-softinput` is not installed, falling back to `View`. No keyboard avoiding capabilties will be used.");}var AvoidKeyboardView=function AvoidKeyboardView(_ref){var onKeyboardHidden=_ref.onKeyboardHidden,onKeyboardShown=_ref.onKeyboardShown,rest=_objectWithoutProperties(_ref,_excluded);React.useEffect(function(){if(AvoidSoftInput){AvoidSoftInput.setShouldMimicIOSBehavior(true);}return function(){if(AvoidSoftInput){AvoidSoftInput.setShouldMimicIOSBehavior(false);}};},[]);if(AvoidSoftInputView){return _jsx(AvoidSoftInputView,Object.assign({onSoftInputHidden:onKeyboardHidden,onSoftInputShown:onKeyboardShown},rest));}else{return _jsx(View,Object.assign({},rest));}};export default AvoidKeyboardView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["initiallyVisible","dismissable","icon","buttonColor","content","contentStyle","style","theme","Icon"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Banner.tsx";import*as React from"react";import{Button,Text,View,StyleSheet,Animated}from"react-native";import Surface from"../components/Surface";import shadow from"../styles/shadow";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ELEVATION=1;var DEFAULT_MAX_WIDTH=960;var Banner=function Banner(_ref){var _ref$initiallyVisible=_ref.initiallyVisible,initiallyVisible=_ref$initiallyVisible===void 0?true:_ref$initiallyVisible,_ref$dismissable=_ref.dismissable,dismissable=_ref$dismissable===void 0?true:_ref$dismissable,icon=_ref.icon,buttonColor=_ref.buttonColor,content=_ref.content,contentStyle=_ref.contentStyle,style=_ref.style,theme=_ref.theme,Icon=_ref.Icon,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(initiallyVisible),_React$useState2=_slicedToArray(_React$useState,2),visible=_React$useState2[0],setVisible=_React$useState2[1];React.useEffect(function(){if(initiallyVisible){setVisible(true);}},[initiallyVisible]);var _React$useRef=React.useRef(new Animated.Value(visible?1:0)),position=_React$useRef.current;var _React$useState3=React.useState({height:0,measured:false}),_React$useState4=_slicedToArray(_React$useState3,2),layout=_React$useState4[0],setLayout=_React$useState4[1];React.useEffect(function(){if(visible){Animated.timing(position,{duration:250,toValue:1,useNativeDriver:false}).start();}else{Animated.timing(position,{duration:200,toValue:0,useNativeDriver:false}).start();}},[visible,position]);var handleLayout=function handleLayout(_ref2){var nativeEvent=_ref2.nativeEvent;var height=nativeEvent.layout.height;setLayout({height:height,measured:true});};var height=Animated.multiply(position,layout.height);var translateY=Animated.multiply(Animated.add(position,-1),layout.height);return _jsx(Surface,Object.assign({},rest,{style:[styles.container,shadow(ELEVATION),style],children:_jsxs(View,{style:[styles.wrapper,contentStyle],children:[_jsx(Animated.View,{style:{height:height}}),_jsxs(Animated.View,{onLayout:handleLayout,style:[layout.measured||!visible?[styles.absolute,{transform:[{translateY:translateY}]}]:null,!layout.measured&&!visible?{opacity:0}:null],children:[_jsxs(View,{style:[styles.content,{marginBottom:dismissable?0:16}],children:[icon?_jsx(View,{style:styles.icon,children:_jsx(Icon,{name:icon,size:40})}):null,_jsx(Text,{style:[styles.message,{color:theme.colors.text}],accessibilityLiveRegion:visible?"polite":"none",accessibilityRole:"alert",children:content})]}),dismissable?_jsx(View,{style:styles.actions,children:_jsx(Button,{color:buttonColor||theme.colors.primary,title:"Close",onPress:function onPress(){return setVisible(false);}})}):null]})]})}));};var styles=StyleSheet.create({container:{elevation:ELEVATION},wrapper:{overflow:"hidden",alignSelf:"center",width:"100%",maxWidth:DEFAULT_MAX_WIDTH},absolute:{position:"absolute",top:0,width:"100%"},content:{flexDirection:"row",justifyContent:"flex-start",marginHorizontal:8,marginTop:16,marginBottom:0},icon:{margin:8},message:{flex:1,margin:8},actions:{flexDirection:"row",justifyContent:"flex-end",margin:8}});export default withTheme(Banner);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["backgroundColor","padding"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Card.tsx";import React from"react";import{StyleSheet,View,Pressable}from"react-native";import Image from"../components/Image";import Surface from"../components/Surface";import{Title,Subtitle,Caption}from"../components/Typography";import{withTheme}from"../theming";import Config from"../components/Config";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ICON_SIZE=Config.cardIconSize;var ICON_CONTAINER_SIZE=Config.cardIconSize*2;var ICON_CONTAINER_PADDING=Config.cardIconSize/2-1;var ICON_ELEVATION=Config.cardIconElevation;export var TopRightCircleIcon=withTheme(function(_ref){var Icon=_ref.Icon,icon=_ref.icon,theme=_ref.theme,onPress=_ref.onPress;return _jsx(Surface,{style:{justifyContent:"center",alignItems:"center",elevation:ICON_ELEVATION,position:"absolute",top:12,right:12,width:ICON_CONTAINER_SIZE,height:ICON_CONTAINER_SIZE,padding:ICON_CONTAINER_PADDING,borderRadius:ICON_CONTAINER_SIZE,backgroundColor:"rgba(0, 0, 0, 0.1)"},children:_jsx(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?0.8:1}];},children:_jsx(Icon,{name:icon,size:ICON_SIZE,color:theme.colors.surface})})});});var Card=function Card(_ref3){var Icon=_ref3.Icon,_ref3$image=_ref3.image,image=_ref3$image===void 0?Config.cardImageUrl:_ref3$image,title=_ref3.title,subtitle=_ref3.subtitle,description=_ref3.description,textCentered=_ref3.textCentered,icon=_ref3.icon,_ref3$aspectRatio=_ref3.aspectRatio,aspectRatio=_ref3$aspectRatio===void 0?1.5:_ref3$aspectRatio,_ref3$elevation=_ref3.elevation,elevation=_ref3$elevation===void 0?2:_ref3$elevation,style=_ref3.style,onPress=_ref3.onPress,onPressIcon=_ref3.onPressIcon,titleStyle=_ref3.titleStyle,subtitleStyle=_ref3.subtitleStyle,descriptionStyle=_ref3.descriptionStyle,theme=_ref3.theme,children=_ref3.children;var _StyleSheet$flatten=StyleSheet.flatten(style||{}),bgColor=_StyleSheet$flatten.backgroundColor,padding=_StyleSheet$flatten.padding,styles=_objectWithoutProperties(_StyleSheet$flatten,_excluded);var backgroundColor=bgColor?bgColor:theme.colors.surface;var innerPadding=padding?padding:12;return _jsx(Surface,{style:[{elevation:elevation,backgroundColor:backgroundColor},styles],children:_jsxs(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref4){var pressed=_ref4.pressed;return[{opacity:pressed?0.8:1}];},children:[_jsx(Image,{style:{aspectRatio:aspectRatio},source:typeof image==="string"?{uri:image}:image,resizeMode:"cover"}),_jsx(View,{style:{padding:innerPadding},children:_jsxs(View,{style:{alignItems:textCentered?"center":"flex-start"},children:[title||title&&title!==""?_jsx(Title,{text:title,style:titleStyle}):null,subtitle||subtitle&&subtitle!==""?_jsx(Subtitle,{text:subtitle,style:subtitleStyle}):null,description||description&&description!==""?_jsx(View,{style:{marginTop:4},children:_jsx(Caption,{text:description,style:descriptionStyle})}):null,children]})}),icon?_jsx(TopRightCircleIcon,{Icon:Icon,icon:icon,onPress:onPressIcon}):null]})});};export default withTheme(Card);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["direction","values","onValueChange","style","children"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/CheckboxGroup.tsx";import*as React from"react";import{View}from"react-native";import{checkboxGroupContext,Direction}from"../components/Checkbox/context";import{jsx as _jsx}from"react/jsx-runtime";var Provider=checkboxGroupContext.Provider;var CheckboxGroup=function CheckboxGroup(_ref){var _ref$direction=_ref.direction,direction=_ref$direction===void 0?Direction.Vertical:_ref$direction,values=_ref.values,_ref$onValueChange=_ref.onValueChange,onValueChange=_ref$onValueChange===void 0?function(){}:_ref$onValueChange,style=_ref.style,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var _containerStyle=[{flexDirection:direction===Direction.Horizontal?"row":"column",overflow:"hidden"}];if(direction!==Direction.Vertical){_containerStyle.push({alignItems:"center"});}return _jsx(View,Object.assign({style:[{minHeight:40},style]},rest,{children:_jsx(Provider,{value:{values:values,onValueChange:onValueChange,direction:direction},children:_jsx(View,{style:_containerStyle,children:children})})}));};export default CheckboxGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["source","size","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/CircleImage.tsx";import*as React from"react";import{Image}from"react-native";import Config from"../components/Config";import{jsx as _jsx}from"react/jsx-runtime";var CircleImage=function CircleImage(_ref){var _ref$source=_ref.source,source=_ref$source===void 0?Config.placeholderImageURL:_ref$source,_ref$size=_ref.size,size=_ref$size===void 0?60:_ref$size,style=_ref.style,props=_objectWithoutProperties(_ref,_excluded);var borderRadius=size/2;return _jsx(Image,Object.assign({style:[{width:size,height:size,borderRadius:borderRadius},style],source:typeof source==="string"?{uri:source}:source,resizeMode:"cover"},props));};export default CircleImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/CircularProgress.tsx";function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import React from"react";import{View}from"react-native";import{Svg,Path,G}from"react-native-svg";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularProgress=function(_React$Component){_inherits(CircularProgress,_React$Component);var _super=_createSuper(CircularProgress);function CircularProgress(){var _this;_classCallCheck(this,CircularProgress);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.polarToCartesian=function(centerX,centerY,radius,angleInDegrees){var angleInRadians=(angleInDegrees-90)*Math.PI/180.0;return{x:centerX+radius*Math.cos(angleInRadians),y:centerY+radius*Math.sin(angleInRadians)};};_this.circlePath=function(x,y,radius,startAngle,endAngle){var start=_this.polarToCartesian(x,y,radius,endAngle*0.9999);var end=_this.polarToCartesian(x,y,radius,startAngle);var largeArcFlag=endAngle-startAngle<=180?"0":"1";var d=["M",start.x,start.y,"A",radius,radius,0,largeArcFlag,0,end.x,end.y];return d.join(" ");};_this.clampFill=function(fill){return Math.min(100,Math.max(0,fill));};return _this;}_createClass(CircularProgress,[{key:"render",value:function render(){var _this$props=this.props,size=_this$props.size,width=_this$props.width,backgroundWidth=_this$props.backgroundWidth,_this$props$tintColor=_this$props.tintColor,tintColor=_this$props$tintColor===void 0?"black":_this$props$tintColor,_this$props$tintTrans=_this$props.tintTransparency,tintTransparency=_this$props$tintTrans===void 0?true:_this$props$tintTrans,backgroundColor=_this$props.backgroundColor,style=_this$props.style,_this$props$rotation=_this$props.rotation,rotation=_this$props$rotation===void 0?90:_this$props$rotation,_this$props$lineCap=_this$props.lineCap,lineCap=_this$props$lineCap===void 0?"butt":_this$props$lineCap,_this$props$arcSweepA=_this$props.arcSweepAngle,arcSweepAngle=_this$props$arcSweepA===void 0?360:_this$props$arcSweepA,fill=_this$props.fill,children=_this$props.children,childrenContainerStyle=_this$props.childrenContainerStyle,_this$props$padding=_this$props.padding,padding=_this$props$padding===void 0?0:_this$props$padding,renderCap=_this$props.renderCap,_this$props$dashedBac=_this$props.dashedBackground,dashedBackground=_this$props$dashedBac===void 0?{width:0,gap:0}:_this$props$dashedBac,_this$props$dashedTin=_this$props.dashedTint,dashedTint=_this$props$dashedTin===void 0?{width:0,gap:0}:_this$props$dashedTin;var maxWidthCircle=backgroundWidth?Math.max(width,backgroundWidth):width;var sizeWithPadding=size/2+padding/2;var radius=size/2-maxWidthCircle/2-padding/2;var currentFillAngle=arcSweepAngle*this.clampFill(fill)/100;var backgroundPath=this.circlePath(sizeWithPadding,sizeWithPadding,radius,tintTransparency?0:currentFillAngle,arcSweepAngle);var circlePathItem=this.circlePath(sizeWithPadding,sizeWithPadding,radius,0,currentFillAngle);var coordinate=this.polarToCartesian(sizeWithPadding,sizeWithPadding,radius,currentFillAngle);var cap=renderCap?renderCap({center:coordinate}):null;var offset=size-maxWidthCircle*2;var localChildrenContainerStyle=[{position:"absolute",left:maxWidthCircle+padding/2,top:maxWidthCircle+padding/2,width:offset,height:offset,borderRadius:offset/2,alignItems:"center",justifyContent:"center",overflow:"hidden"},childrenContainerStyle];var strokeDasharrayTint=dashedTint.gap>0?Object.values(dashedTint).map(function(value){return value.toString();}).join(" "):"";var strokeDasharrayBackground=dashedBackground.gap>0?Object.values(dashedBackground).map(function(value){return value.toString();}).join(" "):"";return _jsxs(View,{style:style,children:[_jsx(Svg,{width:size+padding,height:size+padding,children:_jsxs(G,{rotation:rotation,originX:(size+padding)/2,originY:(size+padding)/2,children:[backgroundColor&&_jsx(Path,{d:backgroundPath,stroke:backgroundColor,strokeWidth:backgroundWidth||width,strokeLinecap:lineCap,strokeDasharray:strokeDasharrayBackground,fill:"transparent"}),fill>0&&_jsx(Path,{d:circlePathItem,stroke:tintColor,strokeWidth:width,strokeLinecap:lineCap,strokeDasharray:strokeDasharrayTint,fill:"transparent"}),cap]})}),children&&_jsx(View,{style:localChildrenContainerStyle,children:children(fill)})]});}}]);return CircularProgress;}(React.Component);export default CircularProgress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["useThemeGutterPadding","borderColor","borderWidth","backgroundColor","backgroundImage","backgroundImageResizeMode","elevation","style","children","theme"],_excluded2=["flex","flexGrow","flexWrap","flexBasis","flexShrink","flexDirection","alignContent","justifyContent","alignItems","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","paddingVertical","paddingHorizontal"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Container.tsx";import*as React from"react";import{View,ImageBackground,StyleSheet}from"react-native";import{withTheme}from"../theming";import Elevation from"../components/Elevation";import{jsx as _jsx}from"react/jsx-runtime";var Container=function Container(_ref){var useThemeGutterPadding=_ref.useThemeGutterPadding,borderColor=_ref.borderColor,borderWidth=_ref.borderWidth,backgroundColor=_ref.backgroundColor,backgroundImage=_ref.backgroundImage,backgroundImageResizeMode=_ref.backgroundImageResizeMode,elevation=_ref.elevation,style=_ref.style,children=_ref.children,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _ref2=StyleSheet.flatten(style)||{},flex=_ref2.flex,flexGrow=_ref2.flexGrow,flexWrap=_ref2.flexWrap,flexBasis=_ref2.flexBasis,flexShrink=_ref2.flexShrink,flexDirection=_ref2.flexDirection,alignContent=_ref2.alignContent,justifyContent=_ref2.justifyContent,alignItems=_ref2.alignItems,padding=_ref2.padding,paddingTop=_ref2.paddingTop,paddingBottom=_ref2.paddingBottom,paddingLeft=_ref2.paddingLeft,paddingRight=_ref2.paddingRight,paddingVertical=_ref2.paddingVertical,paddingHorizontal=_ref2.paddingHorizontal,styleProp=_objectWithoutProperties(_ref2,_excluded2);var containerStyle=Object.assign({backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,width:"100%"},styleProp);var innerStyle={flex:flex,flexGrow:flexGrow,flexWrap:flexWrap,flexBasis:flexBasis,flexShrink:flexShrink,flexDirection:flexDirection,alignContent:alignContent,justifyContent:justifyContent,alignItems:alignItems,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,paddingVertical:paddingVertical,paddingHorizontal:paddingHorizontal||useThemeGutterPadding?16:0};var Wrap=elevation?Elevation:View;if(elevation)containerStyle.elevation=elevation;return _jsx(Wrap,Object.assign({style:[containerStyle,style]},rest,{children:backgroundImage?_jsx(ImageBackground,{source:typeof backgroundImage==="string"?{uri:backgroundImage}:backgroundImage,resizeMode:backgroundImageResizeMode,style:{flex:1},children:_jsx(View,{style:innerStyle,children:children})}):_jsx(View,{style:innerStyle,children:children})}));};export default withTheme(Container);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","labelColor","color","children","onPress","elevation","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedButton.tsx";import*as React from"react";import{ActivityIndicator,View,Text,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Elevation from"../components/Elevation";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Button=function Button(_ref){var Icon=_ref.Icon,icon=_ref.icon,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$type=_ref.type,type=_ref$type===void 0?"solid":_ref$type,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,labelColor=_ref.labelColor,colorOverride=_ref.color,children=_ref.children,onPress=_ref.onPress,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?0:_ref$elevation,_ref$theme=_ref.theme,colors=_ref$theme.colors,disabledOpacity=_ref$theme.disabledOpacity,roundness=_ref$theme.roundness,typography=_ref$theme.typography,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor,borderColor,textColor,borderWidth;var buttonColor=colorOverride||colors.primary;if(type==="solid"){backgroundColor=buttonColor;if(disabled){textColor=color(colors.surface).alpha(disabledOpacity).rgb().string();}else{textColor=labelColor||colors.surface;}}else{backgroundColor="transparent";if(disabled){textColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{textColor=labelColor||buttonColor;}}if(type==="outline"){if(disabled){borderColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{borderColor=buttonColor;}borderWidth=StyleSheet.hairlineWidth;}else{borderColor="transparent";borderWidth=0;}var buttonStyle={backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,borderRadius:roundness};var textStyle={textAlign:"center",color:textColor,marginVertical:16,marginHorizontal:16};var iconStyle=[styles.icon,{marginLeft:16,marginRight:-8,width:Config.buttonIconSize}];return _jsx(Elevation,{style:{elevation:elevation,alignSelf:"stretch"},children:_jsx(Pressable,Object.assign({},rest,{onPress:onPress,accessibilityState:{disabled:disabled},accessibilityRole:"button",disabled:disabled||loading,style:[styles.button,buttonStyle],children:_jsxs(View,{style:styles.content,children:[icon&&loading!==true?_jsx(View,{style:iconStyle,children:_jsx(Icon,{name:icon,size:Config.buttonIconSize,color:textColor})}):null,loading?_jsx(ActivityIndicator,{size:"small",color:textColor,style:iconStyle}):null,_jsx(Text,{numberOfLines:1,style:[textStyle,typography.button],children:children})]})}))});};var styles=StyleSheet.create({button:{minWidth:64,borderStyle:"solid"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},icon:{width:Config.buttonIconSize}});export default withTheme(Button);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["numColumns","children","onPress","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedCardWrapper.tsx";import React from"react";import{withTheme}from"../theming";import Touchable from"../components/Touchable";import{jsx as _jsx}from"react/jsx-runtime";var getWidth=function getWidth(numColumns){switch(numColumns){case 1:return"33%";case 2:return"50%";default:return"100%";}};var Card=function Card(_ref){var _ref$numColumns=_ref.numColumns,numColumns=_ref$numColumns===void 0?3:_ref$numColumns,children=_ref.children,onPress=_ref.onPress,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var width=getWidth(numColumns);return _jsx(Touchable,Object.assign({disabled:!onPress,onPress:onPress,style:[style,{width:width}]},rest,{children:children}));};export default withTheme(Card);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","color","label","onPress","elevation","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedFAB.tsx";import*as React from"react";import{ActivityIndicator,View,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Text from"../components/Text";import Elevation from"../components/Elevation";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var FAB=function FAB(_ref){var Icon=_ref.Icon,icon=_ref.icon,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$type=_ref.type,type=_ref$type===void 0?"solid":_ref$type,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,colorOverride=_ref.color,label=_ref.label,onPress=_ref.onPress,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?0:_ref$elevation,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,disabledOpacity=_ref$theme.disabledOpacity,roundness=_ref$theme.roundness,typography=_ref$theme.typography,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor,borderColor,textColor,borderWidth;var buttonColor=colorOverride||colors.primary;if(type==="standard"||type==="extended"||type==="fixed"){backgroundColor=buttonColor;if(disabled){textColor=color(colors.surface).alpha(disabledOpacity).rgb().string();}else{textColor=colors.surface;}}else{backgroundColor="transparent";if(disabled){textColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{textColor=buttonColor;}}if(type==="outline"){if(disabled){borderColor=color(buttonColor).alpha(disabledOpacity).rgb().string();}else{borderColor=buttonColor;}borderWidth=StyleSheet.hairlineWidth;}else{borderColor="transparent";borderWidth=0;}var buttonStyle={backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,borderRadius:roundness,alignItems:"center",justifyContent:"center"};var buttonStyles=[styles.button,buttonStyle];var contentStyle=[styles.content];var textStyle={textAlign:"center",color:textColor};var iconStyle=[styles.icon,{width:Config.buttonIconSize}];if(type==="standard"||type==="outline"){buttonStyle.width=Config.FABSize;buttonStyle.height=Config.FABSize;buttonStyle.borderRadius=Config.FABBorderRadius;contentStyle.push({width:Config.FABSize,height:Config.FABSize});}if(type==="extended"||type==="fixed"){iconStyle.push({marginLeft:16,marginRight:-8});textStyle.margin=16;}if(type==="fixed"){buttonStyles.push({height:Config.FABFixedHeight,alignSelf:"stretch"});}return _jsx(Elevation,{style:[{elevation:elevation},style],children:_jsx(Pressable,Object.assign({},rest,{onPress:onPress,accessibilityState:{disabled:disabled},accessibilityRole:"button",disabled:disabled||loading,style:buttonStyles,children:_jsxs(View,{style:styles.content,children:[icon&&loading!==true?_jsx(View,{style:iconStyle,children:_jsx(Icon,{name:icon,size:Config.buttonIconSize,color:textColor})}):null,loading?_jsx(ActivityIndicator,{size:"small",color:textColor,style:iconStyle}):null,label?_jsx(Text,{numberOfLines:1,style:[textStyle,typography.button],children:label}):null]})}))});};var styles=StyleSheet.create({button:{borderStyle:"solid"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},icon:{alignItems:"center",justifyContent:"center",width:Config.buttonIconSize},fixed:{left:0,right:0,bottom:0,height:64,borderRadius:0}});export default withTheme(FAB);
|