@tamagui/stacks
Advanced tools
Comparing version 1.111.8 to 1.111.9
import { getVariableValue, isAndroid, isVariable } from "@tamagui/core"; | ||
var getElevation = function(size, extras) { | ||
if (size) { | ||
var { tokens } = extras, token = tokens.size[size], sizeNum = isVariable(token) ? +token.val : size; | ||
return getSizedElevation(sizeNum, extras); | ||
} | ||
}, getSizedElevation = function(val, param) { | ||
var { theme, tokens } = param, num = 0; | ||
if (val === !0) { | ||
var _$val = getVariableValue(tokens.size.true); | ||
typeof _$val == "number" ? num = _$val : num = 10; | ||
} else | ||
num = +val; | ||
if (num !== 0) { | ||
var [height, shadowRadius] = [ | ||
Math.round(num / 4 + 1), | ||
Math.round(num / 2 + 2) | ||
], shadow = { | ||
shadowColor: theme.shadowColor, | ||
shadowRadius, | ||
shadowOffset: { | ||
height, | ||
width: 0 | ||
}, | ||
...isAndroid ? { | ||
elevationAndroid: 2 * height | ||
} : {} | ||
}; | ||
return shadow; | ||
} | ||
}; | ||
export { | ||
getElevation, | ||
getSizedElevation | ||
}; | ||
//# sourceMappingURL=getElevation.js.map | ||
var getElevation = function (size, extras) { | ||
if (size) { | ||
var { | ||
tokens | ||
} = extras, | ||
token = tokens.size[size], | ||
sizeNum = isVariable(token) ? +token.val : size; | ||
return getSizedElevation(sizeNum, extras); | ||
} | ||
}, | ||
getSizedElevation = function (val, param) { | ||
var { | ||
theme, | ||
tokens | ||
} = param, | ||
num = 0; | ||
if (val === !0) { | ||
var _$val = getVariableValue(tokens.size.true); | ||
typeof _$val == "number" ? num = _$val : num = 10; | ||
} else num = +val; | ||
if (num !== 0) { | ||
var [height, shadowRadius] = [Math.round(num / 4 + 1), Math.round(num / 2 + 2)], | ||
shadow = { | ||
shadowColor: theme.shadowColor, | ||
shadowRadius, | ||
shadowOffset: { | ||
height, | ||
width: 0 | ||
}, | ||
...(isAndroid ? { | ||
elevationAndroid: 2 * height | ||
} : {}) | ||
}; | ||
return shadow; | ||
} | ||
}; | ||
export { getElevation, getSizedElevation }; | ||
//# sourceMappingURL=getElevation.native.js.map |
@@ -1,5 +0,5 @@ | ||
export * from "./Stacks"; | ||
export * from "./SizableStack"; | ||
export * from "./ThemeableStack"; | ||
export * from "./NestingContext"; | ||
//# sourceMappingURL=index.js.map | ||
export * from "./Stacks.native.js"; | ||
export * from "./SizableStack.native.js"; | ||
export * from "./ThemeableStack.native.js"; | ||
export * from "./NestingContext.native.js"; | ||
//# sourceMappingURL=index.native.js.map |
import React from "react"; | ||
var ButtonNestingContext = /* @__PURE__ */ React.createContext(!1); | ||
export { | ||
ButtonNestingContext | ||
}; | ||
//# sourceMappingURL=NestingContext.js.map | ||
var ButtonNestingContext = /* @__PURE__ */React.createContext(!1); | ||
export { ButtonNestingContext }; | ||
//# sourceMappingURL=NestingContext.native.js.map |
import { styled } from "@tamagui/core"; | ||
import { getButtonSized } from "@tamagui/get-button-sized"; | ||
import { XStack } from "./Stacks"; | ||
import { bordered, circular, elevate, focusTheme, hoverTheme, pressTheme } from "./variants"; | ||
import { XStack } from "./Stacks.native.js"; | ||
import { bordered, circular, elevate, focusTheme, hoverTheme, pressTheme } from "./variants.native.js"; | ||
var SizableStack = styled(XStack, { | ||
@@ -24,3 +24,3 @@ name: "SizableStack", | ||
size: { | ||
"...size": function(val, extras) { | ||
"...size": function (val, extras) { | ||
return getButtonSized(val, extras); | ||
@@ -31,5 +31,3 @@ } | ||
}); | ||
export { | ||
SizableStack | ||
}; | ||
//# sourceMappingURL=SizableStack.js.map | ||
export { SizableStack }; | ||
//# sourceMappingURL=SizableStack.native.js.map |
import { View, styled } from "@tamagui/core"; | ||
import { getElevation } from "./getElevation"; | ||
import { getElevation } from "./getElevation.native.js"; | ||
var fullscreenStyle = { | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0 | ||
}, getInset = function(val) { | ||
return val && typeof val == "object" ? val : { | ||
top: val, | ||
left: val, | ||
bottom: val, | ||
right: val | ||
}; | ||
}, variants = { | ||
fullscreen: { | ||
true: fullscreenStyle | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0 | ||
}, | ||
elevation: { | ||
"...size": getElevation, | ||
":number": getElevation | ||
getInset = function (val) { | ||
return val && typeof val == "object" ? val : { | ||
top: val, | ||
left: val, | ||
bottom: val, | ||
right: val | ||
}; | ||
}, | ||
inset: getInset | ||
}, YStack = styled(View, { | ||
flexDirection: "column", | ||
variants | ||
}); | ||
variants = { | ||
fullscreen: { | ||
true: fullscreenStyle | ||
}, | ||
elevation: { | ||
"...size": getElevation, | ||
":number": getElevation | ||
}, | ||
inset: getInset | ||
}, | ||
YStack = styled(View, { | ||
flexDirection: "column", | ||
variants | ||
}); | ||
YStack.displayName = "YStack"; | ||
@@ -42,8 +45,3 @@ var XStack = styled(View, { | ||
ZStack.displayName = "ZStack"; | ||
export { | ||
XStack, | ||
YStack, | ||
ZStack, | ||
fullscreenStyle | ||
}; | ||
//# sourceMappingURL=Stacks.js.map | ||
export { XStack, YStack, ZStack, fullscreenStyle }; | ||
//# sourceMappingURL=Stacks.native.js.map |
import { styled } from "@tamagui/core"; | ||
import { YStack } from "./Stacks"; | ||
import { bordered, circular, elevate, focusTheme, hoverTheme, padded, pressTheme, radiused } from "./variants"; | ||
import { YStack } from "./Stacks.native.js"; | ||
import { bordered, circular, elevate, focusTheme, hoverTheme, padded, pressTheme, radiused } from "./variants.native.js"; | ||
var chromelessStyle = { | ||
backgroundColor: "transparent", | ||
borderColor: "transparent", | ||
shadowColor: "transparent", | ||
hoverStyle: { | ||
borderColor: "transparent" | ||
} | ||
}, themeableVariants = { | ||
backgrounded: { | ||
true: { | ||
backgroundColor: "$background" | ||
backgroundColor: "transparent", | ||
borderColor: "transparent", | ||
shadowColor: "transparent", | ||
hoverStyle: { | ||
borderColor: "transparent" | ||
} | ||
}, | ||
radiused, | ||
hoverTheme, | ||
pressTheme, | ||
focusTheme, | ||
circular, | ||
padded, | ||
elevate, | ||
bordered, | ||
transparent: { | ||
true: { | ||
backgroundColor: "transparent" | ||
themeableVariants = { | ||
backgrounded: { | ||
true: { | ||
backgroundColor: "$background" | ||
} | ||
}, | ||
radiused, | ||
hoverTheme, | ||
pressTheme, | ||
focusTheme, | ||
circular, | ||
padded, | ||
elevate, | ||
bordered, | ||
transparent: { | ||
true: { | ||
backgroundColor: "transparent" | ||
} | ||
}, | ||
chromeless: { | ||
true: chromelessStyle, | ||
all: { | ||
...chromelessStyle, | ||
hoverStyle: chromelessStyle, | ||
pressStyle: chromelessStyle, | ||
focusStyle: chromelessStyle | ||
} | ||
} | ||
}, | ||
chromeless: { | ||
true: chromelessStyle, | ||
all: { | ||
...chromelessStyle, | ||
hoverStyle: chromelessStyle, | ||
pressStyle: chromelessStyle, | ||
focusStyle: chromelessStyle | ||
} | ||
} | ||
}, ThemeableStack = styled(YStack, { | ||
variants: themeableVariants | ||
}); | ||
export { | ||
ThemeableStack, | ||
themeableVariants | ||
}; | ||
//# sourceMappingURL=ThemeableStack.js.map | ||
ThemeableStack = styled(YStack, { | ||
variants: themeableVariants | ||
}); | ||
export { ThemeableStack, themeableVariants }; | ||
//# sourceMappingURL=ThemeableStack.native.js.map |
@@ -1,97 +0,106 @@ | ||
import { getElevation } from "./getElevation"; | ||
import { getElevation } from "./getElevation.native.js"; | ||
var elevate = { | ||
true: function(_, extras) { | ||
return getElevation(extras.props.size, extras); | ||
} | ||
}, bordered = function(val, param) { | ||
var { props } = param; | ||
return { | ||
// TODO size it with size in '...size' | ||
borderWidth: typeof val == "number" ? val : 1, | ||
borderColor: "$borderColor", | ||
...props.hoverTheme && { | ||
true: function (_, extras) { | ||
return getElevation(extras.props.size, extras); | ||
} | ||
}, | ||
bordered = function (val, param) { | ||
var { | ||
props | ||
} = param; | ||
return { | ||
// TODO size it with size in '...size' | ||
borderWidth: typeof val == "number" ? val : 1, | ||
borderColor: "$borderColor", | ||
...(props.hoverTheme && { | ||
hoverStyle: { | ||
borderColor: "$borderColorHover" | ||
} | ||
}), | ||
...(props.pressTheme && { | ||
pressStyle: { | ||
borderColor: "$borderColorPress" | ||
} | ||
}), | ||
...(props.focusTheme && { | ||
focusStyle: { | ||
borderColor: "$borderColorFocus" | ||
} | ||
}) | ||
}; | ||
}, | ||
padded = { | ||
true: function (_, extras) { | ||
var { | ||
tokens, | ||
props | ||
} = extras; | ||
return { | ||
padding: tokens.space[props.size] || tokens.space.$true | ||
}; | ||
} | ||
}, | ||
radiused = { | ||
true: function (_, extras) { | ||
var { | ||
tokens, | ||
props | ||
} = extras; | ||
return { | ||
borderRadius: tokens.radius[props.size] || tokens.radius.$true | ||
}; | ||
} | ||
}, | ||
circularStyle = { | ||
borderRadius: 1e5, | ||
padding: 0 | ||
}, | ||
circular = { | ||
true: function (_, param) { | ||
var { | ||
props, | ||
tokens | ||
} = param; | ||
if (!("size" in props)) return circularStyle; | ||
var size = typeof props.size == "number" ? props.size : tokens.size[props.size]; | ||
return { | ||
...circularStyle, | ||
width: size, | ||
height: size, | ||
maxWidth: size, | ||
maxHeight: size, | ||
minWidth: size, | ||
minHeight: size | ||
}; | ||
} | ||
}, | ||
hoverTheme = { | ||
true: { | ||
hoverStyle: { | ||
backgroundColor: "$backgroundHover", | ||
borderColor: "$borderColorHover" | ||
} | ||
}, | ||
...props.pressTheme && { | ||
false: {} | ||
}, | ||
pressTheme = { | ||
true: { | ||
cursor: "pointer", | ||
pressStyle: { | ||
backgroundColor: "$backgroundPress", | ||
borderColor: "$borderColorPress" | ||
} | ||
}, | ||
...props.focusTheme && { | ||
false: {} | ||
}, | ||
focusTheme = { | ||
true: { | ||
focusStyle: { | ||
backgroundColor: "$backgroundFocus", | ||
borderColor: "$borderColorFocus" | ||
} | ||
} | ||
}, | ||
false: {} | ||
}; | ||
}, padded = { | ||
true: function(_, extras) { | ||
var { tokens, props } = extras; | ||
return { | ||
padding: tokens.space[props.size] || tokens.space.$true | ||
}; | ||
} | ||
}, radiused = { | ||
true: function(_, extras) { | ||
var { tokens, props } = extras; | ||
return { | ||
borderRadius: tokens.radius[props.size] || tokens.radius.$true | ||
}; | ||
} | ||
}, circularStyle = { | ||
borderRadius: 1e5, | ||
padding: 0 | ||
}, circular = { | ||
true: function(_, param) { | ||
var { props, tokens } = param; | ||
if (!("size" in props)) | ||
return circularStyle; | ||
var size = typeof props.size == "number" ? props.size : tokens.size[props.size]; | ||
return { | ||
...circularStyle, | ||
width: size, | ||
height: size, | ||
maxWidth: size, | ||
maxHeight: size, | ||
minWidth: size, | ||
minHeight: size | ||
}; | ||
} | ||
}, hoverTheme = { | ||
true: { | ||
hoverStyle: { | ||
backgroundColor: "$backgroundHover", | ||
borderColor: "$borderColorHover" | ||
} | ||
}, | ||
false: {} | ||
}, pressTheme = { | ||
true: { | ||
cursor: "pointer", | ||
pressStyle: { | ||
backgroundColor: "$backgroundPress", | ||
borderColor: "$borderColorPress" | ||
} | ||
}, | ||
false: {} | ||
}, focusTheme = { | ||
true: { | ||
focusStyle: { | ||
backgroundColor: "$backgroundFocus", | ||
borderColor: "$borderColorFocus" | ||
} | ||
}, | ||
false: {} | ||
}; | ||
export { | ||
bordered, | ||
circular, | ||
elevate, | ||
focusTheme, | ||
hoverTheme, | ||
padded, | ||
pressTheme, | ||
radiused | ||
}; | ||
//# sourceMappingURL=variants.js.map | ||
export { bordered, circular, elevate, focusTheme, hoverTheme, padded, pressTheme, radiused }; | ||
//# sourceMappingURL=variants.native.js.map |
{ | ||
"name": "@tamagui/stacks", | ||
"version": "1.111.8", | ||
"version": "1.111.9", | ||
"sideEffects": [ | ||
@@ -28,3 +28,3 @@ "*.css" | ||
".": { | ||
"react-native-import": "./dist/esm/index.native.mjs", | ||
"react-native-import": "./dist/esm/index.native.js", | ||
"react-native": "./dist/cjs/index.native.js", | ||
@@ -37,7 +37,7 @@ "types": "./types/index.d.ts", | ||
"dependencies": { | ||
"@tamagui/core": "1.111.8" | ||
"@tamagui/core": "1.111.9" | ||
}, | ||
"devDependencies": { | ||
"@tamagui/build": "1.111.8", | ||
"@tamagui/get-button-sized": "1.111.8", | ||
"@tamagui/build": "1.111.9", | ||
"@tamagui/get-button-sized": "1.111.9", | ||
"react": "^18.2.0 || ^19.0.0" | ||
@@ -44,0 +44,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132338
135
2980
+ Added@tamagui/compose-refs@1.111.9(transitive)
+ Added@tamagui/constants@1.111.9(transitive)
+ Added@tamagui/core@1.111.9(transitive)
+ Added@tamagui/helpers@1.111.9(transitive)
+ Added@tamagui/normalize-css-color@1.111.9(transitive)
+ Added@tamagui/react-native-use-pressable@1.111.9(transitive)
+ Added@tamagui/react-native-use-responder-events@1.111.9(transitive)
+ Added@tamagui/simple-hash@1.111.9(transitive)
+ Added@tamagui/timer@1.111.9(transitive)
+ Added@tamagui/types@1.111.9(transitive)
+ Added@tamagui/use-did-finish-ssr@1.111.9(transitive)
+ Added@tamagui/use-event@1.111.9(transitive)
+ Added@tamagui/use-force-update@1.111.9(transitive)
+ Added@tamagui/web@1.111.9(transitive)
- Removed@tamagui/compose-refs@1.111.8(transitive)
- Removed@tamagui/constants@1.111.8(transitive)
- Removed@tamagui/core@1.111.8(transitive)
- Removed@tamagui/helpers@1.111.8(transitive)
- Removed@tamagui/normalize-css-color@1.111.8(transitive)
- Removed@tamagui/react-native-use-pressable@1.111.8(transitive)
- Removed@tamagui/react-native-use-responder-events@1.111.8(transitive)
- Removed@tamagui/simple-hash@1.111.8(transitive)
- Removed@tamagui/timer@1.111.8(transitive)
- Removed@tamagui/types@1.111.8(transitive)
- Removed@tamagui/use-did-finish-ssr@1.111.8(transitive)
- Removed@tamagui/use-event@1.111.8(transitive)
- Removed@tamagui/use-force-update@1.111.8(transitive)
- Removed@tamagui/web@1.111.8(transitive)
Updated@tamagui/core@1.111.9