-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TapArea: support to VR visible focus style (#3783)
- Loading branch information
1 parent
71bd621
commit 6a0a3c4
Showing
6 changed files
with
181 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
import { Box, Flex, TapArea, Text } from 'gestalt'; | ||
|
||
export default function TapAreaExample() { | ||
return ( | ||
<Box padding={8} width="100%"> | ||
<Flex gap={6} width="100%"> | ||
<Flex direction="column" gap={6} width="100%"> | ||
<Box | ||
alignItems="center" | ||
borderStyle="sm" | ||
display="flex" | ||
height={150} | ||
justifyContent="center" | ||
width={150} | ||
> | ||
<TapArea focusColor="lightBackground" fullHeight={false} fullWidth={false}> | ||
<Box height={100} width={100}> | ||
<Text size="100">focusColor=lightBackground</Text> | ||
</Box> | ||
</TapArea> | ||
</Box> | ||
|
||
<Box | ||
alignItems="center" | ||
borderStyle="sm" | ||
color="selected" | ||
display="flex" | ||
height={150} | ||
justifyContent="center" | ||
width={150} | ||
> | ||
<TapArea focusColor="darkBackground" fullHeight={false} fullWidth={false}> | ||
<Box height={100} width={100}> | ||
<Text color="inverse" size="100"> | ||
focusColor=darkBackground | ||
</Text> | ||
</Box> | ||
</TapArea> | ||
</Box> | ||
</Flex> | ||
<Flex direction="column" gap={6} width="100%"> | ||
<Box | ||
alignItems="center" | ||
borderStyle="sm" | ||
color="successWeak" | ||
display="flex" | ||
height={150} | ||
justifyContent="center" | ||
width={150} | ||
> | ||
<TapArea | ||
focusColor="lightBackground" | ||
fullHeight={false} | ||
fullWidth={false} | ||
innerFocusColor="default" | ||
> | ||
<Box height={100} width={100}> | ||
<Text size="100">focusColor=lightBackground & innerFocusColor=default</Text> | ||
</Box> | ||
</TapArea> | ||
</Box> | ||
|
||
<Box | ||
alignItems="center" | ||
borderStyle="sm" | ||
color="successBase" | ||
display="flex" | ||
height={150} | ||
justifyContent="center" | ||
width={150} | ||
> | ||
<TapArea | ||
focusColor="darkBackground" | ||
fullHeight={false} | ||
fullWidth={false} | ||
innerFocusColor="default" | ||
> | ||
<Box height={100} width={100}> | ||
<Text size="100">focusColor=darkBackground & innerFocusColor=default</Text> | ||
</Box> | ||
</TapArea> | ||
</Box> | ||
</Flex> | ||
<Flex direction="column" gap={6} width="100%"> | ||
<Box | ||
alignItems="center" | ||
borderStyle="sm" | ||
color="successWeak" | ||
display="flex" | ||
height={150} | ||
justifyContent="center" | ||
width={150} | ||
> | ||
<TapArea | ||
focusColor="lightBackground" | ||
fullHeight={false} | ||
fullWidth={false} | ||
innerFocusColor="inverse" | ||
> | ||
<Box height={100} width={100}> | ||
<Text size="100">focusColor=lightBackground & innerFocusColor=inverse</Text> | ||
</Box> | ||
</TapArea> | ||
</Box> | ||
|
||
<Box | ||
alignItems="center" | ||
borderStyle="sm" | ||
color="successBase" | ||
display="flex" | ||
height={150} | ||
justifyContent="center" | ||
width={150} | ||
> | ||
<TapArea | ||
focusColor="darkBackground" | ||
fullHeight={false} | ||
fullWidth={false} | ||
innerFocusColor="inverse" | ||
> | ||
<Box height={100} width={100}> | ||
<Text size="100">focusColor=darkBackground & innerFocusColor=inverse</Text> | ||
</Box> | ||
</TapArea> | ||
</Box> | ||
</Flex> | ||
</Flex> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters