@tamagui/shapes 1.2.9 → 1.2.10
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/dist/esm/Circle.mjs +10 -0
- package/dist/esm/Circle.mjs.map +7 -0
- package/dist/esm/Square.mjs +22 -0
- package/dist/esm/Square.mjs.map +7 -0
- package/dist/esm/getShapeSize.mjs +16 -0
- package/dist/esm/getShapeSize.mjs.map +7 -0
- package/dist/esm/index.mjs +4 -0
- package/dist/esm/index.mjs.map +7 -0
- package/dist/jsx/Circle.mjs +10 -0
- package/dist/jsx/Circle.mjs.map +7 -0
- package/dist/jsx/Square.mjs +22 -0
- package/dist/jsx/Square.mjs.map +7 -0
- package/dist/jsx/getShapeSize.mjs +16 -0
- package/dist/jsx/getShapeSize.mjs.map +7 -0
- package/dist/jsx/index.mjs +4 -0
- package/dist/jsx/index.mjs.map +7 -0
- package/package.json +4 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Circle.tsx"],
|
|
4
|
+
"sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\n\nimport { Square } from './Square'\n\nexport const Circle = styled(Square, {\n name: 'Circle',\n circular: true,\n})\n\nexport type CircleProps = GetProps<typeof Circle>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAmB,cAAc;AAEjC,SAAS,cAAc;AAEhB,MAAM,SAAS,OAAO,QAAQ;AAAA,EACnC,MAAM;AAAA,EACN,UAAU;AACZ,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { styled } from "@tamagui/core";
|
|
2
|
+
import { ThemeableStack } from "@tamagui/stacks";
|
|
3
|
+
import { getShapeSize } from "./getShapeSize";
|
|
4
|
+
const Square = styled(ThemeableStack, {
|
|
5
|
+
name: "Square",
|
|
6
|
+
alignItems: "center",
|
|
7
|
+
justifyContent: "center",
|
|
8
|
+
variants: {
|
|
9
|
+
circular: {
|
|
10
|
+
true: {
|
|
11
|
+
borderRadius: 1e5
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
"...size": getShapeSize
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
Square
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=Square.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Square.tsx"],
|
|
4
|
+
"sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\nimport { ThemeableStack } from '@tamagui/stacks'\n\nimport { getShapeSize } from './getShapeSize'\n\nexport const Square = styled(ThemeableStack, {\n name: 'Square',\n alignItems: 'center',\n justifyContent: 'center',\n\n variants: {\n circular: {\n true: {\n borderRadius: 100_000,\n },\n },\n\n size: {\n '...size': getShapeSize,\n },\n } as const,\n})\n\nexport type SquareProps = GetProps<typeof Square>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAmB,cAAc;AACjC,SAAS,sBAAsB;AAE/B,SAAS,oBAAoB;AAEtB,MAAM,SAAS,OAAO,gBAAgB;AAAA,EAC3C,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAEhB,UAAU;AAAA,IACR,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,cAAc;AAAA,MAChB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const getShapeSize = (size, { tokens }) => {
|
|
2
|
+
const width = tokens.size[size] ?? size;
|
|
3
|
+
const height = tokens.size[size] ?? size;
|
|
4
|
+
return {
|
|
5
|
+
width,
|
|
6
|
+
height,
|
|
7
|
+
minWidth: width,
|
|
8
|
+
maxWidth: width,
|
|
9
|
+
maxHeight: height,
|
|
10
|
+
minHeight: height
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
getShapeSize
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=getShapeSize.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/getShapeSize.tsx"],
|
|
4
|
+
"sourcesContent": ["import { SizeVariantSpreadFunction } from '@tamagui/core'\nimport { SizableStackProps } from '@tamagui/stacks'\n\nexport const getShapeSize: SizeVariantSpreadFunction<SizableStackProps> = (\n size,\n { tokens },\n) => {\n const width = tokens.size[size] ?? size\n const height = tokens.size[size] ?? size\n return {\n width,\n height,\n minWidth: width,\n maxWidth: width,\n maxHeight: height,\n minHeight: height,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAGO,MAAM,eAA6D,CACxE,MACA,EAAE,OAAO,MACN;AACH,QAAM,QAAQ,OAAO,KAAK,IAAI,KAAK;AACnC,QAAM,SAAS,OAAO,KAAK,IAAI,KAAK;AACpC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Circle.tsx"],
|
|
4
|
+
"sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\n\nimport { Square } from './Square'\n\nexport const Circle = styled(Square, {\n name: 'Circle',\n circular: true,\n})\n\nexport type CircleProps = GetProps<typeof Circle>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAmB,cAAc;AAEjC,SAAS,cAAc;AAEhB,MAAM,SAAS,OAAO,QAAQ;AAAA,EACnC,MAAM;AAAA,EACN,UAAU;AACZ,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { styled } from "@tamagui/core";
|
|
2
|
+
import { ThemeableStack } from "@tamagui/stacks";
|
|
3
|
+
import { getShapeSize } from "./getShapeSize";
|
|
4
|
+
const Square = styled(ThemeableStack, {
|
|
5
|
+
name: "Square",
|
|
6
|
+
alignItems: "center",
|
|
7
|
+
justifyContent: "center",
|
|
8
|
+
variants: {
|
|
9
|
+
circular: {
|
|
10
|
+
true: {
|
|
11
|
+
borderRadius: 1e5
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
"...size": getShapeSize
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
Square
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=Square.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Square.tsx"],
|
|
4
|
+
"sourcesContent": ["import { GetProps, styled } from '@tamagui/core'\nimport { ThemeableStack } from '@tamagui/stacks'\n\nimport { getShapeSize } from './getShapeSize'\n\nexport const Square = styled(ThemeableStack, {\n name: 'Square',\n alignItems: 'center',\n justifyContent: 'center',\n\n variants: {\n circular: {\n true: {\n borderRadius: 100_000,\n },\n },\n\n size: {\n '...size': getShapeSize,\n },\n } as const,\n})\n\nexport type SquareProps = GetProps<typeof Square>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAmB,cAAc;AACjC,SAAS,sBAAsB;AAE/B,SAAS,oBAAoB;AAEtB,MAAM,SAAS,OAAO,gBAAgB;AAAA,EAC3C,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAEhB,UAAU;AAAA,IACR,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,cAAc;AAAA,MAChB;AAAA,IACF;AAAA,IAEA,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const getShapeSize = (size, { tokens }) => {
|
|
2
|
+
const width = tokens.size[size] ?? size;
|
|
3
|
+
const height = tokens.size[size] ?? size;
|
|
4
|
+
return {
|
|
5
|
+
width,
|
|
6
|
+
height,
|
|
7
|
+
minWidth: width,
|
|
8
|
+
maxWidth: width,
|
|
9
|
+
maxHeight: height,
|
|
10
|
+
minHeight: height
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
getShapeSize
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=getShapeSize.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/getShapeSize.tsx"],
|
|
4
|
+
"sourcesContent": ["import { SizeVariantSpreadFunction } from '@tamagui/core'\nimport { SizableStackProps } from '@tamagui/stacks'\n\nexport const getShapeSize: SizeVariantSpreadFunction<SizableStackProps> = (\n size,\n { tokens },\n) => {\n const width = tokens.size[size] ?? size\n const height = tokens.size[size] ?? size\n return {\n width,\n height,\n minWidth: width,\n maxWidth: width,\n maxHeight: height,\n minHeight: height,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAGO,MAAM,eAA6D,CACxE,MACA,EAAE,OAAO,MACN;AACH,QAAM,QAAQ,OAAO,KAAK,IAAI,KAAK;AACnC,QAAM,SAAS,OAAO,KAAK,IAAI,KAAK;AACpC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/shapes",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.10",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"clean:build": "tamagui-build clean:build"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tamagui/core": "^1.2.
|
|
27
|
-
"@tamagui/stacks": "^1.2.
|
|
26
|
+
"@tamagui/core": "^1.2.10",
|
|
27
|
+
"@tamagui/stacks": "^1.2.10"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "*"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tamagui/build": "^1.2.
|
|
33
|
+
"@tamagui/build": "^1.2.10",
|
|
34
34
|
"react": "^18.2.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|