@tamagui/core 1.0.1-beta.220 → 1.0.1-beta.221
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/addTheme.js +7 -10
- package/dist/cjs/addTheme.js.map +3 -3
- package/dist/cjs/config.js +8 -4
- package/dist/cjs/config.js.map +2 -2
- package/dist/cjs/{hooks/useUnmountEffect.js → contexts/ButtonNestingContext.js} +7 -9
- package/dist/cjs/contexts/ButtonNestingContext.js.map +7 -0
- package/dist/cjs/createComponent.js +63 -67
- package/dist/cjs/createComponent.js.map +3 -3
- package/dist/cjs/createTamagui.js +13 -12
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createTokens.test.js +27 -0
- package/dist/cjs/createTokens.test.js.map +7 -0
- package/dist/cjs/createVariable.js +4 -9
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariable.test.js +7 -0
- package/dist/cjs/createVariable.test.js.map +7 -0
- package/dist/cjs/createVariables.js +6 -7
- package/dist/cjs/createVariables.js.map +2 -2
- package/dist/cjs/helpers/ThemeManager.js +161 -147
- package/dist/cjs/helpers/ThemeManager.js.map +3 -3
- package/dist/cjs/helpers/ThemeManager.test.js +421 -34
- package/dist/cjs/helpers/ThemeManager.test.js.map +2 -2
- package/dist/cjs/helpers/{getTokens.js → ThemeManagerContext.js} +8 -8
- package/dist/cjs/helpers/ThemeManagerContext.js.map +7 -0
- package/dist/cjs/helpers/createPropMapper.js +4 -4
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/extendStaticConfig.js +2 -4
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/{assignNativePropsToWeb.native.js → getBoundingClientRect.js} +15 -8
- package/dist/cjs/helpers/getBoundingClientRect.js.map +7 -0
- package/dist/cjs/{hooks/useConstant.js → helpers/getRect.js} +14 -17
- package/dist/cjs/helpers/getRect.js.map +7 -0
- package/dist/cjs/helpers/getSplitStyles.js +82 -85
- package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
- package/dist/cjs/helpers/getThemeCSSRules.js +6 -2
- package/dist/cjs/helpers/getThemeCSSRules.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +1 -1
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/mergeTransform.js +11 -8
- package/dist/cjs/helpers/mergeTransform.js.map +2 -2
- package/dist/cjs/helpers/pseudoDescriptors.js +1 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +2 -2
- package/dist/cjs/helpers/themeable.js +9 -9
- package/dist/cjs/helpers/themeable.js.map +2 -2
- package/dist/cjs/hooks/useElementLayout.js +4 -12
- package/dist/cjs/hooks/useElementLayout.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +2 -1
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/useTheme.js +114 -156
- package/dist/cjs/hooks/useTheme.js.map +3 -3
- package/dist/cjs/hooks/{useIsMounted.js → useThemeName.js} +23 -14
- package/dist/cjs/hooks/useThemeName.js.map +7 -0
- package/dist/cjs/index.js +2 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/setupReactNative.js +20 -7
- package/dist/cjs/setupReactNative.js.map +2 -2
- package/dist/cjs/styled.js +2 -19
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/updateTheme.js +9 -9
- package/dist/cjs/updateTheme.js.map +2 -2
- package/dist/cjs/views/TamaguiProvider.js +3 -3
- package/dist/cjs/views/TamaguiProvider.js.map +2 -2
- package/dist/cjs/views/Theme.js +39 -28
- package/dist/cjs/views/Theme.js.map +3 -3
- package/dist/cjs/views/ThemeProvider.js +8 -33
- package/dist/cjs/views/ThemeProvider.js.map +3 -3
- package/dist/esm/addTheme.js +7 -10
- package/dist/esm/addTheme.js.map +3 -3
- package/dist/esm/config.js +8 -3
- package/dist/esm/config.js.map +2 -2
- package/dist/esm/contexts/ButtonNestingContext.js +6 -0
- package/dist/esm/contexts/ButtonNestingContext.js.map +7 -0
- package/dist/esm/createComponent.js +65 -70
- package/dist/esm/createComponent.js.map +3 -3
- package/dist/esm/createTamagui.js +13 -12
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createTokens.test.js +26 -0
- package/dist/esm/createTokens.test.js.map +7 -0
- package/dist/esm/createVariable.js +4 -9
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariable.test.js +6 -0
- package/dist/esm/createVariable.test.js.map +7 -0
- package/dist/esm/createVariables.js +6 -7
- package/dist/esm/createVariables.js.map +2 -2
- package/dist/esm/helpers/ThemeManager.js +140 -144
- package/dist/esm/helpers/ThemeManager.js.map +3 -3
- package/dist/esm/helpers/ThemeManager.test.js +421 -34
- package/dist/esm/helpers/ThemeManager.test.js.map +2 -2
- package/dist/esm/helpers/ThemeManagerContext.js +6 -0
- package/dist/esm/helpers/ThemeManagerContext.js.map +7 -0
- package/dist/esm/helpers/createPropMapper.js +4 -4
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/extendStaticConfig.js +2 -4
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/getBoundingClientRect.js +13 -0
- package/dist/esm/helpers/getBoundingClientRect.js.map +7 -0
- package/dist/esm/helpers/getRect.js +12 -0
- package/dist/esm/helpers/getRect.js.map +7 -0
- package/dist/esm/helpers/getSplitStyles.js +90 -87
- package/dist/esm/helpers/getSplitStyles.js.map +3 -3
- package/dist/esm/helpers/getThemeCSSRules.js +6 -2
- package/dist/esm/helpers/getThemeCSSRules.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +1 -1
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/mergeTransform.js +8 -6
- package/dist/esm/helpers/mergeTransform.js.map +2 -2
- package/dist/esm/helpers/pseudoDescriptors.js +1 -0
- package/dist/esm/helpers/pseudoDescriptors.js.map +2 -2
- package/dist/esm/helpers/themeable.js +9 -9
- package/dist/esm/helpers/themeable.js.map +2 -2
- package/dist/esm/hooks/useElementLayout.js +2 -9
- package/dist/esm/hooks/useElementLayout.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +3 -2
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +114 -159
- package/dist/esm/hooks/useTheme.js.map +3 -3
- package/dist/esm/hooks/useThemeName.js +25 -0
- package/dist/esm/hooks/useThemeName.js.map +7 -0
- package/dist/esm/index.js +3 -5
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/setupReactNative.js +18 -6
- package/dist/esm/setupReactNative.js.map +2 -2
- package/dist/esm/styled.js +3 -20
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/updateTheme.js +9 -9
- package/dist/esm/updateTheme.js.map +2 -2
- package/dist/esm/views/TamaguiProvider.js +4 -4
- package/dist/esm/views/TamaguiProvider.js.map +2 -2
- package/dist/esm/views/Theme.js +40 -29
- package/dist/esm/views/Theme.js.map +3 -3
- package/dist/esm/views/ThemeProvider.js +8 -27
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/package.json +12 -12
- package/src/__snapshots__/createTokens.test.ts.snap +877 -0
- package/src/addTheme.ts +9 -12
- package/src/config.ts +10 -2
- package/src/contexts/ButtonNestingContext.tsx +3 -0
- package/src/createComponent.tsx +117 -108
- package/src/createTamagui.ts +16 -14
- package/src/createTokens.test.ts +29 -0
- package/src/createTokens.ts +1 -1
- package/src/createVariable.test.ts +7 -0
- package/src/createVariable.ts +4 -10
- package/src/createVariables.ts +7 -7
- package/src/helpers/ThemeManager.test.tsx +480 -0
- package/src/helpers/ThemeManager.tsx +171 -166
- package/src/helpers/ThemeManagerContext.tsx +5 -0
- package/src/helpers/createPropMapper.ts +4 -4
- package/src/helpers/extendStaticConfig.ts +4 -4
- package/src/helpers/getBoundingClientRect.tsx +7 -0
- package/src/helpers/getRect.tsx +8 -0
- package/src/helpers/getSplitStyles.tsx +98 -93
- package/src/helpers/getThemeCSSRules.ts +9 -2
- package/src/helpers/insertStyleRule.tsx +2 -2
- package/src/helpers/mergeTransform.ts +13 -6
- package/src/helpers/pseudoDescriptors.ts +1 -0
- package/src/helpers/themeable.tsx +17 -9
- package/src/hooks/useElementLayout.tsx +3 -8
- package/src/hooks/useMedia.tsx +3 -3
- package/src/hooks/useTheme.tsx +138 -211
- package/src/hooks/useThemeName.tsx +25 -0
- package/src/index.ts +3 -4
- package/src/setupReactNative.ts +16 -5
- package/src/styled.tsx +4 -23
- package/src/types.tsx +42 -17
- package/src/updateTheme.ts +12 -9
- package/src/views/TamaguiProvider.tsx +5 -5
- package/src/views/Theme.tsx +48 -39
- package/src/views/ThemeProvider.tsx +11 -33
- package/types/Tamagui.d.ts +1 -1
- package/types/addTheme.d.ts +23 -2
- package/types/config.d.ts +0 -1
- package/types/contexts/ButtonNestingContext.d.ts +3 -0
- package/types/createTokens.test.d.ts +2 -0
- package/types/createVariable.d.ts +2 -2
- package/types/createVariable.test.d.ts +2 -0
- package/types/helpers/ThemeManager.d.ts +20 -30
- package/types/helpers/ThemeManager.test.d.ts +2 -0
- package/types/helpers/ThemeManagerContext.d.ts +4 -0
- package/types/helpers/getBoundingClientRect.d.ts +2 -0
- package/types/helpers/getRect.d.ts +9 -0
- package/types/helpers/insertStyleRule.d.ts +1 -1
- package/types/helpers/mergeTransform.d.ts +5 -3
- package/types/helpers/themeable.d.ts +3 -0
- package/types/hooks/useElementLayout.d.ts +0 -8
- package/types/hooks/useTheme.d.ts +10 -20
- package/types/hooks/useThemeName.d.ts +5 -0
- package/types/index.d.ts +3 -4
- package/types/setupReactNative.d.ts +4 -2
- package/types/types.d.ts +35 -10
- package/types/updateTheme.d.ts +23 -2
- package/types/views/Theme.d.ts +3 -4
- package/dist/cjs/constants/platform.js +0 -74
- package/dist/cjs/constants/platform.js.map +0 -7
- package/dist/cjs/constants/platform.native.js +0 -62
- package/dist/cjs/constants/platform.native.js.map +0 -7
- package/dist/cjs/helpers/assignNativePropsToWeb.js +0 -188
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +0 -7
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +0 -7
- package/dist/cjs/helpers/calc.js +0 -71
- package/dist/cjs/helpers/calc.js.map +0 -7
- package/dist/cjs/helpers/getFont.js +0 -66
- package/dist/cjs/helpers/getFont.js.map +0 -7
- package/dist/cjs/helpers/getStackSize.js +0 -46
- package/dist/cjs/helpers/getStackSize.js.map +0 -7
- package/dist/cjs/helpers/getTokens.js.map +0 -7
- package/dist/cjs/helpers/startTransition.js +0 -36
- package/dist/cjs/helpers/startTransition.js.map +0 -7
- package/dist/cjs/helpers/validate.js +0 -2
- package/dist/cjs/helpers/validate.js.map +0 -7
- package/dist/cjs/hooks/useConstant.js.map +0 -7
- package/dist/cjs/hooks/useIsMounted.js.map +0 -7
- package/dist/cjs/hooks/usePressable.js +0 -36
- package/dist/cjs/hooks/usePressable.js.map +0 -7
- package/dist/cjs/hooks/useUnmountEffect.js.map +0 -7
- package/dist/cjs/injectStyles.js +0 -40
- package/dist/cjs/injectStyles.js.map +0 -7
- package/dist/cjs/react-native.js +0 -22
- package/dist/cjs/react-native.js.map +0 -7
- package/dist/esm/constants/platform.js +0 -39
- package/dist/esm/constants/platform.js.map +0 -7
- package/dist/esm/constants/platform.native.js +0 -28
- package/dist/esm/constants/platform.native.js.map +0 -7
- package/dist/esm/helpers/assignNativePropsToWeb.js +0 -164
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +0 -7
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +0 -6
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +0 -7
- package/dist/esm/helpers/calc.js +0 -47
- package/dist/esm/helpers/calc.js.map +0 -7
- package/dist/esm/helpers/getFont.js +0 -42
- package/dist/esm/helpers/getFont.js.map +0 -7
- package/dist/esm/helpers/getStackSize.js +0 -22
- package/dist/esm/helpers/getStackSize.js.map +0 -7
- package/dist/esm/helpers/getTokens.js +0 -6
- package/dist/esm/helpers/getTokens.js.map +0 -7
- package/dist/esm/helpers/startTransition.js +0 -6
- package/dist/esm/helpers/startTransition.js.map +0 -7
- package/dist/esm/helpers/validate.js +0 -1
- package/dist/esm/helpers/validate.js.map +0 -7
- package/dist/esm/hooks/useConstant.js +0 -15
- package/dist/esm/hooks/useConstant.js.map +0 -7
- package/dist/esm/hooks/useIsMounted.js +0 -16
- package/dist/esm/hooks/useIsMounted.js.map +0 -7
- package/dist/esm/hooks/usePressable.js +0 -12
- package/dist/esm/hooks/usePressable.js.map +0 -7
- package/dist/esm/hooks/useUnmountEffect.js +0 -8
- package/dist/esm/hooks/useUnmountEffect.js.map +0 -7
- package/dist/esm/injectStyles.js +0 -16
- package/dist/esm/injectStyles.js.map +0 -7
- package/dist/esm/react-native.js +0 -3
- package/dist/esm/react-native.js.map +0 -7
- package/src/contexts/ButtonInsideButtonContext.tsx +0 -3
- package/src/contexts/ThemeContext.tsx +0 -5
- package/src/helpers/areEqualSets.tsx +0 -9
- package/src/views/ThemeInverse.tsx +0 -43
- package/src/views/ThemeReset.tsx +0 -43
- package/types/constants/platform.d.ts +0 -13
- package/types/constants/platform.native.d.ts +0 -13
- package/types/contexts/ButtonInsideButtonContext.d.ts +0 -3
- package/types/contexts/ThemeContext.d.ts +0 -7
- package/types/helpers/areEqualSets.d.ts +0 -2
- package/types/helpers/assignNativePropsToWeb.d.ts +0 -2
- package/types/helpers/assignNativePropsToWeb.native.d.ts +0 -2
- package/types/helpers/calc.d.ts +0 -1
- package/types/helpers/getFont.d.ts +0 -3
- package/types/helpers/getStackSize.d.ts +0 -8
- package/types/helpers/getTokens.d.ts +0 -2
- package/types/helpers/startTransition.d.ts +0 -3
- package/types/helpers/validate.d.ts +0 -1
- package/types/hooks/useConstant.d.ts +0 -2
- package/types/hooks/useIsMounted.d.ts +0 -3
- package/types/hooks/useMedia.test.d.ts +0 -1
- package/types/hooks/usePressable.d.ts +0 -3
- package/types/hooks/usePressablePressResponder.d.ts +0 -84
- package/types/hooks/useUnmountEffect.d.ts +0 -2
- package/types/injectStyles.d.ts +0 -7
- package/types/react-native.d.ts +0 -8
- package/types/views/AbsoluteFill.d.ts +0 -5
- package/types/views/AbsoluteFill.native.d.ts +0 -3
- package/types/views/ThemeInverse.d.ts +0 -9
- package/types/views/ThemeReset.d.ts +0 -4
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var getFont_exports = {};
|
|
20
|
-
__export(getFont_exports, {
|
|
21
|
-
getFont: () => getFont
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(getFont_exports);
|
|
24
|
-
var import_createVariable = require("../createVariable");
|
|
25
|
-
const getFont = (val = "$4", { fonts, theme, props }) => {
|
|
26
|
-
var _a, _b, _c;
|
|
27
|
-
const family = (0, import_createVariable.getVariableValue)(props.fontFamily) || "$body";
|
|
28
|
-
const font = fonts[family] || fonts["$body"];
|
|
29
|
-
if (!font) {
|
|
30
|
-
if (process.env.NODE_ENV === "development") {
|
|
31
|
-
console.warn("\u26A0\uFE0F no font found", { family, fontTokens: Object.keys(fonts), val });
|
|
32
|
-
}
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
const fontFamily = font.family;
|
|
36
|
-
const fontSize = props.fontSize || font.size[val];
|
|
37
|
-
const lineHeight = props.lineHeight || font.lineHeight[val];
|
|
38
|
-
const fontWeight = props.fontWeight || font.weight[val];
|
|
39
|
-
const letterSpacing = props.letterSpacing || font.letterSpacing[val];
|
|
40
|
-
const fontStyle = props.fontStyle || ((_a = font.style) == null ? void 0 : _a[val]);
|
|
41
|
-
const textTransform = props.textTransform || ((_b = font.transform) == null ? void 0 : _b[val]);
|
|
42
|
-
const color = props.color || ((_c = font.color) == null ? void 0 : _c[val]) || theme.color;
|
|
43
|
-
const style = {
|
|
44
|
-
color,
|
|
45
|
-
fontStyle,
|
|
46
|
-
textTransform,
|
|
47
|
-
fontFamily,
|
|
48
|
-
fontWeight,
|
|
49
|
-
letterSpacing,
|
|
50
|
-
fontSize,
|
|
51
|
-
lineHeight
|
|
52
|
-
};
|
|
53
|
-
if (process.env.NODE_ENV === "development") {
|
|
54
|
-
if (props["debug"]) {
|
|
55
|
-
console.groupCollapsed(" \u{1F539} getFont", val, props["fontWeight"], props["fow"]);
|
|
56
|
-
console.log({ style, props, font });
|
|
57
|
-
console.groupEnd();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return style;
|
|
61
|
-
};
|
|
62
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
-
0 && (module.exports = {
|
|
64
|
-
getFont
|
|
65
|
-
});
|
|
66
|
-
//# sourceMappingURL=getFont.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/getFont.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-console */\nimport { getVariableValue } from '../createVariable'\nimport { FontSizeTokens, TextProps, VariantSpreadFunction } from '../types'\n\nexport const getFont: VariantSpreadFunction<TextProps, FontSizeTokens> = (\n val = '$4',\n { fonts, theme, props }\n) => {\n const family = getVariableValue(props.fontFamily) || '$body'\n const font = fonts[family] || fonts['$body']\n if (!font) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('\u26A0\uFE0F no font found', { family, fontTokens: Object.keys(fonts), val })\n }\n return {} as any\n }\n const fontFamily = font.family\n const fontSize = props.fontSize || font.size[val]\n const lineHeight = props.lineHeight || font.lineHeight[val]\n const fontWeight = props.fontWeight || font.weight[val]\n const letterSpacing = props.letterSpacing || font.letterSpacing[val]\n const fontStyle = props.fontStyle || font.style?.[val]\n const textTransform = props.textTransform || font.transform?.[val]\n const color = props.color || font.color?.[val] || theme.color\n const style = {\n color,\n fontStyle,\n textTransform,\n fontFamily,\n fontWeight,\n letterSpacing,\n fontSize,\n lineHeight,\n }\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.groupCollapsed(' \uD83D\uDD39 getFont', val, props['fontWeight'], props['fow'])\n console.log({ style, props, font })\n console.groupEnd()\n }\n }\n return style\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,4BAAiC;AAG1B,MAAM,UAA4D,CACvE,MAAM,MACN,EAAE,OAAO,OAAO,MAAM,MACnB;AAPL;AAQE,QAAM,aAAS,wCAAiB,MAAM,UAAU,KAAK;AACrD,QAAM,OAAO,MAAM,WAAW,MAAM;AACpC,MAAI,CAAC,MAAM;AACT,QAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,cAAQ,KAAK,8BAAoB,EAAE,QAAQ,YAAY,OAAO,KAAK,KAAK,GAAG,IAAI,CAAC;AAAA,IAClF;AACA,WAAO,CAAC;AAAA,EACV;AACA,QAAM,aAAa,KAAK;AACxB,QAAM,WAAW,MAAM,YAAY,KAAK,KAAK;AAC7C,QAAM,aAAa,MAAM,cAAc,KAAK,WAAW;AACvD,QAAM,aAAa,MAAM,cAAc,KAAK,OAAO;AACnD,QAAM,gBAAgB,MAAM,iBAAiB,KAAK,cAAc;AAChE,QAAM,YAAY,MAAM,eAAa,UAAK,UAAL,mBAAa;AAClD,QAAM,gBAAgB,MAAM,mBAAiB,UAAK,cAAL,mBAAiB;AAC9D,QAAM,QAAQ,MAAM,WAAS,UAAK,UAAL,mBAAa,SAAQ,MAAM;AACxD,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,MAAM,UAAU;AAClB,cAAQ,eAAe,uBAAgB,KAAK,MAAM,eAAe,MAAM,MAAM;AAC7E,cAAQ,IAAI,EAAE,OAAO,OAAO,KAAK,CAAC;AAClC,cAAQ,SAAS;AAAA,IACnB;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var getStackSize_exports = {};
|
|
20
|
-
__export(getStackSize_exports, {
|
|
21
|
-
getButtonSize: () => getButtonSize
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(getStackSize_exports);
|
|
24
|
-
var import_getSize = require("./getSize");
|
|
25
|
-
const getButtonSize = (val, { tokens }) => {
|
|
26
|
-
if (typeof val === "number") {
|
|
27
|
-
return {
|
|
28
|
-
paddingHorizontal: val * 0.25,
|
|
29
|
-
height: val,
|
|
30
|
-
borderRadius: val * 0.2
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const ySize = (0, import_getSize.getSize)(val, 0);
|
|
34
|
-
const xSize = (0, import_getSize.stepTokenUpOrDown)(tokens.space, val);
|
|
35
|
-
const radiusToken = tokens.radius[val] ?? tokens.radius["$4"];
|
|
36
|
-
return {
|
|
37
|
-
paddingHorizontal: xSize,
|
|
38
|
-
height: ySize,
|
|
39
|
-
borderRadius: radiusToken
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
getButtonSize
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=getStackSize.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/getStackSize.ts"],
|
|
4
|
-
"sourcesContent": ["import { SizeTokens, VariantSpreadExtras } from '../types'\nimport { getSize, stepTokenUpOrDown } from './getSize'\n\nexport type ScaleVariantExtras = Pick<VariantSpreadExtras<any>, 'tokens' | 'props' | 'fonts'>\n\nexport const getButtonSize = (val: SizeTokens | number, { tokens }: VariantSpreadExtras<any>) => {\n if (typeof val === 'number') {\n return {\n paddingHorizontal: val * 0.25,\n height: val,\n borderRadius: val * 0.2,\n }\n }\n const ySize = getSize(val, 0)\n const xSize = stepTokenUpOrDown(tokens.space, val)\n const radiusToken = tokens.radius[val] ?? tokens.radius['$4']\n return {\n paddingHorizontal: xSize,\n height: ySize,\n borderRadius: radiusToken,\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAA2C;AAIpC,MAAM,gBAAgB,CAAC,KAA0B,EAAE,OAAO,MAAgC;AAC/F,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO;AAAA,MACL,mBAAmB,MAAM;AAAA,MACzB,QAAQ;AAAA,MACR,cAAc,MAAM;AAAA,IACtB;AAAA,EACF;AACA,QAAM,YAAQ,wBAAQ,KAAK,CAAC;AAC5B,QAAM,YAAQ,kCAAkB,OAAO,OAAO,GAAG;AACjD,QAAM,cAAc,OAAO,OAAO,QAAQ,OAAO,OAAO;AACxD,SAAO;AAAA,IACL,mBAAmB;AAAA,IACnB,QAAQ;AAAA,IACR,cAAc;AAAA,EAChB;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/getTokens.tsx"],
|
|
4
|
-
"sourcesContent": ["import { getConfig } from '../config'\nimport { Tokens } from '../types'\n\nexport const getTokens = () => getConfig().tokensParsed as Tokens\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0B;AAGnB,MAAM,YAAY,UAAM,yBAAU,EAAE;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
var startTransition_exports = {};
|
|
26
|
-
__export(startTransition_exports, {
|
|
27
|
-
startTransition: () => startTransition
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(startTransition_exports);
|
|
30
|
-
var import_react = __toESM(require("react"));
|
|
31
|
-
const startTransition = import_react.default.startTransition || ((cb) => cb());
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
startTransition
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=startTransition.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/startTransition.ts"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGX,MAAM,kBAAkB,aAAAA,QAAM,oBAAoB,CAAC,OAAO,GAAG;",
|
|
6
|
-
"names": ["React"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useConstant.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useMemo, useRef } from 'react'\n\ntype ResultBox<T> = { v: T }\n\nexport function useConstant<T>(fn: () => T): T {\n // RSC compat\n if (typeof document === 'undefined') {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useMemo(() => fn(), [])\n }\n\n const ref = useRef<ResultBox<T>>()\n\n if (!ref.current) {\n ref.current = { v: fn() }\n }\n\n return ref.current.v\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgC;AAIzB,SAAS,YAAe,IAAgB;AAE7C,MAAI,OAAO,aAAa,aAAa;AAEnC,eAAO,sBAAQ,MAAM,GAAG,GAAG,CAAC,CAAC;AAAA,EAC/B;AAEA,QAAM,UAAM,qBAAqB;AAEjC,MAAI,CAAC,IAAI,SAAS;AAChB,QAAI,UAAU,EAAE,GAAG,GAAG,EAAE;AAAA,EAC1B;AAEA,SAAO,IAAI,QAAQ;AACrB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useIsMounted.ts"],
|
|
4
|
-
"sourcesContent": ["import { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { useRef } from 'react'\n\nexport function useIsMounted() {\n const isMounted = useRef(false)\n\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C;AAC1C,mBAAuB;AAEhB,SAAS,eAAe;AAC7B,QAAM,gBAAY,qBAAO,KAAK;AAE9B,kDAA0B,MAAM;AAC9B,cAAU,UAAU;AAEpB,WAAO,MAAM;AACX,gBAAU,UAAU;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var usePressable_exports = {};
|
|
20
|
-
__export(usePressable_exports, {
|
|
21
|
-
usePressable: () => usePressable
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(usePressable_exports);
|
|
24
|
-
var import_react_native = require("react-native");
|
|
25
|
-
var _a, _b;
|
|
26
|
-
const getPressable = (_b = (_a = import_react_native.Pressable) == null ? void 0 : _a["type"]) == null ? void 0 : _b["render"];
|
|
27
|
-
const usePressable = (props) => {
|
|
28
|
-
const out = getPressable(props);
|
|
29
|
-
const { children, style, ...pressableProps } = out.props;
|
|
30
|
-
return [pressableProps, style];
|
|
31
|
-
};
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
usePressable
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=usePressable.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/usePressable.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Pressable, PressableProps } from 'react-native'\n\nconst getPressable = Pressable?.['type']?.['render']\n\nexport const usePressable = (props: PressableProps) => {\n const out = getPressable(props)\n const { children, style, ...pressableProps } = out.props\n return [pressableProps, style] as const\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA0C;AAA1C;AAEA,MAAM,gBAAe,gEAAY,YAAZ,mBAAsB;AAEpC,MAAM,eAAe,CAAC,UAA0B;AACrD,QAAM,MAAM,aAAa,KAAK;AAC9B,QAAM,EAAE,UAAU,UAAU,eAAe,IAAI,IAAI;AACnD,SAAO,CAAC,gBAAgB,KAAK;AAC/B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useUnmountEffect.ts"],
|
|
4
|
-
"sourcesContent": ["import { useEffect } from 'react'\n\nexport function useUnmountEffect(callback: () => void) {\n return useEffect(() => () => callback(), [])\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAEnB,SAAS,iBAAiB,UAAsB;AACrD,aAAO,wBAAU,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC;AAC7C;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/cjs/injectStyles.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var injectStyles_exports = {};
|
|
20
|
-
__export(injectStyles_exports, {
|
|
21
|
-
injectStyles: () => injectStyles
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(injectStyles_exports);
|
|
24
|
-
const stylesheets = {};
|
|
25
|
-
const injectStyles = ({ filePath, css }) => {
|
|
26
|
-
let stylesheet = stylesheets[filePath];
|
|
27
|
-
if (!stylesheet) {
|
|
28
|
-
const styleEl = document.createElement("style");
|
|
29
|
-
styleEl.setAttribute("data-file", filePath);
|
|
30
|
-
styleEl.setAttribute("type", "text/css");
|
|
31
|
-
stylesheet = stylesheets[filePath] = styleEl;
|
|
32
|
-
document.head.appendChild(styleEl);
|
|
33
|
-
}
|
|
34
|
-
stylesheet.innerHTML = css;
|
|
35
|
-
};
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
injectStyles
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=injectStyles.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/injectStyles.ts"],
|
|
4
|
-
"sourcesContent": ["// for vite dev mode\n\nconst stylesheets: Record<string, HTMLElement> = {}\n\ninterface InjectStylesOptions {\n filePath: string\n css: string\n}\n\nexport const injectStyles = ({ filePath, css }: InjectStylesOptions) => {\n let stylesheet = stylesheets[filePath]\n if (!stylesheet) {\n const styleEl = document.createElement('style')\n styleEl.setAttribute('data-file', filePath)\n styleEl.setAttribute('type', 'text/css')\n stylesheet = stylesheets[filePath] = styleEl\n document.head.appendChild(styleEl)\n }\n stylesheet.innerHTML = css\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,cAA2C,CAAC;AAO3C,MAAM,eAAe,CAAC,EAAE,UAAU,IAAI,MAA2B;AACtE,MAAI,aAAa,YAAY;AAC7B,MAAI,CAAC,YAAY;AACf,UAAM,UAAU,SAAS,cAAc,OAAO;AAC9C,YAAQ,aAAa,aAAa,QAAQ;AAC1C,YAAQ,aAAa,QAAQ,UAAU;AACvC,iBAAa,YAAY,YAAY;AACrC,aAAS,KAAK,YAAY,OAAO;AAAA,EACnC;AACA,aAAW,YAAY;AACzB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/cjs/react-native.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
-
mod
|
|
19
|
-
));
|
|
20
|
-
var ReactNative = __toESM(require("react-native"));
|
|
21
|
-
globalThis["_TamaguiReactNative"] = ReactNative;
|
|
22
|
-
//# sourceMappingURL=react-native.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/react-native.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * `@tamagui/core/react-native`\n *\n * Only import for easier React Native detection\n *\n */\n\nimport * as ReactNative from 'react-native'\nglobalThis['_TamaguiReactNative'] = ReactNative\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAOA,kBAA6B;AAC7B,WAAW,yBAAyB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var _a, _b;
|
|
2
|
-
import { useEffect, useLayoutEffect } from "react";
|
|
3
|
-
import { Platform } from "react-native";
|
|
4
|
-
const isAndroid = ((_a = Platform) == null ? void 0 : _a.OS) === "android";
|
|
5
|
-
const isIOS = ((_b = Platform) == null ? void 0 : _b.OS) === "ios";
|
|
6
|
-
const isWeb = process.env.TAMAGUI_TARGET === "web";
|
|
7
|
-
const isWindowDefined = typeof window !== "undefined";
|
|
8
|
-
const isServer = isWeb && !isWindowDefined;
|
|
9
|
-
const isClient = isWeb && isWindowDefined;
|
|
10
|
-
const isRSC = process.env.ENABLE_RSC ? import.meta.env ? import.meta.env.SSR : false : false;
|
|
11
|
-
const idFn = () => {
|
|
12
|
-
};
|
|
13
|
-
const useIsomorphicLayoutEffect = isRSC ? idFn : isServer ? useEffect : useLayoutEffect;
|
|
14
|
-
const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
|
|
15
|
-
const isWebTouchable = isClient && "ontouchstart" in window;
|
|
16
|
-
const isTouchable = !isWeb || isWebTouchable;
|
|
17
|
-
if (process.env.NODE_ENV === "development") {
|
|
18
|
-
if (!process.env.TAMAGUI_TARGET) {
|
|
19
|
-
console.warn(`Must set TAMAGUI_TARGET to "web" or "native"`);
|
|
20
|
-
} else if (isClient && process.env.TAMAGUI_TARGET !== "web" && process.env.TAMAGUI_IGNORE_TARGET !== "1") {
|
|
21
|
-
console.warn(
|
|
22
|
-
`Must set TAMAGUI_TARGET to "web" for web apps - if you have window defined outside of the browser, set TAMAGUI_IGNORE_TARGET=1 to hide this`
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
isAndroid,
|
|
28
|
-
isChrome,
|
|
29
|
-
isClient,
|
|
30
|
-
isIOS,
|
|
31
|
-
isRSC,
|
|
32
|
-
isServer,
|
|
33
|
-
isTouchable,
|
|
34
|
-
isWeb,
|
|
35
|
-
isWebTouchable,
|
|
36
|
-
isWindowDefined,
|
|
37
|
-
useIsomorphicLayoutEffect
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=platform.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/constants/platform.ts"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isWindowDefined = typeof window !== 'undefined'\nexport const isServer = isWeb && !isWindowDefined\nexport const isClient = isWeb && isWindowDefined\n\n// may want to move to VITE_RSC_BUILD\nexport const isRSC = process.env.ENABLE_RSC\n ? // note this is statically analyzed so no funny business, just access it without optional chaining\n // @ts-ignore\n import.meta.env\n ? // @ts-ignore\n import.meta.env.SSR\n : false\n : false\n\nconst idFn = () => {}\nexport const useIsomorphicLayoutEffect = isRSC ? idFn : isServer ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const isWebTouchable = isClient && 'ontouchstart' in window\nexport const isTouchable = !isWeb || isWebTouchable\n\nif (process.env.NODE_ENV === 'development') {\n if (!process.env.TAMAGUI_TARGET) {\n // eslint-disable-next-line no-console\n console.warn(`Must set TAMAGUI_TARGET to \"web\" or \"native\"`)\n } else if (\n isClient &&\n process.env.TAMAGUI_TARGET !== 'web' &&\n process.env.TAMAGUI_IGNORE_TARGET !== '1'\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Must set TAMAGUI_TARGET to \"web\" for web apps - if you have window defined outside of the browser, set TAMAGUI_IGNORE_TARGET=1 to hide this`\n )\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,SAAS,WAAW,uBAAuB;AAC3C,SAAS,gBAAgB;AAElB,MAAM,cAAY,qCAAU,QAAO;AACnC,MAAM,UAAQ,qCAAU,QAAO;AAC/B,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,kBAAkB,OAAO,WAAW;AAC1C,MAAM,WAAW,SAAS,CAAC;AAC3B,MAAM,WAAW,SAAS;AAG1B,MAAM,QAAQ,QAAQ,IAAI,aAG7B,YAAY,MAEV,YAAY,IAAI,MAChB,QACF;AAEJ,MAAM,OAAO,MAAM;AAAC;AACb,MAAM,4BAA4B,QAAQ,OAAO,WAAW,YAAY;AACxE,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAC5F,MAAM,iBAAiB,YAAY,kBAAkB;AACrD,MAAM,cAAc,CAAC,SAAS;AAErC,IAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,MAAI,CAAC,QAAQ,IAAI,gBAAgB;AAE/B,YAAQ,KAAK,8CAA8C;AAAA,EAC7D,WACE,YACA,QAAQ,IAAI,mBAAmB,SAC/B,QAAQ,IAAI,0BAA0B,KACtC;AAEA,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var _a, _b;
|
|
2
|
-
import { useLayoutEffect } from "react";
|
|
3
|
-
import { Platform } from "react-native";
|
|
4
|
-
const isAndroid = ((_a = Platform) == null ? void 0 : _a.OS) === "android";
|
|
5
|
-
const isIOS = ((_b = Platform) == null ? void 0 : _b.OS) === "ios";
|
|
6
|
-
const isWeb = false;
|
|
7
|
-
const isWindowDefined = false;
|
|
8
|
-
const isServer = false;
|
|
9
|
-
const isClient = false;
|
|
10
|
-
const isRSC = false;
|
|
11
|
-
const useIsomorphicLayoutEffect = useLayoutEffect;
|
|
12
|
-
const isChrome = false;
|
|
13
|
-
const isWebTouchable = false;
|
|
14
|
-
const isTouchable = true;
|
|
15
|
-
export {
|
|
16
|
-
isAndroid,
|
|
17
|
-
isChrome,
|
|
18
|
-
isClient,
|
|
19
|
-
isIOS,
|
|
20
|
-
isRSC,
|
|
21
|
-
isServer,
|
|
22
|
-
isTouchable,
|
|
23
|
-
isWeb,
|
|
24
|
-
isWebTouchable,
|
|
25
|
-
isWindowDefined,
|
|
26
|
-
useIsomorphicLayoutEffect
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=platform.native.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/constants/platform.native.ts"],
|
|
4
|
-
"sourcesContent": ["import { useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = false\nexport const isWindowDefined = false\nexport const isServer = false\nexport const isClient = false\nexport const isRSC = false\nexport const useIsomorphicLayoutEffect = useLayoutEffect\nexport const isChrome = false\nexport const isWebTouchable = false\nexport const isTouchable = true\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AAElB,MAAM,cAAY,qCAAU,QAAO;AACnC,MAAM,UAAQ,qCAAU,QAAO;AAC/B,MAAM,QAAQ;AACd,MAAM,kBAAkB;AACxB,MAAM,WAAW;AACjB,MAAM,WAAW;AACjB,MAAM,QAAQ;AACd,MAAM,4BAA4B;AAClC,MAAM,WAAW;AACjB,MAAM,iBAAiB;AACvB,MAAM,cAAc;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { accessibilityRoleToWebRole, processIDRefList } from "../createComponent";
|
|
2
|
-
function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
|
|
3
|
-
if (!viewProps.role && nativeProps.accessibilityRole) {
|
|
4
|
-
if (nativeProps.accessibilityRole === "none") {
|
|
5
|
-
viewProps.role = "presentation";
|
|
6
|
-
} else {
|
|
7
|
-
const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole];
|
|
8
|
-
if (webRole != null) {
|
|
9
|
-
viewProps.role = webRole || nativeProps.accessibilityRole;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (nativeProps.accessibilityActiveDescendant != null) {
|
|
14
|
-
viewProps["aria-activedescendant"] = nativeProps.accessibilityActiveDescendant;
|
|
15
|
-
}
|
|
16
|
-
if (nativeProps.accessibilityAtomic != null) {
|
|
17
|
-
viewProps["aria-atomic"] = nativeProps.accessibilityAtomic;
|
|
18
|
-
}
|
|
19
|
-
if (nativeProps.accessibilityAutoComplete != null) {
|
|
20
|
-
viewProps["aria-autocomplete"] = nativeProps.accessibilityAutoComplete;
|
|
21
|
-
}
|
|
22
|
-
if (nativeProps.accessibilityBusy != null) {
|
|
23
|
-
viewProps["aria-busy"] = nativeProps.accessibilityBusy;
|
|
24
|
-
}
|
|
25
|
-
if (nativeProps.accessibilityChecked != null) {
|
|
26
|
-
viewProps["aria-checked"] = nativeProps.accessibilityChecked;
|
|
27
|
-
}
|
|
28
|
-
if (nativeProps.accessibilityColumnCount != null) {
|
|
29
|
-
viewProps["aria-colcount"] = nativeProps.accessibilityColumnCount;
|
|
30
|
-
}
|
|
31
|
-
if (nativeProps.accessibilityColumnIndex != null) {
|
|
32
|
-
viewProps["aria-colindex"] = nativeProps.accessibilityColumnIndex;
|
|
33
|
-
}
|
|
34
|
-
if (nativeProps.accessibilityColumnSpan != null) {
|
|
35
|
-
viewProps["aria-colspan"] = nativeProps.accessibilityColumnSpan;
|
|
36
|
-
}
|
|
37
|
-
if (nativeProps.accessibilityControls != null) {
|
|
38
|
-
viewProps["aria-controls"] = processIDRefList(nativeProps.accessibilityControls);
|
|
39
|
-
}
|
|
40
|
-
if (nativeProps.accessibilityCurrent != null) {
|
|
41
|
-
viewProps["aria-current"] = nativeProps.accessibilityCurrent;
|
|
42
|
-
}
|
|
43
|
-
if (nativeProps.accessibilityDescribedBy != null) {
|
|
44
|
-
viewProps["aria-describedby"] = processIDRefList(nativeProps.accessibilityDescribedBy);
|
|
45
|
-
}
|
|
46
|
-
if (nativeProps.accessibilityDetails != null) {
|
|
47
|
-
viewProps["aria-details"] = nativeProps.accessibilityDetails;
|
|
48
|
-
}
|
|
49
|
-
if (nativeProps.disabled === true) {
|
|
50
|
-
viewProps["aria-disabled"] = true;
|
|
51
|
-
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
52
|
-
viewProps.disabled = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (nativeProps.accessibilityErrorMessage != null) {
|
|
56
|
-
viewProps["aria-errormessage"] = nativeProps.accessibilityErrorMessage;
|
|
57
|
-
}
|
|
58
|
-
if (nativeProps.accessibilityExpanded != null) {
|
|
59
|
-
viewProps["aria-expanded"] = nativeProps.accessibilityExpanded;
|
|
60
|
-
}
|
|
61
|
-
if (nativeProps.accessibilityFlowTo != null) {
|
|
62
|
-
viewProps["aria-flowto"] = processIDRefList(nativeProps.accessibilityFlowTo);
|
|
63
|
-
}
|
|
64
|
-
if (nativeProps.accessibilityHasPopup != null) {
|
|
65
|
-
viewProps["aria-haspopup"] = nativeProps.accessibilityHasPopup;
|
|
66
|
-
}
|
|
67
|
-
if (nativeProps.accessibilityHidden === true) {
|
|
68
|
-
viewProps["aria-hidden"] = nativeProps.accessibilityHidden;
|
|
69
|
-
}
|
|
70
|
-
if (nativeProps.accessibilityInvalid != null) {
|
|
71
|
-
viewProps["aria-invalid"] = nativeProps.accessibilityInvalid;
|
|
72
|
-
}
|
|
73
|
-
if (nativeProps.accessibilityKeyShortcuts != null && Array.isArray(nativeProps.accessibilityKeyShortcuts)) {
|
|
74
|
-
viewProps["aria-keyshortcuts"] = nativeProps.accessibilityKeyShortcuts.join(" ");
|
|
75
|
-
}
|
|
76
|
-
if (nativeProps.accessibilityLabel != null) {
|
|
77
|
-
viewProps["aria-label"] = nativeProps.accessibilityLabel;
|
|
78
|
-
}
|
|
79
|
-
if (nativeProps.accessibilityLabelledBy != null) {
|
|
80
|
-
viewProps["aria-labelledby"] = processIDRefList(nativeProps.accessibilityLabelledBy);
|
|
81
|
-
}
|
|
82
|
-
if (nativeProps.accessibilityLevel != null) {
|
|
83
|
-
viewProps["aria-level"] = nativeProps.accessibilityLevel;
|
|
84
|
-
}
|
|
85
|
-
if (nativeProps.accessibilityLiveRegion != null) {
|
|
86
|
-
viewProps["aria-live"] = nativeProps.accessibilityLiveRegion === "none" ? "off" : nativeProps.accessibilityLiveRegion;
|
|
87
|
-
}
|
|
88
|
-
if (nativeProps.accessibilityModal != null) {
|
|
89
|
-
viewProps["aria-modal"] = nativeProps.accessibilityModal;
|
|
90
|
-
}
|
|
91
|
-
if (nativeProps.accessibilityMultiline != null) {
|
|
92
|
-
viewProps["aria-multiline"] = nativeProps.accessibilityMultiline;
|
|
93
|
-
}
|
|
94
|
-
if (nativeProps.accessibilityMultiSelectable != null) {
|
|
95
|
-
viewProps["aria-multiselectable"] = nativeProps.accessibilityMultiSelectable;
|
|
96
|
-
}
|
|
97
|
-
if (nativeProps.accessibilityOrientation != null) {
|
|
98
|
-
viewProps["aria-orientation"] = nativeProps.accessibilityOrientation;
|
|
99
|
-
}
|
|
100
|
-
if (nativeProps.accessibilityOwns != null) {
|
|
101
|
-
viewProps["aria-owns"] = processIDRefList(nativeProps.accessibilityOwns);
|
|
102
|
-
}
|
|
103
|
-
if (nativeProps.accessibilityPlaceholder != null) {
|
|
104
|
-
viewProps["aria-placeholder"] = nativeProps.accessibilityPlaceholder;
|
|
105
|
-
}
|
|
106
|
-
if (nativeProps.accessibilityPosInSet != null) {
|
|
107
|
-
viewProps["aria-posinset"] = nativeProps.accessibilityPosInSet;
|
|
108
|
-
}
|
|
109
|
-
if (nativeProps.accessibilityPressed != null) {
|
|
110
|
-
viewProps["aria-pressed"] = nativeProps.accessibilityPressed;
|
|
111
|
-
}
|
|
112
|
-
if (nativeProps.accessibilityReadOnly != null) {
|
|
113
|
-
viewProps["aria-readonly"] = nativeProps.accessibilityReadOnly;
|
|
114
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
115
|
-
viewProps.readOnly = true;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (nativeProps.accessibilityRequired != null) {
|
|
119
|
-
viewProps["aria-required"] = nativeProps.accessibilityRequired;
|
|
120
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
121
|
-
viewProps.required = true;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (nativeProps.accessibilityRoleDescription != null) {
|
|
125
|
-
viewProps["aria-roledescription"] = nativeProps.accessibilityRoleDescription;
|
|
126
|
-
}
|
|
127
|
-
if (nativeProps.accessibilityRowCount != null) {
|
|
128
|
-
viewProps["aria-rowcount"] = nativeProps.accessibilityRowCount;
|
|
129
|
-
}
|
|
130
|
-
if (nativeProps.accessibilityRowIndex != null) {
|
|
131
|
-
viewProps["aria-rowindex"] = nativeProps.accessibilityRowIndex;
|
|
132
|
-
}
|
|
133
|
-
if (nativeProps.accessibilityRowSpan != null) {
|
|
134
|
-
viewProps["aria-rowspan"] = nativeProps.accessibilityRowSpan;
|
|
135
|
-
}
|
|
136
|
-
if (nativeProps.accessibilitySelected != null) {
|
|
137
|
-
viewProps["aria-selected"] = nativeProps.accessibilitySelected;
|
|
138
|
-
}
|
|
139
|
-
if (nativeProps.accessibilitySetSize != null) {
|
|
140
|
-
viewProps["aria-setsize"] = nativeProps.accessibilitySetSize;
|
|
141
|
-
}
|
|
142
|
-
if (nativeProps.accessibilitySort != null) {
|
|
143
|
-
viewProps["aria-sort"] = nativeProps.accessibilitySort;
|
|
144
|
-
}
|
|
145
|
-
if (nativeProps.accessibilityValueMax != null) {
|
|
146
|
-
viewProps["aria-valuemax"] = nativeProps.accessibilityValueMax;
|
|
147
|
-
}
|
|
148
|
-
if (nativeProps.accessibilityValueMin != null) {
|
|
149
|
-
viewProps["aria-valuemin"] = nativeProps.accessibilityValueMin;
|
|
150
|
-
}
|
|
151
|
-
if (nativeProps.accessibilityValueNow != null) {
|
|
152
|
-
viewProps["aria-valuenow"] = nativeProps.accessibilityValueNow;
|
|
153
|
-
}
|
|
154
|
-
if (nativeProps.accessibilityValueText != null) {
|
|
155
|
-
viewProps["aria-valuetext"] = nativeProps.accessibilityValueText;
|
|
156
|
-
}
|
|
157
|
-
if (nativeProps.nativeID) {
|
|
158
|
-
viewProps.id = nativeProps.nativeID;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
export {
|
|
162
|
-
assignNativePropsToWeb
|
|
163
|
-
};
|
|
164
|
-
//# sourceMappingURL=assignNativePropsToWeb.js.map
|