Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ntorionbearstudio committed Oct 24, 2024
1 parent 2f7e232 commit 0c535af
Show file tree
Hide file tree
Showing 27 changed files with 240 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { locales } from 'nextra/locales'
export const middleware = request => {
const { nextUrl } = request

if (nextUrl.pathname.startsWith('/remote/')) {
if (nextUrl.pathname.startsWith('/remote/') || nextUrl.pathname.startsWith('/fonts/')) {
// The middleware must not handle dynamic routes.
return
}
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"react-live": "^4.1.7",
"react-native": "^0.75.2",
"react-native-ficus-ui": "1.2.0",
"react-native-vector-icons": "^10.2.0",
"react-native-web": "^0.19.12"
},
"dependenciesMeta": {
Expand Down
115 changes: 110 additions & 5 deletions docs/pages/docs/Components/avatar.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
searchable: true
---

import { ExpoDemo } from '@components/expo-demo';

import { CodeEditor } from '@components/code-editor';

# Avatar

Expand All @@ -17,9 +16,115 @@ import { Avatar, AvatarBadge, AvatarGroup } from 'react-native-ficus-ui';

## Usage

<div className="mt-2">
<ExpoDemo id="@bearstudio/ficus-ui-avatar?platform=ios" />
</div>
### Avatar with photo

<CodeEditor code={`<Avatar
name="Nicolas Torion"
src="https://avatars.githubusercontent.com/u/53612278?v=4"
/>`} />

### Avatar with icon

<CodeEditor code={`<HStack spacing="md">
<Avatar />
<Avatar fontFamily="AntDesign" icon="user" />
</HStack>`} />

### Generated color

<CodeEditor code={`<HStack spacing="md">
<Avatar name="Nicolas Torion" size="xs" />
<Avatar name="Omar Borji" size="sm" />
<Avatar name="Deelan" size="md" />
<Avatar name="Mark Cavendish" size="lg" />
<Avatar name="Antoine Dupont" size="xl" />
</HStack>`} />

### Color scheme

<CodeEditor code={`<HStack spacing="md">
<Avatar name="Nicolas Torion" size="xs" colorScheme="blue" />
<Avatar name="Omar Borji" size="sm" colorScheme="orange" />
<Avatar name="Deelan" size="md" colorScheme="green" />
<Avatar name="Mark Cavendish" size="lg" colorScheme="red" />
<Avatar name="Antoine Dupont" size="xl" colorScheme="purple" />
</HStack>`} />

### Avatar group

<CodeEditor code={`<VStack spacing="md">
<AvatarGroup>
<Avatar
name="Nicolas Torion"
src="https://avatars.githubusercontent.com/u/53612278?v=4"
/>
<Avatar
name="Omar Borji"
src="https://avatars.githubusercontent.com/u/80390318?s=60&v=4"
/>
<Avatar name="Deelan" colorScheme="green" />
<Avatar name="Mark Cavendish" colorScheme="red" />
<Avatar name="Antoine Dupont" colorScheme="purple" />
<Avatar name="Zinédine Zidane" colorScheme="pink" />
</AvatarGroup>
<AvatarGroup size="lg" max={2}>
<Avatar
name="Nicolas Torion"
src="https://avatars.githubusercontent.com/u/53612278?v=4"
/>
<Avatar
name="Omar Borji"
src="https://avatars.githubusercontent.com/u/80390318?s=60&v=4"
/>
<Avatar name="Deelan" colorScheme="green" />
<Avatar name="Mark Cavendish" colorScheme="red" />
<Avatar name="Antoine Dupont" colorScheme="purple" />
<Avatar name="Zinédine Zidane" colorScheme="pink" />
</AvatarGroup>
</VStack>`} />

### Avatar badge

<CodeEditor code={`<HStack spacing="md">
<Avatar
name="Nicolas Torion"
src="https://avatars.githubusercontent.com/u/53612278?v=4"
>
<AvatarBadge />
</Avatar>
<Avatar
name="Omar Borji"
src="https://avatars.githubusercontent.com/u/80390318?s=60&v=4"
>
<AvatarBadge bg="orange.500" borderColor="orange.100" />
</Avatar>
<Avatar name="Deelan" colorScheme="green">
<AvatarBadge bg="orange.500" borderColor="orange.100" />
</Avatar>
</HStack>`} />

### Avatar badge and group

<CodeEditor code={`<HStack spacing="md">
<AvatarGroup size="lg">
<Avatar
name="Nicolas Torion"
src="https://avatars.githubusercontent.com/u/53612278?v=4"
>
<AvatarBadge />
</Avatar>
<Avatar
name="Omar Borji"
src="https://avatars.githubusercontent.com/u/80390318?s=60&v=4"
>
<AvatarBadge bg="orange.500" borderColor="orange.100" />
</Avatar>
<Avatar name="Deelan" colorScheme="green">
<AvatarBadge bg="orange.500" borderColor="orange.100" />
</Avatar>
</AvatarGroup>
</HStack>`} />

## Props

Expand Down
44 changes: 40 additions & 4 deletions docs/pages/docs/Components/divider.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
searchable: true
---

import { ExpoDemo } from '@components/expo-demo';
import { CodeEditor } from '@components/code-editor';


# Divider
Expand All @@ -17,9 +17,45 @@ import { Divider } from 'react-native-ficus-ui';

## Usage

<div className="mt-2">
<ExpoDemo id="@bearstudio/ficus-ui-divider" />
</div>
### Horizontal

<CodeEditor code={`<Box>
<Text>Test text</Text>
<Divider my="md" />
<Text>Test text</Text>
</Box>`} />

### Vertical

<CodeEditor code={`<Box h={40} flexDirection="row">
<Divider orientation="vertical" />
<Box m="md">
<Text>Test text</Text>
</Box>
</Box>`} />

### Custom color

<CodeEditor code={`<Box>
<Text>Test text</Text>
<Divider colorScheme="blue" my="md" />
<Text>Test text</Text>
</Box>`} />

### Custom size

<CodeEditor code={`<Box>
<Text>Test text</Text>
<Divider size={10} my="md" />
<Text>Test text</Text>
<Box mt="xl" h={40} flexDirection="row">
<Divider size={10} orientation="vertical" />
<Box m="md">
<Text>Test text</Text>
</Box>
</Box>
</Box>`} />

## Props

Expand Down
37 changes: 32 additions & 5 deletions docs/pages/docs/Components/icon.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
searchable: true
---

import { ExpoDemo } from '@components/expo-demo';

import { CodeEditor } from '@components/code-editor';

# Icon

Expand All @@ -17,9 +16,37 @@ import { Icon } from 'react-native-ficus-ui';

## Usage

<div className="mt-2">
<ExpoDemo id="@bearstudio/ficus-ui-icon" />
</div>
### Examples

<CodeEditor code={`<HStack spacing={10}>
<Icon name="like1" color="blue.700" fontSize="6xl" />
<Icon
name="star"
color="yellow.700"
fontSize="6xl"
fontFamily="FontAwesome"
/>
<Icon name="codesquare" color="red.500" fontSize="6xl" />
<Icon name="android1" color="teal.500" fontSize="6xl" />
<Icon name="heart" color="red.500" fontSize="6xl" />
<Icon name="apple1" color="blue.700" fontSize="6xl" />
<Icon name="appstore1" color="teal.500" fontSize="6xl" />
<Icon name="slack" color="yellow.700" fontSize="6xl" />
</HStack>`} />

### Custom style

<CodeEditor code={`<Icon
bg="yellow.400"
p={15}
borderRadius="full"
name="star"
color="yellow.700"
fontSize="2xl"
fontFamily="FontAwesome"
h={50}
w={50}
/>`} />

## Props

Expand Down
15 changes: 10 additions & 5 deletions docs/pages/docs/Components/image.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
searchable: true
---

import { ExpoDemo } from '@components/expo-demo';

import { CodeEditor } from '@components/code-editor';

# Image

Expand All @@ -17,9 +16,15 @@ import { Image } from 'react-native-ficus-ui';

## Usage

<div className="mt-2">
<ExpoDemo id="@bearstudio/ficus-ui-image" />
</div>
<CodeEditor code={`<Image
h={200}
w={300}
borderRadius={10}
source={{
uri:
'https://www.picturethisai.com/wiki-image/1080/153400456440184865.jpeg',
}}
/>`} />

## Props

Expand Down
11 changes: 11 additions & 0 deletions docs/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added docs/public/fonts/AntDesign.ttf
Binary file not shown.
Binary file added docs/public/fonts/Entypo.ttf
Binary file not shown.
Binary file added docs/public/fonts/EvilIcons.ttf
Binary file not shown.
Binary file added docs/public/fonts/Feather.ttf
Binary file not shown.
Binary file added docs/public/fonts/FontAwesome.ttf
Binary file not shown.
Binary file added docs/public/fonts/FontAwesome5_Brands.ttf
Binary file not shown.
Binary file added docs/public/fonts/FontAwesome5_Regular.ttf
Binary file not shown.
Binary file added docs/public/fonts/FontAwesome5_Solid.ttf
Binary file not shown.
Binary file added docs/public/fonts/FontAwesome6_Brands.ttf
Binary file not shown.
Binary file added docs/public/fonts/FontAwesome6_Regular.ttf
Binary file not shown.
Binary file added docs/public/fonts/FontAwesome6_Solid.ttf
Binary file not shown.
Binary file added docs/public/fonts/Fontisto.ttf
Binary file not shown.
Binary file added docs/public/fonts/Foundation.ttf
Binary file not shown.
Binary file added docs/public/fonts/Ionicons.ttf
Binary file not shown.
Binary file added docs/public/fonts/MaterialCommunityIcons.ttf
Binary file not shown.
Binary file added docs/public/fonts/MaterialIcons.ttf
Binary file not shown.
Binary file added docs/public/fonts/Octicons.ttf
Binary file not shown.
Binary file added docs/public/fonts/SimpleLineIcons.ttf
Binary file not shown.
Binary file added docs/public/fonts/Zocial.ttf
Binary file not shown.
35 changes: 35 additions & 0 deletions docs/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,38 @@
.dark .invert-on-dark {
filter: invert(1) brightness(1.8);
}

@font-face {
font-family: 'AntDesign';
src: url('/fonts/AntDesign.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'FontAwesome';
src: url('/fonts/FontAwesome.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'Feather';
src: url('/fonts/Feather.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'Ionicons';
src: url('/fonts/Ionicons.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'MaterialIcons';
src: url('/fonts/MaterialIcons.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

0 comments on commit 0c535af

Please sign in to comment.