@reillymc/react-native-components 0.12.4 → 0.12.5
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/actions/swipeAction/SwipeAction.js +1 -1
- package/lib/actions/swipeAction/SwipeAction.theme.js +1 -1
- package/lib/display/listItem/ListItem.js +1 -1
- package/lib/display/listItem/ListItem.theme.js +1 -1
- package/lib/layout/swipeable/SwipeableContainer.js +1 -1
- package/lib/types/actions/swipeAction/SwipeAction.d.ts +1 -0
- package/lib/types/actions/swipeAction/SwipeAction.d.ts.map +1 -1
- package/lib/types/actions/swipeAction/SwipeAction.theme.d.ts.map +1 -1
- package/lib/types/display/listItem/ListItem.d.ts +9 -5
- package/lib/types/display/listItem/ListItem.d.ts.map +1 -1
- package/lib/types/display/listItem/ListItem.theme.d.ts.map +1 -1
- package/lib/types/layout/swipeable/SwipeableContainer.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{defineStyles,useComponent}from"../../internal";import{IconButton}from"../button";import{jsx as _jsx}from"react/jsx-runtime";export var SwipeAction=props=>{var $=_c(4);var t0;if($[0]===Symbol.for("react.memo_cache_sentinel")){t0={createStyles};$[0]=t0;}else{t0=$[0];}var _useComponent=useComponent("swipeAction",t0),styles=_useComponent.styles;var t1;if($[1]!==props||$[2]!==styles.actionButton){t1=_jsx(IconButton,{...props,appearance:"prominent",style:styles.actionButton});$[1]=props;$[2]=styles.actionButton;$[3]=t1;}else{t1=$[3];}return t1;};var createStyles=defineStyles(theme=>({actionButton:{height:"100%",alignItems:"center",justifyContent:"center",borderRadius:
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{defineStyles,useComponent}from"../../internal";import{IconButton}from"../button";import{jsx as _jsx}from"react/jsx-runtime";export var SwipeAction=props=>{var $=_c(4);var t0;if($[0]===Symbol.for("react.memo_cache_sentinel")){t0={createStyles};$[0]=t0;}else{t0=$[0];}var _useComponent=useComponent("swipeAction",t0),styles=_useComponent.styles;var t1;if($[1]!==props||$[2]!==styles.actionButton){t1=_jsx(IconButton,{...props,appearance:"prominent",style:styles.actionButton});$[1]=props;$[2]=styles.actionButton;$[3]=t1;}else{t1=$[3];}return t1;};var createStyles=defineStyles(theme=>({actionButton:{height:"100%",alignItems:"center",justifyContent:"center",borderRadius:theme.borderRadius,width:theme.width}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultSwipeActionTheme=()=>({width:
|
|
1
|
+
export var defaultSwipeActionTheme=({palette})=>({width:60,borderRadius:palette.border.radius.loose});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{View}from"react-native";import{Undefined}from"@reillymc/es-utils";import{ActionBase}from"../../actions/action";import{defineStyles,useComponent}from"../../internal";import{SwipeableContainer}from"../../layout/swipeable";import{Text}from"../../typography/text";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export var ListItem=t0=>{var $=_c(
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{View}from"react-native";import{Undefined}from"@reillymc/es-utils";import{ActionBase}from"../../actions/action";import{defineStyles,useComponent}from"../../internal";import{SwipeableContainer}from"../../layout/swipeable";import{Text}from"../../typography/text";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export var ListItem=t0=>{var $=_c(46);var avatar=t0.avatar,alert=t0.alert,heading=t0.heading,footer=t0.footer,header=t0.header,t1=t0.variant,content=t0.content,swipeActions=t0.swipeActions,style=t0.style,themeOverrides=t0.theme,contentContainerStyle=t0.contentContainerStyle,onPress=t0.onPress;var variant=t1===undefined?"default":t1;var t2;if($[0]!==swipeActions){t2=swipeActions?.filter(Undefined);$[0]=swipeActions;$[1]=t2;}else{t2=$[1];}var filteredActions=t2;var t3;if($[2]!==variant){t3={variant};$[2]=variant;$[3]=t3;}else{t3=$[3];}var t4;if($[4]!==t3||$[5]!==themeOverrides){t4={themeOverrides,props:t3,createStyles};$[4]=t3;$[5]=themeOverrides;$[6]=t4;}else{t4=$[6];}var _useComponent=useComponent("listItem",t4),styles=_useComponent.styles,theme=_useComponent.theme;var t5;if($[7]!==avatar||$[8]!==styles.avatar){t5=!!avatar&&_jsx(View,{style:styles.avatar,children:avatar});$[7]=avatar;$[8]=styles.avatar;$[9]=t5;}else{t5=$[9];}var t6;if($[10]!==contentContainerStyle||$[11]!==styles.contentContainer){t6=[styles.contentContainer,contentContainerStyle];$[10]=contentContainerStyle;$[11]=styles.contentContainer;$[12]=t6;}else{t6=$[12];}var t7;if($[13]!==heading||$[14]!==theme){t7=!!heading&&typeof heading==="string"?_jsx(Text,{variant:"heading",numberOfLines:2,theme:{color:theme.textColor},children:heading}):heading;$[13]=heading;$[14]=theme;$[15]=t7;}else{t7=$[15];}var t8;if($[16]!==content||$[17]!==t6||$[18]!==t7){t8=_jsxs(View,{style:t6,children:[t7,content]});$[16]=content;$[17]=t6;$[18]=t7;$[19]=t8;}else{t8=$[19];}var t9;if($[20]!==styles.innerContainer||$[21]!==t5||$[22]!==t8){t9=_jsxs(View,{style:styles.innerContainer,children:[t5,t8]});$[20]=styles.innerContainer;$[21]=t5;$[22]=t8;$[23]=t9;}else{t9=$[23];}var t10;if($[24]!==alert||$[25]!==styles.alert){t10=!!alert&&_jsx(View,{style:styles.alert,children:alert});$[24]=alert;$[25]=styles.alert;$[26]=t10;}else{t10=$[26];}var t11;if($[27]!==styles.bodyContainer||$[28]!==t10||$[29]!==t9){t11=_jsxs(View,{style:styles.bodyContainer,children:[t9,t10]});$[27]=styles.bodyContainer;$[28]=t10;$[29]=t9;$[30]=t11;}else{t11=$[30];}var t12;if($[31]!==footer||$[32]!==header||$[33]!==t11){t12=_jsxs(_Fragment,{children:[header,t11,footer]});$[31]=footer;$[32]=header;$[33]=t11;$[34]=t12;}else{t12=$[34];}var listContent=t12;var t13;if($[35]!==listContent||$[36]!==onPress||$[37]!==style||$[38]!==styles.pressableContainer){t13=onPress?_jsx(ActionBase,{hitSlop:0,onPress:onPress,style:[styles.pressableContainer,style],children:listContent}):_jsx(View,{style:[styles.pressableContainer,style],children:listContent});$[35]=listContent;$[36]=onPress;$[37]=style;$[38]=styles.pressableContainer;$[39]=t13;}else{t13=$[39];}var innerContent=t13;var t14;if($[40]!==filteredActions||$[41]!==innerContent){t14=filteredActions?.length?_jsx(SwipeableContainer,{rightActions:filteredActions,children:_jsx(View,{children:innerContent})}):innerContent;$[40]=filteredActions;$[41]=innerContent;$[42]=t14;}else{t14=$[42];}var t15;if($[43]!==styles.container||$[44]!==t14){t15=_jsx(View,{style:styles.container,children:t14});$[43]=styles.container;$[44]=t14;$[45]=t15;}else{t15=$[45];}return t15;};var createStyles=defineStyles((theme,props)=>({container:{overflow:"hidden",width:"100%"},pressableContainer:{display:"flex",flexDirection:"column",backgroundColor:theme.surface.backgroundColor,borderRadius:props.variant==="compact"?0:theme.surface.borderRadius,paddingTop:theme.surface.paddingTop,paddingBottom:theme.surface.paddingBottom,paddingStart:theme.surface.paddingStart,paddingEnd:theme.surface.paddingEnd,gap:theme.internalGap},bodyContainer:{flexDirection:"row",justifyContent:"space-between",gap:theme.internalGap},innerContainer:{flexDirection:"row",flexShrink:1,gap:theme.internalGap},avatar:{alignItems:"center",justifyContent:"center"},contentContainer:{flexShrink:1,flexDirection:"column",alignItems:"flex-start",justifyContent:"center",width:"100%"},alert:{alignItems:"center",justifyContent:"center"}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var defaultListItemTheme=({palette:{border,color}})=>({
|
|
1
|
+
export var defaultListItemTheme=({palette:{border,color,spacing}})=>({surface:{backgroundColor:color.surface,borderRadius:border.radius.loose,paddingTop:spacing.medium,paddingBottom:spacing.medium,paddingStart:spacing.medium,paddingEnd:spacing.medium},internalGap:spacing.medium,textColor:color.surfaceForeground});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _c}from"react/compiler-runtime";import{Children,useRef}from"react";import{StyleSheet,View}from"react-native";import Swipeable from"react-native-gesture-handler/ReanimatedSwipeable";import{jsx as _jsx}from"react/jsx-runtime";var EMPTY_ACTIONS=[];export var SwipeableContainer=t0=>{var $=_c(
|
|
1
|
+
import{c as _c}from"react/compiler-runtime";import{Children,useRef}from"react";import{StyleSheet,View}from"react-native";import Swipeable from"react-native-gesture-handler/ReanimatedSwipeable";import{jsx as _jsx}from"react/jsx-runtime";var EMPTY_ACTIONS=[];export var SwipeableContainer=t0=>{var $=_c(10);var t1=t0.rightActions,style=t0.style,children=t0.children;var rightActions=t1===undefined?EMPTY_ACTIONS:t1;var swipeableRef=useRef(null);var t2;if($[0]===Symbol.for("react.memo_cache_sentinel")){t2=()=>{swipeableRef.current?.close();};$[0]=t2;}else{t2=$[0];}var close=t2;var t3;if($[1]!==rightActions){t3=()=>_jsx(View,{style:styles.actionsContainer,children:Children.map(rightActions,action=>_jsx(View,{onTouchEnd:close,children:action}))});$[1]=rightActions;$[2]=t3;}else{t3=$[2];}var renderRightActions=t3;if(rightActions.length===0){var _t;if($[3]!==children||$[4]!==style){_t=_jsx(View,{style:style,children:children});$[3]=children;$[4]=style;$[5]=_t;}else{_t=$[5];}return _t;}var t4;if($[6]!==children||$[7]!==renderRightActions||$[8]!==style){t4=_jsx(Swipeable,{ref:swipeableRef,renderRightActions:renderRightActions,enableTrackpadTwoFingerGesture:true,friction:1.5,overshootRight:false,containerStyle:style,children:children});$[6]=children;$[7]=renderRightActions;$[8]=style;$[9]=t4;}else{t4=$[9];}return t4;};var styles=StyleSheet.create({actionsContainer:{display:"flex",flexDirection:"row-reverse",gap:8,marginLeft:8}});
|
|
@@ -2,6 +2,7 @@ import type { IconComponentProps } from "../../icons/IconComponentProps";
|
|
|
2
2
|
import { type IconButtonProps } from "../button";
|
|
3
3
|
export type SwipeActionTheme = {
|
|
4
4
|
width: number;
|
|
5
|
+
borderRadius: number;
|
|
5
6
|
};
|
|
6
7
|
export interface SwipeActionProps extends Pick<IconButtonProps, "onPress" | "variant"> {
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeAction.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/SwipeAction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"SwipeAction.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/SwipeAction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,gBACb,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,SAAS,CAAC;CAAG;AAE3D,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,EACxC,OAAO,gBAAgB,GAAG,kBAAkB,CAAC,CAAC,CAAC,gCAUlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeAction.theme.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/SwipeAction.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"SwipeAction.theme.d.ts","sourceRoot":"","sources":["../../../../src/actions/swipeAction/SwipeAction.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,aAAa,CAK9D,CAAC"}
|
|
@@ -4,11 +4,15 @@ import { type DeepPartial } from "@reillymc/es-utils";
|
|
|
4
4
|
import { type SwipeableContainerProps } from "../../layout/swipeable";
|
|
5
5
|
type ListItemVariant = "default" | "compact";
|
|
6
6
|
export interface ListItemTheme {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
surface: {
|
|
8
|
+
backgroundColor: ColorValue;
|
|
9
|
+
borderRadius: number;
|
|
10
|
+
paddingTop: number;
|
|
11
|
+
paddingBottom: number;
|
|
12
|
+
paddingStart: number;
|
|
13
|
+
paddingEnd: number;
|
|
14
|
+
};
|
|
15
|
+
internalGap: number;
|
|
12
16
|
textColor: ColorValue;
|
|
13
17
|
}
|
|
14
18
|
export interface ListItemProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/display/listItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EACH,KAAK,UAAU,EACf,KAAK,SAAS,EAEd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,oBAAoB,CAAC;AAIjE,OAAO,EAEH,KAAK,uBAAuB,EAC/B,MAAM,wBAAwB,CAAC;AAGhC,KAAK,eAAe,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC1B,
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/display/listItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EACH,KAAK,UAAU,EACf,KAAK,SAAS,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me.d.ts","sourceRoot":"","sources":["../../../../src/display/listItem/ListItem.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"ListItem.theme.d.ts","sourceRoot":"","sources":["../../../../src/display/listItem/ListItem.theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,UAAU,CAaxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeableContainer.d.ts","sourceRoot":"","sources":["../../../../src/layout/swipeable/SwipeableContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAEjB,MAAM,OAAO,CAAC;AACf,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKhE,MAAM,WAAW,uBAAuB;IACpC;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAID,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"SwipeableContainer.d.ts","sourceRoot":"","sources":["../../../../src/layout/swipeable/SwipeableContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAEjB,MAAM,OAAO,CAAC;AACf,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKhE,MAAM,WAAW,uBAAuB;IACpC;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAID,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,CAmCzE,CAAC"}
|