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

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.
Files changed (92) hide show
  1. package/dist/cjs/createComponent.js +5 -5
  2. package/dist/cjs/createComponent.js.map +2 -2
  3. package/dist/cjs/helpers/extendStaticConfig.js +2 -1
  4. package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
  5. package/dist/cjs/helpers/getSplitStyles.js +1 -1
  6. package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
  7. package/dist/cjs/helpers/withStaticProperties.js +33 -0
  8. package/dist/cjs/helpers/withStaticProperties.js.map +7 -0
  9. package/dist/cjs/hooks/useMedia.js +5 -2
  10. package/dist/cjs/hooks/useMedia.js.map +2 -2
  11. package/dist/cjs/hooks/useTheme.js +1 -1
  12. package/dist/cjs/hooks/useTheme.js.map +2 -2
  13. package/dist/cjs/styled.js.map +2 -2
  14. package/dist/cjs/tamagui-base.css +3 -0
  15. package/dist/cjs/tamagui-base.css.map +2 -2
  16. package/dist/cjs/types.js.map +1 -1
  17. package/dist/esm/createComponent.js +5 -5
  18. package/dist/esm/createComponent.js.map +2 -2
  19. package/dist/esm/helpers/extendStaticConfig.js +2 -1
  20. package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
  21. package/dist/esm/helpers/getSplitStyles.js +1 -1
  22. package/dist/esm/helpers/getSplitStyles.js.map +2 -2
  23. package/dist/esm/helpers/withStaticProperties.js +10 -0
  24. package/dist/esm/helpers/withStaticProperties.js.map +7 -0
  25. package/dist/esm/hooks/useMedia.js +5 -2
  26. package/dist/esm/hooks/useMedia.js.map +2 -2
  27. package/dist/esm/hooks/useTheme.js +1 -1
  28. package/dist/esm/hooks/useTheme.js.map +2 -2
  29. package/dist/esm/styled.js.map +2 -2
  30. package/dist/esm/tamagui-base.css +3 -0
  31. package/dist/esm/tamagui-base.css.map +2 -2
  32. package/dist/jsx/createComponent.js +5 -5
  33. package/dist/jsx/helpers/extendStaticConfig.js +2 -1
  34. package/dist/jsx/helpers/getSplitStyles.js +1 -1
  35. package/dist/jsx/helpers/withStaticProperties.js +9 -0
  36. package/dist/jsx/hooks/useMedia.js +5 -2
  37. package/dist/jsx/hooks/useTheme.js +1 -1
  38. package/dist/jsx/tamagui-base.css +3 -0
  39. package/package.json +6 -6
  40. package/types/helpers/extendStaticConfig.d.ts +1 -1
  41. package/types/helpers/withStaticProperties.d.ts +2 -0
  42. package/types/index.d.ts +1 -0
  43. package/types/styled.d.ts +7 -7
  44. package/types/conf.d.ts.map +0 -1
  45. package/types/constants/constants.d.ts.map +0 -1
  46. package/types/constants/platform.d.ts.map +0 -1
  47. package/types/constants/pseudos.d.ts.map +0 -1
  48. package/types/constants/rnw.d.ts.map +0 -1
  49. package/types/createComponent.d.ts.map +0 -1
  50. package/types/createFont.d.ts.map +0 -1
  51. package/types/createShorthands.d.ts.map +0 -1
  52. package/types/createTamagui.d.ts.map +0 -1
  53. package/types/createTheme.d.ts.map +0 -1
  54. package/types/createTokens.d.ts.map +0 -1
  55. package/types/createVariable.d.ts.map +0 -1
  56. package/types/helpers/addStylesUsingClassname.d.ts.map +0 -1
  57. package/types/helpers/createMediaStyle.d.ts.map +0 -1
  58. package/types/helpers/createPropMapper.d.ts.map +0 -1
  59. package/types/helpers/createTamaguiProvider.d.ts.map +0 -1
  60. package/types/helpers/extendStaticConfig.d.ts.map +0 -1
  61. package/types/helpers/fixNativeShadow.d.ts.map +0 -1
  62. package/types/helpers/fixNativeShadow.native.d.ts.map +0 -1
  63. package/types/helpers/getSplitStyles.d.ts.map +0 -1
  64. package/types/helpers/getStylesAtomic.d.ts.map +0 -1
  65. package/types/helpers/getStylesAtomic.native.d.ts.map +0 -1
  66. package/types/helpers/getThemeParentClassName.d.ts.map +0 -1
  67. package/types/helpers/insertStyleRule.d.ts.map +0 -1
  68. package/types/helpers/isObj.d.ts.map +0 -1
  69. package/types/helpers/isTamaguiElement.d.ts.map +0 -1
  70. package/types/helpers/matchMedia.d.ts.map +0 -1
  71. package/types/helpers/matchMedia.native.d.ts.map +0 -1
  72. package/types/helpers/themeable.d.ts.map +0 -1
  73. package/types/helpers/validate.d.ts.map +0 -1
  74. package/types/hooks/useConstant.d.ts.map +0 -1
  75. package/types/hooks/useFeatures.d.ts.map +0 -1
  76. package/types/hooks/useMedia.d.ts.map +0 -1
  77. package/types/hooks/usePressable.d.ts.map +0 -1
  78. package/types/hooks/useTheme.d.ts.map +0 -1
  79. package/types/index.d.ts.map +0 -1
  80. package/types/static/postProcessStyles.d.ts.map +0 -1
  81. package/types/static.d.ts.map +0 -1
  82. package/types/styled.d.ts.map +0 -1
  83. package/types/types.d.ts.map +0 -1
  84. package/types/views/Animated.d.ts.map +0 -1
  85. package/types/views/Stack.d.ts.map +0 -1
  86. package/types/views/Text.d.ts.map +0 -1
  87. package/types/views/TextAncestorContext.d.ts.map +0 -1
  88. package/types/views/Theme.d.ts.map +0 -1
  89. package/types/views/ThemeContext.d.ts.map +0 -1
  90. package/types/views/ThemeInverse.d.ts.map +0 -1
  91. package/types/views/ThemeManagerContext.d.ts.map +0 -1
  92. package/types/views/ThemeProvider.d.ts.map +0 -1
@@ -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}</View>\n )\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAO;AAEP,qBAAgD;AAChD,8BAA+B;AAC/B,mBAUO;AACP,0BAAkD;AAElD,kBAAiC;AACjC,uBAAmC;AACnC,sBAAqC;AACrC,iBAAoB;AACpB,qCAA8D;AAC9D,gCAAsD;AACtD,4BAA+B;AAC/B,yBAA4B;AAC5B,0BAA6B;AAC7B,sBAAyB;AAQzB,iCAAoC;AAE7B,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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A,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+B;AAC/B,mBAUO;AACP,0BAAkD;AAElD,kBAAiC;AACjC,uBAAmC;AACnC,sBAAqC;AACrC,iBAAoB;AACpB,qCAA8D;AAC9D,gCAAsD;AACtD,4BAA+B;AAC/B,yBAA4B;AAC5B,0BAA6B;AAC7B,sBAAyB;AAQzB,iCAAoC;AAE7B,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,kCAAK,OAAS;AAAA;AAAA;AAGzB,aAAO;AAAA;AAAA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AM,OAAO,+BAAW;AAAA,GAAe,MAAM,QAJrB;",
6
6
  "names": []
7
7
  }
@@ -43,6 +43,7 @@ __export(extendStaticConfig_exports, {
43
43
  extendStaticConfig: () => extendStaticConfig,
44
44
  parseStaticConfig: () => parseStaticConfig
45
45
  });
46
+ var import_helpers = require("@tamagui/helpers");
46
47
  var import_createPropMapper = require("./createPropMapper");
47
48
  function extendStaticConfig(Component, config = {}) {
48
49
  const parent = Component || {};
@@ -67,7 +68,7 @@ function extendStaticConfig(Component, config = {}) {
67
68
  isText: config.isText || parent.staticConfig.isText || false,
68
69
  neverFlatten: config.neverFlatten ?? parent.staticConfig.neverFlatten,
69
70
  ensureOverriddenProp: config.ensureOverriddenProp ?? parent.staticConfig.ensureOverriddenProp,
70
- validStyles: config.validStyles ? __spreadValues(__spreadValues({}, parent.staticConfig.validStyles), config.validStyles) : parent.staticConfig.validStyles,
71
+ validStyles: config.validStyles ? __spreadValues(__spreadValues({}, parent.staticConfig.validStyles), config.validStyles) : parent.staticConfig.validStyles || import_helpers.stylePropsView,
71
72
  validPropsExtra: __spreadValues(__spreadValues({}, parent.staticConfig.validPropsExtra), config.validPropsExtra),
72
73
  defaultProps: __spreadValues(__spreadValues({}, parent.staticConfig.defaultProps), config.defaultProps)
73
74
  }));
@@ -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"],
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;",
4
+ "sourcesContent": ["import { stylePropsView } from '@tamagui/helpers'\nimport 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 || stylePropsView,\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
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA+B;AAI/B,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,eAAe;AAAA,IACvC,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,aAA8B;AAElC,aAAW,WAAW,OAAO;AAE3B,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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;AAElC,YAAM,aAAa,YAAY,SAAS,cA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Prop = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __reExport = (target, module2, copyDefault, desc) => {
12
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
13
+ for (let key of __getOwnPropNames(module2))
14
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
15
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
16
+ }
17
+ return target;
18
+ };
19
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
+ return (module2, temp) => {
21
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
+ };
23
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
24
+ var withStaticProperties_exports = {};
25
+ __export(withStaticProperties_exports, {
26
+ withStaticProperties: () => withStaticProperties
27
+ });
28
+ const withStaticProperties = /* @__PURE__ */ __name(function(component, staticProps) {
29
+ Object.assign(component, staticProps);
30
+ return component;
31
+ }, "withStaticProperties");
32
+ module.exports = __toCommonJS(withStaticProperties_exports);
33
+ //# sourceMappingURL=withStaticProperties.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/withStaticProperties.tsx"],
4
+ "sourcesContent": ["export const withStaticProperties = function <A extends Function, B>(\n component: A,\n staticProps: B\n): A & B {\n Object.assign(component, staticProps)\n return component as any\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,uBAAuB,gCAClC,WACA,aACO;AACP,SAAO,OAAO,WAAW;AACzB,SAAO;AAAA,GAL2B;",
6
+ "names": []
7
+ }
@@ -64,15 +64,18 @@ const removeMediaQueryListener = /* @__PURE__ */ __name((key, cb) => {
64
64
  let conf = null;
65
65
  const mediaQueryConfig = new Proxy({}, {
66
66
  get(target, key) {
67
+ if (key === "$$typeof") {
68
+ return Reflect.get(target, key);
69
+ }
67
70
  if (!conf) {
68
- console.warn("Tamagui warning: accessing media query before init");
71
+ console.warn("Tamagui: accessing media query before init");
69
72
  return null;
70
73
  }
71
74
  return Reflect.get(conf, key);
72
75
  },
73
76
  ownKeys() {
74
77
  if (!conf) {
75
- console.warn("Tamagui warning: accessing media query before init");
78
+ console.warn("Tamagui: accessing media query before init");
76
79
  return [];
77
80
  }
78
81
  return Object.keys(conf);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useMedia.tsx"],
4
- "sourcesContent": ["import { useForceUpdate } from '@tamagui/use-force-update'\nimport { useRef } from 'react'\n\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\nimport { matchMedia } from '../helpers/matchMedia'\nimport {\n ConfigureMediaQueryOptions,\n MediaQueries,\n MediaQueryObject,\n MediaQueryState,\n} from '../types'\nimport { useConstant } from './useConstant'\n\nexport const mediaState: { [key in keyof MediaQueryState]: boolean } = {} as any\nconst mediaQueryListeners: { [key: string]: Set<Function> } = {}\n\nexport const addMediaQueryListener = (key: string, cb: any) => {\n mediaQueryListeners[key] = mediaQueryListeners[key] || new Set()\n mediaQueryListeners[key].add(cb)\n}\n\nexport const removeMediaQueryListener = (key: string, cb: any) => {\n mediaQueryListeners[key]?.delete(cb)\n}\n\nlet conf: MediaQueries | null = null\n\nexport const mediaQueryConfig = new Proxy<MediaQueries>({} as any, {\n get(target, key) {\n if (!conf) {\n console.warn('Tamagui warning: accessing media query before init')\n return null\n }\n return Reflect.get(conf, key)\n },\n ownKeys() {\n if (!conf) {\n console.warn('Tamagui warning: accessing media query before init')\n return []\n }\n return Object.keys(conf)\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n }\n },\n})\n\nexport const getMedia = () => {\n if (!conf) {\n throw new Error(`not configured yet`)\n }\n return mediaState\n}\n\nexport const configureMedia = ({\n queries,\n defaultActive = ['sm', 'xs'],\n}: ConfigureMediaQueryOptions = {}) => {\n if (conf) {\n console.warn(\n `Already configured mediaQueries once (you may have called getMedia() before configureMedia())`\n )\n }\n\n if (queries) {\n conf = queries\n }\n\n // setup\n for (const key in queries) {\n const str = mediaObjectToString(queries[key])\n try {\n const getMatch = () => matchMedia(str)\n const match = getMatch()\n if (!match || typeof match.addListener !== 'function') {\n // caught below\n throw new Error('\u26A0\uFE0F No match (seeing this in RN sometimes)')\n }\n mediaState[key] = !!match.matches\n match.addListener(() => {\n const next = !!getMatch().matches\n if (next === mediaState[key]) return\n mediaState[key] = next\n const listeners = mediaQueryListeners[key]\n if (listeners?.size) {\n for (const cb of [...listeners]) {\n cb()\n }\n }\n })\n } catch (err: any) {\n console.error('Error running media query', str, err.message, err.stack)\n const isDefaultActive = defaultActive?.includes(key as any) ?? true\n mediaState[key] = isDefaultActive\n }\n }\n}\n\ntype UseMediaState = {\n selections: { [key: string]: boolean }\n nextSelections: { [key: string]: boolean }\n isRendering: boolean\n isUnmounted: boolean\n}\n\nexport const useMedia = () => {\n const forceUpdate = useForceUpdate()\n const state = useRef() as React.MutableRefObject<UseMediaState>\n if (!state.current) {\n state.current = {\n selections: {},\n nextSelections: {},\n isUnmounted: false,\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 // delete old\n for (const key in st.selections) {\n if (!(key in st.nextSelections)) {\n removeMediaQueryListener(key, forceUpdate)\n }\n }\n // add new\n for (const key in st.nextSelections) {\n if (!(key in st.selections)) {\n addMediaQueryListener(key, forceUpdate)\n }\n }\n })\n\n // unmount\n useIsomorphicLayoutEffect(() => {\n return () => {\n const st = state.current\n st.isUnmounted = true\n const allKeys = {\n ...st.selections,\n ...st.nextSelections,\n }\n for (const key in allKeys) {\n removeMediaQueryListener(key, forceUpdate)\n }\n }\n }, [])\n\n return useConstant(() => {\n const st = state.current\n return new Proxy(mediaState, {\n get(target, key: string) {\n if (!(key in mediaState)) {\n return Reflect.get(target, key)\n }\n if (!st.isUnmounted) {\n if (st.isRendering) {\n st.nextSelections[key] = true\n }\n }\n if (key in mediaState) {\n return mediaState[key]\n }\n return Reflect.get(mediaState, key)\n },\n })\n })\n}\n\nfunction camelToHyphen(str: string) {\n return str.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`).toLowerCase()\n}\n\nexport function mediaObjectToString(query: string | MediaQueryObject) {\n if (typeof query === 'string') {\n return query\n }\n return Object.entries(query)\n .map(([feature, value]) => {\n feature = camelToHyphen(feature)\n if (typeof value === 'string') {\n return `(${feature}: ${value})`\n }\n if (typeof value === 'number' && /[height|width]$/.test(feature)) {\n value = `${value}px`\n }\n return `(${feature}: ${value})`\n })\n .join(' and ')\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA+B;AAC/B,mBAAuB;AAEvB,sBAA0C;AAC1C,wBAA2B;AAO3B,yBAA4B;AAErB,MAAM,aAA0D;AACvE,MAAM,sBAAwD;AAEvD,MAAM,wBAAwB,wBAAC,KAAa,OAAY;AAC7D,sBAAoB,OAAO,oBAAoB,QAAQ,oBAAI;AAC3D,sBAAoB,KAAK,IAAI;AAAA,GAFM;AAK9B,MAAM,2BAA2B,wBAAC,KAAa,OAAY;AArBlE;AAsBE,4BAAoB,SAApB,mBAA0B,OAAO;AAAA,GADK;AAIxC,IAAI,OAA4B;AAEzB,MAAM,mBAAmB,IAAI,MAAoB,IAAW;AAAA,EACjE,IAAI,QAAQ,KAAK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IAAI,CAAC,CAAC,SAAS,WAAW;AACzB,cAAU,cAAc;AACxB,QAAI,OAAO,UAAU,UAAU;AAC7B,aAAO,IAAI,YAAY;AAAA;AAEzB,QAAI,OAAO,UAAU,YAAY,kBAAkB,KAAK,UAAU;AAChE,cAAQ,GAAG;AAAA;AAEb,WAAO,IAAI,YAAY;AAAA,KAExB,KAAK;AAAA;AAfM;",
4
+ "sourcesContent": ["import { useForceUpdate } from '@tamagui/use-force-update'\nimport { useRef } from 'react'\n\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\nimport { matchMedia } from '../helpers/matchMedia'\nimport {\n ConfigureMediaQueryOptions,\n MediaQueries,\n MediaQueryObject,\n MediaQueryState,\n} from '../types'\nimport { useConstant } from './useConstant'\n\nexport const mediaState: { [key in keyof MediaQueryState]: boolean } = {} as any\nconst mediaQueryListeners: { [key: string]: Set<Function> } = {}\n\nexport const addMediaQueryListener = (key: string, cb: any) => {\n mediaQueryListeners[key] = mediaQueryListeners[key] || new Set()\n mediaQueryListeners[key].add(cb)\n}\n\nexport const removeMediaQueryListener = (key: string, cb: any) => {\n mediaQueryListeners[key]?.delete(cb)\n}\n\nlet conf: MediaQueries | null = null\n\nexport const mediaQueryConfig = new Proxy<MediaQueries>({} as any, {\n get(target, key) {\n if (key === '$$typeof') {\n return Reflect.get(target, key)\n }\n if (!conf) {\n console.warn('Tamagui: accessing media query before init')\n return null\n }\n return Reflect.get(conf, key)\n },\n ownKeys() {\n if (!conf) {\n console.warn('Tamagui: accessing media query before init')\n return []\n }\n return Object.keys(conf)\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n }\n },\n})\n\nexport const getMedia = () => {\n if (!conf) {\n throw new Error(`not configured yet`)\n }\n return mediaState\n}\n\nexport const configureMedia = ({\n queries,\n defaultActive = ['sm', 'xs'],\n}: ConfigureMediaQueryOptions = {}) => {\n if (conf) {\n console.warn(\n `Already configured mediaQueries once (you may have called getMedia() before configureMedia())`\n )\n }\n\n if (queries) {\n conf = queries\n }\n\n // setup\n for (const key in queries) {\n const str = mediaObjectToString(queries[key])\n try {\n const getMatch = () => matchMedia(str)\n const match = getMatch()\n if (!match || typeof match.addListener !== 'function') {\n // caught below\n throw new Error('\u26A0\uFE0F No match (seeing this in RN sometimes)')\n }\n mediaState[key] = !!match.matches\n match.addListener(() => {\n const next = !!getMatch().matches\n if (next === mediaState[key]) return\n mediaState[key] = next\n const listeners = mediaQueryListeners[key]\n if (listeners?.size) {\n for (const cb of [...listeners]) {\n cb()\n }\n }\n })\n } catch (err: any) {\n console.error('Error running media query', str, err.message, err.stack)\n const isDefaultActive = defaultActive?.includes(key as any) ?? true\n mediaState[key] = isDefaultActive\n }\n }\n}\n\ntype UseMediaState = {\n selections: { [key: string]: boolean }\n nextSelections: { [key: string]: boolean }\n isRendering: boolean\n isUnmounted: boolean\n}\n\nexport const useMedia = () => {\n const forceUpdate = useForceUpdate()\n const state = useRef() as React.MutableRefObject<UseMediaState>\n if (!state.current) {\n state.current = {\n selections: {},\n nextSelections: {},\n isUnmounted: false,\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 // delete old\n for (const key in st.selections) {\n if (!(key in st.nextSelections)) {\n removeMediaQueryListener(key, forceUpdate)\n }\n }\n // add new\n for (const key in st.nextSelections) {\n if (!(key in st.selections)) {\n addMediaQueryListener(key, forceUpdate)\n }\n }\n })\n\n // unmount\n useIsomorphicLayoutEffect(() => {\n return () => {\n const st = state.current\n st.isUnmounted = true\n const allKeys = {\n ...st.selections,\n ...st.nextSelections,\n }\n for (const key in allKeys) {\n removeMediaQueryListener(key, forceUpdate)\n }\n }\n }, [])\n\n return useConstant(() => {\n const st = state.current\n return new Proxy(mediaState, {\n get(target, key: string) {\n if (!(key in mediaState)) {\n return Reflect.get(target, key)\n }\n if (!st.isUnmounted) {\n if (st.isRendering) {\n st.nextSelections[key] = true\n }\n }\n if (key in mediaState) {\n return mediaState[key]\n }\n return Reflect.get(mediaState, key)\n },\n })\n })\n}\n\nfunction camelToHyphen(str: string) {\n return str.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`).toLowerCase()\n}\n\nexport function mediaObjectToString(query: string | MediaQueryObject) {\n if (typeof query === 'string') {\n return query\n }\n return Object.entries(query)\n .map(([feature, value]) => {\n feature = camelToHyphen(feature)\n if (typeof value === 'string') {\n return `(${feature}: ${value})`\n }\n if (typeof value === 'number' && /[height|width]$/.test(feature)) {\n value = `${value}px`\n }\n return `(${feature}: ${value})`\n })\n .join(' and ')\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA+B;AAC/B,mBAAuB;AAEvB,sBAA0C;AAC1C,wBAA2B;AAO3B,yBAA4B;AAErB,MAAM,aAA0D;AACvE,MAAM,sBAAwD;AAEvD,MAAM,wBAAwB,wBAAC,KAAa,OAAY;AAC7D,sBAAoB,OAAO,oBAAoB,QAAQ,oBAAI;AAC3D,sBAAoB,KAAK,IAAI;AAAA,GAFM;AAK9B,MAAM,2BAA2B,wBAAC,KAAa,OAAY;AArBlE;AAsBE,4BAAoB,SAApB,mBAA0B,OAAO;AAAA,GADK;AAIxC,IAAI,OAA4B;AAEzB,MAAM,mBAAmB,IAAI,MAAoB,IAAW;AAAA,EACjE,IAAI,QAAQ,KAAK;AACf,QAAI,QAAQ,YAAY;AACtB,aAAO,QAAQ,IAAI,QAAQ;AAAA;AAE7B,QAAI,CAAC,MAAM;AACT,cAAQ,KAAK;AACb,aAAO;AAAA;AAET,WAAO,QAAQ,IAAI,MAAM;AAAA;AAAA,EAE3B,UAAU;AACR,QAAI,CAAC,MAAM;AACT,cAAQ,KAAK;AACb,aAAO;AAAA;AAET,WAAO,OAAO,KAAK;AAAA;AAAA,EAErB,2BAA2B;AACzB,WAAO;AAAA,MACL,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
6
  "names": []
7
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;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QAAQ,IAAI,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,6BAA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Ac;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,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> = React.Component<Partial<Props>>,\n Variants extends GetVariants<GetProps<ParentComponent>> = 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
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/types.tsx"],
4
- "sourcesContent": ["import CSS from 'csstype'\nimport React, { HTMLProps, RefObject } from 'react'\nimport { TextProps as ReactTextProps, TextStyle } from 'react-native'\nimport { GestureResponderEvent, View, ViewProps, ViewStyle } from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type ConfigListener = (conf: TamaguiInternalConfig) => void\n\n// to prevent things from going circular, hoisting some types in this file\n// to generally order them as building up towards TamaguiConfig\n\nexport interface CreateTokens<Val extends number | string | Variable = number | string | Variable> {\n font: { [key: string]: GenericFont }\n color: { [key: string]: Val }\n space: { [key: string]: Val }\n size: { [key: string]: Val }\n radius: { [key: string]: Val }\n zIndex: { [key: string]: Val }\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]: {\n // defined for our tamagui kit , we could do this inside `tamagui`\n // but maybe helpful to have some sort of universally shared things +\n // + enforce if they want their own, redefine in their design sys\n bg: string | Variable\n bg2: string | Variable\n bg3: string | Variable\n bg4: string | Variable\n color: string | Variable\n color2: string | Variable\n color3: string | Variable\n color4: string | Variable\n borderColor: string | Variable\n borderColor2: string | Variable\n shadowColor: string | Variable\n shadowColor2: string | Variable\n }\n}\ntype GenericShorthands = {}\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\n\n// this is the \"main\" typed object, which users re-define\n// (internal) keep all types directly on this object and reference them from elsewhere\n//\n// const config = createTamagui(...)\n// type MyConfig = typeof config\n// declare module 'tamagui' {\n// export interface TamaguiCustomConfig extends MyConfig {}\n// }\n// now your whole app/kit should be typed correctly\n//\nexport interface TamaguiCustomConfig {}\n\nexport interface TamaguiConfig\n extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>,\n TamaguiCustomConfig {}\n\nexport type CreateTamaguiConfig<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands,\n D extends GenericMedia\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n tokens: A\n themes: B\n shorthands: C\n media: D\n}\n\n// for use in creation functions so it doesnt get overwrtitten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeObject = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\n// themes\nexport type ThemeName = keyof Themes extends `${infer Prefix}-${string}`\n ? Prefix | keyof Themes\n : keyof Themes\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeKeyVariables = `$${ThemeKeys}`\n// export type Spaces = TamaguiConfig['tokens']['spaces'][keyof TamaguiConfig['tokens']['spaces']]\n// export type FontSizes = TamaguiConfig['tokens']['fontSizes'][keyof TamaguiConfig['tokens']['fontSizes']]\n// export type Colors = TamaguiConfig['tokens']['colors'][keyof TamaguiConfig['tokens']['colors']]\n\n// this is the config generated via createTamagui()\nexport type TamaguiInternalConfig<\n A extends GenericTokens = GenericTokens,\n B extends GenericThemes = GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia\n> = CreateTamaguiConfig<A, B, C, D> & {\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n themeParsed: { [key: string]: Variable }\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n getCSS: () => string\n parsed: boolean\n}\n\n// prevents const intersections from being clobbered into string, keeping the consts\nexport type UnionableString = string & {}\nexport type UnionableNumber = number & {}\nexport type PropTypes<A extends StaticComponent> = A extends React.FunctionComponent<infer Props>\n ? Props\n : unknown\n\nexport type GenericFont = {\n size: { [key: string | number]: number | Variable }\n lineHeight: { [key: string | number]: number | Variable }\n letterSpacing: { [key: string | number]: number | Variable }\n weight: { [key: string | number]: string | Variable }\n family: string | Variable\n}\n\n// media\nexport type MediaKeys = keyof Media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryState = {\n [key in string]: boolean\n}\nexport type MediaQueryKey = keyof Media\nexport type MediaProps<A> = {\n [key in `$${MediaQueryKey}`]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\nexport type ConfigureMediaQueryOptions = {\n queries?: MediaQueries\n defaultActive?: MediaQueryKey[]\n}\n\nexport type TransformStyleProps = {\n x?: number\n y?: number\n perspective?: number\n scale?: number\n scaleX?: number\n scaleY?: number\n skewX?: string\n skewY?: string\n matrix?: number[]\n rotate?: string\n rotateY?: string\n rotateX?: string\n rotateZ?: string\n}\n\n// createComponent props helpers\n\n//\n// base props that are accepted by createComponent (additional to react-native-web)\n//\ntype ComponentPropsBase = {\n className?: string\n tag?: string\n animated?: boolean\n onHoverIn?: (e: MouseEvent) => any\n onHoverOut?: (e: MouseEvent) => any\n onPress?: (e: GestureResponderEvent) => any\n onPressIn?: (e: GestureResponderEvent) => any\n onPressOut?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseEnter?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseLeave?: (e: GestureResponderEvent) => any\n space?: Tokens['space'][keyof Tokens['space']] | boolean | string | number\n pointerEvents?: string\n}\n\ntype GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight'> =\n keyof Tokens['font'][keyof Tokens['font']][A]\n\nexport type SizeTokens = `$${keyof Tokens['size']}`\nexport type FontTokens = `$${keyof Tokens['font']}`\nexport type FontSizeTokens = `$${GetTokenFontKeysFor<'size'>}`\nexport type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}`\nexport type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}`\nexport type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}`\nexport type SpaceTokens = `$${keyof Tokens['space']}`\nexport type ColorTokens = `$${keyof Tokens['color']}`\nexport type ZIndexTokens = `$${keyof Tokens['zIndex']}`\n\n//\n// adds theme short values to relevant props\n//\ntype ThemeValue<A> = Omit<A, string> | UnionableString | Variable\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]:\n | ThemeValue<T[K]>\n | (K extends ColorableKeys\n ? ThemeKeyVariables\n : K extends SizeKeys\n ? SizeTokens\n : K extends FontKeys\n ? FontTokens\n : K extends FontSizeKeys\n ? FontSizeTokens\n : K extends SpaceKeys\n ? SpaceTokens\n : K extends ColorKeys\n ? ColorTokens\n : K extends ZIndexKeys\n ? ZIndexTokens\n : K extends LineHeightKeys\n ? FontLineHeightTokens\n : K extends FontWeightKeys\n ? FontWeightTokens\n : K extends FontLetterSpacingKeys\n ? FontLetterSpacingTokens\n : {})\n}\n\n// adds shorthand props\ntype WithShorthands<StyleProps> = {\n [Key in keyof Shorthands]?: Shorthands[Key] extends keyof StyleProps\n ? StyleProps[Shorthands[Key]] | null\n : undefined\n}\n\n// adds pseudo props\nexport type PseudoProps<A> = {\n hoverStyle?: A | null\n pressStyle?: A | null\n}\n\n//\n// add both theme and shorthands\n//\ntype WithThemeAndShorthands<A extends object> = WithThemeValues<A> &\n WithShorthands<WithThemeValues<A>>\n\n//\n// combines all of theme, shorthands, psuedos...\n//\ntype WithThemeShorthandsAndPseudos<A extends object> = \n | WithThemeAndShorthands<A>\n & PseudoProps<WithThemeAndShorthands<A>>\n\n//\n// ... and media queries\n//\ntype WithThemeShorthandsPseudosAndMedia<A extends object> = WithThemeShorthandsAndPseudos<A> &\n MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n//\n// Stack\n//\n\ntype WebOnlyStyleProps = {\n // WEB ONLY\n cursor?: string\n // WEB ONLY\n contain?: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'paint' | string\n // WEB ONLY values: inherit, inline, block, content\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n // WEB ONLY pointerEvents can be a style prop\n pointerEvents?: ViewProps['pointerEvents']\n}\n\nexport type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> &\n TransformStyleProps &\n WebOnlyStyleProps\n\nexport type StackStyleProps = WithThemeShorthandsPseudosAndMedia<StackStylePropsBase>\n\nexport type StackProps = Omit<RNWInternalProps, 'children'> &\n Omit<ViewProps, 'display' | 'children'> &\n StackStyleProps &\n ComponentPropsBase & {\n ref?: RefObject<View | HTMLElement> | ((node: View | HTMLElement) => any)\n children?: any | any[]\n }\n\n//\n// Text props\n//\n\n// type EnhancedTextStyleProps = WithThemeValues<\n// Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps\n// >\n// export type TextStylePropsBase = EnhancedTextStyleProps\n// export type TextStyleProps<S = TextStylePropsBase> = S & {\n// hoverStyle?: S | null\n// pressStyle?: S | null\n// }\n\ntype TextStyleProps = WithThemeShorthandsPseudosAndMedia<\n Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & WebOnlyStyleProps\n>\n\nexport type TextProps = ReactTextProps &\n TextStyleProps &\n ComponentPropsBase & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n userSelect?: CSS.Properties['userSelect']\n textOverflow?: CSS.Properties['textOverflow']\n whiteSpace?: CSS.Properties['whiteSpace']\n wordWrap?: CSS.Properties['wordWrap']\n cursor?: CSS.Properties['cursor']\n }\n\n//\n// StaticComponent\n//\n\nexport type StaticComponent<\n Props = any,\n VariantProps = any,\n StaticConfParsed = StaticConfigParsed,\n ParentVariantProps = any\n> = React.FunctionComponent<Props> & {\n staticConfig: StaticConfParsed\n variantProps?: VariantProps\n\n /*\n * Only needed for more complex components\n * If you create a styled frame component this is a HoC to extract\n * styles from all parents.\n */\n extractable: <X>(a: X, opts?: StaticConfig) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n initialWindowMetrics?: any\n fallback?: any\n children?: any\n}\n\nexport type RNWInternalProps = {\n accessibilityState?: {\n busy?: boolean\n checked?: boolean | 'mixed'\n disabled?: boolean\n expanded?: boolean\n grabbed?: boolean\n hidden?: boolean\n invalid?: boolean\n modal?: boolean\n pressed?: boolean\n readonly?: boolean\n required?: boolean\n selected?: boolean\n }\n accessibilityValue?: {\n max?: number\n min?: number\n now?: number\n text?: string\n }\n children?: any\n focusable?: boolean\n nativeID?: string\n onBlur?: (e: any) => void\n onClick?: (e: any) => void\n onClickCapture?: (e: any) => void\n onContextMenu?: (e: any) => void\n onFocus?: (e: any) => void\n onKeyDown?: (e: any) => void\n onKeyUp?: (e: any) => void\n onMoveShouldSetResponder?: (e: any) => boolean\n onMoveShouldSetResponderCapture?: (e: any) => boolean\n onResponderEnd?: (e: any) => void\n onResponderGrant?: (e: any) => void\n onResponderMove?: (e: any) => void\n onResponderReject?: (e: any) => void\n onResponderRelease?: (e: any) => void\n onResponderStart?: (e: any) => void\n onResponderTerminate?: (e: any) => void\n onResponderTerminationRequest?: (e: any) => boolean\n onScrollShouldSetResponder?: (e: any) => boolean\n onScrollShouldSetResponderCapture?: (e: any) => boolean\n onSelectionChangeShouldSetResponder?: (e: any) => boolean\n onSelectionChangeShouldSetResponderCapture?: (e: any) => boolean\n onStartShouldSetResponder?: (e: any) => boolean\n onStartShouldSetResponderCapture?: (e: any) => boolean\n pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto'\n testID?: string\n // unstable\n dataSet?: Object\n onMouseDown?: (e: any) => void\n onMouseEnter?: (e: any) => void\n onMouseLeave?: (e: any) => void\n onMouseMove?: (e: any) => void\n onMouseOver?: (e: any) => void\n onMouseOut?: (e: any) => void\n onMouseUp?: (e: any) => void\n onScroll?: (e: any) => void\n onTouchCancel?: (e: any) => void\n onTouchCancelCapture?: (e: any) => void\n onTouchEnd?: (e: any) => void\n onTouchEndCapture?: (e: any) => void\n onTouchMove?: (e: any) => void\n onTouchMoveCapture?: (e: any) => void\n onTouchStart?: (e: any) => void\n onTouchStartCapture?: (e: any) => void\n onWheel?: (e: any) => void\n href?: string\n hrefAttrs?: { download?: boolean; rel?: string; target?: string }\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: StaticComponent\n\n variants?: {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n }\n\n /*\n * If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /*\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /*\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /*\n * Allows for defining extra valid props to be extracted beyond\n * the default ones.\n */\n validPropsExtra?: { [key: string]: any }\n\n /*\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /*\n * If this prop is encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /*\n * A bit odd, only for more advanced heirarchies.\n * Indicates that the component will set this prop so the\n * static extraction can ensure it sets them to ={undefined}\n * so they get overriddent. In the future, this can be smarter.\n */\n ensureOverriddenProp?: { [key: string]: boolean }\n\n /*\n * We need to wrap children\n */\n isZStack?: boolean\n\n /*\n * To account for style adjustments\n */\n isReactNativeWeb?: boolean\n}\n\ntype ColorableKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderTopColor'\n | 'borderBottomColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n | 'shadowColor'\n\ntype SizeKeys = 'width' | 'height' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight'\n\ntype FontKeys = 'fontFamily'\n\ntype FontSizeKeys = 'fontSize'\n\ntype FontWeightKeys = 'fontWeight'\n\ntype FontLetterSpacingKeys = 'letterSpacing'\n\ntype LineHeightKeys = 'lineHeight'\n\ntype ZIndexKeys = 'zIndex'\n\ntype ColorKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderTopColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n\ntype SpaceKeys =\n | 'padding'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingLeft'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingEnd'\n | 'paddingStart'\n | 'margin'\n | 'marginHorizontal'\n | 'marginVertical'\n | 'marginLeft'\n | 'marginTop'\n | 'marginBottom'\n | 'marginLeft'\n | 'marginRight'\n | 'marginEnd'\n | 'marginStart'\n | 'x'\n | 'y'\n | 'scale'\n | 'scaleX'\n | 'scaleY'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderTopStartRadius'\n | 'borderBottomEndRadius'\n | 'borderBottomLeftRadius'\n | 'borderBottomRightRadius'\n | 'borderBottomStartRadius'\n | 'borderBottomWidth'\n | 'borderLeftWidth'\n | 'borderRadius'\n | 'borderRightWidth'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderEndWidth'\n | 'borderStartWidth'\n | 'borderTopStartRadius'\n | 'borderTopWidth'\n | 'borderWidth'\n | 'left'\n | 'top'\n | 'right'\n | 'bottom'\n | 'shadowOffset'\n"],
4
+ "sourcesContent": ["import CSS from 'csstype'\nimport React, { HTMLProps, RefObject } from 'react'\nimport { TextProps as ReactTextProps, TextStyle } from 'react-native'\nimport { GestureResponderEvent, View, ViewProps, ViewStyle } from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type ConfigListener = (conf: TamaguiInternalConfig) => void\n\n// to prevent things from going circular, hoisting some types in this file\n// to generally order them as building up towards TamaguiConfig\n\nexport interface CreateTokens<Val extends number | string | Variable = number | string | Variable> {\n font: { [key: string]: GenericFont }\n color: { [key: string]: Val }\n space: { [key: string]: Val }\n size: { [key: string]: Val }\n radius: { [key: string]: Val }\n zIndex: { [key: string]: Val }\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]: {\n // defined for our tamagui kit , we could do this inside `tamagui`\n // but maybe helpful to have some sort of universally shared things +\n // + enforce if they want their own, redefine in their design sys\n bg: string | Variable\n bg2: string | Variable\n bg3: string | Variable\n bg4: string | Variable\n color: string | Variable\n color2: string | Variable\n color3: string | Variable\n color4: string | Variable\n borderColor: string | Variable\n borderColor2: string | Variable\n shadowColor: string | Variable\n shadowColor2: string | Variable\n }\n}\ntype GenericShorthands = {}\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\n\n// this is the \"main\" typed object, which users re-define\n// (internal) keep all types directly on this object and reference them from elsewhere\n//\n// const config = createTamagui(...)\n// type MyConfig = typeof config\n// declare module 'tamagui' {\n// export interface TamaguiCustomConfig extends MyConfig {}\n// }\n// now your whole app/kit should be typed correctly\n//\nexport interface TamaguiCustomConfig {}\n\nexport interface TamaguiConfig\n extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>,\n TamaguiCustomConfig {}\n\nexport type CreateTamaguiConfig<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands,\n D extends GenericMedia\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n tokens: A\n themes: B\n shorthands: C\n media: D\n}\n\n// for use in creation functions so it doesnt get overwrtitten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeObject = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\n// themes\nexport type ThemeName = keyof Themes extends `${infer Prefix}-${string}`\n ? Prefix | keyof Themes\n : keyof Themes\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeKeyVariables = `$${ThemeKeys}`\n// export type Spaces = TamaguiConfig['tokens']['spaces'][keyof TamaguiConfig['tokens']['spaces']]\n// export type FontSizes = TamaguiConfig['tokens']['fontSizes'][keyof TamaguiConfig['tokens']['fontSizes']]\n// export type Colors = TamaguiConfig['tokens']['colors'][keyof TamaguiConfig['tokens']['colors']]\n\n// this is the config generated via createTamagui()\nexport type TamaguiInternalConfig<\n A extends GenericTokens = GenericTokens,\n B extends GenericThemes = GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia\n> = CreateTamaguiConfig<A, B, C, D> & {\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n themeParsed: { [key: string]: Variable }\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n getCSS: () => string\n parsed: boolean\n}\n\n// prevents const intersections from being clobbered into string, keeping the consts\nexport type UnionableString = string & {}\nexport type UnionableNumber = number & {}\nexport type PropTypes<A extends StaticComponent> = A extends React.FunctionComponent<infer Props>\n ? Props\n : unknown\n\nexport type GenericFont = {\n size: { [key: string | number]: number | Variable }\n lineHeight: { [key: string | number]: number | Variable }\n letterSpacing: { [key: string | number]: number | Variable }\n weight: { [key: string | number]: string | Variable }\n family: string | Variable\n}\n\n// media\nexport type MediaKeys = keyof Media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryState = {\n [key in string]: boolean\n}\nexport type MediaQueryKey = keyof Media\nexport type MediaProps<A> = {\n [key in `$${MediaQueryKey}`]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\nexport type ConfigureMediaQueryOptions = {\n queries?: MediaQueries\n defaultActive?: MediaQueryKey[]\n}\n\nexport type TransformStyleProps = {\n x?: number\n y?: number\n perspective?: number\n scale?: number\n scaleX?: number\n scaleY?: number\n skewX?: string\n skewY?: string\n matrix?: number[]\n rotate?: string\n rotateY?: string\n rotateX?: string\n rotateZ?: string\n}\n\n// createComponent props helpers\n\n//\n// base props that are accepted by createComponent (additional to react-native-web)\n//\ntype ComponentPropsBase = {\n className?: string\n tag?: string\n animated?: boolean\n onHoverIn?: (e: MouseEvent) => any\n onHoverOut?: (e: MouseEvent) => any\n onPress?: (e: GestureResponderEvent) => any\n onPressIn?: (e: GestureResponderEvent) => any\n onPressOut?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseEnter?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseLeave?: (e: GestureResponderEvent) => any\n space?: Tokens['space'][keyof Tokens['space']] | boolean | string | number\n pointerEvents?: string\n}\n\ntype GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight'> =\n keyof Tokens['font'][keyof Tokens['font']][A]\n\nexport type SizeTokens = `$${keyof Tokens['size']}`\nexport type FontTokens = `$${keyof Tokens['font']}`\nexport type FontSizeTokens = `$${GetTokenFontKeysFor<'size'>}`\nexport type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}`\nexport type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}`\nexport type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}`\nexport type SpaceTokens = `$${keyof Tokens['space']}`\nexport type ColorTokens = `$${keyof Tokens['color']}`\nexport type ZIndexTokens = `$${keyof Tokens['zIndex']}`\n\n//\n// adds theme short values to relevant props\n//\ntype ThemeValue<A> = Omit<A, string> | UnionableString | Variable\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]:\n | ThemeValue<T[K]>\n | (K extends ColorableKeys\n ? ThemeKeyVariables\n : K extends SizeKeys\n ? SizeTokens\n : K extends FontKeys\n ? FontTokens\n : K extends FontSizeKeys\n ? FontSizeTokens\n : K extends SpaceKeys\n ? SpaceTokens\n : K extends ColorKeys\n ? ColorTokens\n : K extends ZIndexKeys\n ? ZIndexTokens\n : K extends LineHeightKeys\n ? FontLineHeightTokens\n : K extends FontWeightKeys\n ? FontWeightTokens\n : K extends FontLetterSpacingKeys\n ? FontLetterSpacingTokens\n : {})\n}\n\n// adds shorthand props\ntype WithShorthands<StyleProps> = {\n [Key in keyof Shorthands]?: Shorthands[Key] extends keyof StyleProps\n ? StyleProps[Shorthands[Key]] | null\n : undefined\n}\n\n// adds pseudo props\nexport type PseudoProps<A> = {\n hoverStyle?: A | null\n pressStyle?: A | null\n}\n\n//\n// add both theme and shorthands\n//\ntype WithThemeAndShorthands<A extends object> = WithThemeValues<A> &\n WithShorthands<WithThemeValues<A>>\n\n//\n// combines all of theme, shorthands, psuedos...\n//\ntype WithThemeShorthandsAndPseudos<A extends object> =\n | WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>\n\n//\n// ... and media queries\n//\ntype WithThemeShorthandsPseudosAndMedia<A extends object> = WithThemeShorthandsAndPseudos<A> &\n MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n//\n// Stack\n//\n\ntype WebOnlyStyleProps = {\n // WEB ONLY\n cursor?: string\n // WEB ONLY\n contain?: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'paint' | string\n // WEB ONLY values: inherit, inline, block, content\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n // WEB ONLY pointerEvents can be a style prop\n pointerEvents?: ViewProps['pointerEvents']\n}\n\nexport type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> &\n TransformStyleProps &\n WebOnlyStyleProps\n\nexport type StackStyleProps = WithThemeShorthandsPseudosAndMedia<StackStylePropsBase>\n\nexport type StackProps = Omit<RNWInternalProps, 'children'> &\n Omit<ViewProps, 'display' | 'children'> &\n StackStyleProps &\n ComponentPropsBase & {\n ref?: RefObject<View | HTMLElement> | ((node: View | HTMLElement) => any)\n children?: any | any[]\n }\n\n//\n// Text props\n//\n\n// type EnhancedTextStyleProps = WithThemeValues<\n// Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps\n// >\n// export type TextStylePropsBase = EnhancedTextStyleProps\n// export type TextStyleProps<S = TextStylePropsBase> = S & {\n// hoverStyle?: S | null\n// pressStyle?: S | null\n// }\n\ntype TextStyleProps = WithThemeShorthandsPseudosAndMedia<\n Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & WebOnlyStyleProps\n>\n\nexport type TextProps = ReactTextProps &\n TextStyleProps &\n ComponentPropsBase & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n userSelect?: CSS.Properties['userSelect']\n textOverflow?: CSS.Properties['textOverflow']\n whiteSpace?: CSS.Properties['whiteSpace']\n wordWrap?: CSS.Properties['wordWrap']\n cursor?: CSS.Properties['cursor']\n }\n\n//\n// StaticComponent\n//\n\nexport type StaticComponent<\n Props = any,\n VariantProps = any,\n StaticConfParsed = StaticConfigParsed,\n ParentVariantProps = any\n> = React.FunctionComponent<Props> & {\n staticConfig: StaticConfParsed\n variantProps?: VariantProps\n\n /*\n * Only needed for more complex components\n * If you create a styled frame component this is a HoC to extract\n * styles from all parents.\n */\n extractable: <X>(a: X, opts?: StaticConfig) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n initialWindowMetrics?: any\n fallback?: any\n children?: any\n}\n\nexport type RNWInternalProps = {\n accessibilityState?: {\n busy?: boolean\n checked?: boolean | 'mixed'\n disabled?: boolean\n expanded?: boolean\n grabbed?: boolean\n hidden?: boolean\n invalid?: boolean\n modal?: boolean\n pressed?: boolean\n readonly?: boolean\n required?: boolean\n selected?: boolean\n }\n accessibilityValue?: {\n max?: number\n min?: number\n now?: number\n text?: string\n }\n children?: any\n focusable?: boolean\n nativeID?: string\n onBlur?: (e: any) => void\n onClick?: (e: any) => void\n onClickCapture?: (e: any) => void\n onContextMenu?: (e: any) => void\n onFocus?: (e: any) => void\n onKeyDown?: (e: any) => void\n onKeyUp?: (e: any) => void\n onMoveShouldSetResponder?: (e: any) => boolean\n onMoveShouldSetResponderCapture?: (e: any) => boolean\n onResponderEnd?: (e: any) => void\n onResponderGrant?: (e: any) => void\n onResponderMove?: (e: any) => void\n onResponderReject?: (e: any) => void\n onResponderRelease?: (e: any) => void\n onResponderStart?: (e: any) => void\n onResponderTerminate?: (e: any) => void\n onResponderTerminationRequest?: (e: any) => boolean\n onScrollShouldSetResponder?: (e: any) => boolean\n onScrollShouldSetResponderCapture?: (e: any) => boolean\n onSelectionChangeShouldSetResponder?: (e: any) => boolean\n onSelectionChangeShouldSetResponderCapture?: (e: any) => boolean\n onStartShouldSetResponder?: (e: any) => boolean\n onStartShouldSetResponderCapture?: (e: any) => boolean\n pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto'\n testID?: string\n // unstable\n dataSet?: Object\n onMouseDown?: (e: any) => void\n onMouseEnter?: (e: any) => void\n onMouseLeave?: (e: any) => void\n onMouseMove?: (e: any) => void\n onMouseOver?: (e: any) => void\n onMouseOut?: (e: any) => void\n onMouseUp?: (e: any) => void\n onScroll?: (e: any) => void\n onTouchCancel?: (e: any) => void\n onTouchCancelCapture?: (e: any) => void\n onTouchEnd?: (e: any) => void\n onTouchEndCapture?: (e: any) => void\n onTouchMove?: (e: any) => void\n onTouchMoveCapture?: (e: any) => void\n onTouchStart?: (e: any) => void\n onTouchStartCapture?: (e: any) => void\n onWheel?: (e: any) => void\n href?: string\n hrefAttrs?: { download?: boolean; rel?: string; target?: string }\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: StaticComponent\n\n variants?: {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n }\n\n /*\n * If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /*\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /*\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /*\n * Allows for defining extra valid props to be extracted beyond\n * the default ones.\n */\n validPropsExtra?: { [key: string]: any }\n\n /*\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /*\n * If this prop is encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /*\n * A bit odd, only for more advanced heirarchies.\n * Indicates that the component will set this prop so the\n * static extraction can ensure it sets them to ={undefined}\n * so they get overriddent. In the future, this can be smarter.\n */\n ensureOverriddenProp?: { [key: string]: boolean }\n\n /*\n * We need to wrap children\n */\n isZStack?: boolean\n\n /*\n * To account for style adjustments\n */\n isReactNativeWeb?: boolean\n}\n\ntype ColorableKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderTopColor'\n | 'borderBottomColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n | 'shadowColor'\n\ntype SizeKeys = 'width' | 'height' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight'\n\ntype FontKeys = 'fontFamily'\n\ntype FontSizeKeys = 'fontSize'\n\ntype FontWeightKeys = 'fontWeight'\n\ntype FontLetterSpacingKeys = 'letterSpacing'\n\ntype LineHeightKeys = 'lineHeight'\n\ntype ZIndexKeys = 'zIndex'\n\ntype ColorKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderTopColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n\ntype SpaceKeys =\n | 'padding'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingLeft'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingEnd'\n | 'paddingStart'\n | 'margin'\n | 'marginHorizontal'\n | 'marginVertical'\n | 'marginLeft'\n | 'marginTop'\n | 'marginBottom'\n | 'marginLeft'\n | 'marginRight'\n | 'marginEnd'\n | 'marginStart'\n | 'x'\n | 'y'\n | 'scale'\n | 'scaleX'\n | 'scaleY'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderTopStartRadius'\n | 'borderBottomEndRadius'\n | 'borderBottomLeftRadius'\n | 'borderBottomRightRadius'\n | 'borderBottomStartRadius'\n | 'borderBottomWidth'\n | 'borderLeftWidth'\n | 'borderRadius'\n | 'borderRightWidth'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderEndWidth'\n | 'borderStartWidth'\n | 'borderTopStartRadius'\n | 'borderTopWidth'\n | 'borderWidth'\n | 'left'\n | 'top'\n | 'right'\n | 'bottom'\n | 'shadowOffset'\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;",
6
6
  "names": []
7
7
  }