Skip to content

Commit 4b6fce2

Browse files
infra: add api.json files for incubator components PanView and ExpandableOverlay
Co-Authored-By: [email protected] <[email protected]>
1 parent f60f15d commit 4b6fce2

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "ExpandableOverlay",
3+
"category": "overlays",
4+
"description": "A component that presents content on top of the invoking screen using an overlay",
5+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/incubatorScreens/IncubatorExpandableOverlayScreen.tsx",
6+
"props": [
7+
{
8+
"name": "expandableContent",
9+
"type": "React.ReactElement",
10+
"description": "The content to render inside the expandable modal/dialog"
11+
},
12+
{
13+
"name": "useDialog",
14+
"type": "boolean",
15+
"description": "Whether to use a dialog as expandable container (by default the container will be a full screen modal)"
16+
},
17+
{
18+
"name": "modalProps",
19+
"type": "ModalProps",
20+
"description": "The props to pass to the modal expandable container"
21+
},
22+
{
23+
"name": "showTopBar",
24+
"type": "boolean",
25+
"description": "Whether to render a modal top bar (relevant only for modal)"
26+
},
27+
{
28+
"name": "topBarProps",
29+
"type": "ModalTopBarProps",
30+
"description": "The modal top bar props to pass on"
31+
},
32+
{
33+
"name": "renderCustomOverlay",
34+
"type": "function",
35+
"description": "A custom overlay to render instead of Modal or Dialog components"
36+
},
37+
{
38+
"name": "disabled",
39+
"type": "boolean",
40+
"description": "Disabled opening expandable overlay"
41+
},
42+
{
43+
"name": "dialogProps",
44+
"type": "object",
45+
"description": "The props to pass to the dialog expandable container (when useDialog is true)"
46+
},
47+
{
48+
"name": "migrateDialog",
49+
"type": "boolean",
50+
"description": "Whether to use the new Dialog implementation"
51+
}
52+
],
53+
"snippet": [
54+
"<ExpandableOverlay",
55+
" expandableContent={<View><Text>Expandable Content</Text></View>}",
56+
" useDialog",
57+
" showTopBar",
58+
" topBarProps={{title: 'Title'}}",
59+
">",
60+
" <Text>Press to open overlay</Text>",
61+
"</ExpandableOverlay>"
62+
]
63+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "PanView",
3+
"category": "interaction",
4+
"description": "A component that detects pan gestures and animates accordingly",
5+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/incubatorScreens/PanViewScreen.tsx",
6+
"props": [
7+
{
8+
"name": "directions",
9+
"type": "PanViewDirections[]",
10+
"description": "The directions of the allowed pan (default is all). Types: UP, DOWN, LEFT and RIGHT (using PanView.directions.###)",
11+
"default": "DEFAULT_DIRECTIONS"
12+
},
13+
{
14+
"name": "dismissible",
15+
"type": "boolean",
16+
"description": "Dismiss the view if over the threshold (translation or velocity)"
17+
},
18+
{
19+
"name": "animateToOrigin",
20+
"type": "boolean",
21+
"description": "Animate to start if not dismissed"
22+
},
23+
{
24+
"name": "onDismiss",
25+
"type": "function",
26+
"description": "Callback to the dismiss animation end"
27+
},
28+
{
29+
"name": "directionLock",
30+
"type": "boolean",
31+
"description": "Should the direction of dragging be locked once a drag has started"
32+
},
33+
{
34+
"name": "threshold",
35+
"type": "PanViewDismissThreshold",
36+
"description": "Object to adjust the dismiss threshold limits (eg {x, y, velocity})"
37+
},
38+
{
39+
"name": "containerStyle",
40+
"type": "StyleProp<ViewStyle>",
41+
"description": "Add a style to the container"
42+
}
43+
],
44+
"snippet": [
45+
"<PanView",
46+
" directions={[PanView.directions.LEFT, PanView.directions.RIGHT]}",
47+
" dismissible",
48+
" animateToOrigin",
49+
" onDismiss={() => console.log('dismissed')}",
50+
">",
51+
" <View>",
52+
" <Text>Swipe me</Text>",
53+
" </View>",
54+
"</PanView>"
55+
]
56+
}

0 commit comments

Comments
 (0)