@draftbit/core 48.4.6-f29495.2 → 48.4.6
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/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +3 -2
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js +3 -3
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/BottomSheet/BottomSheet.js +3 -3
- package/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/src/components/BottomSheet/BottomSheet.tsx +90 -81
|
@@ -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 _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _BottomSheetComponent=_interopRequireDefault(require("./BottomSheetComponent"));var _theming=require("../../theming");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["theme","snapPoints","topSnapPosition","middleSnapPosition","bottomSnapPosition","initialSnapIndex","initialSnapPosition","showHandle","handleColor","topBorderRadius","borderWidth","borderColor","onSettle","style","children"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/BottomSheet/BottomSheet.tsx";var BottomSheet=function
|
|
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 _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _BottomSheetComponent=_interopRequireDefault(require("./BottomSheetComponent"));var _theming=require("../../theming");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["theme","snapPoints","topSnapPosition","middleSnapPosition","bottomSnapPosition","initialSnapIndex","initialSnapPosition","showHandle","handleColor","topBorderRadius","borderWidth","borderColor","onSettle","style","children"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/BottomSheet/BottomSheet.tsx";var BottomSheet=_react.default.forwardRef(function(_ref,ref){var theme=_ref.theme,snapPointsProp=_ref.snapPoints,_ref$topSnapPosition=_ref.topSnapPosition,topSnapPosition=_ref$topSnapPosition===void 0?"10%":_ref$topSnapPosition,_ref$middleSnapPositi=_ref.middleSnapPosition,middleSnapPosition=_ref$middleSnapPositi===void 0?"50%":_ref$middleSnapPositi,_ref$bottomSnapPositi=_ref.bottomSnapPosition,bottomSnapPosition=_ref$bottomSnapPositi===void 0?"80%":_ref$bottomSnapPositi,initialSnapIndex=_ref.initialSnapIndex,_ref$initialSnapPosit=_ref.initialSnapPosition,initialSnapPosition=_ref$initialSnapPosit===void 0?"bottom":_ref$initialSnapPosit,_ref$showHandle=_ref.showHandle,showHandle=_ref$showHandle===void 0?true:_ref$showHandle,_ref$handleColor=_ref.handleColor,handleColor=_ref$handleColor===void 0?theme.colors.divider:_ref$handleColor,_ref$topBorderRadius=_ref.topBorderRadius,topBorderRadius=_ref$topBorderRadius===void 0?20:_ref$topBorderRadius,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,_ref$borderColor=_ref.borderColor,borderColor=_ref$borderColor===void 0?theme.colors.divider:_ref$borderColor,onSettle=_ref.onSettle,style=_ref.style,children=_ref.children,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var backgroundColor=(style==null?void 0:style.backgroundColor)||theme.colors.background;var snapPoints=snapPointsProp||[topSnapPosition,middleSnapPosition,bottomSnapPosition];var getSnapIndexFromPosition=function getSnapIndexFromPosition(position){switch(position){case"top":return 0;case"middle":return 1;case"bottom":return 2;}};return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.parentContainer,pointerEvents:"box-none",children:(0,_jsxRuntime.jsx)(_BottomSheetComponent.default,Object.assign({ref:ref,componentType:"ScrollView",snapPoints:snapPoints,initialSnapIndex:initialSnapIndex!=null?initialSnapIndex:getSnapIndexFromPosition(initialSnapPosition),renderHandle:function renderHandle(){return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:showHandle&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.handleContainer,{backgroundColor:backgroundColor,borderTopLeftRadius:topBorderRadius,borderTopRightRadius:topBorderRadius}],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.handle,{backgroundColor:handleColor}]})})});},contentContainerStyle:[styles.contentContainerStyle,style],containerStyle:_reactNative.StyleSheet.flatten([styles.containerStyle,{backgroundColor:backgroundColor,borderTopLeftRadius:topBorderRadius,borderTopRightRadius:topBorderRadius,borderWidth:borderWidth,borderColor:borderColor}]),onSettle:onSettle},rest,{children:children}))});});var styles=_reactNative.StyleSheet.create({parentContainer:{position:"absolute",left:0,right:0,top:0,bottom:0,zIndex:10,overflow:"hidden"},contentContainerStyle:{paddingHorizontal:16,paddingVertical:10},containerStyle:{flex:1,overflow:"hidden"},handleContainer:{alignItems:"center",paddingVertical:20},handle:{width:40,height:2,borderRadius:4}});var _default=(0,_theming.withTheme)(BottomSheet);exports.default=_default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, ScrollViewProps } from "react-native";
|
|
3
|
+
import BottomSheetComponent from "./BottomSheetComponent";
|
|
3
4
|
import type { Theme } from "../../styles/DefaultTheme";
|
|
4
5
|
declare type SnapPosition = "top" | "middle" | "bottom";
|
|
5
6
|
export interface BottomSheetProps extends ScrollViewProps {
|
|
@@ -21,7 +22,7 @@ export interface BottomSheetProps extends ScrollViewProps {
|
|
|
21
22
|
style?: StyleProp<ViewStyle>;
|
|
22
23
|
theme: Theme;
|
|
23
24
|
}
|
|
24
|
-
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.
|
|
25
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<BottomSheetProps & React.RefAttributes<BottomSheetComponent<any>>, "theme"> & {
|
|
25
26
|
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
26
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.
|
|
27
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<BottomSheetProps & React.RefAttributes<BottomSheetComponent<any>>> & React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<BottomSheetComponent<any>>>, {}>;
|
|
27
28
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { StyleSheet, View, } from "react-native";
|
|
3
3
|
import BottomSheetComponent from "./BottomSheetComponent";
|
|
4
4
|
import { withTheme } from "../../theming";
|
|
5
|
-
const BottomSheet = ({ theme, snapPoints: snapPointsProp, topSnapPosition = "10%", middleSnapPosition = "50%", bottomSnapPosition = "80%", initialSnapIndex, initialSnapPosition = "bottom", showHandle = true, handleColor = theme.colors.divider, topBorderRadius = 20, borderWidth = 1, borderColor = theme.colors.divider, onSettle, style, children, ...rest }) => {
|
|
5
|
+
const BottomSheet = React.forwardRef(({ theme, snapPoints: snapPointsProp, topSnapPosition = "10%", middleSnapPosition = "50%", bottomSnapPosition = "80%", initialSnapIndex, initialSnapPosition = "bottom", showHandle = true, handleColor = theme.colors.divider, topBorderRadius = 20, borderWidth = 1, borderColor = theme.colors.divider, onSettle, style, children, ...rest }, ref) => {
|
|
6
6
|
const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
|
|
7
7
|
const snapPoints = snapPointsProp || [
|
|
8
8
|
topSnapPosition,
|
|
@@ -20,7 +20,7 @@ const BottomSheet = ({ theme, snapPoints: snapPointsProp, topSnapPosition = "10%
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
return (React.createElement(View, { style: styles.parentContainer, pointerEvents: "box-none" },
|
|
23
|
-
React.createElement(BottomSheetComponent, { componentType: "ScrollView", snapPoints: snapPoints, initialSnapIndex: initialSnapIndex !== null && initialSnapIndex !== void 0 ? initialSnapIndex : getSnapIndexFromPosition(initialSnapPosition), renderHandle: () => (React.createElement(React.Fragment, null, showHandle && (React.createElement(View, { style: [
|
|
23
|
+
React.createElement(BottomSheetComponent, { ref: ref, componentType: "ScrollView", snapPoints: snapPoints, initialSnapIndex: initialSnapIndex !== null && initialSnapIndex !== void 0 ? initialSnapIndex : getSnapIndexFromPosition(initialSnapPosition), renderHandle: () => (React.createElement(React.Fragment, null, showHandle && (React.createElement(View, { style: [
|
|
24
24
|
styles.handleContainer,
|
|
25
25
|
{
|
|
26
26
|
backgroundColor,
|
|
@@ -38,7 +38,7 @@ const BottomSheet = ({ theme, snapPoints: snapPointsProp, topSnapPosition = "10%
|
|
|
38
38
|
borderColor,
|
|
39
39
|
},
|
|
40
40
|
]), onSettle: onSettle, ...rest }, children)));
|
|
41
|
-
};
|
|
41
|
+
});
|
|
42
42
|
const styles = StyleSheet.create({
|
|
43
43
|
//Render on top of everything
|
|
44
44
|
parentContainer: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.js","sourceRoot":"","sources":["../../../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,IAAI,GAIL,MAAM,cAAc,CAAC;AAEtB,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAuB1C,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"BottomSheet.js","sourceRoot":"","sources":["../../../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAA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