@tamagui/web 1.14.2 → 1.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helpers/getSplitStyles.js +2 -2
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/styled.js +6 -1
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +2 -2
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.mjs +2 -2
- package/dist/esm/helpers/getSplitStyles.mjs.map +2 -2
- package/dist/esm/styled.js +6 -1
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/styled.mjs +6 -1
- package/dist/esm/styled.mjs.map +2 -2
- package/package.json +9 -9
- package/src/helpers/getSplitStyles.tsx +4 -2
- package/src/styled.tsx +20 -3
- package/src/types.tsx +3 -2
- package/types/createComponent.d.ts +2 -2
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/styled.d.ts +1 -1
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +1 -1
- package/types/types.d.ts.map +1 -1
- package/types/views/Stack.d.ts +1 -1
- package/types/views/Stack.d.ts.map +1 -1
- package/types/views/Text.d.ts +1 -1
- package/types/views/Text.d.ts.map +1 -1
|
@@ -400,7 +400,7 @@ const getSplitStyles = (props, staticConfig, theme, state, parentSplitStyles, la
|
|
|
400
400
|
isMedia = isMediaKey(key);
|
|
401
401
|
isPseudo = key in import_helpers.validPseudoKeys;
|
|
402
402
|
const isMediaOrPseudo = isMedia || isPseudo;
|
|
403
|
-
if (!isMediaOrPseudo && usedKeys
|
|
403
|
+
if (!isMediaOrPseudo && key in usedKeys) {
|
|
404
404
|
if (process.env.NODE_ENV === "developmnet" && debug === "verbose") {
|
|
405
405
|
console.log(`Used media/pseudo ${key}`);
|
|
406
406
|
}
|
|
@@ -448,7 +448,7 @@ const getSplitStyles = (props, staticConfig, theme, state, parentSplitStyles, la
|
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
} else {
|
|
451
|
-
if (usedKeys
|
|
451
|
+
if (key in usedKeys) {
|
|
452
452
|
continue;
|
|
453
453
|
}
|
|
454
454
|
let isDisabled = !state[descriptor.stateKey || descriptor.name];
|
|
@@ -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 stylePropsFont,\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.js'\nimport { isDevTools } from '../constants/isDevTools.js'\nimport {\n getMediaImportanceIfMoreImportant,\n mediaState as globalMediaState,\n mediaKeysWithAndWithout$,\n mediaQueryConfig,\n mergeMediaByImportance,\n} from '../hooks/useMedia.js'\nimport type {\n ClassNamesObject,\n DebugProp,\n GetStyleResult,\n MediaQueryKey,\n PseudoPropKeys,\n PseudoStyles,\n RulesToInsert,\n SpaceTokens,\n SplitStyleState,\n StaticConfigParsed,\n StyleObject,\n TamaguiInternalConfig,\n TextStyleProps,\n ThemeParsed,\n ViewStyleWithPseudos,\n} from '../types.js'\nimport type {\n FontLanguageProps,\n LanguageContextType,\n} from '../views/FontLanguage.types.js'\nimport { createMediaStyle } from './createMediaStyle.js'\nimport { getPropMappedFontFamily } from './createPropMapper.js'\nimport { fixStyles } from './expandStyles.js'\nimport { getAtomicStyle, getStylesAtomic, styleToCSS } from './getStylesAtomic'\nimport {\n insertStyleRules,\n insertedTransforms,\n scanAllSheets,\n shouldInsertStyleRules,\n updateRules,\n} from './insertStyleRule.js'\nimport {\n normalizeValueWithProperty,\n reverseMapClassNameToValue,\n} from './normalizeValueWithProperty.js'\nimport { pseudoDescriptors } from './pseudoDescriptors.js'\n\ntype GetStyleState = {\n style: TextStyleProps\n usedKeys: Record<string, number>\n classNames: ClassNamesObject\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>\n\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 tag: true,\n}\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 { variants, propMapper, isReactNative, inlineProps, 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: ViewStyleWithPseudos = {}\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 /**\n * Not the biggest fan of creating this object but it is a nice API\n */\n const styleState: GetStyleState = {\n classNames,\n conf,\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' && debug === 'verbose') {\n // eslint-disable-next-line no-console\n console.groupCollapsed('getSplitStyles (looping backwards)')\n // prettier-ignore\n // eslint-disable-next-line no-console\n console.log({ props, staticConfig, shouldDoClasses, state, IS_STATIC, propKeys, styleState })\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 /**\n * Need to process these after done with flattening the rest of the props + variants/mediam when we have the final font family.\n *\n * We use this because fonts are grouped together and cannot be processed correctly without the correct font family.\n */\n const specialProps: [string, any][] = []\n\n function processProp(\n keyInit: string,\n valInit: any,\n special = false,\n fontFamilyOverride: any = null\n ) {\n if (keyInit === 'className') return // handled above\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 return\n }\n }\n\n if (!staticConfig.isHOC) {\n if (keyInit in skipProps) {\n return\n }\n }\n\n if (keyInit in usedKeys) {\n return\n }\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 return\n }\n }\n\n if (keyInit === 'dataSet') {\n for (const key in valInit) {\n viewProps[`data-${hyphenate(key)}`] = valInit[key]\n }\n return\n }\n\n const isMainStyle = keyInit === 'style'\n if (isMainStyle || keyInit.startsWith('_style')) {\n if (!valInit) return\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 return\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 return\n }\n }\n\n if (keyInit === 'testID') {\n usedKeys[keyInit] = 1\n viewProps[isReactNative ? 'testId' : 'data-testid'] = valInit\n return\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 return\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 return\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 return\n }\n case 'accessibilityLabelledBy':\n case 'accessibilityFlowTo':\n case 'accessibilityControls':\n case 'accessibilityDescribedBy': {\n viewProps[`aria-${keyInit.replace('accessibility', '').toLowerCase()}`] =\n processIDRefList(valInit)\n return\n }\n case 'accessibilityKeyShortcuts': {\n if (Array.isArray(valInit)) {\n viewProps['aria-keyshortcuts'] = valInit.join(' ')\n }\n return\n }\n case 'accessibilityLiveRegion': {\n viewProps['aria-live'] = valInit === 'none' ? 'off' : valInit\n return\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 return\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 return\n }\n default: {\n didUseKeyInit = false\n }\n }\n }\n }\n\n if (didUseKeyInit) {\n usedKeys[keyInit] = 1\n return\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 = keyInit in validStyles\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' && debug) {\n // eslint-disable-next-line no-console\n console.log('tamagui classname props', keyInit, valInit)\n }\n mergeClassName(transforms, classNames, keyInit, valInit, isMediaOrPseudo)\n return\n }\n }\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 = keyInit in validPseudoKeys\n\n const isVariant = variants && keyInit in variants\n\n const shouldPassProp = !(\n isMedia ||\n isPseudo ||\n isVariant ||\n keyInit in validStyleProps ||\n keyInit in shorthands\n )\n\n const parentHasVariant =\n staticConfig.parentStaticConfig?.variants &&\n keyInit in staticConfig.parentStaticConfig\n const isHOCShouldPassThrough = staticConfig.isHOC && (isMedia || isPseudo)\n const shouldPassThrough = shouldPassProp || isHOCShouldPassThrough || parentHasVariant\n\n if (\n process.env.NODE_ENV === 'development' &&\n debug === 'verbose' &&\n shouldPassThrough\n ) {\n // eslint-disable-next-line no-console\n console.log(` \uD83D\uDD39 pass through ${keyInit}`)\n }\n\n if (shouldPassThrough) {\n usedKeys[keyInit] = 1\n viewProps[keyInit] = valInit\n\n // if it's a variant here, we have a two layer variant...\n // aka styled(Input, { unstyled: true, variants: { unstyled: {} } })\n // which now has it's own unstyled + the child unstyled...\n // so *don't* skip applying the styles, but also pass `unstyled` to children\n if (!isVariant) {\n return\n }\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 special ? { ...props, fontFamily: fontFamilyOverride } : 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 if (!expanded) return\n\n for (const [key, val] of expanded) {\n if (val === undefined) continue\n if (key in stylePropsFont && !special && key !== 'fontFamily') {\n specialProps.push([key, val])\n continue\n }\n\n isMedia = isMediaKey(key)\n isPseudo = key in validPseudoKeys\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, flatTransforms, pkey, defaultVal, true)\n }\n continue\n }\n const curImportance = psuedosUsed[importance] || 0\n const shouldMerge = importance >= curImportance\n if (shouldMerge) {\n psuedosUsed[pkey] = importance\n pseudos ||= {}\n pseudos[key] ||= {}\n pseudos[key][pkey] = val\n mergeStyle(styleState, flatTransforms, pkey, val)\n }\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // prettier-ignore\n console.log(' merge pseudo?', keyInit, shouldMerge, { importance, curImportance, 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\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 as any)\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.fontFamily as string\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, flatTransforms, key, val)\n continue\n }\n\n // pass to view props\n if (!variants || !(key in variants)) {\n if (!(key in skipProps)) {\n viewProps[key] = val\n usedKeys[key] = 1\n }\n }\n }\n }\n\n // loop backwards so we can skip already-used props\n for (let i = len - 1; i >= 0; i--) {\n const keyInit = propKeys[i]\n const valInit = props[keyInit]\n processProp(keyInit, valInit)\n }\n // loop the special props once again\n // this one doesn't need to be backwards since it was pushed in the backwards loop (is already reversed)\n for (let i = 0; i < specialProps.length; i++) {\n const [key, value] = specialProps[i]\n processProp(key, value, true, fontFamily)\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 as string)?.face\n if (faceInfo) {\n const overrideFace =\n faceInfo[style.fontWeight as string]?.[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 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 } as StyleObject)\n }\n classNames[namespace] = identifier\n }\n }\n }\n\n // now we need to reverse viewProps because order is important for wrapped tamagui children:\n // techcnically we could just do this when it is HOC/has parentStaticConfig I think... but safer this way\n const nextViewProps = {}\n const ks = Object.keys(viewProps)\n const l = ks.length\n for (let i = l - 1; i >= 0; i--) {\n nextViewProps[ks[i]] = viewProps[ks[i]]\n }\n\n const result = {\n space,\n hasMedia,\n fontFamily,\n viewProps: nextViewProps,\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 = { ...result, state, etc: { transforms, viewProps, rulesToInsert, parentSplitStyles, flatTransforms } }\n for (const key in 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, viewProps, style }: GetStyleState,\n flatTransforms: FlatTransforms,\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): TextStyleProps => {\n const { staticConfig, theme, props, state, conf, languageContext } = styleState\n const styleOut: TextStyleProps = {}\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\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(rulesToInsert: RulesToInsert, styleObject: StyleObject) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (!shouldInsertStyleRules(styleObject.identifier)) {\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\nexport type FlatTransforms = Record<string, any>\n\nconst mergeTransform = (\n obj: TextStyleProps,\n key: string,\n val: any,\n backwards = false\n) => {\n obj.transform ||= []\n obj.transform[backwards ? 'unshift' : 'push']({\n [mapTransformKeys[key] || key]: val,\n } as any)\n}\n\nconst mergeTransforms = (\n obj: TextStyleProps,\n flatTransforms: FlatTransforms,\n backwards = false\n) => {\n Object.entries(flatTransforms).forEach(([key, val]) => {\n mergeTransform(obj, key, val, backwards)\n })\n}\n\nconst mapTransformKeys = {\n x: 'translateX',\n y: 'translateY',\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAMO;AACP,qBAOO;AACP,mBAAmC;AAGnC,oBAAmC;AACnC,wBAA2B;AAC3B,sBAMO;AAsBP,8BAAiC;AACjC,8BAAwC;AACxC,0BAA0B;AAC1B,6BAA4D;AAC5D,6BAMO;AACP,wCAGO;AACP,+BAAkC;AAqBlC,MAAM,YAAY;AAAA,EAChB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AAAA,EACP,eAAe;AAAA,EACf,KAAK;AACP;AAEA,IAAI,QAAQ,IAAI,aAAa,QAAQ;AACnC,YAAU,mBAAmB,IAAI;AACnC;AAEA,MAAM,YAAY,QAAQ,IAAI,cAAc;AAG5C,IAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,SAAO,OAAO,WAAW;AAAA,IACvB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,cAAc;AAAA,IACd,wBAAwB;AAAA,IACxB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,EACb,CAAC;AACH;AAGA,MAAM,yBAAiD,CAAC;AACxD,IAAI,QAAQ,IAAI,mBAAmB,OAAO;AAExC,QAAM,QAAQ;AAAA,IACZ,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,MAAM;AAAA,IACN,SAAS;AA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n isClient,\n isRSC,\n isServer,\n isWeb,\n useIsomorphicLayoutEffect,\n} from '@tamagui/constants'\nimport {\n stylePropsFont,\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.js'\nimport { isDevTools } from '../constants/isDevTools.js'\nimport {\n getMediaImportanceIfMoreImportant,\n mediaState as globalMediaState,\n mediaKeysWithAndWithout$,\n mediaQueryConfig,\n mergeMediaByImportance,\n} from '../hooks/useMedia.js'\nimport type {\n ClassNamesObject,\n DebugProp,\n GetStyleResult,\n MediaQueryKey,\n PseudoPropKeys,\n PseudoStyles,\n RulesToInsert,\n SpaceTokens,\n SplitStyleState,\n StaticConfigParsed,\n StyleObject,\n TamaguiInternalConfig,\n TextStyleProps,\n ThemeParsed,\n ViewStyleWithPseudos,\n} from '../types.js'\nimport type {\n FontLanguageProps,\n LanguageContextType,\n} from '../views/FontLanguage.types.js'\nimport { createMediaStyle } from './createMediaStyle.js'\nimport { getPropMappedFontFamily } from './createPropMapper.js'\nimport { fixStyles } from './expandStyles.js'\nimport { getAtomicStyle, getStylesAtomic, styleToCSS } from './getStylesAtomic'\nimport {\n insertStyleRules,\n insertedTransforms,\n scanAllSheets,\n shouldInsertStyleRules,\n updateRules,\n} from './insertStyleRule.js'\nimport {\n normalizeValueWithProperty,\n reverseMapClassNameToValue,\n} from './normalizeValueWithProperty.js'\nimport { pseudoDescriptors } from './pseudoDescriptors.js'\n\ntype GetStyleState = {\n style: TextStyleProps\n usedKeys: Record<string, number>\n classNames: ClassNamesObject\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>\n\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 tag: true,\n}\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 { variants, propMapper, isReactNative, inlineProps, 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: ViewStyleWithPseudos = {}\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 /**\n * Not the biggest fan of creating this object but it is a nice API\n */\n const styleState: GetStyleState = {\n classNames,\n conf,\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' && debug === 'verbose') {\n // eslint-disable-next-line no-console\n console.groupCollapsed('getSplitStyles (looping backwards)')\n // prettier-ignore\n // eslint-disable-next-line no-console\n console.log({ props, staticConfig, shouldDoClasses, state, IS_STATIC, propKeys, styleState })\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 /**\n * Need to process these after done with flattening the rest of the props + variants/mediam when we have the final font family.\n *\n * We use this because fonts are grouped together and cannot be processed correctly without the correct font family.\n */\n const specialProps: [string, any][] = []\n\n function processProp(\n keyInit: string,\n valInit: any,\n special = false,\n fontFamilyOverride: any = null\n ) {\n if (keyInit === 'className') return // handled above\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 return\n }\n }\n\n if (!staticConfig.isHOC) {\n if (keyInit in skipProps) {\n return\n }\n }\n\n if (keyInit in usedKeys) {\n return\n }\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 return\n }\n }\n\n if (keyInit === 'dataSet') {\n for (const key in valInit) {\n viewProps[`data-${hyphenate(key)}`] = valInit[key]\n }\n return\n }\n\n const isMainStyle = keyInit === 'style'\n if (isMainStyle || keyInit.startsWith('_style')) {\n if (!valInit) return\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 return\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 return\n }\n }\n\n if (keyInit === 'testID') {\n usedKeys[keyInit] = 1\n viewProps[isReactNative ? 'testId' : 'data-testid'] = valInit\n return\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 return\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 return\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 return\n }\n case 'accessibilityLabelledBy':\n case 'accessibilityFlowTo':\n case 'accessibilityControls':\n case 'accessibilityDescribedBy': {\n viewProps[`aria-${keyInit.replace('accessibility', '').toLowerCase()}`] =\n processIDRefList(valInit)\n return\n }\n case 'accessibilityKeyShortcuts': {\n if (Array.isArray(valInit)) {\n viewProps['aria-keyshortcuts'] = valInit.join(' ')\n }\n return\n }\n case 'accessibilityLiveRegion': {\n viewProps['aria-live'] = valInit === 'none' ? 'off' : valInit\n return\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 return\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 return\n }\n default: {\n didUseKeyInit = false\n }\n }\n }\n }\n\n if (didUseKeyInit) {\n usedKeys[keyInit] = 1\n return\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 = keyInit in validStyles\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' && debug) {\n // eslint-disable-next-line no-console\n console.log('tamagui classname props', keyInit, valInit)\n }\n mergeClassName(transforms, classNames, keyInit, valInit, isMediaOrPseudo)\n return\n }\n }\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 = keyInit in validPseudoKeys\n\n const isVariant = variants && keyInit in variants\n\n const shouldPassProp = !(\n isMedia ||\n isPseudo ||\n isVariant ||\n keyInit in validStyleProps ||\n keyInit in shorthands\n )\n\n const parentHasVariant =\n staticConfig.parentStaticConfig?.variants &&\n keyInit in staticConfig.parentStaticConfig\n const isHOCShouldPassThrough = staticConfig.isHOC && (isMedia || isPseudo)\n const shouldPassThrough = shouldPassProp || isHOCShouldPassThrough || parentHasVariant\n\n if (\n process.env.NODE_ENV === 'development' &&\n debug === 'verbose' &&\n shouldPassThrough\n ) {\n // eslint-disable-next-line no-console\n console.log(` \uD83D\uDD39 pass through ${keyInit}`)\n }\n\n if (shouldPassThrough) {\n usedKeys[keyInit] = 1\n viewProps[keyInit] = valInit\n\n // if it's a variant here, we have a two layer variant...\n // aka styled(Input, { unstyled: true, variants: { unstyled: {} } })\n // which now has it's own unstyled + the child unstyled...\n // so *don't* skip applying the styles, but also pass `unstyled` to children\n if (!isVariant) {\n return\n }\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 special ? { ...props, fontFamily: fontFamilyOverride } : 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 if (!expanded) return\n\n for (const [key, val] of expanded) {\n if (val === undefined) continue\n if (key in stylePropsFont && !special && key !== 'fontFamily') {\n specialProps.push([key, val])\n continue\n }\n\n isMedia = isMediaKey(key)\n isPseudo = key in validPseudoKeys\n const isMediaOrPseudo = isMedia || isPseudo\n\n if (!isMediaOrPseudo && key in usedKeys) {\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\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 (key in usedKeys) {\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\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, flatTransforms, pkey, defaultVal, true)\n }\n continue\n }\n const curImportance = psuedosUsed[importance] || 0\n const shouldMerge = importance >= curImportance\n if (shouldMerge) {\n psuedosUsed[pkey] = importance\n pseudos ||= {}\n pseudos[key] ||= {}\n pseudos[key][pkey] = val\n mergeStyle(styleState, flatTransforms, pkey, val)\n }\n if (process.env.NODE_ENV === 'development' && debug === 'verbose') {\n // prettier-ignore\n console.log(' merge pseudo?', keyInit, shouldMerge, { importance, curImportance, 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\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 as any)\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.fontFamily as string\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, flatTransforms, key, val)\n continue\n }\n\n // pass to view props\n if (!variants || !(key in variants)) {\n if (!(key in skipProps)) {\n viewProps[key] = val\n usedKeys[key] = 1\n }\n }\n }\n }\n\n // loop backwards so we can skip already-used props\n for (let i = len - 1; i >= 0; i--) {\n const keyInit = propKeys[i]\n const valInit = props[keyInit]\n processProp(keyInit, valInit)\n }\n // loop the special props once again\n // this one doesn't need to be backwards since it was pushed in the backwards loop (is already reversed)\n for (let i = 0; i < specialProps.length; i++) {\n const [key, value] = specialProps[i]\n processProp(key, value, true, fontFamily)\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 as string)?.face\n if (faceInfo) {\n const overrideFace =\n faceInfo[style.fontWeight as string]?.[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 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 } as StyleObject)\n }\n classNames[namespace] = identifier\n }\n }\n }\n\n // now we need to reverse viewProps because order is important for wrapped tamagui children:\n // techcnically we could just do this when it is HOC/has parentStaticConfig I think... but safer this way\n const nextViewProps = {}\n const ks = Object.keys(viewProps)\n const l = ks.length\n for (let i = l - 1; i >= 0; i--) {\n nextViewProps[ks[i]] = viewProps[ks[i]]\n }\n\n const result = {\n space,\n hasMedia,\n fontFamily,\n viewProps: nextViewProps,\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 = { ...result, state, etc: { transforms, viewProps, rulesToInsert, parentSplitStyles, flatTransforms } }\n for (const key in 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, viewProps, style }: GetStyleState,\n flatTransforms: FlatTransforms,\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): TextStyleProps => {\n const { staticConfig, theme, props, state, conf, languageContext } = styleState\n const styleOut: TextStyleProps = {}\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\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(rulesToInsert: RulesToInsert, styleObject: StyleObject) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (!shouldInsertStyleRules(styleObject.identifier)) {\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\nexport type FlatTransforms = Record<string, any>\n\nconst mergeTransform = (\n obj: TextStyleProps,\n key: string,\n val: any,\n backwards = false\n) => {\n obj.transform ||= []\n obj.transform[backwards ? 'unshift' : 'push']({\n [mapTransformKeys[key] || key]: val,\n } as any)\n}\n\nconst mergeTransforms = (\n obj: TextStyleProps,\n flatTransforms: FlatTransforms,\n backwards = false\n) => {\n Object.entries(flatTransforms).forEach(([key, val]) => {\n mergeTransform(obj, key, val, backwards)\n })\n}\n\nconst mapTransformKeys = {\n x: 'translateX',\n y: 'translateY',\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AA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Y,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;AAI3E,MAAM,iBAAiB,CACrB,KACA,KACA,KACA,YAAY,UACT;AACH,MAAI,cAAJ,IAAI,YAAc,CAAC;AACnB,MAAI,UAAU,YAAY,YAAY,MAAM,EAAE;AAAA,IAC5C,CAAC,iBAAiB,GAAG,KAAK,GAAG,GAAG;AAAA,EAClC,CAAQ;AACV;AAEA,MAAM,kBAAkB,CACtB,KACA,gBACA,YAAY,UACT;AACH,SAAO,QAAQ,cAAc,EAAE,QAAQ,CAAC,CAAC,KAAK,GAAG,MAAM;AACrD,mBAAe,KAAK,KAAK,KAAK,SAAS;AAAA,EACzC,CAAC;AACH;AAEA,MAAM,mBAAmB;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AACL;",
|
|
6
6
|
"names": ["globalMediaState", "_a", "val", "style", "conf"]
|
|
7
7
|
}
|
package/dist/cjs/styled.js
CHANGED
|
@@ -61,7 +61,7 @@ function styled(ComponentIn, options, staticExtractionOptions) {
|
|
|
61
61
|
const isText = Boolean(
|
|
62
62
|
(staticExtractionOptions == null ? void 0 : staticExtractionOptions.isText) || (parentStaticConfig == null ? void 0 : parentStaticConfig.isText)
|
|
63
63
|
);
|
|
64
|
-
const acceptsClassName = acceptsClassNameProp ?? (isPlainStyledComponent || isReactNative);
|
|
64
|
+
const acceptsClassName = acceptsClassNameProp ?? (isPlainStyledComponent || isReactNative || (parentStaticConfig == null ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig == null ? void 0 : parentStaticConfig.acceptsClassName));
|
|
65
65
|
const conf = {
|
|
66
66
|
...staticExtractionOptions,
|
|
67
67
|
...!isPlainStyledComponent && {
|
|
@@ -85,6 +85,11 @@ function styled(ComponentIn, options, staticExtractionOptions) {
|
|
|
85
85
|
}
|
|
86
86
|
})();
|
|
87
87
|
const component = (0, import_createComponent.createComponent)(staticConfigProps || {}, Component);
|
|
88
|
+
for (const key in ComponentIn) {
|
|
89
|
+
if (key in component)
|
|
90
|
+
continue;
|
|
91
|
+
component[key] = ComponentIn[key];
|
|
92
|
+
}
|
|
88
93
|
return component;
|
|
89
94
|
}
|
|
90
95
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/cjs/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.tsx"],
|
|
4
|
-
"sourcesContent": ["import { stylePropsAll } from '@tamagui/helpers'\nimport { forwardRef } from 'react'\n\nimport { createComponent } from './createComponent.js'\nimport { ReactNativeStaticConfigs } from './setupReactNative.js'\nimport type {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n TamaguiElement,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types.js'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> =\n GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n }\n\ntype GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<\n any,\n any,\n infer P\n>\n ? P\n : GetProps<A>\n\ntype GetVariantProps<A extends StylableComponent> = A extends TamaguiComponent<\n any,\n any,\n any,\n infer V\n>\n ? V\n : {}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n ComponentIn: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n acceptsClassName?: boolean\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n // validate not using a variant over an existing valid style\n if (process.env.NODE_ENV !== 'production') {\n if (!ComponentIn) {\n throw new Error(`No component given to styled()`)\n }\n if (options?.variants) {\n for (const key in options.variants) {\n if (key in stylePropsAll) {\n console.error(\n `Invalid variant key overlaps with style key: ${key}. Tamagui prevents defining variants that use valid style keys to reduce complexity and confusion.`\n )\n }\n }\n }\n }\n\n const parentStaticConfig =\n 'staticConfig' in ComponentIn ? (ComponentIn.staticConfig as StaticConfig) : null\n\n const isPlainStyledComponent =\n !!parentStaticConfig &&\n !(parentStaticConfig.isReactNative || parentStaticConfig.isHOC)\n\n const Component: any = isPlainStyledComponent\n ? ComponentIn\n : parentStaticConfig?.Component || ComponentIn\n\n const isReactNative = Boolean(\n ReactNativeStaticConfigs.has(Component) ||\n staticExtractionOptions?.isReactNative ||\n ReactNativeStaticConfigs.has(parentStaticConfig?.Component) ||\n parentStaticConfig?.isReactNative\n )\n\n const staticConfigProps = (() => {\n if (options) {\n const {\n variants,\n name,\n defaultVariants,\n acceptsClassName: acceptsClassNameProp,\n ...defaultProps\n } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n\n const nativeConf =\n (isReactNative && ReactNativeStaticConfigs.get(Component)) || null\n\n const isText = Boolean(\n staticExtractionOptions?.isText || parentStaticConfig?.isText\n )\n const acceptsClassName =\n acceptsClassNameProp
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA8B;AAG9B,6BAAgC;AAChC,8BAAyC;AAuClC,SAAS,OAId,aAEA,SAOA,yBACA;AAEA,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,CAAC,aAAa;AAChB,YAAM,IAAI,MAAM,gCAAgC;AAAA,IAClD;AACA,QAAI,mCAAS,UAAU;AACrB,iBAAW,OAAO,QAAQ,UAAU;AAClC,YAAI,OAAO,8BAAe;AACxB,kBAAQ;AAAA,YACN,gDAAgD;AAAA,UAClD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,qBACJ,kBAAkB,cAAe,YAAY,eAAgC;AAE/E,QAAM,yBACJ,CAAC,CAAC,sBACF,EAAE,mBAAmB,iBAAiB,mBAAmB;AAE3D,QAAM,YAAiB,yBACnB,eACA,yDAAoB,cAAa;AAErC,QAAM,gBAAgB;AAAA,IACpB,iDAAyB,IAAI,SAAS,MACpC,mEAAyB,kBACzB,iDAAyB,IAAI,yDAAoB,SAAS,MAC1D,yDAAoB;AAAA,EACxB;AAEA,QAAM,qBAAqB,MAAM;AAC/B,QAAI,SAAS;AACX,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA,kBAAkB;AAAA,QAClB,GAAG;AAAA,MACL,IAAI;AACJ,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AAEA,YAAM,aACH,iBAAiB,iDAAyB,IAAI,SAAS,KAAM;AAEhE,YAAM,SAAS;AAAA,SACb,mEAAyB,YAAU,yDAAoB;AAAA,MACzD;AACA,YAAM,mBACJ,
|
|
4
|
+
"sourcesContent": ["import { stylePropsAll } from '@tamagui/helpers'\nimport { forwardRef } from 'react'\n\nimport { createComponent } from './createComponent.js'\nimport { ReactNativeStaticConfigs } from './setupReactNative.js'\nimport type {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n TamaguiElement,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types.js'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> =\n GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n }\n\ntype GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<\n any,\n any,\n infer P\n>\n ? P\n : GetProps<A>\n\ntype GetVariantProps<A extends StylableComponent> = A extends TamaguiComponent<\n any,\n any,\n any,\n infer V\n>\n ? V\n : {}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | void = VariantDefinitions<ParentComponent> | void\n>(\n ComponentIn: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n acceptsClassName?: boolean\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n // validate not using a variant over an existing valid style\n if (process.env.NODE_ENV !== 'production') {\n if (!ComponentIn) {\n throw new Error(`No component given to styled()`)\n }\n if (options?.variants) {\n for (const key in options.variants) {\n if (key in stylePropsAll) {\n console.error(\n `Invalid variant key overlaps with style key: ${key}. Tamagui prevents defining variants that use valid style keys to reduce complexity and confusion.`\n )\n }\n }\n }\n }\n\n const parentStaticConfig =\n 'staticConfig' in ComponentIn ? (ComponentIn.staticConfig as StaticConfig) : null\n\n const isPlainStyledComponent =\n !!parentStaticConfig &&\n !(parentStaticConfig.isReactNative || parentStaticConfig.isHOC)\n\n const Component: any = isPlainStyledComponent\n ? ComponentIn\n : parentStaticConfig?.Component || ComponentIn\n\n const isReactNative = Boolean(\n ReactNativeStaticConfigs.has(Component) ||\n staticExtractionOptions?.isReactNative ||\n ReactNativeStaticConfigs.has(parentStaticConfig?.Component) ||\n parentStaticConfig?.isReactNative\n )\n\n const staticConfigProps = (() => {\n if (options) {\n const {\n variants,\n name,\n defaultVariants,\n acceptsClassName: acceptsClassNameProp,\n ...defaultProps\n } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n\n const nativeConf =\n (isReactNative && ReactNativeStaticConfigs.get(Component)) || null\n\n const isText = Boolean(\n staticExtractionOptions?.isText || parentStaticConfig?.isText\n )\n const acceptsClassName =\n acceptsClassNameProp ??\n (isPlainStyledComponent ||\n isReactNative ||\n (parentStaticConfig?.isHOC && parentStaticConfig?.acceptsClassName))\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isPlainStyledComponent && {\n Component,\n }),\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name || parentStaticConfig?.componentName,\n isReactNative,\n isText,\n acceptsClassName,\n ...nativeConf,\n }\n\n // bail on non className views as well\n if (defaultProps.children || !acceptsClassName) {\n conf.neverFlatten = true\n }\n\n return conf\n }\n })()\n\n const component = createComponent(staticConfigProps || {}, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = GetBaseProps<ParentComponent>\n type ParentVariants = GetVariantProps<ParentComponent>\n\n type OurVariants = Variants extends void\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<\n any,\n infer Val\n >\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void\n ? GetProps<ParentComponent>\n : // start with base props\n OurPropsBase &\n // add in media (+ pseudos nested)\n MediaProps<Partial<OurPropsBase>> &\n // add in pseudos\n PseudoProps<Partial<OurPropsBase>>\n\n type ParentStaticProperties = {\n [Key in Exclude<\n keyof ParentComponent,\n 'defaultProps' | 'propTypes' | '$$typeof' | 'staticConfig' | 'extractable'\n >]: ParentComponent[Key]\n }\n\n type StyledComponent = TamaguiComponent<\n Props,\n TamaguiElement,\n ParentPropsBase,\n ParentVariants & OurVariants,\n ParentStaticProperties\n >\n\n for (const key in ComponentIn) {\n if (key in component) continue\n // @ts-expect-error assigning static properties over\n component[key] = ComponentIn[key]\n }\n\n return component as any as StyledComponent\n}\n\n// sanity check types\n// import { Stack } from './views/Stack'\n// const X = styled(Stack, {\n// variants: {\n// size: {\n// '...size': (val) => {\n// return {\n// pointerEvents: 'auto'\n// }\n// }\n// },\n// disabled: {\n// true: {\n// alignContent: 'center',\n// opacity: 0.5,\n// pointerEvents: 'none',\n// },\n// },\n// } as const\n// })\n// // type variants = GetStyledVariants<typeof X>\n// const y = <X disabled size=\"$10\" />\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA8B;AAG9B,6BAAgC;AAChC,8BAAyC;AAuClC,SAAS,OAId,aAEA,SAOA,yBACA;AAEA,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,CAAC,aAAa;AAChB,YAAM,IAAI,MAAM,gCAAgC;AAAA,IAClD;AACA,QAAI,mCAAS,UAAU;AACrB,iBAAW,OAAO,QAAQ,UAAU;AAClC,YAAI,OAAO,8BAAe;AACxB,kBAAQ;AAAA,YACN,gDAAgD;AAAA,UAClD;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,qBACJ,kBAAkB,cAAe,YAAY,eAAgC;AAE/E,QAAM,yBACJ,CAAC,CAAC,sBACF,EAAE,mBAAmB,iBAAiB,mBAAmB;AAE3D,QAAM,YAAiB,yBACnB,eACA,yDAAoB,cAAa;AAErC,QAAM,gBAAgB;AAAA,IACpB,iDAAyB,IAAI,SAAS,MACpC,mEAAyB,kBACzB,iDAAyB,IAAI,yDAAoB,SAAS,MAC1D,yDAAoB;AAAA,EACxB;AAEA,QAAM,qBAAqB,MAAM;AAC/B,QAAI,SAAS;AACX,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA,kBAAkB;AAAA,QAClB,GAAG;AAAA,MACL,IAAI;AACJ,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AAEA,YAAM,aACH,iBAAiB,iDAAyB,IAAI,SAAS,KAAM;AAEhE,YAAM,SAAS;AAAA,SACb,mEAAyB,YAAU,yDAAoB;AAAA,MACzD;AACA,YAAM,mBACJ,yBACC,0BACC,kBACC,yDAAoB,WAAS,yDAAoB;AAEtD,YAAM,OAA8B;AAAA,QAClC,GAAG;AAAA,QACH,GAAI,CAAC,0BAA0B;AAAA,UAC7B;AAAA,QACF;AAAA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe,SAAQ,yDAAoB;AAAA,QAC3C;AAAA,QACA;AAAA,QACA;AAAA,QACA,GAAG;AAAA,MACL;AAGA,UAAI,aAAa,YAAY,CAAC,kBAAkB;AAC9C,aAAK,eAAe;AAAA,MACtB;AAEA,aAAO;AAAA,IACT;AAAA,EACF,GAAG;AAEH,QAAM,gBAAY,wCAAgB,qBAAqB,CAAC,GAAG,SAAS;AA6CpE,aAAW,OAAO,aAAa;AAC7B,QAAI,OAAO;AAAW;AAEtB,cAAU,GAAG,IAAI,YAAY,GAAG;AAAA,EAClC;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -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 { StyleObject } from '@tamagui/helpers'\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 GestureResponderHandlers,\n PressableProps,\n TextProps as ReactTextProps,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport type { Variable } from './createVariable.js'\nimport type { ResolveVariableTypes } from './helpers/createPropMapper.js'\nimport type { FontLanguageProps } from './views/FontLanguage.types.js'\nimport type { ThemeProviderProps } from './views/ThemeProvider.js'\n\nexport type { MediaStyleObject, StyleObject } from '@tamagui/helpers'\n\nexport type SpaceDirection = 'vertical' | 'horizontal' | 'both'\n\nexport type TamaguiElement = HTMLElement | View\n\nexport type DebugProp = boolean | 'break' | 'verbose' | 'visualize'\n\n// base props that are accepted by createComponent (additional to react-native-web)\n\ntype DivAttributes = HTMLAttributes<HTMLDivElement>\n\nexport type TamaguiReactElement<P = any> = React.ReactElement<P> & {\n type: TamaguiComponent\n}\n\nexport type TamaguiComponentPropsBase = {\n target?: string\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 tabIndex?: string | number\n role?: string\n\n /**\n * Forces the pseudo style state to be on\n */\n forceStyle?: 'hover' | 'press' | 'focus'\n onPress?: PressableProps['onPress']\n onPressIn?: PressableProps['onPress']\n onPressOut?: PressableProps['onPress']\n\n // WEB ONLY TODO probably remove these in favor of something better\n onHoverIn?: DivAttributes['onMouseEnter']\n onHoverOut?: DivAttributes['onMouseLeave']\n onMouseEnter?: DivAttributes['onMouseEnter']\n onMouseLeave?: DivAttributes['onMouseLeave']\n onMouseDown?: DivAttributes['onMouseDown']\n onMouseUp?: DivAttributes['onMouseUp']\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n onScroll?: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void\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\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\nexport type CreateShorthands = {\n // for some reason using keyof ViewStyle here will cause type circularity on react native 0.71\n [key: string]: string\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// try and find the top level types as they can be supersets:\ntype NonSubThemeNames<A extends string | number> = A extends `${string}_${string}`\n ? never\n : A\ntype BaseThemeDefinitions = TamaguiConfig['themes'][NonSubThemeNames<\n keyof TamaguiConfig['themes']\n>]\ntype GenericThemeDefinition = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type ThemeDefinition = BaseThemeDefinitions extends never\n ? GenericThemeDefinition\n : BaseThemeDefinitions\nexport type ThemeKeys = keyof ThemeDefinition\nexport type ThemeParsed = {\n [key in ThemeKeys]: Variable<any>\n}\n\nexport type Tokens = TamaguiConfig['tokens']\n\nexport type TokensParsed = {\n size: TokenPrefixed<Tokens['size']>\n color: TokenPrefixed<Tokens['color']>\n radius: TokenPrefixed<Tokens['radius']>\n zIndex: TokenPrefixed<Tokens['zIndex']>\n space: TokenPrefixed<Tokens['space']>\n}\n\ntype TokenPrefixed<A extends { [key: string]: any }> = {\n [key in Ensure$Prefix<keyof A>]: A[keyof A]\n}\n\ntype Ensure$Prefix<A extends string | number | symbol> = A extends string\n ? A extends `$${string}`\n ? A\n : `$${A}`\n : never\n\nexport type TokensMerged = {\n size: TokensParsed['size'] & Tokens['size']\n color: TokensParsed['color'] & Tokens['color']\n radius: TokensParsed['radius'] & Tokens['radius']\n zIndex: TokensParsed['zIndex'] & Tokens['zIndex']\n space: TokensParsed['space'] & Tokens['space']\n}\n\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?: DebugProp | any\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 & {}\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 SharedBaseExtraStyleProps = {\n pointerEvents?: ViewProps['pointerEvents']\n cursor?: Properties['cursor']\n contain?: Properties['contain']\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n gap?: number | SpaceTokens\n columnGap?: number | SpaceTokens\n rowGap?: number | SpaceTokens\n userSelect?: Properties['userSelect']\n outlineColor?: Properties['outlineColor']\n outlineStyle?: Properties['outlineStyle']\n outlineOffset?: number | SpaceTokens\n outlineWidth?: number | SpaceTokens\n}\n\ntype OverrideRNStyleProps =\n | 'display'\n | 'backfaceVisibility'\n | 'elevation'\n | 'gap'\n | 'columnGap'\n | 'rowGap'\n\nexport type StackStylePropsBase = Omit<ViewStyle, OverrideRNStyleProps> &\n TransformStyleProps &\n SharedBaseExtraStyleProps\n\nexport type TextStylePropsBase = Omit<TextStyle, OverrideRNStyleProps> &\n TransformStyleProps &\n SharedBaseExtraStyleProps & {\n ellipse?: boolean\n textDecorationDistance?: number\n textOverflow?: Properties['textOverflow']\n whiteSpace?: Properties['whiteSpace']\n wordWrap?: Properties['wordWrap']\n }\n\nexport interface ExtendBaseStackProps {}\nexport interface ExtendsBaseTextProps {}\n\n//\n// Stack\n//\n\n// these are added back in by core\ntype OmitRemovedNonWebProps = 'onLayout' | keyof GestureResponderHandlers\n\nexport type StackNonStyleProps = Omit<\n ViewProps,\n 'display' | 'children' | OmitRemovedNonWebProps\n> &\n ExtendBaseStackProps &\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<\n ReactTextProps,\n 'children' | OmitRemovedNonWebProps\n> &\n ExtendsBaseTextProps &\n TamaguiComponentPropsBase\n\nexport type TextPropsBase = TextNonStyleProps & WithThemeAndShorthands<TextStylePropsBase>\n\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\ntype StaticConfigBase = 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 * Used internally for knowing how to handle when a HOC is in-between styled()\n */\n isHOC?: boolean\n}\n\nexport type StaticConfig = StaticConfigBase & {\n parentStaticConfig?: StaticConfigBase\n}\n\nexport type ViewStyleWithPseudos =\n | TextStyleProps\n | (TextStyleProps & {\n hoverStyle?: TextStyleProps\n pressStyle?: TextStyleProps\n focusStyle?: TextStyleProps\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\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 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// TODO: make css driver compatible with this?\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: <V extends UniversalAnimatedNumber<any>>(\n opts: {\n value: V\n hostRef: RefObject<HTMLElement | View>\n },\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\nexport type RulesToInsert = StyleObject[]\n\nexport type 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\nexport type ClassNamesObject = Record<string, string>\n\nexport type TamaguiComponentEvents = {\n cancelable?: boolean | undefined\n disabled?: any\n hitSlop?: any\n delayLongPress?: any\n delayPressIn?: any\n delayPressOut?: any\n focusable?: any\n minPressDuration?: number | undefined\n onPressIn: ((e: any) => void) | undefined\n onPress: ((e: any) => void) | undefined\n onMouseEnter?: ((e: any) => void) | undefined\n onMouseLeave?: ((e: any) => void) | undefined\n onPressOut: ((e: any) => void) | undefined\n}\n"],
|
|
4
|
+
"sourcesContent": ["// TODO split this into own package @tamagui/types to share with animations packages\n\nimport type { StyleObject } from '@tamagui/helpers'\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 GestureResponderHandlers,\n PressableProps,\n TextProps as ReactTextProps,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport type { Variable } from './createVariable.js'\nimport type { ResolveVariableTypes } from './helpers/createPropMapper.js'\nimport type { FontLanguageProps } from './views/FontLanguage.types.js'\nimport type { ThemeProviderProps } from './views/ThemeProvider.js'\n\nexport type { MediaStyleObject, StyleObject } from '@tamagui/helpers'\n\nexport type SpaceDirection = 'vertical' | 'horizontal' | 'both'\n\nexport type TamaguiElement = HTMLElement | View\n\nexport type DebugProp = boolean | 'break' | 'verbose' | 'visualize'\n\n// base props that are accepted by createComponent (additional to react-native-web)\n\ntype DivAttributes = HTMLAttributes<HTMLDivElement>\n\nexport type TamaguiReactElement<P = any> = React.ReactElement<P> & {\n type: TamaguiComponent\n}\n\nexport type TamaguiComponentPropsBase = {\n target?: string\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 tabIndex?: string | number\n role?: string\n\n /**\n * Forces the pseudo style state to be on\n */\n forceStyle?: 'hover' | 'press' | 'focus'\n onPress?: PressableProps['onPress']\n onPressIn?: PressableProps['onPress']\n onPressOut?: PressableProps['onPress']\n\n // WEB ONLY TODO probably remove these in favor of something better\n onHoverIn?: DivAttributes['onMouseEnter']\n onHoverOut?: DivAttributes['onMouseLeave']\n onMouseEnter?: DivAttributes['onMouseEnter']\n onMouseLeave?: DivAttributes['onMouseLeave']\n onMouseDown?: DivAttributes['onMouseDown']\n onMouseUp?: DivAttributes['onMouseUp']\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n onScroll?: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void\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\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\nexport type CreateShorthands = {\n // for some reason using keyof ViewStyle here will cause type circularity on react native 0.71\n [key: string]: string\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// try and find the top level types as they can be supersets:\ntype NonSubThemeNames<A extends string | number> = A extends `${string}_${string}`\n ? never\n : A\ntype BaseThemeDefinitions = TamaguiConfig['themes'][NonSubThemeNames<\n keyof TamaguiConfig['themes']\n>]\ntype GenericThemeDefinition = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type ThemeDefinition = BaseThemeDefinitions extends never\n ? GenericThemeDefinition\n : BaseThemeDefinitions\nexport type ThemeKeys = keyof ThemeDefinition\nexport type ThemeParsed = {\n [key in ThemeKeys]: Variable<any>\n}\n\nexport type Tokens = TamaguiConfig['tokens']\n\nexport type TokensParsed = {\n size: TokenPrefixed<Tokens['size']>\n color: TokenPrefixed<Tokens['color']>\n radius: TokenPrefixed<Tokens['radius']>\n zIndex: TokenPrefixed<Tokens['zIndex']>\n space: TokenPrefixed<Tokens['space']>\n}\n\ntype TokenPrefixed<A extends { [key: string]: any }> = {\n [key in Ensure$Prefix<keyof A>]: A[keyof A]\n}\n\ntype Ensure$Prefix<A extends string | number | symbol> = A extends string\n ? A extends `$${string}`\n ? A\n : `$${A}`\n : never\n\nexport type TokensMerged = {\n size: TokensParsed['size'] & Tokens['size']\n color: TokensParsed['color'] & Tokens['color']\n radius: TokensParsed['radius'] & Tokens['radius']\n zIndex: TokensParsed['zIndex'] & Tokens['zIndex']\n space: TokensParsed['space'] & Tokens['space']\n}\n\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?: DebugProp | any\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 & {}\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 SharedBaseExtraStyleProps = {\n pointerEvents?: ViewProps['pointerEvents']\n cursor?: Properties['cursor']\n contain?: Properties['contain']\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n gap?: number | SpaceTokens\n columnGap?: number | SpaceTokens\n rowGap?: number | SpaceTokens\n userSelect?: Properties['userSelect']\n outlineColor?: Properties['outlineColor']\n outlineStyle?: Properties['outlineStyle']\n outlineOffset?: number | SpaceTokens\n outlineWidth?: number | SpaceTokens\n}\n\ntype OverrideRNStyleProps =\n | 'display'\n | 'backfaceVisibility'\n | 'elevation'\n | 'gap'\n | 'columnGap'\n | 'rowGap'\n\nexport type StackStylePropsBase = Omit<ViewStyle, OverrideRNStyleProps> &\n TransformStyleProps &\n SharedBaseExtraStyleProps\n\nexport type TextStylePropsBase = Omit<TextStyle, OverrideRNStyleProps> &\n TransformStyleProps &\n SharedBaseExtraStyleProps & {\n ellipse?: boolean\n textDecorationDistance?: number\n textOverflow?: Properties['textOverflow']\n whiteSpace?: Properties['whiteSpace']\n wordWrap?: Properties['wordWrap']\n }\n\nexport interface ExtendBaseStackProps {}\nexport interface ExtendsBaseTextProps {}\n\n//\n// Stack\n//\n\n// these are added back in by core\ntype OmitRemovedNonWebProps = 'onLayout' | keyof GestureResponderHandlers\n\nexport type StackNonStyleProps = Omit<\n ViewProps,\n 'display' | 'children' | OmitRemovedNonWebProps\n> &\n ExtendBaseStackProps &\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<\n ReactTextProps,\n 'children' | OmitRemovedNonWebProps\n> &\n ExtendsBaseTextProps &\n TamaguiComponentPropsBase\n\nexport type TextPropsBase = TextNonStyleProps & WithThemeAndShorthands<TextStylePropsBase>\n\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 ParentStaticProperties = {}\n> = ReactComponentWithRef<Props, Ref> & StaticComponentObject & ParentStaticProperties\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\ntype StaticConfigBase = 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 * Used internally for knowing how to handle when a HOC is in-between styled()\n */\n isHOC?: boolean\n}\n\nexport type StaticConfig = StaticConfigBase & {\n parentStaticConfig?: StaticConfigBase\n}\n\nexport type ViewStyleWithPseudos =\n | TextStyleProps\n | (TextStyleProps & {\n hoverStyle?: TextStyleProps\n pressStyle?: TextStyleProps\n focusStyle?: TextStyleProps\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\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 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// TODO: make css driver compatible with this?\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: <V extends UniversalAnimatedNumber<any>>(\n opts: {\n value: V\n hostRef: RefObject<HTMLElement | View>\n },\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\nexport type RulesToInsert = StyleObject[]\n\nexport type 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\nexport type ClassNamesObject = Record<string, string>\n\nexport type TamaguiComponentEvents = {\n cancelable?: boolean | undefined\n disabled?: any\n hitSlop?: any\n delayLongPress?: any\n delayPressIn?: any\n delayPressOut?: any\n focusable?: any\n minPressDuration?: number | undefined\n onPressIn: ((e: any) => void) | undefined\n onPress: ((e: any) => void) | undefined\n onMouseEnter?: ((e: any) => void) | undefined\n onMouseLeave?: ((e: any) => void) | undefined\n onPressOut: ((e: any) => void) | undefined\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|