@tamagui/core 1.0.1-beta.195 → 1.0.1-beta.197
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/createComponent.js +12 -7
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/styled.js +10 -7
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/createComponent.js +12 -7
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/styled.js +10 -7
- package/dist/esm/styled.js.map +2 -2
- package/package.json +12 -12
- package/src/createComponent.tsx +16 -8
- package/src/styled.tsx +10 -7
- package/src/types.tsx +2 -2
- package/types/types.d.ts +2 -2
|
@@ -97,6 +97,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
97
97
|
const avoidClassesWhileAnimating = true;
|
|
98
98
|
let defaultNativeStyle;
|
|
99
99
|
let tamaguiDefaultProps;
|
|
100
|
+
let defaultTag;
|
|
100
101
|
let initialSplitStyles;
|
|
101
102
|
const component = (0, import_react.forwardRef)((propsIn, forwardedRef) => {
|
|
102
103
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -153,7 +154,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
153
154
|
setStateShallow({ hasAnimation: true });
|
|
154
155
|
}
|
|
155
156
|
const isTaggable = !Component || typeof Component === "string";
|
|
156
|
-
const element = import_constants.isWeb ? isTaggable ? props.tag || Component : Component : Component;
|
|
157
|
+
const element = import_constants.isWeb ? isTaggable ? props.tag || defaultTag || Component : Component : Component;
|
|
157
158
|
const BaseTextComponent = BaseText || element || "span";
|
|
158
159
|
const BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
159
160
|
let elementType = isText ? (isAnimated ? AnimatedText : null) || BaseTextComponent : (isAnimated ? AnimatedView : null) || BaseViewComponent;
|
|
@@ -170,8 +171,8 @@ function createComponent(configIn, ParentComponent) {
|
|
|
170
171
|
debugProp
|
|
171
172
|
);
|
|
172
173
|
const hostRef = (0, import_useServerHooks.useServerRef)(null);
|
|
173
|
-
const
|
|
174
|
-
staticConfig.
|
|
174
|
+
const isReactNative = Boolean(
|
|
175
|
+
staticConfig.isReactNative || isAnimated && tamaguiConfig.animations.isReactNative
|
|
175
176
|
);
|
|
176
177
|
const isAnimatedReactNativeWeb = isAnimated && avoidClassesWhileAnimating;
|
|
177
178
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -180,7 +181,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
180
181
|
}
|
|
181
182
|
if (debugProp) {
|
|
182
183
|
const name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`;
|
|
183
|
-
const type =
|
|
184
|
+
const type = isReactNative ? "rnw" : "tamagui";
|
|
184
185
|
const banner = `${name} ${propsIn["data-is"] || ""} ${type}`;
|
|
185
186
|
console.group(`%c \u{1F41B} ${banner}`, "background: yellow;");
|
|
186
187
|
console.groupCollapsed("initial props/state");
|
|
@@ -313,7 +314,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
313
314
|
} = viewPropsIn;
|
|
314
315
|
const disabled = props.accessibilityState != null && props.accessibilityState.disabled === true || props.accessibilityDisabled;
|
|
315
316
|
let viewProps;
|
|
316
|
-
if (process.env.TAMAGUI_TARGET === "web" && !
|
|
317
|
+
if (process.env.TAMAGUI_TARGET === "web" && !isReactNative) {
|
|
317
318
|
const {
|
|
318
319
|
onMoveShouldSetResponder,
|
|
319
320
|
onMoveShouldSetResponderCapture,
|
|
@@ -456,7 +457,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
456
457
|
const style = animationStyles ?? splitStyles.style;
|
|
457
458
|
if (isAnimatedReactNativeWeb) {
|
|
458
459
|
viewProps.style = style;
|
|
459
|
-
} else if (
|
|
460
|
+
} else if (isReactNative) {
|
|
460
461
|
const rnwStyle = { $$css: true };
|
|
461
462
|
for (const name of className.split(" ")) {
|
|
462
463
|
rnwStyle[name] = name;
|
|
@@ -718,6 +719,9 @@ function createComponent(configIn, ParentComponent) {
|
|
|
718
719
|
}
|
|
719
720
|
const debug = defaultPropsIn["debug"];
|
|
720
721
|
const [ourProps, ourClassNames] = (0, import_mergeProps.mergeProps)(defaultPropsIn, {}, true);
|
|
722
|
+
if (ourProps.tag) {
|
|
723
|
+
defaultTag = ourProps.tag;
|
|
724
|
+
}
|
|
721
725
|
initialSplitStyles = (0, import_getSplitStyles.insertSplitStyles)(
|
|
722
726
|
ourProps,
|
|
723
727
|
staticConfig,
|
|
@@ -776,7 +780,8 @@ function createComponent(configIn, ParentComponent) {
|
|
|
776
780
|
defaultPropsInKeyOrder: Object.keys(defaultPropsIn).map((k) => [k, defaultPropsIn[k]]),
|
|
777
781
|
ourProps,
|
|
778
782
|
ourClassNames,
|
|
779
|
-
defaultsClassnames
|
|
783
|
+
defaultsClassnames,
|
|
784
|
+
defaultTag
|
|
780
785
|
});
|
|
781
786
|
}
|
|
782
787
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createComponent.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useComposedRefs } from '@tamagui/compose-refs'\nimport { isClient, isRSC, isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'\n/* eslint-disable react-hooks/rules-of-hooks */\nimport {\n composeEventHandlers,\n stylePropsView,\n validPseudoKeys,\n validStyles,\n} from '@tamagui/helpers'\nimport { useResponderEvents } from '@tamagui/react-native-use-responder-events'\nimport type { ViewStyle } from '@tamagui/types-react-native'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n RefObject,\n createElement,\n forwardRef,\n memo,\n useCallback,\n useContext,\n useEffect,\n} from 'react'\n\nimport { onConfiguredOnce } from './config'\nimport { stackDefaultStyles } from './constants/constants'\nimport { FontLanguageContext } from './contexts/FontLanguageContext'\nimport { TextAncestorContext } from './contexts/TextAncestorContext'\nimport { getReturnVariablesAs } from './helpers/createPropMapper'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport {\n SplitStyleResult,\n getSubStyle,\n insertSplitStyles,\n useSplitStyles,\n} from './helpers/getSplitStyles'\nimport { getAllSelectors } from './helpers/insertStyleRule'\nimport { mergeProps } from './helpers/mergeProps'\nimport { proxyThemeVariables } from './helpers/proxyThemeVariables'\nimport { useShallowSetState } from './helpers/useShallowSetState'\nimport { getRect, measureLayout, useElementLayout } from './hooks/useElementLayout'\nimport { addMediaQueryListener, getInitialMediaState } from './hooks/useMedia'\nimport { useServerRef, useServerState } from './hooks/useServerHooks'\nimport { getThemeManager, useTheme } from './hooks/useTheme'\nimport {\n SpaceDirection,\n SpaceTokens,\n SpacerProps,\n StaticConfig,\n StaticConfigParsed,\n StylableComponent,\n TamaguiComponent,\n TamaguiComponentState,\n TamaguiConfig,\n TamaguiElement,\n TamaguiInternalConfig,\n UseAnimationHook,\n UseAnimationProps,\n} from './types'\nimport { usePressability } from './vendor/Pressability'\nimport { Slot, mergeEvent } from './views/Slot'\nimport { Stack } from './views/Stack'\nimport { wrapThemeManagerContext } from './views/Theme'\n\nReact['keep']\n\n/**\n * All things that need one-time setup after createTamagui is called\n */\nlet defaultComponentState: TamaguiComponentState | null = null\nlet defaultComponentStateMounted: TamaguiComponentState | null = null\nlet tamaguiConfig: TamaguiInternalConfig\nlet AnimatedText: any\nlet AnimatedView: any\nlet initialTheme: any\n\nexport const mouseUps = new Set<Function>()\nif (typeof document !== 'undefined') {\n const cancelTouches = () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n }\n document.addEventListener('mouseup', cancelTouches)\n document.addEventListener('touchend', cancelTouches)\n document.addEventListener('touchcancel', cancelTouches)\n}\n\n// mutates\nfunction mergeShorthands({ defaultProps }: StaticConfigParsed, { shorthands }: TamaguiConfig) {\n // they are defined in correct order already { ...parent, ...child }\n for (const key of Object.keys(defaultProps)) {\n defaultProps[shorthands[key] || key] = defaultProps[key]\n }\n}\n\n/**\n * Only on native do we need the actual underlying View/Text\n * On the web we avoid react-native altogether in core.\n */\nlet BaseText: any\nlet BaseView: any\nif (process.env.TAMAGUI_TARGET === 'native') {\n const native = require('react-native')\n BaseText = native.Text || native.default.Text\n BaseView = native.View || native.default.View\n}\n\nexport function createComponent<\n ComponentPropTypes extends Object = {},\n Ref = TamaguiElement,\n BaseProps = never\n>(configIn: Partial<StaticConfig> | StaticConfigParsed, ParentComponent?: StylableComponent) {\n const staticConfig = (() => {\n const next = extendStaticConfig(configIn, ParentComponent)\n if ('parsed' in next) {\n return next\n } else {\n return parseStaticConfig(next)\n }\n })()\n\n const defaultComponentClassName = `is_${staticConfig.componentName}`\n const avoidClassesWhileAnimating = true\n let defaultNativeStyle: any\n let tamaguiDefaultProps: any\n let initialSplitStyles: SplitStyleResult\n\n // see onConfiguredOnce below which attaches a name then to this component\n const component = forwardRef<Ref, ComponentPropTypes>((propsIn: any, forwardedRef) => {\n // React inserts default props after your props for some reason...\n // order important so we do loops, you can't just spread because JS does weird things\n let props: any\n if (tamaguiDefaultProps && !propsIn.asChild) {\n props = mergeProps(tamaguiDefaultProps, propsIn)[0]\n } else {\n props = propsIn\n }\n\n const debugProp = props['debug']\n const { Component, isText, isZStack } = staticConfig\n const componentName = props.componentName || staticConfig.componentName\n const componentClassName = props.asChild\n ? ''\n : props.componentName\n ? `is_${props.componentName}`\n : defaultComponentClassName\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, componentName, props, forceUpdate)\n\n /**\n * Component state for tracking animations, pseudos\n */\n const hasEnterStyle = !!props.enterStyle\n const needsMount = Boolean((isWeb ? isClient : true) && (hasEnterStyle || props.animation))\n const states = useServerState<TamaguiComponentState>(\n needsMount ? defaultComponentState! : defaultComponentStateMounted!\n )\n\n const state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: true } : states[0]\n const setState = states[1]\n const setStateShallow = useShallowSetState(setState)\n\n const shouldSetMounted = needsMount && !state.mounted\n const setMounted = shouldSetMounted\n ? () => {\n // for some reason without some small delay it doesn't animate css\n setTimeout(\n () => {\n setStateShallow({\n mounted: true,\n })\n },\n isWeb ? 10 : 0\n )\n }\n : undefined\n\n const shouldAvoidClasses =\n !!(props.animation && avoidClassesWhileAnimating) || !staticConfig.acceptsClassName\n\n const shouldForcePseudo = !!propsIn.forceStyle\n const hasTextAncestor = !!(isWeb && isText ? useContext(TextAncestorContext) : false)\n const splitStyleState =\n !shouldAvoidClasses && !shouldForcePseudo\n ? {\n ...state,\n hasTextAncestor,\n dynamicStylesInline: true,\n }\n : ({\n ...state,\n noClassNames: true,\n dynamicStylesInline: true,\n hasTextAncestor,\n resolveVariablesAs: 'value',\n } as const)\n\n const languageContext = isRSC ? null : useContext(FontLanguageContext)\n\n const useAnimations = tamaguiConfig.animations?.useAnimations as UseAnimationHook | undefined\n const nextIsAnimated = !!(useAnimations && props.animation)\n // conditional but if ever true stays true\n const isAnimated = nextIsAnimated || state.hasAnimation\n if (nextIsAnimated && !state.hasAnimation) {\n setStateShallow({ hasAnimation: true })\n }\n\n const isTaggable = !Component || typeof Component === 'string'\n // default to tag, fallback to component (when both strings)\n const element = isWeb ? (isTaggable ? props.tag || Component : Component) : Component\n\n const BaseTextComponent = BaseText || element || 'span'\n const BaseViewComponent = BaseView || element || (hasTextAncestor ? 'span' : 'div')\n let elementType = isText\n ? (isAnimated ? AnimatedText : null) || BaseTextComponent\n : (isAnimated ? AnimatedView : null) || BaseViewComponent\n\n elementType = Component || elementType\n const isStringElement = typeof elementType === 'string'\n\n const splitStyles = useSplitStyles(\n props,\n staticConfig,\n theme,\n splitStyleState,\n props.asChild ? null : initialSplitStyles,\n languageContext || undefined,\n elementType,\n debugProp\n )\n\n const hostRef = useServerRef<TamaguiElement>(null)\n\n // animation setup\n const isReactNativeWeb = Boolean(\n staticConfig.isReactNativeWeb || (isAnimated && tamaguiConfig.animations.isReactNativeWeb)\n )\n const isAnimatedReactNativeWeb = isAnimated && avoidClassesWhileAnimating\n\n if (process.env.NODE_ENV === 'development') {\n if (!process.env.TAMAGUI_TARGET) {\n // eslint-disable-next-line no-console\n console.error(`No process.env.TAMAGUI_TARGET set, please set it to \"native\" or \"web\".`)\n }\n\n if (debugProp) {\n const name = `${\n componentName || Component?.displayName || Component?.name || '[Unnamed Component]'\n }`\n const type = isReactNativeWeb ? 'rnw' : 'tamagui'\n const banner = `${name} ${propsIn['data-is'] || ''} ${type}`\n // eslint-disable-next-line no-console\n console.group(`%c \uD83D\uDC1B ${banner}`, 'background: yellow;')\n // eslint-disable-next-line no-console\n console.groupCollapsed('initial props/state')\n // eslint-disable-next-line no-console\n console.log('props', propsIn)\n // eslint-disable-next-line no-console\n console.log('splitStyles', splitStyles)\n // eslint-disable-next-line no-console\n console.log('className', Object.values(splitStyles.classNames))\n if (typeof window !== 'undefined') {\n // eslint-disable-next-line no-console\n console.log('ref', hostRef, '(click to view)')\n }\n // eslint-disable-next-line no-console\n console.groupEnd()\n if (debugProp === 'break') {\n // eslint-disable-next-line no-debugger\n debugger\n }\n }\n }\n\n const {\n viewProps: viewPropsIn,\n pseudos,\n medias,\n style: splitStylesStyle,\n classNames,\n mediaKeys,\n } = splitStyles\n\n const animationFeatureStylesIn = props.animation\n ? { ...defaultNativeStyle, ...splitStylesStyle }\n : null\n const propsWithAnimation = props as UseAnimationProps\n\n // once you set animation prop don't remove it, you can set to undefined/false\n // reason is animations are heavy - no way around it, and must be run inline here (\uD83D\uDE45 loading as a sub-component)\n let animationStyles: any\n if (!isRSC && isAnimated && useAnimations) {\n const animations = useAnimations(propsWithAnimation, {\n state,\n pseudos,\n onDidAnimate: props.onDidAnimate,\n hostRef,\n staticConfig,\n getStyle({ isExiting, isEntering, exitVariant, enterVariant } = {}) {\n // we have to merge such that transforms keys all exist\n const style = animationFeatureStylesIn\n\n const enterStyle = isEntering\n ? enterVariant && staticConfig.variants?.[enterVariant]['true']\n ? getSubStyle(\n '',\n staticConfig.variants?.[enterVariant]['true'],\n staticConfig,\n theme,\n props,\n state,\n tamaguiConfig\n ) || pseudos.enterStyle\n : pseudos.enterStyle\n : null\n\n const exitStyle = isExiting\n ? exitVariant && staticConfig.variants?.[exitVariant]['true']\n ? getSubStyle(\n '',\n staticConfig.variants?.[exitVariant]['true'],\n staticConfig,\n theme,\n props,\n state,\n tamaguiConfig\n ) || pseudos.exitStyle\n : pseudos.exitStyle\n : null\n\n // if you have hoverStyle={{ scale: 1.1 }} and don't have scale set on the base style\n // no animation will run! this is really confusing. this will look at all variants,\n // and fill in base styles if they don't exist. eg:\n // input:\n // base: {}\n // hoverStyle: { scale: 2 }\n // enterStyle: { x: 100 }\n // output:\n // base: { x: 0, scale: 1 }\n ensureBaseHasDefaults(\n style,\n // enterStyle,\n pseudos.hoverStyle,\n pseudos.focusStyle,\n pseudos.pressStyle\n )\n\n enterStyle && isEntering && merge(style, enterStyle)\n state.hover && pseudos.hoverStyle && merge(style, pseudos.hoverStyle)\n state.focus && pseudos.focusStyle && merge(style, pseudos.focusStyle)\n state.press && pseudos.pressStyle && merge(style, pseudos.pressStyle)\n exitStyle && isExiting && merge(style, exitStyle)\n\n if (process.env.NODE_ENV === 'development') {\n if (debugProp === 'verbose') {\n // eslint-disable-next-line no-console\n console.log('animation style', style)\n }\n }\n\n return style\n },\n //, delay\n })\n\n if (animations) {\n animationStyles = animations.style\n }\n }\n\n // media queries\n useIsomorphicLayoutEffect(() => {\n if (!mediaKeys.length) return\n const disposers: any[] = []\n for (const key of mediaKeys) {\n disposers.push(\n addMediaQueryListener(key, (next: boolean) => {\n setState((prev) => {\n if (prev.mediaState![key] !== next) {\n return {\n ...prev,\n mediaState: {\n ...prev.mediaState,\n [key]: next,\n },\n }\n }\n return prev\n })\n })\n )\n }\n return () => {\n for (const disposer of disposers) {\n disposer()\n }\n }\n }, [mediaKeys.join(',')])\n\n const {\n hitSlop,\n asChild,\n children,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n themeShallow,\n space: spaceProp,\n spaceDirection: _spaceDirection,\n disabled: disabledProp,\n onMouseUp,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\n separator,\n // ignore from here on out\n forceStyle: _forceStyle,\n // @ts-ignore for next/link compat etc\n onClick,\n theme: _themeProp,\n // @ts-ignore\n defaultVariants,\n\n ...nonTamaguiProps\n } = viewPropsIn\n\n const disabled =\n (props.accessibilityState != null && props.accessibilityState.disabled === true) ||\n props.accessibilityDisabled\n\n // these can ultimately be for DOM, react-native-web views, or animated views\n // so the type is pretty loose\n let viewProps: Record<string, any>\n\n // if react-native-web view just pass all props down\n if (process.env.TAMAGUI_TARGET === 'web' && !isReactNativeWeb) {\n // otherwise replicate react-native-web functionality\n const {\n // event props\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n\n // android\n collapsable,\n focusable,\n\n // deprecated,\n accessible,\n accessibilityDisabled,\n\n onLayout,\n\n ...webProps\n } = nonTamaguiProps\n\n viewProps = webProps\n\n if (!isRSC) {\n usePlatformMethods(hostRef as RefObject<Element>)\n\n useElementLayout(hostRef as RefObject<Element>, onLayout as any)\n\n useResponderEvents(hostRef, {\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n } as any)\n }\n\n if (props.href != undefined && hrefAttrs != undefined) {\n const { download, rel, target } = hrefAttrs\n if (download != null) {\n viewProps.download = download\n }\n if (rel != null) {\n viewProps.rel = rel\n }\n if (typeof target === 'string') {\n viewProps.target = target.charAt(0) !== '_' ? '_' + target : target\n }\n }\n\n // FOCUS\n // \"focusable\" indicates that an element may be a keyboard tab-stop.\n const _focusable = focusable != undefined ? focusable : accessible\n const role = viewProps.role\n if (_focusable === false) {\n viewProps.tabIndex = '-1'\n }\n if (\n // These native elements are focusable by default\n elementType === 'a' ||\n elementType === 'button' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n if (_focusable === false || accessibilityDisabled === true) {\n viewProps.tabIndex = '-1'\n }\n } else if (\n // These roles are made focusable by default\n role === 'button' ||\n role === 'checkbox' ||\n role === 'link' ||\n role === 'radio' ||\n role === 'textbox' ||\n role === 'switch'\n ) {\n if (_focusable !== false) {\n viewProps.tabIndex = '0'\n }\n }\n // Everything else must explicitly set the prop\n if (_focusable === true) {\n viewProps.tabIndex = '0'\n }\n } else {\n viewProps = nonTamaguiProps\n }\n\n viewProps.ref = useComposedRefs(hostRef as any, forwardedRef, setMounted)\n\n if (process.env.NODE_ENV === 'development' && !isText && isWeb && !staticConfig.isHOC) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n // eslint-disable-next-line no-console\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n const unPress = useCallback(() => {\n setStateShallow({\n press: false,\n pressIn: false,\n })\n }, [setStateShallow])\n\n if (!isRSC) {\n useEffect(() => {\n return () => {\n mouseUps.delete(unPress)\n }\n }, [unPress])\n }\n\n let styles: any[]\n\n if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {\n styles = {\n ...defaultNativeStyle,\n ...(animationStyles ?? splitStylesStyle),\n ...medias,\n }\n } else {\n styles = [isWeb ? null : defaultNativeStyle, animationStyles ?? splitStylesStyle, medias]\n if (!animationStyles && initialSplitStyles) {\n const initPseudos = initialSplitStyles.pseudos\n !state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, 'enterStyle')\n state.hover &&\n addPseudoToStyles(styles, initPseudos, pseudos, 'hoverStyle', shouldForcePseudo)\n state.focus &&\n addPseudoToStyles(styles, initPseudos, pseudos, 'focusStyle', shouldForcePseudo)\n state.press &&\n addPseudoToStyles(styles, initPseudos, pseudos, 'pressStyle', shouldForcePseudo)\n }\n // ugly but for now...\n if (shouldForcePseudo) {\n const next = {}\n for (const style of styles) {\n if (style) {\n Object.assign(next, style)\n }\n }\n // @ts-ignore\n Object.assign(splitStyles.style, next)\n }\n }\n\n let fontFamily = isText ? splitStyles.fontFamily || staticConfig.defaultProps.fontFamily : null\n if (fontFamily && fontFamily[0] === '$') {\n fontFamily = fontFamily.slice(1)\n }\n const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : ''\n\n if (process.env.TAMAGUI_TARGET === 'web') {\n const classList = [\n componentName ? componentClassName : '',\n fontFamilyClassName,\n theme.className,\n classNames ? Object.values(classNames).join(' ') : '',\n ]\n\n const className = classList.join(' ')\n const style = animationStyles ?? splitStyles.style\n\n if (isAnimatedReactNativeWeb) {\n viewProps.style = style\n } else if (isReactNativeWeb) {\n const rnwStyle = { $$css: true }\n for (const name of className.split(' ')) {\n rnwStyle[name] = name\n }\n viewProps.style = [rnwStyle, ...(Array.isArray(style) ? style : [style])]\n if (process.env.NODE_ENV === 'development') {\n // turn debug data- props into dataSet in dev mode\n Object.keys(viewProps).forEach((key) => {\n if (key.startsWith('data-')) {\n viewProps.dataSet ??= {}\n viewProps.dataSet[key.replace('data-', '')] = viewProps[key]\n delete viewProps[key]\n }\n })\n }\n } else {\n viewProps.className = className\n viewProps.style = style\n }\n }\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n // swap out the right family based on weight/style\n if (splitStyles.fontFamily) {\n const faceInfo = tamaguiConfig.fontsParsed[splitStyles.fontFamily]?.face\n if (faceInfo) {\n const [weight, style] = (() => {\n let weight: string | undefined\n let style: string | undefined\n for (let i = styles.length; i >= 0; i--) {\n weight ??= styles[i]?.fontWeight\n style ??= styles[i]?.fontStyle\n }\n return [weight || '400', style || 'normal'] as const\n })()\n const overrideFace = faceInfo[weight]?.[style]?.val\n if (overrideFace) {\n for (const style of styles) {\n if (style?.fontFamily) {\n style.fontFamily = overrideFace\n }\n }\n }\n }\n }\n\n // assign styles\n viewProps.style = styles\n }\n\n // TODO need to loop active variants and see if they have matchin pseudos and apply as well\n const initialPseudos = initialSplitStyles?.pseudos\n const attachPress = !!(\n pseudos?.pressStyle ||\n initialPseudos?.pressStyle ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n\n const isHoverable = isWeb\n const attachHover =\n isHoverable &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n const handlesPressEvents = !isWeb && !asChild\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n const shouldAttach =\n !asChild &&\n (attachPress ||\n attachHover ||\n 'pressStyle' in props ||\n 'onPress' in props ||\n 'onPressIn' in props ||\n 'onPressOut' in props ||\n (isWeb &&\n ('hoverStyle' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props)))\n\n const events =\n shouldAttach && !isRSC\n ? {\n onPressOut: attachPress\n ? (e) => {\n unPress()\n onPressOut?.(e)\n onMouseUp?.(e)\n }\n : undefined,\n ...(isHoverable && {\n onMouseEnter: attachHover\n ? (e) => {\n const next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (attachHover || state.pressIn) {\n setStateShallow(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave: attachHover\n ? (e) => {\n const next: Partial<typeof state> = {}\n mouseUps.add(unPress)\n if (attachHover) {\n next.hover = false\n }\n if (state.pressIn) {\n next.press = false\n next.pressIn = false\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n onPressIn: attachPress\n ? (e) => {\n setStateShallow({\n press: true,\n pressIn: true,\n hover: false,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n if (isWeb) {\n mouseUps.add(unPress)\n }\n }\n : undefined,\n onPress: attachPress\n ? (e) => {\n unPress()\n // @ts-ignore\n onClick?.(e)\n onPress?.(e)\n }\n : undefined,\n\n // replicating TouchableWithoutFeedback\n ...(!isWeb && {\n cancelable: !props.rejectResponderTermination,\n disabled:\n props.disabled !== null ? props.disabled : props.accessibilityState?.disabled,\n hitSlop: props.hitSlop,\n delayLongPress: props.delayLongPress,\n delayPressIn: props.delayPressIn,\n delayPressOut: props.delayPressOut,\n focusable: viewProps.focusable ?? true,\n minPressDuration: 0,\n }),\n }\n : null\n\n let space = spaceProp\n\n // find space by media query\n if (state.mediaState && mediaKeys.length) {\n for (const key in state.mediaState) {\n if (!state.mediaState[key]) continue\n if (props[key] && props[key].space !== undefined) {\n space = props[key].space\n }\n }\n }\n\n const themeManager = getThemeManager(theme)\n\n const shouldSetChildrenThemeToParent = Boolean(\n themeShallow && themeManager && themeManager.didChangeTheme\n )\n\n const shouldProvideThemeManager =\n shouldSetChildrenThemeToParent || (themeManager && themeManager.didChangeTheme)\n\n const childEls =\n !children || asChild\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n separator,\n children,\n space,\n direction: props.spaceDirection || 'both',\n isZStack,\n }),\n // only set context if changed theme\n shouldProvideThemeManager ? themeManager : undefined,\n shouldSetChildrenThemeToParent\n )\n\n let content: any\n\n if (asChild) {\n elementType = Slot\n viewProps = {\n ...viewProps,\n onPress,\n onPressIn,\n onPressOut,\n }\n }\n\n // EVENTS native\n if (process.env.TAMAGUI_TARGET === 'native') {\n // add focus events\n const attachFocus = !!(\n (pseudos && pseudos.focusStyle) ||\n (initialPseudos && initialPseudos.focusStyle)\n )\n if (attachFocus) {\n viewProps.onFocus = mergeEvent(viewProps.onFocus, () => {\n setStateShallow({ focus: true })\n })\n viewProps.onBlur = mergeEvent(viewProps.onBlur, () => {\n setStateShallow({ focus: false })\n })\n }\n\n // use Pressability to get smooth unPress when you press + hold + move out\n // only ever create once, use .configure() to update later\n const pressability = usePressability(events)\n if (attachPress && events) {\n if (hitSlop) {\n viewProps.hitSlop = hitSlop\n }\n for (const key in pressability) {\n const og = props[key]\n const val = pressability[key]\n viewProps[key] =\n og && !dontComposePressabilityKeys[key] ? composeEventHandlers(og, val) : val\n }\n }\n }\n\n content = createElement(elementType, viewProps, childEls)\n\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (events) {\n content = (\n <span\n style={styleDisplayContents}\n onMouseEnter={events.onMouseEnter}\n onMouseLeave={events.onMouseLeave}\n onClick={events.onPress}\n onMouseDown={events.onPressIn}\n onMouseUp={events.onPressOut}\n onTouchStart={events.onPressIn}\n onTouchEnd={events.onPressOut}\n >\n {content}\n </span>\n )\n }\n\n // special weird case since there's a bug in RNW where we can't animate + pass style { $$css }\n // but we need is_font classnames... need to see about RNW bug and then can remove this\n if (isText && isAnimatedReactNativeWeb) {\n content = (\n <span className={fontFamilyClassName} style={styleDisplayContents}>\n {content}\n </span>\n )\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (debugProp) {\n const element = typeof elementType === 'string' ? elementType : 'Component'\n // eslint-disable-next-line no-console\n console.groupCollapsed(`render <${element} /> with props`, viewProps)\n for (const key in viewProps) {\n // eslint-disable-next-line no-console\n console.log(key, viewProps[key])\n }\n // eslint-disable-next-line no-console\n console.log('children', content)\n // eslint-disable-next-line no-console\n console.groupEnd()\n if (typeof window !== 'undefined') {\n // prettier-ignore\n // eslint-disable-next-line no-console\n console.log({ state, shouldProvideThemeManager, tamaguiDefaultProps, viewProps, splitStyles, animationStyles, handlesPressEvents, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), events, shouldAttach, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses: avoidClassesWhileAnimating, animation: props.animation, style: splitStylesStyle, defaultNativeStyle, initialSplitStyles, ...(typeof window !== 'undefined' ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) } : null) })\n }\n // eslint-disable-next-line no-console\n console.groupEnd()\n }\n }\n\n return content\n })\n\n if (staticConfig.componentName) {\n component.displayName = staticConfig.componentName\n }\n\n onConfiguredOnce((conf) => {\n // one time only setup\n if (!tamaguiConfig) {\n tamaguiConfig = conf\n\n if (!defaultComponentState) {\n defaultComponentState = {\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n mounted: false,\n mediaState: getInitialMediaState(),\n }\n defaultComponentStateMounted = {\n ...defaultComponentState,\n mounted: true,\n }\n }\n\n if (tamaguiConfig.animations) {\n AnimatedText = tamaguiConfig.animations.Text\n AnimatedView = tamaguiConfig.animations.View\n }\n\n if (!initialTheme) {\n const next = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]\n initialTheme = proxyThemeVariables(next)\n if (!initialTheme && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.log(`Warning: Missing theme`)\n }\n }\n }\n\n // per-component setup\n // do this to make sure shorthands don't duplicate with.. longhands\n mergeShorthands(staticConfig, tamaguiConfig)\n\n let defaultPropsIn = staticConfig.defaultProps || {}\n\n // because we run createTamagui after styled() defs, have to do some work here\n // gather defaults props one time and merge downwards\n // find last unprocessed and process\n const parentNames = [...(staticConfig.parentNames || []), staticConfig.componentName]\n\n if (tamaguiConfig.defaultProps && parentNames && staticConfig.componentName) {\n defaultPropsIn = mergeConfigDefaultProps(\n staticConfig.componentName,\n defaultPropsIn,\n tamaguiConfig.defaultProps,\n parentNames,\n tamaguiConfig\n )\n }\n\n const debug = defaultPropsIn['debug']\n\n // remove all classNames\n const [ourProps, ourClassNames] = mergeProps(defaultPropsIn, {}, true)\n\n initialSplitStyles = insertSplitStyles(\n ourProps,\n staticConfig,\n initialTheme,\n {\n mounted: true,\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n resolveVariablesAs: 'both',\n noClassNames: !staticConfig.acceptsClassName,\n keepVariantsAsProps: true,\n },\n undefined,\n undefined,\n debug\n )\n\n // must preserve prop order\n // leave out className because we handle that already with initialSplitStyles.classNames\n // otherwise it confuses variant functions getting className props\n const [defaults, defaultsClassnames] = mergeProps(\n component.defaultProps as any,\n initialSplitStyles.viewProps,\n true\n // conf.inverseShorthands\n )\n\n // avoid passing className props to variants\n initialSplitStyles.classNames = {\n ...defaultsClassnames,\n ...initialSplitStyles.classNames,\n ...ourClassNames,\n }\n\n defaultNativeStyle = {}\n\n const validStyles = staticConfig.validStyles || stylePropsView\n\n // split - keep variables on props to be processed using theme values at runtime (native)\n if (!isWeb) {\n for (const key in staticConfig.defaultProps) {\n const val = staticConfig.defaultProps[key]\n if (validPseudoKeys[key]) continue\n if ((typeof val === 'string' && val[0] === '$') || !validStyles[key]) {\n defaults[key] = val\n } else {\n defaultNativeStyle[key] = val\n }\n }\n }\n\n if (Object.keys(defaults).length) {\n tamaguiDefaultProps = defaults\n }\n\n // add debug logs\n if (process.env.NODE_ENV === 'development' && debug) {\n if (process.env.IS_STATIC !== 'is_static') {\n // eslint-disable-next-line no-console\n console.log(`\uD83D\uDC1B [${staticConfig.componentName || 'Component'}]`, {\n staticConfig,\n initialSplitStyles,\n tamaguiDefaultProps,\n defaultNativeStyle,\n defaults,\n defaultPropsIn,\n defaultPropsKeyOrder: Object.keys(staticConfig.defaultProps),\n defaultPropsInKeyOrder: Object.keys(defaultPropsIn).map((k) => [k, defaultPropsIn[k]]),\n ourProps,\n ourClassNames,\n defaultsClassnames,\n })\n }\n }\n })\n\n let res: TamaguiComponent<ComponentPropTypes, Ref, BaseProps> = component as any\n\n if (configIn.memo) {\n res = memo(res) as any\n }\n\n res.staticConfig = {\n validStyles: staticConfig.validStyles || stylePropsView,\n ...staticConfig,\n }\n\n // res.extractable HoC\n res.extractable = (Component: any, conf?: Partial<StaticConfig>) => {\n Component.staticConfig = extendStaticConfig(\n {\n Component,\n ...conf,\n neverFlatten: true,\n isHOC: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n },\n res\n )\n return Component\n }\n\n return res\n}\n\n// for elements to avoid spacing\nexport const Unspaced = (props: { children?: any }) => {\n return props.children\n}\nUnspaced['isUnspaced'] = true\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<SpacerProps>({\n memo: true,\n componentName: 'Spacer',\n validStyles,\n\n defaultProps: {\n ...stackDefaultStyles,\n // avoid nesting issues\n tag: 'span',\n size: true,\n },\n\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n const sizePx = tokens.space[size] ?? size\n return {\n width: sizePx,\n height: sizePx,\n minWidth: sizePx,\n minHeight: sizePx,\n }\n },\n },\n\n flex: {\n true: {\n flexGrow: 1,\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n minHeight: 0,\n },\n vertical: {\n width: 0,\n minWidth: 0,\n },\n both: {},\n },\n } as const,\n})\n\nexport type SpacedChildrenProps = {\n isZStack?: boolean\n children?: React.ReactNode\n space?: SpaceTokens | number | null\n spaceFlex?: boolean | number\n direction?: SpaceDirection\n separator?: React.ReactNode\n}\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n direction,\n spaceFlex,\n separator,\n}: SpacedChildrenProps) {\n const hasSpace = !!(space || spaceFlex)\n const hasSeparator = !(separator === undefined || separator === null)\n if (!hasSpace && !hasSeparator && !isZStack) {\n return children\n }\n const childrenList = Children.toArray(children)\n if (childrenList.length <= 1 && !isZStack) {\n return childrenList\n }\n const final: React.ReactNode[] = []\n for (const [index, child] of childrenList.entries()) {\n const isEmpty =\n child === null || child === undefined || (Array.isArray(child) && child.length === 0)\n\n // push them all, but wrap some in Fragment\n if (isEmpty || !child || (child['key'] && !isZStack)) {\n final.push(child)\n } else {\n final.push(\n <Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n }\n\n // first child unspaced avoid insert space\n if (isUnspaced(child) && index === 0) {\n continue\n }\n\n // no spacing on ZStack\n if (isZStack) {\n continue\n }\n\n const next = childrenList[index + 1]\n\n if (next && !isUnspaced(next)) {\n if (separator) {\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_00tmgui`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n final.push(\n React.isValidElement(separator)\n ? React.cloneElement(separator, { key: `sep_${index}` })\n : separator\n )\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}01tmgui`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n } else {\n final.push(\n createSpacer({\n key: `_${index}02tmgui`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n }\n }\n\n return final\n}\n\ntype CreateSpacerProps = SpacedChildrenProps & { key: string }\n\nfunction createSpacer({ key, direction, space, spaceFlex }: CreateSpacerProps) {\n return (\n // @ts-ignore this one blew up but the types seem better\n <Spacer\n key={key}\n size={space}\n direction={direction}\n {...(typeof spaceFlex !== 'undefined' && {\n flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex,\n })}\n />\n )\n}\n\nfunction isUnspaced(child: React.ReactNode) {\n // console.log('unspaced?', child, getMedia())\n return child?.['type']?.['isVisuallyHidden'] || child?.['type']?.['isUnspaced']\n}\n\nfunction addPseudoToStyles(\n styles: any[],\n initialPseudos: SplitStyleResult['pseudos'],\n pseudos: any,\n name: string,\n force = false\n) {\n // on web use pseudo object { hoverStyle } to keep specificity with concatClassName\n const pseudoStyle = pseudos[name]\n const shouldNestObject = isWeb && name !== 'enterStyle' && name !== 'exitStyle'\n const defaultPseudoStyle = initialPseudos[name]\n const style = defaultPseudoStyle ? { ...defaultPseudoStyle, ...pseudoStyle } : pseudoStyle\n if (style) {\n styles.push(shouldNestObject && !force ? { [name]: style } : style)\n }\n}\n\nconst DefaultProps = new Map()\n\nfunction mergeConfigDefaultProps(\n name: string,\n props: Record<string, any>,\n configDefaults: Record<string, Object>,\n parentNames: (string | undefined)[],\n conf: TamaguiInternalConfig\n) {\n const len = parentNames.length\n let prev\n\n for (let i = 0; i < len; i++) {\n const n = parentNames[i]\n if (!n) continue\n if (DefaultProps.has(n)) {\n prev = DefaultProps.get(n)\n continue\n }\n const props = configDefaults[n]\n if (!props) {\n if (prev) {\n DefaultProps.set(n, prev)\n }\n continue\n }\n prev = mergeProps(prev || {}, props, false, conf.inverseShorthands)[0]\n DefaultProps.set(n, prev)\n }\n\n // overwrite the user defined defaults on top of internal defined defaults\n const ourDefaultsMerged = DefaultProps.get(name)\n if (ourDefaultsMerged) {\n return mergeProps(props, ourDefaultsMerged, false, conf.inverseShorthands)[0]\n }\n return props\n}\n\nconst defaults = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n opacity: 1,\n translateX: 0,\n translateY: 0,\n skew: 0,\n skewX: 0,\n skewY: 0,\n scale: 1,\n rotate: '0deg',\n rotateY: '0deg',\n rotateX: '0deg',\n}\n\nfunction ensureBaseHasDefaults(base: ViewStyle, ...pseudos: (ViewStyle | null | undefined)[]) {\n for (const pseudo of pseudos) {\n if (!pseudo) continue\n for (const key in pseudo) {\n const val = pseudo[key]\n // can we just use merge() here?\n if (key === 'transform') {\n if (typeof val === 'string') {\n continue\n }\n for (const t of val) {\n const tkey = Object.keys(t)[0]\n const defaultVal = defaults[tkey]\n const tDefaultVal = { [tkey]: defaultVal } as any\n if (!base.transform) {\n base.transform = [tDefaultVal]\n } else {\n if (!base.transform.find((x) => x[tkey])) {\n base.transform.push(tDefaultVal)\n }\n }\n }\n } else {\n if (!(key in base)) {\n base[key] = defaults[key]\n }\n }\n }\n }\n}\n\nfunction merge(base: ViewStyle, next: ViewStyle) {\n if (!next.transform || !base.transform) {\n Object.assign(base, next)\n return\n }\n const { transform, ...rest } = next\n Object.assign(base, rest)\n for (const t of transform) {\n const key = Object.keys(t)[0]\n const existing = base.transform.find((x) => key in x)\n if (existing) {\n existing[key] = t[key]\n } else {\n base.transform.push(t)\n }\n }\n}\n\n// react native compat (web only)\nfunction usePlatformMethods(hostRef: RefObject<Element>) {\n useIsomorphicLayoutEffect(() => {\n const node = hostRef.current\n if (!node) return\n // @ts-ignore\n node.measure = (callback) => measureLayout(node, null, callback)\n // @ts-ignore\n node.measureLayout = (relativeToNode, success) => measureLayout(node, relativeToNode, success)\n // @ts-ignore\n node.measureInWindow = (callback) => {\n if (!node) return\n setTimeout(() => {\n const { height, left, top, width } = getRect(node as HTMLElement)!\n callback(left, top, width, height)\n }, 0)\n }\n }, [hostRef])\n}\n\nconst AbsoluteFill: any = createComponent({\n componentName: 'AbsoluteFill',\n defaultProps: {\n ...stackDefaultStyles,\n flexDirection: 'column',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n pointerEvents: 'box-none',\n },\n})\n\nconst styleDisplayContents = {\n display: 'contents',\n}\n\nconst dontComposePressabilityKeys = {\n onClick: true,\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAq3BU;AAr3BV,0BAAgC;AAChC,uBAAkE;AAElE,qBAKO;AACP,+CAAmC;AAEnC,8BAA+B;AAC/B,mBAUO;AAEP,oBAAiC;AACjC,IAAAA,oBAAmC;AACnC,iCAAoC;AACpC,iCAAoC;AAEpC,gCAAsD;AACtD,4BAKO;AACP,6BAAgC;AAChC,wBAA2B;AAC3B,iCAAoC;AACpC,gCAAmC;AACnC,8BAAyD;AACzD,sBAA4D;AAC5D,4BAA6C;AAC7C,sBAA0C;AAgB1C,0BAAgC;AAChC,kBAAiC;AAEjC,mBAAwC;AAExC,aAAAC,QAAM;AAKN,IAAI,wBAAsD;AAC1D,IAAI,+BAA6D;AACjE,IAAI;AACJ,IAAI;AACJ,IAA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,iBAAW,MAAM;AACf,cAAM,EAAE,QAAQ,MAAM,KAAK,MAAM,QAAI,iCAAQ,IAAmB;AAChE,iBAAS,MAAM,KAAK,OAAO,MAAM;AAAA,MACnC,GAAG,CAAC;AAAA,IACN;AAAA,EACF,GAAG,CAAC,OAAO,CAAC;AACd;AAEA,MAAM,eAAoB,gBAAgB;AAAA,EACxC,eAAe;AAAA,EACf,cAAc;AAAA,IACZ,GAAG;AAAA,IACH,eAAe;AAAA,IACf,UAAU;AAAA,IACV,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,eAAe;AAAA,EACjB;AACF,CAAC;AAED,MAAM,uBAAuB;AAAA,EAC3B,SAAS;AACX;AAEA,MAAM,8BAA8B;AAAA,EAClC,SAAS;AACX;",
|
|
4
|
+
"sourcesContent": ["import { useComposedRefs } from '@tamagui/compose-refs'\nimport { isClient, isRSC, isWeb, useIsomorphicLayoutEffect } from '@tamagui/constants'\n/* eslint-disable react-hooks/rules-of-hooks */\nimport {\n composeEventHandlers,\n stylePropsView,\n validPseudoKeys,\n validStyles,\n} from '@tamagui/helpers'\nimport { useResponderEvents } from '@tamagui/react-native-use-responder-events'\nimport type { ViewStyle } from '@tamagui/types-react-native'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n RefObject,\n createElement,\n forwardRef,\n memo,\n useCallback,\n useContext,\n useEffect,\n} from 'react'\n\nimport { onConfiguredOnce } from './config'\nimport { stackDefaultStyles } from './constants/constants'\nimport { FontLanguageContext } from './contexts/FontLanguageContext'\nimport { TextAncestorContext } from './contexts/TextAncestorContext'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport {\n SplitStyleResult,\n getSubStyle,\n insertSplitStyles,\n useSplitStyles,\n} from './helpers/getSplitStyles'\nimport { getAllSelectors } from './helpers/insertStyleRule'\nimport { mergeProps } from './helpers/mergeProps'\nimport { proxyThemeVariables } from './helpers/proxyThemeVariables'\nimport { useShallowSetState } from './helpers/useShallowSetState'\nimport { getRect, measureLayout, useElementLayout } from './hooks/useElementLayout'\nimport { addMediaQueryListener, getInitialMediaState } from './hooks/useMedia'\nimport { useServerRef, useServerState } from './hooks/useServerHooks'\nimport { getThemeManager, useTheme } from './hooks/useTheme'\nimport {\n SpaceDirection,\n SpaceTokens,\n SpacerProps,\n StaticConfig,\n StaticConfigParsed,\n StylableComponent,\n TamaguiComponent,\n TamaguiComponentState,\n TamaguiConfig,\n TamaguiElement,\n TamaguiInternalConfig,\n UseAnimationHook,\n UseAnimationProps,\n} from './types'\nimport { usePressability } from './vendor/Pressability'\nimport { Slot, mergeEvent } from './views/Slot'\nimport { wrapThemeManagerContext } from './views/Theme'\n\nReact['keep']\n\n/**\n * All things that need one-time setup after createTamagui is called\n */\nlet defaultComponentState: TamaguiComponentState | null = null\nlet defaultComponentStateMounted: TamaguiComponentState | null = null\nlet tamaguiConfig: TamaguiInternalConfig\nlet AnimatedText: any\nlet AnimatedView: any\nlet initialTheme: any\n\nexport const mouseUps = new Set<Function>()\nif (typeof document !== 'undefined') {\n const cancelTouches = () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n }\n document.addEventListener('mouseup', cancelTouches)\n document.addEventListener('touchend', cancelTouches)\n document.addEventListener('touchcancel', cancelTouches)\n}\n\n// mutates\nfunction mergeShorthands({ defaultProps }: StaticConfigParsed, { shorthands }: TamaguiConfig) {\n // they are defined in correct order already { ...parent, ...child }\n for (const key of Object.keys(defaultProps)) {\n defaultProps[shorthands[key] || key] = defaultProps[key]\n }\n}\n\n/**\n * Only on native do we need the actual underlying View/Text\n * On the web we avoid react-native altogether in core.\n */\nlet BaseText: any\nlet BaseView: any\nif (process.env.TAMAGUI_TARGET === 'native') {\n const native = require('react-native')\n BaseText = native.Text || native.default.Text\n BaseView = native.View || native.default.View\n}\n\nexport function createComponent<\n ComponentPropTypes extends Object = {},\n Ref = TamaguiElement,\n BaseProps = never\n>(configIn: Partial<StaticConfig> | StaticConfigParsed, ParentComponent?: StylableComponent) {\n const staticConfig = (() => {\n const next = extendStaticConfig(configIn, ParentComponent)\n if ('parsed' in next) {\n return next\n } else {\n return parseStaticConfig(next)\n }\n })()\n\n const defaultComponentClassName = `is_${staticConfig.componentName}`\n const avoidClassesWhileAnimating = true\n let defaultNativeStyle: any\n let tamaguiDefaultProps: any\n let defaultTag: string | undefined\n let initialSplitStyles: SplitStyleResult\n\n // see onConfiguredOnce below which attaches a name then to this component\n const component = forwardRef<Ref, ComponentPropTypes>((propsIn: any, forwardedRef) => {\n // React inserts default props after your props for some reason...\n // order important so we do loops, you can't just spread because JS does weird things\n let props: any\n if (tamaguiDefaultProps && !propsIn.asChild) {\n props = mergeProps(tamaguiDefaultProps, propsIn)[0]\n } else {\n props = propsIn\n }\n\n const debugProp = props['debug']\n const { Component, isText, isZStack } = staticConfig\n const componentName = props.componentName || staticConfig.componentName\n const componentClassName = props.asChild\n ? ''\n : props.componentName\n ? `is_${props.componentName}`\n : defaultComponentClassName\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, componentName, props, forceUpdate)\n\n /**\n * Component state for tracking animations, pseudos\n */\n const hasEnterStyle = !!props.enterStyle\n const needsMount = Boolean((isWeb ? isClient : true) && (hasEnterStyle || props.animation))\n const states = useServerState<TamaguiComponentState>(\n needsMount ? defaultComponentState! : defaultComponentStateMounted!\n )\n\n const state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: true } : states[0]\n const setState = states[1]\n const setStateShallow = useShallowSetState(setState)\n\n const shouldSetMounted = needsMount && !state.mounted\n const setMounted = shouldSetMounted\n ? () => {\n // for some reason without some small delay it doesn't animate css\n setTimeout(\n () => {\n setStateShallow({\n mounted: true,\n })\n },\n isWeb ? 10 : 0\n )\n }\n : undefined\n\n const shouldAvoidClasses =\n !!(props.animation && avoidClassesWhileAnimating) || !staticConfig.acceptsClassName\n\n const shouldForcePseudo = !!propsIn.forceStyle\n const hasTextAncestor = !!(isWeb && isText ? useContext(TextAncestorContext) : false)\n const splitStyleState =\n !shouldAvoidClasses && !shouldForcePseudo\n ? {\n ...state,\n hasTextAncestor,\n dynamicStylesInline: true,\n }\n : ({\n ...state,\n noClassNames: true,\n dynamicStylesInline: true,\n hasTextAncestor,\n resolveVariablesAs: 'value',\n } as const)\n\n const languageContext = isRSC ? null : useContext(FontLanguageContext)\n\n const useAnimations = tamaguiConfig.animations?.useAnimations as UseAnimationHook | undefined\n const nextIsAnimated = !!(useAnimations && props.animation)\n // conditional but if ever true stays true\n const isAnimated = nextIsAnimated || state.hasAnimation\n if (nextIsAnimated && !state.hasAnimation) {\n setStateShallow({ hasAnimation: true })\n }\n\n const isTaggable = !Component || typeof Component === 'string'\n // default to tag, fallback to component (when both strings)\n const element = isWeb\n ? isTaggable\n ? props.tag || defaultTag || Component\n : Component\n : Component\n\n const BaseTextComponent = BaseText || element || 'span'\n const BaseViewComponent = BaseView || element || (hasTextAncestor ? 'span' : 'div')\n let elementType = isText\n ? (isAnimated ? AnimatedText : null) || BaseTextComponent\n : (isAnimated ? AnimatedView : null) || BaseViewComponent\n\n elementType = Component || elementType\n const isStringElement = typeof elementType === 'string'\n\n const splitStyles = useSplitStyles(\n props,\n staticConfig,\n theme,\n splitStyleState,\n props.asChild ? null : initialSplitStyles,\n languageContext || undefined,\n elementType,\n debugProp\n )\n\n const hostRef = useServerRef<TamaguiElement>(null)\n\n // animation setup\n const isReactNative = Boolean(\n staticConfig.isReactNative || (isAnimated && tamaguiConfig.animations.isReactNative)\n )\n const isAnimatedReactNativeWeb = isAnimated && avoidClassesWhileAnimating\n\n if (process.env.NODE_ENV === 'development') {\n if (!process.env.TAMAGUI_TARGET) {\n // eslint-disable-next-line no-console\n console.error(`No process.env.TAMAGUI_TARGET set, please set it to \"native\" or \"web\".`)\n }\n\n if (debugProp) {\n const name = `${\n componentName || Component?.displayName || Component?.name || '[Unnamed Component]'\n }`\n const type = isReactNative ? 'rnw' : 'tamagui'\n const banner = `${name} ${propsIn['data-is'] || ''} ${type}`\n // eslint-disable-next-line no-console\n console.group(`%c \uD83D\uDC1B ${banner}`, 'background: yellow;')\n // eslint-disable-next-line no-console\n console.groupCollapsed('initial props/state')\n // eslint-disable-next-line no-console\n console.log('props', propsIn)\n // eslint-disable-next-line no-console\n console.log('splitStyles', splitStyles)\n // eslint-disable-next-line no-console\n console.log('className', Object.values(splitStyles.classNames))\n if (typeof window !== 'undefined') {\n // eslint-disable-next-line no-console\n console.log('ref', hostRef, '(click to view)')\n }\n // eslint-disable-next-line no-console\n console.groupEnd()\n if (debugProp === 'break') {\n // eslint-disable-next-line no-debugger\n debugger\n }\n }\n }\n\n const {\n viewProps: viewPropsIn,\n pseudos,\n medias,\n style: splitStylesStyle,\n classNames,\n mediaKeys,\n } = splitStyles\n\n const animationFeatureStylesIn = props.animation\n ? { ...defaultNativeStyle, ...splitStylesStyle }\n : null\n const propsWithAnimation = props as UseAnimationProps\n\n // once you set animation prop don't remove it, you can set to undefined/false\n // reason is animations are heavy - no way around it, and must be run inline here (\uD83D\uDE45 loading as a sub-component)\n let animationStyles: any\n if (!isRSC && isAnimated && useAnimations) {\n const animations = useAnimations(propsWithAnimation, {\n state,\n pseudos,\n onDidAnimate: props.onDidAnimate,\n hostRef,\n staticConfig,\n getStyle({ isExiting, isEntering, exitVariant, enterVariant } = {}) {\n // we have to merge such that transforms keys all exist\n const style = animationFeatureStylesIn\n\n const enterStyle = isEntering\n ? enterVariant && staticConfig.variants?.[enterVariant]['true']\n ? getSubStyle(\n '',\n staticConfig.variants?.[enterVariant]['true'],\n staticConfig,\n theme,\n props,\n state,\n tamaguiConfig\n ) || pseudos.enterStyle\n : pseudos.enterStyle\n : null\n\n const exitStyle = isExiting\n ? exitVariant && staticConfig.variants?.[exitVariant]['true']\n ? getSubStyle(\n '',\n staticConfig.variants?.[exitVariant]['true'],\n staticConfig,\n theme,\n props,\n state,\n tamaguiConfig\n ) || pseudos.exitStyle\n : pseudos.exitStyle\n : null\n\n // if you have hoverStyle={{ scale: 1.1 }} and don't have scale set on the base style\n // no animation will run! this is really confusing. this will look at all variants,\n // and fill in base styles if they don't exist. eg:\n // input:\n // base: {}\n // hoverStyle: { scale: 2 }\n // enterStyle: { x: 100 }\n // output:\n // base: { x: 0, scale: 1 }\n ensureBaseHasDefaults(\n style,\n // enterStyle,\n pseudos.hoverStyle,\n pseudos.focusStyle,\n pseudos.pressStyle\n )\n\n enterStyle && isEntering && merge(style, enterStyle)\n state.hover && pseudos.hoverStyle && merge(style, pseudos.hoverStyle)\n state.focus && pseudos.focusStyle && merge(style, pseudos.focusStyle)\n state.press && pseudos.pressStyle && merge(style, pseudos.pressStyle)\n exitStyle && isExiting && merge(style, exitStyle)\n\n if (process.env.NODE_ENV === 'development') {\n if (debugProp === 'verbose') {\n // eslint-disable-next-line no-console\n console.log('animation style', style)\n }\n }\n\n return style\n },\n //, delay\n })\n\n if (animations) {\n animationStyles = animations.style\n }\n }\n\n // media queries\n useIsomorphicLayoutEffect(() => {\n if (!mediaKeys.length) return\n const disposers: any[] = []\n for (const key of mediaKeys) {\n disposers.push(\n addMediaQueryListener(key, (next: boolean) => {\n setState((prev) => {\n if (prev.mediaState![key] !== next) {\n return {\n ...prev,\n mediaState: {\n ...prev.mediaState,\n [key]: next,\n },\n }\n }\n return prev\n })\n })\n )\n }\n return () => {\n for (const disposer of disposers) {\n disposer()\n }\n }\n }, [mediaKeys.join(',')])\n\n const {\n hitSlop,\n asChild,\n children,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n themeShallow,\n space: spaceProp,\n spaceDirection: _spaceDirection,\n disabled: disabledProp,\n onMouseUp,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\n separator,\n // ignore from here on out\n forceStyle: _forceStyle,\n // @ts-ignore for next/link compat etc\n onClick,\n theme: _themeProp,\n // @ts-ignore\n defaultVariants,\n\n ...nonTamaguiProps\n } = viewPropsIn\n\n const disabled =\n (props.accessibilityState != null && props.accessibilityState.disabled === true) ||\n props.accessibilityDisabled\n\n // these can ultimately be for DOM, react-native-web views, or animated views\n // so the type is pretty loose\n let viewProps: Record<string, any>\n\n // if react-native-web view just pass all props down\n if (process.env.TAMAGUI_TARGET === 'web' && !isReactNative) {\n // otherwise replicate react-native-web functionality\n const {\n // event props\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n\n // android\n collapsable,\n focusable,\n\n // deprecated,\n accessible,\n accessibilityDisabled,\n\n onLayout,\n\n ...webProps\n } = nonTamaguiProps\n\n viewProps = webProps\n\n if (!isRSC) {\n usePlatformMethods(hostRef as RefObject<Element>)\n\n useElementLayout(hostRef as RefObject<Element>, onLayout as any)\n\n useResponderEvents(hostRef, {\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n } as any)\n }\n\n if (props.href != undefined && hrefAttrs != undefined) {\n const { download, rel, target } = hrefAttrs\n if (download != null) {\n viewProps.download = download\n }\n if (rel != null) {\n viewProps.rel = rel\n }\n if (typeof target === 'string') {\n viewProps.target = target.charAt(0) !== '_' ? '_' + target : target\n }\n }\n\n // FOCUS\n // \"focusable\" indicates that an element may be a keyboard tab-stop.\n const _focusable = focusable != undefined ? focusable : accessible\n const role = viewProps.role\n if (_focusable === false) {\n viewProps.tabIndex = '-1'\n }\n if (\n // These native elements are focusable by default\n elementType === 'a' ||\n elementType === 'button' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n if (_focusable === false || accessibilityDisabled === true) {\n viewProps.tabIndex = '-1'\n }\n } else if (\n // These roles are made focusable by default\n role === 'button' ||\n role === 'checkbox' ||\n role === 'link' ||\n role === 'radio' ||\n role === 'textbox' ||\n role === 'switch'\n ) {\n if (_focusable !== false) {\n viewProps.tabIndex = '0'\n }\n }\n // Everything else must explicitly set the prop\n if (_focusable === true) {\n viewProps.tabIndex = '0'\n }\n } else {\n viewProps = nonTamaguiProps\n }\n\n viewProps.ref = useComposedRefs(hostRef as any, forwardedRef, setMounted)\n\n if (process.env.NODE_ENV === 'development' && !isText && isWeb && !staticConfig.isHOC) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n // eslint-disable-next-line no-console\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n const unPress = useCallback(() => {\n setStateShallow({\n press: false,\n pressIn: false,\n })\n }, [setStateShallow])\n\n if (!isRSC) {\n useEffect(() => {\n return () => {\n mouseUps.delete(unPress)\n }\n }, [unPress])\n }\n\n let styles: any[]\n\n if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {\n styles = {\n ...defaultNativeStyle,\n ...(animationStyles ?? splitStylesStyle),\n ...medias,\n }\n } else {\n styles = [isWeb ? null : defaultNativeStyle, animationStyles ?? splitStylesStyle, medias]\n if (!animationStyles && initialSplitStyles) {\n const initPseudos = initialSplitStyles.pseudos\n !state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, 'enterStyle')\n state.hover &&\n addPseudoToStyles(styles, initPseudos, pseudos, 'hoverStyle', shouldForcePseudo)\n state.focus &&\n addPseudoToStyles(styles, initPseudos, pseudos, 'focusStyle', shouldForcePseudo)\n state.press &&\n addPseudoToStyles(styles, initPseudos, pseudos, 'pressStyle', shouldForcePseudo)\n }\n // ugly but for now...\n if (shouldForcePseudo) {\n const next = {}\n for (const style of styles) {\n if (style) {\n Object.assign(next, style)\n }\n }\n // @ts-ignore\n Object.assign(splitStyles.style, next)\n }\n }\n\n let fontFamily = isText ? splitStyles.fontFamily || staticConfig.defaultProps.fontFamily : null\n if (fontFamily && fontFamily[0] === '$') {\n fontFamily = fontFamily.slice(1)\n }\n const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : ''\n\n if (process.env.TAMAGUI_TARGET === 'web') {\n const classList = [\n componentName ? componentClassName : '',\n fontFamilyClassName,\n theme.className,\n classNames ? Object.values(classNames).join(' ') : '',\n ]\n\n const className = classList.join(' ')\n const style = animationStyles ?? splitStyles.style\n\n if (isAnimatedReactNativeWeb) {\n viewProps.style = style\n } else if (isReactNative) {\n const rnwStyle = { $$css: true }\n for (const name of className.split(' ')) {\n rnwStyle[name] = name\n }\n viewProps.style = [rnwStyle, ...(Array.isArray(style) ? style : [style])]\n if (process.env.NODE_ENV === 'development') {\n // turn debug data- props into dataSet in dev mode\n Object.keys(viewProps).forEach((key) => {\n if (key.startsWith('data-')) {\n viewProps.dataSet ??= {}\n viewProps.dataSet[key.replace('data-', '')] = viewProps[key]\n delete viewProps[key]\n }\n })\n }\n } else {\n viewProps.className = className\n viewProps.style = style\n }\n }\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n // swap out the right family based on weight/style\n if (splitStyles.fontFamily) {\n const faceInfo = tamaguiConfig.fontsParsed[splitStyles.fontFamily]?.face\n if (faceInfo) {\n const [weight, style] = (() => {\n let weight: string | undefined\n let style: string | undefined\n for (let i = styles.length; i >= 0; i--) {\n weight ??= styles[i]?.fontWeight\n style ??= styles[i]?.fontStyle\n }\n return [weight || '400', style || 'normal'] as const\n })()\n const overrideFace = faceInfo[weight]?.[style]?.val\n if (overrideFace) {\n for (const style of styles) {\n if (style?.fontFamily) {\n style.fontFamily = overrideFace\n }\n }\n }\n }\n }\n\n // assign styles\n viewProps.style = styles\n }\n\n // TODO need to loop active variants and see if they have matchin pseudos and apply as well\n const initialPseudos = initialSplitStyles?.pseudos\n const attachPress = !!(\n pseudos?.pressStyle ||\n initialPseudos?.pressStyle ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n\n const isHoverable = isWeb\n const attachHover =\n isHoverable &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n const handlesPressEvents = !isWeb && !asChild\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n const shouldAttach =\n !asChild &&\n (attachPress ||\n attachHover ||\n 'pressStyle' in props ||\n 'onPress' in props ||\n 'onPressIn' in props ||\n 'onPressOut' in props ||\n (isWeb &&\n ('hoverStyle' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props)))\n\n const events =\n shouldAttach && !isRSC\n ? {\n onPressOut: attachPress\n ? (e) => {\n unPress()\n onPressOut?.(e)\n onMouseUp?.(e)\n }\n : undefined,\n ...(isHoverable && {\n onMouseEnter: attachHover\n ? (e) => {\n const next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (attachHover || state.pressIn) {\n setStateShallow(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave: attachHover\n ? (e) => {\n const next: Partial<typeof state> = {}\n mouseUps.add(unPress)\n if (attachHover) {\n next.hover = false\n }\n if (state.pressIn) {\n next.press = false\n next.pressIn = false\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n onPressIn: attachPress\n ? (e) => {\n setStateShallow({\n press: true,\n pressIn: true,\n hover: false,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n if (isWeb) {\n mouseUps.add(unPress)\n }\n }\n : undefined,\n onPress: attachPress\n ? (e) => {\n unPress()\n // @ts-ignore\n onClick?.(e)\n onPress?.(e)\n }\n : undefined,\n\n // replicating TouchableWithoutFeedback\n ...(!isWeb && {\n cancelable: !props.rejectResponderTermination,\n disabled:\n props.disabled !== null ? props.disabled : props.accessibilityState?.disabled,\n hitSlop: props.hitSlop,\n delayLongPress: props.delayLongPress,\n delayPressIn: props.delayPressIn,\n delayPressOut: props.delayPressOut,\n focusable: viewProps.focusable ?? true,\n minPressDuration: 0,\n }),\n }\n : null\n\n let space = spaceProp\n\n // find space by media query\n if (state.mediaState && mediaKeys.length) {\n for (const key in state.mediaState) {\n if (!state.mediaState[key]) continue\n if (props[key] && props[key].space !== undefined) {\n space = props[key].space\n }\n }\n }\n\n const themeManager = getThemeManager(theme)\n\n const shouldSetChildrenThemeToParent = Boolean(\n themeShallow && themeManager && themeManager.didChangeTheme\n )\n\n const shouldProvideThemeManager =\n shouldSetChildrenThemeToParent || (themeManager && themeManager.didChangeTheme)\n\n const childEls =\n !children || asChild\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n separator,\n children,\n space,\n direction: props.spaceDirection || 'both',\n isZStack,\n }),\n // only set context if changed theme\n shouldProvideThemeManager ? themeManager : undefined,\n shouldSetChildrenThemeToParent\n )\n\n let content: any\n\n if (asChild) {\n elementType = Slot\n viewProps = {\n ...viewProps,\n onPress,\n onPressIn,\n onPressOut,\n }\n }\n\n // EVENTS native\n if (process.env.TAMAGUI_TARGET === 'native') {\n // add focus events\n const attachFocus = !!(\n (pseudos && pseudos.focusStyle) ||\n (initialPseudos && initialPseudos.focusStyle)\n )\n if (attachFocus) {\n viewProps.onFocus = mergeEvent(viewProps.onFocus, () => {\n setStateShallow({ focus: true })\n })\n viewProps.onBlur = mergeEvent(viewProps.onBlur, () => {\n setStateShallow({ focus: false })\n })\n }\n\n // use Pressability to get smooth unPress when you press + hold + move out\n // only ever create once, use .configure() to update later\n const pressability = usePressability(events)\n if (attachPress && events) {\n if (hitSlop) {\n viewProps.hitSlop = hitSlop\n }\n for (const key in pressability) {\n const og = props[key]\n const val = pressability[key]\n viewProps[key] =\n og && !dontComposePressabilityKeys[key] ? composeEventHandlers(og, val) : val\n }\n }\n }\n\n content = createElement(elementType, viewProps, childEls)\n\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (events) {\n content = (\n <span\n style={styleDisplayContents}\n onMouseEnter={events.onMouseEnter}\n onMouseLeave={events.onMouseLeave}\n onClick={events.onPress}\n onMouseDown={events.onPressIn}\n onMouseUp={events.onPressOut}\n onTouchStart={events.onPressIn}\n onTouchEnd={events.onPressOut}\n >\n {content}\n </span>\n )\n }\n\n // special weird case since there's a bug in RNW where we can't animate + pass style { $$css }\n // but we need is_font classnames... need to see about RNW bug and then can remove this\n if (isText && isAnimatedReactNativeWeb) {\n content = (\n <span className={fontFamilyClassName} style={styleDisplayContents}>\n {content}\n </span>\n )\n }\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (debugProp) {\n const element = typeof elementType === 'string' ? elementType : 'Component'\n // eslint-disable-next-line no-console\n console.groupCollapsed(`render <${element} /> with props`, viewProps)\n for (const key in viewProps) {\n // eslint-disable-next-line no-console\n console.log(key, viewProps[key])\n }\n // eslint-disable-next-line no-console\n console.log('children', content)\n // eslint-disable-next-line no-console\n console.groupEnd()\n if (typeof window !== 'undefined') {\n // prettier-ignore\n // eslint-disable-next-line no-console\n console.log({ state, shouldProvideThemeManager, tamaguiDefaultProps, viewProps, splitStyles, animationStyles, handlesPressEvents, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), events, shouldAttach, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses: avoidClassesWhileAnimating, animation: props.animation, style: splitStylesStyle, defaultNativeStyle, initialSplitStyles, ...(typeof window !== 'undefined' ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) } : null) })\n }\n // eslint-disable-next-line no-console\n console.groupEnd()\n }\n }\n\n return content\n })\n\n if (staticConfig.componentName) {\n component.displayName = staticConfig.componentName\n }\n\n onConfiguredOnce((conf) => {\n // one time only setup\n if (!tamaguiConfig) {\n tamaguiConfig = conf\n\n if (!defaultComponentState) {\n defaultComponentState = {\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n mounted: false,\n mediaState: getInitialMediaState(),\n }\n defaultComponentStateMounted = {\n ...defaultComponentState,\n mounted: true,\n }\n }\n\n if (tamaguiConfig.animations) {\n AnimatedText = tamaguiConfig.animations.Text\n AnimatedView = tamaguiConfig.animations.View\n }\n\n if (!initialTheme) {\n const next = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]\n initialTheme = proxyThemeVariables(next)\n if (!initialTheme && process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.log(`Warning: Missing theme`)\n }\n }\n }\n\n // per-component setup\n // do this to make sure shorthands don't duplicate with.. longhands\n mergeShorthands(staticConfig, tamaguiConfig)\n\n let defaultPropsIn = staticConfig.defaultProps || {}\n\n // because we run createTamagui after styled() defs, have to do some work here\n // gather defaults props one time and merge downwards\n // find last unprocessed and process\n const parentNames = [...(staticConfig.parentNames || []), staticConfig.componentName]\n\n if (tamaguiConfig.defaultProps && parentNames && staticConfig.componentName) {\n defaultPropsIn = mergeConfigDefaultProps(\n staticConfig.componentName,\n defaultPropsIn,\n tamaguiConfig.defaultProps,\n parentNames,\n tamaguiConfig\n )\n }\n\n const debug = defaultPropsIn['debug']\n\n // remove all classNames\n const [ourProps, ourClassNames] = mergeProps(defaultPropsIn, {}, true)\n\n if (ourProps.tag) {\n defaultTag = ourProps.tag\n }\n\n initialSplitStyles = insertSplitStyles(\n ourProps,\n staticConfig,\n initialTheme,\n {\n mounted: true,\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n resolveVariablesAs: 'both',\n noClassNames: !staticConfig.acceptsClassName,\n keepVariantsAsProps: true,\n },\n undefined,\n undefined,\n debug\n )\n\n // must preserve prop order\n // leave out className because we handle that already with initialSplitStyles.classNames\n // otherwise it confuses variant functions getting className props\n const [defaults, defaultsClassnames] = mergeProps(\n component.defaultProps as any,\n initialSplitStyles.viewProps,\n true\n // conf.inverseShorthands\n )\n\n // avoid passing className props to variants\n initialSplitStyles.classNames = {\n ...defaultsClassnames,\n ...initialSplitStyles.classNames,\n ...ourClassNames,\n }\n\n defaultNativeStyle = {}\n\n const validStyles = staticConfig.validStyles || stylePropsView\n\n // split - keep variables on props to be processed using theme values at runtime (native)\n if (!isWeb) {\n for (const key in staticConfig.defaultProps) {\n const val = staticConfig.defaultProps[key]\n if (validPseudoKeys[key]) continue\n if ((typeof val === 'string' && val[0] === '$') || !validStyles[key]) {\n defaults[key] = val\n } else {\n defaultNativeStyle[key] = val\n }\n }\n }\n\n if (Object.keys(defaults).length) {\n tamaguiDefaultProps = defaults\n }\n\n // add debug logs\n if (process.env.NODE_ENV === 'development' && debug) {\n if (process.env.IS_STATIC !== 'is_static') {\n // eslint-disable-next-line no-console\n console.log(`\uD83D\uDC1B [${staticConfig.componentName || 'Component'}]`, {\n staticConfig,\n initialSplitStyles,\n tamaguiDefaultProps,\n defaultNativeStyle,\n defaults,\n defaultPropsIn,\n defaultPropsKeyOrder: Object.keys(staticConfig.defaultProps),\n defaultPropsInKeyOrder: Object.keys(defaultPropsIn).map((k) => [k, defaultPropsIn[k]]),\n ourProps,\n ourClassNames,\n defaultsClassnames,\n defaultTag,\n })\n }\n }\n })\n\n let res: TamaguiComponent<ComponentPropTypes, Ref, BaseProps> = component as any\n\n if (configIn.memo) {\n res = memo(res) as any\n }\n\n res.staticConfig = {\n validStyles: staticConfig.validStyles || stylePropsView,\n ...staticConfig,\n }\n\n // res.extractable HoC\n res.extractable = (Component: any, conf?: Partial<StaticConfig>) => {\n Component.staticConfig = extendStaticConfig(\n {\n Component,\n ...conf,\n neverFlatten: true,\n isHOC: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n },\n res\n )\n return Component\n }\n\n return res\n}\n\n// for elements to avoid spacing\nexport const Unspaced = (props: { children?: any }) => {\n return props.children\n}\nUnspaced['isUnspaced'] = true\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<SpacerProps>({\n memo: true,\n componentName: 'Spacer',\n validStyles,\n\n defaultProps: {\n ...stackDefaultStyles,\n // avoid nesting issues\n tag: 'span',\n size: true,\n },\n\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n const sizePx = tokens.space[size] ?? size\n return {\n width: sizePx,\n height: sizePx,\n minWidth: sizePx,\n minHeight: sizePx,\n }\n },\n },\n\n flex: {\n true: {\n flexGrow: 1,\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n minHeight: 0,\n },\n vertical: {\n width: 0,\n minWidth: 0,\n },\n both: {},\n },\n } as const,\n})\n\nexport type SpacedChildrenProps = {\n isZStack?: boolean\n children?: React.ReactNode\n space?: SpaceTokens | number | null\n spaceFlex?: boolean | number\n direction?: SpaceDirection\n separator?: React.ReactNode\n}\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n direction,\n spaceFlex,\n separator,\n}: SpacedChildrenProps) {\n const hasSpace = !!(space || spaceFlex)\n const hasSeparator = !(separator === undefined || separator === null)\n if (!hasSpace && !hasSeparator && !isZStack) {\n return children\n }\n const childrenList = Children.toArray(children)\n if (childrenList.length <= 1 && !isZStack) {\n return childrenList\n }\n const final: React.ReactNode[] = []\n for (const [index, child] of childrenList.entries()) {\n const isEmpty =\n child === null || child === undefined || (Array.isArray(child) && child.length === 0)\n\n // push them all, but wrap some in Fragment\n if (isEmpty || !child || (child['key'] && !isZStack)) {\n final.push(child)\n } else {\n final.push(\n <Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n }\n\n // first child unspaced avoid insert space\n if (isUnspaced(child) && index === 0) {\n continue\n }\n\n // no spacing on ZStack\n if (isZStack) {\n continue\n }\n\n const next = childrenList[index + 1]\n\n if (next && !isUnspaced(next)) {\n if (separator) {\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_00tmgui`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n final.push(\n React.isValidElement(separator)\n ? React.cloneElement(separator, { key: `sep_${index}` })\n : separator\n )\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}01tmgui`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n } else {\n final.push(\n createSpacer({\n key: `_${index}02tmgui`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n }\n }\n\n return final\n}\n\ntype CreateSpacerProps = SpacedChildrenProps & { key: string }\n\nfunction createSpacer({ key, direction, space, spaceFlex }: CreateSpacerProps) {\n return (\n // @ts-ignore this one blew up but the types seem better\n <Spacer\n key={key}\n size={space}\n direction={direction}\n {...(typeof spaceFlex !== 'undefined' && {\n flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex,\n })}\n />\n )\n}\n\nfunction isUnspaced(child: React.ReactNode) {\n // console.log('unspaced?', child, getMedia())\n return child?.['type']?.['isVisuallyHidden'] || child?.['type']?.['isUnspaced']\n}\n\nfunction addPseudoToStyles(\n styles: any[],\n initialPseudos: SplitStyleResult['pseudos'],\n pseudos: any,\n name: string,\n force = false\n) {\n // on web use pseudo object { hoverStyle } to keep specificity with concatClassName\n const pseudoStyle = pseudos[name]\n const shouldNestObject = isWeb && name !== 'enterStyle' && name !== 'exitStyle'\n const defaultPseudoStyle = initialPseudos[name]\n const style = defaultPseudoStyle ? { ...defaultPseudoStyle, ...pseudoStyle } : pseudoStyle\n if (style) {\n styles.push(shouldNestObject && !force ? { [name]: style } : style)\n }\n}\n\nconst DefaultProps = new Map()\n\nfunction mergeConfigDefaultProps(\n name: string,\n props: Record<string, any>,\n configDefaults: Record<string, Object>,\n parentNames: (string | undefined)[],\n conf: TamaguiInternalConfig\n) {\n const len = parentNames.length\n let prev\n\n for (let i = 0; i < len; i++) {\n const n = parentNames[i]\n if (!n) continue\n if (DefaultProps.has(n)) {\n prev = DefaultProps.get(n)\n continue\n }\n const props = configDefaults[n]\n if (!props) {\n if (prev) {\n DefaultProps.set(n, prev)\n }\n continue\n }\n prev = mergeProps(prev || {}, props, false, conf.inverseShorthands)[0]\n DefaultProps.set(n, prev)\n }\n\n // overwrite the user defined defaults on top of internal defined defaults\n const ourDefaultsMerged = DefaultProps.get(name)\n if (ourDefaultsMerged) {\n return mergeProps(props, ourDefaultsMerged, false, conf.inverseShorthands)[0]\n }\n return props\n}\n\nconst defaults = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n opacity: 1,\n translateX: 0,\n translateY: 0,\n skew: 0,\n skewX: 0,\n skewY: 0,\n scale: 1,\n rotate: '0deg',\n rotateY: '0deg',\n rotateX: '0deg',\n}\n\nfunction ensureBaseHasDefaults(base: ViewStyle, ...pseudos: (ViewStyle | null | undefined)[]) {\n for (const pseudo of pseudos) {\n if (!pseudo) continue\n for (const key in pseudo) {\n const val = pseudo[key]\n // can we just use merge() here?\n if (key === 'transform') {\n if (typeof val === 'string') {\n continue\n }\n for (const t of val) {\n const tkey = Object.keys(t)[0]\n const defaultVal = defaults[tkey]\n const tDefaultVal = { [tkey]: defaultVal } as any\n if (!base.transform) {\n base.transform = [tDefaultVal]\n } else {\n if (!base.transform.find((x) => x[tkey])) {\n base.transform.push(tDefaultVal)\n }\n }\n }\n } else {\n if (!(key in base)) {\n base[key] = defaults[key]\n }\n }\n }\n }\n}\n\nfunction merge(base: ViewStyle, next: ViewStyle) {\n if (!next.transform || !base.transform) {\n Object.assign(base, next)\n return\n }\n const { transform, ...rest } = next\n Object.assign(base, rest)\n for (const t of transform) {\n const key = Object.keys(t)[0]\n const existing = base.transform.find((x) => key in x)\n if (existing) {\n existing[key] = t[key]\n } else {\n base.transform.push(t)\n }\n }\n}\n\n// react native compat (web only)\nfunction usePlatformMethods(hostRef: RefObject<Element>) {\n useIsomorphicLayoutEffect(() => {\n const node = hostRef.current\n if (!node) return\n // @ts-ignore\n node.measure = (callback) => measureLayout(node, null, callback)\n // @ts-ignore\n node.measureLayout = (relativeToNode, success) => measureLayout(node, relativeToNode, success)\n // @ts-ignore\n node.measureInWindow = (callback) => {\n if (!node) return\n setTimeout(() => {\n const { height, left, top, width } = getRect(node as HTMLElement)!\n callback(left, top, width, height)\n }, 0)\n }\n }, [hostRef])\n}\n\nconst AbsoluteFill: any = createComponent({\n componentName: 'AbsoluteFill',\n defaultProps: {\n ...stackDefaultStyles,\n flexDirection: 'column',\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n pointerEvents: 'box-none',\n },\n})\n\nconst styleDisplayContents = {\n display: 'contents',\n}\n\nconst dontComposePressabilityKeys = {\n onClick: true,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAw3BU;AAx3BV,0BAAgC;AAChC,uBAAkE;AAElE,qBAKO;AACP,+CAAmC;AAEnC,8BAA+B;AAC/B,mBAUO;AAEP,oBAAiC;AACjC,IAAAA,oBAAmC;AACnC,iCAAoC;AACpC,iCAAoC;AACpC,gCAAsD;AACtD,4BAKO;AACP,6BAAgC;AAChC,wBAA2B;AAC3B,iCAAoC;AACpC,gCAAmC;AACnC,8BAAyD;AACzD,sBAA4D;AAC5D,4BAA6C;AAC7C,sBAA0C;AAgB1C,0BAAgC;AAChC,kBAAiC;AACjC,mBAAwC;AAExC,aAAAC,QAAM;AAKN,IAAI,wBAAsD;AAC1D,IAAI,+BAA6D;AACjE,IAAI;AACJ,IAAI;AACJ,IAAI;AACJ,IAAI;AAEG,MAAM,WAAW,oBAAI,IAAc;AAC1C,IAAI,OAAO,aAAa,aAAa;AACnC,QAAM,gBAAgB,MAAM;AAC1B,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB;AACA,WAAS,iBAAiB,WAAW,aAAa;AAClD,WAA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IACN;AAAA,EACF,GAAG,CAAC,OAAO,CAAC;AACd;AAEA,MAAM,eAAoB,gBAAgB;AAAA,EACxC,eAAe;AAAA,EACf,cAAc;AAAA,IACZ,GAAG;AAAA,IACH,eAAe;AAAA,IACf,UAAU;AAAA,IACV,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,eAAe;AAAA,EACjB;AACF,CAAC;AAED,MAAM,uBAAuB;AAAA,EAC3B,SAAS;AACX;AAEA,MAAM,8BAA8B;AAAA,EAClC,SAAS;AACX;",
|
|
6
6
|
"names": ["import_constants", "React", "_a", "_b", "_c", "_d", "weight", "style", "element", "defaults", "validStyles", "props"]
|
|
7
7
|
}
|
package/dist/cjs/styled.js
CHANGED
|
@@ -28,7 +28,10 @@ function styled(Component, options, staticExtractionOptions) {
|
|
|
28
28
|
if (process.env.NODE_ENV === "development") {
|
|
29
29
|
if (parentStaticConfig == null ? void 0 : parentStaticConfig.isHOC) {
|
|
30
30
|
console.warn(
|
|
31
|
-
`Warning: Parent component is a functional component, not a Tamagui styled() component. Extending with styled() will break and lead to incorrect styles
|
|
31
|
+
`Warning: Parent component is a functional component, not a Tamagui styled() component. Extending with styled() will break and lead to incorrect styles.`,
|
|
32
|
+
`Given options:`,
|
|
33
|
+
options,
|
|
34
|
+
new Error().stack
|
|
32
35
|
);
|
|
33
36
|
}
|
|
34
37
|
}
|
|
@@ -43,14 +46,14 @@ function styled(Component, options, staticExtractionOptions) {
|
|
|
43
46
|
if (defaultVariants) {
|
|
44
47
|
Object.assign(defaultProps, defaultVariants);
|
|
45
48
|
}
|
|
46
|
-
const
|
|
47
|
-
(parentStaticConfig == null ? void 0 : parentStaticConfig.
|
|
49
|
+
const isReactNative = Boolean(
|
|
50
|
+
(parentStaticConfig == null ? void 0 : parentStaticConfig.isReactNative) || (staticExtractionOptions == null ? void 0 : staticExtractionOptions.isReactNative)
|
|
48
51
|
);
|
|
49
|
-
const reactNativeWebComponent =
|
|
50
|
-
const isTamagui = !
|
|
52
|
+
const reactNativeWebComponent = isReactNative ? (parentStaticConfig == null ? void 0 : parentStaticConfig.reactNativeWebComponent) || Component : null;
|
|
53
|
+
const isTamagui = !isReactNative && !!parentStaticConfig;
|
|
51
54
|
const Comp = reactNativeWebComponent || Component;
|
|
52
55
|
const isText = Boolean((staticExtractionOptions == null ? void 0 : staticExtractionOptions.isText) || (parentStaticConfig == null ? void 0 : parentStaticConfig.isText));
|
|
53
|
-
const acceptsClassName = acceptsClassNameProp ?? (isTamagui ||
|
|
56
|
+
const acceptsClassName = acceptsClassNameProp ?? (isTamagui || isReactNative);
|
|
54
57
|
const conf = {
|
|
55
58
|
...staticExtractionOptions,
|
|
56
59
|
...!isTamagui && {
|
|
@@ -60,7 +63,7 @@ function styled(Component, options, staticExtractionOptions) {
|
|
|
60
63
|
defaultProps,
|
|
61
64
|
defaultVariants,
|
|
62
65
|
componentName: name,
|
|
63
|
-
|
|
66
|
+
isReactNative,
|
|
64
67
|
reactNativeWebComponent,
|
|
65
68
|
isText,
|
|
66
69
|
acceptsClassName
|
package/dist/cjs/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.tsx"],
|
|
4
|
-
"sourcesContent": ["import { getConfig } from './config'\nimport { createComponent } from './createComponent'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n TamaguiElement,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\n// can't infer from styled(<YStack />) which would be nice\n// * excessively deep type instantiation\n\ntype GetBaseProps<A extends StylableComponent> =\n // A extends TamaguiReactElement\n // ? GetBaseProps<A['type']> :\n A extends TamaguiComponent<any, any, infer P> ? P : GetProps<A>\n\ntype GetVariantProps<A extends StylableComponent> =\n // A extends TamaguiReactElement\n // ? GetVariantProps<A['type']>\n // :\n A extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n acceptsClassName?: boolean\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n // allows passing styled(<H1 bc=\"red\" />)\n // but to get types right would be tricky\n // if (isValidElement(Component) && isTamaguiComponent(Component.type)) {\n // const props = Component.props\n // if (props && typeof props === 'object') {\n // Component = Component.type as any\n // options = options ? ({ ...props, ...options } as any) : props\n // }\n // }\n\n const staticConfigProps = (() => {\n const parentStaticConfig =\n 'staticConfig' in Component ? (Component.staticConfig as StaticConfig) : null\n\n if (process.env.NODE_ENV === 'development') {\n if (parentStaticConfig?.isHOC) {\n // eslint-disable-next-line no-console\n console.warn(\n `Warning: Parent component is a functional component, not a Tamagui styled() component. Extending with styled() will break and lead to incorrect styles
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,6BAAgC;AAmCzB,SAAS,OAId,WAEA,SAOA,yBACA;AAWA,QAAM,qBAAqB,MAAM;AAC/B,UAAM,qBACJ,kBAAkB,YAAa,UAAU,eAAgC;AAE3E,QAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,UAAI,yDAAoB,OAAO;AAE7B,gBAAQ;AAAA,UACN;AAAA,
|
|
4
|
+
"sourcesContent": ["import { getConfig } from './config'\nimport { createComponent } from './createComponent'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n TamaguiElement,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\n// can't infer from styled(<YStack />) which would be nice\n// * excessively deep type instantiation\n\ntype GetBaseProps<A extends StylableComponent> =\n // A extends TamaguiReactElement\n // ? GetBaseProps<A['type']> :\n A extends TamaguiComponent<any, any, infer P> ? P : GetProps<A>\n\ntype GetVariantProps<A extends StylableComponent> =\n // A extends TamaguiReactElement\n // ? GetVariantProps<A['type']>\n // :\n A extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n acceptsClassName?: boolean\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n // allows passing styled(<H1 bc=\"red\" />)\n // but to get types right would be tricky\n // if (isValidElement(Component) && isTamaguiComponent(Component.type)) {\n // const props = Component.props\n // if (props && typeof props === 'object') {\n // Component = Component.type as any\n // options = options ? ({ ...props, ...options } as any) : props\n // }\n // }\n\n const staticConfigProps = (() => {\n const parentStaticConfig =\n 'staticConfig' in Component ? (Component.staticConfig as StaticConfig) : null\n\n if (process.env.NODE_ENV === 'development') {\n if (parentStaticConfig?.isHOC) {\n // eslint-disable-next-line no-console\n console.warn(\n `Warning: Parent component is a functional component, not a Tamagui styled() component. Extending with styled() will break and lead to incorrect styles.`,\n `Given options:`,\n options,\n new Error().stack\n )\n }\n }\n\n if (options) {\n const {\n variants,\n name,\n defaultVariants,\n acceptsClassName: acceptsClassNameProp,\n ...defaultProps\n } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNative = Boolean(\n parentStaticConfig?.isReactNative || staticExtractionOptions?.isReactNative\n )\n const reactNativeWebComponent = isReactNative\n ? parentStaticConfig?.reactNativeWebComponent || Component\n : null\n const isTamagui = !isReactNative && !!parentStaticConfig\n const Comp = reactNativeWebComponent || (Component as any)\n const isText = Boolean(staticExtractionOptions?.isText || parentStaticConfig?.isText)\n const acceptsClassName = acceptsClassNameProp ?? (isTamagui || isReactNative)\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name,\n isReactNative,\n // for nesting multiple levels of rnw styled() need keep use the OG component\n reactNativeWebComponent,\n isText,\n acceptsClassName,\n }\n\n // TODO compiler doesn't have logic to include children, de-opt (see EnsureFlexed for test usage)\n // bail on non className views as well\n if (defaultProps.children || !acceptsClassName) {\n conf.neverFlatten = true\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = GetBaseProps<ParentComponent>\n type ParentVariants = GetVariantProps<ParentComponent>\n\n type OurVariants = Variants extends void\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n type StyledComponent = TamaguiComponent<\n Props,\n TamaguiElement,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n\n return component as StyledComponent\n}\n\n// import { Stack } from './views/Stack'\n// const X = styled(Stack, {\n// variants: {\n// size: {\n// '...size': (val) => {\n// return {}\n// }\n// },\n// disabled: {\n// true: {\n// opacity: 0.5,\n// pointerEvents: 'none',\n// },\n// },\n// } as const\n// })\n// type variants = GetStyledVariants<typeof X>\n// const y = <X disabled size=\"$10\" />\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,6BAAgC;AAmCzB,SAAS,OAId,WAEA,SAOA,yBACA;AAWA,QAAM,qBAAqB,MAAM;AAC/B,UAAM,qBACJ,kBAAkB,YAAa,UAAU,eAAgC;AAE3E,QAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,UAAI,yDAAoB,OAAO;AAE7B,gBAAQ;AAAA,UACN;AAAA,UACA;AAAA,UACA;AAAA,UACA,IAAI,MAAM,EAAE;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAEA,QAAI,SAAS;AACX,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA,kBAAkB;AAAA,WACf;AAAA,MACL,IAAI;AACJ,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,gBAAgB;AAAA,SACpB,yDAAoB,mBAAiB,mEAAyB;AAAA,MAChE;AACA,YAAM,0BAA0B,iBAC5B,yDAAoB,4BAA2B,YAC/C;AACJ,YAAM,YAAY,CAAC,iBAAiB,CAAC,CAAC;AACtC,YAAM,OAAO,2BAA4B;AACzC,YAAM,SAAS,SAAQ,mEAAyB,YAAU,yDAAoB,OAAM;AACpF,YAAM,mBAAmB,yBAAyB,aAAa;AAE/D,YAAM,OAA8B;AAAA,QAClC,GAAG;AAAA,QACH,GAAI,CAAC,aAAa;AAAA,UAChB,WAAW;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