@draftbit/core 50.1.2-83aab9.2 → 50.1.2-8f069c.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.
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","labelStyle","labelContainerStyle","checkboxStyle","direction","Icon","status","disabled","onPress","onCheck","onUncheck","color","uncheckedColor","defaultValue","checkedIcon","uncheckedIcon","size","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Checkbox/CheckboxRow.tsx";import*as React from"react";import{StyleSheet,View,Platform,Pressable}from"react-native";import{isString}from"lodash";import{extractStyles}from"../../utilities";import{usePrevious}from"../../hooks";import Text from"../Text";import Checkbox from"./Checkbox";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";export var Direction=function(Direction){Direction["Row"]="row";Direction["RowReverse"]="row-reverse";return Direction;}({});var renderLabel=function renderLabel(value,labelStyle,textStyle){if(isString(value)){return _jsx(Text,{style:[textStyle,labelStyle],children:value});}else{return _jsx(_Fragment,{children:value});}};var CheckboxRow=function CheckboxRow(_ref){var _ref$label=_ref.label,label=_ref$label===void 0?"Label":_ref$label,labelStyle=_ref.labelStyle,labelContainerStyle=_ref.labelContainerStyle,checkboxStyle=_ref.checkboxStyle,_ref$direction=_ref.direction,direction=_ref$direction===void 0?Direction.Row:_ref$direction,Icon=_ref.Icon,status=_ref.status,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,onPress=_ref.onPress,onCheck=_ref.onCheck,onUncheck=_ref.onUncheck,color=_ref.color,uncheckedColor=_ref.uncheckedColor,defaultValue=_ref.defaultValue,checkedIcon=_ref.checkedIcon,uncheckedIcon=_ref.uncheckedIcon,size=_ref.size,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(status||defaultValue||false),_React$useState2=_slicedToArray(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];React.useEffect(function(){if(status!=null){setInternalValue(status);}},[status]);var previousDefaultValue=usePrevious(defaultValue);React.useEffect(function(){if(defaultValue!==previousDefaultValue){setInternalValue(Boolean(defaultValue));}},[defaultValue,previousDefaultValue]);var handlePress=function handlePress(){var newValue=!internalValue;setInternalValue(newValue);onPress==null?void 0:onPress(newValue);if(newValue){onCheck==null?void 0:onCheck();}if(!newValue){onUncheck==null?void 0:onUncheck();}};var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsxs(Pressable,Object.assign({onPress:handlePress,style:[viewStyles,styles.mainParent,{flexDirection:direction}],disabled:disabled},rest,{children:[_jsx(View,{style:[styles.label,{alignItems:direction===Direction.Row?"flex-start":"flex-end"},labelContainerStyle],children:renderLabel(label,textStyles,labelStyle)}),_jsx(Checkbox,{Icon:Icon,status:internalValue,style:checkboxStyle,disabled:disabled,onPress:handlePress,color:color,uncheckedColor:uncheckedColor,checkedIcon:checkedIcon,uncheckedIcon:uncheckedIcon,size:size})]}));};var styles=StyleSheet.create({mainParent:Object.assign({alignItems:"center",justifyContent:"space-around",paddingStart:20,minHeight:50,paddingEnd:20,display:"flex"},Platform.select({web:{cursor:"pointer",userSelect:"none"}})),label:{flex:3}});export default CheckboxRow;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","labelStyle","labelContainerStyle","checkboxStyle","direction","Icon","status","disabled","onPress","onCheck","onUncheck","color","uncheckedColor","defaultValue","checkedIcon","uncheckedIcon","size","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Checkbox/CheckboxRow.tsx";import*as React from"react";import{StyleSheet,View,Platform,Pressable}from"react-native";import{isString}from"lodash";import{extractStyles}from"../../utilities";import{usePrevious}from"../../hooks";import Text from"../Text";import Checkbox from"./Checkbox";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";export var Direction=function(Direction){Direction["Row"]="row";Direction["RowReverse"]="row-reverse";return Direction;}({});var renderLabel=function renderLabel(value,labelStyle,textStyle){if(isString(value)){return _jsx(Text,{style:[textStyle,labelStyle],children:value});}else{return _jsx(_Fragment,{children:value});}};var CheckboxRow=function CheckboxRow(_ref){var _ref$label=_ref.label,label=_ref$label===void 0?"Label":_ref$label,labelStyle=_ref.labelStyle,labelContainerStyle=_ref.labelContainerStyle,checkboxStyle=_ref.checkboxStyle,_ref$direction=_ref.direction,direction=_ref$direction===void 0?Direction.Row:_ref$direction,Icon=_ref.Icon,status=_ref.status,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,onPress=_ref.onPress,onCheck=_ref.onCheck,onUncheck=_ref.onUncheck,color=_ref.color,uncheckedColor=_ref.uncheckedColor,defaultValue=_ref.defaultValue,checkedIcon=_ref.checkedIcon,uncheckedIcon=_ref.uncheckedIcon,size=_ref.size,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(status||defaultValue||false),_React$useState2=_slicedToArray(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];React.useEffect(function(){if(status!=null){setInternalValue(status);}},[status]);var previousDefaultValue=usePrevious(defaultValue);React.useEffect(function(){if(defaultValue!==previousDefaultValue){setInternalValue(Boolean(defaultValue));}},[defaultValue,previousDefaultValue]);var handlePress=function handlePress(){var newValue=!internalValue;setInternalValue(newValue);onPress==null?void 0:onPress(newValue);if(newValue){onCheck==null?void 0:onCheck();}if(!newValue){onUncheck==null?void 0:onUncheck();}};var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsxs(Pressable,Object.assign({onPress:handlePress,style:[styles.mainParent,viewStyles,,{flexDirection:direction}],disabled:disabled},rest,{children:[_jsx(View,{style:[styles.label,{alignItems:direction===Direction.Row?"flex-start":"flex-end"},labelContainerStyle],children:renderLabel(label,textStyles,labelStyle)}),_jsx(Checkbox,{Icon:Icon,status:internalValue,style:checkboxStyle,disabled:disabled,onPress:handlePress,color:color,uncheckedColor:uncheckedColor,checkedIcon:checkedIcon,uncheckedIcon:uncheckedIcon,size:size})]}));};var styles=StyleSheet.create({mainParent:Object.assign({alignItems:"center",justifyContent:"space-around",paddingLeft:20,paddingRight:20,minHeight:50,display:"flex"},Platform.select({web:{cursor:"pointer",userSelect:"none"}})),label:{flex:3}});export default CheckboxRow;
@@ -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,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,_ref$iconPosition=_ref.iconPosition,iconPosition=_ref$iconPosition===void 0?"top":_ref$iconPosition,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){var tabFlexDirection;switch(iconPosition){case"top":tabFlexDirection="column";break;case"bottom":tabFlexDirection="column-reverse";break;case"left":tabFlexDirection="row";break;case"right":tabFlexDirection="row-reverse";break;}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],tabStyle:{flexDirection:tabFlexDirection},renderIcon:function renderIcon(_ref2){var route=_ref2.route,color=_ref2.color;return route!=null&&route.icon?_jsx(Icon,{name:route.icon,color:color,size:iconSize}):null;},style:{backgroundColor:tabsBackgroundColor||theme.colors.background}}));};var renderScene=function renderScene(_ref3){var route=_ref3.route;var index=Number(route.key);return children[index];};if(!routes.length){return _jsx(_Fragment,{});}return _jsx(TabView,{style:viewStyles,navigationState:{index:index,routes:routes},renderScene:renderScene,renderTabBar:renderTabBar,onIndexChange:indexChangeHandler,tabBarPosition:tabBarPosition,keyboardDismissMode:keyboardDismissMode,swipeEnabled:swipeEnabled});};export default withTheme(TabViewComponent);
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabView.tsx";import*as React from"react";import{TabView,TabBar}from"react-native-tab-view";import TabViewItem from"./TabViewItem";import{withTheme}from"../../theming";import{flattenReactFragments,extractStyles}from"../../utilities";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";var TabViewComponent=function TabViewComponent(_ref){var Icon=_ref.Icon,onIndexChanged=_ref.onIndexChanged,onEndReached=_ref.onEndReached,_ref$initialTabIndex=_ref.initialTabIndex,initialTabIndex=_ref$initialTabIndex===void 0?0:_ref$initialTabIndex,tabBarPosition=_ref.tabBarPosition,keyboardDismissMode=_ref.keyboardDismissMode,swipeEnabled=_ref.swipeEnabled,scrollEnabled=_ref.scrollEnabled,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,pressColor=_ref.pressColor,indicatorColor=_ref.indicatorColor,tabsBackgroundColor=_ref.tabsBackgroundColor,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?16:_ref$iconSize,style=_ref.style,theme=_ref.theme,childrenProp=_ref.children;var _React$useState=React.useState(initialTabIndex),_React$useState2=_slicedToArray(_React$useState,2),index=_React$useState2[0],setIndex=_React$useState2[1];var _React$useState3=React.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),routes=_React$useState4[0],setRoutes=_React$useState4[1];var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp)).filter(function(child){return React.isValidElement(child)&&child.type===TabViewItem;});},[childrenProp]);React.useEffect(function(){var newRoutes=[];children.forEach(function(item,idx){var child=item;newRoutes.push({key:idx.toString(),title:child.props.title,icon:child.props.icon,accessibilityLabel:child.props.accessibilityLabel});});setRoutes(newRoutes);},[children]);var indexChangeHandler=function indexChangeHandler(i){setIndex(i);onIndexChanged==null?void 0:onIndexChanged(i);if(i===routes.length){onEndReached==null?void 0:onEndReached();}};var renderTabBar=function renderTabBar(props){return _jsx(TabBar,Object.assign({},props,{activeColor:activeColor||theme.colors.primary,inactiveColor:inactiveColor||"rgb(200,200,200)",pressColor:pressColor||theme.colors.primary,scrollEnabled:scrollEnabled,indicatorStyle:{backgroundColor:indicatorColor||theme.colors.primary},labelStyle:[{textTransform:"none"},textStyles],renderIcon:function renderIcon(_ref2){var route=_ref2.route,color=_ref2.color;return route!=null&&route.icon?_jsx(Icon,{name:route.icon,color:color,size:iconSize}):null;},style:{backgroundColor:tabsBackgroundColor||theme.colors.background}}));};var renderScene=function renderScene(_ref3){var route=_ref3.route;var index=Number(route.key);return children[index];};if(!routes.length){return _jsx(_Fragment,{});}return _jsx(TabView,{style:viewStyles,navigationState:{index:index,routes:routes},renderScene:renderScene,renderTabBar:renderTabBar,onIndexChange:indexChangeHandler,tabBarPosition:tabBarPosition,keyboardDismissMode:keyboardDismissMode,swipeEnabled:swipeEnabled});};export default withTheme(TabViewComponent);
@@ -45,7 +45,7 @@ const CheckboxRow = ({ label = "Label", labelStyle, labelContainerStyle, checkbo
45
45
  }
46
46
  };
47
47
  const { textStyles, viewStyles } = extractStyles(style);
48
- return (React.createElement(Pressable, { onPress: handlePress, style: [viewStyles, styles.mainParent, { flexDirection: direction }], disabled: disabled, ...rest },
48
+ return (React.createElement(Pressable, { onPress: handlePress, style: [styles.mainParent, viewStyles, , { flexDirection: direction }], disabled: disabled, ...rest },
49
49
  React.createElement(View, { style: [
50
50
  styles.label,
51
51
  {
@@ -59,9 +59,9 @@ const styles = StyleSheet.create({
59
59
  mainParent: {
60
60
  alignItems: "center",
61
61
  justifyContent: "space-around",
62
- paddingStart: 20,
62
+ paddingLeft: 20,
63
+ paddingRight: 20,
63
64
  minHeight: 50,
64
- paddingEnd: 20,
65
65
  display: "flex",
66
66
  ...Platform.select({
67
67
  web: {
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxRow.js","sourceRoot":"","s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ACZ,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,IAAI,GACV,CACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,MAAM;QACf,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,MAAM,EAAE,SAAS;gBACjB,UAAU,EAAE,MAAM;aACnB;SACF,CAAC;KACH;IACD,KAAK,EAAE;QACL,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -4,7 +4,6 @@ import type { IconSlot } from "../../interfaces/Icon";
4
4
  import type { Theme } from "../../styles/DefaultTheme";
5
5
  declare type TabBarPosition = "top" | "bottom";
6
6
  declare type KeyboardDismissMode = "none" | "auto" | "on-drag";
7
- declare type IconPosition = "top" | "bottom" | "left" | "right";
8
7
  declare type TabViewProps = {
9
8
  onIndexChanged?: (index: number) => void;
10
9
  onEndReached?: () => void;
@@ -19,7 +18,6 @@ declare type TabViewProps = {
19
18
  indicatorColor?: string;
20
19
  tabsBackgroundColor?: string;
21
20
  iconSize?: number;
22
- iconPosition?: IconPosition;
23
21
  style?: StyleProp<ViewStyle | TextStyle>;
24
22
  theme: Theme;
25
23
  } & IconSlot;
@@ -3,7 +3,7 @@ import { TabView, TabBar, } from "react-native-tab-view";
3
3
  import TabViewItem from "./TabViewItem";
4
4
  import { withTheme } from "../../theming";
5
5
  import { flattenReactFragments, extractStyles } from "../../utilities";
6
- const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, initialTabIndex = 0, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, tabsBackgroundColor, iconSize = 16, iconPosition = "top", style, theme, children: childrenProp, }) => {
6
+ const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, initialTabIndex = 0, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, tabsBackgroundColor, iconSize = 16, style, theme, children: childrenProp, }) => {
7
7
  const [index, setIndex] = React.useState(initialTabIndex);
8
8
  const [routes, setRoutes] = React.useState([]);
9
9
  const { textStyles, viewStyles } = extractStyles(style);
@@ -30,24 +30,9 @@ const TabViewComponent = ({ Icon, onIndexChanged, onEndReached, initialTabIndex
30
30
  }
31
31
  };
32
32
  const renderTabBar = (props) => {
33
- let tabFlexDirection;
34
- switch (iconPosition) {
35
- case "top":
36
- tabFlexDirection = "column";
37
- break;
38
- case "bottom":
39
- tabFlexDirection = "column-reverse";
40
- break;
41
- case "left":
42
- tabFlexDirection = "row";
43
- break;
44
- case "right":
45
- tabFlexDirection = "row-reverse";
46
- break;
47
- }
48
33
  return (React.createElement(TabBar, { ...props, activeColor: activeColor || theme.colors.primary, inactiveColor: inactiveColor || "rgb(200,200,200)", pressColor: pressColor || theme.colors.primary, scrollEnabled: scrollEnabled, indicatorStyle: {
49
34
  backgroundColor: indicatorColor || theme.colors.primary,
50
- }, labelStyle: [{ textTransform: "none" }, textStyles], tabStyle: { flexDirection: tabFlexDirection }, renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: iconSize })) : null, style: {
35
+ }, labelStyle: [{ textTransform: "none" }, textStyles], renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: iconSize })) : null, style: {
51
36
  backgroundColor: tabsBackgroundColor || theme.colors.background,
52
37
  } }));
53
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TabView.js","sourceRoot":"","sources":["../../../../../src/components/T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