@tamagui/core 1.0.1-beta.25 → 1.0.1-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/cjs/createComponent.js +4 -2
  2. package/dist/cjs/createComponent.js.map +2 -2
  3. package/dist/cjs/helpers/createPropMapper.js +10 -16
  4. package/dist/cjs/helpers/createPropMapper.js.map +2 -2
  5. package/dist/cjs/helpers/getStackSize.js +6 -4
  6. package/dist/cjs/helpers/getStackSize.js.map +2 -2
  7. package/dist/cjs/helpers/getVariantExtras.js +48 -0
  8. package/dist/cjs/helpers/getVariantExtras.js.map +7 -0
  9. package/dist/cjs/hooks/useFeatures.js.map +2 -2
  10. package/dist/cjs/index.js +1 -0
  11. package/dist/cjs/index.js.map +2 -2
  12. package/dist/cjs/styled.js.map +2 -2
  13. package/dist/cjs/types-rnw.js.map +1 -1
  14. package/dist/cjs/types.js.map +1 -1
  15. package/dist/esm/createComponent.js +4 -2
  16. package/dist/esm/createComponent.js.map +2 -2
  17. package/dist/esm/helpers/createPropMapper.js +10 -16
  18. package/dist/esm/helpers/createPropMapper.js.map +2 -2
  19. package/dist/esm/helpers/getStackSize.js +6 -4
  20. package/dist/esm/helpers/getStackSize.js.map +2 -2
  21. package/dist/esm/helpers/getVariantExtras.js +26 -0
  22. package/dist/esm/helpers/getVariantExtras.js.map +7 -0
  23. package/dist/esm/hooks/useFeatures.js.map +2 -2
  24. package/dist/esm/index.js +1 -0
  25. package/dist/esm/index.js.map +2 -2
  26. package/dist/esm/styled.js.map +2 -2
  27. package/dist/jsx/createComponent.js +4 -2
  28. package/dist/jsx/helpers/createPropMapper.js +10 -16
  29. package/dist/jsx/helpers/getStackSize.js +6 -4
  30. package/dist/jsx/helpers/getVariantExtras.js +25 -0
  31. package/dist/jsx/index.js +1 -0
  32. package/package.json +6 -6
  33. package/reset.css +4 -0
  34. package/types/createComponent.d.ts.map +1 -1
  35. package/types/helpers/createPropMapper.d.ts.map +1 -1
  36. package/types/helpers/getStackSize.d.ts +2 -1
  37. package/types/helpers/getStackSize.d.ts.map +1 -1
  38. package/types/helpers/getVariantExtras.d.ts +9 -0
  39. package/types/helpers/getVariantExtras.d.ts.map +1 -0
  40. package/types/hooks/useFeatures.d.ts +3 -2
  41. package/types/hooks/useFeatures.d.ts.map +1 -1
  42. package/types/index.d.ts +1 -0
  43. package/types/index.d.ts.map +1 -1
  44. package/types/styled.d.ts.map +1 -1
  45. package/types/types-rnw.d.ts.map +1 -1
  46. package/types/types.d.ts +1 -0
  47. package/types/types.d.ts.map +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx"],
4
- "sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | symbol =\n | VariantDefinitions<ParentComponent>\n | symbol\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n const staticConfigProps = (() => {\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb =\n 'staticConfig' in Component\n ? Component.staticConfig.isReactNativeWeb\n : RNComponents.has(Component)\n const reactNativeWebComponent = isReactNativeWeb\n ? Component['staticConfig']?.reactNativeWebComponent || Component\n : null\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = reactNativeWebComponent || (Component as any)\n const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false))\n const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false))\n const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false))\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n isTamagui,\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name,\n isReactNativeWeb,\n // for nesting multiple levels of rnw styled() need keep use the OG component\n reactNativeWebComponent,\n isInput,\n isText,\n isImage,\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = ParentComponent extends TamaguiComponent<any, any, infer P>\n ? P\n : GetProps<ParentComponent>\n type ParentVariants = ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\n type OurVariants = Variants extends symbol\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void | symbol\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 return component as TamaguiComponent<\n Props,\n // TODO infer ref\n any,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n}\n\n// test types:\n// // variants\n// export const XStack = styled(Stack, {\n// flexDirection: 'row',\n// name: 'XStack',\n// variants: {\n// fullscreen: {\n// true: {},\n// },\n// elevation: {\n// '...size': (val) => ({}),\n// },\n// },\n// })\n// const InBetween = styled(XStack, {})\n// type INBVariants = typeof InBetween extends TamaguiComponent<any, any, any, infer Variants> ? Variants: never\n// const SwitchFrame = styled(InBetween, {\n// name: 'Switch',\n// tag: 'button',\n// borderRadius: 100,\n// borderWidth: 0,\n// variants: {\n// name: {\n// true: {\n// backgroundColor: 'aliceblue'\n// },\n// // 1: {\n\n// // },\n// // ':number': (val) => {\n// // return {}\n// // },\n// // \"...fontSize\": (val) => {\n// // return {}\n// // },\n// // \"...color\": (val) => {\n// // return {}\n// // }\n// }\n// },\n// defaultVariants: {\n// size: '$4',\n// },\n// })\n// const x = <XStack fullscreen />\n// const y = <XStack fullscreen />\n// const z = <SwitchFrame fullscreen name />\n\n// depth:\n// export const SizableText = styled(Stack, {\n// name: 'SizableText',\n// backgroundColor: 'red',\n// variants: {\n// size: {\n// '...fontSize': (val, { props }) => {\n// return {\n// backgroundColor: '',\n// }\n// },\n// },\n// },\n// })\n// export const Heading = styled(SizableText, {\n// tag: 'span',\n// name: 'Heading',\n// accessibilityRole: 'header',\n// size: '$8',\n// margin: 0,\n// })\n// export const Paragraph = styled(SizableText, {\n// tag: 'p',\n// margin: 10,\n// variants: {\n// another: {\n// true: {},\n// },\n// },\n// })\n// export const Paragraph2 = styled(Paragraph, {\n// tag: 'p',\n// variants: {\n// another: {\n// '...color': (val) => ({\n// backgroundColor: 'red',\n// }),\n// },\n// },\n// })\n// const a = <SizableText size=\"$10\" />\n// const b = <Paragraph size=\"$10\" another />\n// const c = <Paragraph2 size=\"$10\" another=\"aliceblue\" />\n// export const SizableText2 = styled(SizableText, {\n// })\n// const xx = <SizableText2 abc />\n// export const Paragraph = styled(SizableText, {\n// name: 'Paragraph',\n// })\n// export const Heading = styled(Paragraph, {\n// tag: 'span',\n// margin: 0,\n// })\n// export const H2 = styled(Heading, {\n// name: 'H2',\n// })\n// const x = <H2 color=\"red\" />\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAuC;AAEvC,6BAAgC;AAChC,0BAA6B;AAoBtB,gBAML,WAEA,SAMA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAvCnC;AAwCI,QAAI,SAAS;AACX,YAA6D,cAArD,YAAU,MAAM,oBAAqC,IAAjB,yBAAiB,IAAjB,CAApC,YAAU,QAAM;AACxB,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBACJ,kBAAkB,YACd,UAAU,aAAa,mBACvB,iCAAa,IAAI,SAAS;AAChC,YAAM,0BAA0B,mBAC5B,iBAAU,oBAAV,mBAA2B,4BAA2B,YACtD;AACJ,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO,2BAA4B;AACzC,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,4BAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,gCAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,2BAAO;AAClF,YAAM,OAA8B,gDAC/B,0BACC,CAAC,aAAa;AAAA,QAChB,WAAW;AAAA,MACb,IAJkC;AAAA,QAKlC;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,YAAY,4CAAgB,mBAAmB,SAAS;AA4B9D,SAAO;AAOT;AA9FgB;",
4
+ "sourcesContent": ["import { Image, Text, TextInput } from 'react-native'\n\nimport { createComponent } from './createComponent'\nimport { RNComponents } from './helpers/RNComponents'\nimport {\n GetProps,\n GetVariantValues,\n MediaProps,\n PseudoProps,\n StaticConfig,\n StylableComponent,\n TamaguiComponent,\n VariantDefinitions,\n VariantSpreadFunction,\n} from './types'\n\n// TODO may be able to use this in the options?: arg below directly\nexport type StyledOptions<ParentComponent extends StylableComponent> = GetProps<ParentComponent> & {\n name?: string\n variants?: VariantDefinitions<ParentComponent> | undefined\n defaultVariants?: { [key: string]: any }\n}\n\nexport function styled<\n ParentComponent extends StylableComponent,\n Variants extends VariantDefinitions<ParentComponent> | symbol =\n | VariantDefinitions<ParentComponent>\n | symbol\n>(\n Component: ParentComponent,\n // this should be Partial<GetProps<ParentComponent>> but causes excessively deep type issues\n options?: GetProps<ParentComponent> & {\n name?: string\n variants?: Variants | undefined\n // thought i had this typed, but can't get it linked\n defaultVariants?: { [key: string]: any }\n },\n staticExtractionOptions?: Partial<StaticConfig>\n) {\n const staticConfigProps = (() => {\n if (options) {\n const { variants, name, defaultVariants, ...defaultProps } = options\n if (defaultVariants) {\n Object.assign(defaultProps, defaultVariants)\n }\n const isReactNativeWeb =\n 'staticConfig' in Component\n ? Component.staticConfig.isReactNativeWeb\n : RNComponents.has(Component)\n const reactNativeWebComponent = isReactNativeWeb\n ? Component['staticConfig']?.reactNativeWebComponent || Component\n : null\n const isTamagui = !isReactNativeWeb && 'staticConfig' in Component\n const Comp = reactNativeWebComponent || (Component as any)\n const isImage = !!(defaultProps.isImage || (!isTamagui ? Comp === Image : false))\n const isInput = !!(defaultProps.isInput || (!isTamagui ? Comp === TextInput : false))\n const isText = !!(defaultProps.isText || (!isTamagui ? isInput || Comp === Text : false))\n\n const conf: Partial<StaticConfig> = {\n ...staticExtractionOptions,\n ...(!isTamagui && {\n Component: Comp,\n }),\n isTamagui,\n // this type gets messed up by options?: Partial<GetProps<ParentComponent>> above\n // take away the Partial<> and it's fine\n variants,\n defaultProps,\n defaultVariants,\n componentName: name,\n isReactNativeWeb,\n // for nesting multiple levels of rnw styled() need keep use the OG component\n reactNativeWebComponent,\n isInput,\n isText,\n isImage,\n }\n\n return conf\n }\n return {}\n })()\n\n const component = createComponent(staticConfigProps, Component)\n\n // get parent props without pseudos and medias so we can rebuild both with new variants\n type ParentPropsBase = ParentComponent extends TamaguiComponent<any, any, infer P>\n ? P\n : GetProps<ParentComponent>\n type ParentVariants = ParentComponent extends TamaguiComponent<any, any, any, infer V> ? V : {}\n\n type OurVariants = Variants extends symbol\n ? {}\n : {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n }\n\n type VariantProps = Omit<ParentVariants, keyof OurVariants> & OurVariants\n type OurPropsBase = ParentPropsBase & VariantProps\n\n type Props = Variants extends void | symbol\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 return component as TamaguiComponent<\n Props,\n // TODO infer ref\n any,\n ParentPropsBase,\n ParentVariants & OurVariants\n >\n}\n\n// test types:\n// // variants\n// export const XStack = styled(Stack, {\n// flexDirection: 'row',\n// name: 'XStack',\n// variants: {\n// fullscreen: {\n// true: {},\n// },\n// elevation: {\n// '...size': (val) => ({}),\n// },\n// },\n// })\n// const InBetween = styled(XStack, {})\n// type INBVariants = typeof InBetween extends TamaguiComponent<any, any, any, infer Variants> ? Variants: never\n// const SwitchFrame = styled(InBetween, {\n// name: 'Switch',\n// tag: 'button',\n// borderRadius: 100,\n// borderWidth: 0,\n// variants: {\n// name: {\n// true: {\n// backgroundColor: 'aliceblue'\n// },\n// // 1: {\n\n// // },\n// // ':number': (val) => {\n// // return {}\n// // },\n// // \"...fontSize\": (val) => {\n// // return {}\n// // },\n// // \"...color\": (val) => {\n// // return {}\n// // }\n// }\n// },\n// defaultVariants: {\n// size: '$4',\n// },\n// })\n// const x = <XStack fullscreen />\n// const y = <XStack fullscreen />\n// const z = <SwitchFrame fullscreen name />\n\n// depth:\n// export const SizableText = styled(Stack, {\n// name: 'SizableText',\n// backgroundColor: 'red',\n// variants: {\n// size: {\n// '...fontSize': (val, { props }) => {\n// return {\n// backgroundColor: '',\n// }\n// },\n// },\n// },\n// })\n// export const Heading = styled(SizableText, {\n// tag: 'span',\n// name: 'Heading',\n// accessibilityRole: 'header',\n// size: '$8',\n// margin: 0,\n// })\n// export const Paragraph = styled(SizableText, {\n// tag: 'p',\n// margin: 10,\n// variants: {\n// another: {\n// true: {},\n// },\n// },\n// })\n// export const Paragraph2 = styled(Paragraph, {\n// tag: 'p',\n// variants: {\n// another: {\n// '...color': (val) => ({\n// backgroundColor: 'red',\n// }),\n// },\n// },\n// })\n// const a = <SizableText size=\"$10\" />\n// const b = <Paragraph size=\"$10\" another />\n// const c = <Paragraph2 size=\"$10\" another=\"aliceblue\" />\n// export const SizableText2 = styled(SizableText, {\n// })\n// const xx = <SizableText2 abc />\n// export const Paragraph = styled(SizableText, {\n// name: 'Paragraph',\n// })\n// export const Heading = styled(Paragraph, {\n// tag: 'span',\n// margin: 0,\n// })\n// export const H2 = styled(Heading, {\n// name: 'H2',\n// })\n// const x = <H2 color=\"red\" />\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAuC;AAEvC,6BAAgC;AAChC,0BAA6B;AAoBtB,gBAML,WAEA,SAMA,yBACA;AACA,QAAM,oBAAqB,OAAM;AAvCnC;AAwCI,QAAI,SAAS;AACX,YAA6D,cAArD,YAAU,MAAM,oBAAqC,IAAjB,yBAAiB,IAAjB,CAApC,YAAU,QAAM;AACxB,UAAI,iBAAiB;AACnB,eAAO,OAAO,cAAc,eAAe;AAAA,MAC7C;AACA,YAAM,mBACJ,kBAAkB,YACd,UAAU,aAAa,mBACvB,iCAAa,IAAI,SAAS;AAChC,YAAM,0BAA0B,mBAC5B,iBAAU,oBAAV,mBAA2B,4BAA2B,YACtD;AACJ,YAAM,YAAY,CAAC,oBAAoB,kBAAkB;AACzD,YAAM,OAAO,2BAA4B;AACzC,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,4BAAQ;AAC1E,YAAM,UAAU,CAAC,CAAE,cAAa,WAAY,EAAC,YAAY,SAAS,gCAAY;AAC9E,YAAM,SAAS,CAAC,CAAE,cAAa,UAAW,EAAC,YAAY,WAAW,SAAS,2BAAO;AAElF,YAAM,OAA8B,gDAC/B,0BACC,CAAC,aAAa;AAAA,QAChB,WAAW;AAAA,MACb,IAJkC;AAAA,QAKlC;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AACA,WAAO,CAAC;AAAA,EACV,GAAG;AAEH,QAAM,YAAY,4CAAgB,mBAAmB,SAAS;AA4B9D,SAAO;AAOT;AA/FgB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/types-rnw.tsx"],
4
- "sourcesContent": ["// The following list is sourced from:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/types/styles.js#L76\ntype RNWCursorValue =\n | 'alias'\n | 'all-scroll'\n | 'auto'\n | 'cell'\n | 'context-menu'\n | 'copy'\n | 'crosshair'\n | 'default'\n | 'grab'\n | 'grabbing'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'text'\n | 'vertical-text'\n | 'move'\n | 'none'\n | 'no-drop'\n | 'not-allowed'\n | 'zoom-in'\n | 'zoom-out'\n | 'col-resize'\n | 'e-resize'\n | 'ew-resize'\n | 'n-resize'\n | 'ne-resize'\n | 'ns-resize'\n | 'nw-resize'\n | 'row-resize'\n | 's-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'w-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n\n// This list is the combination of the following two lists:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js#L10\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L12\n// Plus the single hard-coded value \"label\" from here:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L36\ntype RNWWebAccessibilityRole =\n | 'adjustable'\n | 'article'\n | 'banner'\n | 'blockquote'\n | 'button'\n | 'code'\n | 'complementary'\n | 'contentinfo'\n | 'deletion'\n | 'emphasis'\n | 'figure'\n | 'form'\n | 'header'\n | 'image'\n | 'imagebutton'\n | 'insertion'\n | 'keyboardkey'\n | 'label'\n | 'link'\n | 'list'\n | 'listitem'\n | 'main'\n | 'navigation'\n | 'none'\n | 'region'\n | 'search'\n | 'strong'\n | 'summary'\n | 'text'\n\ninterface PressableStateCallbackType {\n hovered?: boolean\n focused?: boolean\n}\n\nexport interface RNWViewProps {\n // our internal hack to pass className down (until styleq transition)\n dataSet?: any\n\n // TODO get proper types:\n target?: any\n rel?: any\n download?: any\n\n accessibilityRole?: RNWWebAccessibilityRole\n href?: string\n hrefAttrs?: {\n target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top'\n rel?: string\n download?: boolean\n }\n onMouseDown?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseUp?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseEnter?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseLeave?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n onScroll?: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void\n // For compatibility with RNW internals\n onScrollShouldSetResponder?: unknown\n onScrollShouldSetResponderCapture?: unknown\n onSelectionChangeShouldSetResponder?: unknown\n onSelectionChangeShouldSetResponderCapture?: unknown\n}\n\nexport interface RNWTextProps {\n dir?: 'ltr' | 'rtl' | 'auto'\n focusable?: boolean\n accessibilityRole?: RNWWebAccessibilityRole\n accessibilityState?: {\n busy?: boolean\n checked?: boolean | 'mixed'\n disabled?: boolean\n expanded?: boolean\n grabbed?: boolean\n hidden?: boolean\n invalid?: boolean\n pressed?: boolean\n readonly?: boolean\n required?: boolean\n selected?: boolean\n }\n href?: string\n // TODO hrefAttrs or come up with proper html escape hatch\n // hrefAttrs?: {\n // target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top'\n // rel?: string\n // download?: boolean\n // }\n onMouseEnter?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseLeave?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n // For compatibility with RNW internals\n onMoveShouldSetResponder?: unknown\n onMoveShouldSetResponderCapture?: unknown\n onResponderEnd?: unknown\n onResponderGrant?: unknown\n onResponderMove?: unknown\n onResponderReject?: unknown\n onResponderRelease?: unknown\n onResponderStart?: unknown\n onResponderTerminate?: unknown\n onResponderTerminationRequest?: unknown\n onScrollShouldSetResponder?: unknown\n onScrollShouldSetResponderCapture?: unknown\n onSelectionChangeShouldSetResponder?: unknown\n onSelectionChangeShouldSetResponderCapture?: unknown\n onStartShouldSetResponder?: unknown\n onStartShouldSetResponderCapture?: unknown\n}\n\nexport interface RNWViewStyle {\n cursor?: RNWCursorValue\n transitionProperty?: string\n display?: 'flex' | 'inline-flex' | 'none'\n}\n\nexport interface RNWTextStyle {\n // The following list is sourced from:\n // - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/types/styles.js#L128\n userSelect?: 'all' | 'auto' | 'contain' | 'none' | 'text'\n}\n"],
4
+ "sourcesContent": ["// The following list is sourced from:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/types/styles.js#L76\ntype RNWCursorValue =\n | 'alias'\n | 'all-scroll'\n | 'auto'\n | 'cell'\n | 'context-menu'\n | 'copy'\n | 'crosshair'\n | 'default'\n | 'grab'\n | 'grabbing'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'text'\n | 'vertical-text'\n | 'move'\n | 'none'\n | 'no-drop'\n | 'not-allowed'\n | 'zoom-in'\n | 'zoom-out'\n | 'col-resize'\n | 'e-resize'\n | 'ew-resize'\n | 'n-resize'\n | 'ne-resize'\n | 'ns-resize'\n | 'nw-resize'\n | 'row-resize'\n | 's-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'w-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n\n// This list is the combination of the following two lists:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js#L10\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L12\n// Plus the single hard-coded value \"label\" from here:\n// - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js#L36\ntype RNWWebAccessibilityRole =\n | 'adjustable'\n | 'article'\n | 'banner'\n | 'blockquote'\n | 'button'\n | 'code'\n | 'complementary'\n | 'contentinfo'\n | 'deletion'\n | 'emphasis'\n | 'figure'\n | 'form'\n | 'header'\n | 'image'\n | 'imagebutton'\n | 'insertion'\n | 'keyboardkey'\n | 'label'\n | 'link'\n | 'list'\n | 'listitem'\n | 'main'\n | 'navigation'\n | 'none'\n | 'region'\n | 'search'\n | 'strong'\n | 'summary'\n | 'text'\n\nexport interface RNWViewProps {\n // our internal hack to pass className down (until styleq transition)\n dataSet?: any\n\n // TODO get proper types:\n target?: any\n rel?: any\n download?: any\n\n accessibilityRole?: RNWWebAccessibilityRole\n href?: string\n hrefAttrs?: {\n target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top'\n rel?: string\n download?: boolean\n }\n onMouseDown?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseUp?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseEnter?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseLeave?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n onScroll?: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void\n // For compatibility with RNW internals\n onScrollShouldSetResponder?: unknown\n onScrollShouldSetResponderCapture?: unknown\n onSelectionChangeShouldSetResponder?: unknown\n onSelectionChangeShouldSetResponderCapture?: unknown\n}\n\nexport interface RNWTextProps {\n dir?: 'ltr' | 'rtl' | 'auto'\n focusable?: boolean\n accessibilityRole?: RNWWebAccessibilityRole\n accessibilityState?: {\n busy?: boolean\n checked?: boolean | 'mixed'\n disabled?: boolean\n expanded?: boolean\n grabbed?: boolean\n hidden?: boolean\n invalid?: boolean\n pressed?: boolean\n readonly?: boolean\n required?: boolean\n selected?: boolean\n }\n href?: string\n // TODO hrefAttrs or come up with proper html escape hatch\n // hrefAttrs?: {\n // target?: '_blank' | '_self' | '_top' | 'blank' | 'self' | 'top'\n // rel?: string\n // download?: boolean\n // }\n onMouseEnter?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onMouseLeave?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void\n // For compatibility with RNW internals\n onMoveShouldSetResponder?: unknown\n onMoveShouldSetResponderCapture?: unknown\n onResponderEnd?: unknown\n onResponderGrant?: unknown\n onResponderMove?: unknown\n onResponderReject?: unknown\n onResponderRelease?: unknown\n onResponderStart?: unknown\n onResponderTerminate?: unknown\n onResponderTerminationRequest?: unknown\n onScrollShouldSetResponder?: unknown\n onScrollShouldSetResponderCapture?: unknown\n onSelectionChangeShouldSetResponder?: unknown\n onSelectionChangeShouldSetResponderCapture?: unknown\n onStartShouldSetResponder?: unknown\n onStartShouldSetResponderCapture?: unknown\n}\n\nexport interface RNWViewStyle {\n cursor?: RNWCursorValue\n transitionProperty?: string\n display?: 'flex' | 'inline-flex' | 'none'\n}\n\nexport interface RNWTextStyle {\n // The following list is sourced from:\n // - https://github.com/necolas/react-native-web/blob/0.17.5/packages/react-native-web/src/types/styles.js#L128\n userSelect?: 'all' | 'auto' | 'contain' | 'none' | 'text'\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -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 CSS from 'csstype'\nimport React from 'react'\nimport {\n GestureResponderEvent,\n Image,\n TextProps as ReactTextProps,\n Text,\n TextInput,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ResolveVariableTypes } from './helpers/createPropMapper'\nimport { RNWTextProps, RNWViewProps } from './types-rnw'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type ReactComponentWithRef<Props, Ref> = React.ForwardRefExoticComponent<\n Props & React.RefAttributes<Ref>\n>\n\nexport type ConfigListener = (conf: TamaguiInternalConfig) => void\n\n// to prevent things from going circular, hoisting some types in this file\n// to generally order them as building up towards TamaguiConfig\n\nexport type VariableVal = number | string | Variable\nexport type VariableColorVal = string | Variable\n\ntype GenericKey = string | number | symbol\n\nexport interface CreateTokens<Val extends VariableVal = VariableVal> {\n color: { [key: GenericKey]: Val }\n space: { [key: GenericKey]: Val }\n size: { [key: GenericKey]: Val }\n radius: { [key: GenericKey]: Val }\n zIndex: { [key: GenericKey]: Val }\n}\n\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}\ntype GenericShorthands = {\n // [key: string]: string\n}\n\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\n\ntype GenericFonts = {\n [key: string]: GenericFont\n}\n\ntype GenericAnimations = {\n [key: string]:\n | string\n | {\n [key: string]: any\n }\n}\n\n// this is the \"main\" typed object, which users re-define\n// (internal) keep all types directly on this object and reference them from elsewhere\n//\n// const config = createTamagui(...)\n// type MyConfig = typeof config\n// declare module 'tamagui' {\n// export interface TamaguiCustomConfig extends MyConfig {}\n// }\n// now your whole app/kit should be typed correctly\n//\nexport interface TamaguiCustomConfig {}\n\nexport interface TamaguiConfig\n extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>,\n TamaguiCustomConfig {}\n\nexport type CreateTamaguiConfig<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n fonts: F\n tokens: A\n themes: B\n shorthands: C\n media: D\n animations: AnimationDriver<E>\n}\n\n// for use in creation functions so it doesnt get overwrtitten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia,\n GenericAnimations,\n GenericFonts\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeObject = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\nexport type ThemeName = GetAltThemeNames<keyof Themes>\n// export type ThemeNameWithSubThemes = GetSubThemes<ThemeName>\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeTokens = `$${ThemeKeys}`\nexport type AnimationKeys = Omit<GetAnimationKeys<TamaguiConfig>, number>\n\ntype GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S\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> = CreateTamaguiConfig<A, B, C, D, E, F> & {\n // TODO need to make it this but this breaks types, revisit\n // animations: E //AnimationDriver<E>\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n fontsParsed: GenericFonts\n getCSS: () => string\n parsed: boolean\n}\n\nexport type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations']['animations']\n\n// prevents const intersections from being clobbered into string, keeping the consts\nexport type UnionableString = string & {}\nexport type UnionableNumber = number & {}\nexport type PropTypes<A extends TamaguiComponent> = A extends React.FunctionComponent<infer Props>\n ? Props\n : unknown\n\nexport type GenericFont<Key extends number | string = number | string> = {\n size: { [key in Key]: number | Variable }\n lineHeight: Partial<{ [key in Key]: number | Variable }>\n letterSpacing: Partial<{ [key in Key]: number | Variable }>\n weight: Partial<{ [key in Key]: number | string | Variable }>\n family: string | Variable\n style?: Partial<{ [key in Key]: TextStyle['fontStyle'] | Variable }>\n transform?: Partial<{ [key in Key]: TextStyle['textTransform'] | Variable }>\n color?: Partial<{ [key in Key]: string | Variable }>\n}\n\n// media\nexport type MediaKeys = keyof Media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryKey = keyof Media\nexport type MediaPropKeys = `$${MediaQueryKey}`\nexport type MediaQueryState = { [key in MediaPropKeys]: boolean }\nexport type MediaProps<A> = {\n [key in MediaPropKeys]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\nexport type ConfigureMediaQueryOptions = {\n queries?: MediaQueries\n defaultActive?: MediaQueryKey[]\n}\n\nexport type TransformStyleProps = {\n x?: number\n y?: number\n perspective?: number\n scale?: number\n scaleX?: number\n scaleY?: number\n skewX?: string\n skewY?: string\n matrix?: number[]\n rotate?: string\n rotateY?: string\n rotateX?: string\n rotateZ?: string\n}\n\n// createComponent props helpers\n\n// 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\nexport type SpaceDirection = ViewStyle['flexDirection'] | 'both'\n\n//\n// base props that are accepted by createComponent (additional to react-native-web)\n//\nexport type TamaguiComponentPropsBase = {\n asChild?: boolean\n space?: SpaceTokens\n spaceDirection?: SpaceDirection\n dangerouslySetInnerHTML?: { __html: string }\n animation?: AnimationProp\n animateOnly?: string[]\n children?: any | any[]\n debug?: boolean | 'break' | 'verbose'\n disabled?: boolean\n className?: string\n id?: string\n tag?: string\n theme?: ThemeName | null\n onHoverIn?: (e: MouseEvent) => any\n onHoverOut?: (e: MouseEvent) => any\n onPress?: (e: GestureResponderEvent) => any\n onPressIn?: (e: GestureResponderEvent) => any\n onPressOut?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseEnter?: (e: MouseEvent) => any\n onMouseLeave?: (e: MouseEvent) => any\n onMouseDown?: (e: MouseEvent) => any\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\nexport type ColorTokens =\n | GetTokenString<keyof Tokens['color']>\n | GetTokenString<keyof ThemeObject>\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 FontWeightTokens =\n | `$${GetTokenFontKeysFor<'weight'>}`\n | `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`\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 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 PsuedoPropKeys = 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, psuedos...\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> = WithThemeShorthandsAndPseudos<A> &\n MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n//\n// Stack\n//\n\ntype WebOnlyStyleProps = {\n // WEB ONLY\n cursor?: string\n // WEB ONLY\n contain?: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'paint' | string\n // WEB ONLY values: inherit, inline, block, content\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n // WEB ONLY pointerEvents can be a style prop\n pointerEvents?: ViewProps['pointerEvents']\n}\n\nexport type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> &\n TransformStyleProps &\n WebOnlyStyleProps\n\nexport type StackPropsBaseShared = Omit<ViewProps, 'display' | 'children'> &\n RNWViewProps &\n TamaguiComponentPropsBase\nexport type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>\nexport type StackPropsBase = StackPropsBaseShared & WithThemeAndShorthands<StackStylePropsBase>\nexport type StackProps = StackPropsBaseShared & StackStyleProps\n\n//\n// Text props\n//\n\nexport type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> &\n TransformStyleProps &\n WebOnlyStyleProps & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n userSelect?: CSS.Properties['userSelect']\n textOverflow?: CSS.Properties['textOverflow']\n whiteSpace?: CSS.Properties['whiteSpace']\n wordWrap?: CSS.Properties['wordWrap']\n cursor?: CSS.Properties['cursor']\n }\n\nexport type TextPropsBaseShared = Omit<ReactTextProps, 'children'> &\n RNWTextProps &\n TamaguiComponentPropsBase\nexport type TextPropsBase = TextPropsBaseShared & WithThemeAndShorthands<TextStylePropsBase>\nexport type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>\nexport type TextProps = TextPropsBaseShared & TextStyleProps\n\n// could actually infer from parent\nexport type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<\n Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase\n>\n\n//\n// StaticComponent\n//\n\nexport type TamaguiComponent<\n Props = any,\n Ref = any,\n BaseProps = {},\n VariantProps = {}\n> = ReactComponentWithRef<Props, Ref> & StaticComponentObject\n\ntype StaticComponentObject = {\n staticConfig: StaticConfig\n /*\n * Only needed for more complex components\n * If you create a styled frame component this is a HoC to extract\n * styles from all parents.\n */\n extractable: <X>(a: X, opts?: Partial<StaticConfig>) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n injectCSS?: boolean\n children?: React.ReactNode\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any,\n resolveVariablesAs?: ResolveVariableTypes,\n avoidDefaultProps?: boolean\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: React.FunctionComponent<any> & StaticComponentObject\n\n variants?: {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n }\n\n /**\n * Used for applying sub theme style\n */\n componentName?: string\n\n /**\n * If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /**\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /**\n * Attempts to attach focus styles at runtime (useful for native)\n */\n isInput?: boolean\n\n /**\n * React native web images need special handling for className support\n */\n isImage?: boolean\n\n /**\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /**\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /**\n * If these props are encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /**\n * If these props are encountered, leave them un-extracted.\n */\n inlineProps?: Set<string>\n\n /**\n * A bit odd, only for more advanced heirarchies.\n * Indicates that the component will set this prop so the\n * static extraction can ensure it sets them to ={undefined}\n * so they get overriddent. In the future, this can be smarter.\n */\n ensureOverriddenProp?: { [key: string]: boolean }\n\n /**\n * Auto-detected, but can ovverride. Wraps children to space them on top\n */\n isZStack?: boolean\n\n /**\n * Merges into defaultProps later on, used internally yonly\n */\n defaultVariants?: { [key: string]: any }\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isReactNativeWeb?: boolean\n\n /**\n * Used internally to keep reference to the original rnw component\n */\n reactNativeWebComponent?: any\n\n /**\n * Memoize the component\n */\n memo?: boolean\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isTamagui?: boolean\n}\n\n/**\n * --------------------------------------------\n * variants\n * --------------------------------------------\n */\n\nexport type StylableComponent =\n | TamaguiComponent\n | React.Component\n | React.ForwardRefExoticComponent<any>\n | (new (props: any) => any)\n | typeof View\n | typeof Text\n | typeof TextInput\n | typeof Image\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<infer Props>\n ? Props\n : A extends React.Component<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 | '...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 '...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]?: MyProps | 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<A, SizeTokens>\nexport type ColorVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ColorTokens>\nexport type FontLineHeightVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontLineHeightTokens\n>\nexport type FontLetterSpacingVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontLetterSpacingTokens\n>\nexport type FontStyleVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontStyleTokens\n>\nexport type FontTransformVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontTransformTokens\n>\nexport type ZIndexVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ZIndexTokens>\nexport type RadiusVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, RadiusTokens>\nexport type ThemeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ThemeTokens>\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 mounted: boolean\n animation?: null | {\n style?: any\n avoidClasses?: boolean\n }\n}\n\nexport type SplitStyleState = TamaguiComponentState & {\n noClassNames?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n fallbackProps?: Object\n}\n\n// Animations:\n\ntype AnimationConfig = {\n [key: string]: any\n}\n\nexport type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {\n avoidClasses?: boolean\n useAnimations: UseAnimationHook\n animations: A\n View?: any\n Text?: any\n}\n\nexport type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>\n\nexport type UseAnimationHelpers = {\n staticConfig: StaticConfigParsed\n getStyle: (props?: {\n isEntering?: boolean\n exitVariant?: string | null\n enterVariant?: string | null\n }) => ViewStyle\n state: SplitStyleState\n pseudos: PseudoProps<ViewStyle>\n // style: ViewStyle | null | undefined\n // isMounted: boolean\n // exitStyle?: ViewStyle | null\n onDidAnimate?: any\n delay?: number\n // mergedStyles(props?: { isExiting?: boolean }): ViewStyle\n}\n\nexport type UseAnimationHook = (\n props: UseAnimationProps,\n helpers: UseAnimationHelpers\n) => {\n style?: StackStylePropsBase | StackStylePropsBase[]\n safeToUnmount?: () => void\n}\n"],
4
+ "sourcesContent": ["// TODO split this into own package @tamagui/types to share with animations packages\n\nimport CSS from 'csstype'\nimport React from 'react'\nimport {\n GestureResponderEvent,\n Image,\n TextProps as ReactTextProps,\n Text,\n TextInput,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ResolveVariableTypes } from './helpers/createPropMapper'\nimport { RNWTextProps, RNWViewProps } from './types-rnw'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type ReactComponentWithRef<Props, Ref> = React.ForwardRefExoticComponent<\n Props & React.RefAttributes<Ref>\n>\n\nexport type ConfigListener = (conf: TamaguiInternalConfig) => void\n\n// to prevent things from going circular, hoisting some types in this file\n// to generally order them as building up towards TamaguiConfig\n\nexport type VariableVal = number | string | Variable\nexport type VariableColorVal = string | Variable\n\ntype GenericKey = string | number | symbol\n\nexport interface CreateTokens<Val extends VariableVal = VariableVal> {\n color: { [key: GenericKey]: Val }\n space: { [key: GenericKey]: Val }\n size: { [key: GenericKey]: Val }\n radius: { [key: GenericKey]: Val }\n zIndex: { [key: GenericKey]: Val }\n}\n\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}\ntype GenericShorthands = {\n // [key: string]: string\n}\n\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\n\ntype GenericFonts = {\n [key: string]: GenericFont\n}\n\ntype GenericAnimations = {\n [key: string]:\n | string\n | {\n [key: string]: any\n }\n}\n\n// this is the \"main\" typed object, which users re-define\n// (internal) keep all types directly on this object and reference them from elsewhere\n//\n// const config = createTamagui(...)\n// type MyConfig = typeof config\n// declare module 'tamagui' {\n// export interface TamaguiCustomConfig extends MyConfig {}\n// }\n// now your whole app/kit should be typed correctly\n//\nexport interface TamaguiCustomConfig {}\n\nexport interface TamaguiConfig\n extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>,\n TamaguiCustomConfig {}\n\nexport type CreateTamaguiConfig<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations,\n F extends GenericFonts = GenericFonts\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n fonts: F\n tokens: A\n themes: B\n shorthands: C\n media: D\n animations: AnimationDriver<E>\n}\n\n// for use in creation functions so it doesnt get overwrtitten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia,\n GenericAnimations,\n GenericFonts\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeObject = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\nexport type ThemeName = GetAltThemeNames<keyof Themes>\n// export type ThemeNameWithSubThemes = GetSubThemes<ThemeName>\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeTokens = `$${ThemeKeys}`\nexport type AnimationKeys = Omit<GetAnimationKeys<TamaguiConfig>, number>\n\ntype GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S\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> = CreateTamaguiConfig<A, B, C, D, E, F> & {\n // TODO need to make it this but this breaks types, revisit\n // animations: E //AnimationDriver<E>\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n fontsParsed: GenericFonts\n getCSS: () => string\n parsed: boolean\n}\n\nexport type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations']['animations']\n\n// prevents const intersections from being clobbered into string, keeping the consts\nexport type UnionableString = string & {}\nexport type UnionableNumber = number & {}\nexport type PropTypes<A extends TamaguiComponent> = A extends React.FunctionComponent<infer Props>\n ? Props\n : unknown\n\nexport type GenericFont<Key extends number | string = number | string> = {\n size: { [key in Key]: number | Variable }\n lineHeight: Partial<{ [key in Key]: number | Variable }>\n letterSpacing: Partial<{ [key in Key]: number | Variable }>\n weight: Partial<{ [key in Key]: number | string | Variable }>\n family: string | Variable\n style?: Partial<{ [key in Key]: TextStyle['fontStyle'] | Variable }>\n transform?: Partial<{ [key in Key]: TextStyle['textTransform'] | Variable }>\n color?: Partial<{ [key in Key]: string | Variable }>\n}\n\n// media\nexport type MediaKeys = keyof Media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryKey = keyof Media\nexport type MediaPropKeys = `$${MediaQueryKey}`\nexport type MediaQueryState = { [key in MediaPropKeys]: boolean }\nexport type MediaProps<A> = {\n [key in MediaPropKeys]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\nexport type ConfigureMediaQueryOptions = {\n queries?: MediaQueries\n defaultActive?: MediaQueryKey[]\n}\n\nexport type TransformStyleProps = {\n x?: number\n y?: number\n perspective?: number\n scale?: number\n scaleX?: number\n scaleY?: number\n skewX?: string\n skewY?: string\n matrix?: number[]\n rotate?: string\n rotateY?: string\n rotateX?: string\n rotateZ?: string\n}\n\n// createComponent props helpers\n\n// 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\nexport type SpaceDirection = ViewStyle['flexDirection'] | 'both'\n\n//\n// base props that are accepted by createComponent (additional to react-native-web)\n//\nexport type TamaguiComponentPropsBase = {\n asChild?: boolean\n space?: SpaceTokens\n spaceDirection?: SpaceDirection\n dangerouslySetInnerHTML?: { __html: string }\n animation?: AnimationProp\n animateOnly?: string[]\n children?: any | any[]\n debug?: boolean | 'break' | 'verbose'\n disabled?: boolean\n className?: string\n id?: string\n tag?: string\n theme?: ThemeName | null\n onHoverIn?: (e: MouseEvent) => any\n onHoverOut?: (e: MouseEvent) => any\n onPress?: (e: GestureResponderEvent) => any\n onPressIn?: (e: GestureResponderEvent) => any\n onPressOut?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseEnter?: (e: MouseEvent) => any\n onMouseLeave?: (e: MouseEvent) => any\n onMouseDown?: (e: MouseEvent) => any\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\nexport type ColorTokens =\n | GetTokenString<keyof Tokens['color']>\n | GetTokenString<keyof ThemeObject>\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 FontWeightTokens =\n | `$${GetTokenFontKeysFor<'weight'>}`\n | `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`\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 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 PsuedoPropKeys = 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, psuedos...\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> = WithThemeShorthandsAndPseudos<A> &\n MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n//\n// Stack\n//\n\ntype WebOnlyStyleProps = {\n // WEB ONLY\n cursor?: string\n // WEB ONLY\n contain?: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'paint' | string\n // WEB ONLY values: inherit, inline, block, content\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n // WEB ONLY pointerEvents can be a style prop\n pointerEvents?: ViewProps['pointerEvents']\n}\n\nexport type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> &\n TransformStyleProps &\n WebOnlyStyleProps\n\nexport type StackPropsBaseShared = Omit<ViewProps, 'display' | 'children'> &\n RNWViewProps &\n TamaguiComponentPropsBase\nexport type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>\nexport type StackPropsBase = StackPropsBaseShared & WithThemeAndShorthands<StackStylePropsBase>\nexport type StackProps = StackPropsBaseShared & StackStyleProps\n\nexport type GestureReponderEvent = Exclude<View['props']['onResponderMove'], void> extends (\n event: infer Event\n) => void\n ? Event\n : never\n\n//\n// Text props\n//\n\nexport type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> &\n TransformStyleProps &\n WebOnlyStyleProps & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n userSelect?: CSS.Properties['userSelect']\n textOverflow?: CSS.Properties['textOverflow']\n whiteSpace?: CSS.Properties['whiteSpace']\n wordWrap?: CSS.Properties['wordWrap']\n cursor?: CSS.Properties['cursor']\n }\n\nexport type TextPropsBaseShared = Omit<ReactTextProps, 'children'> &\n RNWTextProps &\n TamaguiComponentPropsBase\nexport type TextPropsBase = TextPropsBaseShared & WithThemeAndShorthands<TextStylePropsBase>\nexport type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>\nexport type TextProps = TextPropsBaseShared & TextStyleProps\n\n// could actually infer from parent\nexport type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<\n Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase\n>\n\n//\n// StaticComponent\n//\n\nexport type TamaguiComponent<\n Props = any,\n Ref = any,\n BaseProps = {},\n VariantProps = {}\n> = ReactComponentWithRef<Props, Ref> & StaticComponentObject\n\ntype StaticComponentObject = {\n staticConfig: StaticConfig\n /*\n * Only needed for more complex components\n * If you create a styled frame component this is a HoC to extract\n * styles from all parents.\n */\n extractable: <X>(a: X, opts?: Partial<StaticConfig>) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n injectCSS?: boolean\n children?: React.ReactNode\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any,\n resolveVariablesAs?: ResolveVariableTypes,\n avoidDefaultProps?: boolean\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: React.FunctionComponent<any> & StaticComponentObject\n\n variants?: {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n }\n\n /**\n * Used for applying sub theme style\n */\n componentName?: string\n\n /**\n * If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /**\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /**\n * Attempts to attach focus styles at runtime (useful for native)\n */\n isInput?: boolean\n\n /**\n * React native web images need special handling for className support\n */\n isImage?: boolean\n\n /**\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /**\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /**\n * If these props are encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /**\n * If these props are encountered, leave them un-extracted.\n */\n inlineProps?: Set<string>\n\n /**\n * A bit odd, only for more advanced heirarchies.\n * Indicates that the component will set this prop so the\n * static extraction can ensure it sets them to ={undefined}\n * so they get overriddent. In the future, this can be smarter.\n */\n ensureOverriddenProp?: { [key: string]: boolean }\n\n /**\n * Auto-detected, but can ovverride. Wraps children to space them on top\n */\n isZStack?: boolean\n\n /**\n * Merges into defaultProps later on, used internally yonly\n */\n defaultVariants?: { [key: string]: any }\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isReactNativeWeb?: boolean\n\n /**\n * Used internally to keep reference to the original rnw component\n */\n reactNativeWebComponent?: any\n\n /**\n * Memoize the component\n */\n memo?: boolean\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isTamagui?: boolean\n}\n\n/**\n * --------------------------------------------\n * variants\n * --------------------------------------------\n */\n\nexport type StylableComponent =\n | TamaguiComponent\n | React.Component\n | React.ForwardRefExoticComponent<any>\n | (new (props: any) => any)\n | typeof View\n | typeof Text\n | typeof TextInput\n | typeof Image\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<infer Props>\n ? Props\n : A extends React.Component<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 | '...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 '...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]?: MyProps | 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<A, SizeTokens>\nexport type ColorVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ColorTokens>\nexport type FontLineHeightVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontLineHeightTokens\n>\nexport type FontLetterSpacingVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontLetterSpacingTokens\n>\nexport type FontStyleVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontStyleTokens\n>\nexport type FontTransformVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontTransformTokens\n>\nexport type ZIndexVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ZIndexTokens>\nexport type RadiusVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, RadiusTokens>\nexport type ThemeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ThemeTokens>\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 mounted: boolean\n animation?: null | {\n style?: any\n avoidClasses?: boolean\n }\n}\n\nexport type SplitStyleState = TamaguiComponentState & {\n noClassNames?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n fallbackProps?: Object\n}\n\n// Animations:\n\ntype AnimationConfig = {\n [key: string]: any\n}\n\nexport type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {\n avoidClasses?: boolean\n useAnimations: UseAnimationHook\n animations: A\n View?: any\n Text?: any\n}\n\nexport type UseAnimationProps = TamaguiComponentPropsBase & Record<string, any>\n\nexport type UseAnimationHelpers = {\n staticConfig: StaticConfigParsed\n getStyle: (props?: {\n isEntering?: boolean\n exitVariant?: string | null\n enterVariant?: string | null\n }) => ViewStyle\n state: SplitStyleState\n pseudos: PseudoProps<ViewStyle>\n // style: ViewStyle | null | undefined\n // isMounted: boolean\n // exitStyle?: ViewStyle | null\n onDidAnimate?: any\n delay?: number\n // mergedStyles(props?: { isExiting?: boolean }): ViewStyle\n}\n\nexport type UseAnimationHook = (\n props: UseAnimationProps,\n helpers: UseAnimationHelpers\n) => {\n style?: StackStylePropsBase | StackStylePropsBase[]\n safeToUnmount?: () => void\n}\n"],
5
5
  "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -114,6 +114,7 @@ function createComponent(configIn, ParentComponent) {
114
114
  const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
115
115
  const isAnimated = !!(useAnimations && props.animation);
116
116
  const hasEnterStyle = !!props.enterStyle;
117
+ const hostRef = useRef(null);
117
118
  const features = useFeatures(props, {
118
119
  forceUpdate,
119
120
  setStateShallow,
@@ -123,6 +124,7 @@ function createComponent(configIn, ParentComponent) {
123
124
  pseudos,
124
125
  staticConfig,
125
126
  theme,
127
+ hostRef,
126
128
  onDidAnimate: props.onDidAnimate
127
129
  });
128
130
  const {
@@ -178,7 +180,6 @@ function createComponent(configIn, ParentComponent) {
178
180
  });
179
181
  }
180
182
  const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false;
181
- const hostRef = useRef(null);
182
183
  const internal = useRef();
183
184
  if (!internal.current) {
184
185
  internal.current = {
@@ -213,6 +214,7 @@ function createComponent(configIn, ParentComponent) {
213
214
  viewProps.accessibilityRole = accessibilityRole;
214
215
  }
215
216
  if (isWeb && !asChild) {
217
+ rnw.useElementLayout(hostRef, onLayout);
216
218
  rnw.useResponderEvents(hostRef, {
217
219
  onMoveShouldSetResponder,
218
220
  onMoveShouldSetResponderCapture,
@@ -559,7 +561,7 @@ const Spacer = createComponent({
559
561
  "...size": (size, { tokens }) => {
560
562
  var _a;
561
563
  size = size == true ? "$true" : size;
562
- const sizePx = (_a = tokens.size[size]) != null ? _a : size;
564
+ const sizePx = (_a = tokens.space[size]) != null ? _a : size;
563
565
  return {
564
566
  width: sizePx,
565
567
  height: sizePx,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createComponent.tsx"],
4
- "sourcesContent": ["import { stylePropsView } from '@tamagui/helpers'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n createElement,\n forwardRef,\n memo,\n useCallback,\n useContext,\n useRef,\n useState,\n} from 'react'\nimport { Pressable, StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isAndroid, isWeb, useIsomorphicLayoutEffect } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { createShallowUpdate } from './helpers/createShallowUpdate'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport { SplitStyleResult, insertSplitStyles, useSplitStyles } from './helpers/getSplitStyles'\nimport { getAllSelectors } from './helpers/insertStyleRule'\nimport { BaseButton } from './helpers/nativeGestureHandler'\nimport { proxyThemeVariables } from './helpers/proxyThemeVariables'\nimport { wrapThemeManagerContext } from './helpers/wrapThemeManagerContext'\nimport { useFeatures } from './hooks/useFeatures'\nimport { useIsTouchDevice } from './hooks/useIsTouchDevice'\nimport { usePressable } from './hooks/usePressable'\nimport { getThemeManagerIfChanged, useTheme } from './hooks/useTheme'\nimport {\n SpaceDirection,\n SpaceTokens,\n StackProps,\n StaticConfig,\n StaticConfigParsed,\n StylableComponent,\n TamaguiComponent,\n TamaguiComponentState,\n TamaguiConfig,\n TamaguiInternalConfig,\n UseAnimationHook,\n} from './types'\nimport { Slot } from './views/Slot'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nReact['keep']\n\nconst defaultComponentState: TamaguiComponentState = {\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n // only used by enterStyle\n mounted: false,\n animation: null,\n}\n\nexport const mouseUps = new Set<Function>()\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n document.addEventListener('touchend', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n document.addEventListener('touchcancel', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\n// mutates\nfunction mergeShorthands({ defaultProps }: StaticConfigParsed, { shorthands }: TamaguiConfig) {\n // they are defined in correct order already { ...parent, ...child }\n for (const key in defaultProps) {\n defaultProps[shorthands[key] || key] = defaultProps[key]\n }\n}\n\nlet initialTheme: any\n\nexport function createComponent<\n ComponentPropTypes extends Object = {},\n Ref = View,\n BaseProps = never\n>(configIn: Partial<StaticConfig> | StaticConfigParsed, ParentComponent?: StylableComponent) {\n const staticConfig = (() => {\n const config = extendStaticConfig(configIn, ParentComponent)\n if ('parsed' in config) {\n return config\n } else {\n return parseStaticConfig(config)\n }\n })()\n\n const componentClassName = `is_${staticConfig.componentName}`\n let tamaguiConfig: TamaguiInternalConfig\n let AnimatedText: any\n let AnimatedView: any\n let avoidClasses = true\n let defaultNativeStyle: any\n let defaultNativeStyleSheet: StyleSheet.NamedStyles<{ base: {} }>\n let tamaguiDefaultProps: any\n let initialSplitStyles: SplitStyleResult\n\n function addPseudoToStyles(styles: any[], name: string, pseudos: any) {\n // on web use pseudo object { hoverStyle } to keep specificity with concatClassName\n const pseudoStyle = pseudos[name]\n const shouldNestObject = isWeb && name !== 'enterStyle' && name !== 'exitStyle'\n const defaultPseudoStyle = initialSplitStyles.pseudos[name]\n if (defaultPseudoStyle) {\n styles.push(shouldNestObject ? { [name]: defaultPseudoStyle } : defaultPseudoStyle)\n }\n if (pseudoStyle) {\n styles.push(shouldNestObject ? { [name]: pseudoStyle } : pseudoStyle)\n }\n }\n\n // see onConfiguredOnce below which attaches a name then to this component\n const component = forwardRef<Ref, ComponentPropTypes>((props: any, forwardedRef) => {\n // ridiculous fix because react inserts default props after your props for some reason...\n props = tamaguiDefaultProps && !props.asChild ? { ...tamaguiDefaultProps, ...props } : props\n\n const { Component, componentName, isText, isZStack } = staticConfig\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u26A0\uFE0F', staticConfig.componentName || Component?.displayName || Component?.name || '[Unnamed Component]', 'debug on')\n // keep separate react native warn touches every value on prop causing weird behavior\n console.log('props in:', props, Object.keys(props))\n if (props['debug'] === 'break') debugger\n }\n }\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, staticConfig.componentName, props, forceUpdate)\n const [state, set_] = useState<TamaguiComponentState>(defaultComponentState)\n const setStateShallow = createShallowUpdate(set_)\n\n const shouldAvoidClasses = !!(props.animation && avoidClasses)\n const splitStyles = useSplitStyles(\n props,\n staticConfig,\n theme,\n shouldAvoidClasses ? { ...state, noClassNames: true, resolveVariablesAs: 'value' } : state,\n shouldAvoidClasses || props.asChild ? null : initialSplitStyles.classNames\n )\n\n const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles\n const useAnimations = tamaguiConfig.animations?.useAnimations as UseAnimationHook | undefined\n const isAnimated = !!(useAnimations && props.animation)\n const hasEnterStyle = !!props.enterStyle\n\n const features = useFeatures(props, {\n forceUpdate,\n setStateShallow,\n useAnimations,\n state,\n style: props.animation ? { ...defaultNativeStyle, ...style } : null,\n pseudos,\n staticConfig,\n theme,\n onDidAnimate: props.onDidAnimate,\n })\n\n const {\n tag,\n hitSlop,\n asChild,\n children,\n pointerEvents,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space,\n disabled,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n onMouseDown,\n nativeID,\n\n accessible,\n accessibilityRole,\n\n // android\n collapsable,\n focusable,\n\n // ignore from here on out\n // for next/link compat etc\n // @ts-ignore\n onClick,\n theme: _themeProp,\n // @ts-ignore\n defaultVariants,\n\n // TODO feature load layout hook\n onLayout,\n ...viewPropsRest\n } = viewPropsIn\n\n let viewProps: StackProps = viewPropsRest\n\n // from react-native-web\n if (process.env.NODE_ENV === 'development' && !isText && isWeb) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\n const hostRef = useRef(null)\n\n // isMounted\n const internal = useRef<{ isMounted: boolean }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n\n useIsomorphicLayoutEffect(() => {\n // we need to use state to properly have mounted go from false => true\n if (typeof window !== 'undefined' && (hasEnterStyle || props.animation)) {\n // for SSR we never set mounted, ensuring enterStyle={{}} is set by default\n setStateShallow({\n mounted: true,\n })\n }\n\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n }\n }, [hasEnterStyle, props.animation])\n\n if (nativeID) {\n viewProps.id = nativeID\n }\n\n if (isAndroid) {\n if (collapsable) viewProps.collapsable = collapsable\n if (focusable) viewProps.focusable = focusable\n }\n\n if (!isWeb) {\n if (accessible) viewProps.accessible = accessible\n if (accessibilityRole) viewProps.accessibilityRole = accessibilityRole\n }\n\n if (isWeb && !asChild) {\n // from react-native-web\n rnw.useResponderEvents(hostRef, {\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n })\n }\n\n // get the right component\n const isTaggable = !Component || typeof Component === 'string'\n\n // default to tag, fallback to component (when both strings)\n const element = isWeb ? (isTaggable ? tag || Component : Component) : Component\n const BaseTextComponent = !isWeb ? Text : element || 'span'\n const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? 'span' : 'div')\n let ViewComponent = isText\n ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent\n : (isAnimated ? AnimatedView || View : null) || BaseViewComponent\n\n ViewComponent = Component || ViewComponent\n\n let styles: any[]\n\n const isStringElement = typeof ViewComponent === 'string'\n const animationStyles = state.animation ? state.animation.style : null\n\n if (isStringElement && shouldAvoidClasses) {\n styles = {\n ...defaultNativeStyle,\n ...animationStyles,\n ...medias,\n }\n } else {\n styles = [\n isWeb ? null : defaultNativeStyleSheet ? (defaultNativeStyleSheet.base as ViewStyle) : null,\n // parity w react-native-web, only for text in text\n // TODO this should be able to be done w css to replicate after extraction:\n // (.text .text { display: inline-flex; }) (but if they set display we'd need stronger precendence)\n // isText && hasTextAncestor && isWeb ? { display: 'inline-flex' } : null,\n // style,\n animationStyles ? animationStyles : style,\n medias,\n ]\n if (!animationStyles) {\n !state.mounted && addPseudoToStyles(styles, 'enterStyle', pseudos)\n state.hover && addPseudoToStyles(styles, 'hoverStyle', pseudos)\n state.focus && addPseudoToStyles(styles, 'focusStyle', pseudos)\n state.press && addPseudoToStyles(styles, 'pressStyle', pseudos)\n }\n }\n\n if (isWeb) {\n if (!shouldAvoidClasses) {\n const fontFamilyName = isText\n ? props.fontFamily || staticConfig.defaultProps.fontFamily\n : null\n const fontFamily =\n fontFamilyName && fontFamilyName[0] === '$' ? fontFamilyName.slice(1) : null\n const classList = [\n componentName ? componentClassName : '',\n fontFamily ? `font_${fontFamily}` : '',\n theme.className,\n classNames ? Object.values(classNames).join(' ') : '',\n ]\n\n // TODO restore this to isText classList\n // hasTextAncestor === true && cssText.textHasAncestor,\n // TODO MOVE TO VARIANTS [number] [any]\n // numberOfLines != null && numberOfLines > 1 && cssText.textMultiLine,\n\n const className = classList.join(' ')\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log(' \u00BB className', { isStringElement, pseudos, state, classNames, propsClassName: props.className, style, classList, className: className.trim().split(' '), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) })\n }\n }\n viewProps.className = className\n viewProps.style = animationStyles\n } else {\n viewProps.style = styles\n }\n } else {\n viewProps.style = styles\n }\n\n if (pointerEvents) {\n viewProps.pointerEvents = pointerEvents\n }\n\n if (isWeb) {\n // from react-native-web\n const platformMethodsRef = rnw.usePlatformMethods(viewProps)\n const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef)\n\n if (!isAnimated) {\n // @ts-ignore\n viewProps.ref = setRef\n } else {\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n if (props.href != null && hrefAttrs != null) {\n const { download, rel, target } = hrefAttrs\n if (download != null) {\n viewProps.download = download\n }\n if (rel != null) {\n viewProps.rel = rel\n }\n if (typeof target === 'string') {\n viewProps.target = target.charAt(0) !== '_' ? '_' + target : target\n }\n }\n } else {\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n // TODO need to loop active variants and see if they have matchin pseudos and apply as well\n const initialPseudos = initialSplitStyles.pseudos\n const attachPress = !!(\n (pseudos && pseudos.pressStyle) ||\n (initialPseudos && initialPseudos.pressStyle) ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n\n const isTouch = useIsTouchDevice()\n const isHoverable = isWeb && !isTouch\n const attachHover =\n isHoverable &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n const handlesPressEvents = !isStringElement && !asChild\n const pressKey = handlesPressEvents ? 'onPress' : 'onClick'\n const pressInKey = handlesPressEvents ? 'onPressIn' : 'onMouseDown'\n const pressOutKey = handlesPressEvents ? 'onPressOut' : 'onMouseUp'\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n // while avoiding reparenting...\n // once proper reparenting is supported, we can remove this and use that...\n const shouldAttach =\n !asChild &&\n (attachPress ||\n attachHover ||\n 'pressStyle' in props ||\n 'onPress' in props ||\n 'onPressIn' in props ||\n 'onPressOut' in props ||\n (isWeb &&\n ('hoverStyle' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props)))\n\n const unPress = useCallback(() => {\n if (!internal.current!.isMounted) return\n setStateShallow({\n press: false,\n pressIn: false,\n })\n }, [])\n\n const events = shouldAttach\n ? {\n [pressOutKey]: attachPress\n ? (e) => {\n unPress()\n onPressOut?.(e)\n }\n : undefined,\n ...(isHoverable && {\n onMouseEnter: attachHover\n ? (e) => {\n let next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave: attachHover\n ? (e) => {\n let next: Partial<typeof state> = {}\n mouseUps.add(unPress)\n if (attachHover) {\n next.hover = false\n }\n if (state.pressIn) {\n next.press = false\n next.pressIn = false\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n [pressInKey]: attachPress\n ? (e) => {\n setStateShallow({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n if (isWeb) {\n mouseUps.add(unPress)\n }\n }\n : null,\n [pressKey]: attachPress\n ? (e) => {\n unPress()\n onClick?.(e)\n onPress?.(e)\n }\n : null,\n }\n : null\n\n const childEls =\n !children || asChild\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n children,\n space,\n direction: props.spaceDirection || 'both',\n isZStack,\n }),\n getThemeManagerIfChanged(theme)\n )\n\n let content: any\n\n // replicate react-native-web's `createElement`\n if (isWeb) {\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = {\n ...viewProps.dataSet,\n className: viewProps.className,\n }\n } else {\n const rnProps = rnw.createDOMProps(viewProps)\n const className =\n rnProps.className && rnProps.className !== viewProps.className\n ? `${rnProps.className} ${viewProps.className}`\n : viewProps.className\n\n // additive\n Object.assign(viewProps, rnProps)\n\n // we already handle Text/View properly\n if (className) {\n viewProps.className = className\n }\n }\n }\n\n if (asChild) {\n ViewComponent = Slot\n const onlyChild = React.Children.only(children)\n Object.assign(viewProps, onlyChild.props)\n }\n\n // EVENTS: web\n if (isWeb) {\n const [pressableProps] = usePressable(\n events\n ? {\n disabled,\n ...(hitSlop && {\n hitSlop,\n }),\n onPressOut: events[pressOutKey],\n onPressIn: events[pressInKey],\n onPress: events[pressKey],\n }\n : {\n disabled: true,\n }\n )\n if (events) {\n if (handlesPressEvents) {\n Object.assign(viewProps, pressableProps)\n } else {\n Object.assign(viewProps, events)\n }\n }\n }\n\n content = createElement(ViewComponent, viewProps, childEls)\n\n // EVENTS native\n // native just wrap in <Pressable />\n if (!isWeb) {\n if (attachPress && events) {\n content = (\n // bugfix: on native <Pressable /> pressing down and then moving finger off\n // doesn't actually turn off press styles\n // but react-native-gesture-handler doesn't pass GestureResponderEvent...\n <Pressable onPressIn={events[pressInKey]} onPress={events[pressKey]}>\n <BaseButton\n onActiveStateChange={(isActive) => {\n if (!isActive) {\n unPress()\n }\n }}\n >\n {content}\n </BaseButton>\n </Pressable>\n )\n }\n }\n\n if (isWeb && events && attachHover) {\n content = (\n <span\n className=\"tui_Hoverable\"\n style={{\n display: 'contents',\n }}\n onMouseEnter={events.onMouseEnter}\n onMouseLeave={events.onMouseLeave}\n >\n {content}\n </span>\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log(' \u00BB ', { propsIn: { ...props }, propsOut: { ...viewProps }, state, splitStyles, animationStyles, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), events, shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles, ...(typeof window !== 'undefined' ? { theme, themeState: theme.__state, themeClassName: theme.className, staticConfig, tamaguiConfig } : null) })\n }\n }\n\n if (features.length) {\n return (\n <>\n {features}\n {content}\n </>\n )\n }\n\n return content\n })\n\n component.displayName = staticConfig.componentName\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n if (process.env.IS_STATIC === 'is_static') {\n // in static mode we just use these to lookup configuration\n return\n }\n\n tamaguiConfig = conf\n\n // do this to make sure shorthands don't duplicate with.. longhands\n mergeShorthands(staticConfig, tamaguiConfig)\n\n avoidClasses = !!tamaguiConfig.animations?.avoidClasses\n AnimatedText = tamaguiConfig.animations?.Text\n AnimatedView = tamaguiConfig?.animations?.View\n initialTheme =\n initialTheme ||\n proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]])\n initialSplitStyles = insertSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme, {\n mounted: true,\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n resolveVariablesAs: 'both',\n keepVariantsAsProps: true,\n })\n\n // @ts-ignore\n // this ruins the prop order!!!\n // can't believe it but it puts default props after props?\n const defaults = {\n ...component.defaultProps,\n ...initialSplitStyles.viewProps,\n }\n\n defaultNativeStyle = {}\n\n const validStyles = staticConfig.validStyles || stylePropsView\n\n // split - keep variables on props to be processed using theme values at runtime (native)\n for (const key in staticConfig.defaultProps) {\n const val = staticConfig.defaultProps[key]\n if ((typeof val === 'string' && val[0] === '$') || !validStyles[key]) {\n defaults[key] = val\n } else {\n defaultNativeStyle[key] = val\n }\n }\n\n defaultNativeStyleSheet = StyleSheet.create({\n base: defaultNativeStyle,\n })\n\n if (Object.keys(defaults).length) {\n tamaguiDefaultProps = defaults\n }\n\n // add debug logs\n if (process.env.NODE_ENV === 'development' && staticConfig.defaultProps?.debug) {\n if (process.env.IS_STATIC !== 'is_static') {\n console.log(`\uD83D\uDC1B [${staticConfig.componentName || 'Component'}]`, {\n staticConfig,\n initialSplitStyles,\n tamaguiDefaultProps,\n defaultNativeStyle,\n defaults,\n })\n }\n }\n })\n\n let res: TamaguiComponent<ComponentPropTypes, Ref, BaseProps> = component as any\n\n if (configIn.memo) {\n res = memo(res) as any\n }\n\n res['staticConfig'] = {\n validStyles: staticConfig.validStyles || stylePropsView,\n ...staticConfig,\n }\n\n if (process.env.NODE_ENV === 'development') {\n res['whyDidYouRender'] = true\n }\n\n // res.extractable HoC\n res['extractable'] = (Component: any, conf?: Partial<StaticConfig>) => {\n Component['staticConfig'] = extendStaticConfig(\n {\n Component,\n ...conf,\n neverFlatten: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n },\n res\n )\n return Component\n }\n\n return res\n}\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<\n Omit<StackProps, 'flex' | 'direction'> & {\n size?: number | SpaceTokens\n flex?: boolean | number\n direction?: 'horizontal' | 'vertical'\n }\n>({\n memo: true,\n componentName: 'Spacer',\n defaultProps: {\n ...stackDefaultStyles,\n size: true,\n },\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n const sizePx = tokens.size[size] ?? size\n return {\n width: sizePx,\n height: sizePx,\n minWidth: sizePx,\n minHeight: sizePx,\n }\n },\n },\n\n flex: {\n true: {\n flex: 1,\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n minHeight: 0,\n },\n vertical: {\n width: 0,\n minWidth: 0,\n },\n },\n },\n\n defaultVariants: {\n direction: 'horizontal',\n },\n})\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n direction,\n spaceFlex,\n}: {\n isZStack?: boolean\n children: any\n space?: any\n spaceFlex?: boolean | number\n direction?: SpaceDirection\n}) {\n if (!space && !spaceFlex) {\n return children\n }\n const childrenList = Array.isArray(children) ? children : Children.toArray(children)\n const len = childrenList.length\n if (len <= 1) {\n return childrenList\n }\n const final: any[] = []\n for (const [index, child] of childrenList.entries()) {\n const isEmpty =\n child === null ||\n child === undefined ||\n child === false ||\n (Array.isArray(child) && child.length === 0)\n\n // push them all, but wrap some in Fragment\n if (isEmpty || !child || (child['key'] && !isZStack)) {\n final.push(child)\n } else {\n final.push(\n <Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n }\n\n const next = childrenList[index + 1]\n\n if (next && !isVisuallyHidden(next)) {\n final.push(\n <Spacer\n key={`_${index}_spacer`}\n direction={\n direction === 'both'\n ? undefined\n : direction === 'row' || direction === 'row-reverse'\n ? 'horizontal'\n : 'vertical'\n }\n size={space}\n {...(spaceFlex && {\n flex: spaceFlex,\n })}\n />\n )\n }\n }\n\n return final\n}\n\nfunction isVisuallyHidden(child: any) {\n return child?.['type']?.['isVisuallyHidden']\n}\n\nexport function AbsoluteFill(props: any) {\n return isWeb ? (\n <div\n style={\n {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n } as any\n }\n >\n {props.children}\n </div>\n ) : (\n <View style={StyleSheet.absoluteFill}>{props.child}</View>\n )\n}\n\n// this can be done with CSS entirely right?\n// const shouldWrapTextAncestor = isWeb && isText && !hasTextAncestor\n// if (shouldWrapTextAncestor) {\n// // from react-native-web\n// content = createElement(TextAncestorContext.Provider, { value: true }, content)\n// }\n"],
5
- "mappings": ";;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAEA;AACA;AACA;AACA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,OAAO;AACL,YAAM,KACJ,oCAAC;AAAA,QAAS,KAAK;AAAA,SAAQ,WAAW,oCAAC,oBAAc,KAAM,IAAkB,KAAM,CACjF;AAAA,IACF;AAEA,UAAM,OAAO,aAAa,QAAQ;AAElC,QAAI,QAAQ,CAAC,iBAAiB,IAAI,GAAG;AACnC,YAAM,KACJ,oCAAC;AAAA,QACC,KAAK,IAAI;AAAA,QACT,WACE,cAAc,SACV,SACA,cAAc,SAAS,cAAc,gBACrC,eACA;AAAA,QAEN,MAAM;AAAA,WACD,aAAa;AAAA,UAChB,MAAM;AAAA,QACR;AAAA,OACF,CACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AA7DgB;AA+DhB,0BAA0B,OAAY;AAr3BtC;AAs3BE,SAAO,qCAAQ,YAAR,mBAAkB;AAC3B;AAFS;AAIF,sBAAsB,OAAY;AACvC,SAAO,QACL,oCAAC;AAAA,IACC,OACE;AAAA,MACE,UAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,KAGD,MAAM,QACT,IAEA,oCAAC;AAAA,IAAK,OAAO,WAAW;AAAA,KAAe,MAAM,KAAM;AAEvD;AAlBgB;",
4
+ "sourcesContent": ["import { stylePropsView } from '@tamagui/helpers'\nimport { useForceUpdate } from '@tamagui/use-force-update'\nimport React, {\n Children,\n Fragment,\n createElement,\n forwardRef,\n memo,\n useCallback,\n useContext,\n useRef,\n useState,\n} from 'react'\nimport { Pressable, StyleSheet, Text, View, ViewStyle } from 'react-native'\n\nimport { onConfiguredOnce } from './conf'\nimport { stackDefaultStyles } from './constants/constants'\nimport { isAndroid, isWeb, useIsomorphicLayoutEffect } from './constants/platform'\nimport { rnw } from './constants/rnw'\nimport { createShallowUpdate } from './helpers/createShallowUpdate'\nimport { extendStaticConfig, parseStaticConfig } from './helpers/extendStaticConfig'\nimport { SplitStyleResult, insertSplitStyles, useSplitStyles } from './helpers/getSplitStyles'\nimport { getAllSelectors } from './helpers/insertStyleRule'\nimport { BaseButton } from './helpers/nativeGestureHandler'\nimport { proxyThemeVariables } from './helpers/proxyThemeVariables'\nimport { wrapThemeManagerContext } from './helpers/wrapThemeManagerContext'\nimport { useFeatures } from './hooks/useFeatures'\nimport { useIsTouchDevice } from './hooks/useIsTouchDevice'\nimport { usePressable } from './hooks/usePressable'\nimport { getThemeManagerIfChanged, useTheme } from './hooks/useTheme'\nimport {\n SpaceDirection,\n SpaceTokens,\n StackProps,\n StaticConfig,\n StaticConfigParsed,\n StylableComponent,\n TamaguiComponent,\n TamaguiComponentState,\n TamaguiConfig,\n TamaguiInternalConfig,\n UseAnimationHook,\n} from './types'\nimport { Slot } from './views/Slot'\nimport { TextAncestorContext } from './views/TextAncestorContext'\n\nReact['keep']\n\nconst defaultComponentState: TamaguiComponentState = {\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n // only used by enterStyle\n mounted: false,\n animation: null,\n}\n\nexport const mouseUps = new Set<Function>()\nif (typeof document !== 'undefined') {\n document.addEventListener('mouseup', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n document.addEventListener('touchend', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n document.addEventListener('touchcancel', () => {\n mouseUps.forEach((x) => x())\n mouseUps.clear()\n })\n}\n\n// mutates\nfunction mergeShorthands({ defaultProps }: StaticConfigParsed, { shorthands }: TamaguiConfig) {\n // they are defined in correct order already { ...parent, ...child }\n for (const key in defaultProps) {\n defaultProps[shorthands[key] || key] = defaultProps[key]\n }\n}\n\nlet initialTheme: any\n\nexport function createComponent<\n ComponentPropTypes extends Object = {},\n Ref = View,\n BaseProps = never\n>(configIn: Partial<StaticConfig> | StaticConfigParsed, ParentComponent?: StylableComponent) {\n const staticConfig = (() => {\n const config = extendStaticConfig(configIn, ParentComponent)\n if ('parsed' in config) {\n return config\n } else {\n return parseStaticConfig(config)\n }\n })()\n\n const componentClassName = `is_${staticConfig.componentName}`\n let tamaguiConfig: TamaguiInternalConfig\n let AnimatedText: any\n let AnimatedView: any\n let avoidClasses = true\n let defaultNativeStyle: any\n let defaultNativeStyleSheet: StyleSheet.NamedStyles<{ base: {} }>\n let tamaguiDefaultProps: any\n let initialSplitStyles: SplitStyleResult\n\n function addPseudoToStyles(styles: any[], name: string, pseudos: any) {\n // on web use pseudo object { hoverStyle } to keep specificity with concatClassName\n const pseudoStyle = pseudos[name]\n const shouldNestObject = isWeb && name !== 'enterStyle' && name !== 'exitStyle'\n const defaultPseudoStyle = initialSplitStyles.pseudos[name]\n if (defaultPseudoStyle) {\n styles.push(shouldNestObject ? { [name]: defaultPseudoStyle } : defaultPseudoStyle)\n }\n if (pseudoStyle) {\n styles.push(shouldNestObject ? { [name]: pseudoStyle } : pseudoStyle)\n }\n }\n\n // see onConfiguredOnce below which attaches a name then to this component\n const component = forwardRef<Ref, ComponentPropTypes>((props: any, forwardedRef) => {\n // ridiculous fix because react inserts default props after your props for some reason...\n props = tamaguiDefaultProps && !props.asChild ? { ...tamaguiDefaultProps, ...props } : props\n\n const { Component, componentName, isText, isZStack } = staticConfig\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u26A0\uFE0F', staticConfig.componentName || Component?.displayName || Component?.name || '[Unnamed Component]', 'debug on')\n // keep separate react native warn touches every value on prop causing weird behavior\n console.log('props in:', props, Object.keys(props))\n if (props['debug'] === 'break') debugger\n }\n }\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, staticConfig.componentName, props, forceUpdate)\n const [state, set_] = useState<TamaguiComponentState>(defaultComponentState)\n const setStateShallow = createShallowUpdate(set_)\n\n const shouldAvoidClasses = !!(props.animation && avoidClasses)\n const splitStyles = useSplitStyles(\n props,\n staticConfig,\n theme,\n shouldAvoidClasses ? { ...state, noClassNames: true, resolveVariablesAs: 'value' } : state,\n shouldAvoidClasses || props.asChild ? null : initialSplitStyles.classNames\n )\n\n const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles\n const useAnimations = tamaguiConfig.animations?.useAnimations as UseAnimationHook | undefined\n const isAnimated = !!(useAnimations && props.animation)\n const hasEnterStyle = !!props.enterStyle\n const hostRef = useRef<HTMLElement | View>(null)\n\n const features = useFeatures(props, {\n forceUpdate,\n setStateShallow,\n useAnimations,\n state,\n style: props.animation ? { ...defaultNativeStyle, ...style } : null,\n pseudos,\n staticConfig,\n theme,\n hostRef,\n onDidAnimate: props.onDidAnimate,\n })\n\n const {\n tag,\n hitSlop,\n asChild,\n children,\n pointerEvents,\n onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space,\n disabled,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n onMouseDown,\n nativeID,\n\n accessible,\n accessibilityRole,\n\n // android\n collapsable,\n focusable,\n\n // ignore from here on out\n // for next/link compat etc\n // @ts-ignore\n onClick,\n theme: _themeProp,\n // @ts-ignore\n defaultVariants,\n\n onLayout,\n ...viewPropsRest\n } = viewPropsIn\n\n let viewProps: StackProps = viewPropsRest\n\n // from react-native-web\n if (process.env.NODE_ENV === 'development' && !isText && isWeb) {\n Children.toArray(props.children).forEach((item) => {\n if (typeof item === 'string') {\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`)\n }\n })\n }\n\n const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\n\n // isMounted\n const internal = useRef<{ isMounted: boolean }>()\n if (!internal.current) {\n internal.current = {\n isMounted: true,\n }\n }\n\n useIsomorphicLayoutEffect(() => {\n // we need to use state to properly have mounted go from false => true\n if (typeof window !== 'undefined' && (hasEnterStyle || props.animation)) {\n // for SSR we never set mounted, ensuring enterStyle={{}} is set by default\n setStateShallow({\n mounted: true,\n })\n }\n\n internal.current!.isMounted = true\n return () => {\n mouseUps.delete(unPress)\n internal.current!.isMounted = false\n }\n }, [hasEnterStyle, props.animation])\n\n if (nativeID) {\n viewProps.id = nativeID\n }\n\n if (isAndroid) {\n if (collapsable) viewProps.collapsable = collapsable\n if (focusable) viewProps.focusable = focusable\n }\n\n if (!isWeb) {\n if (accessible) viewProps.accessible = accessible\n if (accessibilityRole) viewProps.accessibilityRole = accessibilityRole\n }\n\n if (isWeb && !asChild) {\n rnw.useElementLayout(hostRef, onLayout)\n\n // from react-native-web\n rnw.useResponderEvents(hostRef, {\n onMoveShouldSetResponder,\n onMoveShouldSetResponderCapture,\n onResponderEnd,\n onResponderGrant,\n onResponderMove,\n onResponderReject,\n onResponderRelease,\n onResponderStart,\n onResponderTerminate,\n onResponderTerminationRequest,\n onScrollShouldSetResponder,\n onScrollShouldSetResponderCapture,\n onSelectionChangeShouldSetResponder,\n onSelectionChangeShouldSetResponderCapture,\n onStartShouldSetResponder,\n onStartShouldSetResponderCapture,\n })\n }\n\n // get the right component\n const isTaggable = !Component || typeof Component === 'string'\n\n // default to tag, fallback to component (when both strings)\n const element = isWeb ? (isTaggable ? tag || Component : Component) : Component\n const BaseTextComponent = !isWeb ? Text : element || 'span'\n const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? 'span' : 'div')\n let ViewComponent = isText\n ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent\n : (isAnimated ? AnimatedView || View : null) || BaseViewComponent\n\n ViewComponent = Component || ViewComponent\n\n let styles: any[]\n\n const isStringElement = typeof ViewComponent === 'string'\n const animationStyles = state.animation ? state.animation.style : null\n\n if (isStringElement && shouldAvoidClasses) {\n styles = {\n ...defaultNativeStyle,\n ...animationStyles,\n ...medias,\n }\n } else {\n styles = [\n isWeb ? null : defaultNativeStyleSheet ? (defaultNativeStyleSheet.base as ViewStyle) : null,\n // parity w react-native-web, only for text in text\n // TODO this should be able to be done w css to replicate after extraction:\n // (.text .text { display: inline-flex; }) (but if they set display we'd need stronger precendence)\n // isText && hasTextAncestor && isWeb ? { display: 'inline-flex' } : null,\n // style,\n animationStyles ? animationStyles : style,\n medias,\n ]\n if (!animationStyles) {\n !state.mounted && addPseudoToStyles(styles, 'enterStyle', pseudos)\n state.hover && addPseudoToStyles(styles, 'hoverStyle', pseudos)\n state.focus && addPseudoToStyles(styles, 'focusStyle', pseudos)\n state.press && addPseudoToStyles(styles, 'pressStyle', pseudos)\n }\n }\n\n if (isWeb) {\n if (!shouldAvoidClasses) {\n const fontFamilyName = isText\n ? props.fontFamily || staticConfig.defaultProps.fontFamily\n : null\n const fontFamily =\n fontFamilyName && fontFamilyName[0] === '$' ? fontFamilyName.slice(1) : null\n const classList = [\n componentName ? componentClassName : '',\n fontFamily ? `font_${fontFamily}` : '',\n theme.className,\n classNames ? Object.values(classNames).join(' ') : '',\n ]\n\n // TODO restore this to isText classList\n // hasTextAncestor === true && cssText.textHasAncestor,\n // TODO MOVE TO VARIANTS [number] [any]\n // numberOfLines != null && numberOfLines > 1 && cssText.textMultiLine,\n\n const className = classList.join(' ')\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log(' \u00BB className', { isStringElement, pseudos, state, classNames, propsClassName: props.className, style, classList, className: className.trim().split(' '), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) })\n }\n }\n viewProps.className = className\n viewProps.style = animationStyles\n } else {\n viewProps.style = styles\n }\n } else {\n viewProps.style = styles\n }\n\n if (pointerEvents) {\n viewProps.pointerEvents = pointerEvents\n }\n\n if (isWeb) {\n // from react-native-web\n const platformMethodsRef = rnw.usePlatformMethods(viewProps)\n const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef)\n\n if (!isAnimated) {\n // @ts-ignore\n viewProps.ref = setRef\n } else {\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n if (props.href != null && hrefAttrs != null) {\n const { download, rel, target } = hrefAttrs\n if (download != null) {\n viewProps.download = download\n }\n if (rel != null) {\n viewProps.rel = rel\n }\n if (typeof target === 'string') {\n viewProps.target = target.charAt(0) !== '_' ? '_' + target : target\n }\n }\n } else {\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\n\n // TODO need to loop active variants and see if they have matchin pseudos and apply as well\n const initialPseudos = initialSplitStyles.pseudos\n const attachPress = !!(\n (pseudos && pseudos.pressStyle) ||\n (initialPseudos && initialPseudos.pressStyle) ||\n onPress ||\n onPressOut ||\n onPressIn ||\n onClick\n )\n\n const isTouch = useIsTouchDevice()\n const isHoverable = isWeb && !isTouch\n const attachHover =\n isHoverable &&\n !!((pseudos && pseudos.hoverStyle) || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave)\n\n const handlesPressEvents = !isStringElement && !asChild\n const pressKey = handlesPressEvents ? 'onPress' : 'onClick'\n const pressInKey = handlesPressEvents ? 'onPressIn' : 'onMouseDown'\n const pressOutKey = handlesPressEvents ? 'onPressOut' : 'onMouseUp'\n\n // check presence to prevent reparenting bugs, allows for onPress={x ? function : undefined} usage\n // while avoiding reparenting...\n // once proper reparenting is supported, we can remove this and use that...\n const shouldAttach =\n !asChild &&\n (attachPress ||\n attachHover ||\n 'pressStyle' in props ||\n 'onPress' in props ||\n 'onPressIn' in props ||\n 'onPressOut' in props ||\n (isWeb &&\n ('hoverStyle' in props ||\n 'onHoverIn' in props ||\n 'onHoverOut' in props ||\n 'onMouseEnter' in props ||\n 'onMouseLeave' in props)))\n\n const unPress = useCallback(() => {\n if (!internal.current!.isMounted) return\n setStateShallow({\n press: false,\n pressIn: false,\n })\n }, [])\n\n const events = shouldAttach\n ? {\n [pressOutKey]: attachPress\n ? (e) => {\n unPress()\n onPressOut?.(e)\n }\n : undefined,\n ...(isHoverable && {\n onMouseEnter: attachHover\n ? (e) => {\n let next: Partial<typeof state> = {}\n if (attachHover) {\n next.hover = true\n }\n if (state.pressIn) {\n next.press = true\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverIn?.(e)\n onMouseEnter?.(e)\n }\n : undefined,\n onMouseLeave: attachHover\n ? (e) => {\n let next: Partial<typeof state> = {}\n mouseUps.add(unPress)\n if (attachHover) {\n next.hover = false\n }\n if (state.pressIn) {\n next.press = false\n next.pressIn = false\n }\n if (Object.keys(next).length) {\n setStateShallow(next)\n }\n onHoverOut?.(e)\n onMouseLeave?.(e)\n }\n : undefined,\n }),\n [pressInKey]: attachPress\n ? (e) => {\n setStateShallow({\n press: true,\n pressIn: true,\n })\n onPressIn?.(e)\n onMouseDown?.(e)\n if (isWeb) {\n mouseUps.add(unPress)\n }\n }\n : null,\n [pressKey]: attachPress\n ? (e) => {\n unPress()\n onClick?.(e)\n onPress?.(e)\n }\n : null,\n }\n : null\n\n const childEls =\n !children || asChild\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n children,\n space,\n direction: props.spaceDirection || 'both',\n isZStack,\n }),\n getThemeManagerIfChanged(theme)\n )\n\n let content: any\n\n // replicate react-native-web's `createElement`\n if (isWeb) {\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = {\n ...viewProps.dataSet,\n className: viewProps.className,\n }\n } else {\n const rnProps = rnw.createDOMProps(viewProps)\n const className =\n rnProps.className && rnProps.className !== viewProps.className\n ? `${rnProps.className} ${viewProps.className}`\n : viewProps.className\n\n // additive\n Object.assign(viewProps, rnProps)\n\n // we already handle Text/View properly\n if (className) {\n viewProps.className = className\n }\n }\n }\n\n if (asChild) {\n ViewComponent = Slot\n const onlyChild = React.Children.only(children)\n Object.assign(viewProps, onlyChild.props)\n }\n\n // EVENTS: web\n if (isWeb) {\n const [pressableProps] = usePressable(\n events\n ? {\n disabled,\n ...(hitSlop && {\n hitSlop,\n }),\n onPressOut: events[pressOutKey],\n onPressIn: events[pressInKey],\n onPress: events[pressKey],\n }\n : {\n disabled: true,\n }\n )\n if (events) {\n if (handlesPressEvents) {\n Object.assign(viewProps, pressableProps)\n } else {\n Object.assign(viewProps, events)\n }\n }\n }\n\n content = createElement(ViewComponent, viewProps, childEls)\n\n // EVENTS native\n // native just wrap in <Pressable />\n if (!isWeb) {\n if (attachPress && events) {\n content = (\n // bugfix: on native <Pressable /> pressing down and then moving finger off\n // doesn't actually turn off press styles\n // but react-native-gesture-handler doesn't pass GestureResponderEvent...\n <Pressable onPressIn={events[pressInKey]} onPress={events[pressKey]}>\n <BaseButton\n onActiveStateChange={(isActive) => {\n if (!isActive) {\n unPress()\n }\n }}\n >\n {content}\n </BaseButton>\n </Pressable>\n )\n }\n }\n\n if (isWeb && events && attachHover) {\n content = (\n <span\n className=\"tui_Hoverable\"\n style={{\n display: 'contents',\n }}\n onMouseEnter={events.onMouseEnter}\n onMouseLeave={events.onMouseLeave}\n >\n {content}\n </span>\n )\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log(' \u00BB ', { propsIn: { ...props }, propsOut: { ...viewProps }, state, splitStyles, animationStyles, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), events, shouldAttach, ViewComponent, viewProps, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles, ...(typeof window !== 'undefined' ? { theme, themeState: theme.__state, themeClassName: theme.className, staticConfig, tamaguiConfig } : null) })\n }\n }\n\n if (features.length) {\n return (\n <>\n {features}\n {content}\n </>\n )\n }\n\n return content\n })\n\n component.displayName = staticConfig.componentName\n\n // Once configuration is run and all components are registered\n // get default props + className and analyze styles\n onConfiguredOnce((conf) => {\n if (process.env.IS_STATIC === 'is_static') {\n // in static mode we just use these to lookup configuration\n return\n }\n\n tamaguiConfig = conf\n\n // do this to make sure shorthands don't duplicate with.. longhands\n mergeShorthands(staticConfig, tamaguiConfig)\n\n avoidClasses = !!tamaguiConfig.animations?.avoidClasses\n AnimatedText = tamaguiConfig.animations?.Text\n AnimatedView = tamaguiConfig?.animations?.View\n initialTheme =\n initialTheme ||\n proxyThemeVariables(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]])\n initialSplitStyles = insertSplitStyles(staticConfig.defaultProps, staticConfig, initialTheme, {\n mounted: true,\n hover: false,\n press: false,\n pressIn: false,\n focus: false,\n resolveVariablesAs: 'both',\n keepVariantsAsProps: true,\n })\n\n // this ruins the prop order!!!\n // can't believe it but it puts default props after props?\n const defaults = {\n ...component.defaultProps,\n ...initialSplitStyles.viewProps,\n }\n\n defaultNativeStyle = {}\n\n const validStyles = staticConfig.validStyles || stylePropsView\n\n // split - keep variables on props to be processed using theme values at runtime (native)\n for (const key in staticConfig.defaultProps) {\n const val = staticConfig.defaultProps[key]\n if ((typeof val === 'string' && val[0] === '$') || !validStyles[key]) {\n defaults[key] = val\n } else {\n defaultNativeStyle[key] = val\n }\n }\n\n defaultNativeStyleSheet = StyleSheet.create({\n base: defaultNativeStyle,\n })\n\n if (Object.keys(defaults).length) {\n tamaguiDefaultProps = defaults\n }\n\n // add debug logs\n if (process.env.NODE_ENV === 'development' && staticConfig.defaultProps?.debug) {\n if (process.env.IS_STATIC !== 'is_static') {\n console.log(`\uD83D\uDC1B [${staticConfig.componentName || 'Component'}]`, {\n staticConfig,\n initialSplitStyles,\n tamaguiDefaultProps,\n defaultNativeStyle,\n defaults,\n })\n }\n }\n })\n\n let res: TamaguiComponent<ComponentPropTypes, Ref, BaseProps> = component as any\n\n if (configIn.memo) {\n res = memo(res) as any\n }\n\n res['staticConfig'] = {\n validStyles: staticConfig.validStyles || stylePropsView,\n ...staticConfig,\n }\n\n if (process.env.NODE_ENV === 'development') {\n res['whyDidYouRender'] = true\n }\n\n // res.extractable HoC\n res['extractable'] = (Component: any, conf?: Partial<StaticConfig>) => {\n Component['staticConfig'] = extendStaticConfig(\n {\n Component,\n ...conf,\n neverFlatten: true,\n defaultProps: {\n ...Component.defaultProps,\n ...conf?.defaultProps,\n },\n },\n res\n )\n return Component\n }\n\n return res\n}\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\nexport const Spacer = createComponent<\n Omit<StackProps, 'flex' | 'direction'> & {\n size?: number | SpaceTokens\n flex?: boolean | number\n direction?: 'horizontal' | 'vertical'\n }\n>({\n memo: true,\n componentName: 'Spacer',\n defaultProps: {\n ...stackDefaultStyles,\n size: true,\n },\n variants: {\n size: {\n '...size': (size, { tokens }) => {\n size = size == true ? '$true' : size\n const sizePx = tokens.space[size] ?? size\n return {\n width: sizePx,\n height: sizePx,\n minWidth: sizePx,\n minHeight: sizePx,\n }\n },\n },\n\n flex: {\n true: {\n flex: 1,\n },\n },\n\n direction: {\n horizontal: {\n height: 0,\n minHeight: 0,\n },\n vertical: {\n width: 0,\n minWidth: 0,\n },\n },\n },\n\n defaultVariants: {\n direction: 'horizontal',\n },\n})\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n direction,\n spaceFlex,\n}: {\n isZStack?: boolean\n children: any\n space?: any\n spaceFlex?: boolean | number\n direction?: SpaceDirection\n}) {\n if (!space && !spaceFlex) {\n return children\n }\n const childrenList = Array.isArray(children) ? children : Children.toArray(children)\n const len = childrenList.length\n if (len <= 1) {\n return childrenList\n }\n const final: any[] = []\n for (const [index, child] of childrenList.entries()) {\n const isEmpty =\n child === null ||\n child === undefined ||\n child === false ||\n (Array.isArray(child) && child.length === 0)\n\n // push them all, but wrap some in Fragment\n if (isEmpty || !child || (child['key'] && !isZStack)) {\n final.push(child)\n } else {\n final.push(\n <Fragment key={index}>{isZStack ? <AbsoluteFill>{child}</AbsoluteFill> : child}</Fragment>\n )\n }\n\n const next = childrenList[index + 1]\n\n if (next && !isVisuallyHidden(next)) {\n final.push(\n <Spacer\n key={`_${index}_spacer`}\n direction={\n direction === 'both'\n ? undefined\n : direction === 'row' || direction === 'row-reverse'\n ? 'horizontal'\n : 'vertical'\n }\n size={space}\n {...(spaceFlex && {\n flex: spaceFlex,\n })}\n />\n )\n }\n }\n\n return final\n}\n\nfunction isVisuallyHidden(child: any) {\n return child?.['type']?.['isVisuallyHidden']\n}\n\nexport function AbsoluteFill(props: any) {\n return isWeb ? (\n <div\n style={\n {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n } as any\n }\n >\n {props.children}\n </div>\n ) : (\n <View style={StyleSheet.absoluteFill}>{props.child}</View>\n )\n}\n\n// this can be done with CSS entirely right?\n// const shouldWrapTextAncestor = isWeb && isText && !hasTextAncestor\n// if (shouldWrapTextAncestor) {\n// // from react-native-web\n// content = createElement(TextAncestorContext.Provider, { value: true }, content)\n// }\n"],
5
+ "mappings": ";;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AAEA,MAAM;AAEN,MAAM,wBAA+C;AAAA,EACnD,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EAEP,SAAS;AAAA,EACT,WAAW;AACb;AAEO,MAAM,WAAW,oBAAI,IAAc;AAC1C,IAAI,OAAO,aAAa,aAAa;AACnC,WAAS,iBAAiB,WAAW,MAAM;AACzC,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB,CAAC;AACD,WAAS,iBAAiB,YAAY,MAAM;AAC1C,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB,CAAC;AACD,WAAS,iBAAiB,eAAe,MAAM;AAC7C,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC3B,aAAS,MAAM;AAAA,EACjB,CAAC;AACH;AAGA,yBAAyB,EAAE,gBAAoC,EAAE,cAA6B;AAE5F,aAA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AM;AAAA,MACN,OAAO;AAAA,MACP,QAAQ;AAAA,IACV;AAAA,KAGD,MAAM,QACT,IAEA,oCAAC;AAAA,IAAK,OAAO,WAAW;AAAA,KAAe,MAAM,KAAM;AAEvD;AAlBgB;",
6
6
  "names": []
7
7
  }
@@ -3,6 +3,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
3
3
  import { getConfig } from "../conf";
4
4
  import { isWeb } from "../constants/platform";
5
5
  import { isVariable } from "../createVariable";
6
+ import { getVariantExtras } from "./getVariantExtras";
6
7
  import { isObj } from "./isObj";
7
8
  function getVariantFunction(variant, key, value) {
8
9
  if (typeof variant === "function") {
@@ -44,21 +45,7 @@ const createPropMapper = /* @__PURE__ */ __name((staticConfig) => {
44
45
  if (variantValue) {
45
46
  if (typeof variantValue === "function") {
46
47
  const fn = variantValue;
47
- variantValue = fn(value, {
48
- fonts: conf.fontsParsed,
49
- tokens: conf.tokensParsed,
50
- theme,
51
- props: avoidDefaultProps ? props : new Proxy(props, {
52
- get(target, key2) {
53
- if (Reflect.has(target, key2)) {
54
- return Reflect.get(target, key2);
55
- }
56
- if (defaultProps) {
57
- return Reflect.get(defaultProps, key2);
58
- }
59
- }
60
- })
61
- });
48
+ variantValue = fn(value, getVariantExtras(props, theme, defaultProps, avoidDefaultProps));
62
49
  }
63
50
  if (isObj(variantValue)) {
64
51
  variantValue = resolveTokens(variantValue, conf, theme, fontFamily, returnVariablesAs);
@@ -188,7 +175,14 @@ const tokenCategories = {
188
175
  minWidth: true,
189
176
  minHeight: true,
190
177
  maxWidth: true,
191
- maxHeight: true
178
+ maxHeight: true,
179
+ padding: true,
180
+ paddingLeft: true,
181
+ paddingRight: true,
182
+ paddingTop: true,
183
+ paddingBottom: true,
184
+ paddingVertical: true,
185
+ paddingHorizontal: true
192
186
  },
193
187
  color: {
194
188
  color: true,