first implementation of tamagui mobile pages
This commit is contained in:
271
.tamagui/tamaguitext-components.config.cjs
Normal file
271
.tamagui/tamaguitext-components.config.cjs
Normal file
@@ -0,0 +1,271 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// node_modules/@tamagui/text/dist/esm/index.mjs
|
||||
var esm_exports = {};
|
||||
__export(esm_exports, {
|
||||
H1: () => H1,
|
||||
H2: () => H2,
|
||||
H3: () => H3,
|
||||
H4: () => H4,
|
||||
H5: () => H5,
|
||||
H6: () => H6,
|
||||
Heading: () => Heading,
|
||||
Paragraph: () => Paragraph,
|
||||
SizableText: () => SizableText2,
|
||||
wrapChildrenInText: () => wrapChildrenInText
|
||||
});
|
||||
module.exports = __toCommonJS(esm_exports);
|
||||
|
||||
// node_modules/@tamagui/constants/dist/esm/constants.mjs
|
||||
var import_react = __toESM(require("react"), 1);
|
||||
var IS_REACT_19 = typeof import_react.default.use < "u";
|
||||
var isWeb = true;
|
||||
var isWindowDefined = typeof window < "u";
|
||||
var isClient = isWeb && isWindowDefined;
|
||||
var isChrome = typeof navigator < "u" && /Chrome/.test(navigator.userAgent || "");
|
||||
var isWebTouchable = isClient && ("ontouchstart" in window || navigator.maxTouchPoints > 0);
|
||||
var isIos = process.env.TEST_NATIVE_PLATFORM === "ios";
|
||||
|
||||
// node_modules/@tamagui/get-font-sized/dist/esm/index.mjs
|
||||
var import_web = require("@tamagui/core");
|
||||
var getFontSized = /* @__PURE__ */ __name((sizeTokenIn = "$true", {
|
||||
font,
|
||||
fontFamily,
|
||||
props
|
||||
}) => {
|
||||
if (!font) return {
|
||||
fontSize: sizeTokenIn
|
||||
};
|
||||
const sizeToken = sizeTokenIn === "$true" ? getDefaultSizeToken(font) : sizeTokenIn, style = {}, fontSize = font.size[sizeToken], lineHeight = font.lineHeight?.[sizeToken], fontWeight = font.weight?.[sizeToken], letterSpacing = font.letterSpacing?.[sizeToken], textTransform = font.transform?.[sizeToken], fontStyle = props.fontStyle ?? font.style?.[sizeToken], color = props.color ?? font.color?.[sizeToken];
|
||||
return fontStyle && (style.fontStyle = fontStyle), textTransform && (style.textTransform = textTransform), fontFamily && (style.fontFamily = fontFamily), fontWeight && (style.fontWeight = fontWeight), letterSpacing && (style.letterSpacing = letterSpacing), fontSize && (style.fontSize = fontSize), lineHeight && (style.lineHeight = lineHeight), color && (style.color = color), process.env.NODE_ENV === "development" && props.debug && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} getFontSized", sizeTokenIn, sizeToken), isClient && console.info({
|
||||
style,
|
||||
props,
|
||||
font
|
||||
}), console.groupEnd()), style;
|
||||
}, "getFontSized");
|
||||
var SizableText = (0, import_web.styled)(import_web.Text, {
|
||||
name: "SizableText",
|
||||
fontFamily: "$body",
|
||||
variants: {
|
||||
size: {
|
||||
"...fontSize": getFontSized
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
size: "$true"
|
||||
}
|
||||
});
|
||||
var cache = /* @__PURE__ */ new WeakMap();
|
||||
function getDefaultSizeToken(font) {
|
||||
if (typeof font == "object" && cache.has(font)) return cache.get(font);
|
||||
const sizeTokens = "$true" in font.size ? font.size : (0, import_web.getTokens)().size, sizeDefault = sizeTokens.$true, sizeDefaultSpecific = sizeDefault ? Object.keys(sizeTokens).find((x) => x !== "$true" && sizeTokens[x].val === sizeDefault.val) : null;
|
||||
return !sizeDefault || !sizeDefaultSpecific ? (process.env.NODE_ENV === "development" && console.warn(`No default size is set in your tokens for the "true" key, fonts will be inconsistent.
|
||||
|
||||
Fix this by having consistent tokens across fonts and sizes and setting a true key for your size tokens, or
|
||||
set true keys for all your font tokens: "size", "lineHeight", "fontStyle", etc.`), Object.keys(font.size)[3]) : (cache.set(font, sizeDefaultSpecific), sizeDefaultSpecific);
|
||||
}
|
||||
__name(getDefaultSizeToken, "getDefaultSizeToken");
|
||||
|
||||
// node_modules/@tamagui/text/dist/esm/SizableText.mjs
|
||||
var import_web2 = require("@tamagui/core");
|
||||
var SizableText2 = (0, import_web2.styled)(import_web2.Text, {
|
||||
name: "SizableText",
|
||||
fontFamily: "$body",
|
||||
variants: {
|
||||
unstyled: {
|
||||
false: {
|
||||
size: "$true",
|
||||
color: "$color"
|
||||
}
|
||||
},
|
||||
size: getFontSized
|
||||
},
|
||||
defaultVariants: {
|
||||
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
||||
}
|
||||
});
|
||||
SizableText2.staticConfig.variants.fontFamily = {
|
||||
"...": /* @__PURE__ */ __name((_val, extras) => {
|
||||
const sizeProp = extras.props.size, fontSizeProp = extras.props.fontSize, size = sizeProp === "$true" && fontSizeProp ? fontSizeProp : extras.props.size || "$true";
|
||||
return getFontSized(size, extras);
|
||||
}, "...")
|
||||
};
|
||||
|
||||
// node_modules/@tamagui/text/dist/esm/Paragraph.mjs
|
||||
var import_web3 = require("@tamagui/core");
|
||||
var Paragraph = (0, import_web3.styled)(SizableText2, {
|
||||
name: "Paragraph",
|
||||
tag: "p",
|
||||
userSelect: "auto",
|
||||
color: "$color",
|
||||
size: "$true",
|
||||
whiteSpace: "normal"
|
||||
});
|
||||
|
||||
// node_modules/@tamagui/text/dist/esm/Headings.mjs
|
||||
var import_web4 = require("@tamagui/core");
|
||||
var Heading = (0, import_web4.styled)(Paragraph, {
|
||||
tag: "span",
|
||||
name: "Heading",
|
||||
accessibilityRole: "header",
|
||||
fontFamily: "$heading",
|
||||
size: "$8",
|
||||
margin: 0
|
||||
});
|
||||
var H1 = (0, import_web4.styled)(Heading, {
|
||||
name: "H1",
|
||||
tag: "h1",
|
||||
variants: {
|
||||
unstyled: {
|
||||
false: {
|
||||
size: "$10"
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
||||
}
|
||||
});
|
||||
var H2 = (0, import_web4.styled)(Heading, {
|
||||
name: "H2",
|
||||
tag: "h2",
|
||||
variants: {
|
||||
unstyled: {
|
||||
false: {
|
||||
size: "$9"
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
||||
}
|
||||
});
|
||||
var H3 = (0, import_web4.styled)(Heading, {
|
||||
name: "H3",
|
||||
tag: "h3",
|
||||
variants: {
|
||||
unstyled: {
|
||||
false: {
|
||||
size: "$8"
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
||||
}
|
||||
});
|
||||
var H4 = (0, import_web4.styled)(Heading, {
|
||||
name: "H4",
|
||||
tag: "h4",
|
||||
variants: {
|
||||
unstyled: {
|
||||
false: {
|
||||
size: "$7"
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
||||
}
|
||||
});
|
||||
var H5 = (0, import_web4.styled)(Heading, {
|
||||
name: "H5",
|
||||
tag: "h5",
|
||||
variants: {
|
||||
unstyled: {
|
||||
false: {
|
||||
size: "$6"
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
||||
}
|
||||
});
|
||||
var H6 = (0, import_web4.styled)(Heading, {
|
||||
name: "H6",
|
||||
tag: "h6",
|
||||
variants: {
|
||||
unstyled: {
|
||||
false: {
|
||||
size: "$5"
|
||||
}
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
||||
}
|
||||
});
|
||||
|
||||
// node_modules/@tamagui/text/dist/esm/wrapChildrenInText.mjs
|
||||
var import_react2 = __toESM(require("react"), 1);
|
||||
var import_jsx_runtime = require("react/jsx-runtime");
|
||||
function wrapChildrenInText(TextComponent, propsIn, extraProps) {
|
||||
const {
|
||||
children,
|
||||
textProps,
|
||||
size,
|
||||
noTextWrap,
|
||||
color,
|
||||
fontFamily,
|
||||
fontSize,
|
||||
fontWeight,
|
||||
letterSpacing,
|
||||
textAlign,
|
||||
fontStyle,
|
||||
maxFontSizeMultiplier
|
||||
} = propsIn;
|
||||
if (noTextWrap || !children) return [children];
|
||||
const props = {
|
||||
...extraProps
|
||||
};
|
||||
return color && (props.color = color), fontFamily && (props.fontFamily = fontFamily), fontSize && (props.fontSize = fontSize), fontWeight && (props.fontWeight = fontWeight), letterSpacing && (props.letterSpacing = letterSpacing), textAlign && (props.textAlign = textAlign), size && (props.size = size), fontStyle && (props.fontStyle = fontStyle), maxFontSizeMultiplier && (props.maxFontSizeMultiplier = maxFontSizeMultiplier), import_react2.default.Children.toArray(children).map((child, index) => typeof child == "string" ? (
|
||||
// so "data-disable-theme" is a hack to fix themeInverse, don't ask me why
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextComponent, {
|
||||
...props,
|
||||
...textProps,
|
||||
children: child
|
||||
}, index)
|
||||
) : child);
|
||||
}
|
||||
__name(wrapChildrenInText, "wrapChildrenInText");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
H1,
|
||||
H2,
|
||||
H3,
|
||||
H4,
|
||||
H5,
|
||||
H6,
|
||||
Heading,
|
||||
Paragraph,
|
||||
SizableText,
|
||||
wrapChildrenInText
|
||||
});
|
||||
Reference in New Issue
Block a user