@tamagui/stacks 1.27.2 → 1.27.3
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 +4 -4
- package/dist/esm/SizableStack.mjs +0 -42
- package/dist/esm/Stacks.mjs +0 -42
- package/dist/esm/ThemeableStack.mjs +0 -54
- package/dist/esm/getElevation.mjs +0 -41
- package/dist/esm/index.mjs +0 -4
- package/dist/esm/variants.mjs +0 -98
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/stacks",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.3",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@tamagui/core": "1.27.
|
|
32
|
+
"@tamagui/core": "1.27.3"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "*"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@tamagui/build": "1.27.
|
|
39
|
-
"@tamagui/get-button-sized": "1.27.
|
|
38
|
+
"@tamagui/build": "1.27.3",
|
|
39
|
+
"@tamagui/get-button-sized": "1.27.3",
|
|
40
40
|
"react": "^18.2.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { styled } from "@tamagui/core";
|
|
2
|
-
import { getButtonSized } from "@tamagui/get-button-sized";
|
|
3
|
-
import { XStack } from "./Stacks";
|
|
4
|
-
import {
|
|
5
|
-
bordered,
|
|
6
|
-
circular,
|
|
7
|
-
elevate,
|
|
8
|
-
focusTheme,
|
|
9
|
-
hoverTheme,
|
|
10
|
-
pressTheme
|
|
11
|
-
} from "./variants";
|
|
12
|
-
const SizableStack = styled(XStack, {
|
|
13
|
-
name: "SizableStack",
|
|
14
|
-
variants: {
|
|
15
|
-
unstyled: {
|
|
16
|
-
true: {
|
|
17
|
-
hoverTheme: false,
|
|
18
|
-
pressTheme: false,
|
|
19
|
-
focusTheme: false,
|
|
20
|
-
elevate: false,
|
|
21
|
-
bordered: false
|
|
22
|
-
},
|
|
23
|
-
false: {
|
|
24
|
-
backgroundColor: "$background",
|
|
25
|
-
flexShrink: 1
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
hoverTheme,
|
|
29
|
-
pressTheme,
|
|
30
|
-
focusTheme,
|
|
31
|
-
circular,
|
|
32
|
-
elevate,
|
|
33
|
-
bordered,
|
|
34
|
-
size: {
|
|
35
|
-
"...size": getButtonSized
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
export {
|
|
40
|
-
SizableStack
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=SizableStack.mjs.map
|
package/dist/esm/Stacks.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Stack, styled } from "@tamagui/core";
|
|
2
|
-
import { getElevation } from "./getElevation";
|
|
3
|
-
const fullscreenStyle = {
|
|
4
|
-
position: "absolute",
|
|
5
|
-
top: 0,
|
|
6
|
-
left: 0,
|
|
7
|
-
right: 0,
|
|
8
|
-
bottom: 0
|
|
9
|
-
};
|
|
10
|
-
const variants = {
|
|
11
|
-
fullscreen: {
|
|
12
|
-
true: fullscreenStyle
|
|
13
|
-
},
|
|
14
|
-
elevation: {
|
|
15
|
-
"...size": getElevation
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const YStack = styled(Stack, {
|
|
19
|
-
flexDirection: "column",
|
|
20
|
-
variants
|
|
21
|
-
});
|
|
22
|
-
const XStack = styled(Stack, {
|
|
23
|
-
flexDirection: "row",
|
|
24
|
-
variants
|
|
25
|
-
});
|
|
26
|
-
const ZStack = styled(
|
|
27
|
-
YStack,
|
|
28
|
-
{
|
|
29
|
-
position: "relative"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
neverFlatten: true,
|
|
33
|
-
isZStack: true
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
export {
|
|
37
|
-
XStack,
|
|
38
|
-
YStack,
|
|
39
|
-
ZStack,
|
|
40
|
-
fullscreenStyle
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=Stacks.mjs.map
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { styled } from "@tamagui/core";
|
|
2
|
-
import { YStack } from "./Stacks";
|
|
3
|
-
import {
|
|
4
|
-
bordered,
|
|
5
|
-
circular,
|
|
6
|
-
elevate,
|
|
7
|
-
focusTheme,
|
|
8
|
-
hoverTheme,
|
|
9
|
-
padded,
|
|
10
|
-
pressTheme,
|
|
11
|
-
radiused
|
|
12
|
-
} from "./variants";
|
|
13
|
-
const chromelessStyle = {
|
|
14
|
-
backgroundColor: "transparent",
|
|
15
|
-
borderColor: "transparent",
|
|
16
|
-
shadowColor: "transparent"
|
|
17
|
-
};
|
|
18
|
-
const themeableVariants = {
|
|
19
|
-
backgrounded: {
|
|
20
|
-
true: {
|
|
21
|
-
backgroundColor: "$background"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
radiused,
|
|
25
|
-
hoverTheme,
|
|
26
|
-
pressTheme,
|
|
27
|
-
focusTheme,
|
|
28
|
-
circular,
|
|
29
|
-
padded,
|
|
30
|
-
elevate,
|
|
31
|
-
bordered,
|
|
32
|
-
transparent: {
|
|
33
|
-
true: {
|
|
34
|
-
backgroundColor: "transparent"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
chromeless: {
|
|
38
|
-
true: chromelessStyle,
|
|
39
|
-
all: {
|
|
40
|
-
...chromelessStyle,
|
|
41
|
-
hoverStyle: chromelessStyle,
|
|
42
|
-
pressStyle: chromelessStyle,
|
|
43
|
-
focusStyle: chromelessStyle
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const ThemeableStack = styled(YStack, {
|
|
48
|
-
variants: themeableVariants
|
|
49
|
-
});
|
|
50
|
-
export {
|
|
51
|
-
ThemeableStack,
|
|
52
|
-
themeableVariants
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=ThemeableStack.mjs.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getVariableValue,
|
|
3
|
-
isAndroid,
|
|
4
|
-
isVariable
|
|
5
|
-
} from "@tamagui/core";
|
|
6
|
-
const getElevation = (size, extras) => {
|
|
7
|
-
if (!size)
|
|
8
|
-
return;
|
|
9
|
-
const { tokens } = extras;
|
|
10
|
-
const token = tokens.size[size];
|
|
11
|
-
const sizeNum = isVariable(token) ? +token.val : size;
|
|
12
|
-
return getSizedElevation(sizeNum, extras);
|
|
13
|
-
};
|
|
14
|
-
const getSizedElevation = (val, { theme, tokens }) => {
|
|
15
|
-
let num = 0;
|
|
16
|
-
if (val === true) {
|
|
17
|
-
const val2 = getVariableValue(tokens.size["true"]);
|
|
18
|
-
if (typeof val2 === "number") {
|
|
19
|
-
num = val2;
|
|
20
|
-
} else {
|
|
21
|
-
num = 10;
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
num = +val;
|
|
25
|
-
}
|
|
26
|
-
const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
27
|
-
const shadow = {
|
|
28
|
-
shadowColor: theme.shadowColor,
|
|
29
|
-
shadowRadius,
|
|
30
|
-
shadowOffset: { height, width: 0 },
|
|
31
|
-
...isAndroid ? {
|
|
32
|
-
elevationAndroid: 2 * height
|
|
33
|
-
} : {}
|
|
34
|
-
};
|
|
35
|
-
return shadow;
|
|
36
|
-
};
|
|
37
|
-
export {
|
|
38
|
-
getElevation,
|
|
39
|
-
getSizedElevation
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=getElevation.mjs.map
|
package/dist/esm/index.mjs
DELETED
package/dist/esm/variants.mjs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { getElevation } from "./getElevation";
|
|
2
|
-
const elevate = {
|
|
3
|
-
true: (_, extras) => {
|
|
4
|
-
return getElevation(extras.props["size"], extras);
|
|
5
|
-
}
|
|
6
|
-
};
|
|
7
|
-
const bordered = (val, { props }) => {
|
|
8
|
-
return {
|
|
9
|
-
// TODO size it with size in '...size'
|
|
10
|
-
borderWidth: typeof val === "number" ? val : 1,
|
|
11
|
-
borderColor: "$borderColor",
|
|
12
|
-
...props.hoverTheme && {
|
|
13
|
-
hoverStyle: {
|
|
14
|
-
borderColor: "$borderColorHover"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
...props.pressTheme && {
|
|
18
|
-
pressStyle: {
|
|
19
|
-
borderColor: "$borderColorPress"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
...props.focusTheme && {
|
|
23
|
-
focusStyle: {
|
|
24
|
-
borderColor: "$borderColorFocus"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
const padded = {
|
|
30
|
-
true: (_, extras) => {
|
|
31
|
-
const { tokens, props } = extras;
|
|
32
|
-
return {
|
|
33
|
-
padding: tokens.space[props.size] || tokens.space["$true"]
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const radiused = {
|
|
38
|
-
true: (_, extras) => {
|
|
39
|
-
const { tokens, props } = extras;
|
|
40
|
-
return {
|
|
41
|
-
borderRadius: tokens.radius[props.size] || tokens.radius["$true"]
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const circular = {
|
|
46
|
-
true: (_, { props, tokens }) => {
|
|
47
|
-
const size = tokens.size[props.size || "$true"];
|
|
48
|
-
return {
|
|
49
|
-
width: size,
|
|
50
|
-
height: size,
|
|
51
|
-
maxWidth: size,
|
|
52
|
-
maxHeight: size,
|
|
53
|
-
minWidth: size,
|
|
54
|
-
minHeight: size,
|
|
55
|
-
borderRadius: 1e5,
|
|
56
|
-
padding: 0
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const hoverTheme = {
|
|
61
|
-
true: {
|
|
62
|
-
hoverStyle: {
|
|
63
|
-
backgroundColor: "$backgroundHover",
|
|
64
|
-
borderColor: "$borderColorHover"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
false: {}
|
|
68
|
-
};
|
|
69
|
-
const pressTheme = {
|
|
70
|
-
true: {
|
|
71
|
-
cursor: "pointer",
|
|
72
|
-
pressStyle: {
|
|
73
|
-
backgroundColor: "$backgroundPress",
|
|
74
|
-
borderColor: "$borderColorPress"
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
false: {}
|
|
78
|
-
};
|
|
79
|
-
const focusTheme = {
|
|
80
|
-
true: {
|
|
81
|
-
focusStyle: {
|
|
82
|
-
backgroundColor: "$backgroundFocus",
|
|
83
|
-
borderColor: "$borderColorFocus"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
false: {}
|
|
87
|
-
};
|
|
88
|
-
export {
|
|
89
|
-
bordered,
|
|
90
|
-
circular,
|
|
91
|
-
elevate,
|
|
92
|
-
focusTheme,
|
|
93
|
-
hoverTheme,
|
|
94
|
-
padded,
|
|
95
|
-
pressTheme,
|
|
96
|
-
radiused
|
|
97
|
-
};
|
|
98
|
-
//# sourceMappingURL=variants.mjs.map
|