@tamagui/core 1.0.0-alpha.63 → 1.0.0-alpha.64

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.
@@ -276,7 +276,7 @@ function createComponent(configIn) {
276
276
  const className = (0, import_helpers.concatClassName)(...classList);
277
277
  if (process.env.NODE_ENV === "development") {
278
278
  if (props["debug"]) {
279
- console.log("\u{1F95A} className", { style, styles, classList, stylesClassNames, className: className.trim().split(" ") });
279
+ console.log("\xBB className", { style, styles, classList, stylesClassNames, className: className.trim().split(" ") });
280
280
  }
281
281
  }
282
282
  viewProps.className = className;
@@ -415,11 +415,11 @@ function createComponent(configIn) {
415
415
  if (process.env.NODE_ENV === "development") {
416
416
  if (props["debug"]) {
417
417
  viewProps["debug"] = true;
418
- console.log("\u{1F95A} props in:", props);
419
- console.log("\u{1F95A} props out:", viewProps, (_b = viewProps.className) == null ? void 0 : _b.split(" "));
420
- console.log("\u{1F95A} etc:", { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls });
418
+ console.log("\xBB props in:", props);
419
+ console.log("\xBB props out:", viewProps, (_b = viewProps.className) == null ? void 0 : _b.split(" "));
420
+ console.log("\xBB etc:", { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls });
421
421
  if (typeof window !== "undefined") {
422
- console.log("\u{1F95A} component info", { staticConfig, tamaguiConfig });
422
+ console.log("\xBB component info", { staticConfig, tamaguiConfig });
423
423
  }
424
424
  }
425
425
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createComponent.tsx"],
4
- "sourcesContent": ["import './tamagui-base.css'\n\nimport { concatClassName, stylePropsView } from '@tamagui/helpers'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n createElement,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react'\nimport { StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isTouchDevice, isWeb } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { addStylesUsingClassname, useStylesAsClassname } from './helpers/addStylesUsingClassname'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport { getSplitStyles } from './helpers/getSplitStyles'\nimport { useFeatures } from './hooks/useFeatures'\nimport { usePressable } from './hooks/usePressable'\nimport { useTheme } from './hooks/useTheme'\nimport {\n SpaceTokens,\n StaticComponent,\n StaticConfig,\n StaticConfigParsed,\n TamaguiInternalConfig,\n} from './types'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nexport const mouseUps = new Set<Function>()\n\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\ntype DefaultProps = {}\n\nconst defaultComponentState = {\n hover: false,\n press: false,\n pressIn: false,\n}\n\ntype ComponentState = typeof defaultComponentState\n\nfunction createShallowUpdate(setter: React.Dispatch<React.SetStateAction<ComponentState>>) {\n return (next: Partial<ComponentState>) => {\n setter((prev) => {\n for (const key in next) {\n if (prev[key] !== next[key]) {\n return { ...prev, ...next }\n }\n }\n return prev\n })\n }\n}\n\nexport function createComponent<ComponentPropTypes extends Object = DefaultProps>(\n configIn: Partial<StaticConfig> | StaticConfigParsed\n) {\n let staticConfig: StaticConfigParsed\n if ('parsed' in configIn) {\n staticConfig = configIn\n } else {\n staticConfig = parseStaticConfig(configIn)\n }\n\n const { Component, validStyles, isText, isZStack } = staticConfig\n const validStyleProps = validStyles ?? stylePropsView\n\n // split out default styles vs props so we can assign it to component.defaultProps\n let defaultProps = null as any\n let tamaguiConfig: TamaguiInternalConfig\n\n // web uses className, native uses style\n let defaultNativeStyle: StyleSheet.NamedStyles<{ base: {} }> | null = null\n let defaultsClassName = ''\n let initialTheme: any\n\n // see onConfiguredOnce below which attaches a name then to this component\n\n const component = forwardRef<View, ComponentPropTypes>((props: any, forwardedRef) => {\n const forceUpdate = useForceUpdate()\n const features = useFeatures(props, { forceUpdate })\n const theme = useTheme()\n const [state, set_] = useState<ComponentState>(defaultComponentState)\n const set = createShallowUpdate(set_)\n\n // from react-native-web\n if (process.env.NODE_ENV === 'development' && !isText && isWeb) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\n const hostRef = useRef(null)\n\n const {\n viewProps: viewPropsIn,\n pseudos,\n style,\n classNames,\n } = getSplitStyles(props, staticConfig, theme)\n\n const {\n tag,\n hitSlop,\n children,\n pointerEvents,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space,\n disabled,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\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 onMouseDown,\n onClick,\n\n accessible,\n accessibilityRole,\n\n // TODO feature load layout hook\n onLayout,\n ...viewProps\n } = viewPropsIn\n\n if (!isWeb) {\n if (accessible) viewProps.accessible = accessible\n if (accessibilityRole) viewProps.accessibilityRole = accessibilityRole\n }\n\n if (isWeb) {\n // from react-native-web\n rnw.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 })\n }\n\n // hasEverHadEvents prevents repareting if you remove onPress or similar...\n const internal = useRef<{ isMounted: boolean; hasEverHadEvents?: boolean }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n\n useEffect(() => {\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n }\n }, [])\n\n // element\n const isInternalComponent = !Component || typeof Component === 'string'\n // default to tag, fallback to component (when both strings)\n const element = isWeb ? (isInternalComponent ? tag || Component : Component) : Component\n const ReactView = !isWeb ? View : element || (hasTextAncestor ? 'span' : 'div')\n const ReactText = !isWeb ? Text : element || 'span'\n const ViewComponent = isText ? ReactText : ReactView\n\n // styles\n const isHovering = !isTouchDevice && !disabled && pseudos && state.hover\n const isPressing = !disabled && pseudos && state.press\n\n const styles = [\n defaultNativeStyle ? defaultNativeStyle.base : null,\n // parity w react-native-web, only for text in text\n // TODO this should be able to be done w css to replicate after extraction:\n // (.text .text { display: inline-flex; }) (but if they set display we'd need stronger precendence)\n // isText && hasTextAncestor && isWeb ? { display: 'inline-flex' } : null,\n style,\n isHovering ? pseudos.hoverStyle || null : null,\n isPressing ? pseudos.pressStyle || null : null,\n ]\n\n if (isWeb) {\n const stylesClassNames = useStylesAsClassname(styles)\n const classList = isText\n ? [\n defaultsClassName,\n // hasTextAncestor === true && cssText.textHasAncestor,\n // TODO MOVE TO VARIANTS [number] [any]\n // numberOfLines != null && numberOfLines > 1 && cssText.textMultiLine,\n classNames,\n stylesClassNames,\n props.className,\n ]\n : [defaultsClassName, props.className, classNames, stylesClassNames]\n\n // @ts-ignore we are optimizing using arguments\n const className = concatClassName(...classList)\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\uD83E\uDD5A className', { style, styles, classList, stylesClassNames, className: className.trim().split(' ') })\n }\n }\n viewProps.className = className\n } else {\n viewProps.style = styles\n }\n\n if (pointerEvents) {\n viewProps.pointerEvents = pointerEvents\n }\n\n if (isWeb) {\n // from react-native-web\n const platformMethodsRef = rnw.usePlatformMethods(viewProps)\n const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef)\n viewProps.ref = setRef\n if (props.href != null && hrefAttrs != null) {\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 } else {\n if (forwardedRef) {\n viewProps.ref = forwardedRef\n }\n }\n\n const attachPress = !!(\n (pseudos && pseudos.pressStyle) ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n const attachHover =\n isWeb &&\n !isTouchDevice &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n // while avoiding reparenting...\n // once proper reparenting is supported, we can remove this and use that...\n const shouldAttach =\n internal.current.hasEverHadEvents ||\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 'onClick' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props))\n\n // never remove events as we wrap in a div (for now, may be able to remove..)\n if (shouldAttach) {\n internal.current.hasEverHadEvents = true\n }\n\n const unPress = useCallback(() => {\n if (!internal.current!.isMounted) return\n set({\n press: false,\n pressIn: false,\n })\n }, [])\n\n const events = shouldAttach\n ? {\n ...(!isWeb && {\n // non web\n onPressOut: (e) => {\n unPress()\n onPressOut?.(e)\n },\n }),\n ...(isWeb &&\n !isTouchDevice && {\n onMouseEnter:\n attachHover || attachPress\n ? (e) => {\n let next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (Object.keys(next).length) {\n set(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave:\n attachHover || attachPress\n ? (e) => {\n let 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 set(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n onMouseDown: attachPress\n ? (e) => {\n set({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n }\n : (onPressIn as any),\n onClick: attachPress\n ? (e) => {\n // this caused issue with next.js passing href\n // e.preventDefault()\n onPress?.(e)\n onClick?.(e)\n unPress()\n onPressOut?.(e)\n }\n : (onPressOut as any),\n }\n : null\n\n if (events) {\n if (typeof ViewComponent !== 'string') {\n // TODO once we do the above we can then rely entirely on pressStyle returned here isntead of above pressStyle logic\n const [pressProps] = usePressable({\n disabled,\n hitSlop,\n onPressIn: events.onMouseDown,\n onPressOut: events.onPressOut,\n onPress: events.onClick,\n })\n Object.assign(viewProps, pressProps)\n } else {\n Object.assign(viewProps, events)\n }\n }\n\n const childEls = spacedChildren({\n children,\n space,\n flexDirection: props.flexDirection || defaultProps?.flexDirection,\n isZStack: isZStack,\n })\n\n let content: any\n\n // replicate react-native-web's `createElement`\n if (isWeb && rnw) {\n const domProps = rnw.createDOMProps(viewProps)\n const className =\n domProps.className && domProps.className !== viewProps.className\n ? `${domProps.className} ${viewProps.className}`\n : viewProps.className\n Object.assign(viewProps, domProps)\n\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = viewProps.dataSet || {}\n Object.assign(viewProps.dataSet, { __className: className })\n } else {\n // we already handle Text/View properly\n viewProps.className = className\n }\n\n content = createElement(ViewComponent, viewProps, childEls)\n } else {\n content = createElement(ViewComponent, viewProps, childEls)\n }\n\n const shouldWrapTextAncestor = isWeb && isText && !hasTextAncestor\n if (shouldWrapTextAncestor) {\n // from react-native-web\n content = createElement(TextAncestorContext.Provider, { value: true }, content)\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n viewProps['debug'] = true\n console.log('\uD83E\uDD5A props in:', props)\n console.log('\uD83E\uDD5A props out:', viewProps, viewProps.className?.split(' '))\n // prettier-ignore\n console.log('\uD83E\uDD5A etc:', { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls })\n // only on browser because node expands it huge\n if (typeof window !== 'undefined') {\n console.log('\uD83E\uDD5A component info', { staticConfig, tamaguiConfig })\n }\n }\n }\n\n if (features.length) {\n return (\n <>\n {features}\n {content}\n </>\n )\n }\n\n return content\n })\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n const shouldDebug = staticConfig.defaultProps?.debug\n tamaguiConfig = conf\n initialTheme = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]\n const { classNames, pseudos, style, viewProps } = getSplitStyles(\n staticConfig.defaultProps,\n staticConfig,\n initialTheme\n )\n if (isWeb) {\n if (classNames) {\n defaultsClassName += classNames + ' '\n }\n defaultsClassName += addStylesUsingClassname([style, pseudos])\n if (process.env.NODE_ENV === 'development' && shouldDebug) {\n // prettier-ignore\n console.log('tamagui \uD83D\uDC1B:', { defaultsClassName: defaultsClassName.split(' ') })\n }\n } else {\n // native, create a default StyleSheet\n // TODO handle pseudos\n const sheetStyles = {}\n for (const styleObj of style) {\n Object.assign(sheetStyles, styleObj)\n }\n defaultNativeStyle = StyleSheet.create({\n base: sheetStyles,\n })\n }\n // @ts-ignore\n component.defaultProps = {\n ...viewProps,\n ...component.defaultProps,\n }\n if (process.env.NODE_ENV === 'development' && shouldDebug) {\n // prettier-ignore\n console.log('tamagui \uD83D\uDC1B:', { initialTheme, classNames, pseudos, style, viewProps, defaultsClassName, component })\n }\n })\n\n component['staticConfig'] = {\n validStyles: validStyleProps,\n ...staticConfig,\n }\n\n const res = component as any as StaticComponent<ComponentPropTypes, void>\n\n // add extractable HoC\n res['extractable'] = (Component: any, conf?: StaticConfig) => {\n Component['staticConfig'] = extendStaticConfig(res, {\n ...conf,\n neverFlatten: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n })\n return Component\n }\n\n return res\n}\n\nlet hasWarnedOnce = false\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<{ size?: number | SpaceTokens; flex?: boolean | number }>({\n defaultProps: {\n ...stackDefaultStyles,\n size: true,\n },\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n return {\n width: tokens.size[size] ?? size,\n height: tokens.size[size] ?? size,\n }\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n },\n vertical: {\n width: 0,\n },\n },\n },\n})\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n flexDirection,\n}: {\n isZStack?: boolean\n children: any\n space?: any\n flexDirection?: ViewStyle['flexDirection']\n}) {\n if (!space && !isZStack) {\n return children\n }\n const childrenList = Children.toArray(children)\n const len = childrenList.length\n if (len === 1) {\n return children\n }\n const next: any[] = []\n for (const [index, child] of childrenList.entries()) {\n if (child === null || child === undefined) {\n continue\n }\n\n const key = `${child?.['key'] ?? index}`\n\n next.push(\n <Fragment key={key}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n\n // allows for custom visually hidden components that dont insert spacing\n if (child?.['type']?.['isVisuallyHidden']) {\n continue\n }\n\n if (index !== len - 1) {\n if (space) {\n next.push(\n <Spacer\n key={`${key}_spacer`}\n // @ts-ignore TODO\n direction={\n flexDirection === 'row' || flexDirection === 'row-reverse' ? 'horizontal' : 'vertical'\n }\n size={space}\n />\n )\n }\n }\n }\n return next\n}\n\nexport const AbsoluteFill = (props: any) =>\n isWeb ? (\n <div className=\"tamagui-absolute-fill\">{props.children}</div>\n ) : (\n <View style={StyleSheet.absoluteFill}>{props.child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GAMC;AArkBH;AAskBE,MAAI,CAAC,SAAS,CAAC,UAAU;AACvB,WAAO;AAAA;AAET,QAAM,eAAe,sBAAS,QAAQ;AACtC,QAAM,MAAM,aAAa;AACzB,MAAI,QAAQ,GAAG;AACb,WAAO;AAAA;AAET,QAAM,OAAc;AACpB,aAAW,CAAC,OAAO,UAAU,aAAa,WAAW;AACnD,QAAI,UAAU,QAAQ,UAAU,QAAW;AACzC;AAAA;AAGF,UAAM,MAAM,GAAG,gCAAQ,WAAU;AAEjC,SAAK,KACH,mDAAC,uBAAD;AAAA,MAAU;AAAA,OAAW,WAAW,mDAAC,cAAD,MAAe,SAAwB;AAIzE,QAAI,qCAAQ,YAAR,mBAAkB,qBAAqB;AACzC;AAAA;AAGF,QAAI,UAAU,MAAM,GAAG;AACrB,UAAI,OAAO;AACT,aAAK,KACH,mDAAC,QAAD;AAAA,UACE,KAAK,GAAG;AAAA,UAER,WACE,kBAAkB,SAAS,kBAAkB,gBAAgB,eAAe;AAAA,UAE9E,MAAM;AAAA;AAAA;AAAA;AAAA;AAMhB,SAAO;AAAA;AAnDO;AAsDT,MAAM,eAAe,wBAAC,UAC3B,wBACE,mDAAC,OAAD;AAAA,EAAK,WAAU;AAAA,GAAyB,MAAM,YAE9C,mDAAC,0BAAD;AAAA,EAAM,OAAO,+BAAW;AAAA,GAAe,MAAM,QAJrB;",
4
+ "sourcesContent": ["import './tamagui-base.css'\n\nimport { concatClassName, stylePropsView } from '@tamagui/helpers'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n createElement,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react'\nimport { StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isTouchDevice, isWeb } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { addStylesUsingClassname, useStylesAsClassname } from './helpers/addStylesUsingClassname'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport { getSplitStyles } from './helpers/getSplitStyles'\nimport { useFeatures } from './hooks/useFeatures'\nimport { usePressable } from './hooks/usePressable'\nimport { useTheme } from './hooks/useTheme'\nimport {\n SpaceTokens,\n StaticComponent,\n StaticConfig,\n StaticConfigParsed,\n TamaguiInternalConfig,\n} from './types'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nexport const mouseUps = new Set<Function>()\n\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\ntype DefaultProps = {}\n\nconst defaultComponentState = {\n hover: false,\n press: false,\n pressIn: false,\n}\n\ntype ComponentState = typeof defaultComponentState\n\nfunction createShallowUpdate(setter: React.Dispatch<React.SetStateAction<ComponentState>>) {\n return (next: Partial<ComponentState>) => {\n setter((prev) => {\n for (const key in next) {\n if (prev[key] !== next[key]) {\n return { ...prev, ...next }\n }\n }\n return prev\n })\n }\n}\n\nexport function createComponent<ComponentPropTypes extends Object = DefaultProps>(\n configIn: Partial<StaticConfig> | StaticConfigParsed\n) {\n let staticConfig: StaticConfigParsed\n if ('parsed' in configIn) {\n staticConfig = configIn\n } else {\n staticConfig = parseStaticConfig(configIn)\n }\n\n const { Component, validStyles, isText, isZStack } = staticConfig\n const validStyleProps = validStyles ?? stylePropsView\n\n // split out default styles vs props so we can assign it to component.defaultProps\n let defaultProps = null as any\n let tamaguiConfig: TamaguiInternalConfig\n\n // web uses className, native uses style\n let defaultNativeStyle: StyleSheet.NamedStyles<{ base: {} }> | null = null\n let defaultsClassName = ''\n let initialTheme: any\n\n // see onConfiguredOnce below which attaches a name then to this component\n\n const component = forwardRef<View, ComponentPropTypes>((props: any, forwardedRef) => {\n const forceUpdate = useForceUpdate()\n const features = useFeatures(props, { forceUpdate })\n const theme = useTheme()\n const [state, set_] = useState<ComponentState>(defaultComponentState)\n const set = createShallowUpdate(set_)\n\n // from react-native-web\n if (process.env.NODE_ENV === 'development' && !isText && isWeb) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\n const hostRef = useRef(null)\n\n const {\n viewProps: viewPropsIn,\n pseudos,\n style,\n classNames,\n } = getSplitStyles(props, staticConfig, theme)\n\n const {\n tag,\n hitSlop,\n children,\n pointerEvents,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space,\n disabled,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\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 onMouseDown,\n onClick,\n\n accessible,\n accessibilityRole,\n\n // TODO feature load layout hook\n onLayout,\n ...viewProps\n } = viewPropsIn\n\n if (!isWeb) {\n if (accessible) viewProps.accessible = accessible\n if (accessibilityRole) viewProps.accessibilityRole = accessibilityRole\n }\n\n if (isWeb) {\n // from react-native-web\n rnw.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 })\n }\n\n // hasEverHadEvents prevents repareting if you remove onPress or similar...\n const internal = useRef<{ isMounted: boolean; hasEverHadEvents?: boolean }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n\n useEffect(() => {\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n }\n }, [])\n\n // element\n const isInternalComponent = !Component || typeof Component === 'string'\n // default to tag, fallback to component (when both strings)\n const element = isWeb ? (isInternalComponent ? tag || Component : Component) : Component\n const ReactView = !isWeb ? View : element || (hasTextAncestor ? 'span' : 'div')\n const ReactText = !isWeb ? Text : element || 'span'\n const ViewComponent = isText ? ReactText : ReactView\n\n // styles\n const isHovering = !isTouchDevice && !disabled && pseudos && state.hover\n const isPressing = !disabled && pseudos && state.press\n\n const styles = [\n defaultNativeStyle ? defaultNativeStyle.base : null,\n // parity w react-native-web, only for text in text\n // TODO this should be able to be done w css to replicate after extraction:\n // (.text .text { display: inline-flex; }) (but if they set display we'd need stronger precendence)\n // isText && hasTextAncestor && isWeb ? { display: 'inline-flex' } : null,\n style,\n isHovering ? pseudos.hoverStyle || null : null,\n isPressing ? pseudos.pressStyle || null : null,\n ]\n\n if (isWeb) {\n const stylesClassNames = useStylesAsClassname(styles)\n const classList = isText\n ? [\n defaultsClassName,\n // hasTextAncestor === true && cssText.textHasAncestor,\n // TODO MOVE TO VARIANTS [number] [any]\n // numberOfLines != null && numberOfLines > 1 && cssText.textMultiLine,\n classNames,\n stylesClassNames,\n props.className,\n ]\n : [defaultsClassName, props.className, classNames, stylesClassNames]\n\n // @ts-ignore we are optimizing using arguments\n const className = concatClassName(...classList)\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u00BB className', { style, styles, classList, stylesClassNames, className: className.trim().split(' ') })\n }\n }\n viewProps.className = className\n } else {\n viewProps.style = styles\n }\n\n if (pointerEvents) {\n viewProps.pointerEvents = pointerEvents\n }\n\n if (isWeb) {\n // from react-native-web\n const platformMethodsRef = rnw.usePlatformMethods(viewProps)\n const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef)\n viewProps.ref = setRef\n if (props.href != null && hrefAttrs != null) {\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 } else {\n if (forwardedRef) {\n viewProps.ref = forwardedRef\n }\n }\n\n const attachPress = !!(\n (pseudos && pseudos.pressStyle) ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n const attachHover =\n isWeb &&\n !isTouchDevice &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n // while avoiding reparenting...\n // once proper reparenting is supported, we can remove this and use that...\n const shouldAttach =\n internal.current.hasEverHadEvents ||\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 'onClick' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props))\n\n // never remove events as we wrap in a div (for now, may be able to remove..)\n if (shouldAttach) {\n internal.current.hasEverHadEvents = true\n }\n\n const unPress = useCallback(() => {\n if (!internal.current!.isMounted) return\n set({\n press: false,\n pressIn: false,\n })\n }, [])\n\n const events = shouldAttach\n ? {\n ...(!isWeb && {\n // non web\n onPressOut: (e) => {\n unPress()\n onPressOut?.(e)\n },\n }),\n ...(isWeb &&\n !isTouchDevice && {\n onMouseEnter:\n attachHover || attachPress\n ? (e) => {\n let next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (Object.keys(next).length) {\n set(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave:\n attachHover || attachPress\n ? (e) => {\n let 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 set(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n onMouseDown: attachPress\n ? (e) => {\n set({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n }\n : (onPressIn as any),\n onClick: attachPress\n ? (e) => {\n // this caused issue with next.js passing href\n // e.preventDefault()\n onPress?.(e)\n onClick?.(e)\n unPress()\n onPressOut?.(e)\n }\n : (onPressOut as any),\n }\n : null\n\n if (events) {\n if (typeof ViewComponent !== 'string') {\n // TODO once we do the above we can then rely entirely on pressStyle returned here isntead of above pressStyle logic\n const [pressProps] = usePressable({\n disabled,\n hitSlop,\n onPressIn: events.onMouseDown,\n onPressOut: events.onPressOut,\n onPress: events.onClick,\n })\n Object.assign(viewProps, pressProps)\n } else {\n Object.assign(viewProps, events)\n }\n }\n\n const childEls = spacedChildren({\n children,\n space,\n flexDirection: props.flexDirection || defaultProps?.flexDirection,\n isZStack: isZStack,\n })\n\n let content: any\n\n // replicate react-native-web's `createElement`\n if (isWeb && rnw) {\n const domProps = rnw.createDOMProps(viewProps)\n const className =\n domProps.className && domProps.className !== viewProps.className\n ? `${domProps.className} ${viewProps.className}`\n : viewProps.className\n Object.assign(viewProps, domProps)\n\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = viewProps.dataSet || {}\n Object.assign(viewProps.dataSet, { __className: className })\n } else {\n // we already handle Text/View properly\n viewProps.className = className\n }\n\n content = createElement(ViewComponent, viewProps, childEls)\n } else {\n content = createElement(ViewComponent, viewProps, childEls)\n }\n\n const shouldWrapTextAncestor = isWeb && isText && !hasTextAncestor\n if (shouldWrapTextAncestor) {\n // from react-native-web\n content = createElement(TextAncestorContext.Provider, { value: true }, content)\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n viewProps['debug'] = true\n console.log('\u00BB props in:', props)\n console.log('\u00BB props out:', viewProps, viewProps.className?.split(' '))\n // prettier-ignore\n console.log('\u00BB etc:', { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls })\n // only on browser because node expands it huge\n if (typeof window !== 'undefined') {\n console.log('\u00BB component info', { staticConfig, tamaguiConfig })\n }\n }\n }\n\n if (features.length) {\n return (\n <>\n {features}\n {content}\n </>\n )\n }\n\n return content\n })\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n const shouldDebug = staticConfig.defaultProps?.debug\n tamaguiConfig = conf\n initialTheme = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]\n const { classNames, pseudos, style, viewProps } = getSplitStyles(\n staticConfig.defaultProps,\n staticConfig,\n initialTheme\n )\n if (isWeb) {\n if (classNames) {\n defaultsClassName += classNames + ' '\n }\n defaultsClassName += addStylesUsingClassname([style, pseudos])\n if (process.env.NODE_ENV === 'development' && shouldDebug) {\n // prettier-ignore\n console.log('tamagui \uD83D\uDC1B:', { defaultsClassName: defaultsClassName.split(' ') })\n }\n } else {\n // native, create a default StyleSheet\n // TODO handle pseudos\n const sheetStyles = {}\n for (const styleObj of style) {\n Object.assign(sheetStyles, styleObj)\n }\n defaultNativeStyle = StyleSheet.create({\n base: sheetStyles,\n })\n }\n // @ts-ignore\n component.defaultProps = {\n ...viewProps,\n ...component.defaultProps,\n }\n if (process.env.NODE_ENV === 'development' && shouldDebug) {\n // prettier-ignore\n console.log('tamagui \uD83D\uDC1B:', { initialTheme, classNames, pseudos, style, viewProps, defaultsClassName, component })\n }\n })\n\n component['staticConfig'] = {\n validStyles: validStyleProps,\n ...staticConfig,\n }\n\n const res = component as any as StaticComponent<ComponentPropTypes, void>\n\n // add extractable HoC\n res['extractable'] = (Component: any, conf?: StaticConfig) => {\n Component['staticConfig'] = extendStaticConfig(res, {\n ...conf,\n neverFlatten: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n })\n return Component\n }\n\n return res\n}\n\nlet hasWarnedOnce = false\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<{ size?: number | SpaceTokens; flex?: boolean | number }>({\n defaultProps: {\n ...stackDefaultStyles,\n size: true,\n },\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n return {\n width: tokens.size[size] ?? size,\n height: tokens.size[size] ?? size,\n }\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n },\n vertical: {\n width: 0,\n },\n },\n },\n})\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n flexDirection,\n}: {\n isZStack?: boolean\n children: any\n space?: any\n flexDirection?: ViewStyle['flexDirection']\n}) {\n if (!space && !isZStack) {\n return children\n }\n const childrenList = Children.toArray(children)\n const len = childrenList.length\n if (len === 1) {\n return children\n }\n const next: any[] = []\n for (const [index, child] of childrenList.entries()) {\n if (child === null || child === undefined) {\n continue\n }\n\n const key = `${child?.['key'] ?? index}`\n\n next.push(\n <Fragment key={key}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n\n // allows for custom visually hidden components that dont insert spacing\n if (child?.['type']?.['isVisuallyHidden']) {\n continue\n }\n\n if (index !== len - 1) {\n if (space) {\n next.push(\n <Spacer\n key={`${key}_spacer`}\n // @ts-ignore TODO\n direction={\n flexDirection === 'row' || flexDirection === 'row-reverse' ? 'horizontal' : 'vertical'\n }\n size={space}\n />\n )\n }\n }\n }\n return next\n}\n\nexport const AbsoluteFill = (props: any) =>\n isWeb ? (\n <div className=\"tamagui-absolute-fill\">{props.children}</div>\n ) : (\n <View style={StyleSheet.absoluteFill}>{props.child}</View>\n )\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAO;AAEP,qBAAgD;AAChD,8BAA+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B,aAAW,CAAC,OAAO,UAAU,aAAa,WAAW;AACnD,QAAI,UAAU,QAAQ,UAAU,QAAW;AACzC;AAAA;AAGF,UAAM,MAAM,GAAG,gCAAQ,WAAU;AAEjC,SAAK,KACH,mDAAC,uBAAD;AAAA,MAAU;AAAA,OAAW,WAAW,mDAAC,cAAD,MAAe,SAAwB;AAIzE,QAAI,qCAAQ,YAAR,mBAAkB,qBAAqB;AACzC;AAAA;AAGF,QAAI,UAAU,MAAM,GAAG;AACrB,UAAI,OAAO;AACT,aAAK,KACH,mDAAC,QAAD;AAAA,UACE,KAAK,GAAG;AAAA,UAER,WACE,kBAAkB,SAAS,kBAAkB,gBAAgB,eAAe;AAAA,UAE9E,MAAM;AAAA;AAAA;AAAA;AAAA;AAMhB,SAAO;AAAA;AAnDO;AAsDT,MAAM,eAAe,wBAAC,UAC3B,wBACE,mDAAC,OAAD;AAAA,EAAK,WAAU;AAAA,GAAyB,MAAM,YAE9C,mDAAC,0BAAD;AAAA,EAAM,OAAO,+BAAW;AAAA,GAAe,MAAM,QAJrB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/extendStaticConfig.ts"],
4
- "sourcesContent": ["import React from 'react'\n\nimport { StaticComponent, StaticConfig, StaticConfigParsed } from '../types'\nimport { createPropMapper } from './createPropMapper'\n\nexport function extendStaticConfig(\n // can be undefined when loading with @tamagui/fake-react-native\n // could be fixed a bit cleaner\n Component?: StaticComponent | React.Component<any>,\n config: StaticConfig = {}\n): StaticConfigParsed | null {\n const parent = (Component || {}) as any\n if (!parent.staticConfig) {\n // if no static config, we are extending an external component\n parent.staticConfig = {\n Component,\n }\n }\n\n const variants = {\n ...parent.staticConfig.variants,\n }\n\n // merge variants without clobbering previous... can we tho (typed??\n if (config.variants) {\n for (const key in config.variants) {\n if (variants[key]) {\n variants[key] = {\n ...variants[key],\n ...config.variants[key],\n }\n } else {\n variants[key] = config.variants[key]\n }\n }\n }\n\n return parseStaticConfig({\n ...parent.staticConfig,\n ...config,\n isZStack: config.isZStack || parent.staticConfig.isZStack,\n variants,\n isText: config.isText || parent.staticConfig.isText || false,\n neverFlatten: config.neverFlatten ?? parent.staticConfig.neverFlatten,\n ensureOverriddenProp: config.ensureOverriddenProp ?? parent.staticConfig.ensureOverriddenProp,\n validStyles: config.validStyles\n ? {\n ...parent.staticConfig.validStyles,\n ...config.validStyles,\n }\n : parent.staticConfig.validStyles,\n validPropsExtra: {\n ...parent.staticConfig.validPropsExtra,\n ...config.validPropsExtra,\n },\n defaultProps: {\n ...parent.staticConfig.defaultProps,\n ...config.defaultProps,\n },\n })\n}\n\nexport const parseStaticConfig = (config: StaticConfig): StaticConfigParsed => {\n return {\n ...config,\n parsed: true,\n propMapper: createPropMapper(config),\n }\n}\n"],
4
+ "sourcesContent": ["import React from 'react'\n\nimport { StaticComponent, StaticConfig, StaticConfigParsed } from '../types'\nimport { createPropMapper } from './createPropMapper'\n\nexport function extendStaticConfig(\n // can be undefined when loading with @tamagui/fake-react-native\n // could be fixed a bit cleaner\n Component?: StaticComponent | React.Component<any> | ((props: any) => any),\n config: StaticConfig = {}\n): StaticConfigParsed | null {\n const parent = (Component || {}) as any\n if (!parent.staticConfig) {\n // if no static config, we are extending an external component\n parent.staticConfig = {\n Component,\n }\n }\n\n const variants = {\n ...parent.staticConfig.variants,\n }\n\n // merge variants without clobbering previous... can we tho (typed??\n if (config.variants) {\n for (const key in config.variants) {\n if (variants[key]) {\n variants[key] = {\n ...variants[key],\n ...config.variants[key],\n }\n } else {\n variants[key] = config.variants[key]\n }\n }\n }\n\n return parseStaticConfig({\n ...parent.staticConfig,\n ...config,\n isZStack: config.isZStack || parent.staticConfig.isZStack,\n variants,\n isText: config.isText || parent.staticConfig.isText || false,\n neverFlatten: config.neverFlatten ?? parent.staticConfig.neverFlatten,\n ensureOverriddenProp: config.ensureOverriddenProp ?? parent.staticConfig.ensureOverriddenProp,\n validStyles: config.validStyles\n ? {\n ...parent.staticConfig.validStyles,\n ...config.validStyles,\n }\n : parent.staticConfig.validStyles,\n validPropsExtra: {\n ...parent.staticConfig.validPropsExtra,\n ...config.validPropsExtra,\n },\n defaultProps: {\n ...parent.staticConfig.defaultProps,\n ...config.defaultProps,\n },\n })\n}\n\nexport const parseStaticConfig = (config: StaticConfig): StaticConfigParsed => {\n return {\n ...config,\n parsed: true,\n propMapper: createPropMapper(config),\n }\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,8BAAiC;AAE1B,4BAGL,WACA,SAAuB,IACI;AAC3B,QAAM,SAAU,aAAa;AAC7B,MAAI,CAAC,OAAO,cAAc;AAExB,WAAO,eAAe;AAAA,MACpB;AAAA;AAAA;AAIJ,QAAM,WAAW,mBACZ,OAAO,aAAa;AAIzB,MAAI,OAAO,UAAU;AACnB,eAAW,OAAO,OAAO,UAAU;AACjC,UAAI,SAAS,MAAM;AACjB,iBAAS,OAAO,kCACX,SAAS,OACT,OAAO,SAAS;AAAA,aAEhB;AACL,iBAAS,OAAO,OAAO,SAAS;AAAA;AAAA;AAAA;AAKtC,SAAO,kBAAkB,gDACpB,OAAO,eACP,SAFoB;AAAA,IAGvB,UAAU,OAAO,YAAY,OAAO,aAAa;AAAA,IACjD;AAAA,IACA,QAAQ,OAAO,UAAU,OAAO,aAAa,UAAU;AAAA,IACvD,cAAc,OAAO,gBAAgB,OAAO,aAAa;AAAA,IACzD,sBAAsB,OAAO,wBAAwB,OAAO,aAAa;AAAA,IACzE,aAAa,OAAO,cAChB,kCACK,OAAO,aAAa,cACpB,OAAO,eAEZ,OAAO,aAAa;AAAA,IACxB,iBAAiB,kCACZ,OAAO,aAAa,kBACpB,OAAO;AAAA,IAEZ,cAAc,kCACT,OAAO,aAAa,eACpB,OAAO;AAAA;AAAA;AApDA;AAyDT,MAAM,oBAAoB,wBAAC,WAA6C;AAC7E,SAAO,iCACF,SADE;AAAA,IAEL,QAAQ;AAAA,IACR,YAAY,8CAAiB;AAAA;AAAA,GAJA;",
6
6
  "names": []
7
7
  }
@@ -141,7 +141,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme) => {
141
141
  }
142
142
  if (process.env.NODE_ENV === "development") {
143
143
  if (props["debug"]) {
144
- console.log(" \u{1F95A} splitProps:", { props, viewProps, style });
144
+ console.log(" splitProps:", { props, viewProps, style });
145
145
  }
146
146
  }
147
147
  return {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/getSplitStyles.tsx"],
4
- "sourcesContent": ["import {\n AllRules,\n stylePropsText,\n stylePropsTransform,\n validStyles,\n validStylesPseudo,\n} from '@tamagui/helpers'\nimport { ViewStyle } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport { StaticConfigParsed, ThemeObject } from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { getStylesAtomic } from './getStylesAtomic'\nimport { insertStyleRule } from './insertStyleRule'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\n\n// TODO run over this, should be able to cut it down quite a bit\n\nexport const getSplitStyles = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject\n) => {\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: Record<string, any> = {}\n const style: any[] = []\n\n let pseudos: { hoverStyle?: ViewStyle; pressStyle?: ViewStyle } | null = null\n let cur: ViewStyle | null = null\n let classNames: string[] | null = null\n\n for (const keyInit in props) {\n // be sure to sync next few lines below to getSubStyle (*1)\n const valInit = props[keyInit]\n\n // media\n if (keyInit[0] === '$') {\n const mediaKey = keyInit.slice(1)\n\n if (!mediaQueryConfig[mediaKey]) {\n // this isn't a media key, pass through\n viewProps[keyInit] = valInit\n continue\n }\n\n // dont check if media is active, we just apply *all* media styles\n // we combine the media props on top regular props, could proxy this\n // TODO test proxy here instead of merge\n const mediaProps = { ...props, ...valInit }\n // TODO media + hover\n const mediaStyle = getSubStyle(valInit, staticConfig, theme, props)\n\n if (isWeb) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log('mediaStyles', keyInit, { mediaProps, mediaStyle })\n }\n }\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKey, mediaQueryConfig)\n classNames = classNames || []\n classNames.push(out.identifier)\n AllRules.add(out.styleRule)\n insertStyleRule(out.styleRule)\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n console.log('mediaProp', style.identifier, out.styleRule)\n }\n }\n } else {\n if (mediaState[mediaKey]) {\n style.push(mediaStyle)\n }\n }\n continue\n }\n\n // pseudo\n if (validStylesPseudo[keyInit]) {\n if (!valInit) continue\n pseudos = pseudos || {}\n pseudos[keyInit] = getSubStyle(valInit, staticConfig, theme, props)\n continue\n }\n\n const out = staticConfig.propMapper(keyInit, valInit, theme, props)\n const expanded = out === true || !out ? [[keyInit, valInit]] : Object.entries(out)\n\n for (const [key, val] of expanded) {\n // const val = valueMap(valInit) ?? valInit\n const keyFirstChar = key[0]\n if (key === 'style' || (keyFirstChar === '_' && key.startsWith('_style'))) {\n if (cur) {\n // process last\n fixNativeShadow(cur)\n style.push(cur)\n cur = null\n }\n fixNativeShadow(val)\n style.push(val)\n continue\n }\n // expand flex so it merged with flexShrink etc properly\n // TODO this shouldn't be here...\n if (key === 'flex') {\n cur = cur || {}\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n // TODO this fixed a behavior but need to find / document / test\n Object.assign(cur, {\n flexGrow: val,\n flexShrink: 1,\n })\n continue\n }\n if (!isWeb && key === 'pointerEvents') {\n viewProps[key] = val\n continue\n }\n if (validStyleProps[key]) {\n // transforms\n if (key in stylePropsTransform) {\n cur = cur || {}\n mergeTransform(cur, key, val)\n continue\n }\n cur = cur || {}\n cur[key] = val\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n viewProps[key] = val\n }\n }\n }\n // push last style\n if (cur) {\n fixNativeShadow(cur)\n style.push(cur)\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log(' \uD83E\uDD5A splitProps:', { props, viewProps, style })\n }\n }\n\n return {\n viewProps,\n style,\n pseudos,\n classNames,\n }\n}\n\nconst getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n // be sure to sync next few lines below to loop above (*1)\n const val = styleIn[key]\n const out = staticConfig.propMapper(key, val, theme, props)\n const expanded = out === true || !out ? [[key, val]] : Object.entries(out)\n for (const [skey, sval] of expanded) {\n // const sval = valueMap(valInit)\n if (skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = sval\n }\n }\n }\n fixNativeShadow(styleOut)\n return styleOut\n}\n\nconst mapTransformKeys = {\n x: 'translateX',\n y: 'translateY',\n}\n\nconst mergeTransform = (obj: ViewStyle, key: string, val: any) => {\n const transform: any[] = obj.transform\n ? Array.isArray(obj.transform)\n ? obj.transform\n : [obj.transform]\n : []\n transform.push({ [mapTransformKeys[key] || key]: val })\n obj.transform = transform\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,qBAMO;AAGP,sBAAsB;AACtB,sBAA6C;AAE7C,8BAAiC;AACjC,6BAAgC;AAChC,6BAAgC;AAChC,6BAAgC;AAMzB,MAAM,iBAAiB,wBAC5B,OACA,cACA,UACG;AACH,QAAM,kBAAkB,aAAa,SAAS,gCAAiB;AAC/D,QAAM,YAAiC;AACvC,QAAM,QAAe;AAErB,MAAI,UAAqE;AACzE,MAAI,MAAwB;AAC5B,MAAI,aAA8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BAAiB,wBAAC,KAAgB,KAAa,QAAa;AAChE,QAAM,YAAmB,IAAI,YACzB,MAAM,QAAQ,IAAI,aAChB,IAAI,YACJ,CAAC,IAAI,aACP;AACJ,YAAU,KAAK,GAAG,iBAAiB,QAAQ,MAAM;AACjD,MAAI,YAAY;AAAA,GAPK;",
4
+ "sourcesContent": ["import {\n AllRules,\n stylePropsText,\n stylePropsTransform,\n validStyles,\n validStylesPseudo,\n} from '@tamagui/helpers'\nimport { ViewStyle } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport { StaticConfigParsed, ThemeObject } from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { getStylesAtomic } from './getStylesAtomic'\nimport { insertStyleRule } from './insertStyleRule'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\n\n// TODO run over this, should be able to cut it down quite a bit\n\nexport const getSplitStyles = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject\n) => {\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: Record<string, any> = {}\n const style: any[] = []\n\n let pseudos: { hoverStyle?: ViewStyle; pressStyle?: ViewStyle } | null = null\n let cur: ViewStyle | null = null\n let classNames: string[] | null = null\n\n for (const keyInit in props) {\n // be sure to sync next few lines below to getSubStyle (*1)\n const valInit = props[keyInit]\n\n // media\n if (keyInit[0] === '$') {\n const mediaKey = keyInit.slice(1)\n\n if (!mediaQueryConfig[mediaKey]) {\n // this isn't a media key, pass through\n viewProps[keyInit] = valInit\n continue\n }\n\n // dont check if media is active, we just apply *all* media styles\n // we combine the media props on top regular props, could proxy this\n // TODO test proxy here instead of merge\n const mediaProps = { ...props, ...valInit }\n // TODO media + hover\n const mediaStyle = getSubStyle(valInit, staticConfig, theme, props)\n\n if (isWeb) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log('mediaStyles', keyInit, { mediaProps, mediaStyle })\n }\n }\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKey, mediaQueryConfig)\n classNames = classNames || []\n classNames.push(out.identifier)\n AllRules.add(out.styleRule)\n insertStyleRule(out.styleRule)\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n console.log('mediaProp', style.identifier, out.styleRule)\n }\n }\n } else {\n if (mediaState[mediaKey]) {\n style.push(mediaStyle)\n }\n }\n continue\n }\n\n // pseudo\n if (validStylesPseudo[keyInit]) {\n if (!valInit) continue\n pseudos = pseudos || {}\n pseudos[keyInit] = getSubStyle(valInit, staticConfig, theme, props)\n continue\n }\n\n const out = staticConfig.propMapper(keyInit, valInit, theme, props)\n const expanded = out === true || !out ? [[keyInit, valInit]] : Object.entries(out)\n\n for (const [key, val] of expanded) {\n // const val = valueMap(valInit) ?? valInit\n const keyFirstChar = key[0]\n if (key === 'style' || (keyFirstChar === '_' && key.startsWith('_style'))) {\n if (cur) {\n // process last\n fixNativeShadow(cur)\n style.push(cur)\n cur = null\n }\n fixNativeShadow(val)\n style.push(val)\n continue\n }\n // expand flex so it merged with flexShrink etc properly\n // TODO this shouldn't be here...\n if (key === 'flex') {\n cur = cur || {}\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n // TODO this fixed a behavior but need to find / document / test\n Object.assign(cur, {\n flexGrow: val,\n flexShrink: 1,\n })\n continue\n }\n if (!isWeb && key === 'pointerEvents') {\n viewProps[key] = val\n continue\n }\n if (validStyleProps[key]) {\n // transforms\n if (key in stylePropsTransform) {\n cur = cur || {}\n mergeTransform(cur, key, val)\n continue\n }\n cur = cur || {}\n cur[key] = val\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n viewProps[key] = val\n }\n }\n }\n // push last style\n if (cur) {\n fixNativeShadow(cur)\n style.push(cur)\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log(' splitProps:', { props, viewProps, style })\n }\n }\n\n return {\n viewProps,\n style,\n pseudos,\n classNames,\n }\n}\n\nconst getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n // be sure to sync next few lines below to loop above (*1)\n const val = styleIn[key]\n const out = staticConfig.propMapper(key, val, theme, props)\n const expanded = out === true || !out ? [[key, val]] : Object.entries(out)\n for (const [skey, sval] of expanded) {\n // const sval = valueMap(valInit)\n if (skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = sval\n }\n }\n }\n fixNativeShadow(styleOut)\n return styleOut\n}\n\nconst mapTransformKeys = {\n x: 'translateX',\n y: 'translateY',\n}\n\nconst mergeTransform = (obj: ViewStyle, key: string, val: any) => {\n const transform: any[] = obj.transform\n ? Array.isArray(obj.transform)\n ? obj.transform\n : [obj.transform]\n : []\n transform.push({ [mapTransformKeys[key] || key]: val })\n obj.transform = transform\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,qBAMO;AAGP,sBAAsB;AACtB,sBAA6C;AAE7C,8BAAiC;AACjC,6BAAgC;AAChC,6BAAgC;AAChC,6BAAgC;AAMzB,MAAM,iBAAiB,wBAC5B,OACA,cACA,UACG;AACH,QAAM,kBAAkB,aAAa,SAAS,gCAAiB;AAC/D,QAAM,YAAiC;AACvC,QAAM,QAAe;AAErB,MAAI,UAAqE;AACzE,MAAI,MAAwB;AAC5B,MAAI,aAA8B;AAElC,aAAW,WAAW,OAAO;AAE3B,UAAM,UAAU,MAAM;AAGtB,QAAI,QAAQ,OAAO,KAAK;AACtB,YAAM,WAAW,QAAQ,MAAM;AAE/B,UAAI,CAAC,iCAAiB,WAAW;AAE/B,kBAAU,WAAW;AACrB;AAAA;AAMF,YAAM,aAAa,kCAAK,QAAU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7
  }
@@ -99,7 +99,7 @@ const useTheme = /* @__PURE__ */ __name(() => {
99
99
  const val = activeTheme[key];
100
100
  if (process.env.NODE_ENV === "development") {
101
101
  if (typeof val === "undefined") {
102
- console.warn(`No theme value "${String(key)}" in`, activeTheme, themes);
102
+ console.warn(`No theme value "${String(key)}" in`, activeTheme);
103
103
  return null;
104
104
  }
105
105
  if (!(0, import_createVariable.isVariable)(val)) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useTheme.tsx"],
4
- "sourcesContent": ["import { useForceUpdate } from '@tamagui/use-force-update'\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react'\n\nimport { GET_DEFAULT_THEME } from '../constants/constants'\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\nimport { isVariable } from '../createVariable'\nimport { ThemeName, ThemeObject } from '../types'\nimport { ThemeContext } from '../views/ThemeContext'\nimport { ThemeManagerContext } from '../views/ThemeManagerContext'\n\ntype UseThemeState = {\n uuid: Object\n keys: Set<string>\n isRendering: boolean\n}\n\nconst areEqualSets = (a: Set<string>, b: Set<string>) => {\n if (a.size !== b.size) return false\n for (const val in a) {\n if (!b.has(val)) {\n return false\n }\n }\n return true\n}\n\nexport const useThemeName = (opts?: { parent?: true }) => {\n const parent = useContext(ThemeManagerContext)\n const [name, setName] = useState(parent.name)\n\n useIsomorphicLayoutEffect(() => {\n return parent.onChangeTheme((next, manager) => {\n setName(opts?.parent ? manager.parentName : next)\n })\n }, [parent])\n\n return name || 'light'\n}\n\nexport const useDefaultThemeName = () => {\n return useContext(ThemeContext)[GET_DEFAULT_THEME] as any as ThemeName\n}\n\nexport const useTheme = (): ThemeObject => {\n const forceUpdate = useForceUpdate()\n const manager = useContext(ThemeManagerContext)\n const themes = useContext(ThemeContext) || {}\n\n const state = useRef() as React.MutableRefObject<UseThemeState>\n if (!state.current) {\n state.current = {\n uuid: {},\n keys: new Set(),\n isRendering: true,\n }\n }\n state.current.isRendering = true\n\n // track usage\n useIsomorphicLayoutEffect(() => {\n const st = state.current\n st.isRendering = false\n const cur = manager.keys.get(st.uuid)\n if (!cur || !areEqualSets(st.keys, cur)) {\n manager.track(st.uuid, st.keys)\n }\n })\n\n useEffect(() => {\n return manager.onUpdate(state.current.uuid, forceUpdate)\n }, [])\n\n const theme = (manager.name ? themes[manager.name] : themes.light) ?? themes.light ?? {}\n\n return useMemo(\n () => {\n return new Proxy(theme, {\n get(_, key: string) {\n const name = manager.name\n if (!name) {\n return Reflect.get(_, key)\n }\n let activeTheme = themes[name]\n if (!activeTheme) {\n if (process.env.NODE_ENV !== 'test') {\n console.error('No theme by name', name, 'only:', themes, 'keeping current theme')\n }\n activeTheme = theme\n }\n const val = activeTheme[key]\n if (process.env.NODE_ENV === 'development') {\n if (typeof val === 'undefined') {\n console.warn(`No theme value \"${String(key)}\" in`, activeTheme, themes)\n return null\n }\n if (!isVariable(val)) {\n console.warn('Non variable!', val)\n }\n if (val.name !== key) {\n console.warn('Non-matching name for variable to key', key, val.name)\n }\n }\n if (state.current.isRendering) {\n state.current.keys.add(key)\n }\n return val\n },\n })\n },\n [\n /* if concurrent mode wanted put manager.name here */\n ]\n )\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA+B;AAC/B,mBAAwE;AAExE,uBAAkC;AAClC,sBAA0C;AAC1C,4BAA2B;AAE3B,0BAA6B;AAC7B,iCAAoC;AAQpC,MAAM,eAAe,wBAAC,GAAgB,MAAmB;AACvD,MAAI,EAAE,SAAS,EAAE;AAAM,WAAO;AAC9B,aAAW,OAAO,GAAG;AACnB,QAAI,CAAC,EAAE,IAAI,MAAM;AACf,aAAO;AAAA;AAAA;AAGX,SAAO;AAAA,GAPY;AAUd,MAAM,eAAe,wBAAC,SAA6B;AACxD,QAAM,SAAS,6BAAW;AAC1B,QAAM,CAAC,MAAM,WAAW,2BAAS,OAAO;AAExC,iDAA0B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aAAa,eAAe;AAC1C,cAAI,OAAO,QAAQ,aAAa;AAC9B,oBAAQ,KAAK,mBAAmB,OAAO,YAAY,aAAa;AAChE,mBAAO;AAAA;AAET,cAAI,CAAC,sCAAW,MAAM;AACpB,oBAAQ,KAAK,iBAAiB;AAAA;AAEhC,cAAI,IAAI,SAAS,KAAK;AACpB,oBAAQ,KAAK,yCAAyC,KAAK,IAAI;AAAA;AAAA;AAGnE,YAAI,MAAM,QAAQ,aAAa;AAC7B,gBAAM,QAAQ,KAAK,IAAI;AAAA;AAEzB,eAAO;AAAA;AAAA;AAAA,KAIb;AAAA,GAlEoB;",
4
+ "sourcesContent": ["import { useForceUpdate } from '@tamagui/use-force-update'\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react'\n\nimport { GET_DEFAULT_THEME } from '../constants/constants'\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\nimport { isVariable } from '../createVariable'\nimport { ThemeName, ThemeObject } from '../types'\nimport { ThemeContext } from '../views/ThemeContext'\nimport { ThemeManagerContext } from '../views/ThemeManagerContext'\n\ntype UseThemeState = {\n uuid: Object\n keys: Set<string>\n isRendering: boolean\n}\n\nconst areEqualSets = (a: Set<string>, b: Set<string>) => {\n if (a.size !== b.size) return false\n for (const val in a) {\n if (!b.has(val)) {\n return false\n }\n }\n return true\n}\n\nexport const useThemeName = (opts?: { parent?: true }) => {\n const parent = useContext(ThemeManagerContext)\n const [name, setName] = useState(parent.name)\n\n useIsomorphicLayoutEffect(() => {\n return parent.onChangeTheme((next, manager) => {\n setName(opts?.parent ? manager.parentName : next)\n })\n }, [parent])\n\n return name || 'light'\n}\n\nexport const useDefaultThemeName = () => {\n return useContext(ThemeContext)[GET_DEFAULT_THEME] as any as ThemeName\n}\n\nexport const useTheme = (): ThemeObject => {\n const forceUpdate = useForceUpdate()\n const manager = useContext(ThemeManagerContext)\n const themes = useContext(ThemeContext) || {}\n\n const state = useRef() as React.MutableRefObject<UseThemeState>\n if (!state.current) {\n state.current = {\n uuid: {},\n keys: new Set(),\n isRendering: true,\n }\n }\n state.current.isRendering = true\n\n // track usage\n useIsomorphicLayoutEffect(() => {\n const st = state.current\n st.isRendering = false\n const cur = manager.keys.get(st.uuid)\n if (!cur || !areEqualSets(st.keys, cur)) {\n manager.track(st.uuid, st.keys)\n }\n })\n\n useEffect(() => {\n return manager.onUpdate(state.current.uuid, forceUpdate)\n }, [])\n\n const theme = (manager.name ? themes[manager.name] : themes.light) ?? themes.light ?? {}\n\n return useMemo(\n () => {\n return new Proxy(theme, {\n get(_, key: string) {\n const name = manager.name\n if (!name) {\n return Reflect.get(_, key)\n }\n let activeTheme = themes[name]\n if (!activeTheme) {\n if (process.env.NODE_ENV !== 'test') {\n console.error('No theme by name', name, 'only:', themes, 'keeping current theme')\n }\n activeTheme = theme\n }\n const val = activeTheme[key]\n if (process.env.NODE_ENV === 'development') {\n if (typeof val === 'undefined') {\n console.warn(`No theme value \"${String(key)}\" in`, activeTheme)\n return null\n }\n if (!isVariable(val)) {\n console.warn('Non variable!', val)\n }\n if (val.name !== key) {\n console.warn('Non-matching name for variable to key', key, val.name)\n }\n }\n if (state.current.isRendering) {\n state.current.keys.add(key)\n }\n return val\n },\n })\n },\n [\n /* if concurrent mode wanted put manager.name here */\n ]\n )\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA+B;AAC/B,mBAAwE;AAExE,uBAAkC;AAClC,sBAA0C;AAC1C,4BAA2B;AAE3B,0BAA6B;AAC7B,iCAAoC;AAQpC,MAAM,eAAe,wBAAC,GAAgB,MAAmB;AACvD,MAAI,EAAE,SAAS,EAAE;AAAM,WAAO;AAC9B,aAAW,OAAO,GAAG;AACnB,QAAI,CAAC,EAAE,IAAI,MAAM;AACf,aAAO;AAAA;AAAA;AAGX,SAAO;AAAA,GAPY;AAUd,MAAM,eAAe,wBAAC,SAA6B;AACxD,QAAM,SAAS,6BAAW;AAC1B,QAA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hB,cAAM,MAAM,YAAY;AACxB,YAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,cAAI,OAAO,QAAQ,aAAa;AAC9B,oBAAQ,KAAK,mBAAmB,OAAO,YAAY;AACnD,mBAAO;AAAA;AAET,cAAI,CAAC,sCAAW,MAAM;AACpB,oBAAQ,KAAK,iBAAiB;AAAA;AAEhC,cAAI,IAAI,SAAS,KAAK;AACpB,oBAAQ,KAAK,yCAAyC,KAAK,IAAI;AAAA;AAAA;AAGnE,YAAI,MAAM,QAAQ,aAAa;AAC7B,gBAAM,QAAQ,KAAK,IAAI;AAAA;AAEzB,eAAO;AAAA;AAAA;AAAA,KAIb;AAAA,GAlEoB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.ts"],
4
- "sourcesContent": ["import * as React from 'react'\n\nimport { createComponent } from './createComponent'\nimport { extendStaticConfig } from './helpers/extendStaticConfig'\nimport {\n MediaProps,\n PseudoProps,\n StaticComponent,\n StaticConfig,\n TamaguiConfig,\n Themes,\n Tokens,\n} from './types'\n\nexport function styled<\n ParentComponent extends StaticComponent | React.Component<any>,\n Variants extends GetVariants<ParentComponent>\n>(\n Component: ParentComponent,\n options?: GetProps<ParentComponent> & {\n variants?: Variants\n },\n staticExtractionOptions?: StaticConfig\n) {\n const staticConfigProps: StaticConfig = (() => {\n if (options) {\n const { variants, ...defaultProps } = options\n return { ...staticExtractionOptions, variants, defaultProps }\n }\n return {}\n })()\n const config = extendStaticConfig(Component, staticConfigProps)\n const component = createComponent(config!) // error is good here its on init\n type VariantProps = GetVariantProps<Variants>\n return component as StaticComponent<\n // if not options/variants passed just styled(Text):\n keyof VariantProps extends never\n ? GetProps<ParentComponent>\n : // if options passed: styled(Text, { ... })\n Omit<GetProps<ParentComponent>, keyof VariantProps> &\n VariantProps &\n MediaProps<VariantProps> &\n PseudoProps<VariantProps>,\n void\n >\n}\n\n// type ParentVariants = A extends StaticComponent<any, infer Variants> ? Variants : {}\n\nexport type GetProps<A> = A extends StaticComponent<infer Props>\n ? Props\n : A extends React.Component<infer Props>\n ? Props\n : {}\n\nexport type GetVariants<ParentComponent extends StaticComponent | React.Component<any>> = void | {\n [key: string]: {\n [key: string]:\n | Partial<GetProps<ParentComponent>>\n | ((\n val: any,\n config: {\n tokens: TamaguiConfig['tokens']\n theme: Themes extends { [key: string]: infer B } ? B : unknown\n props: GetProps<ParentComponent>\n }\n ) => Partial<GetProps<ParentComponent>>)\n }\n}\n\nexport type GetVariantProps<Variants> = Variants extends void\n ? {}\n : {\n // ensure variants actually defined\n [Key in keyof Variants]?: keyof Variants[Key] extends `...${infer VariantSpread}`\n ? VariantSpread extends keyof Tokens\n ? keyof Tokens[VariantSpread] extends string | number\n ? `$${keyof Tokens[VariantSpread]}` | null\n : unknown\n : unknown\n : keyof Variants[Key] extends 'true'\n ? boolean | null\n : keyof Exclude<Variants[Key], undefined>\n }\n\n// type X = { ok: 1 }\n// type Y = { okk: 2; ok: 3 }\n// type Z = X & Y\n// type Z2 = Z\n\n// TODO get name\n// const displayName = `styled(Component)`\n// Object.defineProperty(component, 'name', {\n// value: displayName,\n// writable: false,\n// })\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAEA,6BAAgC;AAChC,gCAAmC;AAW5B,gBAIL,WACA,SAGA,yBACA;AACA,QAAM,oBAAmC,OAAM;AAC7C,QAAI,SAAS;AACX,YAAsC,cAA9B,eAA8B,IAAjB,yBAAiB,IAAjB,CAAb;AACR,aAAO,iCAAK,0BAAL,EAA8B,UAAU;AAAA;AAEjD,WAAO;AAAA;AAET,QAAM,SAAS,kDAAmB,WAAW;AAC7C,QAAM,YAAY,4CAAgB;AAElC,SAAO;AAAA;AApBO;",
4
+ "sourcesContent": ["import * as React from 'react'\n\nimport { createComponent } from './createComponent'\nimport { extendStaticConfig } from './helpers/extendStaticConfig'\nimport {\n MediaProps,\n PseudoProps,\n StaticComponent,\n StaticConfig,\n TamaguiConfig,\n Themes,\n Tokens,\n} from './types'\n\nexport function styled<\n Props,\n ParentComponent extends StaticComponent | React.Component<any>,\n Variants extends GetVariants<GetProps<ParentComponent>>\n>(\n Component: ParentComponent,\n options?: GetProps<ParentComponent> & {\n variants?: Variants\n },\n staticExtractionOptions?: StaticConfig\n) {\n const staticConfigProps: StaticConfig = (() => {\n if (options) {\n const { variants, ...defaultProps } = options\n return { ...staticExtractionOptions, variants, defaultProps }\n }\n return {}\n })()\n const config = extendStaticConfig(Component, staticConfigProps)\n const component = createComponent(config!) // error is good here its on init\n\n type VariantProps = GetVariantProps<Variants>\n type ParentProps = Props extends Object ? Props : GetProps<ParentComponent>\n\n return component as StaticComponent<\n // if not options/variants passed just styled(Text):\n keyof VariantProps extends never\n ? ParentProps\n : // if options passed: styled(Text, { ... })\n Omit<ParentProps, keyof VariantProps> &\n VariantProps &\n MediaProps<VariantProps> &\n PseudoProps<VariantProps>,\n void\n >\n}\n\n// type ParentVariants = A extends StaticComponent<any, infer Variants> ? Variants : {}\n\nexport type GetProps<A> = A extends StaticComponent<infer Props>\n ? Props\n : A extends React.Component<infer Props>\n ? Props\n : A extends (props: infer Props) => any\n ? Props\n : {}\n\nexport type GetVariants<Props> = void | {\n [key: string]: {\n [key: string]:\n | Partial<Props>\n | ((\n val: any,\n config: {\n tokens: TamaguiConfig['tokens']\n theme: Themes extends { [key: string]: infer B } ? B : unknown\n props: Props\n }\n ) => Partial<Props>)\n }\n}\n\nexport type GetVariantProps<Variants> = Variants extends void\n ? {}\n : {\n // ensure variants actually defined\n [Key in keyof Variants]?: keyof Variants[Key] extends `...${infer VariantSpread}`\n ? VariantSpread extends keyof Tokens\n ? keyof Tokens[VariantSpread] extends string | number\n ? `$${keyof Tokens[VariantSpread]}` | null\n : unknown\n : unknown\n : keyof Variants[Key] extends 'true'\n ? boolean | null\n : keyof Exclude<Variants[Key], undefined>\n }\n\n// type X = { ok: 1 }\n// type Y = { okk: 2; ok: 3 }\n// type Z = X & Y\n// type Z2 = Z\n\n// TODO get name\n// const displayName = `styled(Component)`\n// Object.defineProperty(component, 'name', {\n// value: displayName,\n// writable: false,\n// })\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAEA,6BAAgC;AAChC,gCAAmC;AAW5B,gBAKL,WACA,SAGA,yBACA;AACA,QAAM,oBAAmC,OAAM;AAC7C,QAAI,SAAS;AACX,YAAsC,cAA9B,eAA8B,IAAjB,yBAAiB,IAAjB,CAAb;AACR,aAAO,iCAAK,0BAAL,EAA8B,UAAU;AAAA;AAEjD,WAAO;AAAA;AAET,QAAM,SAAS,kDAAmB,WAAW;AAC7C,QAAM,YAAY,4CAAgB;AAKlC,SAAO;AAAA;AAxBO;",
6
6
  "names": []
7
7
  }
@@ -5,4 +5,7 @@
5
5
  right: 0;
6
6
  bottom: 0;
7
7
  }
8
+ .reset-appearance {
9
+ -webkit-appearance: none;
10
+ }
8
11
  /*# sourceMappingURL=tamagui-base.css.map */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tamagui-base.css"],
4
- "sourcesContent": [".tamagui-absolute-fill {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n"],
5
- "mappings": "AAAA;AACE;AACA;AACA;AACA;AACA;AAAA;",
4
+ "sourcesContent": [".tamagui-absolute-fill {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.reset-appearance {\n -webkit-appearance: none;\n}\n"],
5
+ "mappings": "AAAA;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;",
6
6
  "names": []
7
7
  }
@@ -188,7 +188,7 @@ function createComponent(configIn) {
188
188
  const className = concatClassName(...classList);
189
189
  if (process.env.NODE_ENV === "development") {
190
190
  if (props["debug"]) {
191
- console.log("\u{1F95A} className", { style, styles, classList, stylesClassNames, className: className.trim().split(" ") });
191
+ console.log("\xBB className", { style, styles, classList, stylesClassNames, className: className.trim().split(" ") });
192
192
  }
193
193
  }
194
194
  viewProps.className = className;
@@ -329,11 +329,11 @@ function createComponent(configIn) {
329
329
  if (process.env.NODE_ENV === "development") {
330
330
  if (props["debug"]) {
331
331
  viewProps["debug"] = true;
332
- console.log("\u{1F95A} props in:", props);
333
- console.log("\u{1F95A} props out:", viewProps, (_a = viewProps.className) == null ? void 0 : _a.split(" "));
334
- console.log("\u{1F95A} etc:", { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls });
332
+ console.log("\xBB props in:", props);
333
+ console.log("\xBB props out:", viewProps, (_a = viewProps.className) == null ? void 0 : _a.split(" "));
334
+ console.log("\xBB etc:", { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls });
335
335
  if (typeof window !== "undefined") {
336
- console.log("\u{1F95A} component info", { staticConfig, tamaguiConfig });
336
+ console.log("\xBB component info", { staticConfig, tamaguiConfig });
337
337
  }
338
338
  }
339
339
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createComponent.tsx"],
4
- "sourcesContent": ["import './tamagui-base.css'\n\nimport { concatClassName, stylePropsView } from '@tamagui/helpers'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n createElement,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react'\nimport { StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isTouchDevice, isWeb } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { addStylesUsingClassname, useStylesAsClassname } from './helpers/addStylesUsingClassname'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport { getSplitStyles } from './helpers/getSplitStyles'\nimport { useFeatures } from './hooks/useFeatures'\nimport { usePressable } from './hooks/usePressable'\nimport { useTheme } from './hooks/useTheme'\nimport {\n SpaceTokens,\n StaticComponent,\n StaticConfig,\n StaticConfigParsed,\n TamaguiInternalConfig,\n} from './types'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nexport const mouseUps = new Set<Function>()\n\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\ntype DefaultProps = {}\n\nconst defaultComponentState = {\n hover: false,\n press: false,\n pressIn: false,\n}\n\ntype ComponentState = typeof defaultComponentState\n\nfunction createShallowUpdate(setter: React.Dispatch<React.SetStateAction<ComponentState>>) {\n return (next: Partial<ComponentState>) => {\n setter((prev) => {\n for (const key in next) {\n if (prev[key] !== next[key]) {\n return { ...prev, ...next }\n }\n }\n return prev\n })\n }\n}\n\nexport function createComponent<ComponentPropTypes extends Object = DefaultProps>(\n configIn: Partial<StaticConfig> | StaticConfigParsed\n) {\n let staticConfig: StaticConfigParsed\n if ('parsed' in configIn) {\n staticConfig = configIn\n } else {\n staticConfig = parseStaticConfig(configIn)\n }\n\n const { Component, validStyles, isText, isZStack } = staticConfig\n const validStyleProps = validStyles ?? stylePropsView\n\n // split out default styles vs props so we can assign it to component.defaultProps\n let defaultProps = null as any\n let tamaguiConfig: TamaguiInternalConfig\n\n // web uses className, native uses style\n let defaultNativeStyle: StyleSheet.NamedStyles<{ base: {} }> | null = null\n let defaultsClassName = ''\n let initialTheme: any\n\n // see onConfiguredOnce below which attaches a name then to this component\n\n const component = forwardRef<View, ComponentPropTypes>((props: any, forwardedRef) => {\n const forceUpdate = useForceUpdate()\n const features = useFeatures(props, { forceUpdate })\n const theme = useTheme()\n const [state, set_] = useState<ComponentState>(defaultComponentState)\n const set = createShallowUpdate(set_)\n\n // from react-native-web\n if (process.env.NODE_ENV === 'development' && !isText && isWeb) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\n const hostRef = useRef(null)\n\n const {\n viewProps: viewPropsIn,\n pseudos,\n style,\n classNames,\n } = getSplitStyles(props, staticConfig, theme)\n\n const {\n tag,\n hitSlop,\n children,\n pointerEvents,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space,\n disabled,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\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 onMouseDown,\n onClick,\n\n accessible,\n accessibilityRole,\n\n // TODO feature load layout hook\n onLayout,\n ...viewProps\n } = viewPropsIn\n\n if (!isWeb) {\n if (accessible) viewProps.accessible = accessible\n if (accessibilityRole) viewProps.accessibilityRole = accessibilityRole\n }\n\n if (isWeb) {\n // from react-native-web\n rnw.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 })\n }\n\n // hasEverHadEvents prevents repareting if you remove onPress or similar...\n const internal = useRef<{ isMounted: boolean; hasEverHadEvents?: boolean }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n\n useEffect(() => {\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n }\n }, [])\n\n // element\n const isInternalComponent = !Component || typeof Component === 'string'\n // default to tag, fallback to component (when both strings)\n const element = isWeb ? (isInternalComponent ? tag || Component : Component) : Component\n const ReactView = !isWeb ? View : element || (hasTextAncestor ? 'span' : 'div')\n const ReactText = !isWeb ? Text : element || 'span'\n const ViewComponent = isText ? ReactText : ReactView\n\n // styles\n const isHovering = !isTouchDevice && !disabled && pseudos && state.hover\n const isPressing = !disabled && pseudos && state.press\n\n const styles = [\n defaultNativeStyle ? defaultNativeStyle.base : null,\n // parity w react-native-web, only for text in text\n // TODO this should be able to be done w css to replicate after extraction:\n // (.text .text { display: inline-flex; }) (but if they set display we'd need stronger precendence)\n // isText && hasTextAncestor && isWeb ? { display: 'inline-flex' } : null,\n style,\n isHovering ? pseudos.hoverStyle || null : null,\n isPressing ? pseudos.pressStyle || null : null,\n ]\n\n if (isWeb) {\n const stylesClassNames = useStylesAsClassname(styles)\n const classList = isText\n ? [\n defaultsClassName,\n // hasTextAncestor === true && cssText.textHasAncestor,\n // TODO MOVE TO VARIANTS [number] [any]\n // numberOfLines != null && numberOfLines > 1 && cssText.textMultiLine,\n classNames,\n stylesClassNames,\n props.className,\n ]\n : [defaultsClassName, props.className, classNames, stylesClassNames]\n\n // @ts-ignore we are optimizing using arguments\n const className = concatClassName(...classList)\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\uD83E\uDD5A className', { style, styles, classList, stylesClassNames, className: className.trim().split(' ') })\n }\n }\n viewProps.className = className\n } else {\n viewProps.style = styles\n }\n\n if (pointerEvents) {\n viewProps.pointerEvents = pointerEvents\n }\n\n if (isWeb) {\n // from react-native-web\n const platformMethodsRef = rnw.usePlatformMethods(viewProps)\n const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef)\n viewProps.ref = setRef\n if (props.href != null && hrefAttrs != null) {\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 } else {\n if (forwardedRef) {\n viewProps.ref = forwardedRef\n }\n }\n\n const attachPress = !!(\n (pseudos && pseudos.pressStyle) ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n const attachHover =\n isWeb &&\n !isTouchDevice &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n // while avoiding reparenting...\n // once proper reparenting is supported, we can remove this and use that...\n const shouldAttach =\n internal.current.hasEverHadEvents ||\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 'onClick' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props))\n\n // never remove events as we wrap in a div (for now, may be able to remove..)\n if (shouldAttach) {\n internal.current.hasEverHadEvents = true\n }\n\n const unPress = useCallback(() => {\n if (!internal.current!.isMounted) return\n set({\n press: false,\n pressIn: false,\n })\n }, [])\n\n const events = shouldAttach\n ? {\n ...(!isWeb && {\n // non web\n onPressOut: (e) => {\n unPress()\n onPressOut?.(e)\n },\n }),\n ...(isWeb &&\n !isTouchDevice && {\n onMouseEnter:\n attachHover || attachPress\n ? (e) => {\n let next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (Object.keys(next).length) {\n set(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave:\n attachHover || attachPress\n ? (e) => {\n let 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 set(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n onMouseDown: attachPress\n ? (e) => {\n set({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n }\n : (onPressIn as any),\n onClick: attachPress\n ? (e) => {\n // this caused issue with next.js passing href\n // e.preventDefault()\n onPress?.(e)\n onClick?.(e)\n unPress()\n onPressOut?.(e)\n }\n : (onPressOut as any),\n }\n : null\n\n if (events) {\n if (typeof ViewComponent !== 'string') {\n // TODO once we do the above we can then rely entirely on pressStyle returned here isntead of above pressStyle logic\n const [pressProps] = usePressable({\n disabled,\n hitSlop,\n onPressIn: events.onMouseDown,\n onPressOut: events.onPressOut,\n onPress: events.onClick,\n })\n Object.assign(viewProps, pressProps)\n } else {\n Object.assign(viewProps, events)\n }\n }\n\n const childEls = spacedChildren({\n children,\n space,\n flexDirection: props.flexDirection || defaultProps?.flexDirection,\n isZStack: isZStack,\n })\n\n let content: any\n\n // replicate react-native-web's `createElement`\n if (isWeb && rnw) {\n const domProps = rnw.createDOMProps(viewProps)\n const className =\n domProps.className && domProps.className !== viewProps.className\n ? `${domProps.className} ${viewProps.className}`\n : viewProps.className\n Object.assign(viewProps, domProps)\n\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = viewProps.dataSet || {}\n Object.assign(viewProps.dataSet, { __className: className })\n } else {\n // we already handle Text/View properly\n viewProps.className = className\n }\n\n content = createElement(ViewComponent, viewProps, childEls)\n } else {\n content = createElement(ViewComponent, viewProps, childEls)\n }\n\n const shouldWrapTextAncestor = isWeb && isText && !hasTextAncestor\n if (shouldWrapTextAncestor) {\n // from react-native-web\n content = createElement(TextAncestorContext.Provider, { value: true }, content)\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n viewProps['debug'] = true\n console.log('\uD83E\uDD5A props in:', props)\n console.log('\uD83E\uDD5A props out:', viewProps, viewProps.className?.split(' '))\n // prettier-ignore\n console.log('\uD83E\uDD5A etc:', { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls })\n // only on browser because node expands it huge\n if (typeof window !== 'undefined') {\n console.log('\uD83E\uDD5A component info', { staticConfig, tamaguiConfig })\n }\n }\n }\n\n if (features.length) {\n return (\n <>\n {features}\n {content}\n </>\n )\n }\n\n return content\n })\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n const shouldDebug = staticConfig.defaultProps?.debug\n tamaguiConfig = conf\n initialTheme = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]\n const { classNames, pseudos, style, viewProps } = getSplitStyles(\n staticConfig.defaultProps,\n staticConfig,\n initialTheme\n )\n if (isWeb) {\n if (classNames) {\n defaultsClassName += classNames + ' '\n }\n defaultsClassName += addStylesUsingClassname([style, pseudos])\n if (process.env.NODE_ENV === 'development' && shouldDebug) {\n // prettier-ignore\n console.log('tamagui \uD83D\uDC1B:', { defaultsClassName: defaultsClassName.split(' ') })\n }\n } else {\n // native, create a default StyleSheet\n // TODO handle pseudos\n const sheetStyles = {}\n for (const styleObj of style) {\n Object.assign(sheetStyles, styleObj)\n }\n defaultNativeStyle = StyleSheet.create({\n base: sheetStyles,\n })\n }\n // @ts-ignore\n component.defaultProps = {\n ...viewProps,\n ...component.defaultProps,\n }\n if (process.env.NODE_ENV === 'development' && shouldDebug) {\n // prettier-ignore\n console.log('tamagui \uD83D\uDC1B:', { initialTheme, classNames, pseudos, style, viewProps, defaultsClassName, component })\n }\n })\n\n component['staticConfig'] = {\n validStyles: validStyleProps,\n ...staticConfig,\n }\n\n const res = component as any as StaticComponent<ComponentPropTypes, void>\n\n // add extractable HoC\n res['extractable'] = (Component: any, conf?: StaticConfig) => {\n Component['staticConfig'] = extendStaticConfig(res, {\n ...conf,\n neverFlatten: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n })\n return Component\n }\n\n return res\n}\n\nlet hasWarnedOnce = false\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<{ size?: number | SpaceTokens; flex?: boolean | number }>({\n defaultProps: {\n ...stackDefaultStyles,\n size: true,\n },\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n return {\n width: tokens.size[size] ?? size,\n height: tokens.size[size] ?? size,\n }\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n },\n vertical: {\n width: 0,\n },\n },\n },\n})\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n flexDirection,\n}: {\n isZStack?: boolean\n children: any\n space?: any\n flexDirection?: ViewStyle['flexDirection']\n}) {\n if (!space && !isZStack) {\n return children\n }\n const childrenList = Children.toArray(children)\n const len = childrenList.length\n if (len === 1) {\n return children\n }\n const next: any[] = []\n for (const [index, child] of childrenList.entries()) {\n if (child === null || child === undefined) {\n continue\n }\n\n const key = `${child?.['key'] ?? index}`\n\n next.push(\n <Fragment key={key}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n\n // allows for custom visually hidden components that dont insert spacing\n if (child?.['type']?.['isVisuallyHidden']) {\n continue\n }\n\n if (index !== len - 1) {\n if (space) {\n next.push(\n <Spacer\n key={`${key}_spacer`}\n // @ts-ignore TODO\n direction={\n flexDirection === 'row' || flexDirection === 'row-reverse' ? 'horizontal' : 'vertical'\n }\n size={space}\n />\n )\n }\n }\n }\n return next\n}\n\nexport const AbsoluteFill = (props: any) =>\n isWeb ? (\n <div className=\"tamagui-absolute-fill\">{props.children}</div>\n ) : (\n <View style={StyleSheet.absoluteFill}>{props.child}</View>\n )\n"],
5
- "mappings": ";;AAAA;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AAEO,MAAM,WAAW,oBAAI;AAE5B,IAAI,OAAO,aAAa,aAAa;AACnC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AO,WAAW;AAAA,GAAe,MAAM,QAJrB;",
4
+ "sourcesContent": ["import './tamagui-base.css'\n\nimport { concatClassName, stylePropsView } from '@tamagui/helpers'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n createElement,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react'\nimport { StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isTouchDevice, isWeb } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { addStylesUsingClassname, useStylesAsClassname } from './helpers/addStylesUsingClassname'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport { getSplitStyles } from './helpers/getSplitStyles'\nimport { useFeatures } from './hooks/useFeatures'\nimport { usePressable } from './hooks/usePressable'\nimport { useTheme } from './hooks/useTheme'\nimport {\n SpaceTokens,\n StaticComponent,\n StaticConfig,\n StaticConfigParsed,\n TamaguiInternalConfig,\n} from './types'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nexport const mouseUps = new Set<Function>()\n\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\ntype DefaultProps = {}\n\nconst defaultComponentState = {\n hover: false,\n press: false,\n pressIn: false,\n}\n\ntype ComponentState = typeof defaultComponentState\n\nfunction createShallowUpdate(setter: React.Dispatch<React.SetStateAction<ComponentState>>) {\n return (next: Partial<ComponentState>) => {\n setter((prev) => {\n for (const key in next) {\n if (prev[key] !== next[key]) {\n return { ...prev, ...next }\n }\n }\n return prev\n })\n }\n}\n\nexport function createComponent<ComponentPropTypes extends Object = DefaultProps>(\n configIn: Partial<StaticConfig> | StaticConfigParsed\n) {\n let staticConfig: StaticConfigParsed\n if ('parsed' in configIn) {\n staticConfig = configIn\n } else {\n staticConfig = parseStaticConfig(configIn)\n }\n\n const { Component, validStyles, isText, isZStack } = staticConfig\n const validStyleProps = validStyles ?? stylePropsView\n\n // split out default styles vs props so we can assign it to component.defaultProps\n let defaultProps = null as any\n let tamaguiConfig: TamaguiInternalConfig\n\n // web uses className, native uses style\n let defaultNativeStyle: StyleSheet.NamedStyles<{ base: {} }> | null = null\n let defaultsClassName = ''\n let initialTheme: any\n\n // see onConfiguredOnce below which attaches a name then to this component\n\n const component = forwardRef<View, ComponentPropTypes>((props: any, forwardedRef) => {\n const forceUpdate = useForceUpdate()\n const features = useFeatures(props, { forceUpdate })\n const theme = useTheme()\n const [state, set_] = useState<ComponentState>(defaultComponentState)\n const set = createShallowUpdate(set_)\n\n // from react-native-web\n if (process.env.NODE_ENV === 'development' && !isText && isWeb) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\n const hostRef = useRef(null)\n\n const {\n viewProps: viewPropsIn,\n pseudos,\n style,\n classNames,\n } = getSplitStyles(props, staticConfig, theme)\n\n const {\n tag,\n hitSlop,\n children,\n pointerEvents,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space,\n disabled,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\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 onMouseDown,\n onClick,\n\n accessible,\n accessibilityRole,\n\n // TODO feature load layout hook\n onLayout,\n ...viewProps\n } = viewPropsIn\n\n if (!isWeb) {\n if (accessible) viewProps.accessible = accessible\n if (accessibilityRole) viewProps.accessibilityRole = accessibilityRole\n }\n\n if (isWeb) {\n // from react-native-web\n rnw.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 })\n }\n\n // hasEverHadEvents prevents repareting if you remove onPress or similar...\n const internal = useRef<{ isMounted: boolean; hasEverHadEvents?: boolean }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n\n useEffect(() => {\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n }\n }, [])\n\n // element\n const isInternalComponent = !Component || typeof Component === 'string'\n // default to tag, fallback to component (when both strings)\n const element = isWeb ? (isInternalComponent ? tag || Component : Component) : Component\n const ReactView = !isWeb ? View : element || (hasTextAncestor ? 'span' : 'div')\n const ReactText = !isWeb ? Text : element || 'span'\n const ViewComponent = isText ? ReactText : ReactView\n\n // styles\n const isHovering = !isTouchDevice && !disabled && pseudos && state.hover\n const isPressing = !disabled && pseudos && state.press\n\n const styles = [\n defaultNativeStyle ? defaultNativeStyle.base : null,\n // parity w react-native-web, only for text in text\n // TODO this should be able to be done w css to replicate after extraction:\n // (.text .text { display: inline-flex; }) (but if they set display we'd need stronger precendence)\n // isText && hasTextAncestor && isWeb ? { display: 'inline-flex' } : null,\n style,\n isHovering ? pseudos.hoverStyle || null : null,\n isPressing ? pseudos.pressStyle || null : null,\n ]\n\n if (isWeb) {\n const stylesClassNames = useStylesAsClassname(styles)\n const classList = isText\n ? [\n defaultsClassName,\n // hasTextAncestor === true && cssText.textHasAncestor,\n // TODO MOVE TO VARIANTS [number] [any]\n // numberOfLines != null && numberOfLines > 1 && cssText.textMultiLine,\n classNames,\n stylesClassNames,\n props.className,\n ]\n : [defaultsClassName, props.className, classNames, stylesClassNames]\n\n // @ts-ignore we are optimizing using arguments\n const className = concatClassName(...classList)\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u00BB className', { style, styles, classList, stylesClassNames, className: className.trim().split(' ') })\n }\n }\n viewProps.className = className\n } else {\n viewProps.style = styles\n }\n\n if (pointerEvents) {\n viewProps.pointerEvents = pointerEvents\n }\n\n if (isWeb) {\n // from react-native-web\n const platformMethodsRef = rnw.usePlatformMethods(viewProps)\n const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef)\n viewProps.ref = setRef\n if (props.href != null && hrefAttrs != null) {\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 } else {\n if (forwardedRef) {\n viewProps.ref = forwardedRef\n }\n }\n\n const attachPress = !!(\n (pseudos && pseudos.pressStyle) ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n const attachHover =\n isWeb &&\n !isTouchDevice &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n // while avoiding reparenting...\n // once proper reparenting is supported, we can remove this and use that...\n const shouldAttach =\n internal.current.hasEverHadEvents ||\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 'onClick' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props))\n\n // never remove events as we wrap in a div (for now, may be able to remove..)\n if (shouldAttach) {\n internal.current.hasEverHadEvents = true\n }\n\n const unPress = useCallback(() => {\n if (!internal.current!.isMounted) return\n set({\n press: false,\n pressIn: false,\n })\n }, [])\n\n const events = shouldAttach\n ? {\n ...(!isWeb && {\n // non web\n onPressOut: (e) => {\n unPress()\n onPressOut?.(e)\n },\n }),\n ...(isWeb &&\n !isTouchDevice && {\n onMouseEnter:\n attachHover || attachPress\n ? (e) => {\n let next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (Object.keys(next).length) {\n set(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave:\n attachHover || attachPress\n ? (e) => {\n let 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 set(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n onMouseDown: attachPress\n ? (e) => {\n set({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n }\n : (onPressIn as any),\n onClick: attachPress\n ? (e) => {\n // this caused issue with next.js passing href\n // e.preventDefault()\n onPress?.(e)\n onClick?.(e)\n unPress()\n onPressOut?.(e)\n }\n : (onPressOut as any),\n }\n : null\n\n if (events) {\n if (typeof ViewComponent !== 'string') {\n // TODO once we do the above we can then rely entirely on pressStyle returned here isntead of above pressStyle logic\n const [pressProps] = usePressable({\n disabled,\n hitSlop,\n onPressIn: events.onMouseDown,\n onPressOut: events.onPressOut,\n onPress: events.onClick,\n })\n Object.assign(viewProps, pressProps)\n } else {\n Object.assign(viewProps, events)\n }\n }\n\n const childEls = spacedChildren({\n children,\n space,\n flexDirection: props.flexDirection || defaultProps?.flexDirection,\n isZStack: isZStack,\n })\n\n let content: any\n\n // replicate react-native-web's `createElement`\n if (isWeb && rnw) {\n const domProps = rnw.createDOMProps(viewProps)\n const className =\n domProps.className && domProps.className !== viewProps.className\n ? `${domProps.className} ${viewProps.className}`\n : viewProps.className\n Object.assign(viewProps, domProps)\n\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = viewProps.dataSet || {}\n Object.assign(viewProps.dataSet, { __className: className })\n } else {\n // we already handle Text/View properly\n viewProps.className = className\n }\n\n content = createElement(ViewComponent, viewProps, childEls)\n } else {\n content = createElement(ViewComponent, viewProps, childEls)\n }\n\n const shouldWrapTextAncestor = isWeb && isText && !hasTextAncestor\n if (shouldWrapTextAncestor) {\n // from react-native-web\n content = createElement(TextAncestorContext.Provider, { value: true }, content)\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n viewProps['debug'] = true\n console.log('\u00BB props in:', props)\n console.log('\u00BB props out:', viewProps, viewProps.className?.split(' '))\n // prettier-ignore\n console.log('\u00BB etc:', { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls })\n // only on browser because node expands it huge\n if (typeof window !== 'undefined') {\n console.log('\u00BB component info', { staticConfig, tamaguiConfig })\n }\n }\n }\n\n if (features.length) {\n return (\n <>\n {features}\n {content}\n </>\n )\n }\n\n return content\n })\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n const shouldDebug = staticConfig.defaultProps?.debug\n tamaguiConfig = conf\n initialTheme = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]\n const { classNames, pseudos, style, viewProps } = getSplitStyles(\n staticConfig.defaultProps,\n staticConfig,\n initialTheme\n )\n if (isWeb) {\n if (classNames) {\n defaultsClassName += classNames + ' '\n }\n defaultsClassName += addStylesUsingClassname([style, pseudos])\n if (process.env.NODE_ENV === 'development' && shouldDebug) {\n // prettier-ignore\n console.log('tamagui \uD83D\uDC1B:', { defaultsClassName: defaultsClassName.split(' ') })\n }\n } else {\n // native, create a default StyleSheet\n // TODO handle pseudos\n const sheetStyles = {}\n for (const styleObj of style) {\n Object.assign(sheetStyles, styleObj)\n }\n defaultNativeStyle = StyleSheet.create({\n base: sheetStyles,\n })\n }\n // @ts-ignore\n component.defaultProps = {\n ...viewProps,\n ...component.defaultProps,\n }\n if (process.env.NODE_ENV === 'development' && shouldDebug) {\n // prettier-ignore\n console.log('tamagui \uD83D\uDC1B:', { initialTheme, classNames, pseudos, style, viewProps, defaultsClassName, component })\n }\n })\n\n component['staticConfig'] = {\n validStyles: validStyleProps,\n ...staticConfig,\n }\n\n const res = component as any as StaticComponent<ComponentPropTypes, void>\n\n // add extractable HoC\n res['extractable'] = (Component: any, conf?: StaticConfig) => {\n Component['staticConfig'] = extendStaticConfig(res, {\n ...conf,\n neverFlatten: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n })\n return Component\n }\n\n return res\n}\n\nlet hasWarnedOnce = false\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<{ size?: number | SpaceTokens; flex?: boolean | number }>({\n defaultProps: {\n ...stackDefaultStyles,\n size: true,\n },\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n return {\n width: tokens.size[size] ?? size,\n height: tokens.size[size] ?? size,\n }\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n },\n vertical: {\n width: 0,\n },\n },\n },\n})\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n flexDirection,\n}: {\n isZStack?: boolean\n children: any\n space?: any\n flexDirection?: ViewStyle['flexDirection']\n}) {\n if (!space && !isZStack) {\n return children\n }\n const childrenList = Children.toArray(children)\n const len = childrenList.length\n if (len === 1) {\n return children\n }\n const next: any[] = []\n for (const [index, child] of childrenList.entries()) {\n if (child === null || child === undefined) {\n continue\n }\n\n const key = `${child?.['key'] ?? index}`\n\n next.push(\n <Fragment key={key}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n\n // allows for custom visually hidden components that dont insert spacing\n if (child?.['type']?.['isVisuallyHidden']) {\n continue\n }\n\n if (index !== len - 1) {\n if (space) {\n next.push(\n <Spacer\n key={`${key}_spacer`}\n // @ts-ignore TODO\n direction={\n flexDirection === 'row' || flexDirection === 'row-reverse' ? 'horizontal' : 'vertical'\n }\n size={space}\n />\n )\n }\n }\n }\n return next\n}\n\nexport const AbsoluteFill = (props: any) =>\n isWeb ? (\n <div className=\"tamagui-absolute-fill\">{props.children}</div>\n ) : (\n <View style={StyleSheet.absoluteFill}>{props.child}</View>\n )\n"],
5
+ "mappings": ";;AAAA;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AAEO,MAAM,WAAW,oBAAI;AAE5B,IAAI,OAAO,aAAa,aAAa;AACnC,WAAS,iBAAiB,WAAW,MAAM;AACzC,aAAS,QAAQ,CAAC,MAAM;AACxB,aAAS;AAAA;AAAA;AAMb,MAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA;AAKX,6BAA6B,QAA8D;AACzF,SAAO,CAAC,SAAkC;AACxC,WAAO,CAAC,SAAS;AACf,iBAAW,OAAO,MAAM;AACtB,YAAI,KAAK,SAAS,KAAK,MAAM;AAC3B,iBAAO,KAAK,SAAS;AAAA;AAAA;AAGzB,aAAO;AAAA;AAAA;AAAA;AARJ;AAaF,yBACL,UACA;AACA,MAAI;AACJ,MAAI,YAAY,UAAU;AACxB,mBAAe;AAAA,SACV;AACL,mBAAe,kBAAkB;AAAA;AAGnC,QAAM,EAAE,WAAW,aAAa,QAAQ,aAAa;AACrD,QAAM,kBAAkB,oCAAe;AAGvC,MAAI,eAAe;AACnB,MAAI;AAGJ,MAAI,qBAAkE;AACtE,MAAI,oBAAoB;AACxB,MAAI;AAIJ,QAAM,YAAY,WAAqC,CAAC,OAAY,iBAAiB;AA5FvF;AA6FI,UAAM,cAAc;AACpB,UAAM,WAAW,YAAY,OAAO,EAAE;AACtC,UAAM,QAAQ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AC,UAAD;AAAA,MAAU;AAAA,OAAW,WAAW,oCAAC,cAAD,MAAe,SAAwB;AAIzE,QAAI,qCAAQ,YAAR,mBAAkB,qBAAqB;AACzC;AAAA;AAGF,QAAI,UAAU,MAAM,GAAG;AACrB,UAAI,OAAO;AACT,aAAK,KACH,oCAAC,QAAD;AAAA,UACE,KAAK,GAAG;AAAA,UAER,WACE,kBAAkB,SAAS,kBAAkB,gBAAgB,eAAe;AAAA,UAE9E,MAAM;AAAA;AAAA;AAAA;AAAA;AAMhB,SAAO;AAAA;AAnDO;AAsDT,MAAM,eAAe,wBAAC,UAC3B,QACE,oCAAC,OAAD;AAAA,EAAK,WAAU;AAAA,GAAyB,MAAM,YAE9C,oCAAC,MAAD;AAAA,EAAM,OAAO,WAAW;AAAA,GAAe,MAAM,QAJrB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/extendStaticConfig.ts"],
4
- "sourcesContent": ["import React from 'react'\n\nimport { StaticComponent, StaticConfig, StaticConfigParsed } from '../types'\nimport { createPropMapper } from './createPropMapper'\n\nexport function extendStaticConfig(\n // can be undefined when loading with @tamagui/fake-react-native\n // could be fixed a bit cleaner\n Component?: StaticComponent | React.Component<any>,\n config: StaticConfig = {}\n): StaticConfigParsed | null {\n const parent = (Component || {}) as any\n if (!parent.staticConfig) {\n // if no static config, we are extending an external component\n parent.staticConfig = {\n Component,\n }\n }\n\n const variants = {\n ...parent.staticConfig.variants,\n }\n\n // merge variants without clobbering previous... can we tho (typed??\n if (config.variants) {\n for (const key in config.variants) {\n if (variants[key]) {\n variants[key] = {\n ...variants[key],\n ...config.variants[key],\n }\n } else {\n variants[key] = config.variants[key]\n }\n }\n }\n\n return parseStaticConfig({\n ...parent.staticConfig,\n ...config,\n isZStack: config.isZStack || parent.staticConfig.isZStack,\n variants,\n isText: config.isText || parent.staticConfig.isText || false,\n neverFlatten: config.neverFlatten ?? parent.staticConfig.neverFlatten,\n ensureOverriddenProp: config.ensureOverriddenProp ?? parent.staticConfig.ensureOverriddenProp,\n validStyles: config.validStyles\n ? {\n ...parent.staticConfig.validStyles,\n ...config.validStyles,\n }\n : parent.staticConfig.validStyles,\n validPropsExtra: {\n ...parent.staticConfig.validPropsExtra,\n ...config.validPropsExtra,\n },\n defaultProps: {\n ...parent.staticConfig.defaultProps,\n ...config.defaultProps,\n },\n })\n}\n\nexport const parseStaticConfig = (config: StaticConfig): StaticConfigParsed => {\n return {\n ...config,\n parsed: true,\n propMapper: createPropMapper(config),\n }\n}\n"],
4
+ "sourcesContent": ["import React from 'react'\n\nimport { StaticComponent, StaticConfig, StaticConfigParsed } from '../types'\nimport { createPropMapper } from './createPropMapper'\n\nexport function extendStaticConfig(\n // can be undefined when loading with @tamagui/fake-react-native\n // could be fixed a bit cleaner\n Component?: StaticComponent | React.Component<any> | ((props: any) => any),\n config: StaticConfig = {}\n): StaticConfigParsed | null {\n const parent = (Component || {}) as any\n if (!parent.staticConfig) {\n // if no static config, we are extending an external component\n parent.staticConfig = {\n Component,\n }\n }\n\n const variants = {\n ...parent.staticConfig.variants,\n }\n\n // merge variants without clobbering previous... can we tho (typed??\n if (config.variants) {\n for (const key in config.variants) {\n if (variants[key]) {\n variants[key] = {\n ...variants[key],\n ...config.variants[key],\n }\n } else {\n variants[key] = config.variants[key]\n }\n }\n }\n\n return parseStaticConfig({\n ...parent.staticConfig,\n ...config,\n isZStack: config.isZStack || parent.staticConfig.isZStack,\n variants,\n isText: config.isText || parent.staticConfig.isText || false,\n neverFlatten: config.neverFlatten ?? parent.staticConfig.neverFlatten,\n ensureOverriddenProp: config.ensureOverriddenProp ?? parent.staticConfig.ensureOverriddenProp,\n validStyles: config.validStyles\n ? {\n ...parent.staticConfig.validStyles,\n ...config.validStyles,\n }\n : parent.staticConfig.validStyles,\n validPropsExtra: {\n ...parent.staticConfig.validPropsExtra,\n ...config.validPropsExtra,\n },\n defaultProps: {\n ...parent.staticConfig.defaultProps,\n ...config.defaultProps,\n },\n })\n}\n\nexport const parseStaticConfig = (config: StaticConfig): StaticConfigParsed => {\n return {\n ...config,\n parsed: true,\n propMapper: createPropMapper(config),\n }\n}\n"],
5
5
  "mappings": ";;AAGA;AAEO,4BAGL,WACA,SAAuB,IACI;AAV7B;AAWE,QAAM,SAAU,aAAa;AAC7B,MAAI,CAAC,OAAO,cAAc;AAExB,WAAO,eAAe;AAAA,MACpB;AAAA;AAAA;AAIJ,QAAM,WAAW;AAAA,OACZ,OAAO,aAAa;AAAA;AAIzB,MAAI,OAAO,UAAU;AACnB,eAAW,OAAO,OAAO,UAAU;AACjC,UAAI,SAAS,MAAM;AACjB,iBAAS,OAAO;AAAA,aACX,SAAS;AAAA,aACT,OAAO,SAAS;AAAA;AAAA,aAEhB;AACL,iBAAS,OAAO,OAAO,SAAS;AAAA;AAAA;AAAA;AAKtC,SAAO,kBAAkB;AAAA,OACpB,OAAO;AAAA,OACP;AAAA,IACH,UAAU,OAAO,YAAY,OAAO,aAAa;AAAA,IACjD;AAAA,IACA,QAAQ,OAAO,UAAU,OAAO,aAAa,UAAU;AAAA,IACvD,cAAc,aAAO,iBAAP,YAAuB,OAAO,aAAa;AAAA,IACzD,sBAAsB,aAAO,yBAAP,YAA+B,OAAO,aAAa;AAAA,IACzE,aAAa,OAAO,cAChB;AAAA,SACK,OAAO,aAAa;AAAA,SACpB,OAAO;AAAA,QAEZ,OAAO,aAAa;AAAA,IACxB,iBAAiB;AAAA,SACZ,OAAO,aAAa;AAAA,SACpB,OAAO;AAAA;AAAA,IAEZ,cAAc;AAAA,SACT,OAAO,aAAa;AAAA,SACpB,OAAO;AAAA;AAAA;AAAA;AApDA;AAyDT,MAAM,oBAAoB,wBAAC,WAA6C;AAC7E,SAAO;AAAA,OACF;AAAA,IACH,QAAQ;AAAA,IACR,YAAY,iBAAiB;AAAA;AAAA,GAJA;",
6
6
  "names": []
7
7
  }
@@ -108,7 +108,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme) => {
108
108
  }
109
109
  if (process.env.NODE_ENV === "development") {
110
110
  if (props["debug"]) {
111
- console.log(" \u{1F95A} splitProps:", { props, viewProps, style });
111
+ console.log(" splitProps:", { props, viewProps, style });
112
112
  }
113
113
  }
114
114
  return {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/getSplitStyles.tsx"],
4
- "sourcesContent": ["import {\n AllRules,\n stylePropsText,\n stylePropsTransform,\n validStyles,\n validStylesPseudo,\n} from '@tamagui/helpers'\nimport { ViewStyle } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport { StaticConfigParsed, ThemeObject } from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { getStylesAtomic } from './getStylesAtomic'\nimport { insertStyleRule } from './insertStyleRule'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\n\n// TODO run over this, should be able to cut it down quite a bit\n\nexport const getSplitStyles = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject\n) => {\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: Record<string, any> = {}\n const style: any[] = []\n\n let pseudos: { hoverStyle?: ViewStyle; pressStyle?: ViewStyle } | null = null\n let cur: ViewStyle | null = null\n let classNames: string[] | null = null\n\n for (const keyInit in props) {\n // be sure to sync next few lines below to getSubStyle (*1)\n const valInit = props[keyInit]\n\n // media\n if (keyInit[0] === '$') {\n const mediaKey = keyInit.slice(1)\n\n if (!mediaQueryConfig[mediaKey]) {\n // this isn't a media key, pass through\n viewProps[keyInit] = valInit\n continue\n }\n\n // dont check if media is active, we just apply *all* media styles\n // we combine the media props on top regular props, could proxy this\n // TODO test proxy here instead of merge\n const mediaProps = { ...props, ...valInit }\n // TODO media + hover\n const mediaStyle = getSubStyle(valInit, staticConfig, theme, props)\n\n if (isWeb) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log('mediaStyles', keyInit, { mediaProps, mediaStyle })\n }\n }\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKey, mediaQueryConfig)\n classNames = classNames || []\n classNames.push(out.identifier)\n AllRules.add(out.styleRule)\n insertStyleRule(out.styleRule)\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n console.log('mediaProp', style.identifier, out.styleRule)\n }\n }\n } else {\n if (mediaState[mediaKey]) {\n style.push(mediaStyle)\n }\n }\n continue\n }\n\n // pseudo\n if (validStylesPseudo[keyInit]) {\n if (!valInit) continue\n pseudos = pseudos || {}\n pseudos[keyInit] = getSubStyle(valInit, staticConfig, theme, props)\n continue\n }\n\n const out = staticConfig.propMapper(keyInit, valInit, theme, props)\n const expanded = out === true || !out ? [[keyInit, valInit]] : Object.entries(out)\n\n for (const [key, val] of expanded) {\n // const val = valueMap(valInit) ?? valInit\n const keyFirstChar = key[0]\n if (key === 'style' || (keyFirstChar === '_' && key.startsWith('_style'))) {\n if (cur) {\n // process last\n fixNativeShadow(cur)\n style.push(cur)\n cur = null\n }\n fixNativeShadow(val)\n style.push(val)\n continue\n }\n // expand flex so it merged with flexShrink etc properly\n // TODO this shouldn't be here...\n if (key === 'flex') {\n cur = cur || {}\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n // TODO this fixed a behavior but need to find / document / test\n Object.assign(cur, {\n flexGrow: val,\n flexShrink: 1,\n })\n continue\n }\n if (!isWeb && key === 'pointerEvents') {\n viewProps[key] = val\n continue\n }\n if (validStyleProps[key]) {\n // transforms\n if (key in stylePropsTransform) {\n cur = cur || {}\n mergeTransform(cur, key, val)\n continue\n }\n cur = cur || {}\n cur[key] = val\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n viewProps[key] = val\n }\n }\n }\n // push last style\n if (cur) {\n fixNativeShadow(cur)\n style.push(cur)\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log(' \uD83E\uDD5A splitProps:', { props, viewProps, style })\n }\n }\n\n return {\n viewProps,\n style,\n pseudos,\n classNames,\n }\n}\n\nconst getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n // be sure to sync next few lines below to loop above (*1)\n const val = styleIn[key]\n const out = staticConfig.propMapper(key, val, theme, props)\n const expanded = out === true || !out ? [[key, val]] : Object.entries(out)\n for (const [skey, sval] of expanded) {\n // const sval = valueMap(valInit)\n if (skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = sval\n }\n }\n }\n fixNativeShadow(styleOut)\n return styleOut\n}\n\nconst mapTransformKeys = {\n x: 'translateX',\n y: 'translateY',\n}\n\nconst mergeTransform = (obj: ViewStyle, key: string, val: any) => {\n const transform: any[] = obj.transform\n ? Array.isArray(obj.transform)\n ? obj.transform\n : [obj.transform]\n : []\n transform.push({ [mapTransformKeys[key] || key]: val })\n obj.transform = transform\n}\n"],
5
- "mappings": ";;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AACA;AAEA;AACA;AACA;AACA;AAMO,MAAM,iBAAiB,wBAC5B,OACA,cACA,UACG;AACH,QAAM,kBAAkB,aAAa,SAAS,iBAAiB;AAC/D,QAAM,YAAiC;AACvC,QAAM,QAAe;AAErB,MAAI,UAAqE;AACzE,MAAI,MAAwB;AAC5B,MAAI,aAA8B;AAElC,aAAW,WAAW,OAAO;AAE3B,UAAM,UAAU,MAAM;AAGtB,QAAI,QAAQ,OAAO,KAAK;AACtB,YAAM,WAAW,QAAQ,MAAM;AAE/B,UAAI,CAAC,iBAAiB,WAAW;AAE/B,kBAAU,WAAW;AACrB;AAAA;AAMF,YAAM,aAAa,KAAK,UAAU;AAElC,YAAM,aAAa,YAAY,SAA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Transform,\n validStyles,\n validStylesPseudo,\n} from '@tamagui/helpers'\nimport { ViewStyle } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { mediaQueryConfig, mediaState } from '../hooks/useMedia'\nimport { StaticConfigParsed, ThemeObject } from '../types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { fixNativeShadow } from './fixNativeShadow'\nimport { getStylesAtomic } from './getStylesAtomic'\nimport { insertStyleRule } from './insertStyleRule'\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\n\n// TODO run over this, should be able to cut it down quite a bit\n\nexport const getSplitStyles = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeObject\n) => {\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: Record<string, any> = {}\n const style: any[] = []\n\n let pseudos: { hoverStyle?: ViewStyle; pressStyle?: ViewStyle } | null = null\n let cur: ViewStyle | null = null\n let classNames: string[] | null = null\n\n for (const keyInit in props) {\n // be sure to sync next few lines below to getSubStyle (*1)\n const valInit = props[keyInit]\n\n // media\n if (keyInit[0] === '$') {\n const mediaKey = keyInit.slice(1)\n\n if (!mediaQueryConfig[mediaKey]) {\n // this isn't a media key, pass through\n viewProps[keyInit] = valInit\n continue\n }\n\n // dont check if media is active, we just apply *all* media styles\n // we combine the media props on top regular props, could proxy this\n // TODO test proxy here instead of merge\n const mediaProps = { ...props, ...valInit }\n // TODO media + hover\n const mediaStyle = getSubStyle(valInit, staticConfig, theme, props)\n\n if (isWeb) {\n const mediaStyles = getStylesAtomic(mediaStyle)\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log('mediaStyles', keyInit, { mediaProps, mediaStyle })\n }\n }\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKey, mediaQueryConfig)\n classNames = classNames || []\n classNames.push(out.identifier)\n AllRules.add(out.styleRule)\n insertStyleRule(out.styleRule)\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n console.log('mediaProp', style.identifier, out.styleRule)\n }\n }\n } else {\n if (mediaState[mediaKey]) {\n style.push(mediaStyle)\n }\n }\n continue\n }\n\n // pseudo\n if (validStylesPseudo[keyInit]) {\n if (!valInit) continue\n pseudos = pseudos || {}\n pseudos[keyInit] = getSubStyle(valInit, staticConfig, theme, props)\n continue\n }\n\n const out = staticConfig.propMapper(keyInit, valInit, theme, props)\n const expanded = out === true || !out ? [[keyInit, valInit]] : Object.entries(out)\n\n for (const [key, val] of expanded) {\n // const val = valueMap(valInit) ?? valInit\n const keyFirstChar = key[0]\n if (key === 'style' || (keyFirstChar === '_' && key.startsWith('_style'))) {\n if (cur) {\n // process last\n fixNativeShadow(cur)\n style.push(cur)\n cur = null\n }\n fixNativeShadow(val)\n style.push(val)\n continue\n }\n // expand flex so it merged with flexShrink etc properly\n // TODO this shouldn't be here...\n if (key === 'flex') {\n cur = cur || {}\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n // TODO this fixed a behavior but need to find / document / test\n Object.assign(cur, {\n flexGrow: val,\n flexShrink: 1,\n })\n continue\n }\n if (!isWeb && key === 'pointerEvents') {\n viewProps[key] = val\n continue\n }\n if (validStyleProps[key]) {\n // transforms\n if (key in stylePropsTransform) {\n cur = cur || {}\n mergeTransform(cur, key, val)\n continue\n }\n cur = cur || {}\n cur[key] = val\n continue\n }\n\n // pass to view props\n if (!staticConfig.variants || !(key in staticConfig.variants)) {\n viewProps[key] = val\n }\n }\n }\n // push last style\n if (cur) {\n fixNativeShadow(cur)\n style.push(cur)\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log(' splitProps:', { props, viewProps, style })\n }\n }\n\n return {\n viewProps,\n style,\n pseudos,\n classNames,\n }\n}\n\nconst getSubStyle = (\n styleIn: Object,\n staticConfig: StaticConfigParsed,\n theme: ThemeObject,\n props: any\n): ViewStyle => {\n const styleOut: ViewStyle = {}\n for (const key in styleIn) {\n // be sure to sync next few lines below to loop above (*1)\n const val = styleIn[key]\n const out = staticConfig.propMapper(key, val, theme, props)\n const expanded = out === true || !out ? [[key, val]] : Object.entries(out)\n for (const [skey, sval] of expanded) {\n // const sval = valueMap(valInit)\n if (skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = sval\n }\n }\n }\n fixNativeShadow(styleOut)\n return styleOut\n}\n\nconst mapTransformKeys = {\n x: 'translateX',\n y: 'translateY',\n}\n\nconst mergeTransform = (obj: ViewStyle, key: string, val: any) => {\n const transform: any[] = obj.transform\n ? Array.isArray(obj.transform)\n ? obj.transform\n : [obj.transform]\n : []\n transform.push({ [mapTransformKeys[key] || key]: val })\n obj.transform = transform\n}\n"],
5
+ "mappings": ";;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AACA;AAEA;AACA;AACA;AACA;AAMO,MAAM,iBAAiB,wBAC5B,OACA,cACA,UACG;AACH,QAAM,kBAAkB,aAAa,SAAS,iBAAiB;AAC/D,QAAM,YAAiC;AACvC,QAAM,QAAe;AAErB,MAAI,UAAqE;AACzE,MAAI,MAAwB;AAC5B,MAAI,aAA8B;AAElC,aAAW,WAAW,OAAO;AAE3B,UAAM,UAAU,MAAM;AAGtB,QAAI,QAAQ,OAAO,KAAK;AACtB,YAAM,WAAW,QAAQ,MAAM;AAE/B,UAAI,CAAC,iBAAiB,WAAW;AAE/B,kBAAU,WAAW;AACrB;AAAA;AAMF,YAAM,aAAa,KAAK,UAAU;AAElC,YAAM,aAAa,YAAY,SAAS,cAAc,OAAO;AAE7D,UAAI,OAAO;AACT,cAAM,cAAc,gBAAgB;AACpC,YAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,cAAI,MAAM,UAAU;AAClB,oBAAQ,IAAI,eAAe,SAAS,EAAE,YAAY;AAAA;AAAA;AAGtD,mBAAW,UAAS,aAAa;AAC/B,gBAAM,OAAM,iBAAiB,QAAO,UAAU;AAC9C,uBAAa,cAAc;AAC3B,qBAAW,KAAK,KAAI;AACpB,mBAAS,IAAI,K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,eAAe;AAC1C,QAAI,MAAM,UAAU;AAClB,cAAQ,IAAI,iBAAiB,EAAE,OAAO,WAAW;AAAA;AAAA;AAIrD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,GAtI0B;AA0I9B,MAAM,cAAc,wBAClB,SACA,cACA,OACA,UACc;AACd,QAAM,WAAsB;AAC5B,aAAW,OAAO,SAAS;AAEzB,UAAM,MAAM,QAAQ;AACpB,UAAM,MAAM,aAAa,WAAW,KAAK,KAAK,OAAO;AACrD,UAAM,WAAW,QAAQ,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,QAAQ,OAAO,QAAQ;AACtE,eAAW,CAAC,MAAM,SAAS,UAAU;AAEnC,UAAI,QAAQ,qBAAqB;AAC/B,uBAAe,UAAU,MAAM;AAAA,aAC1B;AACL,iBAAS,QAAQ;AAAA;AAAA;AAAA;AAIvB,kBAAgB;AAChB,SAAO;AAAA,GAtBW;AAyBpB,MAAM,mBAAmB;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA;AAGL,MAAM,iBAAiB,wBAAC,KAAgB,KAAa,QAAa;AAChE,QAAM,YAAmB,IAAI,YACzB,MAAM,QAAQ,IAAI,aAChB,IAAI,YACJ,CAAC,IAAI,aACP;AACJ,YAAU,KAAK,GAAG,iBAAiB,QAAQ,MAAM;AACjD,MAAI,YAAY;AAAA,GAPK;",
6
6
  "names": []
7
7
  }
@@ -73,7 +73,7 @@ const useTheme = /* @__PURE__ */ __name(() => {
73
73
  const val = activeTheme[key];
74
74
  if (process.env.NODE_ENV === "development") {
75
75
  if (typeof val === "undefined") {
76
- console.warn(`No theme value "${String(key)}" in`, activeTheme, themes);
76
+ console.warn(`No theme value "${String(key)}" in`, activeTheme);
77
77
  return null;
78
78
  }
79
79
  if (!isVariable(val)) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useTheme.tsx"],
4
- "sourcesContent": ["import { useForceUpdate } from '@tamagui/use-force-update'\nimport React, { useContext, useEffect, useMemo, useRef, useState } from 'react'\n\nimport { GET_DEFAULT_THEME } from '../constants/constants'\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\nimport { isVariable } from '../createVariable'\nimport { ThemeName, ThemeObject } from '../types'\nimport { ThemeContext } from '../views/ThemeContext'\nimport { ThemeManagerContext } from '../views/ThemeManagerContext'\n\ntype UseThemeState = {\n uuid: Object\n keys: Set<string>\n isRendering: boolean\n}\n\nconst areEqualSets = (a: Set<string>, b: Set<string>) => {\n if (a.size !== b.size) return false\n for (const val in a) {\n if (!b.has(val)) {\n return false\n }\n }\n return true\n}\n\nexport const useThemeName = (opts?: { parent?: true }) => {\n const parent = useContext(ThemeManagerContext)\n const [name, setName] = useState(parent.name)\n\n useIsomorphicLayoutEffect(() => {\n return parent.onChangeTheme((next, manager) => {\n setName(opts?.parent ? manager.parentName : next)\n })\n }, [parent])\n\n return name || 'light'\n}\n\nexport const useDefaultThemeName = () => {\n return useContext(ThemeContext)[GET_DEFAULT_THEME] as any as ThemeName\n}\n\nexport const useTheme = (): ThemeObject => {\n const forceUpdate = useForceUpdate()\n const manager = useContext(ThemeManagerContext)\n const themes = useContext(ThemeContext) || {}\n\n const state = useRef() as React.MutableRefObject<UseThemeState>\n if (!state.current) {\n state.current = {\n uuid: {},\n keys: new Set(),\n isRendering: true,\n }\n }\n state.current.isRendering = true\n\n // track usage\n useIsomorphicLayoutEffect(() => {\n const st = state.current\n st.isRendering = false\n const cur = manager.keys.get(st.uuid)\n if (!cur || !areEqualSets(st.keys, cur)) {\n manager.track(st.uuid, st.keys)\n }\n })\n\n useEffect(() => {\n return manager.onUpdate(state.current.uuid, forceUpdate)\n }, [])\n\n const theme = (manager.name ? themes[manager.name] : themes.light) ?? themes.light ?? {}\n\n return useMemo(\n () => {\n return new Proxy(theme, {\n get(_, key: string) {\n const name = manager.name\n if (!name) {\n return Reflect.get(_, key)\n }\n let activeTheme = themes[name]\n if (!activeTheme) {\n if (process.env.NODE_ENV !== 'test') {\n console.error('No theme by name', name, 'only:', themes, 'keeping current theme')\n }\n activeTheme = theme\n }\n const val = activeTheme[key]\n if (process.env.NODE_ENV === 'development') {\n if (typeof val === 'undefined') {\n console.warn(`No theme value \"${String(key)}\" in`, activeTheme, themes)\n return null\n }\n if (!isVariable(val)) {\n console.warn('Non variable!', val)\n }\n if (val.name !== key) {\n console.warn('Non-matching name for variable to key', key, val.name)\n }\n }\n if (state.current.isRendering) {\n state.current.keys.add(key)\n }\n return val\n },\n })\n },\n [\n /* if concurrent mode wanted put manager.name here */\n ]\n )\n}\n"],
5
- "mappings": ";;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAQA,MAAM,eAAe,wBAAC,GAAgB,MAAmB;AACvD,MAAI,EAAE,SAAS,EAAE;AAAM,WAAO;AAC9B,aAAW,OAAO,GAAG;AACnB,QAAI,CAAC,EAAE,IAAI,MAAM;AACf,aAAO;AAAA;AAAA;AAGX,SAAO;AAAA,GAPY;AAUd,MAAM,eAAe,wBAAC,SAA6B;AACxD,QAAM,SAAS,WAAW;AAC1B,QAAM,CAAC,MAAM,WAAW,SAAS,OAAO;AAExC,4BAA0B,MAAM;AAC9B,WAAO,OAAO,cAAc,CAAC,MAAM,YAAY;AAC7C,cAAQ,8BAAM,UAAS,QAAQ,aAAa;AAAA;AAAA,KAE7C,CAAC;AAEJ,SAAO,QAAQ;AAAA,GAVW;AAarB,MAAM,sBAAsB,6BAAM;AACvC,SAAO,WAAW,cAAc;AAAA,GADC;AAI5B,MAAM,WAAW,6BAAmB;AA3C3C;AA4CE,QAAM,cAAc;AACpB,QAAM,UAAU,WAAW;AAC3B,QAAM,SAAS,WAAW,iBAAiB;AAE3C,QAAM,QAAQ;AACd,MAAI,CAAC,MAAM,SAAS;AAClB,UAAM,UAAU;AAAA,MACd,MAAM;AAAA,MACN,MAAM,oBAAI;AAAA,MACV,aAAa;AAAA;AAAA;AAGjB,QAAM,QAAQ,cAAc;AAG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\n\nimport { GET_DEFAULT_THEME } from '../constants/constants'\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\nimport { isVariable } from '../createVariable'\nimport { ThemeName, ThemeObject } from '../types'\nimport { ThemeContext } from '../views/ThemeContext'\nimport { ThemeManagerContext } from '../views/ThemeManagerContext'\n\ntype UseThemeState = {\n uuid: Object\n keys: Set<string>\n isRendering: boolean\n}\n\nconst areEqualSets = (a: Set<string>, b: Set<string>) => {\n if (a.size !== b.size) return false\n for (const val in a) {\n if (!b.has(val)) {\n return false\n }\n }\n return true\n}\n\nexport const useThemeName = (opts?: { parent?: true }) => {\n const parent = useContext(ThemeManagerContext)\n const [name, setName] = useState(parent.name)\n\n useIsomorphicLayoutEffect(() => {\n return parent.onChangeTheme((next, manager) => {\n setName(opts?.parent ? manager.parentName : next)\n })\n }, [parent])\n\n return name || 'light'\n}\n\nexport const useDefaultThemeName = () => {\n return useContext(ThemeContext)[GET_DEFAULT_THEME] as any as ThemeName\n}\n\nexport const useTheme = (): ThemeObject => {\n const forceUpdate = useForceUpdate()\n const manager = useContext(ThemeManagerContext)\n const themes = useContext(ThemeContext) || {}\n\n const state = useRef() as React.MutableRefObject<UseThemeState>\n if (!state.current) {\n state.current = {\n uuid: {},\n keys: new Set(),\n isRendering: true,\n }\n }\n state.current.isRendering = true\n\n // track usage\n useIsomorphicLayoutEffect(() => {\n const st = state.current\n st.isRendering = false\n const cur = manager.keys.get(st.uuid)\n if (!cur || !areEqualSets(st.keys, cur)) {\n manager.track(st.uuid, st.keys)\n }\n })\n\n useEffect(() => {\n return manager.onUpdate(state.current.uuid, forceUpdate)\n }, [])\n\n const theme = (manager.name ? themes[manager.name] : themes.light) ?? themes.light ?? {}\n\n return useMemo(\n () => {\n return new Proxy(theme, {\n get(_, key: string) {\n const name = manager.name\n if (!name) {\n return Reflect.get(_, key)\n }\n let activeTheme = themes[name]\n if (!activeTheme) {\n if (process.env.NODE_ENV !== 'test') {\n console.error('No theme by name', name, 'only:', themes, 'keeping current theme')\n }\n activeTheme = theme\n }\n const val = activeTheme[key]\n if (process.env.NODE_ENV === 'development') {\n if (typeof val === 'undefined') {\n console.warn(`No theme value \"${String(key)}\" in`, activeTheme)\n return null\n }\n if (!isVariable(val)) {\n console.warn('Non variable!', val)\n }\n if (val.name !== key) {\n console.warn('Non-matching name for variable to key', key, val.name)\n }\n }\n if (state.current.isRendering) {\n state.current.keys.add(key)\n }\n return val\n },\n })\n },\n [\n /* if concurrent mode wanted put manager.name here */\n ]\n )\n}\n"],
5
+ "mappings": ";;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAQA,MAAM,eAAe,wBAAC,GAAgB,MAAmB;AACvD,MAAI,EAAE,SAAS,EAAE;AAAM,WAAO;AAC9B,aAAW,OAAO,GAAG;AACnB,QAAI,CAAC,EAAE,IAAI,MAAM;AACf,aAAO;AAAA;AAAA;AAGX,SAAO;AAAA,GAPY;AAUd,MAAM,eAAe,wBAAC,SAA6B;AACxD,QAAM,SAAS,WAAW;AAC1B,QAAM,CAAC,MAAM,WAAW,SAAS,OAAO;AAExC,4BAA0B,MAAM;AAC9B,WAAO,OAAO,cAAc,CAAC,MAAM,YAAY;AAC7C,cAAQ,8BAAM,UAAS,QAAQ,aAAa;AAAA;AAAA,KAE7C,CAAC;AAEJ,SAAO,QAAQ;AAAA,GAVW;AAarB,MAAM,sBAAsB,6BAAM;AACvC,SAAO,WAAW,cAAc;AAAA,GADC;AAI5B,MAAM,WAAW,6BAAmB;AA3C3C;AA4CE,QAAM,cAAc;AACpB,QAAM,UAAU,WAAW;AAC3B,QAAM,SAAS,WAAW,iBAAiB;AAE3C,QAAM,QAAQ;AACd,MAAI,CAAC,MAAM,SAAS;AAClB,UAAM,UAAU;AAAA,MACd,MAAM;AAAA,MACN,MAAM,oBAAI;AAAA,MACV,aAAa;AAAA;AAAA;AAGjB,QAAM,QAAQ,cAAc;AAG5B,4BAA0B,MAAM;AAC9B,UAAM,KAAK,MAAM;AACjB,OAAG,cAAc;AACjB,UAAM,MAAM,QAAQ,KAAK,IAAI,GAAG;AAChC,QAAI,CAAC,OAAO,CAAC,aAAa,GAAG,MAAM,MAAM;AACvC,cAAQ,MAAM,GAAG,MAAM,GAAG;AAAA;AAAA;AAI9B,YAAU,MAAM;AACd,WAAO,QAAQ,SAAS,MAAM,QAAQ,MAAM;AAAA,KAC3C;AAEH,QAAM,QAAS,oBAAQ,OAAO,OAAO,QAAQ,QAAQ,OAAO,UAA7C,YAAuD,OAAO,UAA9D,YAAuE;AAEtF,SAAO,QACL,MAAM;AACJ,WAAO,IAAI,MAAM,OAAO;AAAA,MACtB,IAAI,GAAG,KAAa;AAClB,cAAM,OAAO,QAAQ;AACrB,YAAI,CAAC,MAAM;AACT,iBAAO,QAAQ,IAAI,GAAG;AAAA;AAExB,YAAI,cAAc,OAAO;AACzB,YAAI,CAAC,aAAa;AAChB,cAAI,QAAQ,IAAI,aAAa,QAAQ;AACnC,oBAAQ,MAAM,oBAAoB,MAAM,SAAS,QAAQ;AAAA;AAE3D,wBAAc;AAAA;AAEhB,cAAM,MAAM,YAAY;AACxB,YAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,cAAI,OAAO,QAAQ,aAAa;AAC9B,oBAAQ,KAAK,mBAAmB,OAAO,YAAY;AACnD,mBAAO;AAAA;AAET,cAAI,CAAC,WAAW,MAAM;AACpB,oBAAQ,KAAK,iBAAiB;AAAA;AAEhC,cAAI,IAAI,SAAS,KAAK;AACpB,oBAAQ,KAAK,yCAAyC,KAAK,IAAI;AAAA;AAAA;AAGnE,YAAI,MAAM,QAAQ,aAAa;AAC7B,gBAAM,QAAQ,KAAK,IAAI;AAAA;AAEzB,eAAO;AAAA;AAAA;AAAA,KAIb;AAAA,GAlEoB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.ts"],
4
- "sourcesContent": ["import * as React from 'react'\n\nimport { createComponent } from './createComponent'\nimport { extendStaticConfig } from './helpers/extendStaticConfig'\nimport {\n MediaProps,\n PseudoProps,\n StaticComponent,\n StaticConfig,\n TamaguiConfig,\n Themes,\n Tokens,\n} from './types'\n\nexport function styled<\n ParentComponent extends StaticComponent | React.Component<any>,\n Variants extends GetVariants<ParentComponent>\n>(\n Component: ParentComponent,\n options?: GetProps<ParentComponent> & {\n variants?: Variants\n },\n staticExtractionOptions?: StaticConfig\n) {\n const staticConfigProps: StaticConfig = (() => {\n if (options) {\n const { variants, ...defaultProps } = options\n return { ...staticExtractionOptions, variants, defaultProps }\n }\n return {}\n })()\n const config = extendStaticConfig(Component, staticConfigProps)\n const component = createComponent(config!) // error is good here its on init\n type VariantProps = GetVariantProps<Variants>\n return component as StaticComponent<\n // if not options/variants passed just styled(Text):\n keyof VariantProps extends never\n ? GetProps<ParentComponent>\n : // if options passed: styled(Text, { ... })\n Omit<GetProps<ParentComponent>, keyof VariantProps> &\n VariantProps &\n MediaProps<VariantProps> &\n PseudoProps<VariantProps>,\n void\n >\n}\n\n// type ParentVariants = A extends StaticComponent<any, infer Variants> ? Variants : {}\n\nexport type GetProps<A> = A extends StaticComponent<infer Props>\n ? Props\n : A extends React.Component<infer Props>\n ? Props\n : {}\n\nexport type GetVariants<ParentComponent extends StaticComponent | React.Component<any>> = void | {\n [key: string]: {\n [key: string]:\n | Partial<GetProps<ParentComponent>>\n | ((\n val: any,\n config: {\n tokens: TamaguiConfig['tokens']\n theme: Themes extends { [key: string]: infer B } ? B : unknown\n props: GetProps<ParentComponent>\n }\n ) => Partial<GetProps<ParentComponent>>)\n }\n}\n\nexport type GetVariantProps<Variants> = Variants extends void\n ? {}\n : {\n // ensure variants actually defined\n [Key in keyof Variants]?: keyof Variants[Key] extends `...${infer VariantSpread}`\n ? VariantSpread extends keyof Tokens\n ? keyof Tokens[VariantSpread] extends string | number\n ? `$${keyof Tokens[VariantSpread]}` | null\n : unknown\n : unknown\n : keyof Variants[Key] extends 'true'\n ? boolean | null\n : keyof Exclude<Variants[Key], undefined>\n }\n\n// type X = { ok: 1 }\n// type Y = { okk: 2; ok: 3 }\n// type Z = X & Y\n// type Z2 = Z\n\n// TODO get name\n// const displayName = `styled(Component)`\n// Object.defineProperty(component, 'name', {\n// value: displayName,\n// writable: false,\n// })\n"],
5
- "mappings": ";;AAEA;AACA;AAWO,gBAIL,WACA,SAGA,yBACA;AACA,QAAM,oBAAmC,OAAM;AAC7C,QAAI,SAAS;AACX,YAAM,EAAE,aAAa,iBAAiB;AACtC,aAAO,KAAK,yBAAyB,UAAU;AAAA;AAEjD,WAAO;AAAA;AAET,QAAM,SAAS,mBAAmB,WAAW;AAC7C,QAAM,YAAY,gBAAgB;AAElC,SAAO;AAAA;AApBO;",
4
+ "sourcesContent": ["import * as React from 'react'\n\nimport { createComponent } from './createComponent'\nimport { extendStaticConfig } from './helpers/extendStaticConfig'\nimport {\n MediaProps,\n PseudoProps,\n StaticComponent,\n StaticConfig,\n TamaguiConfig,\n Themes,\n Tokens,\n} from './types'\n\nexport function styled<\n Props,\n ParentComponent extends StaticComponent | React.Component<any>,\n Variants extends GetVariants<GetProps<ParentComponent>>\n>(\n Component: ParentComponent,\n options?: GetProps<ParentComponent> & {\n variants?: Variants\n },\n staticExtractionOptions?: StaticConfig\n) {\n const staticConfigProps: StaticConfig = (() => {\n if (options) {\n const { variants, ...defaultProps } = options\n return { ...staticExtractionOptions, variants, defaultProps }\n }\n return {}\n })()\n const config = extendStaticConfig(Component, staticConfigProps)\n const component = createComponent(config!) // error is good here its on init\n\n type VariantProps = GetVariantProps<Variants>\n type ParentProps = Props extends Object ? Props : GetProps<ParentComponent>\n\n return component as StaticComponent<\n // if not options/variants passed just styled(Text):\n keyof VariantProps extends never\n ? ParentProps\n : // if options passed: styled(Text, { ... })\n Omit<ParentProps, keyof VariantProps> &\n VariantProps &\n MediaProps<VariantProps> &\n PseudoProps<VariantProps>,\n void\n >\n}\n\n// type ParentVariants = A extends StaticComponent<any, infer Variants> ? Variants : {}\n\nexport type GetProps<A> = A extends StaticComponent<infer Props>\n ? Props\n : A extends React.Component<infer Props>\n ? Props\n : A extends (props: infer Props) => any\n ? Props\n : {}\n\nexport type GetVariants<Props> = void | {\n [key: string]: {\n [key: string]:\n | Partial<Props>\n | ((\n val: any,\n config: {\n tokens: TamaguiConfig['tokens']\n theme: Themes extends { [key: string]: infer B } ? B : unknown\n props: Props\n }\n ) => Partial<Props>)\n }\n}\n\nexport type GetVariantProps<Variants> = Variants extends void\n ? {}\n : {\n // ensure variants actually defined\n [Key in keyof Variants]?: keyof Variants[Key] extends `...${infer VariantSpread}`\n ? VariantSpread extends keyof Tokens\n ? keyof Tokens[VariantSpread] extends string | number\n ? `$${keyof Tokens[VariantSpread]}` | null\n : unknown\n : unknown\n : keyof Variants[Key] extends 'true'\n ? boolean | null\n : keyof Exclude<Variants[Key], undefined>\n }\n\n// type X = { ok: 1 }\n// type Y = { okk: 2; ok: 3 }\n// type Z = X & Y\n// type Z2 = Z\n\n// TODO get name\n// const displayName = `styled(Component)`\n// Object.defineProperty(component, 'name', {\n// value: displayName,\n// writable: false,\n// })\n"],
5
+ "mappings": ";;AAEA;AACA;AAWO,gBAKL,WACA,SAGA,yBACA;AACA,QAAM,oBAAmC,OAAM;AAC7C,QAAI,SAAS;AACX,YAAM,EAAE,aAAa,iBAAiB;AACtC,aAAO,KAAK,yBAAyB,UAAU;AAAA;AAEjD,WAAO;AAAA;AAET,QAAM,SAAS,mBAAmB,WAAW;AAC7C,QAAM,YAAY,gBAAgB;AAKlC,SAAO;AAAA;AAxBO;",
6
6
  "names": []
7
7
  }
@@ -5,4 +5,7 @@
5
5
  right: 0;
6
6
  bottom: 0;
7
7
  }
8
+ .reset-appearance {
9
+ -webkit-appearance: none;
10
+ }
8
11
  /*# sourceMappingURL=tamagui-base.css.map */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tamagui-base.css"],
4
- "sourcesContent": [".tamagui-absolute-fill {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n"],
5
- "mappings": "AAAA;AACE;AACA;AACA;AACA;AACA;AAAA;",
4
+ "sourcesContent": [".tamagui-absolute-fill {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.reset-appearance {\n -webkit-appearance: none;\n}\n"],
5
+ "mappings": "AAAA;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;",
6
6
  "names": []
7
7
  }
@@ -188,7 +188,7 @@ function createComponent(configIn) {
188
188
  const className = concatClassName(...classList);
189
189
  if (process.env.NODE_ENV === "development") {
190
190
  if (props["debug"]) {
191
- console.log("\u{1F95A} className", { style, styles, classList, stylesClassNames, className: className.trim().split(" ") });
191
+ console.log("\xBB className", { style, styles, classList, stylesClassNames, className: className.trim().split(" ") });
192
192
  }
193
193
  }
194
194
  viewProps.className = className;
@@ -329,11 +329,11 @@ function createComponent(configIn) {
329
329
  if (process.env.NODE_ENV === "development") {
330
330
  if (props["debug"]) {
331
331
  viewProps["debug"] = true;
332
- console.log("\u{1F95A} props in:", props);
333
- console.log("\u{1F95A} props out:", viewProps, (_a = viewProps.className) == null ? void 0 : _a.split(" "));
334
- console.log("\u{1F95A} etc:", { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls });
332
+ console.log("\xBB props in:", props);
333
+ console.log("\xBB props out:", viewProps, (_a = viewProps.className) == null ? void 0 : _a.split(" "));
334
+ console.log("\xBB etc:", { shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls });
335
335
  if (typeof window !== "undefined") {
336
- console.log("\u{1F95A} component info", { staticConfig, tamaguiConfig });
336
+ console.log("\xBB component info", { staticConfig, tamaguiConfig });
337
337
  }
338
338
  }
339
339
  }
@@ -108,7 +108,7 @@ const getSplitStyles = /* @__PURE__ */ __name((props, staticConfig, theme) => {
108
108
  }
109
109
  if (process.env.NODE_ENV === "development") {
110
110
  if (props["debug"]) {
111
- console.log(" \u{1F95A} splitProps:", { props, viewProps, style });
111
+ console.log(" splitProps:", { props, viewProps, style });
112
112
  }
113
113
  }
114
114
  return {
@@ -73,7 +73,7 @@ const useTheme = /* @__PURE__ */ __name(() => {
73
73
  const val = activeTheme[key];
74
74
  if (process.env.NODE_ENV === "development") {
75
75
  if (typeof val === "undefined") {
76
- console.warn(`No theme value "${String(key)}" in`, activeTheme, themes);
76
+ console.warn(`No theme value "${String(key)}" in`, activeTheme);
77
77
  return null;
78
78
  }
79
79
  if (!isVariable(val)) {
@@ -5,3 +5,6 @@
5
5
  right: 0;
6
6
  bottom: 0;
7
7
  }
8
+ .reset-appearance {
9
+ -webkit-appearance: none;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "1.0.0-alpha.63",
3
+ "version": "1.0.0-alpha.64",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -17,10 +17,10 @@
17
17
  "dist"
18
18
  ],
19
19
  "dependencies": {
20
- "@tamagui/helpers": "^1.0.0-alpha.63",
20
+ "@tamagui/helpers": "^1.0.0-alpha.64",
21
21
  "@tamagui/ow": "^0.28.1",
22
- "@tamagui/use-debounce": "^1.0.0-alpha.58",
23
- "@tamagui/use-force-update": "^1.0.0-alpha.58",
22
+ "@tamagui/use-debounce": "^1.0.0-alpha.64",
23
+ "@tamagui/use-force-update": "^1.0.0-alpha.64",
24
24
  "react": "*",
25
25
  "react-dom": "*"
26
26
  },
@@ -28,7 +28,7 @@
28
28
  "react-native-web": "*"
29
29
  },
30
30
  "devDependencies": {
31
- "@tamagui/build": "^1.0.0-alpha.58",
31
+ "@tamagui/build": "^1.0.0-alpha.64",
32
32
  "@types/react": "^17.0.35",
33
33
  "csstype": "^3.0.10",
34
34
  "esbuild": "^0.13.12",
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "0682fe0472fa1604a247f9934e7cd05d7feedfb5"
41
+ "gitHead": "9363f43117f9504de9bd4949ca210cd1ebbf753b"
42
42
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { StaticComponent, StaticConfig, StaticConfigParsed } from '../types';
3
- export declare function extendStaticConfig(Component?: StaticComponent | React.Component<any>, config?: StaticConfig): StaticConfigParsed | null;
3
+ export declare function extendStaticConfig(Component?: StaticComponent | React.Component<any> | ((props: any) => any), config?: StaticConfig): StaticConfigParsed | null;
4
4
  export declare const parseStaticConfig: (config: StaticConfig) => StaticConfigParsed;
5
5
  //# sourceMappingURL=extendStaticConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extendStaticConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/extendStaticConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG5E,wBAAgB,kBAAkB,CAGhC,SAAS,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAClD,MAAM,GAAE,YAAiB,GACxB,kBAAkB,GAAG,IAAI,CAkD3B;AAED,eAAO,MAAM,iBAAiB,WAAY,YAAY,KAAG,kBAMxD,CAAA"}
1
+ {"version":3,"file":"extendStaticConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/extendStaticConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG5E,wBAAgB,kBAAkB,CAGhC,SAAS,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,EAC1E,MAAM,GAAE,YAAiB,GACxB,kBAAkB,GAAG,IAAI,CAkD3B;AAED,eAAO,MAAM,iBAAiB,WAAY,YAAY,KAAG,kBAMxD,CAAA"}
package/types/styled.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import * as React from 'react';
2
2
  import { MediaProps, PseudoProps, StaticComponent, StaticConfig, TamaguiConfig, Themes, Tokens } from './types';
3
- export declare function styled<ParentComponent extends StaticComponent | React.Component<any>, Variants extends GetVariants<ParentComponent>>(Component: ParentComponent, options?: GetProps<ParentComponent> & {
3
+ export declare function styled<Props, ParentComponent extends StaticComponent | React.Component<any>, Variants extends GetVariants<GetProps<ParentComponent>>>(Component: ParentComponent, options?: GetProps<ParentComponent> & {
4
4
  variants?: Variants;
5
- }, staticExtractionOptions?: StaticConfig): StaticComponent<keyof GetVariantProps<Variants> extends never ? GetProps<ParentComponent> : Omit<GetProps<ParentComponent>, keyof GetVariantProps<Variants>> & GetVariantProps<Variants> & MediaProps<GetVariantProps<Variants>> & PseudoProps<GetVariantProps<Variants>>, void, import("./types").StaticConfigParsed, any>;
6
- export declare type GetProps<A> = A extends StaticComponent<infer Props> ? Props : A extends React.Component<infer Props> ? Props : {};
7
- export declare type GetVariants<ParentComponent extends StaticComponent | React.Component<any>> = void | {
5
+ }, staticExtractionOptions?: StaticConfig): StaticComponent<keyof GetVariantProps<Variants> extends never ? Props extends Object ? Props : GetProps<ParentComponent> : Omit<Props extends Object ? Props : GetProps<ParentComponent>, keyof GetVariantProps<Variants>> & GetVariantProps<Variants> & MediaProps<GetVariantProps<Variants>> & PseudoProps<GetVariantProps<Variants>>, void, import("./types").StaticConfigParsed, any>;
6
+ export declare type GetProps<A> = A extends StaticComponent<infer Props> ? Props : A extends React.Component<infer Props> ? Props : A extends (props: infer Props) => any ? Props : {};
7
+ export declare type GetVariants<Props> = void | {
8
8
  [key: string]: {
9
- [key: string]: Partial<GetProps<ParentComponent>> | ((val: any, config: {
9
+ [key: string]: Partial<Props> | ((val: any, config: {
10
10
  tokens: TamaguiConfig['tokens'];
11
11
  theme: Themes extends {
12
12
  [key: string]: infer B;
13
13
  } ? B : unknown;
14
- props: GetProps<ParentComponent>;
15
- }) => Partial<GetProps<ParentComponent>>);
14
+ props: Props;
15
+ }) => Partial<Props>);
16
16
  };
17
17
  };
18
18
  export declare type GetVariantProps<Variants> = Variants extends void ? {} : {
@@ -1 +1 @@
1
- {"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/styled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,aAAa,EACb,MAAM,EACN,MAAM,EACP,MAAM,SAAS,CAAA;AAEhB,wBAAgB,MAAM,CACpB,eAAe,SAAS,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAC9D,QAAQ,SAAS,WAAW,CAAC,eAAe,CAAC,EAE7C,SAAS,EAAE,eAAe,EAC1B,OAAO,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG;IACpC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,EACD,uBAAuB,CAAC,EAAE,YAAY,+TAuBvC;AAID,oBAAY,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,eAAe,CAAC,MAAM,KAAK,CAAC,GAC5D,KAAK,GACL,CAAC,SAAS,KAAK,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,GACtC,KAAK,GACL,EAAE,CAAA;AAEN,oBAAY,WAAW,CAAC,eAAe,SAAS,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG;IAC/F,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,CAAC,GAAG,EAAE,MAAM,GACR,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,GAClC,CAAC,CACC,GAAG,EAAE,GAAG,EACR,MAAM,EAAE;YACN,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;YAC/B,KAAK,EAAE,MAAM,SAAS;gBAAE,CAAC,GAAG,EA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