Skip to content

a components - api docs #1642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/components/actionBar/actionBar.api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "ActionBar",
"category": "basic",
"description": "Quick actions bar, each action support Button component props",
"extends": ["View"],
"extendsLink": ["https://github.com/wix/react-native-ui-lib/blob/master/src/components/view/index.tsx"],
"modifiers": ["margin", "padding"],
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ActionBarScreen.tsx",
"images": ["https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/ActionBar/ActionBar.gif?raw=true"],
"props": [
{"name": "actions", "type": "ButtonProps[]", "description": "The actions for the action bar", "required": true},
{"name": "height", "type": "number", "description": "Height", "default": "48"},
{"name": "backgroundColor", "type": "string", "description": "Background color", "default": "Colors.white"},
{"name": "centered", "type": "boolean", "description": "Should action be equally centered"},
{
"name": "keepRelative",
"type": "boolean",
"description": "Keep the action bar position relative instead of it absolute position"
},
{
"name": "useSafeArea",
"type": "boolean",
"description": "In iOS, use safe area, in case component attached to the bottom",
"default": "true"
},
{"name": "style", "type": "ViewStyle", "description": "Component's style"}
]
}
75 changes: 75 additions & 0 deletions src/components/actionSheet/actionSheet.api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"name": "ActionSheet",
"category": "overlays",
"description": "Cross platform Action Sheet, with a support for native iOS solutions",
"extends": ["Dialog"],
"extendsLink": ["https://github.com/wix/react-native-ui-lib/blob/master/src/components/dialog/index.tsx"],
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/ActionSheetScreen.tsx",
"images": ["https://media.giphy.com/media/l0HUpXOR6RqB2ct5S/giphy.gif"],
"props": [
{"name": "visible", "type": "boolean", "description": "Whether to show the action sheet or not"},
{
"name": "title",
"type": "string",
"description": "Title of the action sheet",
"note": "If both 'title' and 'message' are not passed will not render the title view at all"
},
{"name": "message", "type": "string", "description": "Message of the action sheet"},
{
"name": "cancelButtonIndex",
"type": "number",
"description": "Index of the option represents the cancel action (to be displayed as the separated bottom bold button)"
},
{
"name": "destructiveButtonIndex",
"type": "number",
"description": "Index of the option represents the destructive action (will display red text. Usually used for delete or abort actions)"
},
{
"name": "options",
"type": "Array<ButtonProps>",
"description": "List of options for the action sheet, follows the Button prop types (supply 'label' string and 'onPress' function)"
},
{
"name": "onDismiss",
"type": "DialogProps['onDismiss']",
"description": "Called when dismissing the action sheet (usually used for setting 'visible' prop to false)"
},
{
"name": "onModalDismissed",
"type": "DialogProps['onDialogDismissed']",
"description": "Called once the modal has been dismissed",
"note": "iOS only, modal only"
},
{"name": "useNativeIOS", "type": "boolean", "description": "Should use the native action sheet for iOS"},
{
"name": "showCancelButton",
"type": "boolean",
"description": "When passed (only with useNativeIOS), will display a cancel button at the bottom (overrides cancelButtonIndex)"
},
{
"name": "containerStyle",
"type": "ViewStyle",
"description": "Add or override style of the action sheet (wraps the title and actions)"
},
{
"name": "dialogStyle",
"type": "ViewStyle",
"description": "Add or override style of the dialog wrapping the action sheet"
},
{"name": "optionsStyle", "type": "ViewStyle", "description": "Add or override style of the options list"},
{"name": "renderTitle", "type": "() => JSX.Element", "description": "Render custom title"},
{
"name": "renderAction",
"type": "\n(\noption: ButtonProps, \nindex: number, \nonOptionPress: ActionSheetOnOptionPress\n) => JSX.Element",
"description": "Render custom action",
"note": "You will need to call 'onOptionPress' so the option's 'onPress' will be called"
},
{
"name": "useSafeArea",
"type": "boolean",
"description": "In iOS, use safe area, in case component attached to the bottom"
},
{"name": "testID", "type": "string", "description": "The test id for e2e tests"}
]
}
19 changes: 19 additions & 0 deletions src/components/animatedImage/animatedImage.api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "AnimatedImage",
"category": "basic",
"description": "Image component that fades-in the image with animation once it's loaded",
"extends": ["Image"],
"extendsLink": ["https://github.com/wix/react-native-ui-lib/blob/master/src/components/image/index.tsx"],
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/AnimatedImageScreen.js",
"images": ["https://media.giphy.com/media/l0HU7jj0ivEFyZIA0/giphy.gif"],
"props": [
{
"name": "animationDuration",
"type": "number",
"description": "Duration for the fade animation when the image is loaded",
"default": "300"
},
{"name": "loader", "type": "JSX.element", "description": "A component to render while the image is loading"},
{"name": "containerStyle", "type": "ViewStyle", "description": "Additional spacing styles for the container"}
]
}
23 changes: 23 additions & 0 deletions src/components/animatedScanner/animatedScanner.api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "AnimatedScanner",
"category": "basic",
"description": "description",
"extends": ["Animated.View"],
"extendsLink": ["https://reactnative.dev/docs/animated"],
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/CardScannerScreen.js",
"images": ["https://media.giphy.com/media/l49JVcxoclUXbryiA/giphy.gif"],
"props": [
{"name": "progress", "type": "number", "description": "Animated value between 0 and 100", "default": "0"},
{
"name": "duration",
"type": "number",
"description": "Duration of current break (can be change between breaks)",
"default": "1000"
},
{"name": "opacity", "type": "number", "description": "Opacity"},
{"name": "backgroundColor", "type": "string", "description": "Background color"},
{"name": "onBreakpoint", "type": "() => {progress, isDone}", "description": "Breakpoint callback"},
{"name": "hideScannerLine", "type": "boolean", "description": "Whether to hide the scanner line"},
{"name": "containerStyle", "type": "ViewStyle", "description": "Component's container style"}
]
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
{
"name": "Avatar",
"category": "basic",
"description": " Avatar component for displaying user profile images",
"description": "Avatar component for displaying user profile images",
"images": [
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Avatar/Avarat_1.png?raw=true",
"https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Avatar/Avarat_2.png?raw=true"
],
"extends": ["TouchableOpacity", "Image"],
"extendsLink": [
"https://github.com/wix/react-native-ui-lib/blob/master/src/components/touchableOpacity/index.tsx",
"https://github.com/wix/react-native-ui-lib/blob/master/src/components/image/index.tsx"
],
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/AvatarsScreen.tsx",
"props": [
{"name": "animate", "type": "boolean", "description": "Adds fade in animation when Avatar image loads"},
{
"name": "animate",
"type": "boolean",
"description": "Adds fade in animation when Avatar image loads",
"default": "false"
},
{"name": "backgroundColor", "type": "string", "description": "Background color for Avatar"},
{"name": "badgePosition", "type": "BadgePosition", "description": "Badge location on Avatar"},
{
"name": "badgePosition",
"type": "TOP_RIGHT | TOP_LEFT | BOTTOM_RIGHT | BOTTOM_LEFT",
"description": "Badge location on Avatar",
"default": "BadgePosition.TOP_RIGHT"
},
{"name": "badgeProps", "type": "BadgeProps", "description": "Badge props passed down to Badge component"},
{
"name": "containerStyle",
"type": "ViewStyle",
"description": "Additional spacing styles for the container"
},
{"name": "source", "type": "ImageSourcePropType", "description": "The image source (external or assets)"},
{"name": "source", "type": "ImageSourcePropType", "description": "The image source (external or from assets)"},
{"name": "imageProps", "type": "ImageProps", "description": "Image props object"},
{
"name": "imageStyle",
Expand Down Expand Up @@ -57,7 +71,7 @@
"description": "Send this to use the name to infer a backgroundColor"
},
{"name": "label", "type": "string", "description": "Label that can represent initials"},
{"name": "labelColor", "type": "string", "description": "The label color"},
{"name": "labelColor", "type": "string", "description": "The label color", "default": "Colors.grey10"},
{"name": "ribbonLabel", "type": "string", "description": "Ribbon label to display on the avatar"},
{"name": "ribbonStyle", "type": "ViewStyle", "description": "Ribbon custom style"},
{"name": "ribbonLabelStyle", "type": "TextStyle", "description": "Ribbon label custom style"},
Expand All @@ -68,7 +82,7 @@
"type": "StatusModes",
"description": "AWAY, ONLINE, OFFLINE or NONE mode (if set to a value other then 'NONE' will override isOnline prop)"
},
{"name": "size", "type": " number", "description": "Custom size for the Avatar"},
{"name": "size", "type": " number", "description": "Custom size for the Avatar", "default": "50"},
{"name": "onPress", "type": "(props: any) => void", "description": "Press handler"},
{"name": "testID", "type": "string", "description": "Test identifier"}
]
Expand Down