create-proto 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-proto",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Scaffold a new Proto prototype: `npm create proto@latest myapp`. Describe a screen, watch your prototype run natively on iPhone — designer-first, paired with Claude Code.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,5 +1,6 @@
1
1
  import { Stack } from 'expo-router';
2
2
  import TouchDots from '../components/proto/touch-dots';
3
+ import config from '../proto.config';
3
4
 
4
5
  export default function RootLayout() {
5
6
  return (
@@ -10,7 +11,7 @@ export default function RootLayout() {
10
11
  <Stack.Screen
11
12
  name="index"
12
13
  options={{
13
- title: 'Prototo',
14
+ title: config.name,
14
15
  headerLargeTitle: true,
15
16
  }}
16
17
  />
@@ -46,7 +46,8 @@ export function Screen({ scrollable = true, gradient, children }: ScreenProps) {
46
46
  return (
47
47
  <ScrollView
48
48
  style={{ flex: 1, backgroundColor: theme.surface.primary }}
49
- contentContainerStyle={{ padding, gap: padding }}
49
+ // With a wash the content box fills the viewport so the gradient reaches the bottom edge.
50
+ contentContainerStyle={{ padding, gap: padding, flexGrow: washColor ? 1 : undefined }}
50
51
  contentInsetAdjustmentBehavior="automatic"
51
52
  >
52
53
  {wash}
@@ -1,5 +1,5 @@
1
- import { useEffect, useState, type ReactNode } from 'react';
2
- import { Pressable } from 'react-native';
1
+ import { useEffect, type ReactNode } from 'react';
2
+ import { SymbolView } from 'expo-symbols';
3
3
  import * as Clipboard from 'expo-clipboard';
4
4
  import * as Haptics from 'expo-haptics';
5
5
  import {
@@ -10,7 +10,7 @@ import {
10
10
  withTiming,
11
11
  Easing,
12
12
  } from '../components/proto/gestures';
13
- import { Screen, Stack, Text, Card, Divider, Lottie } from '../components/proto';
13
+ import { Screen, Stack, Row, Text, Card, Button, Divider, Lottie, useAccent } from '../components/proto';
14
14
 
15
15
  // Prototo Desktop sets EXPO_PUBLIC_PROTO_DESKTOP=1 when it runs `proto start`
16
16
  // (Metro inlines it at bundle time). In the desktop the terminal sits beside
@@ -19,18 +19,9 @@ import { Screen, Stack, Text, Card, Divider, Lottie } from '../components/proto'
19
19
  const IN_DESKTOP = process.env.EXPO_PUBLIC_PROTO_DESKTOP === '1';
20
20
 
21
21
  const EXAMPLES = [
22
- {
23
- label: 'A whole screen',
24
- prompt: 'Make me a music player home screen',
25
- },
26
- {
27
- label: 'Native feel',
28
- prompt: 'Add a liquid glass tab bar with Home, Search, Profile',
29
- },
30
- {
31
- label: 'A quick change',
32
- prompt: 'Make the background sunset orange',
33
- },
22
+ { label: 'From Figma', prompt: 'Use Figma MCP and design this screen for me [figma link]' },
23
+ { label: 'Native feel', prompt: 'Add a liquid glass tab bar with Home, Search, Profile' },
24
+ { label: 'A quick change', prompt: 'Make the background sunset orange' },
34
25
  ];
35
26
 
36
27
  function Enter({ delay, children }: { delay: number; children: ReactNode }) {
@@ -52,60 +43,58 @@ function Enter({ delay, children }: { delay: number; children: ReactNode }) {
52
43
  }
53
44
 
54
45
  function ExampleCard({ example }: { example: (typeof EXAMPLES)[number] }) {
55
- const [copied, setCopied] = useState(false);
46
+ const accent = useAccent();
56
47
 
57
48
  const handleCopy = async () => {
58
49
  await Clipboard.setStringAsync(example.prompt);
59
50
  await Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
60
- setCopied(true);
61
- setTimeout(() => setCopied(false), 1500);
62
51
  };
63
52
 
64
53
  return (
65
- <Card padding={20}>
66
- <Stack gap={6}>
67
- <Text size="label" color="accent">
68
- {example.label}
69
- </Text>
70
- <Text size="headline">{`"${example.prompt}"`}</Text>
54
+ <Card glass padding={16}>
55
+ <Row gap={14} align="center">
56
+ <SymbolView name="text.bubble" size={22} tintColor={accent} />
57
+ <Stack gap={2} style={{ flex: 1 }}>
58
+ <Text size="label" color="accent">
59
+ {example.label}
60
+ </Text>
61
+ <Text size="body">{`“${example.prompt}”`}</Text>
62
+ </Stack>
71
63
  {IN_DESKTOP ? null : (
72
- <Pressable onPress={handleCopy} style={{ alignSelf: 'flex-end', marginTop: 4 }}>
73
- <Text size="caption" color="accent">
74
- {copied ? 'Copied' : 'Copy'}
75
- </Text>
76
- </Pressable>
64
+ <Row>
65
+ <Button label="Copy" variant="ghost" onPress={() => void handleCopy()} />
66
+ </Row>
77
67
  )}
78
- </Stack>
68
+ </Row>
79
69
  </Card>
80
70
  );
81
71
  }
82
72
 
83
73
  export default function Home() {
84
74
  return (
85
- <Screen scrollable>
75
+ <Screen scrollable gradient>
86
76
  <Stack gap={24}>
87
77
  <Enter delay={0}>
88
- <Lottie
89
- source={require('../assets/lottie/logo-prototo.json')}
90
- style={{ width: 56, height: 56, alignSelf: 'center' }}
91
- />
92
- </Enter>
93
-
94
- <Enter delay={80}>
95
78
  <Card glass padding={24}>
96
- <Stack gap={8}>
97
- <Text size="headline">You're in.</Text>
98
- <Text size="body" color="secondary">
99
- {IN_DESKTOP
100
- ? 'Type your first prompt in the terminal beside this preview, and watch it appear here.'
101
- : `In a terminal: cd {{APP_NAME}} && claude (or codex). Then paste a prompt below.`}
102
- </Text>
103
- </Stack>
79
+ <Row gap={16} align="center">
80
+ <Lottie
81
+ source={require('../assets/lottie/logo-prototo.json')}
82
+ style={{ width: 48, height: 48 }}
83
+ />
84
+ <Stack gap={4} style={{ flex: 1 }}>
85
+ <Text size="headline">You're in.</Text>
86
+ <Text size="body" color="secondary">
87
+ {IN_DESKTOP
88
+ ? 'Describe a screen in the terminal beside this preview. It appears here as it builds.'
89
+ : `In a terminal: cd {{APP_NAME}} && claude (or codex). Then paste a prompt below.`}
90
+ </Text>
91
+ </Stack>
92
+ </Row>
104
93
  </Card>
105
94
  </Enter>
106
95
 
107
- <Enter delay={160}>
108
- <Stack gap={12}>
96
+ <Enter delay={120}>
97
+ <Stack gap={10}>
109
98
  <Text size="label" color="secondary">
110
99
  Try one of these
111
100
  </Text>
@@ -116,7 +105,7 @@ export default function Home() {
116
105
  </Enter>
117
106
 
118
107
  <Enter delay={240}>
119
- <Stack gap={16}>
108
+ <Stack gap={12}>
120
109
  <Divider />
121
110
  <Text size="caption" color="secondary">
122
111
  Each prompt builds on the last. Prototo reads DESIGN.md before every change.