Skip to content

Commit 94c9684

Browse files
committed
add(site): Document Image, better docs
1 parent d4665a3 commit 94c9684

22 files changed

+102
-20
lines changed

next.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
- @tamagui/cli: tamagui test ./packages/site/components/OffsetBox.tsx
2+
3+
cli to compile a file and see output:
4+
5+
> Loading tamagui
6+
> Compiling OffsetBox
7+
>> <YStack />
8+
>> ...
9+
110
- for lineargradient:
211
- propMapper
312
- move logic to function

packages/build/tamagui-build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const pkgMain = pkg.main
2020
const pkgModule = pkg.module
2121

2222
async function build() {
23-
console.log('🥚', pkg.name)
23+
console.log('»', pkg.name)
2424
const x = Date.now()
2525
let files = (await fg(['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.css'])).filter(
2626
(x) => !x.includes('.d.ts')

packages/loader/src/loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function loader(this: any, source: string) {
3636
(options.disableDebugAttr || process.env.NODE_ENV !== 'development')
3737
) {
3838
if (!hasLogged) {
39-
console.log('🥚 Tamagui disableDebug & disableExtraction set, no parsing running')
39+
console.log(' » Tamagui disableDebug & disableExtraction set, no parsing running')
4040
hasLogged = true
4141
}
4242
return callback(null, source)

packages/proxy-worm/index.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = empty()
2+
3+
function empty() {
4+
return new Proxy(
5+
{},
6+
{
7+
get() {
8+
return empty()
9+
},
10+
apply() {
11+
return empty()
12+
},
13+
}
14+
)
15+
}

packages/proxy-worm/package.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@tamagui/proxy-worm",
3+
"version": "1.0.0-alpha.63",
4+
"main": "index.js",
5+
"publishConfig": {
6+
"access": "public"
7+
},
8+
"scripts": {
9+
"build": "true",
10+
"watch": "true"
11+
}
12+
}

packages/site/components/MDXComponents.tsx

+1-12
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { DocCodeBlock } from './DocsCodeBlock'
2929
import { ExternalIcon } from './ExternalIcon'
3030
import { HeroContainer } from './HeroContainer'
3131
import { Highlights } from './Highlights'
32+
import { OffsetBox } from './OffsetBox'
3233
import { Preview } from './Preview'
3334
import { PropsTable } from './PropsTable'
3435

@@ -329,18 +330,6 @@ export const components = {
329330
},
330331
}
331332

332-
const OffsetBox = (props: StackProps & { size?: 'hero' }) => {
333-
return (
334-
<YStack
335-
{...(props.size === 'hero' && {
336-
$gtSm: { mx: '$-5' },
337-
$gtMd: { mx: '$-10' },
338-
})}
339-
{...props}
340-
/>
341-
)
342-
}
343-
344333
const LinkHeading = ({ id, children, ...props }: { id: string } & StackProps) => (
345334
<XStack
346335
tag="a"
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react'
2+
import { StackProps, YStack } from 'tamagui'
3+
4+
export const OffsetBox = (props: StackProps & { size?: 'hero' }) => {
5+
return (
6+
<YStack
7+
{...(props.size === 'hero' && {
8+
$gtSm: { mx: '$-5' },
9+
$gtMd: { mx: '$-10' },
10+
})}
11+
{...props}
12+
/>
13+
)
14+
}

packages/site/components/demos/ButtonDemo.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ function Buttons(props) {
1919
return (
2020
<YStack elevation="$6" w={180} bc="$bg" p="$3" br="$2" space="$2" {...props}>
2121
<Button>Plain</Button>
22-
<Button themeIcon icon={Airplay} size="$6">
22+
<Button icon={Airplay} size="$6">
2323
Large
2424
</Button>
25-
<Button themeInverse themeIcon iconAfter={Gift} size="$2">
25+
<Button themeInverse iconAfter={Gift} size="$2">
2626
Small Inversed
2727
</Button>
28-
<Button themeIcon icon={Activity} size="$1">
28+
<Button icon={Activity} size="$1">
2929
XS
3030
</Button>
3131
<InteractiveContainer>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
import { Image, XStack } from 'tamagui'
3+
4+
export function ImageDemo() {
5+
return (
6+
<XStack space>
7+
<Image source="http://placekitten.com/200/300" width={200} height={300} />
8+
</XStack>
9+
)
10+
}

packages/site/components/demos/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ export { MenuDemo } from './MenuDemo'
1111
export { SeparatorDemo } from './SeparatorDemo'
1212
export { PopoverDemo } from './PopoverDemo'
1313
export { HoverablePopoverDemo } from './HoverablePopoverDemo'
14+
export { ImageDemo } from './ImageDemo'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Image
3+
description: React Native Web Image + Tamagui style props.
4+
name: html
5+
---
6+
7+
# Image
8+
9+
<Description>React Native Web Image + Tamagui style props.</Description>
10+
11+
<HeroContainer>
12+
<ImageDemo />
13+
</HeroContainer>
14+
15+
```jsx hero template=Image
16+
17+
```
18+
19+
<Highlights features={['Works on native and web.', 'Accepts Tamagui style props.']} />
20+
21+
## Props
22+
23+
See the [Tamagui props](/docs/intro/props) with the [React Native Web Image props](https://necolas.github.io/react-native-web/docs/image/) merged onto them.

packages/site/data/docs/guides/design-systems.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export default () => (
162162
When it compiles you should see something like:
163163
164164
```bash
165-
🥚 app.tsx 16ms ׁ· 1 optimized · 1 flattened
165+
» app.tsx 16ms ׁ· 1 optimized · 1 flattened
166166
```
167167
168168
To get more information on any extraction, use the `// debug` pragma:

packages/site/lib/docsRoutes.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const docsRoutes = [
1919
{ title: 'Paragraph', route: '/docs/components/text' },
2020
{ title: 'Button', route: '/docs/components/button' },
2121
{ title: 'Headings', route: '/docs/components/headings' },
22+
{ title: 'Image', route: '/docs/components/image' },
2223
{ title: 'Forms', route: '/docs/components/forms' },
2324
{ title: 'Separator', route: '/docs/components/separator' },
2425
{ title: 'Popover', route: '/docs/components/popover' },

packages/site/next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const transform = withPlugins(
2121
logTimings: true,
2222
// disableExtraction: false,
2323
disableExtraction: process.env.NODE_ENV === 'development',
24+
excludeReactNativeWebExports: ['Switch', 'ProgressBar', 'Picker'],
2425
}),
2526
// // template for modifying webpack further:
2627
// (nextConfig = {}) => {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

yarn.lock

+9-2
Original file line numberDiff line numberDiff line change
@@ -3916,6 +3916,7 @@ __metadata:
39163916
resolution: "@tamagui/next-plugin@workspace:packages/next-plugin"
39173917
dependencies:
39183918
"@tamagui/build": ^1.0.0-alpha.58
3919+
"@tamagui/proxy-worm": ^1.0.0-alpha.63
39193920
"@tamagui/static": ^1.0.0-alpha.63
39203921
browserslist: ^4.19.1
39213922
css-minimizer-webpack-plugin: ^3.1.3
@@ -3943,6 +3944,12 @@ __metadata:
39433944
languageName: node
39443945
linkType: hard
39453946

3947+
"@tamagui/proxy-worm@^1.0.0-alpha.63, @tamagui/proxy-worm@workspace:packages/proxy-worm":
3948+
version: 0.0.0-use.local
3949+
resolution: "@tamagui/proxy-worm@workspace:packages/proxy-worm"
3950+
languageName: unknown
3951+
linkType: soft
3952+
39463953
"@tamagui/site@workspace:packages/site":
39473954
version: 0.0.0-use.local
39483955
resolution: "@tamagui/site@workspace:packages/site"
@@ -4042,9 +4049,9 @@ __metadata:
40424049
languageName: unknown
40434050
linkType: soft
40444051

4045-
"@tamagui/test@workspace:packages/test":
4052+
"@tamagui/test@workspace:packages/test-playground":
40464053
version: 0.0.0-use.local
4047-
resolution: "@tamagui/test@workspace:packages/test"
4054+
resolution: "@tamagui/test@workspace:packages/test-playground"
40484055
dependencies:
40494056
"@tamagui/core": ^1.0.0-alpha.63
40504057
"@tamagui/helpers": ^1.0.0-alpha.63

0 commit comments

Comments
 (0)