@tamagui/stacks 1.114.3 → 1.115.0
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/cjs/{NestingContext.js → NestingContext.cjs} +22 -14
- package/dist/cjs/{SizableStack.js → SizableStack.cjs} +20 -12
- package/dist/cjs/Stacks.cjs +70 -0
- package/dist/cjs/ThemeableStack.cjs +69 -0
- package/dist/cjs/getElevation.cjs +59 -0
- package/dist/cjs/index.cjs +21 -0
- package/dist/cjs/variants.cjs +130 -0
- package/package.json +6 -5
- package/dist/cjs/Stacks.js +0 -65
- package/dist/cjs/ThemeableStack.js +0 -60
- package/dist/cjs/getElevation.js +0 -45
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/variants.js +0 -107
- /package/dist/cjs/{NestingContext.js.map → NestingContext.cjs.map} +0 -0
- /package/dist/cjs/{SizableStack.js.map → SizableStack.cjs.map} +0 -0
- /package/dist/cjs/{Stacks.js.map → Stacks.cjs.map} +0 -0
- /package/dist/cjs/{ThemeableStack.js.map → ThemeableStack.cjs.map} +0 -0
- /package/dist/cjs/{getElevation.js.map → getElevation.cjs.map} +0 -0
- /package/dist/cjs/{index.js.map → index.cjs.map} +0 -0
- /package/dist/cjs/{variants.js.map → variants.cjs.map} +0 -0
|
@@ -2,29 +2,37 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
15
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
23
32
|
var NestingContext_exports = {};
|
|
24
33
|
__export(NestingContext_exports, {
|
|
25
34
|
ButtonNestingContext: () => ButtonNestingContext
|
|
26
35
|
});
|
|
27
36
|
module.exports = __toCommonJS(NestingContext_exports);
|
|
28
37
|
var import_react = __toESM(require("react"));
|
|
29
|
-
const ButtonNestingContext = import_react.default.createContext(!1);
|
|
30
|
-
//# sourceMappingURL=NestingContext.js.map
|
|
38
|
+
const ButtonNestingContext = import_react.default.createContext(!1);
|
|
@@ -3,21 +3,30 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
15
21
|
var SizableStack_exports = {};
|
|
16
22
|
__export(SizableStack_exports, {
|
|
17
23
|
SizableStack: () => SizableStack
|
|
18
24
|
});
|
|
19
25
|
module.exports = __toCommonJS(SizableStack_exports);
|
|
20
|
-
var import_core = require("@tamagui/core"),
|
|
26
|
+
var import_core = require("@tamagui/core"),
|
|
27
|
+
import_get_button_sized = require("@tamagui/get-button-sized"),
|
|
28
|
+
import_Stacks = require("./Stacks.cjs"),
|
|
29
|
+
import_variants = require("./variants.cjs");
|
|
21
30
|
const SizableStack = (0, import_core.styled)(import_Stacks.XStack, {
|
|
22
31
|
name: "SizableStack",
|
|
23
32
|
variants: {
|
|
@@ -40,5 +49,4 @@ const SizableStack = (0, import_core.styled)(import_Stacks.XStack, {
|
|
|
40
49
|
"...size": (val, extras) => (0, import_get_button_sized.getButtonSized)(val, extras)
|
|
41
50
|
}
|
|
42
51
|
}
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=SizableStack.js.map
|
|
52
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var Stacks_exports = {};
|
|
22
|
+
__export(Stacks_exports, {
|
|
23
|
+
XStack: () => XStack,
|
|
24
|
+
YStack: () => YStack,
|
|
25
|
+
ZStack: () => ZStack,
|
|
26
|
+
fullscreenStyle: () => fullscreenStyle
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(Stacks_exports);
|
|
29
|
+
var import_core = require("@tamagui/core"),
|
|
30
|
+
import_getElevation = require("./getElevation.cjs");
|
|
31
|
+
const fullscreenStyle = {
|
|
32
|
+
position: "absolute",
|
|
33
|
+
top: 0,
|
|
34
|
+
left: 0,
|
|
35
|
+
right: 0,
|
|
36
|
+
bottom: 0
|
|
37
|
+
},
|
|
38
|
+
getInset = val => val && typeof val == "object" ? val : {
|
|
39
|
+
top: val,
|
|
40
|
+
left: val,
|
|
41
|
+
bottom: val,
|
|
42
|
+
right: val
|
|
43
|
+
},
|
|
44
|
+
variants = {
|
|
45
|
+
fullscreen: {
|
|
46
|
+
true: fullscreenStyle
|
|
47
|
+
},
|
|
48
|
+
elevation: {
|
|
49
|
+
"...size": import_getElevation.getElevation,
|
|
50
|
+
":number": import_getElevation.getElevation
|
|
51
|
+
},
|
|
52
|
+
inset: getInset
|
|
53
|
+
},
|
|
54
|
+
YStack = (0, import_core.styled)(import_core.View, {
|
|
55
|
+
flexDirection: "column",
|
|
56
|
+
variants
|
|
57
|
+
});
|
|
58
|
+
YStack.displayName = "YStack";
|
|
59
|
+
const XStack = (0, import_core.styled)(import_core.View, {
|
|
60
|
+
flexDirection: "row",
|
|
61
|
+
variants
|
|
62
|
+
});
|
|
63
|
+
XStack.displayName = "XStack";
|
|
64
|
+
const ZStack = (0, import_core.styled)(YStack, {
|
|
65
|
+
position: "relative"
|
|
66
|
+
}, {
|
|
67
|
+
neverFlatten: !0,
|
|
68
|
+
isZStack: !0
|
|
69
|
+
});
|
|
70
|
+
ZStack.displayName = "ZStack";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var ThemeableStack_exports = {};
|
|
22
|
+
__export(ThemeableStack_exports, {
|
|
23
|
+
ThemeableStack: () => ThemeableStack,
|
|
24
|
+
themeableVariants: () => themeableVariants
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(ThemeableStack_exports);
|
|
27
|
+
var import_core = require("@tamagui/core"),
|
|
28
|
+
import_Stacks = require("./Stacks.cjs"),
|
|
29
|
+
import_variants = require("./variants.cjs");
|
|
30
|
+
const chromelessStyle = {
|
|
31
|
+
backgroundColor: "transparent",
|
|
32
|
+
borderColor: "transparent",
|
|
33
|
+
shadowColor: "transparent",
|
|
34
|
+
hoverStyle: {
|
|
35
|
+
borderColor: "transparent"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
themeableVariants = {
|
|
39
|
+
backgrounded: {
|
|
40
|
+
true: {
|
|
41
|
+
backgroundColor: "$background"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
radiused: import_variants.radiused,
|
|
45
|
+
hoverTheme: import_variants.hoverTheme,
|
|
46
|
+
pressTheme: import_variants.pressTheme,
|
|
47
|
+
focusTheme: import_variants.focusTheme,
|
|
48
|
+
circular: import_variants.circular,
|
|
49
|
+
padded: import_variants.padded,
|
|
50
|
+
elevate: import_variants.elevate,
|
|
51
|
+
bordered: import_variants.bordered,
|
|
52
|
+
transparent: {
|
|
53
|
+
true: {
|
|
54
|
+
backgroundColor: "transparent"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
chromeless: {
|
|
58
|
+
true: chromelessStyle,
|
|
59
|
+
all: {
|
|
60
|
+
...chromelessStyle,
|
|
61
|
+
hoverStyle: chromelessStyle,
|
|
62
|
+
pressStyle: chromelessStyle,
|
|
63
|
+
focusStyle: chromelessStyle
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
ThemeableStack = (0, import_core.styled)(import_Stacks.YStack, {
|
|
68
|
+
variants: themeableVariants
|
|
69
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var getElevation_exports = {};
|
|
22
|
+
__export(getElevation_exports, {
|
|
23
|
+
getElevation: () => getElevation,
|
|
24
|
+
getSizedElevation: () => getSizedElevation
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(getElevation_exports);
|
|
27
|
+
var import_core = require("@tamagui/core");
|
|
28
|
+
const getElevation = (size, extras) => {
|
|
29
|
+
if (!size) return;
|
|
30
|
+
const {
|
|
31
|
+
tokens
|
|
32
|
+
} = extras,
|
|
33
|
+
token = tokens.size[size],
|
|
34
|
+
sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
|
|
35
|
+
return getSizedElevation(sizeNum, extras);
|
|
36
|
+
},
|
|
37
|
+
getSizedElevation = (val, {
|
|
38
|
+
theme,
|
|
39
|
+
tokens
|
|
40
|
+
}) => {
|
|
41
|
+
let num = 0;
|
|
42
|
+
if (val === !0) {
|
|
43
|
+
const val2 = (0, import_core.getVariableValue)(tokens.size.true);
|
|
44
|
+
typeof val2 == "number" ? num = val2 : num = 10;
|
|
45
|
+
} else num = +val;
|
|
46
|
+
if (num === 0) return;
|
|
47
|
+
const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
48
|
+
return {
|
|
49
|
+
shadowColor: theme.shadowColor,
|
|
50
|
+
shadowRadius,
|
|
51
|
+
shadowOffset: {
|
|
52
|
+
height,
|
|
53
|
+
width: 0
|
|
54
|
+
},
|
|
55
|
+
...(import_core.isAndroid ? {
|
|
56
|
+
elevationAndroid: 2 * height
|
|
57
|
+
} : {})
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
},
|
|
12
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
+
value: !0
|
|
15
|
+
}), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
__reExport(src_exports, require("./Stacks.cjs"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("./SizableStack.cjs"), module.exports);
|
|
20
|
+
__reExport(src_exports, require("./ThemeableStack.cjs"), module.exports);
|
|
21
|
+
__reExport(src_exports, require("./NestingContext.cjs"), module.exports);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var variants_exports = {};
|
|
22
|
+
__export(variants_exports, {
|
|
23
|
+
bordered: () => bordered,
|
|
24
|
+
circular: () => circular,
|
|
25
|
+
elevate: () => elevate,
|
|
26
|
+
focusTheme: () => focusTheme,
|
|
27
|
+
hoverTheme: () => hoverTheme,
|
|
28
|
+
padded: () => padded,
|
|
29
|
+
pressTheme: () => pressTheme,
|
|
30
|
+
radiused: () => radiused
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(variants_exports);
|
|
33
|
+
var import_getElevation = require("./getElevation.cjs");
|
|
34
|
+
const elevate = {
|
|
35
|
+
true: (_, extras) => (0, import_getElevation.getElevation)(extras.props.size, extras)
|
|
36
|
+
},
|
|
37
|
+
bordered = (val, {
|
|
38
|
+
props
|
|
39
|
+
}) => ({
|
|
40
|
+
// TODO size it with size in '...size'
|
|
41
|
+
borderWidth: typeof val == "number" ? val : 1,
|
|
42
|
+
borderColor: "$borderColor",
|
|
43
|
+
...(props.hoverTheme && {
|
|
44
|
+
hoverStyle: {
|
|
45
|
+
borderColor: "$borderColorHover"
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
...(props.pressTheme && {
|
|
49
|
+
pressStyle: {
|
|
50
|
+
borderColor: "$borderColorPress"
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
...(props.focusTheme && {
|
|
54
|
+
focusStyle: {
|
|
55
|
+
borderColor: "$borderColorFocus"
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
}),
|
|
59
|
+
padded = {
|
|
60
|
+
true: (_, extras) => {
|
|
61
|
+
const {
|
|
62
|
+
tokens,
|
|
63
|
+
props
|
|
64
|
+
} = extras;
|
|
65
|
+
return {
|
|
66
|
+
padding: tokens.space[props.size] || tokens.space.$true
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
radiused = {
|
|
71
|
+
true: (_, extras) => {
|
|
72
|
+
const {
|
|
73
|
+
tokens,
|
|
74
|
+
props
|
|
75
|
+
} = extras;
|
|
76
|
+
return {
|
|
77
|
+
borderRadius: tokens.radius[props.size] || tokens.radius.$true
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
circularStyle = {
|
|
82
|
+
borderRadius: 1e5,
|
|
83
|
+
padding: 0
|
|
84
|
+
},
|
|
85
|
+
circular = {
|
|
86
|
+
true: (_, {
|
|
87
|
+
props,
|
|
88
|
+
tokens
|
|
89
|
+
}) => {
|
|
90
|
+
if (!("size" in props)) return circularStyle;
|
|
91
|
+
const size = typeof props.size == "number" ? props.size : tokens.size[props.size];
|
|
92
|
+
return {
|
|
93
|
+
...circularStyle,
|
|
94
|
+
width: size,
|
|
95
|
+
height: size,
|
|
96
|
+
maxWidth: size,
|
|
97
|
+
maxHeight: size,
|
|
98
|
+
minWidth: size,
|
|
99
|
+
minHeight: size
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
hoverTheme = {
|
|
104
|
+
true: {
|
|
105
|
+
hoverStyle: {
|
|
106
|
+
backgroundColor: "$backgroundHover",
|
|
107
|
+
borderColor: "$borderColorHover"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
false: {}
|
|
111
|
+
},
|
|
112
|
+
pressTheme = {
|
|
113
|
+
true: {
|
|
114
|
+
cursor: "pointer",
|
|
115
|
+
pressStyle: {
|
|
116
|
+
backgroundColor: "$backgroundPress",
|
|
117
|
+
borderColor: "$borderColorPress"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
false: {}
|
|
121
|
+
},
|
|
122
|
+
focusTheme = {
|
|
123
|
+
true: {
|
|
124
|
+
focusStyle: {
|
|
125
|
+
backgroundColor: "$backgroundFocus",
|
|
126
|
+
borderColor: "$borderColorFocus"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
false: {}
|
|
130
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/stacks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.115.0",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -29,15 +29,16 @@
|
|
|
29
29
|
"react-native": "./dist/cjs/index.native.js",
|
|
30
30
|
"types": "./types/index.d.ts",
|
|
31
31
|
"import": "./dist/esm/index.mjs",
|
|
32
|
-
"require": "./dist/cjs/index.
|
|
32
|
+
"require": "./dist/cjs/index.cjs",
|
|
33
|
+
"default": "./dist/cjs/index.native.js"
|
|
33
34
|
}
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"@tamagui/core": "1.
|
|
37
|
+
"@tamagui/core": "1.115.0"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@tamagui/build": "1.
|
|
40
|
-
"@tamagui/get-button-sized": "1.
|
|
40
|
+
"@tamagui/build": "1.115.0",
|
|
41
|
+
"@tamagui/get-button-sized": "1.115.0",
|
|
41
42
|
"react": "^18.2.0 || ^19.0.0"
|
|
42
43
|
},
|
|
43
44
|
"publishConfig": {
|
package/dist/cjs/Stacks.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var Stacks_exports = {};
|
|
16
|
-
__export(Stacks_exports, {
|
|
17
|
-
XStack: () => XStack,
|
|
18
|
-
YStack: () => YStack,
|
|
19
|
-
ZStack: () => ZStack,
|
|
20
|
-
fullscreenStyle: () => fullscreenStyle
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(Stacks_exports);
|
|
23
|
-
var import_core = require("@tamagui/core"), import_getElevation = require("./getElevation");
|
|
24
|
-
const fullscreenStyle = {
|
|
25
|
-
position: "absolute",
|
|
26
|
-
top: 0,
|
|
27
|
-
left: 0,
|
|
28
|
-
right: 0,
|
|
29
|
-
bottom: 0
|
|
30
|
-
}, getInset = (val) => val && typeof val == "object" ? val : {
|
|
31
|
-
top: val,
|
|
32
|
-
left: val,
|
|
33
|
-
bottom: val,
|
|
34
|
-
right: val
|
|
35
|
-
}, variants = {
|
|
36
|
-
fullscreen: {
|
|
37
|
-
true: fullscreenStyle
|
|
38
|
-
},
|
|
39
|
-
elevation: {
|
|
40
|
-
"...size": import_getElevation.getElevation,
|
|
41
|
-
":number": import_getElevation.getElevation
|
|
42
|
-
},
|
|
43
|
-
inset: getInset
|
|
44
|
-
}, YStack = (0, import_core.styled)(import_core.View, {
|
|
45
|
-
flexDirection: "column",
|
|
46
|
-
variants
|
|
47
|
-
});
|
|
48
|
-
YStack.displayName = "YStack";
|
|
49
|
-
const XStack = (0, import_core.styled)(import_core.View, {
|
|
50
|
-
flexDirection: "row",
|
|
51
|
-
variants
|
|
52
|
-
});
|
|
53
|
-
XStack.displayName = "XStack";
|
|
54
|
-
const ZStack = (0, import_core.styled)(
|
|
55
|
-
YStack,
|
|
56
|
-
{
|
|
57
|
-
position: "relative"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
neverFlatten: !0,
|
|
61
|
-
isZStack: !0
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
ZStack.displayName = "ZStack";
|
|
65
|
-
//# sourceMappingURL=Stacks.js.map
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var ThemeableStack_exports = {};
|
|
16
|
-
__export(ThemeableStack_exports, {
|
|
17
|
-
ThemeableStack: () => ThemeableStack,
|
|
18
|
-
themeableVariants: () => themeableVariants
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(ThemeableStack_exports);
|
|
21
|
-
var import_core = require("@tamagui/core"), import_Stacks = require("./Stacks"), import_variants = require("./variants");
|
|
22
|
-
const chromelessStyle = {
|
|
23
|
-
backgroundColor: "transparent",
|
|
24
|
-
borderColor: "transparent",
|
|
25
|
-
shadowColor: "transparent",
|
|
26
|
-
hoverStyle: {
|
|
27
|
-
borderColor: "transparent"
|
|
28
|
-
}
|
|
29
|
-
}, themeableVariants = {
|
|
30
|
-
backgrounded: {
|
|
31
|
-
true: {
|
|
32
|
-
backgroundColor: "$background"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
radiused: import_variants.radiused,
|
|
36
|
-
hoverTheme: import_variants.hoverTheme,
|
|
37
|
-
pressTheme: import_variants.pressTheme,
|
|
38
|
-
focusTheme: import_variants.focusTheme,
|
|
39
|
-
circular: import_variants.circular,
|
|
40
|
-
padded: import_variants.padded,
|
|
41
|
-
elevate: import_variants.elevate,
|
|
42
|
-
bordered: import_variants.bordered,
|
|
43
|
-
transparent: {
|
|
44
|
-
true: {
|
|
45
|
-
backgroundColor: "transparent"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
chromeless: {
|
|
49
|
-
true: chromelessStyle,
|
|
50
|
-
all: {
|
|
51
|
-
...chromelessStyle,
|
|
52
|
-
hoverStyle: chromelessStyle,
|
|
53
|
-
pressStyle: chromelessStyle,
|
|
54
|
-
focusStyle: chromelessStyle
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}, ThemeableStack = (0, import_core.styled)(import_Stacks.YStack, {
|
|
58
|
-
variants: themeableVariants
|
|
59
|
-
});
|
|
60
|
-
//# sourceMappingURL=ThemeableStack.js.map
|
package/dist/cjs/getElevation.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var getElevation_exports = {};
|
|
16
|
-
__export(getElevation_exports, {
|
|
17
|
-
getElevation: () => getElevation,
|
|
18
|
-
getSizedElevation: () => getSizedElevation
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(getElevation_exports);
|
|
21
|
-
var import_core = require("@tamagui/core");
|
|
22
|
-
const getElevation = (size, extras) => {
|
|
23
|
-
if (!size) return;
|
|
24
|
-
const { tokens } = extras, token = tokens.size[size], sizeNum = (0, import_core.isVariable)(token) ? +token.val : size;
|
|
25
|
-
return getSizedElevation(sizeNum, extras);
|
|
26
|
-
}, getSizedElevation = (val, { theme, tokens }) => {
|
|
27
|
-
let num = 0;
|
|
28
|
-
if (val === !0) {
|
|
29
|
-
const val2 = (0, import_core.getVariableValue)(tokens.size.true);
|
|
30
|
-
typeof val2 == "number" ? num = val2 : num = 10;
|
|
31
|
-
} else
|
|
32
|
-
num = +val;
|
|
33
|
-
if (num === 0)
|
|
34
|
-
return;
|
|
35
|
-
const [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)];
|
|
36
|
-
return {
|
|
37
|
-
shadowColor: theme.shadowColor,
|
|
38
|
-
shadowRadius,
|
|
39
|
-
shadowOffset: { height, width: 0 },
|
|
40
|
-
...import_core.isAndroid ? {
|
|
41
|
-
elevationAndroid: 2 * height
|
|
42
|
-
} : {}
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=getElevation.js.map
|
package/dist/cjs/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
-
return to;
|
|
10
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
-
var src_exports = {};
|
|
13
|
-
module.exports = __toCommonJS(src_exports);
|
|
14
|
-
__reExport(src_exports, require("./Stacks"), module.exports);
|
|
15
|
-
__reExport(src_exports, require("./SizableStack"), module.exports);
|
|
16
|
-
__reExport(src_exports, require("./ThemeableStack"), module.exports);
|
|
17
|
-
__reExport(src_exports, require("./NestingContext"), module.exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/variants.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var variants_exports = {};
|
|
16
|
-
__export(variants_exports, {
|
|
17
|
-
bordered: () => bordered,
|
|
18
|
-
circular: () => circular,
|
|
19
|
-
elevate: () => elevate,
|
|
20
|
-
focusTheme: () => focusTheme,
|
|
21
|
-
hoverTheme: () => hoverTheme,
|
|
22
|
-
padded: () => padded,
|
|
23
|
-
pressTheme: () => pressTheme,
|
|
24
|
-
radiused: () => radiused
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(variants_exports);
|
|
27
|
-
var import_getElevation = require("./getElevation");
|
|
28
|
-
const elevate = {
|
|
29
|
-
true: (_, extras) => (0, import_getElevation.getElevation)(extras.props.size, extras)
|
|
30
|
-
}, bordered = (val, { props }) => ({
|
|
31
|
-
// TODO size it with size in '...size'
|
|
32
|
-
borderWidth: typeof val == "number" ? val : 1,
|
|
33
|
-
borderColor: "$borderColor",
|
|
34
|
-
...props.hoverTheme && {
|
|
35
|
-
hoverStyle: {
|
|
36
|
-
borderColor: "$borderColorHover"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
...props.pressTheme && {
|
|
40
|
-
pressStyle: {
|
|
41
|
-
borderColor: "$borderColorPress"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
...props.focusTheme && {
|
|
45
|
-
focusStyle: {
|
|
46
|
-
borderColor: "$borderColorFocus"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}), padded = {
|
|
50
|
-
true: (_, extras) => {
|
|
51
|
-
const { tokens, props } = extras;
|
|
52
|
-
return {
|
|
53
|
-
padding: tokens.space[props.size] || tokens.space.$true
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}, radiused = {
|
|
57
|
-
true: (_, extras) => {
|
|
58
|
-
const { tokens, props } = extras;
|
|
59
|
-
return {
|
|
60
|
-
borderRadius: tokens.radius[props.size] || tokens.radius.$true
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}, circularStyle = {
|
|
64
|
-
borderRadius: 1e5,
|
|
65
|
-
padding: 0
|
|
66
|
-
}, circular = {
|
|
67
|
-
true: (_, { props, tokens }) => {
|
|
68
|
-
if (!("size" in props))
|
|
69
|
-
return circularStyle;
|
|
70
|
-
const size = typeof props.size == "number" ? props.size : tokens.size[props.size];
|
|
71
|
-
return {
|
|
72
|
-
...circularStyle,
|
|
73
|
-
width: size,
|
|
74
|
-
height: size,
|
|
75
|
-
maxWidth: size,
|
|
76
|
-
maxHeight: size,
|
|
77
|
-
minWidth: size,
|
|
78
|
-
minHeight: size
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}, hoverTheme = {
|
|
82
|
-
true: {
|
|
83
|
-
hoverStyle: {
|
|
84
|
-
backgroundColor: "$backgroundHover",
|
|
85
|
-
borderColor: "$borderColorHover"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
false: {}
|
|
89
|
-
}, pressTheme = {
|
|
90
|
-
true: {
|
|
91
|
-
cursor: "pointer",
|
|
92
|
-
pressStyle: {
|
|
93
|
-
backgroundColor: "$backgroundPress",
|
|
94
|
-
borderColor: "$borderColorPress"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
false: {}
|
|
98
|
-
}, focusTheme = {
|
|
99
|
-
true: {
|
|
100
|
-
focusStyle: {
|
|
101
|
-
backgroundColor: "$backgroundFocus",
|
|
102
|
-
borderColor: "$borderColorFocus"
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
false: {}
|
|
106
|
-
};
|
|
107
|
-
//# sourceMappingURL=variants.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|