@tamagui/shapes 1.0.1-beta.56 → 1.0.1-beta.60
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 +5 -4
- package/src/Circle.tsx +10 -0
- package/src/Square.tsx +26 -0
- package/src/getShapeSize.tsx +15 -0
- package/src/index.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/shapes",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.60",
|
|
4
4
|
"sideEffects": true,
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"module": "dist/esm",
|
|
9
9
|
"module:jsx": "dist/jsx",
|
|
10
10
|
"files": [
|
|
11
|
+
"src",
|
|
11
12
|
"types",
|
|
12
13
|
"dist"
|
|
13
14
|
],
|
|
@@ -18,14 +19,14 @@
|
|
|
18
19
|
"clean:build": "tamagui-build clean:build"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
22
|
-
"@tamagui/stacks": "^1.0.1-beta.
|
|
22
|
+
"@tamagui/core": "^1.0.1-beta.60",
|
|
23
|
+
"@tamagui/stacks": "^1.0.1-beta.60"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"react": "*"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
29
|
+
"@tamagui/build": "^1.0.1-beta.60",
|
|
29
30
|
"react": "*"
|
|
30
31
|
},
|
|
31
32
|
"publishConfig": {
|
package/src/Circle.tsx
ADDED
package/src/Square.tsx
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { GetProps, styled } from '@tamagui/core'
|
|
2
|
+
import { ThemeableStack } from '@tamagui/stacks'
|
|
3
|
+
|
|
4
|
+
import { getShapeSize } from './getShapeSize'
|
|
5
|
+
|
|
6
|
+
export const Square = styled(ThemeableStack, {
|
|
7
|
+
name: 'Square',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
overflow: 'hidden',
|
|
11
|
+
backgrounded: true,
|
|
12
|
+
|
|
13
|
+
variants: {
|
|
14
|
+
circular: {
|
|
15
|
+
true: {
|
|
16
|
+
borderRadius: 100_000,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
size: {
|
|
21
|
+
'...size': getShapeSize,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
export type SquareProps = GetProps<typeof Square>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SizeVariantSpreadFunction } from '@tamagui/core'
|
|
2
|
+
import { SizableStackProps } from '@tamagui/stacks'
|
|
3
|
+
|
|
4
|
+
export const getShapeSize: SizeVariantSpreadFunction<SizableStackProps> = (size, { tokens }) => {
|
|
5
|
+
const width = tokens.size[size] ?? size
|
|
6
|
+
const height = tokens.size[size] ?? size
|
|
7
|
+
return {
|
|
8
|
+
width,
|
|
9
|
+
height,
|
|
10
|
+
minWidth: width,
|
|
11
|
+
maxWidth: width,
|
|
12
|
+
maxHeight: height,
|
|
13
|
+
minHeight: height,
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/index.ts
ADDED