@tamagui/core 1.1.13 → 1.2.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/types.tsx"],
4
- "sourcesContent": ["// TODO split this into own package @tamagui/types to share with animations packages\n\nimport type { Properties } from 'csstype'\nimport type {\n ComponentType,\n ForwardRefExoticComponent,\n FunctionComponent,\n HTMLAttributes,\n ReactNode,\n RefAttributes,\n RefObject,\n} from 'react'\nimport type {\n Image,\n PressableProps,\n TextProps as ReactTextProps,\n Text,\n TextInput,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport type { Variable } from './createVariable'\nimport type { ResolveVariableTypes } from './helpers/createPropMapper'\nimport type { TamaguiReactElement } from './static'\nimport type { RNWTextProps, RNWViewProps } from './types-rnw'\nimport type { FontLanguageProps } from './views/FontLanguage.types'\nimport type { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type SpaceDirection = 'vertical' | 'horizontal' | 'both'\n\nexport type TamaguiElement = HTMLElement | View\n\nexport type DebugProp = boolean | 'break' | 'verbose'\n\n// base props that are accepted by createComponent (additional to react-native-web)\n\ntype DivAttributes = HTMLAttributes<HTMLDivElement>\n\nexport type TamaguiComponentPropsBase = {\n hitSlop?: PressableProps['hitSlop']\n asChild?: boolean\n space?: SpaceTokens | null\n spaceDirection?: SpaceDirection\n separator?: ReactNode\n dangerouslySetInnerHTML?: { __html: string }\n animation?: AnimationProp | null\n animateOnly?: string[]\n children?: any | any[]\n debug?: DebugProp\n disabled?: boolean\n className?: string\n themeShallow?: boolean\n id?: string\n tag?: string\n theme?: ThemeName | null\n componentName?: string\n /**\n * Forces the pseudo style state to be on\n */\n forceStyle?: 'hover' | 'press' | 'focus'\n onHoverIn?: DivAttributes['onMouseEnter']\n onHoverOut?: DivAttributes['onMouseLeave']\n onPress?: PressableProps['onPress']\n onPressIn?: PressableProps['onPress']\n onPressOut?: PressableProps['onPress']\n // WEB ONLY\n onMouseEnter?: DivAttributes['onMouseEnter']\n onMouseLeave?: DivAttributes['onMouseLeave']\n onMouseDown?: DivAttributes['onMouseDown']\n}\n\nexport type ReactComponentWithRef<Props, Ref> = ForwardRefExoticComponent<\n Props & RefAttributes<Ref>\n>\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 type VariableVal = number | string | Variable\nexport type VariableColorVal = string | Variable\n\ntype GenericKey = string | number | symbol\n\nexport interface CreateTokens<Val extends VariableVal = VariableVal> {\n color: { [key: GenericKey]: Val }\n space: { [key: GenericKey]: Val }\n size: { [key: GenericKey]: Val }\n radius: { [key: GenericKey]: Val }\n zIndex: { [key: GenericKey]: Val }\n}\n\ntype Tokenify<A extends GenericTokens> = {\n color: TokenifyRecord<A['color']>\n space: TokenifyRecord<A['space']>\n size: TokenifyRecord<A['size']>\n radius: TokenifyRecord<A['radius']>\n zIndex: TokenifyRecord<A['zIndex']>\n}\n\ntype TokenifyRecord<A extends CreateTokens[keyof CreateTokens]> = {\n [Key in keyof A]: A[Key] extends Variable ? A[Key] : Variable<A[Key]>\n}\n\nexport type TamaguiBaseTheme = {\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 background: VariableColorVal\n backgroundHover: VariableColorVal\n backgroundPress: VariableColorVal\n backgroundFocus: VariableColorVal\n color: VariableColorVal\n colorHover: VariableColorVal\n colorPress: VariableColorVal\n colorFocus: VariableColorVal\n borderColor: VariableColorVal\n borderColorHover: VariableColorVal\n borderColorPress: VariableColorVal\n borderColorFocus: VariableColorVal\n shadowColor: VariableColorVal\n shadowColorHover: VariableColorVal\n shadowColorPress: VariableColorVal\n shadowColorFocus: VariableColorVal\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]:\n | Partial<TamaguiBaseTheme> & {\n [key: string]: VariableVal\n }\n}\n\ntype AllStyleKeys = keyof StackStylePropsBase | keyof TextStylePropsBase\n\nexport type CreateShorthands = {\n [key: string]: AllStyleKeys\n}\n\nexport type GenericShorthands = {}\n\n// sm: { minWidth: 100 }\ntype GenericMedia = {\n [key: string]: {\n [key: string]: number | string\n }\n}\n\nexport type GenericFonts = Record<string, GenericFont>\n\ntype GenericAnimations = {\n [key: string]:\n | string\n | {\n [key: string]: any\n }\n | any[]\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 = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = {\n fonts: RemoveLanguagePostfixes<F>\n fontLanguages: GetLanguagePostfixes<F> extends never\n ? string[]\n : GetLanguagePostfixes<F>[]\n tokens: A\n // parsed\n themes: {\n [Name in keyof B]: {\n [Key in keyof B[Name]]: Variable\n }\n }\n shorthands: C\n media: D\n animations: AnimationDriver<E>\n}\n\ntype GetLanguagePostfix<Set> = Set extends string\n ? Set extends `${string}_${infer Postfix}`\n ? Postfix\n : never\n : never\n\ntype OmitLanguagePostfix<Set> = Set extends string\n ? Set extends `${infer Prefix}_${string}`\n ? Prefix\n : Set\n : never\n\ntype RemoveLanguagePostfixes<F extends GenericFonts> = {\n [Key in OmitLanguagePostfix<keyof F>]: F[Key]\n}\n\ntype GetLanguagePostfixes<F extends GenericFonts> = GetLanguagePostfix<keyof F>\n\n// test RemoveLanguagePostfixes\n// type x = CreateTamaguiConfig<any, any, any, any, any, {\n// body: any,\n// body_en: any\n// }>['fonts']\n\ntype ConfProps<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = {\n tokens: A\n themes: B\n shorthands?: C\n media?: D\n animations?: AnimationDriver<E>\n fonts: F\n}\n\nexport type InferTamaguiConfig<Conf> = Conf extends ConfProps<\n infer A,\n infer B,\n infer C,\n infer D,\n infer E,\n infer F\n>\n ? TamaguiInternalConfig<A, B, C, D, E, F>\n : unknown\n\n// for use in creation functions so it doesnt get overwritten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia,\n GenericAnimations,\n GenericFonts\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeDefinition = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type ThemeKeys = keyof ThemeDefinition\nexport type ThemeParsed = {\n [key in ThemeKeys]: Variable<any>\n}\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\nexport type ThemeName = Exclude<GetAltThemeNames<keyof Themes>, number>\nexport type ThemeTokens = `$${ThemeKeys}`\nexport type AnimationKeys = TamaguiConfig['animations'] extends AnimationDriver<\n infer Config\n>\n ? keyof Config\n : string\nexport type FontLanguages = ArrayIntersection<TamaguiConfig['fontLanguages']>\n\nexport interface ThemeProps {\n className?: string\n name?: Exclude<ThemeName, number> | null\n componentName?: string\n children?: any\n reset?: boolean\n debug?: boolean | 'verbose'\n inverse?: boolean\n // on the web, for portals we need to re-insert className\n forceClassName?: boolean\n // allows for disabling the auto-update behavior\n shouldUpdate?: () => boolean\n}\n\ntype ArrayIntersection<A extends any[]> = A[keyof A]\n\ntype GetAltThemeNames<S> =\n | (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S)\n | S\n\ntype SpacerPropsBase = {\n size?: number | SpaceTokens | null\n flex?: boolean | number\n direction?: SpaceDirection\n}\ntype SpacerOwnProps = SpacerPropsBase &\n //\n WithThemeShorthandsPseudosMediaAnimation<SpacerPropsBase>\n\nexport type SpacerProps = Omit<StackProps, 'flex' | 'direction' | 'size'> &\n //\n SpacerOwnProps\n\nexport type CreateTamaguiProps = {\n reactNative?: any\n shorthands?: CreateShorthands\n media?: GenericTamaguiConfig['media']\n animations?: AnimationDriver<any>\n fonts: GenericTamaguiConfig['fonts']\n tokens: GenericTamaguiConfig['tokens']\n themes: {\n [key: string]: {\n [key: string]: string | number | Variable\n }\n }\n\n /**\n * *Advanced use case* For all CSS extracted views, this has no effect.\n *\n * For SSR compatibility on the web, Tamagui will render once with the settings\n * from `mediaQueryDefaultActive` set for all media queries. Then, it will render\n * again after the initial render using the proper media query values. This is so that\n * hydration will match perfectly with the server.\n *\n * Setting disableSSR will avoid this second render by setting the media query state\n * to the actual browser dimensions on initial load. This is only useful for client-only\n * apps.\n *\n */\n disableSSR?: boolean\n\n /**\n * Disable inserting a theme class in the DOM or context, allowing you to manually place it higher.\n * For custom use cases like integration with next-theme.\n */\n disableRootThemeClass?: boolean\n\n defaultProps?: Record<string, any> & {\n Stack?: StackProps\n Text?: TextProps\n Spacer?: SpacerProps\n }\n\n // for the first render, determines which media queries are true\n // useful for SSR\n mediaQueryDefaultActive?: Record<MediaQueryKey, boolean>\n\n // what's between each CSS style rule, set to \"\\n\" to be easier to read\n // defaults: \"\\n\" when NODE_ENV=development, \"\" otherwise\n cssStyleSeparator?: string\n\n // (Advanced)\n // on the web, tamagui treats `dark` and `light` themes as special and\n // generates extra CSS to avoid having to re-render the entire page.\n // this CSS relies on specificity hacks that multiply by your sub-themes.\n // this sets the maxiumum number of nested dark/light themes you can do\n // defaults to 3 for a balance, but can be higher if you nest them deeply.\n maxDarkLightNesting?: number\n\n // adds @media(prefers-color-scheme) media queries for dark/light\n shouldAddPrefersColorThemes?: boolean\n\n // only if you put the theme classname on the html element we have to generate diff\n themeClassNameOnRoot?: boolean\n}\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 E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> &\n Omit<CreateTamaguiConfig<A, B, C, D, E, F>, 'tokens'> & {\n // TODO need to make it this but this breaks types, revisit\n // animations: E //AnimationDriver<E>\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n tokens: Tokenify<A>\n tokensParsed: Tokenify<A>\n themeConfig: any\n fontsParsed: GenericFonts\n getCSS: () => string\n parsed: boolean\n inverseShorthands: Record<string, string>\n reactNative?: any\n }\n\nexport type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations']\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 TamaguiComponent> = A extends FunctionComponent<\n infer Props\n>\n ? Props\n : unknown\n\nexport type GenericFont<Key extends number | string = number | string> = {\n size: { [key in Key]: number | Variable }\n lineHeight: Partial<{ [key in Key]: number | Variable }>\n letterSpacing: Partial<{ [key in Key]: number | Variable }>\n weight: Partial<{ [key in Key]: number | string | Variable }>\n family: string | Variable\n style?: Partial<{ [key in Key]: TextStyle['fontStyle'] | Variable }>\n transform?: Partial<{ [key in Key]: TextStyle['textTransform'] | Variable }>\n color?: Partial<{ [key in Key]: string | Variable }>\n // for native use only, lets you map to alternative fonts\n face?: Partial<{\n [key in FontWeightSteps]: { normal?: string; italic?: string }\n }>\n}\n\n// media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryKey = keyof Media\nexport type MediaPropKeys = `$${MediaQueryKey}`\nexport type MediaQueryState = { [key in MediaQueryKey]: boolean }\nexport type MediaProps<A> = {\n [key in MediaPropKeys]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\n\nexport interface MediaQueryList {\n addListener(listener?: any): void\n removeListener(listener?: any): void\n matches: boolean\n}\n\nexport type MatchMedia = (query: string) => MediaQueryList\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// animation=\"bouncy\"\n// animation={['bouncy', { }]}\n// { all: 'name' }\n\n// TODO can override for better types\nexport type AnimationConfigType = any\n\nexport type AnimationProp =\n | AnimationKeys\n | {\n [key: string]:\n | AnimationKeys\n | {\n type: AnimationKeys\n [key: string]: any\n }\n }\n | [\n AnimationKeys,\n {\n [key: string]:\n | AnimationKeys\n | {\n type?: AnimationKeys\n [key: string]: any\n }\n }\n ]\n\ntype GetTokenFontKeysFor<\n A extends\n | 'size'\n | 'weight'\n | 'letterSpacing'\n | 'family'\n | 'lineHeight'\n | 'transform'\n | 'style'\n | 'color'\n> = keyof TamaguiConfig['fonts']['body'][A]\n\ntype GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`\n\n// base tokens\nexport type SizeTokens = GetTokenString<keyof Tokens['size']> | number\nexport type SpaceTokens = GetTokenString<keyof Tokens['space']> | number | boolean\n\nexport type ColorTokens =\n | GetTokenString<keyof Tokens['color']>\n | GetTokenString<keyof ThemeParsed>\n | CSSColorNames\nexport type ZIndexTokens = GetTokenString<keyof Tokens['zIndex']> | number\nexport type RadiusTokens = GetTokenString<keyof Tokens['radius']> | number\n\n// font tokens\nexport type FontTokens = GetTokenString<keyof TamaguiConfig['fonts']>\nexport type FontSizeTokens = GetTokenString<GetTokenFontKeysFor<'size'>> | number\nexport type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number\nexport type FontWeightSteps = `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`\nexport type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}` | FontWeightSteps\nexport type FontColorTokens = `$${GetTokenFontKeysFor<'color'>}` | number\nexport type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}` | number\nexport type FontStyleTokens = `$${GetTokenFontKeysFor<'style'>}` | TextStyle['fontStyle']\nexport type FontTransformTokens =\n | `$${GetTokenFontKeysFor<'transform'>}`\n | TextStyle['textTransform']\n\n//\n// adds theme short values to relevant props\n//\n\nexport type ThemeValueByCategory<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends 'size'\n ? SizeTokens\n : K extends 'font'\n ? FontTokens\n : K extends 'fontSize'\n ? FontSizeTokens\n : K extends 'space'\n ? SpaceTokens\n : K extends 'color'\n ? ColorTokens\n : K extends 'zIndex'\n ? ZIndexTokens\n : K extends 'lineHeight'\n ? FontLineHeightTokens\n : K extends 'fontWeight'\n ? FontWeightTokens\n : K extends 'letterSpacing'\n ? FontLetterSpacingTokens\n : {}\n\ntype FontKeys = 'fontFamily'\ntype FontSizeKeys = 'fontSize'\ntype FontWeightKeys = 'fontWeight'\ntype FontLetterSpacingKeys = 'letterSpacing'\ntype LineHeightKeys = 'lineHeight'\ntype ZIndexKeys = 'zIndex'\n\nexport type ThemeValueGet<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends SizeKeys\n ? SizeTokens\n : K extends FontKeys\n ? FontTokens\n : K extends FontSizeKeys\n ? FontSizeTokens\n : K extends `${`border${string | ''}Radius`}`\n ? RadiusTokens\n : K extends SpaceKeys\n ? K extends 'shadowOffset'\n ? { width: SpaceTokens; height: SpaceTokens }\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 : never\n\nexport type ThemeValueFallback = UnionableString | Variable\n\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]: ThemeValueGet<K> extends never\n ? T[K]\n : ThemeValueGet<K> | Exclude<T[K], string> | ThemeValueFallback\n}\n\n// adds shorthand props\nexport type 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 focusStyle?: A | null\n exitStyle?: A | null\n enterStyle?: A | null\n}\n\nexport type PseudoPropKeys = keyof PseudoProps<any>\n\nexport type PseudoStyles = {\n hoverStyle?: ViewStyle\n pressStyle?: ViewStyle\n focusStyle?: ViewStyle\n enterStyle?: ViewStyle\n exitStyle?: ViewStyle\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, pseudos...\n//\ntype WithThemeShorthandsAndPseudos<A extends object> =\n | WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>\n\n//\n// ... media queries and animations\n//\ntype WithThemeShorthandsPseudosMediaAnimation<A extends object> =\n WithThemeShorthandsAndPseudos<A> & MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n/**\n * Base style-only props (no media, pseudo):\n */\n\ntype PropsWebOnly = {\n pointerEvents?: ViewProps['pointerEvents']\n cursor?: Properties['cursor']\n contain?: Properties['contain']\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n userSelect?: Properties['userSelect']\n outlineColor?: Properties['outlineColor']\n outlineStyle?: Properties['outlineStyle']\n outlineOffset?: Properties['outlineOffset']\n outlineWidth?: Properties['outlineWidth']\n tabIndex?: string | number\n role?: string\n}\n\nexport type StackStylePropsBase = Omit<\n ViewStyle,\n 'display' | 'backfaceVisibility' | 'elevation'\n> &\n TransformStyleProps &\n PropsWebOnly\n\nexport type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> &\n TransformStyleProps &\n PropsWebOnly & {\n ellipse?: boolean\n textDecorationDistance?: number\n textOverflow?: Properties['textOverflow']\n whiteSpace?: Properties['whiteSpace']\n wordWrap?: Properties['wordWrap']\n }\n\n//\n// Stack\n//\n\nexport type StackNonStyleProps = Omit<ViewProps, 'display' | 'children'> &\n RNWViewProps &\n TamaguiComponentPropsBase\n\nexport type StackStyleProps =\n WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>\nexport type StackPropsBase = StackNonStyleProps &\n WithThemeAndShorthands<StackStylePropsBase>\nexport type StackProps = StackNonStyleProps & StackStyleProps\n\n//\n// Text props\n//\n\nexport type TextNonStyleProps = Omit<ReactTextProps, 'children'> &\n RNWTextProps &\n TamaguiComponentPropsBase\n\nexport type TextPropsBase = TextNonStyleProps & WithThemeAndShorthands<TextStylePropsBase>\nexport type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>\nexport type TextProps = TextNonStyleProps & TextStyleProps\n\n// could actually infer from parent\nexport type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<\n Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase\n>\n\n//\n// StaticComponent\n//\n\nexport type TamaguiComponent<\n Props = any,\n Ref = any,\n BaseProps = {},\n VariantProps = {}\n> = ReactComponentWithRef<Props, Ref> & StaticComponentObject\n\ntype StaticComponentObject = {\n staticConfig: StaticConfig\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?: Partial<StaticConfig>) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n config: TamaguiInternalConfig\n disableInjectCSS?: boolean\n children?: ReactNode\n}\n\nexport type PropMapper = (\n key: string,\n value: any,\n theme: ThemeParsed,\n props: Record<string, any>,\n state: Partial<SplitStyleState>,\n languageContext?: FontLanguageProps,\n avoidDefaultProps?: boolean,\n debug?: DebugProp\n) => undefined | [string, any][]\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: PropMapper\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type GenericVariantDefinitions = {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfigPublic = {\n /**\n * (compiler) 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 * (compiler) If these props are encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /**\n * (compiler) If these props are encountered, leave them un-extracted.\n */\n inlineProps?: Set<string>\n\n /**\n * (compiler) If not flattening, leave this prop as original value.\n * Only applies to style attributes\n */\n inlineWhenUnflattened?: Set<string>\n\n /**\n * (compiler) 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 * Auto-detected, but can ovverride. Wraps children to space them on top\n */\n isZStack?: boolean\n\n /**\n * Auto-detect, but can override, passes styles properly to react-native-web\n */\n isReactNative?: boolean\n\n /**\n * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,\n * it will assume the passed in component only accepts style={} for react-native compatibility.\n * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.\n */\n acceptsClassName?: boolean\n}\n\nexport type StaticConfig = StaticConfigPublic & {\n Component?: FunctionComponent<any> & StaticComponentObject\n\n variants?: GenericVariantDefinitions\n\n /**\n * Used for applying sub theme style\n */\n componentName?: string\n\n /**\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps: Record<string, any>\n\n /**\n * Merges into defaultProps later on, used internally yonly\n */\n defaultVariants?: { [key: string]: any }\n\n /**\n * Memoize the component\n */\n memo?: boolean\n\n /**\n * Used insternally to attach default props to names\n */\n parentNames?: string[]\n\n /**\n * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,\n * it will assume the passed in component only accepts style={} for react-native compatibility.\n * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.\n */\n acceptsClassName?: boolean\n\n /**\n * Used internally for handling focus\n */\n isInput?: boolean\n}\n\n/**\n * --------------------------------------------\n * variants\n * --------------------------------------------\n */\n\nexport type StylableComponent =\n | TamaguiComponent\n // * excessively deep type instantiation\n // | TamaguiReactElement\n | ComponentType<any>\n | ForwardRefExoticComponent<any>\n | ReactComponentWithRef<any, any>\n | (new (props: any) => any)\n | typeof View\n | typeof Text\n | typeof TextInput\n | typeof Image\n\nexport type GetStyledVariants<A extends TamaguiComponent> = A extends TamaguiComponent<\n any,\n any,\n any,\n infer Variants\n>\n ? Variants\n : never\n\nexport type GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<\n any,\n any,\n infer BaseProps\n>\n ? BaseProps\n : never\n\nexport type GetProps<A extends StylableComponent> = A extends TamaguiComponent<\n infer Props\n>\n ? Props\n : A extends TamaguiReactElement<infer Props>\n ? Props\n : A extends ComponentType<infer Props>\n ? GetGenericComponentTamaguiProps<Props>\n : A extends new (props: infer Props) => any\n ? GetGenericComponentTamaguiProps<Props>\n : {}\n\ntype GetGenericComponentTamaguiProps<P> = P &\n Omit<'textAlign' extends keyof P ? TextProps : StackProps, keyof P>\n\nexport type SpreadKeys =\n | '...fontSize'\n | '...fontStyle'\n | '...fontTransform'\n | '...lineHeight'\n | '...letterSpacing'\n | '...size'\n | '...space'\n | '...color'\n | '...zIndex'\n | '...theme'\n | '...radius'\n\nexport type VariantDefinitions<\n Parent extends StylableComponent = TamaguiComponent,\n MyProps extends Object = GetProps<Parent>,\n Val = any\n> = VariantDefinitionFromProps<MyProps, Val>\n\nexport type VariantDefinitionFromProps<MyProps, Val> = MyProps extends Object\n ? {\n [propName: string]:\n | VariantSpreadFunction<MyProps, Val>\n | ({\n [Key in SpreadKeys]?: Key extends '...fontSize'\n ? FontSizeVariantSpreadFunction<MyProps>\n : Key extends '...size'\n ? SizeVariantSpreadFunction<MyProps>\n : Key extends '...space'\n ? SpaceVariantSpreadFunction<MyProps>\n : Key extends '...color'\n ? ColorVariantSpreadFunction<MyProps>\n : Key extends '...lineHeight'\n ? FontLineHeightVariantSpreadFunction<MyProps>\n : Key extends '...fontTransform'\n ? FontTransformVariantSpreadFunction<MyProps>\n : Key extends '...fontStyle'\n ? FontStyleVariantSpreadFunction<MyProps>\n : Key extends '...letterSpacing'\n ? FontLetterSpacingVariantSpreadFunction<MyProps>\n : Key extends '...zIndex'\n ? ZIndexVariantSpreadFunction<MyProps>\n : Key extends '...radius'\n ? RadiusVariantSpreadFunction<MyProps>\n : Key extends '...theme'\n ? ThemeVariantSpreadFunction<MyProps>\n : never\n } & {\n [Key in string | number | 'true' | 'false']?:\n | MyProps\n | VariantSpreadFunction<MyProps, Val>\n } & {\n [Key in VariantTypeKeys]?: Key extends ':number'\n ? VariantSpreadFunction<MyProps, number>\n : Key extends ':boolean'\n ? VariantSpreadFunction<MyProps, boolean>\n : Key extends ':string'\n ? VariantSpreadFunction<MyProps, string>\n : never\n })\n }\n : never\n\nexport type GenericStackVariants = VariantDefinitionFromProps<StackProps, any>\nexport type GenericTextVariants = VariantDefinitionFromProps<StackProps, any>\n\nexport type GetVariantProps<Variants> = {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n}\n\nexport type VariantSpreadExtras<Props> = {\n fonts: TamaguiConfig['fonts']\n tokens: TamaguiConfig['tokens']\n theme: Themes extends { [key: string]: infer B } ? B : unknown\n props: Props\n}\n\ntype PropLike = { [key: string]: any }\n\nexport type VariantSpreadFunction<Props extends PropLike, Val = any> = (\n val: Val,\n config: VariantSpreadExtras<Props>\n) =>\n | {\n [Key in keyof Props]: Props[Key] | Variable\n }\n | null\n | undefined\n\nexport type VariantTypeKeys = ':string' | ':boolean' | ':number'\n\nexport type GetVariantValues<Key> = Key extends `...${infer VariantSpread}`\n ? ThemeValueByCategory<VariantSpread>\n : Key extends 'true' | 'false'\n ? boolean\n : Key extends ':string'\n ? string\n : Key extends ':boolean'\n ? boolean\n : Key extends ':number'\n ? number\n : Key\n\nexport type FontSizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontSizeTokens\n>\nexport type SizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n SizeTokens\n>\nexport type SpaceVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n SpaceTokens\n>\nexport type ColorVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n ColorTokens\n>\nexport type FontLineHeightVariantSpreadFunction<A extends PropLike> =\n VariantSpreadFunction<A, FontLineHeightTokens>\nexport type FontLetterSpacingVariantSpreadFunction<A extends PropLike> =\n VariantSpreadFunction<A, FontLetterSpacingTokens>\nexport type FontStyleVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontStyleTokens\n>\nexport type FontTransformVariantSpreadFunction<A extends PropLike> =\n VariantSpreadFunction<A, FontTransformTokens>\nexport type ZIndexVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n ZIndexTokens\n>\nexport type RadiusVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n RadiusTokens\n>\nexport type ThemeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n ThemeTokens\n>\n\n/**\n * --------------------------------------------\n * end variants\n * --------------------------------------------\n */\n\ntype SizeKeys =\n | 'width'\n | 'height'\n | 'minWidth'\n | 'minHeight'\n | 'maxWidth'\n | 'maxHeight'\n | 'shadowRadius'\n\ntype ColorKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderTopColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n | 'shadowColor'\n | 'textShadowColor'\n\ntype SpaceKeys =\n | 'space'\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\ntype CSSColorNames =\n | 'aliceblue'\n | 'antiquewhite'\n | 'aqua'\n | 'aquamarine'\n | 'azure'\n | 'beige'\n | 'bisque'\n | 'black'\n | 'blanchedalmond'\n | 'blue'\n | 'blueviolet'\n | 'brown'\n | 'burlywood'\n | 'cadetblue'\n | 'chartreuse'\n | 'chocolate'\n | 'coral'\n | 'cornflowerblue'\n | 'cornsilk'\n | 'crimson'\n | 'cyan'\n | 'darkblue'\n | 'darkcyan'\n | 'darkgoldenrod'\n | 'darkgray'\n | 'darkgreen'\n | 'darkkhaki'\n | 'darkmagenta'\n | 'darkolivegreen'\n | 'darkorange'\n | 'darkorchid'\n | 'darkred'\n | 'darksalmon'\n | 'darkseagreen'\n | 'darkslateblue'\n | 'darkslategray'\n | 'darkturquoise'\n | 'darkviolet'\n | 'deeppink'\n | 'deepskyblue'\n | 'dimgray'\n | 'dodgerblue'\n | 'firebrick'\n | 'floralwhite'\n | 'forestgreen'\n | 'fuchsia'\n | 'gainsboro'\n | 'ghostwhite'\n | 'gold'\n | 'goldenrod'\n | 'gray'\n | 'green'\n | 'greenyellow'\n | 'honeydew'\n | 'hotpink'\n | 'indianred '\n | 'indigo '\n | 'ivory'\n | 'khaki'\n | 'lavender'\n | 'lavenderblush'\n | 'lawngreen'\n | 'lemonchiffon'\n | 'lightblue'\n | 'lightcoral'\n | 'lightcyan'\n | 'lightgoldenrodyellow'\n | 'lightgrey'\n | 'lightgreen'\n | 'lightpink'\n | 'lightsalmon'\n | 'lightseagreen'\n | 'lightskyblue'\n | 'lightslategray'\n | 'lightsteelblue'\n | 'lightyellow'\n | 'lime'\n | 'limegreen'\n | 'linen'\n | 'magenta'\n | 'maroon'\n | 'mediumaquamarine'\n | 'mediumblue'\n | 'mediumorchid'\n | 'mediumpurple'\n | 'mediumseagreen'\n | 'mediumslateblue'\n | 'mediumspringgreen'\n | 'mediumturquoise'\n | 'mediumvioletred'\n | 'midnightblue'\n | 'mintcream'\n | 'mistyrose'\n | 'moccasin'\n | 'navajowhite'\n | 'navy'\n | 'oldlace'\n | 'olive'\n | 'olivedrab'\n | 'orange'\n | 'orangered'\n | 'orchid'\n | 'palegoldenrod'\n | 'palegreen'\n | 'paleturquoise'\n | 'palevioletred'\n | 'papayawhip'\n | 'peachpuff'\n | 'peru'\n | 'pink'\n | 'plum'\n | 'powderblue'\n | 'purple'\n | 'red'\n | 'rosybrown'\n | 'royalblue'\n | 'saddlebrown'\n | 'salmon'\n | 'sandybrown'\n | 'seagreen'\n | 'seashell'\n | 'sienna'\n | 'silver'\n | 'skyblue'\n | 'slateblue'\n | 'slategray'\n | 'snow'\n | 'springgreen'\n | 'steelblue'\n | 'tan'\n | 'teal'\n | 'thistle'\n | 'tomato'\n | 'turquoise'\n | 'violet'\n | 'wheat'\n | 'white'\n | 'whitesmoke'\n | 'yellow'\n | 'yellowgreen'\n\nexport type TamaguiComponentState = {\n hover: boolean\n press: boolean\n pressIn: boolean\n focus: boolean\n unmounted: boolean\n animation?: null | {\n style?: any\n avoidClasses?: boolean\n }\n}\n\nexport type SplitStyleState = TamaguiComponentState & {\n mediaState?: Record<string, boolean>\n noClassNames?: boolean\n dynamicStylesInline?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n fallbackProps?: Record<string, any>\n keepVariantsAsProps?: boolean\n hasTextAncestor?: boolean\n\n // for animations\n isExiting?: boolean\n exitVariant?: string\n enterVariant?: string\n}\n\n// Presence\n\nexport interface PresenceContextProps {\n id: string\n isPresent: boolean\n register: (id: string) => () => void\n onExitComplete?: (id: string) => void\n initial?: false | string | string[]\n custom?: any\n exitVariant?: string | null\n enterVariant?: string | null\n}\n\ntype SafeToRemoveCallback = () => void\ntype AlwaysPresent = [true, null, null]\ntype Present = [true, undefined, PresenceContextProps]\ntype NotPresent = [false, SafeToRemoveCallback, PresenceContextProps]\n\nexport type UsePresenceResult = AlwaysPresent | Present | NotPresent\n\n// Animations:\n\ntype AnimationConfig = {\n [key: string]: any\n}\n\n// includes a very limited adapter between various impls for number => style\n// this is useful only in limited scenarios like `Sheet`, but necessary in those cases\n\nexport type AnimatedNumberStrategy =\n // only values shared between reanimated/react-native for now\n | {\n type: 'spring'\n stiffness?: number\n damping?: number\n mass?: number\n overshootClamping?: boolean\n restSpeedThreshold?: number\n restDisplacementThreshold?: number\n }\n | { type: 'timing'; duration: number }\n | { type: 'direct' }\n\nexport type UniversalAnimatedNumber<A> = {\n getInstance(): A\n getValue(): number\n setValue(next: number, config?: AnimatedNumberStrategy): void\n stop(): void\n}\n\nexport type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {\n isReactNative?: boolean\n useAnimations: UseAnimationHook\n usePresence: () => UsePresenceResult\n useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>\n useAnimatedNumberStyle: <V extends UniversalAnimatedNumber<any>>(\n val: V,\n getStyle: (current: any) => any\n ) => any\n useAnimatedNumberReaction: (\n val: UniversalAnimatedNumber<any>,\n onValue: (current: number) => void\n ) => void\n animations: A\n View?: any\n Text?: any\n}\n\nexport type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>\n\nexport type UseAnimationHook = (props: {\n style: Record<string, any>\n props: Record<string, any>\n presence?: UsePresenceResult | null\n hostRef: RefObject<HTMLElement | View>\n staticConfig: StaticConfigParsed\n state: SplitStyleState\n pseudos: PseudoProps<ViewStyle> | null\n onDidAnimate?: any\n delay?: number\n}) => null | {\n style?: StackStylePropsBase | StackStylePropsBase[]\n}\n\nexport type GestureReponderEvent = Exclude<\n View['props']['onResponderMove'],\n void\n> extends (event: infer Event) => void\n ? Event\n : never\n"],
4
+ "sourcesContent": ["// TODO split this into own package @tamagui/types to share with animations packages\n\nimport type { Properties } from 'csstype'\nimport type {\n ComponentType,\n ForwardRefExoticComponent,\n FunctionComponent,\n HTMLAttributes,\n ReactNode,\n RefAttributes,\n RefObject,\n} from 'react'\nimport type {\n Image,\n PressableProps,\n TextProps as ReactTextProps,\n Text,\n TextInput,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport type { Variable } from './createVariable'\nimport type { ResolveVariableTypes } from './helpers/createPropMapper'\nimport type { TamaguiReactElement } from './static'\nimport type { RNWTextProps, RNWViewProps } from './types-rnw'\nimport type { FontLanguageProps } from './views/FontLanguage.types'\nimport type { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type SpaceDirection = 'vertical' | 'horizontal' | 'both'\n\nexport type TamaguiElement = HTMLElement | View\n\nexport type DebugProp = boolean | 'break' | 'verbose'\n\n// base props that are accepted by createComponent (additional to react-native-web)\n\ntype DivAttributes = HTMLAttributes<HTMLDivElement>\n\nexport type TamaguiComponentPropsBase = {\n hitSlop?: PressableProps['hitSlop']\n asChild?: boolean\n space?: SpaceTokens | null\n spaceDirection?: SpaceDirection\n separator?: ReactNode\n dangerouslySetInnerHTML?: { __html: string }\n animation?: AnimationProp | null\n animateOnly?: string[]\n children?: any | any[]\n debug?: DebugProp\n disabled?: boolean\n className?: string\n themeShallow?: boolean\n id?: string\n tag?: string\n theme?: ThemeName | null\n componentName?: string\n /**\n * Forces the pseudo style state to be on\n */\n forceStyle?: 'hover' | 'press' | 'focus'\n onHoverIn?: DivAttributes['onMouseEnter']\n onHoverOut?: DivAttributes['onMouseLeave']\n onPress?: PressableProps['onPress']\n onPressIn?: PressableProps['onPress']\n onPressOut?: PressableProps['onPress']\n // WEB ONLY\n onMouseEnter?: DivAttributes['onMouseEnter']\n onMouseLeave?: DivAttributes['onMouseLeave']\n onMouseDown?: DivAttributes['onMouseDown']\n}\n\nexport type ReactComponentWithRef<Props, Ref> = ForwardRefExoticComponent<\n Props & RefAttributes<Ref>\n>\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 type VariableVal = number | string | Variable\nexport type VariableColorVal = string | Variable\n\ntype GenericKey = string | number | symbol\n\nexport interface CreateTokens<Val extends VariableVal = VariableVal> {\n color: { [key: GenericKey]: Val }\n space: { [key: GenericKey]: Val }\n size: { [key: GenericKey]: Val }\n radius: { [key: GenericKey]: Val }\n zIndex: { [key: GenericKey]: Val }\n}\n\ntype Tokenify<A extends GenericTokens> = {\n color: TokenifyRecord<A['color']>\n space: TokenifyRecord<A['space']>\n size: TokenifyRecord<A['size']>\n radius: TokenifyRecord<A['radius']>\n zIndex: TokenifyRecord<A['zIndex']>\n}\n\ntype TokenifyRecord<A extends CreateTokens[keyof CreateTokens]> = {\n [Key in keyof A]: A[Key] extends Variable ? A[Key] : Variable<A[Key]>\n}\n\nexport type TamaguiBaseTheme = {\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 background: VariableColorVal\n backgroundHover: VariableColorVal\n backgroundPress: VariableColorVal\n backgroundFocus: VariableColorVal\n color: VariableColorVal\n colorHover: VariableColorVal\n colorPress: VariableColorVal\n colorFocus: VariableColorVal\n borderColor: VariableColorVal\n borderColorHover: VariableColorVal\n borderColorPress: VariableColorVal\n borderColorFocus: VariableColorVal\n shadowColor: VariableColorVal\n shadowColorHover: VariableColorVal\n shadowColorPress: VariableColorVal\n shadowColorFocus: VariableColorVal\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]:\n | Partial<TamaguiBaseTheme> & {\n [key: string]: VariableVal\n }\n}\n\ntype AllStyleKeys = keyof StackStylePropsBase | keyof TextStylePropsBase\n\nexport type CreateShorthands = {\n [key: string]: AllStyleKeys\n}\n\nexport type GenericShorthands = {}\n\n// sm: { minWidth: 100 }\ntype GenericMedia = {\n [key: string]: {\n [key: string]: number | string\n }\n}\n\nexport type GenericFonts = Record<string, GenericFont>\n\ntype GenericAnimations = {\n [key: string]:\n | string\n | {\n [key: string]: any\n }\n | any[]\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 = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = {\n fonts: RemoveLanguagePostfixes<F>\n fontLanguages: GetLanguagePostfixes<F> extends never\n ? string[]\n : GetLanguagePostfixes<F>[]\n tokens: A\n // parsed\n themes: {\n [Name in keyof B]: {\n [Key in keyof B[Name]]: Variable\n }\n }\n shorthands: C\n media: D\n animations: AnimationDriver<E>\n}\n\ntype GetLanguagePostfix<Set> = Set extends string\n ? Set extends `${string}_${infer Postfix}`\n ? Postfix\n : never\n : never\n\ntype OmitLanguagePostfix<Set> = Set extends string\n ? Set extends `${infer Prefix}_${string}`\n ? Prefix\n : Set\n : never\n\ntype RemoveLanguagePostfixes<F extends GenericFonts> = {\n [Key in OmitLanguagePostfix<keyof F>]: F[Key]\n}\n\ntype GetLanguagePostfixes<F extends GenericFonts> = GetLanguagePostfix<keyof F>\n\n// test RemoveLanguagePostfixes\n// type x = CreateTamaguiConfig<any, any, any, any, any, {\n// body: any,\n// body_en: any\n// }>['fonts']\n\ntype ConfProps<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = {\n tokens: A\n themes: B\n shorthands?: C\n media?: D\n animations?: AnimationDriver<E>\n fonts: F\n}\n\nexport type InferTamaguiConfig<Conf> = Conf extends ConfProps<\n infer A,\n infer B,\n infer C,\n infer D,\n infer E,\n infer F\n>\n ? TamaguiInternalConfig<A, B, C, D, E, F>\n : unknown\n\n// for use in creation functions so it doesnt get overwritten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia,\n GenericAnimations,\n GenericFonts\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeDefinition = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type ThemeKeys = keyof ThemeDefinition\nexport type ThemeParsed = {\n [key in ThemeKeys]: Variable<any>\n}\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\nexport type ThemeName = Exclude<GetAltThemeNames<keyof Themes>, number>\nexport type ThemeTokens = `$${ThemeKeys}`\nexport type AnimationKeys = TamaguiConfig['animations'] extends AnimationDriver<\n infer Config\n>\n ? keyof Config\n : string\nexport type FontLanguages = ArrayIntersection<TamaguiConfig['fontLanguages']>\n\nexport interface ThemeProps {\n className?: string\n name?: Exclude<ThemeName, number> | null\n componentName?: string\n children?: any\n reset?: boolean\n debug?: boolean | 'verbose'\n inverse?: boolean\n // on the web, for portals we need to re-insert className\n forceClassName?: boolean\n // allows for disabling the auto-update behavior\n shouldUpdate?: () => boolean\n}\n\ntype ArrayIntersection<A extends any[]> = A[keyof A]\n\ntype GetAltThemeNames<S> =\n | (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S)\n | S\n\ntype SpacerPropsBase = {\n size?: number | SpaceTokens | null\n flex?: boolean | number\n direction?: SpaceDirection\n}\ntype SpacerOwnProps = SpacerPropsBase &\n //\n WithThemeShorthandsPseudosMediaAnimation<SpacerPropsBase>\n\nexport type SpacerProps = Omit<StackProps, 'flex' | 'direction' | 'size'> &\n //\n SpacerOwnProps\n\nexport type CreateTamaguiProps = {\n reactNative?: any\n shorthands?: CreateShorthands\n media?: GenericTamaguiConfig['media']\n animations?: AnimationDriver<any>\n fonts: GenericTamaguiConfig['fonts']\n tokens: GenericTamaguiConfig['tokens']\n themes: {\n [key: string]: {\n [key: string]: string | number | Variable\n }\n }\n\n /**\n * *Advanced use case* For all CSS extracted views, this has no effect.\n *\n * For SSR compatibility on the web, Tamagui will render once with the settings\n * from `mediaQueryDefaultActive` set for all media queries. Then, it will render\n * again after the initial render using the proper media query values. This is so that\n * hydration will match perfectly with the server.\n *\n * Setting disableSSR will avoid this second render by setting the media query state\n * to the actual browser dimensions on initial load. This is only useful for client-only\n * apps.\n *\n */\n disableSSR?: boolean\n\n /**\n * Disable inserting a theme class in the DOM or context, allowing you to manually place it higher.\n * For custom use cases like integration with next-theme.\n */\n disableRootThemeClass?: boolean\n\n defaultProps?: Record<string, any> & {\n Stack?: StackProps\n Text?: TextProps\n Spacer?: SpacerProps\n }\n\n // for the first render, determines which media queries are true\n // useful for SSR\n mediaQueryDefaultActive?: Record<MediaQueryKey, boolean>\n\n // what's between each CSS style rule, set to \"\\n\" to be easier to read\n // defaults: \"\\n\" when NODE_ENV=development, \"\" otherwise\n cssStyleSeparator?: string\n\n // (Advanced)\n // on the web, tamagui treats `dark` and `light` themes as special and\n // generates extra CSS to avoid having to re-render the entire page.\n // this CSS relies on specificity hacks that multiply by your sub-themes.\n // this sets the maxiumum number of nested dark/light themes you can do\n // defaults to 3 for a balance, but can be higher if you nest them deeply.\n maxDarkLightNesting?: number\n\n // adds @media(prefers-color-scheme) media queries for dark/light\n shouldAddPrefersColorThemes?: boolean\n\n // only if you put the theme classname on the html element we have to generate diff\n themeClassNameOnRoot?: boolean\n}\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 E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = Omit<CreateTamaguiProps, keyof GenericTamaguiConfig> &\n Omit<CreateTamaguiConfig<A, B, C, D, E, F>, 'tokens'> & {\n // TODO need to make it this but this breaks types, revisit\n // animations: E //AnimationDriver<E>\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n tokens: Tokenify<A>\n tokensParsed: Tokenify<A>\n themeConfig: any\n fontsParsed: GenericFonts\n getCSS: () => string\n parsed: boolean\n inverseShorthands: Record<string, string>\n reactNative?: any\n }\n\nexport type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations']\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 TamaguiComponent> = A extends FunctionComponent<\n infer Props\n>\n ? Props\n : unknown\n\nexport type GenericFont<Key extends number | string = number | string> = {\n size: { [key in Key]: number | Variable }\n lineHeight: Partial<{ [key in Key]: number | Variable }>\n letterSpacing: Partial<{ [key in Key]: number | Variable }>\n weight: Partial<{ [key in Key]: number | string | Variable }>\n family: string | Variable\n style?: Partial<{ [key in Key]: TextStyle['fontStyle'] | Variable }>\n transform?: Partial<{ [key in Key]: TextStyle['textTransform'] | Variable }>\n color?: Partial<{ [key in Key]: string | Variable }>\n // for native use only, lets you map to alternative fonts\n face?: Partial<{\n [key in FontWeightSteps]: { normal?: string; italic?: string }\n }>\n}\n\n// media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryKey = keyof Media\nexport type MediaPropKeys = `$${MediaQueryKey}`\nexport type MediaQueryState = { [key in MediaQueryKey]: boolean }\nexport type MediaProps<A> = {\n [key in MediaPropKeys]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\n\nexport interface MediaQueryList {\n addListener(listener?: any): void\n removeListener(listener?: any): void\n matches: boolean\n}\n\nexport type MatchMedia = (query: string) => MediaQueryList\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// animation=\"bouncy\"\n// animation={['bouncy', { }]}\n// { all: 'name' }\n\n// TODO can override for better types\nexport type AnimationConfigType = any\n\nexport type AnimationProp =\n | AnimationKeys\n | {\n [key: string]:\n | AnimationKeys\n | {\n type: AnimationKeys\n [key: string]: any\n }\n }\n | [\n AnimationKeys,\n {\n [key: string]:\n | AnimationKeys\n | {\n type?: AnimationKeys\n [key: string]: any\n }\n }\n ]\n\ntype GetTokenFontKeysFor<\n A extends\n | 'size'\n | 'weight'\n | 'letterSpacing'\n | 'family'\n | 'lineHeight'\n | 'transform'\n | 'style'\n | 'color'\n> = keyof TamaguiConfig['fonts']['body'][A]\n\ntype GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`\n\n// base tokens\nexport type SizeTokens = GetTokenString<keyof Tokens['size']> | number\nexport type SpaceTokens = GetTokenString<keyof Tokens['space']> | number | boolean\n\nexport type ColorTokens =\n | GetTokenString<keyof Tokens['color']>\n | GetTokenString<keyof ThemeParsed>\n | CSSColorNames\nexport type ZIndexTokens = GetTokenString<keyof Tokens['zIndex']> | number\nexport type RadiusTokens = GetTokenString<keyof Tokens['radius']> | number\n\n// font tokens\nexport type FontTokens = GetTokenString<keyof TamaguiConfig['fonts']>\nexport type FontSizeTokens = GetTokenString<GetTokenFontKeysFor<'size'>> | number\nexport type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number\nexport type FontWeightSteps = `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`\nexport type FontWeightTokens = `$${GetTokenFontKeysFor<'weight'>}` | FontWeightSteps\nexport type FontColorTokens = `$${GetTokenFontKeysFor<'color'>}` | number\nexport type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}` | number\nexport type FontStyleTokens = `$${GetTokenFontKeysFor<'style'>}` | TextStyle['fontStyle']\nexport type FontTransformTokens =\n | `$${GetTokenFontKeysFor<'transform'>}`\n | TextStyle['textTransform']\n\n//\n// adds theme short values to relevant props\n//\n\nexport type ThemeValueByCategory<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends 'size'\n ? SizeTokens\n : K extends 'font'\n ? FontTokens\n : K extends 'fontSize'\n ? FontSizeTokens\n : K extends 'space'\n ? SpaceTokens\n : K extends 'color'\n ? ColorTokens\n : K extends 'zIndex'\n ? ZIndexTokens\n : K extends 'lineHeight'\n ? FontLineHeightTokens\n : K extends 'fontWeight'\n ? FontWeightTokens\n : K extends 'letterSpacing'\n ? FontLetterSpacingTokens\n : {}\n\ntype FontKeys = 'fontFamily'\ntype FontSizeKeys = 'fontSize'\ntype FontWeightKeys = 'fontWeight'\ntype FontLetterSpacingKeys = 'letterSpacing'\ntype LineHeightKeys = 'lineHeight'\ntype ZIndexKeys = 'zIndex'\n\nexport type ThemeValueGet<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends SizeKeys\n ? SizeTokens\n : K extends FontKeys\n ? FontTokens\n : K extends FontSizeKeys\n ? FontSizeTokens\n : K extends `${`border${string | ''}Radius`}`\n ? RadiusTokens\n : K extends SpaceKeys\n ? K extends 'shadowOffset'\n ? { width: SpaceTokens; height: SpaceTokens }\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 : never\n\nexport type ThemeValueFallback = UnionableString | Variable\n\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]: ThemeValueGet<K> extends never\n ? T[K]\n : ThemeValueGet<K> | Exclude<T[K], string> | ThemeValueFallback\n}\n\n// adds shorthand props\nexport type 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 focusStyle?: A | null\n exitStyle?: A | null\n enterStyle?: A | null\n}\n\nexport type PseudoPropKeys = keyof PseudoProps<any>\n\nexport type PseudoStyles = {\n hoverStyle?: ViewStyle\n pressStyle?: ViewStyle\n focusStyle?: ViewStyle\n enterStyle?: ViewStyle\n exitStyle?: ViewStyle\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, pseudos...\n//\ntype WithThemeShorthandsAndPseudos<A extends object> =\n | WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>\n\n//\n// ... media queries and animations\n//\ntype WithThemeShorthandsPseudosMediaAnimation<A extends object> =\n WithThemeShorthandsAndPseudos<A> & MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n/**\n * Base style-only props (no media, pseudo):\n */\n\ntype PropsWebOnly = {\n pointerEvents?: ViewProps['pointerEvents']\n cursor?: Properties['cursor']\n contain?: Properties['contain']\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n userSelect?: Properties['userSelect']\n outlineColor?: Properties['outlineColor']\n outlineStyle?: Properties['outlineStyle']\n outlineOffset?: Properties['outlineOffset']\n outlineWidth?: Properties['outlineWidth']\n tabIndex?: string | number\n role?: string\n}\n\nexport type StackStylePropsBase = Omit<\n ViewStyle,\n 'display' | 'backfaceVisibility' | 'elevation'\n> &\n TransformStyleProps &\n PropsWebOnly\n\nexport type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> &\n TransformStyleProps &\n PropsWebOnly & {\n ellipse?: boolean\n textDecorationDistance?: number\n textOverflow?: Properties['textOverflow']\n whiteSpace?: Properties['whiteSpace']\n wordWrap?: Properties['wordWrap']\n }\n\n//\n// Stack\n//\n\nexport type StackNonStyleProps = Omit<ViewProps, 'display' | 'children'> &\n RNWViewProps &\n TamaguiComponentPropsBase\n\nexport type StackStyleProps =\n WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>\nexport type StackPropsBase = StackNonStyleProps &\n WithThemeAndShorthands<StackStylePropsBase>\nexport type StackProps = StackNonStyleProps & StackStyleProps\n\n//\n// Text props\n//\n\nexport type TextNonStyleProps = Omit<ReactTextProps, 'children'> &\n RNWTextProps &\n TamaguiComponentPropsBase\n\nexport type TextPropsBase = TextNonStyleProps & WithThemeAndShorthands<TextStylePropsBase>\nexport type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>\nexport type TextProps = TextNonStyleProps & TextStyleProps\n\n// could actually infer from parent\nexport type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<\n Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase\n>\n\n//\n// StaticComponent\n//\n\nexport type TamaguiComponent<\n Props = any,\n Ref = any,\n BaseProps = {},\n VariantProps = {}\n> = ReactComponentWithRef<Props, Ref> & StaticComponentObject\n\ntype StaticComponentObject = {\n staticConfig: StaticConfigParsed\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?: Partial<StaticConfig>) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n config: TamaguiInternalConfig\n disableInjectCSS?: boolean\n children?: ReactNode\n}\n\nexport type PropMapper = (\n key: string,\n value: any,\n theme: ThemeParsed,\n props: Record<string, any>,\n state: Partial<SplitStyleState>,\n languageContext?: FontLanguageProps,\n avoidDefaultProps?: boolean,\n debug?: DebugProp\n) => undefined | [string, any][]\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: PropMapper\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type GenericVariantDefinitions = {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfigPublic = {\n /**\n * (compiler) 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 * (compiler) If these props are encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /**\n * (compiler) If these props are encountered, leave them un-extracted.\n */\n inlineProps?: Set<string>\n\n /**\n * (compiler) If not flattening, leave this prop as original value.\n * Only applies to style attributes\n */\n inlineWhenUnflattened?: Set<string>\n\n /**\n * (compiler) 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 * Auto-detected, but can ovverride. Wraps children to space them on top\n */\n isZStack?: boolean\n\n /**\n * Auto-detect, but can override, passes styles properly to react-native-web\n */\n isReactNative?: boolean\n\n /**\n * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,\n * it will assume the passed in component only accepts style={} for react-native compatibility.\n * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.\n */\n acceptsClassName?: boolean\n}\n\nexport type StaticConfig = StaticConfigPublic & {\n Component?: FunctionComponent<any> & StaticComponentObject\n\n variants?: GenericVariantDefinitions\n\n /**\n * Used for applying sub theme style\n */\n componentName?: string\n\n /**\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps: Record<string, any>\n\n /**\n * Merges into defaultProps later on, used internally yonly\n */\n defaultVariants?: { [key: string]: any }\n\n /**\n * Memoize the component\n */\n memo?: boolean\n\n /**\n * Used insternally to attach default props to names\n */\n parentNames?: string[]\n\n /**\n * By default if styled() doesn't recognize a parent Tamagui compoent or specific react-native views,\n * it will assume the passed in component only accepts style={} for react-native compatibility.\n * Setting `acceptsClassName: true` indicates Tamagui can pass in className props.\n */\n acceptsClassName?: boolean\n\n /**\n * Used internally for handling focus\n */\n isInput?: boolean\n}\n\n/**\n * --------------------------------------------\n * variants\n * --------------------------------------------\n */\n\nexport type StylableComponent =\n | TamaguiComponent\n // * excessively deep type instantiation\n // | TamaguiReactElement\n | ComponentType<any>\n | ForwardRefExoticComponent<any>\n | ReactComponentWithRef<any, any>\n | (new (props: any) => any)\n | typeof View\n | typeof Text\n | typeof TextInput\n | typeof Image\n\nexport type GetStyledVariants<A extends TamaguiComponent> = A extends TamaguiComponent<\n any,\n any,\n any,\n infer Variants\n>\n ? Variants\n : never\n\nexport type GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<\n any,\n any,\n infer BaseProps\n>\n ? BaseProps\n : never\n\nexport type GetProps<A extends StylableComponent> = A extends TamaguiComponent<\n infer Props\n>\n ? Props\n : A extends TamaguiReactElement<infer Props>\n ? Props\n : A extends ComponentType<infer Props>\n ? GetGenericComponentTamaguiProps<Props>\n : A extends new (props: infer Props) => any\n ? GetGenericComponentTamaguiProps<Props>\n : {}\n\ntype GetGenericComponentTamaguiProps<P> = P &\n Omit<'textAlign' extends keyof P ? TextProps : StackProps, keyof P>\n\nexport type SpreadKeys =\n | '...fontSize'\n | '...fontStyle'\n | '...fontTransform'\n | '...lineHeight'\n | '...letterSpacing'\n | '...size'\n | '...space'\n | '...color'\n | '...zIndex'\n | '...theme'\n | '...radius'\n\nexport type VariantDefinitions<\n Parent extends StylableComponent = TamaguiComponent,\n MyProps extends Object = GetProps<Parent>,\n Val = any\n> = VariantDefinitionFromProps<MyProps, Val>\n\nexport type VariantDefinitionFromProps<MyProps, Val> = MyProps extends Object\n ? {\n [propName: string]:\n | VariantSpreadFunction<MyProps, Val>\n | ({\n [Key in SpreadKeys]?: Key extends '...fontSize'\n ? FontSizeVariantSpreadFunction<MyProps>\n : Key extends '...size'\n ? SizeVariantSpreadFunction<MyProps>\n : Key extends '...space'\n ? SpaceVariantSpreadFunction<MyProps>\n : Key extends '...color'\n ? ColorVariantSpreadFunction<MyProps>\n : Key extends '...lineHeight'\n ? FontLineHeightVariantSpreadFunction<MyProps>\n : Key extends '...fontTransform'\n ? FontTransformVariantSpreadFunction<MyProps>\n : Key extends '...fontStyle'\n ? FontStyleVariantSpreadFunction<MyProps>\n : Key extends '...letterSpacing'\n ? FontLetterSpacingVariantSpreadFunction<MyProps>\n : Key extends '...zIndex'\n ? ZIndexVariantSpreadFunction<MyProps>\n : Key extends '...radius'\n ? RadiusVariantSpreadFunction<MyProps>\n : Key extends '...theme'\n ? ThemeVariantSpreadFunction<MyProps>\n : never\n } & {\n [Key in string | number | 'true' | 'false']?:\n | MyProps\n | VariantSpreadFunction<MyProps, Val>\n } & {\n [Key in VariantTypeKeys]?: Key extends ':number'\n ? VariantSpreadFunction<MyProps, number>\n : Key extends ':boolean'\n ? VariantSpreadFunction<MyProps, boolean>\n : Key extends ':string'\n ? VariantSpreadFunction<MyProps, string>\n : never\n })\n }\n : never\n\nexport type GenericStackVariants = VariantDefinitionFromProps<StackProps, any>\nexport type GenericTextVariants = VariantDefinitionFromProps<StackProps, any>\n\nexport type GetVariantProps<Variants> = {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n}\n\nexport type VariantSpreadExtras<Props> = {\n fonts: TamaguiConfig['fonts']\n tokens: TamaguiConfig['tokens']\n theme: Themes extends { [key: string]: infer B } ? B : unknown\n props: Props\n}\n\ntype PropLike = { [key: string]: any }\n\nexport type VariantSpreadFunction<Props extends PropLike, Val = any> = (\n val: Val,\n config: VariantSpreadExtras<Props>\n) =>\n | {\n [Key in keyof Props]: Props[Key] | Variable\n }\n | null\n | undefined\n\nexport type VariantTypeKeys = ':string' | ':boolean' | ':number'\n\nexport type GetVariantValues<Key> = Key extends `...${infer VariantSpread}`\n ? ThemeValueByCategory<VariantSpread>\n : Key extends 'true' | 'false'\n ? boolean\n : Key extends ':string'\n ? string\n : Key extends ':boolean'\n ? boolean\n : Key extends ':number'\n ? number\n : Key\n\nexport type FontSizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontSizeTokens\n>\nexport type SizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n SizeTokens\n>\nexport type SpaceVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n SpaceTokens\n>\nexport type ColorVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n ColorTokens\n>\nexport type FontLineHeightVariantSpreadFunction<A extends PropLike> =\n VariantSpreadFunction<A, FontLineHeightTokens>\nexport type FontLetterSpacingVariantSpreadFunction<A extends PropLike> =\n VariantSpreadFunction<A, FontLetterSpacingTokens>\nexport type FontStyleVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontStyleTokens\n>\nexport type FontTransformVariantSpreadFunction<A extends PropLike> =\n VariantSpreadFunction<A, FontTransformTokens>\nexport type ZIndexVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n ZIndexTokens\n>\nexport type RadiusVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n RadiusTokens\n>\nexport type ThemeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n ThemeTokens\n>\n\n/**\n * --------------------------------------------\n * end variants\n * --------------------------------------------\n */\n\ntype SizeKeys =\n | 'width'\n | 'height'\n | 'minWidth'\n | 'minHeight'\n | 'maxWidth'\n | 'maxHeight'\n | 'shadowRadius'\n\ntype ColorKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderTopColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n | 'shadowColor'\n | 'textShadowColor'\n\ntype SpaceKeys =\n | 'space'\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\ntype CSSColorNames =\n | 'aliceblue'\n | 'antiquewhite'\n | 'aqua'\n | 'aquamarine'\n | 'azure'\n | 'beige'\n | 'bisque'\n | 'black'\n | 'blanchedalmond'\n | 'blue'\n | 'blueviolet'\n | 'brown'\n | 'burlywood'\n | 'cadetblue'\n | 'chartreuse'\n | 'chocolate'\n | 'coral'\n | 'cornflowerblue'\n | 'cornsilk'\n | 'crimson'\n | 'cyan'\n | 'darkblue'\n | 'darkcyan'\n | 'darkgoldenrod'\n | 'darkgray'\n | 'darkgreen'\n | 'darkkhaki'\n | 'darkmagenta'\n | 'darkolivegreen'\n | 'darkorange'\n | 'darkorchid'\n | 'darkred'\n | 'darksalmon'\n | 'darkseagreen'\n | 'darkslateblue'\n | 'darkslategray'\n | 'darkturquoise'\n | 'darkviolet'\n | 'deeppink'\n | 'deepskyblue'\n | 'dimgray'\n | 'dodgerblue'\n | 'firebrick'\n | 'floralwhite'\n | 'forestgreen'\n | 'fuchsia'\n | 'gainsboro'\n | 'ghostwhite'\n | 'gold'\n | 'goldenrod'\n | 'gray'\n | 'green'\n | 'greenyellow'\n | 'honeydew'\n | 'hotpink'\n | 'indianred '\n | 'indigo '\n | 'ivory'\n | 'khaki'\n | 'lavender'\n | 'lavenderblush'\n | 'lawngreen'\n | 'lemonchiffon'\n | 'lightblue'\n | 'lightcoral'\n | 'lightcyan'\n | 'lightgoldenrodyellow'\n | 'lightgrey'\n | 'lightgreen'\n | 'lightpink'\n | 'lightsalmon'\n | 'lightseagreen'\n | 'lightskyblue'\n | 'lightslategray'\n | 'lightsteelblue'\n | 'lightyellow'\n | 'lime'\n | 'limegreen'\n | 'linen'\n | 'magenta'\n | 'maroon'\n | 'mediumaquamarine'\n | 'mediumblue'\n | 'mediumorchid'\n | 'mediumpurple'\n | 'mediumseagreen'\n | 'mediumslateblue'\n | 'mediumspringgreen'\n | 'mediumturquoise'\n | 'mediumvioletred'\n | 'midnightblue'\n | 'mintcream'\n | 'mistyrose'\n | 'moccasin'\n | 'navajowhite'\n | 'navy'\n | 'oldlace'\n | 'olive'\n | 'olivedrab'\n | 'orange'\n | 'orangered'\n | 'orchid'\n | 'palegoldenrod'\n | 'palegreen'\n | 'paleturquoise'\n | 'palevioletred'\n | 'papayawhip'\n | 'peachpuff'\n | 'peru'\n | 'pink'\n | 'plum'\n | 'powderblue'\n | 'purple'\n | 'red'\n | 'rosybrown'\n | 'royalblue'\n | 'saddlebrown'\n | 'salmon'\n | 'sandybrown'\n | 'seagreen'\n | 'seashell'\n | 'sienna'\n | 'silver'\n | 'skyblue'\n | 'slateblue'\n | 'slategray'\n | 'snow'\n | 'springgreen'\n | 'steelblue'\n | 'tan'\n | 'teal'\n | 'thistle'\n | 'tomato'\n | 'turquoise'\n | 'violet'\n | 'wheat'\n | 'white'\n | 'whitesmoke'\n | 'yellow'\n | 'yellowgreen'\n\nexport type TamaguiComponentState = {\n hover: boolean\n press: boolean\n pressIn: boolean\n focus: boolean\n unmounted: boolean\n animation?: null | {\n style?: any\n avoidClasses?: boolean\n }\n}\n\nexport type SplitStyleState = TamaguiComponentState & {\n mediaState?: Record<string, boolean>\n noClassNames?: boolean\n dynamicStylesInline?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n fallbackProps?: Record<string, any>\n keepVariantsAsProps?: boolean\n hasTextAncestor?: boolean\n\n // for animations\n isExiting?: boolean\n exitVariant?: string\n enterVariant?: string\n}\n\n// Presence\n\nexport interface PresenceContextProps {\n id: string\n isPresent: boolean\n register: (id: string) => () => void\n onExitComplete?: (id: string) => void\n initial?: false | string | string[]\n custom?: any\n exitVariant?: string | null\n enterVariant?: string | null\n}\n\ntype SafeToRemoveCallback = () => void\ntype AlwaysPresent = [true, null, null]\ntype Present = [true, undefined, PresenceContextProps]\ntype NotPresent = [false, SafeToRemoveCallback, PresenceContextProps]\n\nexport type UsePresenceResult = AlwaysPresent | Present | NotPresent\n\n// Animations:\n\ntype AnimationConfig = {\n [key: string]: any\n}\n\n// includes a very limited adapter between various impls for number => style\n// this is useful only in limited scenarios like `Sheet`, but necessary in those cases\n\nexport type AnimatedNumberStrategy =\n // only values shared between reanimated/react-native for now\n | {\n type: 'spring'\n stiffness?: number\n damping?: number\n mass?: number\n overshootClamping?: boolean\n restSpeedThreshold?: number\n restDisplacementThreshold?: number\n }\n | { type: 'timing'; duration: number }\n | { type: 'direct' }\n\nexport type UniversalAnimatedNumber<A> = {\n getInstance(): A\n getValue(): number\n setValue(next: number, config?: AnimatedNumberStrategy): void\n stop(): void\n}\n\nexport type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {\n isReactNative?: boolean\n useAnimations: UseAnimationHook\n usePresence: () => UsePresenceResult\n useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>\n useAnimatedNumberStyle: <V extends UniversalAnimatedNumber<any>>(\n val: V,\n getStyle: (current: any) => any\n ) => any\n useAnimatedNumberReaction: (\n val: UniversalAnimatedNumber<any>,\n onValue: (current: number) => void\n ) => void\n animations: A\n View?: any\n Text?: any\n}\n\nexport type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>\n\nexport type UseAnimationHook = (props: {\n style: Record<string, any>\n props: Record<string, any>\n presence?: UsePresenceResult | null\n hostRef: RefObject<HTMLElement | View>\n staticConfig: StaticConfigParsed\n state: SplitStyleState\n pseudos: PseudoProps<ViewStyle> | null\n onDidAnimate?: any\n delay?: number\n}) => null | {\n style?: StackStylePropsBase | StackStylePropsBase[]\n}\n\nexport type GestureReponderEvent = Exclude<\n View['props']['onResponderMove'],\n void\n> extends (event: infer Event) => void\n ? Event\n : never\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -19,8 +19,8 @@ const getConfig = () => {
19
19
  }
20
20
  return conf;
21
21
  };
22
- const getTokens = (prefixed) => prefixed ? conf.tokensParsed : conf.tokens;
23
- const useTokens = getTokens;
22
+ const getTokens = ({ prefixed = true } = {}) => prefixed ? conf.tokensParsed : conf.tokens;
23
+ const useTokens = () => getTokens();
24
24
  const getThemes = () => conf.themes;
25
25
  const configListeners = /* @__PURE__ */ new Set();
26
26
  const onConfiguredOnce = (cb) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/config.ts"],
4
- "sourcesContent": ["import { ConfigListener, TamaguiInternalConfig, Tokens } from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n configListeners.forEach((cb) => cb(next))\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n conf!.fonts[name] = font\n conf!.fontsParsed[`$${name}`] = fontParsed\n}\n\nexport const getConfig = () => {\n if (!conf) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.`\n : 'Err0'\n )\n }\n return conf\n}\nexport const getTokens = (prefixed?: boolean): Tokens =>\n prefixed ? conf!.tokensParsed : conf!.tokens\n\n/**\n * Note: this is the same as `getTokens`\n */\nexport const useTokens = getTokens\n\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf)\n } else {\n configListeners.add(cb)\n }\n}\n\nexport const updateConfig = (key: string, value: any) => {\n Object.assign(key, value)\n}\n\n// searches by value name or token name\nexport const getFont = (name: string) => {\n const conf = getConfig()\n return (\n conf.fontsParsed[name] ??\n Object.entries(conf.fontsParsed).find(\n ([k]) => conf.fontsPars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from './types'\n\nlet conf: TamaguiInternalConfig | null\n\nexport const setConfig = (next: TamaguiInternalConfig) => {\n conf = next\n configListeners.forEach((cb) => cb(next))\n}\n\nexport const setConfigFont = (name: string, font: any, fontParsed: any) => {\n if (process.env.NODE_ENV === 'development') {\n if (!conf) throw new Error(`Haven't called createTamagui yet`)\n }\n conf!.fonts[name] = font\n conf!.fontsParsed[`$${name}`] = fontParsed\n}\n\nexport const getConfig = () => {\n if (!conf) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? `Missing tamagui config, you either have a duplicate config, or haven't set it up. Be sure createTamagui is called before rendering.`\n : 'Err0'\n )\n }\n return conf\n}\n\nexport const getTokens = ({ prefixed = true }: { prefixed?: boolean } = {}): Tokens =>\n prefixed ? conf!.tokensParsed : conf!.tokens\n\n/**\n * Note: this is the same as `getTokens`\n */\nexport const useTokens = () => getTokens()\n\nexport const getThemes = () => conf!.themes\n\nexport const configListeners = new Set<ConfigListener>()\n\nexport const onConfiguredOnce = (cb: ConfigListener) => {\n if (conf) {\n cb(conf)\n } else {\n configListeners.add(cb)\n }\n}\n\nexport const updateConfig = (key: string, value: any) => {\n Object.assign(key, value)\n}\n\n// searches by value name or token name\nexport const getFont = (name: string) => {\n const conf = getConfig()\n return (\n conf.fontsParsed[name] ??\n Object.entries(conf.fontsParsed).find(\n ([k]) => conf.fontsParsed[k]?.family?.['val'] === name\n )?.[1]\n )\n}\n"],
5
+ "mappings": "AAEA,IAAI;AAEG,MAAM,YAAY,CAAC,SAAgC;AACxD,SAAO;AACP,kBAAgB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;AAC1C;AAEO,MAAM,gBAAgB,CAAC,MAAc,MAAW,eAAoB;AACzE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC;AAAM,YAAM,IAAI,MAAM,kCAAkC;AAAA,EAC/D;AACA,OAAM,MAAM,IAAI,IAAI;AACpB,OAAM,YAAY,IAAI,MAAM,IAAI;AAClC;AAEO,MAAM,YAAY,MAAM;AAC7B,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR,QAAQ,IAAI,aAAa,eACrB,wIACA;AAAA,IACN;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,YAAY,CAAC,EAAE,WAAW,KAAK,IAA4B,CAAC,MACvE,WAAW,KAAM,eAAe,KAAM;AAKjC,MAAM,YAAY,MAAM,UAAU;AAElC,MAAM,YAAY,MAAM,KAAM;AAE9B,MAAM,kBAAkB,oBAAI,IAAoB;AAEhD,MAAM,mBAAmB,CAAC,OAAuB;AACtD,MAAI,MAAM;AACR,OAAG,IAAI;AAAA,EACT,OAAO;AACL,oBAAgB,IAAI,EAAE;AAAA,EACxB;AACF;AAEO,MAAM,eAAe,CAAC,KAAa,UAAe;AACvD,SAAO,OAAO,KAAK,KAAK;AAC1B;AAGO,MAAM,UAAU,CAAC,SAAiB;AArDzC;AAsDE,QAAMA,QAAO,UAAU;AACvB,SACEA,MAAK,YAAY,IAAI,OACrB,YAAO,QAAQA,MAAK,WAAW,EAAE;AAAA,IAC/B,CAAC,CAAC,CAAC,MAAG;AA1DZ,UAAAC,KAAA;AA0De,qBAAAA,MAAAD,MAAK,YAAY,CAAC,MAAlB,gBAAAC,IAAqB,WAArB,mBAA8B,YAAW;AAAA;AAAA,EACpD,MAFA,mBAEI;AAER;",
6
6
  "names": ["conf", "_a"]
7
7
  }
@@ -576,10 +576,12 @@ const getSplitStyles = (props, staticConfig, theme, state, parentSplitStyles, la
576
576
  }
577
577
  continue;
578
578
  }
579
- if (!isWeb && key === "pointerEvents") {
580
- usedKeys[key] = 1;
581
- viewProps[key] = val;
582
- continue;
579
+ if (process.env.TAMAGUI_TARGET === "native") {
580
+ if (key === "pointerEvents") {
581
+ usedKeys[key] = 1;
582
+ viewProps[key] = val;
583
+ continue;
584
+ }
583
585
  }
584
586
  if (key === "fontFamily" && !fontFamily && valInit && val) {
585
587
  fontFamily = valInit[0] === "$" ? valInit : val;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/getSplitStyles.tsx"],
4
- "sourcesContent": ["import {\n isClient,\n isRSC,\n isServer,\n isWeb,\n useIsomorphicLayoutEffect,\n} from '@tamagui/constants'\nimport {\n stylePropsText,\n stylePropsTransform,\n validPseudoKeys,\n validStyles,\n validStylesOnBaseProps,\n} from '@tamagui/helpers'\nimport { useInsertionEffect } from 'react'\nimport type { TextStyle, ViewStyle } from 'react-native'\n\nimport { getConfig, getFont } from '../config'\nimport { isDevTools } from '../constants/isDevTools'\nimport {\n getMediaImportanceIfMoreImportant,\n mediaState as globalMediaState,\n mediaKeysWithAndWithout$,\n mediaQueryConfig,\n mergeMediaByImportance,\n} from '../hooks/useMedia'\nimport type {\n DebugProp,\n MediaQueryKey,\n PseudoPropKeys,\n PseudoStyles,\n SpaceTokens,\n SplitStyleState,\n StackProps,\n StaticConfigParsed,\n TamaguiInternalConfig,\n ThemeParsed,\n} from '../types'\nimport { FontLanguageProps, LanguageContextType } from '../views/FontLanguage.types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { getPropMappedFontFamily } from './createPropMapper'\nimport { fixStyles } from './expandStyles'\nimport { getAtomicStyle, getStylesAtomic, styleToCSS } from './getStylesAtomic'\nimport {\n PartialStyleObject,\n RulesToInsert,\n insertStyleRules,\n insertedTransforms,\n scanAllSheets,\n shouldInsertStyleRules,\n updateRules,\n} from './insertStyleRule'\nimport { FlatTransforms, mergeTransform, mergeTransforms } from './mergeTransform'\nimport {\n normalizeValueWithProperty,\n reverseMapClassNameToValue,\n} from './normalizeValueWithProperty.js'\nimport { pseudoDescriptors } from './pseudoDescriptors'\nimport { warnOnce } from './warnOnce'\n\ntype GetStyleResult = {\n pseudos?: PseudoStyles\n style: ViewStyle\n classNames: ClassNamesObject\n rulesToInsert: RulesToInsert\n viewProps: StackProps & Record<string, any>\n fontFamily: string | undefined\n space?: any // SpaceTokens?\n hasMedia: boolean | 'space'\n}\n\ntype GetStyleState = {\n style: ViewStyle\n usedKeys: Record<string, number>\n classNames: ClassNamesObject\n flatTransforms: FlatTransforms\n staticConfig: StaticConfigParsed\n theme: ThemeParsed\n props: Record<string, any>\n viewProps: Record<string, any>\n state: SplitStyleState\n conf: TamaguiInternalConfig\n languageContext?: FontLanguageProps\n avoidDefaultProps?: boolean\n avoidMergeTransform?: boolean\n}\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\nexport type ClassNamesObject = Record<string, string>\nexport type SplitStyleResult = ReturnType<typeof getSplitStyles>\n\nconst skipProps = {\n animation: true,\n space: true,\n animateOnly: true,\n debug: true,\n componentName: true,\n role: true,\n tag: true,\n}\nif (process.env.NODE_ENV === 'test') {\n skipProps['data-test-renders'] = true\n}\n\nconst IS_STATIC = process.env.IS_STATIC === 'is_static'\n\n// native only skips\nif (process.env.TAMAGUI_TARGET === 'native') {\n Object.assign(skipProps, {\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n cursor: true,\n contain: true,\n boxSizing: true,\n boxShadow: true,\n })\n}\n\n// web only maps accessibility to aria props\nconst accessibilityDirectMap: Record<string, string> = {}\nif (process.env.TAMAGUI_TARGET === 'web') {\n // bundle size shave\n const items = {\n Hidden: true,\n ActiveDescendant: true,\n Atomic: true,\n AutoComplete: true,\n Busy: true,\n Checked: true,\n ColumnCount: 'colcount',\n ColumnIndex: 'colindex',\n ColumnSpan: 'colspan',\n Current: true,\n Details: true,\n ErrorMessage: true,\n Expanded: true,\n HasPopup: true,\n Invalid: true,\n Label: true,\n Level: true,\n Modal: true,\n Multiline: true,\n MultiSelectable: true,\n Orientation: true,\n Owns: true,\n Placeholder: true,\n PosInSet: true,\n Pressed: true,\n RoleDescription: true,\n RowCount: true,\n RowIndex: true,\n RowSpan: true,\n Selected: true,\n SetSize: true,\n Sort: true,\n ValueMax: true,\n ValueMin: true,\n ValueNow: true,\n ValueText: true,\n }\n for (const key in items) {\n let val = items[key]\n if (val === true) {\n val = key.toLowerCase()\n }\n accessibilityDirectMap[`accessibility${key}`] = `aria-${val}`\n }\n}\n\ntype TransformNamespaceKey = 'transform' | PseudoPropKeys | MediaQueryKey\n\nlet conf: TamaguiInternalConfig\n\ntype StyleSplitter = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeParsed,\n state: SplitStyleState,\n parentSplitStyles?: GetStyleResult | null,\n languageContext?: LanguageContextType,\n // web-only\n elementType?: string,\n debug?: DebugProp\n) => GetStyleResult\n\nexport const PROP_SPLIT = '-'\n\nconst accessibilityRoleToWebRole = {\n adjustable: 'slider',\n header: 'heading',\n image: 'img',\n link: 'link',\n none: 'presentation',\n summary: 'region',\n}\n\n// loop props backwards\n// track used keys:\n// const keys = new Set<string>()\n// keep classnames and styles separate:\n// const styles = {}\n// const classNames = {}\n\nconst isMediaKey = (key: string) =>\n Boolean(key[0] === '$' && mediaKeysWithAndWithout$.has(key))\n\nexport const getSplitStyles: StyleSplitter = (\n props,\n staticConfig,\n theme,\n state,\n parentSplitStyles,\n languageContext,\n elementType,\n debug\n) => {\n if (cache.has(props)) {\n return cache.get(props)\n }\n\n conf = conf || getConfig()\n const { shorthands } = conf\n const {\n defaultVariants,\n variants,\n propMapper,\n isReactNative,\n deoptProps,\n inlineProps,\n inlineWhenUnflattened,\n } = staticConfig\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: GetStyleResult['viewProps'] = {}\n let pseudos: PseudoStyles | null = null\n let psuedosUsed: Record<string, number> | null = null\n const mediaState = state.mediaState || globalMediaState\n const usedKeys: Record<string, number> = {}\n const propKeys = Object.keys(props)\n let space: SpaceTokens | null = props.space\n let hasMedia: boolean | string[] = false\n\n const shouldDoClasses =\n staticConfig.acceptsClassName && (isWeb || IS_STATIC) && !state.noClassNames\n\n let style: ViewStyle | TextStyle = {}\n const flatTransforms: FlatTransforms = {}\n\n const len = propKeys.length\n const rulesToInsert: RulesToInsert = []\n const classNames: ClassNamesObject = {}\n let className = '' // existing classNames\n // we need to gather these specific to each media query / pseudo\n // value is [hash, val], so [\"-jnjad-asdnjk\", \"scaleX(1) rotate(10deg)\"]\n const transforms: Record<TransformNamespaceKey, [string, string]> = {}\n // fontFamily is our special baby, ensure we grab the latest set one always\n let fontFamily: string | undefined\n\n const styleState: GetStyleState = {\n classNames,\n conf,\n flatTransforms,\n props,\n state,\n staticConfig,\n style,\n theme,\n usedKeys,\n viewProps,\n languageContext,\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props.selectable) {\n warnOnce('props.selectable', 'selectable props deprecated, use userSelect')\n }\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // eslint-disable-next-line no-console\n console.groupCollapsed('getSplitStyles (looping backwards)')\n // eslint-disable-next-line no-console\n console.log({ staticConfig, shouldDoClasses, state, IS_STATIC, propKeys })\n // eslint-disable-next-line no-console\n console.groupEnd()\n }\n\n if (props.className) {\n for (const cn of props.className.split(' ')) {\n if (cn[0] === '_') {\n // tamagui, merge it expanded on key, eventually this will go away with better compiler\n const [shorthand, mediaOrPseudo] = cn.slice(1).split('-')\n const isMedia = mediaOrPseudo[0] === '_'\n const isPseudo = mediaOrPseudo[0] === '0'\n const isMediaOrPseudo = isMedia || isPseudo\n let fullKey = shorthands[shorthand]\n if (isMedia) {\n // is media\n let mediaShortKey = mediaOrPseudo.slice(1)\n mediaShortKey = mediaShortKey.slice(0, mediaShortKey.indexOf('_'))\n fullKey += `${PROP_SPLIT}${mediaShortKey}`\n } else if (isPseudo) {\n // is pseudo\n const pseudoShortKey = mediaOrPseudo.slice(1)\n fullKey += `${PROP_SPLIT}${pseudoShortKey}`\n }\n usedKeys[fullKey] = 1\n mergeClassName(transforms, classNames, fullKey, cn, isMediaOrPseudo)\n } else if (cn) {\n className += ` ${cn}`\n }\n }\n }\n\n // loop backwards so we can skip already-used props\n for (let i = len - 1; i >= 0; i--) {\n let keyInit = propKeys[i]\n if (keyInit === 'className') continue // handled above\n let valInit = props[keyInit]\n\n // normalize shorthands up front\n if (keyInit in shorthands) {\n keyInit = shorthands[keyInit]\n }\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n // map userSelect to native prop\n if (keyInit === 'userSelect') {\n keyInit = 'selectable'\n valInit = valInit === 'none' ? false : true\n } else if (keyInit.startsWith('data-') || keyInit.startsWith('aria-')) {\n continue\n }\n }\n\n if (keyInit in usedKeys) continue\n if (keyInit in skipProps) continue\n\n if (typeof valInit === 'string' && valInit[0] === '_') {\n if (keyInit in validStyleProps || keyInit.includes('-')) {\n if (shouldDoClasses) {\n classNames[keyInit] = valInit\n } else {\n style[keyInit] = reverseMapClassNameToValue(keyInit, valInit)\n }\n usedKeys[keyInit] = 1\n continue\n }\n }\n\n if (keyInit === 'dataSet') {\n for (const key in valInit) {\n viewProps[`data-${hyphenate(key)}`] = valInit[key]\n }\n continue\n }\n\n const isMainStyle = keyInit === 'style'\n if (isMainStyle || keyInit.startsWith('_style')) {\n if (!valInit) continue\n const styles = Array.isArray(valInit) ? valInit : [valInit]\n const styleLen = styles.length\n for (let j = styleLen; j >= 0; j--) {\n const cur = styles[j]\n if (!cur) continue\n for (const key in cur) {\n if (!isMainStyle && usedKeys[key]) {\n continue\n }\n usedKeys[key] = 1\n style[key] = cur[key]\n }\n }\n continue\n }\n\n if (process.env.TAMAGUI_TARGET === 'web') {\n /**\n * Copying in the accessibility/prop handling from react-native-web here\n * Keeps it in a single loop, avoids dup de-structuring to avoid bundle size\n */\n if (keyInit === 'disabled' && valInit === true) {\n usedKeys[keyInit] = 1\n viewProps['aria-disabled'] = true\n // Enhance with native semantics\n if (\n elementType === 'button' ||\n elementType === 'form' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.disabled = true\n }\n if (!variants?.disabled) {\n continue\n }\n }\n\n if (keyInit === 'testID') {\n usedKeys[keyInit] = 1\n viewProps[isReactNative ? 'testId' : 'data-testid'] = valInit\n continue\n }\n\n if (keyInit === 'id' || keyInit === 'nativeID') {\n usedKeys[keyInit] = 1\n if (isReactNative) {\n viewProps.nativeID = valInit\n } else {\n viewProps.id = valInit\n }\n continue\n }\n\n let didUseKeyInit = false\n\n if (isReactNative) {\n // pass along to react-native-web\n if (accessibilityDirectMap[keyInit] || keyInit.startsWith('accessibility')) {\n viewProps[keyInit] = valInit\n usedKeys[keyInit] = 1\n continue\n }\n } else {\n didUseKeyInit = true\n\n if (accessibilityDirectMap[keyInit]) {\n viewProps[accessibilityDirectMap[keyInit]] = valInit\n } else {\n switch (keyInit) {\n case 'accessibilityRole': {\n if (valInit === 'none') {\n viewProps.role = 'presentation'\n } else {\n viewProps.role = accessibilityRoleToWebRole[valInit] || valInit\n }\n continue\n }\n case 'accessibilityLabelledBy':\n case 'accessibilityFlowTo':\n case 'accessibilityControls':\n case 'accessibilityDescribedBy': {\n viewProps[`aria-${keyInit.replace('accessibility', '').toLowerCase()}`] =\n processIDRefList(valInit)\n continue\n }\n case 'accessibilityKeyShortcuts': {\n if (Array.isArray(valInit)) {\n viewProps['aria-keyshortcuts'] = valInit.join(' ')\n }\n continue\n }\n case 'accessibilityLiveRegion': {\n viewProps['aria-live'] = valInit === 'none' ? 'off' : valInit\n continue\n }\n case 'accessibilityReadOnly': {\n viewProps['aria-readonly'] = valInit\n // Enhance with native semantics\n if (\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.readOnly = true\n }\n continue\n }\n case 'accessibilityRequired': {\n viewProps['aria-required'] = valInit\n // Enhance with native semantics\n if (\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.required = valInit\n }\n continue\n }\n default: {\n didUseKeyInit = false\n }\n }\n }\n }\n\n if (didUseKeyInit) {\n usedKeys[keyInit] = 1\n continue\n }\n\n if (valInit && valInit[0] === '_') {\n // if valid style key (or pseudo like color-hover):\n // this conditional and esp the pseudo check rarely runs so not a perf issue\n const isValidClassName = validStyles[keyInit]\n const isMediaOrPseudo =\n !isValidClassName &&\n keyInit.includes(PROP_SPLIT) &&\n validStyles[keyInit.split(PROP_SPLIT)[0]]\n\n if (isValidClassName || isMediaOrPseudo) {\n usedKeys[keyInit] = 1\n if (process.env.NODE_ENV === 'development') {\n if (debug) {\n // eslint-disable-next-line no-console\n console.log('tamagui classname props', keyInit, valInit)\n }\n }\n mergeClassName(transforms, classNames, keyInit, valInit, isMediaOrPseudo)\n continue\n }\n }\n }\n\n if (\n (defaultVariants && keyInit in defaultVariants) ||\n // may want to just: not compile styled() into classnames, always do this, and always pass in all values in extras.props\n // but we'd want to add styled({ extracted: true }) or something at compile time to save on parsing a bit...\n (state.keepVariantsAsProps && variants && keyInit in variants)\n ) {\n viewProps[keyInit] = valInit\n }\n\n /**\n * There's (some) reason to this madness: we want to allow returning media/pseudo from variants\n * Say you have a variant hoverable: { true: { hoverStyle: {} } }\n * We run propMapper first to expand variant, then we run the inner loop and look again\n * for if there's a pseudo/media returned from it.\n */\n\n let isMedia = isMediaKey(keyInit)\n let isPseudo = validPseudoKeys[keyInit]\n\n if (\n !(\n isMedia ||\n isPseudo ||\n variants?.[keyInit] ||\n validStyleProps[keyInit] ||\n shorthands[keyInit]\n )\n ) {\n usedKeys[keyInit] = 1\n viewProps[keyInit] = valInit\n continue\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // eslint-disable-next-line no-console\n console.groupCollapsed(' \uD83D\uDD39 styles', keyInit, valInit)\n }\n\n const expanded =\n isMedia || isPseudo\n ? [[keyInit, valInit]]\n : propMapper(\n keyInit,\n valInit,\n theme,\n props,\n state,\n languageContext,\n undefined,\n debug\n )\n\n if (!fontFamily) {\n fontFamily = getPropMappedFontFamily(expanded)\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n if (!isServer && isDevTools) {\n // eslint-disable-next-line no-console\n console.log('expanded', expanded, '\\nusedKeys', usedKeys, '\\ncurrent', {\n ...style,\n })\n }\n // eslint-disable-next-line no-console\n console.groupEnd()\n }\n\n if (!expanded) continue\n\n for (const [key, val] of expanded) {\n if (val === undefined) continue\n\n isMedia = isMediaKey(key)\n isPseudo = validPseudoKeys[key]\n const isMediaOrPseudo = isMedia || isPseudo\n\n if (!isMediaOrPseudo && usedKeys[key]) {\n if (process.env.NODE_ENV === 'developmnet' && debug === 'verbose') {\n console.log(`Used media/pseudo ${key}`)\n }\n continue\n }\n\n if (inlineProps?.has(key) || inlineWhenUnflattened?.has(key)) {\n usedKeys[key] = 1\n viewProps[key] = props[key] ?? val\n }\n\n // pseudo\n if (isPseudo) {\n if (!val) continue\n\n // TODO can avoid processing this if !shouldDoClasses + state is off\n const pseudoStyleObject = getSubStyle(\n styleState,\n key,\n val,\n true,\n state.noClassNames\n )\n\n const descriptor = pseudoDescriptors[key as keyof typeof pseudoDescriptors]\n const isEnter = descriptor.name === 'enter'\n const isExit = descriptor.name === 'exit'\n\n // don't continue here on isEnter && !state.unmounted because we need to merge defaults\n if (!descriptor || (isExit && !state.isExiting)) {\n continue\n }\n\n if (!shouldDoClasses || IS_STATIC) {\n pseudos ||= {}\n pseudos[key] ||= {}\n Object.assign(pseudos[key], pseudoStyleObject)\n }\n\n if (shouldDoClasses && !isEnter && !isExit) {\n const pseudoStyles = getAtomicStyle(pseudoStyleObject, descriptor)\n for (const psuedoStyle of pseudoStyles) {\n const fullKey = `${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}`\n if (!usedKeys[fullKey]) {\n usedKeys[fullKey] = 1\n addStyleToInsertRules(rulesToInsert, psuedoStyle)\n mergeClassName(\n transforms,\n classNames,\n fullKey,\n psuedoStyle.identifier,\n isMediaOrPseudo\n )\n }\n }\n } else {\n if (usedKeys[key]) {\n continue\n }\n\n let isDisabled = !state[descriptor.stateKey || descriptor.name]\n\n // we never animate in on server side just show the full thing\n // on client side we use CSS to hide the fully in SSR items, then\n // un-hide and replay with original animation.\n if (isWeb && !isClient && isEnter) {\n isDisabled = false\n }\n\n if (!isDisabled) {\n if (valInit === staticConfig.defaultProps[keyInit]) {\n // ignore:\n // if it's a default property given by styled(), we don't mark it as used, so\n // that props given inline can override:\n } else {\n usedKeys[key] ||= 1\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log(`Setting used ${key}`)\n }\n }\n }\n\n psuedosUsed ||= {}\n\n const importance = descriptor.priority\n for (const pkey in pseudoStyleObject) {\n const val = pseudoStyleObject[pkey]\n // when disabled ensure the default value is set for future animations to align\n if (isDisabled) {\n if (!(pkey in usedKeys) && pkey in animatableDefaults) {\n const defaultVal = animatableDefaults[pkey]\n mergeStyle(styleState, pkey, defaultVal, true)\n }\n continue\n }\n const curImportance = psuedosUsed[importance] || 0\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log('Merge pseudo?', { importance, curImportance, pkey, val })\n }\n if (importance >= curImportance) {\n psuedosUsed[pkey] = importance\n pseudos ||= {}\n pseudos[key] ||= {}\n pseudos[key][pkey] = val\n mergeStyle(styleState, pkey, val)\n }\n }\n }\n continue\n }\n\n // media\n if (isMedia) {\n if (!val) continue\n\n hasMedia ||= true\n\n // THIS USED TO PROXY BACK TO REGULAR PROPS BUT THAT IS THE WRONG BEHAVIOR\n // we avoid passing in default props for media queries because that would confuse things like SizableText.size:\n\n const mediaStyle = getSubStyle(\n styleState,\n key,\n val,\n // TODO try true like pseudo\n false\n )\n\n const mediaKeyShort = key.slice(1)\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // prettier-ignore\n // eslint-disable-next-line no-console\n console.log(` \uD83D\uDCFA ${key}`, { key, mediaStyle, props, shouldDoClasses })\n }\n\n if ('space' in mediaStyle) {\n if (!Array.isArray(hasMedia)) {\n hasMedia = []\n }\n hasMedia.push(mediaKeyShort)\n }\n\n if (shouldDoClasses) {\n if ('space' in mediaStyle) {\n delete mediaStyle['space']\n if (mediaState[mediaKeyShort]) {\n const val = valInit.space\n const importance = getMediaImportanceIfMoreImportant(\n mediaKeyShort,\n 'space',\n usedKeys\n )\n if (importance) {\n space = val\n usedKeys['space'] = importance\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log(\n `Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`\n )\n }\n }\n }\n }\n const mediaStyles = getStylesAtomic(mediaStyle)\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig)\n const fullKey = `${style.property}${PROP_SPLIT}${mediaKeyShort}`\n if (!usedKeys[fullKey]) {\n usedKeys[fullKey] = 1\n addStyleToInsertRules(rulesToInsert, out)\n mergeClassName(transforms, classNames, fullKey, out.identifier, true)\n }\n }\n } else if (mediaState[mediaKeyShort]) {\n for (const subKey in mediaStyle) {\n const importance = getMediaImportanceIfMoreImportant(\n mediaKeyShort,\n subKey,\n usedKeys\n )\n if (importance === null) continue\n if (subKey === 'space') {\n space = valInit.space\n continue\n }\n mergeMediaByImportance(\n style,\n mediaKeyShort,\n subKey,\n mediaStyle[subKey],\n usedKeys\n )\n if (key === 'fontFamily') {\n fontFamily = mediaStyle[key]\n }\n }\n }\n continue\n }\n\n if (!isWeb && key === 'pointerEvents') {\n usedKeys[key] = 1\n viewProps[key] = val\n continue\n }\n\n if (key === 'fontFamily' && !fontFamily && valInit && val) {\n fontFamily = valInit[0] === '$' ? valInit : val\n }\n\n if (key in validStyleProps) {\n mergeStyle(styleState, key, val)\n continue\n }\n\n // pass to view props\n if (!(variants && key in variants)) {\n if (!skipProps[key]) {\n viewProps[key] = val\n usedKeys[key] = 1\n }\n }\n }\n }\n\n fixStyles(style)\n if (isWeb) {\n styleToCSS(style)\n }\n\n // native: swap out the right family based on weight/style\n if (process.env.TAMAGUI_TARGET === 'native') {\n if ('fontFamily' in style && style.fontFamily) {\n const faceInfo = getFont(style.fontFamily)?.face\n if (faceInfo) {\n const overrideFace =\n faceInfo[style.fontWeight!]?.[style.fontStyle || 'normal']?.val\n if (overrideFace) {\n style.fontFamily = overrideFace\n fontFamily = overrideFace\n delete style.fontWeight\n delete style.fontStyle\n }\n }\n if (process.env.NODE_ENV === 'development') {\n if (debug) {\n console.log(`Found fontFamily native: ${style.fontFamily}`, faceInfo)\n }\n }\n }\n }\n\n // always do this at the very end to preserve the order strictly (animations, origin)\n // and allow proper merging of all pseudos before applying\n if (flatTransforms) {\n if (process.env.NODE_ENV === 'development' && debug) {\n // eslint-disable-next-line no-console\n console.log(\n 'Merging flat transforms, transform before',\n [...(style.transform || [])],\n flatTransforms\n )\n }\n mergeTransforms(style, flatTransforms, true)\n }\n\n // add in defaults if not set:\n if (parentSplitStyles) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (shouldDoClasses) {\n for (const key in parentSplitStyles.classNames) {\n const val = parentSplitStyles.classNames[key]\n if (key in style || key in classNames) continue\n classNames[key] = val\n }\n }\n }\n if (!shouldDoClasses) {\n for (const key in parentSplitStyles.style) {\n if (key in classNames || key in style) continue\n style[key] = parentSplitStyles.style[key]\n }\n }\n }\n\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (shouldDoClasses) {\n const retainedStyles = {}\n if (style['$$css']) {\n // avoid re-processing for rnw\n } else {\n const atomic = getStylesAtomic(style)\n for (const atomicStyle of atomic) {\n const key = atomicStyle.property\n if (props.animateOnly && props.animateOnly.includes(key)) {\n retainedStyles[key] = atomicStyle.value\n } else {\n addStyleToInsertRules(rulesToInsert, atomicStyle)\n mergeClassName(transforms, classNames, key, atomicStyle.identifier)\n }\n }\n if (!IS_STATIC) {\n style = retainedStyles\n }\n }\n }\n\n if (transforms) {\n for (const namespace in transforms) {\n if (!transforms[namespace]) {\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn('Error no transform', transforms, namespace)\n }\n continue\n }\n const [hash, val] = transforms[namespace]\n const identifier = `_transform${hash}`\n if (isClient && !insertedTransforms[identifier]) {\n const rule = `.${identifier} { transform: ${val}; }`\n addStyleToInsertRules(rulesToInsert, {\n identifier,\n rules: [rule],\n property: namespace,\n })\n }\n classNames[namespace] = identifier\n }\n }\n }\n\n const result = {\n space,\n hasMedia,\n fontFamily,\n viewProps,\n style,\n pseudos,\n classNames,\n rulesToInsert,\n }\n\n if (className) {\n classNames.className = className\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n if (isDevTools) {\n // eslint-disable-next-line no-console\n console.groupCollapsed(' \uD83D\uDD39 styles =>')\n // prettier-ignore\n const logs = { transforms, viewProps, state, rulesToInsert, parentSplitStyles, flatTransforms, result }\n for (const key in { ...result, ...logs }) {\n // eslint-disable-next-line no-console\n console.log(key, logs[key])\n }\n // eslint-disable-next-line no-console\n console.groupEnd()\n }\n }\n\n cache.set(props, result)\n\n return result\n}\n\nfunction mergeClassName(\n transforms: Record<string, any[]>,\n classNames: Record<string, string>,\n key: string,\n val: string,\n isMediaOrPseudo = false\n) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n // empty classnames passed by compiler sometimes\n if (!val) return\n if (val[0] === '_' && val.startsWith('_transform-')) {\n const ns: TransformNamespaceKey = isMediaOrPseudo ? key : 'transform'\n let transform = insertedTransforms[val]\n if (isClient && !transform) {\n scanAllSheets() // HMR or loaded a new chunk\n transform = insertedTransforms[val]\n if (!transform && isWeb && val[0] !== '_') {\n transform = val // runtime insert\n }\n }\n transforms[ns] ||= ['', '']\n transforms[ns][0] += val.replace('_transform', '')\n // ssr doesn't need to do anything just make the right classname\n if (transform) {\n transforms[ns][1] += transform\n }\n } else {\n classNames[key] = val\n }\n }\n}\n\n/**\n * getSubStyle calls propMapper with props\n * those should be specific to the substyle, but fallback to the base props\n * so given props:\n *\n * { fontSize: 12, color: 'red', $sm: { color: 'blue' } }\n *\n * getSubStyle props should be a proxy that ends up like:\n *\n * { fontSize: 12, color: 'blue' }\n *\n * and to avoid re-creating it over and over, use a WeakMap\n */\nconst cache = new WeakMap()\nfunction getSubStyleProps(\n defaultProps: Object,\n baseProps: Object,\n specificProps: Object\n) {\n const key = specificProps || baseProps\n // can cache based only on specific it's always referentially consistent with base\n if (!cache.has(key)) {\n cache.set(key, {\n ...defaultProps,\n ...baseProps,\n ...specificProps,\n })\n }\n return cache.get(key)!\n}\n\nfunction mergeStyle(\n { usedKeys, classNames, flatTransforms, viewProps, style }: GetStyleState,\n key: string,\n val: any,\n dontSetUsed = false\n) {\n if (!dontSetUsed) {\n usedKeys[key] ||= 1\n }\n if (val && val[0] === '_') {\n classNames[key] = val\n } else if (key in stylePropsTransform) {\n flatTransforms ||= {}\n flatTransforms[key] = val\n } else {\n const out = normalizeValueWithProperty(val, key)\n if (key in validStylesOnBaseProps) {\n viewProps[key] = out\n } else {\n style[key] = out\n }\n }\n}\n\nexport const getSubStyle = (\n styleState: GetStyleState,\n subKey: string,\n styleIn: Object,\n avoidDefaultProps?: boolean,\n avoidMergeTransform?: boolean\n): ViewStyle => {\n const { staticConfig, theme, props, state, conf, languageContext } = styleState\n const styleOut: ViewStyle = {}\n\n for (let key in styleIn) {\n const val = styleIn[key]\n key = conf.shorthands[key] || key\n const expanded = staticConfig.propMapper(\n key,\n val,\n theme,\n getSubStyleProps(staticConfig.defaultProps, props, props[subKey]),\n state,\n languageContext,\n avoidDefaultProps\n )\n if (!expanded) continue\n for (const [skey, sval] of expanded) {\n if (!avoidMergeTransform && skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = normalizeValueWithProperty(sval, key)\n }\n }\n }\n\n fixStyles(styleOut)\n\n return styleOut\n}\n\nexport const insertSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n insertStyleRules(res.rulesToInsert)\n return res\n}\n\n// on native no need to insert any css\nconst useInsertEffectCompat = isWeb\n ? useInsertionEffect || useIsomorphicLayoutEffect\n : () => {}\n\nexport const useSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n\n if (!isRSC) {\n useInsertEffectCompat(() => {\n insertStyleRules(res.rulesToInsert)\n }, [res.rulesToInsert])\n }\n\n return res\n}\n\nfunction addStyleToInsertRules(\n rulesToInsert: RulesToInsert,\n styleObject: PartialStyleObject\n) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (!shouldInsertStyleRules(styleObject)) {\n return\n }\n updateRules(styleObject.identifier, styleObject.rules)\n rulesToInsert.push(styleObject)\n }\n}\n\nfunction processIDRefList(idRefList: string | Array<string>): string {\n return Array.isArray(idRefList) ? idRefList.join(' ') : idRefList\n}\n\nconst animatableDefaults = {\n opacity: 1,\n scale: 1,\n rotate: '0deg',\n rotateY: '0deg',\n rotateX: '0deg',\n}\n\nconst lowercaseHyphenate = (match: string) => `-${match.toLowerCase()}`\nconst hyphenate = (str: string) => str.replace(/[A-Z]/g, lowercaseHyphenate)\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAGnC,SAAS,WAAW,eAAe;AACnC,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB,iBAAiB,kBAAkB;AAC5D;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAyB,gBAAgB,uBAAuB;AAChE;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AAiCzB,MAAM,YAAY;AAAA,EAChB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AAAA,EACP,eAAe;AAAA,EACf,MAAM;AAAA,EACN,KAAK;AACP;AACA,IAAI,QAAQ,IAAI,aAAa,QAAQ;AACnC,YAAU,mBAAmB,IAAI;AACnC;AAEA,MAAM,YAAY,QAAQ,IAAI,cAAc;AAG5C,IAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,SA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AAA,IACpC,GAAG,CAAC,IAAI,aAAa,CAAC;AAAA,EACxB;AAEA,SAAO;AACT;AAEA,SAAS,sBACP,eACA,aACA;AACA,MAAI,QAAQ,IAAI,mBAAmB,OAAO;AACxC,QAAI,CAAC,uBAAuB,WAAW,GAAG;AACxC;AAAA,IACF;AACA,gBAAY,YAAY,YAAY,YAAY,KAAK;AACrD,kBAAc,KAAK,WAAW;AAAA,EAChC;AACF;AAEA,SAAS,iBAAiB,WAA2C;AACnE,SAAO,MAAM,QAAQ,SAAS,IAAI,UAAU,KAAK,GAAG,IAAI;AAC1D;AAEA,MAAM,qBAAqB;AAAA,EACzB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AACX;AAEA,MAAM,qBAAqB,CAAC,UAAkB,IAAI,MAAM,YAAY;AACpE,MAAM,YAAY,CAAC,QAAgB,IAAI,QAAQ,UAAU,kBAAkB;",
4
+ "sourcesContent": ["import {\n isClient,\n isRSC,\n isServer,\n isWeb,\n useIsomorphicLayoutEffect,\n} from '@tamagui/constants'\nimport {\n stylePropsText,\n stylePropsTransform,\n validPseudoKeys,\n validStyles,\n validStylesOnBaseProps,\n} from '@tamagui/helpers'\nimport { useInsertionEffect } from 'react'\nimport type { TextStyle, ViewStyle } from 'react-native'\n\nimport { getConfig, getFont } from '../config'\nimport { isDevTools } from '../constants/isDevTools'\nimport {\n getMediaImportanceIfMoreImportant,\n mediaState as globalMediaState,\n mediaKeysWithAndWithout$,\n mediaQueryConfig,\n mergeMediaByImportance,\n} from '../hooks/useMedia'\nimport type {\n DebugProp,\n MediaQueryKey,\n PseudoPropKeys,\n PseudoStyles,\n SpaceTokens,\n SplitStyleState,\n StackProps,\n StaticConfigParsed,\n TamaguiInternalConfig,\n ThemeParsed,\n} from '../types'\nimport { FontLanguageProps, LanguageContextType } from '../views/FontLanguage.types'\nimport { createMediaStyle } from './createMediaStyle'\nimport { getPropMappedFontFamily } from './createPropMapper'\nimport { fixStyles } from './expandStyles'\nimport { getAtomicStyle, getStylesAtomic, styleToCSS } from './getStylesAtomic'\nimport {\n PartialStyleObject,\n RulesToInsert,\n insertStyleRules,\n insertedTransforms,\n scanAllSheets,\n shouldInsertStyleRules,\n updateRules,\n} from './insertStyleRule'\nimport { FlatTransforms, mergeTransform, mergeTransforms } from './mergeTransform'\nimport {\n normalizeValueWithProperty,\n reverseMapClassNameToValue,\n} from './normalizeValueWithProperty.js'\nimport { pseudoDescriptors } from './pseudoDescriptors'\nimport { warnOnce } from './warnOnce'\n\ntype GetStyleResult = {\n pseudos?: PseudoStyles\n style: ViewStyle\n classNames: ClassNamesObject\n rulesToInsert: RulesToInsert\n viewProps: StackProps & Record<string, any>\n fontFamily: string | undefined\n space?: any // SpaceTokens?\n hasMedia: boolean | 'space'\n}\n\ntype GetStyleState = {\n style: ViewStyle\n usedKeys: Record<string, number>\n classNames: ClassNamesObject\n flatTransforms: FlatTransforms\n staticConfig: StaticConfigParsed\n theme: ThemeParsed\n props: Record<string, any>\n viewProps: Record<string, any>\n state: SplitStyleState\n conf: TamaguiInternalConfig\n languageContext?: FontLanguageProps\n avoidDefaultProps?: boolean\n avoidMergeTransform?: boolean\n}\n\nexport type SplitStyles = ReturnType<typeof getSplitStyles>\nexport type ClassNamesObject = Record<string, string>\nexport type SplitStyleResult = ReturnType<typeof getSplitStyles>\n\nconst skipProps = {\n animation: true,\n space: true,\n animateOnly: true,\n debug: true,\n componentName: true,\n role: true,\n tag: true,\n}\nif (process.env.NODE_ENV === 'test') {\n skipProps['data-test-renders'] = true\n}\n\nconst IS_STATIC = process.env.IS_STATIC === 'is_static'\n\n// native only skips\nif (process.env.TAMAGUI_TARGET === 'native') {\n Object.assign(skipProps, {\n whiteSpace: true,\n wordWrap: true,\n textOverflow: true,\n textDecorationDistance: true,\n cursor: true,\n contain: true,\n boxSizing: true,\n boxShadow: true,\n })\n}\n\n// web only maps accessibility to aria props\nconst accessibilityDirectMap: Record<string, string> = {}\nif (process.env.TAMAGUI_TARGET === 'web') {\n // bundle size shave\n const items = {\n Hidden: true,\n ActiveDescendant: true,\n Atomic: true,\n AutoComplete: true,\n Busy: true,\n Checked: true,\n ColumnCount: 'colcount',\n ColumnIndex: 'colindex',\n ColumnSpan: 'colspan',\n Current: true,\n Details: true,\n ErrorMessage: true,\n Expanded: true,\n HasPopup: true,\n Invalid: true,\n Label: true,\n Level: true,\n Modal: true,\n Multiline: true,\n MultiSelectable: true,\n Orientation: true,\n Owns: true,\n Placeholder: true,\n PosInSet: true,\n Pressed: true,\n RoleDescription: true,\n RowCount: true,\n RowIndex: true,\n RowSpan: true,\n Selected: true,\n SetSize: true,\n Sort: true,\n ValueMax: true,\n ValueMin: true,\n ValueNow: true,\n ValueText: true,\n }\n for (const key in items) {\n let val = items[key]\n if (val === true) {\n val = key.toLowerCase()\n }\n accessibilityDirectMap[`accessibility${key}`] = `aria-${val}`\n }\n}\n\ntype TransformNamespaceKey = 'transform' | PseudoPropKeys | MediaQueryKey\n\nlet conf: TamaguiInternalConfig\n\ntype StyleSplitter = (\n props: { [key: string]: any },\n staticConfig: StaticConfigParsed,\n theme: ThemeParsed,\n state: SplitStyleState,\n parentSplitStyles?: GetStyleResult | null,\n languageContext?: LanguageContextType,\n // web-only\n elementType?: string,\n debug?: DebugProp\n) => GetStyleResult\n\nexport const PROP_SPLIT = '-'\n\nconst accessibilityRoleToWebRole = {\n adjustable: 'slider',\n header: 'heading',\n image: 'img',\n link: 'link',\n none: 'presentation',\n summary: 'region',\n}\n\n// loop props backwards\n// track used keys:\n// const keys = new Set<string>()\n// keep classnames and styles separate:\n// const styles = {}\n// const classNames = {}\n\nconst isMediaKey = (key: string) =>\n Boolean(key[0] === '$' && mediaKeysWithAndWithout$.has(key))\n\nexport const getSplitStyles: StyleSplitter = (\n props,\n staticConfig,\n theme,\n state,\n parentSplitStyles,\n languageContext,\n elementType,\n debug\n) => {\n if (cache.has(props)) {\n return cache.get(props)\n }\n\n conf = conf || getConfig()\n const { shorthands } = conf\n const {\n defaultVariants,\n variants,\n propMapper,\n isReactNative,\n deoptProps,\n inlineProps,\n inlineWhenUnflattened,\n } = staticConfig\n const validStyleProps = staticConfig.isText ? stylePropsText : validStyles\n const viewProps: GetStyleResult['viewProps'] = {}\n let pseudos: PseudoStyles | null = null\n let psuedosUsed: Record<string, number> | null = null\n const mediaState = state.mediaState || globalMediaState\n const usedKeys: Record<string, number> = {}\n const propKeys = Object.keys(props)\n let space: SpaceTokens | null = props.space\n let hasMedia: boolean | string[] = false\n\n const shouldDoClasses =\n staticConfig.acceptsClassName && (isWeb || IS_STATIC) && !state.noClassNames\n\n let style: ViewStyle | TextStyle = {}\n const flatTransforms: FlatTransforms = {}\n\n const len = propKeys.length\n const rulesToInsert: RulesToInsert = []\n const classNames: ClassNamesObject = {}\n let className = '' // existing classNames\n // we need to gather these specific to each media query / pseudo\n // value is [hash, val], so [\"-jnjad-asdnjk\", \"scaleX(1) rotate(10deg)\"]\n const transforms: Record<TransformNamespaceKey, [string, string]> = {}\n // fontFamily is our special baby, ensure we grab the latest set one always\n let fontFamily: string | undefined\n\n const styleState: GetStyleState = {\n classNames,\n conf,\n flatTransforms,\n props,\n state,\n staticConfig,\n style,\n theme,\n usedKeys,\n viewProps,\n languageContext,\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props.selectable) {\n warnOnce('props.selectable', 'selectable props deprecated, use userSelect')\n }\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // eslint-disable-next-line no-console\n console.groupCollapsed('getSplitStyles (looping backwards)')\n // eslint-disable-next-line no-console\n console.log({ staticConfig, shouldDoClasses, state, IS_STATIC, propKeys })\n // eslint-disable-next-line no-console\n console.groupEnd()\n }\n\n if (props.className) {\n for (const cn of props.className.split(' ')) {\n if (cn[0] === '_') {\n // tamagui, merge it expanded on key, eventually this will go away with better compiler\n const [shorthand, mediaOrPseudo] = cn.slice(1).split('-')\n const isMedia = mediaOrPseudo[0] === '_'\n const isPseudo = mediaOrPseudo[0] === '0'\n const isMediaOrPseudo = isMedia || isPseudo\n let fullKey = shorthands[shorthand]\n if (isMedia) {\n // is media\n let mediaShortKey = mediaOrPseudo.slice(1)\n mediaShortKey = mediaShortKey.slice(0, mediaShortKey.indexOf('_'))\n fullKey += `${PROP_SPLIT}${mediaShortKey}`\n } else if (isPseudo) {\n // is pseudo\n const pseudoShortKey = mediaOrPseudo.slice(1)\n fullKey += `${PROP_SPLIT}${pseudoShortKey}`\n }\n usedKeys[fullKey] = 1\n mergeClassName(transforms, classNames, fullKey, cn, isMediaOrPseudo)\n } else if (cn) {\n className += ` ${cn}`\n }\n }\n }\n\n // loop backwards so we can skip already-used props\n for (let i = len - 1; i >= 0; i--) {\n let keyInit = propKeys[i]\n if (keyInit === 'className') continue // handled above\n let valInit = props[keyInit]\n\n // normalize shorthands up front\n if (keyInit in shorthands) {\n keyInit = shorthands[keyInit]\n }\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n // map userSelect to native prop\n if (keyInit === 'userSelect') {\n keyInit = 'selectable'\n valInit = valInit === 'none' ? false : true\n } else if (keyInit.startsWith('data-') || keyInit.startsWith('aria-')) {\n continue\n }\n }\n\n if (keyInit in usedKeys) continue\n if (keyInit in skipProps) continue\n\n if (typeof valInit === 'string' && valInit[0] === '_') {\n if (keyInit in validStyleProps || keyInit.includes('-')) {\n if (shouldDoClasses) {\n classNames[keyInit] = valInit\n } else {\n style[keyInit] = reverseMapClassNameToValue(keyInit, valInit)\n }\n usedKeys[keyInit] = 1\n continue\n }\n }\n\n if (keyInit === 'dataSet') {\n for (const key in valInit) {\n viewProps[`data-${hyphenate(key)}`] = valInit[key]\n }\n continue\n }\n\n const isMainStyle = keyInit === 'style'\n if (isMainStyle || keyInit.startsWith('_style')) {\n if (!valInit) continue\n const styles = Array.isArray(valInit) ? valInit : [valInit]\n const styleLen = styles.length\n for (let j = styleLen; j >= 0; j--) {\n const cur = styles[j]\n if (!cur) continue\n for (const key in cur) {\n if (!isMainStyle && usedKeys[key]) {\n continue\n }\n usedKeys[key] = 1\n style[key] = cur[key]\n }\n }\n continue\n }\n\n if (process.env.TAMAGUI_TARGET === 'web') {\n /**\n * Copying in the accessibility/prop handling from react-native-web here\n * Keeps it in a single loop, avoids dup de-structuring to avoid bundle size\n */\n if (keyInit === 'disabled' && valInit === true) {\n usedKeys[keyInit] = 1\n viewProps['aria-disabled'] = true\n // Enhance with native semantics\n if (\n elementType === 'button' ||\n elementType === 'form' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.disabled = true\n }\n if (!variants?.disabled) {\n continue\n }\n }\n\n if (keyInit === 'testID') {\n usedKeys[keyInit] = 1\n viewProps[isReactNative ? 'testId' : 'data-testid'] = valInit\n continue\n }\n\n if (keyInit === 'id' || keyInit === 'nativeID') {\n usedKeys[keyInit] = 1\n if (isReactNative) {\n viewProps.nativeID = valInit\n } else {\n viewProps.id = valInit\n }\n continue\n }\n\n let didUseKeyInit = false\n\n if (isReactNative) {\n // pass along to react-native-web\n if (accessibilityDirectMap[keyInit] || keyInit.startsWith('accessibility')) {\n viewProps[keyInit] = valInit\n usedKeys[keyInit] = 1\n continue\n }\n } else {\n didUseKeyInit = true\n\n if (accessibilityDirectMap[keyInit]) {\n viewProps[accessibilityDirectMap[keyInit]] = valInit\n } else {\n switch (keyInit) {\n case 'accessibilityRole': {\n if (valInit === 'none') {\n viewProps.role = 'presentation'\n } else {\n viewProps.role = accessibilityRoleToWebRole[valInit] || valInit\n }\n continue\n }\n case 'accessibilityLabelledBy':\n case 'accessibilityFlowTo':\n case 'accessibilityControls':\n case 'accessibilityDescribedBy': {\n viewProps[`aria-${keyInit.replace('accessibility', '').toLowerCase()}`] =\n processIDRefList(valInit)\n continue\n }\n case 'accessibilityKeyShortcuts': {\n if (Array.isArray(valInit)) {\n viewProps['aria-keyshortcuts'] = valInit.join(' ')\n }\n continue\n }\n case 'accessibilityLiveRegion': {\n viewProps['aria-live'] = valInit === 'none' ? 'off' : valInit\n continue\n }\n case 'accessibilityReadOnly': {\n viewProps['aria-readonly'] = valInit\n // Enhance with native semantics\n if (\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.readOnly = true\n }\n continue\n }\n case 'accessibilityRequired': {\n viewProps['aria-required'] = valInit\n // Enhance with native semantics\n if (\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.required = valInit\n }\n continue\n }\n default: {\n didUseKeyInit = false\n }\n }\n }\n }\n\n if (didUseKeyInit) {\n usedKeys[keyInit] = 1\n continue\n }\n\n if (valInit && valInit[0] === '_') {\n // if valid style key (or pseudo like color-hover):\n // this conditional and esp the pseudo check rarely runs so not a perf issue\n const isValidClassName = validStyles[keyInit]\n const isMediaOrPseudo =\n !isValidClassName &&\n keyInit.includes(PROP_SPLIT) &&\n validStyles[keyInit.split(PROP_SPLIT)[0]]\n\n if (isValidClassName || isMediaOrPseudo) {\n usedKeys[keyInit] = 1\n if (process.env.NODE_ENV === 'development') {\n if (debug) {\n // eslint-disable-next-line no-console\n console.log('tamagui classname props', keyInit, valInit)\n }\n }\n mergeClassName(transforms, classNames, keyInit, valInit, isMediaOrPseudo)\n continue\n }\n }\n }\n\n if (\n (defaultVariants && keyInit in defaultVariants) ||\n // may want to just: not compile styled() into classnames, always do this, and always pass in all values in extras.props\n // but we'd want to add styled({ extracted: true }) or something at compile time to save on parsing a bit...\n (state.keepVariantsAsProps && variants && keyInit in variants)\n ) {\n viewProps[keyInit] = valInit\n }\n\n /**\n * There's (some) reason to this madness: we want to allow returning media/pseudo from variants\n * Say you have a variant hoverable: { true: { hoverStyle: {} } }\n * We run propMapper first to expand variant, then we run the inner loop and look again\n * for if there's a pseudo/media returned from it.\n */\n\n let isMedia = isMediaKey(keyInit)\n let isPseudo = validPseudoKeys[keyInit]\n\n if (\n !(\n isMedia ||\n isPseudo ||\n variants?.[keyInit] ||\n validStyleProps[keyInit] ||\n shorthands[keyInit]\n )\n ) {\n usedKeys[keyInit] = 1\n viewProps[keyInit] = valInit\n continue\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // eslint-disable-next-line no-console\n console.groupCollapsed(' \uD83D\uDD39 styles', keyInit, valInit)\n }\n\n const expanded =\n isMedia || isPseudo\n ? [[keyInit, valInit]]\n : propMapper(\n keyInit,\n valInit,\n theme,\n props,\n state,\n languageContext,\n undefined,\n debug\n )\n\n if (!fontFamily) {\n fontFamily = getPropMappedFontFamily(expanded)\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n if (!isServer && isDevTools) {\n // eslint-disable-next-line no-console\n console.log('expanded', expanded, '\\nusedKeys', usedKeys, '\\ncurrent', {\n ...style,\n })\n }\n // eslint-disable-next-line no-console\n console.groupEnd()\n }\n\n if (!expanded) continue\n\n for (const [key, val] of expanded) {\n if (val === undefined) continue\n\n isMedia = isMediaKey(key)\n isPseudo = validPseudoKeys[key]\n const isMediaOrPseudo = isMedia || isPseudo\n\n if (!isMediaOrPseudo && usedKeys[key]) {\n if (process.env.NODE_ENV === 'developmnet' && debug === 'verbose') {\n console.log(`Used media/pseudo ${key}`)\n }\n continue\n }\n\n if (inlineProps?.has(key) || inlineWhenUnflattened?.has(key)) {\n usedKeys[key] = 1\n viewProps[key] = props[key] ?? val\n }\n\n // pseudo\n if (isPseudo) {\n if (!val) continue\n\n // TODO can avoid processing this if !shouldDoClasses + state is off\n const pseudoStyleObject = getSubStyle(\n styleState,\n key,\n val,\n true,\n state.noClassNames\n )\n\n const descriptor = pseudoDescriptors[key as keyof typeof pseudoDescriptors]\n const isEnter = descriptor.name === 'enter'\n const isExit = descriptor.name === 'exit'\n\n // don't continue here on isEnter && !state.unmounted because we need to merge defaults\n if (!descriptor || (isExit && !state.isExiting)) {\n continue\n }\n\n if (!shouldDoClasses || IS_STATIC) {\n pseudos ||= {}\n pseudos[key] ||= {}\n Object.assign(pseudos[key], pseudoStyleObject)\n }\n\n if (shouldDoClasses && !isEnter && !isExit) {\n const pseudoStyles = getAtomicStyle(pseudoStyleObject, descriptor)\n for (const psuedoStyle of pseudoStyles) {\n const fullKey = `${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}`\n if (!usedKeys[fullKey]) {\n usedKeys[fullKey] = 1\n addStyleToInsertRules(rulesToInsert, psuedoStyle)\n mergeClassName(\n transforms,\n classNames,\n fullKey,\n psuedoStyle.identifier,\n isMediaOrPseudo\n )\n }\n }\n } else {\n if (usedKeys[key]) {\n continue\n }\n\n let isDisabled = !state[descriptor.stateKey || descriptor.name]\n\n // we never animate in on server side just show the full thing\n // on client side we use CSS to hide the fully in SSR items, then\n // un-hide and replay with original animation.\n if (isWeb && !isClient && isEnter) {\n isDisabled = false\n }\n\n if (!isDisabled) {\n if (valInit === staticConfig.defaultProps[keyInit]) {\n // ignore:\n // if it's a default property given by styled(), we don't mark it as used, so\n // that props given inline can override:\n } else {\n usedKeys[key] ||= 1\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log(`Setting used ${key}`)\n }\n }\n }\n\n psuedosUsed ||= {}\n\n const importance = descriptor.priority\n for (const pkey in pseudoStyleObject) {\n const val = pseudoStyleObject[pkey]\n // when disabled ensure the default value is set for future animations to align\n if (isDisabled) {\n if (!(pkey in usedKeys) && pkey in animatableDefaults) {\n const defaultVal = animatableDefaults[pkey]\n mergeStyle(styleState, pkey, defaultVal, true)\n }\n continue\n }\n const curImportance = psuedosUsed[importance] || 0\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log('Merge pseudo?', { importance, curImportance, pkey, val })\n }\n if (importance >= curImportance) {\n psuedosUsed[pkey] = importance\n pseudos ||= {}\n pseudos[key] ||= {}\n pseudos[key][pkey] = val\n mergeStyle(styleState, pkey, val)\n }\n }\n }\n continue\n }\n\n // media\n if (isMedia) {\n if (!val) continue\n\n hasMedia ||= true\n\n // THIS USED TO PROXY BACK TO REGULAR PROPS BUT THAT IS THE WRONG BEHAVIOR\n // we avoid passing in default props for media queries because that would confuse things like SizableText.size:\n\n const mediaStyle = getSubStyle(\n styleState,\n key,\n val,\n // TODO try true like pseudo\n false\n )\n\n const mediaKeyShort = key.slice(1)\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // prettier-ignore\n // eslint-disable-next-line no-console\n console.log(` \uD83D\uDCFA ${key}`, { key, mediaStyle, props, shouldDoClasses })\n }\n\n if ('space' in mediaStyle) {\n if (!Array.isArray(hasMedia)) {\n hasMedia = []\n }\n hasMedia.push(mediaKeyShort)\n }\n\n if (shouldDoClasses) {\n if ('space' in mediaStyle) {\n delete mediaStyle['space']\n if (mediaState[mediaKeyShort]) {\n const val = valInit.space\n const importance = getMediaImportanceIfMoreImportant(\n mediaKeyShort,\n 'space',\n usedKeys\n )\n if (importance) {\n space = val\n usedKeys['space'] = importance\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n console.log(\n `Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`\n )\n }\n }\n }\n }\n const mediaStyles = getStylesAtomic(mediaStyle)\n for (const style of mediaStyles) {\n const out = createMediaStyle(style, mediaKeyShort, mediaQueryConfig)\n const fullKey = `${style.property}${PROP_SPLIT}${mediaKeyShort}`\n if (!usedKeys[fullKey]) {\n usedKeys[fullKey] = 1\n addStyleToInsertRules(rulesToInsert, out)\n mergeClassName(transforms, classNames, fullKey, out.identifier, true)\n }\n }\n } else if (mediaState[mediaKeyShort]) {\n for (const subKey in mediaStyle) {\n const importance = getMediaImportanceIfMoreImportant(\n mediaKeyShort,\n subKey,\n usedKeys\n )\n if (importance === null) continue\n if (subKey === 'space') {\n space = valInit.space\n continue\n }\n mergeMediaByImportance(\n style,\n mediaKeyShort,\n subKey,\n mediaStyle[subKey],\n usedKeys\n )\n if (key === 'fontFamily') {\n fontFamily = mediaStyle[key]\n }\n }\n }\n continue\n }\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n if (key === 'pointerEvents') {\n usedKeys[key] = 1\n viewProps[key] = val\n continue\n }\n }\n\n if (key === 'fontFamily' && !fontFamily && valInit && val) {\n fontFamily = valInit[0] === '$' ? valInit : val\n }\n\n if (key in validStyleProps) {\n mergeStyle(styleState, key, val)\n continue\n }\n\n // pass to view props\n if (!(variants && key in variants)) {\n if (!skipProps[key]) {\n viewProps[key] = val\n usedKeys[key] = 1\n }\n }\n }\n }\n\n fixStyles(style)\n if (isWeb) {\n styleToCSS(style)\n }\n\n // native: swap out the right family based on weight/style\n if (process.env.TAMAGUI_TARGET === 'native') {\n if ('fontFamily' in style && style.fontFamily) {\n const faceInfo = getFont(style.fontFamily)?.face\n if (faceInfo) {\n const overrideFace =\n faceInfo[style.fontWeight!]?.[style.fontStyle || 'normal']?.val\n if (overrideFace) {\n style.fontFamily = overrideFace\n fontFamily = overrideFace\n delete style.fontWeight\n delete style.fontStyle\n }\n }\n if (process.env.NODE_ENV === 'development') {\n if (debug) {\n console.log(`Found fontFamily native: ${style.fontFamily}`, faceInfo)\n }\n }\n }\n }\n\n // always do this at the very end to preserve the order strictly (animations, origin)\n // and allow proper merging of all pseudos before applying\n if (flatTransforms) {\n if (process.env.NODE_ENV === 'development' && debug) {\n // eslint-disable-next-line no-console\n console.log(\n 'Merging flat transforms, transform before',\n [...(style.transform || [])],\n flatTransforms\n )\n }\n mergeTransforms(style, flatTransforms, true)\n }\n\n // add in defaults if not set:\n if (parentSplitStyles) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (shouldDoClasses) {\n for (const key in parentSplitStyles.classNames) {\n const val = parentSplitStyles.classNames[key]\n if (key in style || key in classNames) continue\n classNames[key] = val\n }\n }\n }\n if (!shouldDoClasses) {\n for (const key in parentSplitStyles.style) {\n if (key in classNames || key in style) continue\n style[key] = parentSplitStyles.style[key]\n }\n }\n }\n\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (shouldDoClasses) {\n const retainedStyles = {}\n if (style['$$css']) {\n // avoid re-processing for rnw\n } else {\n const atomic = getStylesAtomic(style)\n for (const atomicStyle of atomic) {\n const key = atomicStyle.property\n if (props.animateOnly && props.animateOnly.includes(key)) {\n retainedStyles[key] = atomicStyle.value\n } else {\n addStyleToInsertRules(rulesToInsert, atomicStyle)\n mergeClassName(transforms, classNames, key, atomicStyle.identifier)\n }\n }\n if (!IS_STATIC) {\n style = retainedStyles\n }\n }\n }\n\n if (transforms) {\n for (const namespace in transforms) {\n if (!transforms[namespace]) {\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn('Error no transform', transforms, namespace)\n }\n continue\n }\n const [hash, val] = transforms[namespace]\n const identifier = `_transform${hash}`\n if (isClient && !insertedTransforms[identifier]) {\n const rule = `.${identifier} { transform: ${val}; }`\n addStyleToInsertRules(rulesToInsert, {\n identifier,\n rules: [rule],\n property: namespace,\n })\n }\n classNames[namespace] = identifier\n }\n }\n }\n\n const result = {\n space,\n hasMedia,\n fontFamily,\n viewProps,\n style,\n pseudos,\n classNames,\n rulesToInsert,\n }\n\n if (className) {\n classNames.className = className\n }\n\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n if (isDevTools) {\n // eslint-disable-next-line no-console\n console.groupCollapsed(' \uD83D\uDD39 styles =>')\n // prettier-ignore\n const logs = { transforms, viewProps, state, rulesToInsert, parentSplitStyles, flatTransforms, result }\n for (const key in { ...result, ...logs }) {\n // eslint-disable-next-line no-console\n console.log(key, logs[key])\n }\n // eslint-disable-next-line no-console\n console.groupEnd()\n }\n }\n\n cache.set(props, result)\n\n return result\n}\n\nfunction mergeClassName(\n transforms: Record<string, any[]>,\n classNames: Record<string, string>,\n key: string,\n val: string,\n isMediaOrPseudo = false\n) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n // empty classnames passed by compiler sometimes\n if (!val) return\n if (val[0] === '_' && val.startsWith('_transform-')) {\n const ns: TransformNamespaceKey = isMediaOrPseudo ? key : 'transform'\n let transform = insertedTransforms[val]\n if (isClient && !transform) {\n scanAllSheets() // HMR or loaded a new chunk\n transform = insertedTransforms[val]\n if (!transform && isWeb && val[0] !== '_') {\n transform = val // runtime insert\n }\n }\n transforms[ns] ||= ['', '']\n transforms[ns][0] += val.replace('_transform', '')\n // ssr doesn't need to do anything just make the right classname\n if (transform) {\n transforms[ns][1] += transform\n }\n } else {\n classNames[key] = val\n }\n }\n}\n\n/**\n * getSubStyle calls propMapper with props\n * those should be specific to the substyle, but fallback to the base props\n * so given props:\n *\n * { fontSize: 12, color: 'red', $sm: { color: 'blue' } }\n *\n * getSubStyle props should be a proxy that ends up like:\n *\n * { fontSize: 12, color: 'blue' }\n *\n * and to avoid re-creating it over and over, use a WeakMap\n */\nconst cache = new WeakMap()\nfunction getSubStyleProps(\n defaultProps: Object,\n baseProps: Object,\n specificProps: Object\n) {\n const key = specificProps || baseProps\n // can cache based only on specific it's always referentially consistent with base\n if (!cache.has(key)) {\n cache.set(key, {\n ...defaultProps,\n ...baseProps,\n ...specificProps,\n })\n }\n return cache.get(key)!\n}\n\nfunction mergeStyle(\n { usedKeys, classNames, flatTransforms, viewProps, style }: GetStyleState,\n key: string,\n val: any,\n dontSetUsed = false\n) {\n if (!dontSetUsed) {\n usedKeys[key] ||= 1\n }\n if (val && val[0] === '_') {\n classNames[key] = val\n } else if (key in stylePropsTransform) {\n flatTransforms ||= {}\n flatTransforms[key] = val\n } else {\n const out = normalizeValueWithProperty(val, key)\n if (key in validStylesOnBaseProps) {\n viewProps[key] = out\n } else {\n style[key] = out\n }\n }\n}\n\nexport const getSubStyle = (\n styleState: GetStyleState,\n subKey: string,\n styleIn: Object,\n avoidDefaultProps?: boolean,\n avoidMergeTransform?: boolean\n): ViewStyle => {\n const { staticConfig, theme, props, state, conf, languageContext } = styleState\n const styleOut: ViewStyle = {}\n\n for (let key in styleIn) {\n const val = styleIn[key]\n key = conf.shorthands[key] || key\n const expanded = staticConfig.propMapper(\n key,\n val,\n theme,\n getSubStyleProps(staticConfig.defaultProps, props, props[subKey]),\n state,\n languageContext,\n avoidDefaultProps\n )\n if (!expanded) continue\n for (const [skey, sval] of expanded) {\n if (!avoidMergeTransform && skey in stylePropsTransform) {\n mergeTransform(styleOut, skey, sval)\n } else {\n styleOut[skey] = normalizeValueWithProperty(sval, key)\n }\n }\n }\n\n fixStyles(styleOut)\n\n return styleOut\n}\n\nexport const insertSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n insertStyleRules(res.rulesToInsert)\n return res\n}\n\n// on native no need to insert any css\nconst useInsertEffectCompat = isWeb\n ? useInsertionEffect || useIsomorphicLayoutEffect\n : () => {}\n\nexport const useSplitStyles: StyleSplitter = (...args) => {\n const res = getSplitStyles(...args)\n\n if (!isRSC) {\n useInsertEffectCompat(() => {\n insertStyleRules(res.rulesToInsert)\n }, [res.rulesToInsert])\n }\n\n return res\n}\n\nfunction addStyleToInsertRules(\n rulesToInsert: RulesToInsert,\n styleObject: PartialStyleObject\n) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (!shouldInsertStyleRules(styleObject)) {\n return\n }\n updateRules(styleObject.identifier, styleObject.rules)\n rulesToInsert.push(styleObject)\n }\n}\n\nfunction processIDRefList(idRefList: string | Array<string>): string {\n return Array.isArray(idRefList) ? idRefList.join(' ') : idRefList\n}\n\nconst animatableDefaults = {\n opacity: 1,\n scale: 1,\n rotate: '0deg',\n rotateY: '0deg',\n rotateX: '0deg',\n}\n\nconst lowercaseHyphenate = (match: string) => `-${match.toLowerCase()}`\nconst hyphenate = (str: string) => str.replace(/[A-Z]/g, lowercaseHyphenate)\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAGnC,SAAS,WAAW,eAAe;AACnC,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP,SAAS,wBAAwB;AACjC,SAAS,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@
1
+ import { isRSC, isWeb } from "@tamagui/constants";
2
+ import { useContext } from "react";
3
+ import { FontLanguageContext } from "../contexts/FontLanguageContext";
4
+ import { TextAncestorContext } from "../contexts/TextAncestorContext";
5
+ import { useSplitStyles } from "../helpers/getSplitStyles";
6
+ import { useMedia } from "./useMedia";
7
+ import { useTheme } from "./useTheme";
8
+ function useStyle(base, style, options) {
9
+ const isText = base.staticConfig.isText;
10
+ const hasTextAncestor = !!(isWeb && isText ? useContext(TextAncestorContext) : false);
11
+ const languageContext = isRSC ? null : useContext(FontLanguageContext);
12
+ const theme = useTheme();
13
+ const media = useMedia();
14
+ const out = useSplitStyles(
15
+ style,
16
+ base.staticConfig,
17
+ theme,
18
+ {
19
+ ...options,
20
+ mediaState: media,
21
+ hasTextAncestor,
22
+ resolveVariablesAs: "auto"
23
+ },
24
+ null,
25
+ languageContext || void 0,
26
+ isText ? "span" : "div",
27
+ options == null ? void 0 : options.debug
28
+ );
29
+ return {
30
+ style: Object.keys(out.style).length ? out.style : null,
31
+ classNames: out.classNames
32
+ };
33
+ }
34
+ export {
35
+ useStyle
36
+ };
37
+ //# sourceMappingURL=useStyle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useStyle.tsx"],
4
+ "sourcesContent": ["import { isRSC, isWeb } from '@tamagui/constants'\nimport { useContext } from 'react'\n\nimport { FontLanguageContext } from '../contexts/FontLanguageContext'\nimport { TextAncestorContext } from '../contexts/TextAncestorContext'\nimport { useSplitStyles } from '../helpers/getSplitStyles'\nimport {\n DebugProp,\n GetProps,\n SplitStyleState,\n TamaguiComponent,\n TextNonStyleProps,\n} from '../types'\nimport { useMedia } from './useMedia'\nimport { useTheme } from './useTheme'\n\nexport function useStyle<\n Component extends TamaguiComponent,\n StyleProps = Omit<GetProps<Component>, keyof TextNonStyleProps>\n>(\n base: Component,\n style: StyleProps,\n options?: Partial<SplitStyleState> & { debug?: DebugProp }\n) {\n const isText = base.staticConfig.isText\n const hasTextAncestor = !!(isWeb && isText ? useContext(TextAncestorContext) : false)\n const languageContext = isRSC ? null : useContext(FontLanguageContext)\n const theme = useTheme()\n const media = useMedia()\n const out = useSplitStyles(\n style as any,\n base.staticConfig,\n theme,\n {\n ...(options as any),\n mediaState: media,\n hasTextAncestor,\n resolveVariablesAs: 'auto',\n },\n null,\n languageContext || undefined,\n isText ? 'span' : 'div',\n options?.debug\n )\n return {\n style: Object.keys(out.style).length ? out.style : null,\n classNames: out.classNames,\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,OAAO,aAAa;AAC7B,SAAS,kBAAkB;AAE3B,SAAS,2BAA2B;AACpC,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAQ/B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AAElB,SAAS,SAId,MACA,OACA,SACA;AACA,QAAM,SAAS,KAAK,aAAa;AACjC,QAAM,kBAAkB,CAAC,EAAE,SAAS,SAAS,WAAW,mBAAmB,IAAI;AAC/E,QAAM,kBAAkB,QAAQ,OAAO,WAAW,mBAAmB;AACrE,QAAM,QAAQ,SAAS;AACvB,QAAM,QAAQ,SAAS;AACvB,QAAM,MAAM;AAAA,IACV;AAAA,IACA,KAAK;AAAA,IACL;AAAA,IACA;AAAA,MACE,GAAI;AAAA,MACJ,YAAY;AAAA,MACZ;AAAA,MACA,oBAAoB;AAAA,IACtB;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB,SAAS,SAAS;AAAA,IAClB,mCAAS;AAAA,EACX;AACA,SAAO;AAAA,IACL,OAAO,OAAO,KAAK,IAAI,KAAK,EAAE,SAAS,IAAI,QAAQ;AAAA,IACnD,YAAY,IAAI;AAAA,EAClB;AACF;",
6
+ "names": []
7
+ }
package/dist/esm/index.js CHANGED
@@ -44,6 +44,7 @@ import {
44
44
  export * from "./hooks/useTheme";
45
45
  export * from "./hooks/useThemeName";
46
46
  export * from "./hooks/useSafeRef";
47
+ export * from "./hooks/useStyle";
47
48
  export * from "./views/Slot";
48
49
  export * from "./views/Stack";
49
50
  export * from "./views/Text";