Skip to content

Commit 642aac0

Browse files
committed
docs: renew documentation site
1 parent 570b452 commit 642aac0

File tree

375 files changed

+8271
-8260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

375 files changed

+8271
-8260
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"css.lint.unknownAtRules": "ignore",
23
"cSpell.words": ["composify"],
34
"editor.formatOnSave": true,
45
"editor.tabSize": 2,

biome.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
}
3131
},
3232
"domains": {
33-
"next": "recommended",
3433
"react": "recommended"
3534
}
3635
},

examples/api/database.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"documents": [
33
{
44
"id": "foo",
5-
"content": "<VStack alignVertical=\"center\" alignHorizontal=\"stretch\" padding={{top: 16, bottom: 16, left: 16, right: 16}} gap={4}><Heading level={1} weight=\"extrabold\">Server Driven UI made easy</Heading><Body color=\"#1E1E1E\" weight=\"normal\">Bring visual editing to your components — no rewrites needed.</Body><HStack alignVertical=\"stretch\" alignHorizontal=\"flex-start\" gap={4} margin={{top: 16}}><Button variant=\"primary\">Learn More ›</Button><Button variant=\"outline\">Get started →</Button></HStack></VStack>"
5+
"content": "<VStack alignVertical=\"center\" alignHorizontal=\"stretch\" padding={{top: 16, bottom: 16, left: 16, right: 16}} gap={4}><Heading level={1} weight=\"extrabold\" size=\"3xl\">Server Driven UI made easy</Heading><Body color=\"#1E1E1E\" weight=\"normal\">Bring visual editing to your components — no rewrites needed.</Body></VStack>"
66
}
77
]
88
}

examples/expo/app/[slug].tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@/components';
1+
import '@/components/catalog';
22

33
import { Renderer } from '@composify/react/renderer';
44
import { useLocalSearchParams } from 'expo-router';
@@ -16,14 +16,7 @@ export default function Page() {
1616
});
1717
const { content } = await res.json().catch(() => ({}));
1818

19-
setSource(
20-
content ??
21-
`
22-
<VStack flex={1} alignHorizontal="center" alignVertical="center">
23-
<Heading level={3} weight="semibold">Not Found</Heading>
24-
</VStack>
25-
`.trim(),
26-
);
19+
setSource(content ?? '<VStack />');
2720
};
2821

2922
fetchData();

examples/expo/app/editor/[slug].tsx

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import '@/components/catalog';
12
import '@composify/react/style.css';
2-
import '@/components';
33

44
import { Editor } from '@composify/react/editor';
55
import { useLocalSearchParams } from 'expo-router';
@@ -19,31 +19,7 @@ export default function EditorPage() {
1919

2020
const { content } = await res.json().catch(() => ({}));
2121

22-
setSource(
23-
content ??
24-
`
25-
<VStack
26-
alignVertical="center"
27-
alignHorizontal="stretch"
28-
padding={{ top: 16, bottom: 16, left: 16, right: 16 }}
29-
gap={4}
30-
>
31-
<Heading level={1} weight="extrabold">Server Driven UI made easy</Heading>
32-
<Body color="#1E1E1E" weight="normal">
33-
Bring visual editing to your components — no rewrites needed.
34-
</Body>
35-
<HStack
36-
alignVertical="stretch"
37-
alignHorizontal="flex-start"
38-
gap={4}
39-
margin={{ top: 16 }}
40-
>
41-
<Button variant="primary">Learn More ›</Button>
42-
<Button variant="outline">Get started →</Button>
43-
</HStack>
44-
</VStack>
45-
`.trim(),
46-
);
22+
setSource(content ?? '<VStack size={{ height: 200 }} backgroundColor="#f8fafc" />');
4723
};
4824

4925
fetchData();
@@ -72,5 +48,5 @@ export default function EditorPage() {
7248
return null;
7349
}
7450

75-
return <Editor title={slug} source={source} onSubmit={handleSubmit} />;
51+
return <Editor title={`Editing: ${slug}`} source={source} onSubmit={handleSubmit} />;
7652
}

examples/expo/components/Body/Body.tsx

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,34 @@ import type { FC, PropsWithChildren } from 'react';
22
import { StyleSheet, Text } from 'react-native';
33

44
type Props = PropsWithChildren<{
5-
color?: string;
6-
weight?: 'light' | 'normal';
7-
margin?: {
8-
top?: number;
9-
bottom?: number;
10-
left?: number;
11-
right?: number;
12-
};
5+
size?: 'sm' | 'md' | 'lg';
6+
align?: 'left' | 'center' | 'right';
137
}>;
148

15-
const FONT_WEIGHT_BY_WEIGHT = {
16-
light: '300',
17-
normal: '400',
18-
} as const;
19-
20-
export const Body: FC<Props> = ({ color = '#1E1E1E', weight = 'normal', margin, children }) => (
21-
<Text
22-
style={[
23-
styles.body,
24-
{
25-
color,
26-
fontWeight: FONT_WEIGHT_BY_WEIGHT[weight],
27-
marginTop: margin?.top,
28-
marginBottom: margin?.bottom,
29-
marginLeft: margin?.left,
30-
marginRight: margin?.right,
31-
},
32-
]}
33-
>
34-
{children}
35-
</Text>
9+
export const Body: FC<Props> = ({ size = 'md', align = 'left', children }) => (
10+
<Text style={[styles.body, styles[`size-${size}`], styles[`align-${align}`]]}>{children}</Text>
3611
);
3712

3813
const styles = StyleSheet.create({
3914
body: {
15+
color: '#525252',
16+
},
17+
'size-sm': {
18+
fontSize: 14,
19+
},
20+
'size-md': {
21+
fontSize: 16,
22+
},
23+
'size-lg': {
4024
fontSize: 18,
4125
},
26+
'align-left': {
27+
textAlign: 'left',
28+
},
29+
'align-center': {
30+
textAlign: 'center',
31+
},
32+
'align-right': {
33+
textAlign: 'right',
34+
},
4235
});

examples/expo/components/Body/BodyCatalog.ts

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,32 @@ import { Body } from './Body';
33

44
Catalog.register('Body', {
55
component: Body,
6+
category: 'Content',
67
props: {
7-
children: {
8-
label: 'Content',
9-
type: 'text',
10-
default: 'Bring visual editing to your components — no rewrites needed.',
11-
},
12-
color: {
13-
label: 'Text Color',
14-
type: 'text',
15-
default: '#1E1E1E',
8+
size: {
9+
label: 'Size',
10+
type: 'radio',
11+
options: [
12+
{ label: 'Small', value: 'sm' },
13+
{ label: 'Medium', value: 'md' },
14+
{ label: 'Large', value: 'lg' },
15+
],
16+
default: 'md',
1617
},
17-
weight: {
18-
label: 'Font Weight',
18+
align: {
19+
label: 'Alignment',
1920
type: 'radio',
2021
options: [
21-
{
22-
label: 'Light',
23-
value: 'light',
24-
},
25-
{
26-
label: 'Normal',
27-
value: 'normal',
28-
},
22+
{ label: 'Left', value: 'left' },
23+
{ label: 'Center', value: 'center' },
24+
{ label: 'Right', value: 'right' },
2925
],
30-
default: 'normal',
26+
default: 'left',
3127
},
32-
margin: {
33-
label: 'Margin',
34-
type: 'object',
35-
fields: {
36-
top: {
37-
label: 'Top',
38-
type: 'number',
39-
default: 0,
40-
},
41-
bottom: {
42-
label: 'Bottom',
43-
type: 'number',
44-
default: 0,
45-
},
46-
left: {
47-
label: 'Left',
48-
type: 'number',
49-
default: 0,
50-
},
51-
right: {
52-
label: 'Right',
53-
type: 'number',
54-
default: 0,
55-
},
56-
},
28+
children: {
29+
label: 'Content',
30+
type: 'textarea',
31+
default: 'Body',
5732
},
5833
},
5934
});
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
import './BodyCatalog';
2-
31
export { Body } from './Body';

examples/expo/components/Button/Button.tsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

examples/expo/components/Button/ButtonCatalog.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)