@draftbit/core 48.10.2-935166.2 → 48.10.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
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=Pressable;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Pressable.tsx";var _excluded=["children","disabled","onPress","activeOpacity","disabledOpacity","delayLongPress","hitSlop","style"];function Pressable(_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=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_reactNative.Pressable,Object.assign({onPress:onPress,disabled:disabled,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
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=Pressable;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Pressable.tsx";var _excluded=["children","disabled","onPress","activeOpacity","disabledOpacity","delayLongPress","hitSlop","androidRippleColor","androidRippleBorderless","androidRippleRadius","androidRippleForeground","style"];function Pressable(_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,androidRippleColor=_ref.androidRippleColor,androidRippleBorderless=_ref.androidRippleBorderless,androidRippleRadius=_ref.androidRippleRadius,androidRippleForeground=_ref.androidRippleForeground,_style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_reactNative.Pressable,Object.assign({onPress:onPress,disabled:disabled,delayLongPress:delayLongPress?delayLongPress:500,hitSlop:hitSlop?hitSlop:8,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?activeOpacity:disabled?disabledOpacity:1},_style];},android_ripple:androidRippleColor||androidRippleBorderless||androidRippleColor||androidRippleForeground?{radius:androidRippleRadius,borderless:androidRippleBorderless,color:androidRippleColor,foreground:androidRippleForeground}:null},props,{children:children}));}
@@ -4,6 +4,10 @@ declare type Props = {
4
4
  style?: ViewStyle;
5
5
  activeOpacity?: number;
6
6
  disabledOpacity?: number;
7
- } & PressableProps;
8
- export default function Pressable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, style, ...props }: Props): JSX.Element;
7
+ androidRippleColor?: string;
8
+ androidRippleBorderless?: boolean;
9
+ androidRippleRadius?: number;
10
+ androidRippleForeground?: boolean;
11
+ } & Omit<PressableProps, "android_ripple ">;
12
+ export default function Pressable({ children, disabled, onPress, activeOpacity, disabledOpacity, delayLongPress, hitSlop, androidRippleColor, androidRippleBorderless, androidRippleRadius, androidRippleForeground, style, ...props }: Props): JSX.Element;
9
13
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { Pressable as NativePressable, } from "react-native";
3
- export default function Pressable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, style, ...props }) {
3
+ export default function Pressable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, androidRippleColor, androidRippleBorderless, androidRippleRadius, androidRippleForeground, style, ...props }) {
4
4
  return (React.createElement(NativePressable, { onPress: onPress, disabled: disabled, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: ({ pressed }) => {
5
5
  return [
6
6
  {
@@ -8,6 +8,16 @@ export default function Pressable({ children, disabled, onPress, activeOpacity =
8
8
  },
9
9
  style,
10
10
  ];
11
- }, ...props }, children));
11
+ }, android_ripple: androidRippleColor ||
12
+ androidRippleBorderless ||
13
+ androidRippleColor ||
14
+ androidRippleForeground
15
+ ? {
16
+ radius: androidRippleRadius,
17
+ borderless: androidRippleBorderless,
18
+ color: androidRippleColor,
19
+ foreground: androidRippleForeground,
20
+ }
21
+ : null, ...props }, children));
12
22
  }
13
23
  //# sourceMappingURL=Pressable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pressable.js","sourceRoot":"","sources":["../../../../src/components/Pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,SAAS,IAAI,eAAe,GAG7B,MAAM,cAAc,CAAC;AAQtB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,GAAG,GAAG,EACnB,eAAe,GAAG,GAAG,EACrB,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACF;IACN,OAAO,CACL,oBAAC,eAAe,IACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,cAAc,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AAK;aACN,CAAC;QACJ,CAAC,EACD,cAAc,EACZ,kBAAkB;YAClB,uBAAuB;YACvB,kBAAkB;YAClB,uBAAuB;YACrB,CAAC,CAAC;gBACE,MAAM,EAAE,mBAAmB;gBAC3B,UAAU,EAAE,uBAAuB;gBACnC,KAAK,EAAE,kBAAkB;gBACzB,UAAU,EAAE,uBAAuB;aACpC;YACH,CAAC,CAAC,IAAI,KAEN,KAAK,IAER,QAAQ,CACO,CACnB,CAAC;AACJ,CAAC"}