@tamagui/core 1.0.1-beta.48 → 1.0.1-beta.49

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 (131) hide show
  1. package/dist/cjs/Tamagui.js +3 -0
  2. package/dist/cjs/Tamagui.js.map +2 -2
  3. package/dist/cjs/ThemeManager.js.map +2 -2
  4. package/dist/cjs/conf.js +0 -4
  5. package/dist/cjs/conf.js.map +2 -2
  6. package/dist/cjs/createComponent.js +173 -169
  7. package/dist/cjs/createComponent.js.map +2 -2
  8. package/dist/cjs/createTamagui.js +71 -29
  9. package/dist/cjs/createTamagui.js.map +2 -2
  10. package/dist/cjs/createTheme.js +3 -1
  11. package/dist/cjs/createTheme.js.map +2 -2
  12. package/dist/cjs/createTokens.js +4 -19
  13. package/dist/cjs/createTokens.js.map +2 -2
  14. package/dist/cjs/createVariable.js +22 -8
  15. package/dist/cjs/createVariable.js.map +2 -2
  16. package/dist/cjs/createVariables.js +57 -0
  17. package/dist/cjs/createVariables.js.map +7 -0
  18. package/dist/cjs/helpers/createPropMapper.js +81 -51
  19. package/dist/cjs/helpers/createPropMapper.js.map +2 -2
  20. package/dist/cjs/helpers/generateAtomicStyles.js +41 -36
  21. package/dist/cjs/helpers/generateAtomicStyles.js.map +2 -2
  22. package/dist/cjs/helpers/getSplitStyles.js +35 -4
  23. package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
  24. package/dist/cjs/helpers/getStackSize.js +4 -4
  25. package/dist/cjs/helpers/getStackSize.js.map +2 -2
  26. package/dist/cjs/helpers/getStylesAtomic.js +9 -2
  27. package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
  28. package/dist/cjs/helpers/insertStyleRule.js +2 -0
  29. package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
  30. package/dist/cjs/helpers/validate.js +2 -2
  31. package/dist/cjs/helpers/validate.js.map +2 -2
  32. package/dist/cjs/hooks/useIsMounted.js +2 -2
  33. package/dist/cjs/hooks/useIsMounted.js.map +2 -2
  34. package/dist/cjs/index.js +2 -3
  35. package/dist/cjs/index.js.map +2 -2
  36. package/dist/cjs/styled.js +5 -0
  37. package/dist/cjs/styled.js.map +2 -2
  38. package/dist/cjs/types.js.map +1 -1
  39. package/dist/cjs/views/Theme.js +3 -2
  40. package/dist/cjs/views/Theme.js.map +2 -2
  41. package/dist/esm/Tamagui.js +3 -0
  42. package/dist/esm/Tamagui.js.map +2 -2
  43. package/dist/esm/ThemeManager.js.map +2 -2
  44. package/dist/esm/conf.js +0 -4
  45. package/dist/esm/conf.js.map +2 -2
  46. package/dist/esm/createComponent.js +173 -170
  47. package/dist/esm/createComponent.js.map +2 -2
  48. package/dist/esm/createTamagui.js +70 -29
  49. package/dist/esm/createTamagui.js.map +2 -2
  50. package/dist/esm/createTheme.js +3 -1
  51. package/dist/esm/createTheme.js.map +2 -2
  52. package/dist/esm/createTokens.js +3 -17
  53. package/dist/esm/createTokens.js.map +2 -2
  54. package/dist/esm/createVariable.js +22 -7
  55. package/dist/esm/createVariable.js.map +2 -2
  56. package/dist/esm/createVariables.js +35 -0
  57. package/dist/esm/createVariables.js.map +7 -0
  58. package/dist/esm/helpers/createPropMapper.js +70 -51
  59. package/dist/esm/helpers/createPropMapper.js.map +2 -2
  60. package/dist/esm/helpers/generateAtomicStyles.js +41 -36
  61. package/dist/esm/helpers/generateAtomicStyles.js.map +2 -2
  62. package/dist/esm/helpers/getSplitStyles.js +36 -5
  63. package/dist/esm/helpers/getSplitStyles.js.map +2 -2
  64. package/dist/esm/helpers/getStackSize.js +1 -1
  65. package/dist/esm/helpers/getStackSize.js.map +2 -2
  66. package/dist/esm/helpers/getStylesAtomic.js +7 -1
  67. package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
  68. package/dist/esm/helpers/insertStyleRule.js +2 -0
  69. package/dist/esm/helpers/insertStyleRule.js.map +2 -2
  70. package/dist/esm/helpers/validate.js +2 -2
  71. package/dist/esm/helpers/validate.js.map +2 -2
  72. package/dist/esm/hooks/useIsMounted.js +1 -1
  73. package/dist/esm/hooks/useIsMounted.js.map +2 -2
  74. package/dist/esm/index.js +2 -2
  75. package/dist/esm/index.js.map +2 -2
  76. package/dist/esm/styled.js +5 -0
  77. package/dist/esm/styled.js.map +2 -2
  78. package/dist/esm/views/Theme.js +3 -2
  79. package/dist/esm/views/Theme.js.map +2 -2
  80. package/dist/jsx/Tamagui.js +3 -0
  81. package/dist/jsx/conf.js +0 -4
  82. package/dist/jsx/createComponent.js +173 -170
  83. package/dist/jsx/createTamagui.js +70 -29
  84. package/dist/jsx/createTheme.js +3 -1
  85. package/dist/jsx/createTokens.js +3 -17
  86. package/dist/jsx/createVariable.js +22 -7
  87. package/dist/jsx/createVariables.js +34 -0
  88. package/dist/jsx/helpers/createPropMapper.js +70 -51
  89. package/dist/jsx/helpers/generateAtomicStyles.js +41 -36
  90. package/dist/jsx/helpers/getSplitStyles.js +36 -5
  91. package/dist/jsx/helpers/getStackSize.js +1 -1
  92. package/dist/jsx/helpers/getStylesAtomic.js +7 -1
  93. package/dist/jsx/helpers/insertStyleRule.js +2 -0
  94. package/dist/jsx/helpers/validate.js +2 -2
  95. package/dist/jsx/hooks/useIsMounted.js +1 -1
  96. package/dist/jsx/index.js +2 -2
  97. package/dist/jsx/styled.js +5 -0
  98. package/dist/jsx/views/Theme.js +3 -2
  99. package/package.json +5 -5
  100. package/types/ThemeManager.d.ts.map +1 -1
  101. package/types/conf.d.ts +1 -1
  102. package/types/conf.d.ts.map +1 -1
  103. package/types/createComponent.d.ts +1 -0
  104. package/types/createComponent.d.ts.map +1 -1
  105. package/types/createTamagui.d.ts.map +1 -1
  106. package/types/createTheme.d.ts +1 -1
  107. package/types/createTheme.d.ts.map +1 -1
  108. package/types/createTokens.d.ts +0 -1
  109. package/types/createTokens.d.ts.map +1 -1
  110. package/types/createVariable.d.ts +15 -13
  111. package/types/createVariable.d.ts.map +1 -1
  112. package/types/createVariables.d.ts +10 -0
  113. package/types/createVariables.d.ts.map +1 -0
  114. package/types/helpers/createPropMapper.d.ts.map +1 -1
  115. package/types/helpers/generateAtomicStyles.d.ts.map +1 -1
  116. package/types/helpers/getSize.d.ts +1 -1
  117. package/types/helpers/getSize.d.ts.map +1 -1
  118. package/types/helpers/getSplitStyles.d.ts.map +1 -1
  119. package/types/helpers/getStackSize.d.ts +4 -5
  120. package/types/helpers/getStackSize.d.ts.map +1 -1
  121. package/types/helpers/getStylesAtomic.d.ts +5 -0
  122. package/types/helpers/getStylesAtomic.d.ts.map +1 -1
  123. package/types/helpers/getVariantExtras.d.ts +1 -1
  124. package/types/helpers/insertStyleRule.d.ts.map +1 -1
  125. package/types/hooks/useIsMounted.d.ts.map +1 -1
  126. package/types/index.d.ts +2 -1
  127. package/types/index.d.ts.map +1 -1
  128. package/types/styled.d.ts.map +1 -1
  129. package/types/types.d.ts +10 -7
  130. package/types/types.d.ts.map +1 -1
  131. package/types/views/Theme.d.ts.map +1 -1
@@ -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 { 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 { mediaState } from './hooks/useMedia'\nimport { usePressable } from './hooks/usePressable'\nimport { getThemeManagerIfChanged, useTheme } from './hooks/useTheme'\nimport {\n SpaceFlexDirection,\n SpaceTokens,\n StackProps,\n StaticConfig,\n StaticConfigParsed,\n StylableComponent,\n TamaguiComponent,\n TamaguiComponentState,\n TamaguiConfig,\n TamaguiElement,\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 = TamaguiElement,\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 defaultComponentClassName = `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>((propsIn: any, forwardedRef) => {\n // React inserts default props after your props for some reason... order important\n const props =\n tamaguiDefaultProps && !propsIn.asChild ? { ...tamaguiDefaultProps, ...propsIn } : propsIn\n\n const { Component, isText, isZStack } = staticConfig\n const componentName = props.componentName || staticConfig.componentName\n const componentClassName = props.asChild\n ? ''\n : props.componentName\n ? `is_${props.componentName}`\n : defaultComponentClassName\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u26A0\uFE0F', 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:', { propsIn, props, ordered: Object.keys(props) })\n if (props['debug'] === 'break') debugger\n }\n }\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, 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\n ? {\n ...state,\n dynamicStylesInline: true,\n }\n : {\n ...state,\n noClassNames: true,\n dynamicStylesInline: true,\n resolveVariablesAs: 'value',\n },\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 onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space: spaceProp,\n disabled: disabledProp,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\n separator,\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 ...nonTamaguiProps\n } = viewPropsIn\n\n // get the right component\n const isTaggable = !Component || typeof Component === 'string'\n const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\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 elementType = isText\n ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent\n : (isAnimated ? AnimatedView || View : null) || BaseViewComponent\n\n elementType = Component || elementType\n const isStringElement = typeof elementType === 'string'\n\n const disabled =\n (props.accessibilityState != null && props.accessibilityState.disabled === true) ||\n props.accessibilityDisabled\n\n // these can ultimately be for DOM, react-native-web views, or animated views\n // so the type is pretty loose\n let viewProps: Record<string, any>\n\n // if react-native-web view just pass all props down\n if (isWeb && !staticConfig.isReactNativeWeb) {\n // otherwise replicate react-native-web functionality\n const {\n // event props\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 // react-native props\n nativeID,\n\n // react-native-web accessibility props\n // @ts-ignore\n accessibilityActiveDescendant,\n // @ts-ignore\n accessibilityAtomic,\n // @ts-ignore\n accessibilityAutoComplete,\n // @ts-ignore\n accessibilityBusy,\n // @ts-ignore\n accessibilityChecked,\n // @ts-ignore\n accessibilityColumnCount,\n // @ts-ignore\n accessibilityColumnIndex,\n // @ts-ignore\n accessibilityColumnSpan,\n // @ts-ignore\n accessibilityControls,\n // @ts-ignore\n accessibilityCurrent,\n // @ts-ignore\n accessibilityDescribedBy,\n // @ts-ignore\n accessibilityDetails,\n // @ts-ignore\n accessibilityDisabled,\n // @ts-ignore\n accessibilityErrorMessage,\n // @ts-ignore\n accessibilityExpanded,\n // @ts-ignore\n accessibilityFlowTo,\n // @ts-ignore\n accessibilityHasPopup,\n // @ts-ignore\n accessibilityHidden,\n // @ts-ignore\n accessibilityInvalid,\n // @ts-ignore\n accessibilityKeyShortcuts,\n // @ts-ignore\n accessibilityLabel,\n // @ts-ignore\n accessibilityLabelledBy,\n // @ts-ignore\n accessibilityLevel,\n // @ts-ignore\n accessibilityLiveRegion,\n // @ts-ignore\n accessibilityModal,\n // @ts-ignore\n accessibilityMultiline,\n // @ts-ignore\n accessibilityMultiSelectable,\n // @ts-ignore\n accessibilityOrientation,\n // @ts-ignore\n accessibilityOwns,\n // @ts-ignore\n accessibilityPlaceholder,\n // @ts-ignore\n accessibilityPosInSet,\n // @ts-ignore\n accessibilityPressed,\n // @ts-ignore\n accessibilityReadOnly,\n // @ts-ignore\n accessibilityRequired,\n // @ts-ignore\n accessibilityRole,\n // @ts-ignore\n accessibilityRoleDescription,\n // @ts-ignore\n accessibilityRowCount,\n // @ts-ignore\n accessibilityRowIndex,\n // @ts-ignore\n accessibilityRowSpan,\n // @ts-ignore\n accessibilitySelected,\n // @ts-ignore\n accessibilitySetSize,\n // @ts-ignore\n accessibilitySort,\n // @ts-ignore\n accessibilityValueMax,\n // @ts-ignore\n accessibilityValueMin,\n // @ts-ignore\n accessibilityValueNow,\n // @ts-ignore\n accessibilityValueText,\n\n // deprecated\n accessible,\n accessibilityState,\n accessibilityValue,\n\n // android\n collapsable,\n focusable,\n\n onLayout,\n\n ...webProps\n } = nonTamaguiProps\n\n viewProps = webProps\n\n // adapted from react-native-web\n if (!viewProps.role && accessibilityRole) {\n if (accessibilityRole === 'none') {\n viewProps.role = 'presentation'\n } else {\n const webRole = accessibilityRoleToWebRole[accessibilityRole]\n if (webRole != null) {\n viewProps.role = webRole || accessibilityRole\n }\n }\n }\n const role = viewProps.role\n\n // adapted from react-native-web\n // ACCESSIBILITY\n if (accessibilityActiveDescendant != null) {\n viewProps['aria-activedescendant'] = accessibilityActiveDescendant\n }\n if (accessibilityAtomic != null) {\n viewProps['aria-atomic'] = accessibilityAtomic\n }\n if (accessibilityAutoComplete != null) {\n viewProps['aria-autocomplete'] = accessibilityAutoComplete\n }\n if (accessibilityBusy != null) {\n viewProps['aria-busy'] = accessibilityBusy\n }\n if (accessibilityChecked != null) {\n viewProps['aria-checked'] = accessibilityChecked\n }\n if (accessibilityColumnCount != null) {\n viewProps['aria-colcount'] = accessibilityColumnCount\n }\n if (accessibilityColumnIndex != null) {\n viewProps['aria-colindex'] = accessibilityColumnIndex\n }\n if (accessibilityColumnSpan != null) {\n viewProps['aria-colspan'] = accessibilityColumnSpan\n }\n if (accessibilityControls != null) {\n viewProps['aria-controls'] = processIDRefList(accessibilityControls)\n }\n if (accessibilityCurrent != null) {\n viewProps['aria-current'] = accessibilityCurrent\n }\n if (accessibilityDescribedBy != null) {\n viewProps['aria-describedby'] = processIDRefList(accessibilityDescribedBy)\n }\n if (accessibilityDetails != null) {\n viewProps['aria-details'] = accessibilityDetails\n }\n if (disabled === true) {\n viewProps['aria-disabled'] = true\n // Enhance with native semantics\n if (\n elementType === 'button' ||\n elementType === 'form' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.disabled = true\n }\n }\n if (accessibilityErrorMessage != null) {\n viewProps['aria-errormessage'] = accessibilityErrorMessage\n }\n if (accessibilityExpanded != null) {\n viewProps['aria-expanded'] = accessibilityExpanded\n }\n if (accessibilityFlowTo != null) {\n viewProps['aria-flowto'] = processIDRefList(accessibilityFlowTo)\n }\n if (accessibilityHasPopup != null) {\n viewProps['aria-haspopup'] = accessibilityHasPopup\n }\n if (accessibilityHidden === true) {\n viewProps['aria-hidden'] = accessibilityHidden\n }\n if (accessibilityInvalid != null) {\n viewProps['aria-invalid'] = accessibilityInvalid\n }\n if (accessibilityKeyShortcuts != null && Array.isArray(accessibilityKeyShortcuts)) {\n viewProps['aria-keyshortcuts'] = accessibilityKeyShortcuts.join(' ')\n }\n if (accessibilityLabel != null) {\n viewProps['aria-label'] = accessibilityLabel\n }\n if (accessibilityLabelledBy != null) {\n viewProps['aria-labelledby'] = processIDRefList(accessibilityLabelledBy)\n }\n if (accessibilityLevel != null) {\n viewProps['aria-level'] = accessibilityLevel\n }\n if (accessibilityLiveRegion != null) {\n viewProps['aria-live'] =\n accessibilityLiveRegion === 'none' ? 'off' : accessibilityLiveRegion\n }\n if (accessibilityModal != null) {\n viewProps['aria-modal'] = accessibilityModal\n }\n if (accessibilityMultiline != null) {\n viewProps['aria-multiline'] = accessibilityMultiline\n }\n if (accessibilityMultiSelectable != null) {\n viewProps['aria-multiselectable'] = accessibilityMultiSelectable\n }\n if (accessibilityOrientation != null) {\n viewProps['aria-orientation'] = accessibilityOrientation\n }\n if (accessibilityOwns != null) {\n viewProps['aria-owns'] = processIDRefList(accessibilityOwns)\n }\n if (accessibilityPlaceholder != null) {\n viewProps['aria-placeholder'] = accessibilityPlaceholder\n }\n if (accessibilityPosInSet != null) {\n viewProps['aria-posinset'] = accessibilityPosInSet\n }\n if (accessibilityPressed != null) {\n viewProps['aria-pressed'] = accessibilityPressed\n }\n if (accessibilityReadOnly != null) {\n viewProps['aria-readonly'] = accessibilityReadOnly\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.readOnly = true\n }\n }\n if (accessibilityRequired != null) {\n viewProps['aria-required'] = accessibilityRequired\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.required = true\n }\n }\n if (accessibilityRoleDescription != null) {\n viewProps['aria-roledescription'] = accessibilityRoleDescription\n }\n if (accessibilityRowCount != null) {\n viewProps['aria-rowcount'] = accessibilityRowCount\n }\n if (accessibilityRowIndex != null) {\n viewProps['aria-rowindex'] = accessibilityRowIndex\n }\n if (accessibilityRowSpan != null) {\n viewProps['aria-rowspan'] = accessibilityRowSpan\n }\n if (accessibilitySelected != null) {\n viewProps['aria-selected'] = accessibilitySelected\n }\n if (accessibilitySetSize != null) {\n viewProps['aria-setsize'] = accessibilitySetSize\n }\n if (accessibilitySort != null) {\n viewProps['aria-sort'] = accessibilitySort\n }\n if (accessibilityValueMax != null) {\n viewProps['aria-valuemax'] = accessibilityValueMax\n }\n if (accessibilityValueMin != null) {\n viewProps['aria-valuemin'] = accessibilityValueMin\n }\n if (accessibilityValueNow != null) {\n viewProps['aria-valuenow'] = accessibilityValueNow\n }\n if (accessibilityValueText != null) {\n viewProps['aria-valuetext'] = accessibilityValueText\n }\n\n if (nativeID) {\n viewProps.id = nativeID\n }\n\n if (!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 // 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\n // FOCUS\n // \"focusable\" indicates that an element may be a keyboard tab-stop.\n const _focusable = focusable != null ? focusable : accessible\n if (_focusable === false) {\n viewProps.tabIndex = '-1'\n }\n if (\n // These native elements are focusable by default\n elementType === 'a' ||\n elementType === 'button' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n if (_focusable === false || accessibilityDisabled === true) {\n viewProps.tabIndex = '-1'\n }\n } else if (\n // These roles are made focusable by default\n role === 'button' ||\n role === 'checkbox' ||\n role === 'link' ||\n role === 'radio' ||\n role === 'textbox' ||\n role === 'switch'\n ) {\n if (_focusable !== false) {\n viewProps.tabIndex = '0'\n }\n } else {\n // Everything else must explicitly set the prop\n if (_focusable === true) {\n viewProps.tabIndex = '0'\n }\n }\n } else {\n viewProps = nonTamaguiProps\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\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 // 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 let styles: any[]\n\n const animationStyles = state.animation ? state.animation.style : null\n\n if (isStringElement && shouldAvoidClasses) {\n styles = {\n ...defaultNativeStyle,\n ...(animationStyles ?? style),\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 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 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 if (!shouldAvoidClasses) {\n if (classNames) {\n classList.push(Object.values(classNames).join(' '))\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\n const className = classList.join(' ')\n const style = animationStyles ?? splitStyles.style\n\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n // prettier-ignore\n console.log(' \u00BB className', { splitStyles, style, isStringElement, pseudos, state, classNames, propsClassName: props.className, classList, className: className.trim().split(' '), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) })\n }\n\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = {\n ...viewProps.dataSet,\n className: className,\n }\n } else {\n viewProps.className = className\n }\n\n viewProps.style = style\n } else {\n viewProps.style = styles\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 let space = spaceProp\n // find space by media query\n if (features.enabled.mediaQuery) {\n for (const key in mediaState) {\n if (!mediaState[key]) continue\n if (props[key] && props[key].space !== undefined) {\n space = props[key].space\n }\n }\n }\n\n let childEls =\n !children || asChild\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n separator,\n children,\n space,\n direction: props.spaceDirection || 'both',\n isZStack,\n }),\n getThemeManagerIfChanged(theme)\n )\n\n let content: any\n\n if (asChild) {\n elementType = Slot\n viewProps = {\n ...viewProps,\n onPress,\n onPressIn,\n onPressOut,\n }\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(elementType, viewProps, childEls)\n\n // EVENTS native\n // native just wrap in <Pressable />\n if (process.env.TAMAGUI_TARGET === 'native') {\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: elementType, 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.elements.length) {\n return (\n <>\n {features.elements}\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// for elements to avoid spacing\nexport const Unspaced = (props: { children?: any }) => {\n return props.children\n}\nUnspaced['isUnspaced'] = true\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\ntype SpaceDirection = 'vertical' | 'horizontal'\n\nexport type SpacerProps = Omit<StackProps, 'flex' | 'direction'> & {\n size?: number | SpaceTokens\n flex?: boolean | number\n direction?: SpaceDirection\n}\nexport const Spacer = createComponent<SpacerProps>({\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 ':number': (flex) => ({ flex }),\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 type SpacedChildrenProps = {\n isZStack?: boolean\n children?: any\n space?: any\n spaceFlex?: boolean | number\n direction?: SpaceFlexDirection\n separator?: React.ReactNode\n}\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n direction,\n spaceFlex,\n separator,\n}: SpacedChildrenProps) {\n const hasSpace = !!(space || spaceFlex)\n const hasSeparator = !(separator === undefined || separator === null)\n if (!hasSpace && !hasSeparator) {\n return children\n }\n const childrenList = Children.toArray(children)\n if (childrenList.length <= 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 && !isUnspaced(next)) {\n if (separator) {\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_before_sep_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n final.push(\n React.isValidElement(separator)\n ? React.cloneElement(separator, { key: `sep_${index}` })\n : separator\n )\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_after_sep_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n } else {\n final.push(\n createSpacer({\n key: `_${index}_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n }\n }\n\n return final\n}\n\ntype CreateSpacerProps = SpacedChildrenProps & { key: string }\n\nfunction createSpacer({ key, direction, space, spaceFlex }: CreateSpacerProps) {\n return (\n <Spacer\n key={key}\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\nfunction isUnspaced(child: any) {\n return child?.['type']?.['isVisuallyHidden'] || child?.['type']?.['isUnspaced']\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\nfunction processIDRefList(idRefList: string | Array<string>): string {\n return Array.isArray(idRefList) ? idRefList.join(' ') : idRefList\n}\n\nconst accessibilityRoleToWebRole = {\n adjustable: 'slider',\n button: 'button',\n header: 'heading',\n image: 'img',\n imagebutton: null,\n keyboardkey: null,\n label: null,\n link: 'link',\n none: 'presentation',\n search: 'search',\n summary: 'region',\n text: null,\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;AAeA;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,aAAW,OAAO,cAAc;AAC9B,iBAAa,WAAW,QAAQ,OAAO,aAAa;AAAA,EACtD;AACF;AALS;AAOT,IAAI;AAEG,yBAIL,UAAsD,iBAAqC;AAC3F,QAAM,eAAgB,OAAM;AAC1B,UAAM,SAAS,mBAAmB,UAAU,eAAe;AAC3D,QAAI,YAAY,QAAQ;AACtB,aAAO;AAAA,IACT,OAAO;AACL,aAAO,kBAAkB,MAAM;AAAA,IACjC;AAAA,EACF,GAAG;AAEH,QAAM,4BAA4B,MAAM,aAAa;AACrD,MAAI;AACJ,MAAI;AACJ,MAAI;AACJ,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BS;AAmBT,oBAAoB,OAAY;AAlvChC;AAmvCE,SAAO,sCAAQ,YAAR,mBAAkB,wBAAuB,sCAAQ,YAAR,mBAAkB;AACpE;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;AA2BhB,0BAA0B,WAA2C;AACnE,SAAO,MAAM,QAAQ,SAAS,IAAI,UAAU,KAAK,GAAG,IAAI;AAC1D;AAFS;AAIT,MAAM,6BAA6B;AAAA,EACjC,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa;AAAA,EACb,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AACR;",
4
+ "sourcesContent": ["import { stylePropsView, validStyles } 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 { 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 { mediaState } from './hooks/useMedia'\nimport { usePressable } from './hooks/usePressable'\nimport { getThemeManagerIfChanged, useTheme } from './hooks/useTheme'\nimport {\n SpaceFlexDirection,\n SpaceTokens,\n StackProps,\n StaticConfig,\n StaticConfigParsed,\n StylableComponent,\n TamaguiComponent,\n TamaguiComponentState,\n TamaguiConfig,\n TamaguiElement,\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 = TamaguiElement,\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 defaultComponentClassName = `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>((propsIn: any, forwardedRef) => {\n // React inserts default props after your props for some reason... order important\n const props =\n tamaguiDefaultProps && !propsIn.asChild ? { ...tamaguiDefaultProps, ...propsIn } : propsIn\n\n const { Component, isText, isZStack } = staticConfig\n const componentName = props.componentName || staticConfig.componentName\n const componentClassName = props.asChild\n ? ''\n : props.componentName\n ? `is_${props.componentName}`\n : defaultComponentClassName\n\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n // prettier-ignore\n console.log('\u26A0\uFE0F', 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:', { propsIn, props, ordered: Object.keys(props) })\n if (props['debug'] === 'break') debugger\n }\n }\n\n const forceUpdate = useForceUpdate()\n const theme = useTheme(props.theme, 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\n ? {\n ...state,\n dynamicStylesInline: true,\n }\n : {\n ...state,\n noClassNames: true,\n dynamicStylesInline: true,\n resolveVariablesAs: 'value',\n },\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 onPress,\n onPressIn,\n onPressOut,\n onHoverIn,\n onHoverOut,\n space: spaceProp,\n disabled: disabledProp,\n onMouseDown,\n onMouseEnter,\n onMouseLeave,\n hrefAttrs,\n separator,\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 ...nonTamaguiProps\n } = viewPropsIn\n\n // get the right component\n const isTaggable = !Component || typeof Component === 'string'\n const hasTextAncestor = isWeb ? useContext(TextAncestorContext) : false\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 elementType = isText\n ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent\n : (isAnimated ? AnimatedView || View : null) || BaseViewComponent\n\n elementType = Component || elementType\n const isStringElement = typeof elementType === 'string'\n\n const disabled =\n (props.accessibilityState != null && props.accessibilityState.disabled === true) ||\n props.accessibilityDisabled\n\n // these can ultimately be for DOM, react-native-web views, or animated views\n // so the type is pretty loose\n let viewProps: Record<string, any>\n\n // if react-native-web view just pass all props down\n if (isWeb && !staticConfig.isReactNativeWeb) {\n // otherwise replicate react-native-web functionality\n const {\n // event props\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 // react-native props\n nativeID,\n\n // react-native-web accessibility props\n // @ts-ignore\n accessibilityActiveDescendant,\n // @ts-ignore\n accessibilityAtomic,\n // @ts-ignore\n accessibilityAutoComplete,\n // @ts-ignore\n accessibilityBusy,\n // @ts-ignore\n accessibilityChecked,\n // @ts-ignore\n accessibilityColumnCount,\n // @ts-ignore\n accessibilityColumnIndex,\n // @ts-ignore\n accessibilityColumnSpan,\n // @ts-ignore\n accessibilityControls,\n // @ts-ignore\n accessibilityCurrent,\n // @ts-ignore\n accessibilityDescribedBy,\n // @ts-ignore\n accessibilityDetails,\n // @ts-ignore\n accessibilityDisabled,\n // @ts-ignore\n accessibilityErrorMessage,\n // @ts-ignore\n accessibilityExpanded,\n // @ts-ignore\n accessibilityFlowTo,\n // @ts-ignore\n accessibilityHasPopup,\n // @ts-ignore\n accessibilityHidden,\n // @ts-ignore\n accessibilityInvalid,\n // @ts-ignore\n accessibilityKeyShortcuts,\n // @ts-ignore\n accessibilityLabel,\n // @ts-ignore\n accessibilityLabelledBy,\n // @ts-ignore\n accessibilityLevel,\n // @ts-ignore\n accessibilityLiveRegion,\n // @ts-ignore\n accessibilityModal,\n // @ts-ignore\n accessibilityMultiline,\n // @ts-ignore\n accessibilityMultiSelectable,\n // @ts-ignore\n accessibilityOrientation,\n // @ts-ignore\n accessibilityOwns,\n // @ts-ignore\n accessibilityPlaceholder,\n // @ts-ignore\n accessibilityPosInSet,\n // @ts-ignore\n accessibilityPressed,\n // @ts-ignore\n accessibilityReadOnly,\n // @ts-ignore\n accessibilityRequired,\n // @ts-ignore\n accessibilityRole,\n // @ts-ignore\n accessibilityRoleDescription,\n // @ts-ignore\n accessibilityRowCount,\n // @ts-ignore\n accessibilityRowIndex,\n // @ts-ignore\n accessibilityRowSpan,\n // @ts-ignore\n accessibilitySelected,\n // @ts-ignore\n accessibilitySetSize,\n // @ts-ignore\n accessibilitySort,\n // @ts-ignore\n accessibilityValueMax,\n // @ts-ignore\n accessibilityValueMin,\n // @ts-ignore\n accessibilityValueNow,\n // @ts-ignore\n accessibilityValueText,\n\n // deprecated\n accessible,\n accessibilityState,\n accessibilityValue,\n\n // android\n collapsable,\n focusable,\n\n onLayout,\n\n ...webProps\n } = nonTamaguiProps\n\n viewProps = webProps\n\n assignNativePropsToWeb(elementType, viewProps, nonTamaguiProps)\n\n if (!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 // 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\n const role = viewProps.role\n\n // FOCUS\n // \"focusable\" indicates that an element may be a keyboard tab-stop.\n const _focusable = focusable != null ? focusable : accessible\n if (_focusable === false) {\n viewProps.tabIndex = '-1'\n }\n if (\n // These native elements are focusable by default\n elementType === 'a' ||\n elementType === 'button' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n if (_focusable === false || accessibilityDisabled === true) {\n viewProps.tabIndex = '-1'\n }\n } else if (\n // These roles are made focusable by default\n role === 'button' ||\n role === 'checkbox' ||\n role === 'link' ||\n role === 'radio' ||\n role === 'textbox' ||\n role === 'switch'\n ) {\n if (_focusable !== false) {\n viewProps.tabIndex = '0'\n }\n } else {\n // Everything else must explicitly set the prop\n if (_focusable === true) {\n viewProps.tabIndex = '0'\n }\n }\n } else {\n viewProps = nonTamaguiProps\n if (forwardedRef) {\n // @ts-ignore\n viewProps.ref = forwardedRef\n }\n }\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 // 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 let styles: any[]\n\n const animationStyles = state.animation ? state.animation.style : null\n\n if (isStringElement && shouldAvoidClasses) {\n styles = {\n ...defaultNativeStyle,\n ...(animationStyles ?? style),\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 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 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 if (!shouldAvoidClasses) {\n if (classNames) {\n classList.push(Object.values(classNames).join(' '))\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\n const className = classList.join(' ')\n const style = animationStyles ?? splitStyles.style\n\n if (process.env.NODE_ENV === 'development' && props['debug']) {\n // prettier-ignore\n console.log(' \u00BB className', { splitStyles, style, isStringElement, pseudos, state, classNames, propsClassName: props.className, classList, className: className.trim().split(' '), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) })\n }\n\n if (staticConfig.isReactNativeWeb) {\n viewProps.dataSet = {\n ...viewProps.dataSet,\n className: className,\n }\n } else {\n viewProps.className = className\n }\n\n viewProps.style = style\n } else {\n viewProps.style = styles\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 let space = spaceProp\n // find space by media query\n if (features.enabled.mediaQuery) {\n for (const key in mediaState) {\n if (!mediaState[key]) continue\n if (props[key] && props[key].space !== undefined) {\n space = props[key].space\n }\n }\n }\n\n let childEls =\n !children || asChild\n ? children\n : wrapThemeManagerContext(\n spacedChildren({\n separator,\n children,\n space,\n direction: props.spaceDirection || 'both',\n isZStack,\n }),\n getThemeManagerIfChanged(theme)\n )\n\n let content: any\n\n if (asChild) {\n elementType = Slot\n viewProps = {\n ...viewProps,\n onPress,\n onPressIn,\n onPressOut,\n }\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(elementType, viewProps, childEls)\n\n // EVENTS native\n // native just wrap in <Pressable />\n if (process.env.TAMAGUI_TARGET === 'native') {\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: elementType, 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.elements.length) {\n return (\n <>\n {features.elements}\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 // res.extractable HoC\n res.extractable = (Component: any, conf?: Partial<StaticConfig>) => {\n Component.staticConfig = extendStaticConfig(\n {\n Component,\n ...conf,\n neverFlatten: true,\n isExtractable: 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// for elements to avoid spacing\nexport const Unspaced = (props: { children?: any }) => {\n return props.children\n}\nUnspaced['isUnspaced'] = true\n\n// dont used styled() here to avoid circular deps\n// keep inline to avoid circular deps\n\ntype SpaceDirection = 'vertical' | 'horizontal'\n\nexport type SpacerProps = Omit<StackProps, 'flex' | 'direction'> & {\n size?: number | SpaceTokens\n flex?: boolean | number\n direction?: SpaceDirection\n}\nexport const Spacer = createComponent<SpacerProps>({\n memo: true,\n componentName: 'Spacer',\n validStyles,\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 flexGrow: 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 type SpacedChildrenProps = {\n isZStack?: boolean\n children?: any\n space?: any\n spaceFlex?: boolean | number\n direction?: SpaceFlexDirection\n separator?: React.ReactNode\n}\n\nexport function spacedChildren({\n isZStack,\n children,\n space,\n direction,\n spaceFlex,\n separator,\n}: SpacedChildrenProps) {\n const hasSpace = !!(space || spaceFlex)\n const hasSeparator = !(separator === undefined || separator === null)\n if (!hasSpace && !hasSeparator) {\n return children\n }\n const childrenList = Children.toArray(children)\n if (childrenList.length <= 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 && !isUnspaced(next)) {\n if (separator) {\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_before_sep_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n final.push(\n React.isValidElement(separator)\n ? React.cloneElement(separator, { key: `sep_${index}` })\n : separator\n )\n if (hasSpace) {\n final.push(\n createSpacer({\n key: `_${index}_after_sep_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n } else {\n final.push(\n createSpacer({\n key: `_${index}_spacer`,\n direction,\n space,\n spaceFlex,\n })\n )\n }\n }\n }\n\n return final\n}\n\ntype CreateSpacerProps = SpacedChildrenProps & { key: string }\n\nfunction createSpacer({ key, direction, space, spaceFlex }: CreateSpacerProps) {\n return (\n <Spacer\n key={key}\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\nfunction isUnspaced(child: any) {\n return child?.['type']?.['isVisuallyHidden'] || child?.['type']?.['isUnspaced']\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\nfunction processIDRefList(idRefList: string | Array<string>): string {\n return Array.isArray(idRefList) ? idRefList.join(' ') : idRefList\n}\n\nconst accessibilityRoleToWebRole = {\n adjustable: 'slider',\n button: 'button',\n header: 'heading',\n image: 'img',\n imagebutton: null,\n keyboardkey: null,\n label: null,\n link: 'link',\n none: 'presentation',\n search: 'search',\n summary: 'region',\n text: null,\n}\n\n// adapted from react-native-web\nexport function assignNativePropsToWeb(elementType: string, viewProps: any, nativeProps: any) {\n if (!viewProps.role && nativeProps.accessibilityRole) {\n if (nativeProps.accessibilityRole === 'none') {\n viewProps.role = 'presentation'\n } else {\n const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole]\n if (webRole != null) {\n viewProps.role = webRole || nativeProps.accessibilityRole\n }\n }\n }\n\n if (nativeProps.accessibilityActiveDescendant != null) {\n viewProps['aria-activedescendant'] = nativeProps.accessibilityActiveDescendant\n }\n if (nativeProps.accessibilityAtomic != null) {\n viewProps['aria-atomic'] = nativeProps.accessibilityAtomic\n }\n if (nativeProps.accessibilityAutoComplete != null) {\n viewProps['aria-autocomplete'] = nativeProps.accessibilityAutoComplete\n }\n if (nativeProps.accessibilityBusy != null) {\n viewProps['aria-busy'] = nativeProps.accessibilityBusy\n }\n if (nativeProps.accessibilityChecked != null) {\n viewProps['aria-checked'] = nativeProps.accessibilityChecked\n }\n if (nativeProps.accessibilityColumnCount != null) {\n viewProps['aria-colcount'] = nativeProps.accessibilityColumnCount\n }\n if (nativeProps.accessibilityColumnIndex != null) {\n viewProps['aria-colindex'] = nativeProps.accessibilityColumnIndex\n }\n if (nativeProps.accessibilityColumnSpan != null) {\n viewProps['aria-colspan'] = nativeProps.accessibilityColumnSpan\n }\n if (nativeProps.accessibilityControls != null) {\n viewProps['aria-controls'] = processIDRefList(nativeProps.accessibilityControls)\n }\n if (nativeProps.accessibilityCurrent != null) {\n viewProps['aria-current'] = nativeProps.accessibilityCurrent\n }\n if (nativeProps.accessibilityDescribedBy != null) {\n viewProps['aria-describedby'] = processIDRefList(nativeProps.accessibilityDescribedBy)\n }\n if (nativeProps.accessibilityDetails != null) {\n viewProps['aria-details'] = nativeProps.accessibilityDetails\n }\n if (nativeProps.disabled === true) {\n viewProps['aria-disabled'] = true\n // Enhance with native semantics\n if (\n elementType === 'button' ||\n elementType === 'form' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.disabled = true\n }\n }\n if (nativeProps.accessibilityErrorMessage != null) {\n viewProps['aria-errormessage'] = nativeProps.accessibilityErrorMessage\n }\n if (nativeProps.accessibilityExpanded != null) {\n viewProps['aria-expanded'] = nativeProps.accessibilityExpanded\n }\n if (nativeProps.accessibilityFlowTo != null) {\n viewProps['aria-flowto'] = processIDRefList(nativeProps.accessibilityFlowTo)\n }\n if (nativeProps.accessibilityHasPopup != null) {\n viewProps['aria-haspopup'] = nativeProps.accessibilityHasPopup\n }\n if (nativeProps.accessibilityHidden === true) {\n viewProps['aria-hidden'] = nativeProps.accessibilityHidden\n }\n if (nativeProps.accessibilityInvalid != null) {\n viewProps['aria-invalid'] = nativeProps.accessibilityInvalid\n }\n if (\n nativeProps.accessibilityKeyShortcuts != null &&\n Array.isArray(nativeProps.accessibilityKeyShortcuts)\n ) {\n viewProps['aria-keyshortcuts'] = nativeProps.accessibilityKeyShortcuts.join(' ')\n }\n if (nativeProps.accessibilityLabel != null) {\n viewProps['aria-label'] = nativeProps.accessibilityLabel\n }\n if (nativeProps.accessibilityLabelledBy != null) {\n viewProps['aria-labelledby'] = processIDRefList(nativeProps.accessibilityLabelledBy)\n }\n if (nativeProps.accessibilityLevel != null) {\n viewProps['aria-level'] = nativeProps.accessibilityLevel\n }\n if (nativeProps.accessibilityLiveRegion != null) {\n viewProps['aria-live'] =\n nativeProps.accessibilityLiveRegion === 'none' ? 'off' : nativeProps.accessibilityLiveRegion\n }\n if (nativeProps.accessibilityModal != null) {\n viewProps['aria-modal'] = nativeProps.accessibilityModal\n }\n if (nativeProps.accessibilityMultiline != null) {\n viewProps['aria-multiline'] = nativeProps.accessibilityMultiline\n }\n if (nativeProps.accessibilityMultiSelectable != null) {\n viewProps['aria-multiselectable'] = nativeProps.accessibilityMultiSelectable\n }\n if (nativeProps.accessibilityOrientation != null) {\n viewProps['aria-orientation'] = nativeProps.accessibilityOrientation\n }\n if (nativeProps.accessibilityOwns != null) {\n viewProps['aria-owns'] = processIDRefList(nativeProps.accessibilityOwns)\n }\n if (nativeProps.accessibilityPlaceholder != null) {\n viewProps['aria-placeholder'] = nativeProps.accessibilityPlaceholder\n }\n if (nativeProps.accessibilityPosInSet != null) {\n viewProps['aria-posinset'] = nativeProps.accessibilityPosInSet\n }\n if (nativeProps.accessibilityPressed != null) {\n viewProps['aria-pressed'] = nativeProps.accessibilityPressed\n }\n if (nativeProps.accessibilityReadOnly != null) {\n viewProps['aria-readonly'] = nativeProps.accessibilityReadOnly\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.readOnly = true\n }\n }\n if (nativeProps.accessibilityRequired != null) {\n viewProps['aria-required'] = nativeProps.accessibilityRequired\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.required = true\n }\n }\n if (nativeProps.accessibilityRoleDescription != null) {\n viewProps['aria-roledescription'] = nativeProps.accessibilityRoleDescription\n }\n if (nativeProps.accessibilityRowCount != null) {\n viewProps['aria-rowcount'] = nativeProps.accessibilityRowCount\n }\n if (nativeProps.accessibilityRowIndex != null) {\n viewProps['aria-rowindex'] = nativeProps.accessibilityRowIndex\n }\n if (nativeProps.accessibilityRowSpan != null) {\n viewProps['aria-rowspan'] = nativeProps.accessibilityRowSpan\n }\n if (nativeProps.accessibilitySelected != null) {\n viewProps['aria-selected'] = nativeProps.accessibilitySelected\n }\n if (nativeProps.accessibilitySetSize != null) {\n viewProps['aria-setsize'] = nativeProps.accessibilitySetSize\n }\n if (nativeProps.accessibilitySort != null) {\n viewProps['aria-sort'] = nativeProps.accessibilitySort\n }\n if (nativeProps.accessibilityValueMax != null) {\n viewProps['aria-valuemax'] = nativeProps.accessibilityValueMax\n }\n if (nativeProps.accessibilityValueMin != null) {\n viewProps['aria-valuemin'] = nativeProps.accessibilityValueMin\n }\n if (nativeProps.accessibilityValueNow != null) {\n viewProps['aria-valuenow'] = nativeProps.accessibilityValueNow\n }\n if (nativeProps.accessibilityValueText != null) {\n viewProps['aria-valuetext'] = nativeProps.accessibilityValueText\n }\n\n if (nativeProps.nativeID) {\n viewProps.id = nativeProps.nativeID\n }\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;AAeA;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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,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,wBAAwB,MAAM;AAC5C,cAAU,kBAAkB,YAAY;AAAA,EAC1C;AACA,MAAI,YAAY,qBAAqB,MAAM;AACzC,cAAU,eAAe,YAAY;AAAA,EACvC;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,yBAAyB,MAAM;AAC7C,cAAU,mBAAmB,YAAY;AAAA,EAC3C;AACA,MAAI,YAAY,0BAA0B,MAAM;AAC9C,cAAU,oBAAoB,YAAY;AAAA,EAC5C;AAEA,MAAI,YAAY,UAAU;AACxB,cAAU,KAAK,YAAY;AAAA,EAC7B;AACF;AA7KgB;",
6
6
  "names": []
7
7
  }
@@ -3,7 +3,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
3
3
  import { configListeners, getHasConfigured, setConfig } from "./conf";
4
4
  import { THEME_CLASSNAME_PREFIX } from "./constants/constants";
5
5
  import { isWeb } from "./constants/platform";
6
- import { Variable, createCSSVariable, createVariable, isVariable } from "./createVariable";
6
+ import { createCSSVariable, createVariable, isVariable } from "./createVariable";
7
7
  import { createTamaguiProvider } from "./helpers/createTamaguiProvider";
8
8
  import { getInsertedRules } from "./helpers/insertStyleRule";
9
9
  import { configureMedia } from "./hooks/useMedia";
@@ -29,6 +29,7 @@ function createTamagui(config) {
29
29
  });
30
30
  const themeConfig = (() => {
31
31
  var _a, _b, _c;
32
+ const themes = { ...config.themes };
32
33
  let cssRules = [];
33
34
  const varsByValue = /* @__PURE__ */ new Map();
34
35
  if (isWeb) {
@@ -61,39 +62,74 @@ function createTamagui(config) {
61
62
  }
62
63
  const hasDarkLight = "light" in config.themes && "dark" in config.themes;
63
64
  const CNP = `.${THEME_CLASSNAME_PREFIX}`;
64
- for (const themeName in config.themes) {
65
+ const existing = /* @__PURE__ */ new WeakMap();
66
+ const dedupedThemes = {};
67
+ for (const themeName in themes) {
68
+ const rawTheme = themes[themeName];
69
+ if (existing.has(rawTheme)) {
70
+ const e = existing.get(rawTheme);
71
+ e.names.push(themeName);
72
+ continue;
73
+ }
65
74
  const theme = { ...config.themes[themeName] };
66
- config.themes[themeName] = theme;
75
+ for (const key in theme) {
76
+ ensureThemeVariable(theme, key);
77
+ }
78
+ themes[themeName] = theme;
79
+ dedupedThemes[themeName] = {
80
+ names: [themeName],
81
+ theme
82
+ };
83
+ existing.set(theme, dedupedThemes[themeName]);
84
+ }
85
+ for (const themeName in dedupedThemes) {
86
+ const { theme, names } = dedupedThemes[themeName];
67
87
  let vars = "";
68
88
  for (const themeKey in theme) {
69
89
  if (isWeb) {
70
90
  const val = theme[themeKey];
71
- const varName = val instanceof Variable ? val.name : (_a = varsByValue[val]) == null ? void 0 : _a.name;
72
- vars += `--${themeKey}:${varName ? createCSSVariable(varName) : `${val}`};`;
91
+ let varName;
92
+ let varVal;
93
+ if (isVariable(val)) {
94
+ varName = val.key;
95
+ varVal = val.isFloating ? val.val : createCSSVariable(varName);
96
+ } else {
97
+ varName = (_a = varsByValue[val]) == null ? void 0 : _a.key;
98
+ varVal = varName ? createCSSVariable(varName) : `${val}`;
99
+ }
100
+ if (process.env.NODE_ENV === "development") {
101
+ if (!varName) {
102
+ console.warn("no var name in theme", themeName, themeKey);
103
+ continue;
104
+ }
105
+ }
106
+ vars += `--${themeKey}:${varVal};`;
73
107
  }
74
- ensureThemeVariable(theme, themeKey);
75
108
  }
76
109
  if (isWeb) {
77
110
  const isDarkOrLightBase = themeName === "dark" || themeName === "light";
78
111
  const isDark = themeName.startsWith("dark");
79
- const selector = `${CNP}${themeName}`;
80
- const selectors = [selector];
112
+ const selectors = names.map((name) => {
113
+ return `${CNP}${name}`;
114
+ });
81
115
  if (hasDarkLight) {
82
- const childSelector = `${CNP}${themeName.replace("dark_", "").replace("light_", "")}`;
83
- const order = isDark ? ["dark", "light"] : ["light", "dark"];
84
- if (isDarkOrLightBase) {
85
- order.reverse();
86
- }
87
- const [stronger, weaker] = order;
88
- const max = (_b = config.maxDarkLightNesting) != null ? _b : 3;
89
- new Array(max * 2).fill(void 0).forEach((_, pi) => {
90
- if (pi % 2 === 1)
91
- return;
92
- const parents = new Array(pi + 1).fill(void 0).map((_2, psi) => {
93
- return `${CNP}${psi % 2 === 0 ? stronger : weaker}`;
116
+ for (const subName of names) {
117
+ const childSelector = `${CNP}${subName.replace("dark_", "").replace("light_", "")}`;
118
+ const order = isDark ? ["dark", "light"] : ["light", "dark"];
119
+ if (isDarkOrLightBase) {
120
+ order.reverse();
121
+ }
122
+ const [stronger, weaker] = order;
123
+ const max = (_b = config.maxDarkLightNesting) != null ? _b : 3;
124
+ new Array(max * 2).fill(void 0).forEach((_, pi) => {
125
+ if (pi % 2 === 1)
126
+ return;
127
+ const parents = new Array(pi + 1).fill(void 0).map((_2, psi) => {
128
+ return `${CNP}${psi % 2 === 0 ? stronger : weaker}`;
129
+ });
130
+ selectors.push(`${(parents.length > 1 ? parents.slice(1) : parents).join(" ")} ${childSelector}`);
94
131
  });
95
- selectors.push(`${(parents.length > 1 ? parents.slice(1) : parents).join(" ")} ${childSelector}`);
96
- });
132
+ }
97
133
  }
98
134
  const rootSep = config.themeClassNameOnRoot ? "" : " ";
99
135
  cssRules.push(`${selectors.map((x) => `:root${rootSep}${x}`).join(", ")} {${vars}}`);
@@ -111,6 +147,7 @@ function createTamagui(config) {
111
147
  Object.freeze(cssRules);
112
148
  const css = cssRules.join("\n");
113
149
  return {
150
+ themes,
114
151
  cssRules,
115
152
  css
116
153
  };
@@ -154,10 +191,12 @@ ${getInsertedRules().join("\n")}`;
154
191
  shorthands: {},
155
192
  media: {},
156
193
  ...config,
194
+ themes: themeConfig.themes,
157
195
  Provider: createTamaguiProvider({
158
196
  getCSS,
159
197
  defaultTheme: "light",
160
- ...config
198
+ ...config,
199
+ themes: themeConfig.themes
161
200
  }),
162
201
  fontsParsed,
163
202
  themeConfig,
@@ -187,17 +226,19 @@ const parseTokens = /* @__PURE__ */ __name((tokens) => {
187
226
  }, "parseTokens");
188
227
  function ensureThemeVariable(theme, key) {
189
228
  const val = theme[key];
229
+ const themeKey = key;
190
230
  if (!isVariable(val)) {
191
231
  theme[key] = createVariable({
192
- key,
193
- name: key,
194
- val
232
+ key: themeKey,
233
+ name: themeKey,
234
+ val,
235
+ isFloating: true
195
236
  });
196
237
  } else {
197
- if (val.name !== key) {
238
+ if (val.name !== themeKey) {
198
239
  theme[key] = createVariable({
199
- key,
200
- name: key,
240
+ key: val.name,
241
+ name: themeKey,
201
242
  val: val.val
202
243
  });
203
244
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createTamagui.ts"],
4
- "sourcesContent": ["import { configListeners, getHasConfigured, setConfig } from './conf'\nimport { THEME_CLASSNAME_PREFIX } from './constants/constants'\nimport { isWeb } from './constants/platform'\nimport { Variable, createCSSVariable, createVariable, isVariable } from './createVariable'\nimport { createTamaguiProvider } from './helpers/createTamaguiProvider'\nimport { getInsertedRules } from './helpers/insertStyleRule'\nimport { configureMedia } from './hooks/useMedia'\nimport {\n AnimationDriver,\n CreateTamaguiConfig,\n GenericTamaguiConfig,\n MediaQueryKey,\n TamaguiInternalConfig,\n} from './types'\n\nexport type CreateTamaguiProps =\n // user then re-defines the types after createTamagui returns the typed object they want\n Partial<Omit<GenericTamaguiConfig, 'themes' | 'tokens' | 'animations'>> & {\n animations?: AnimationDriver<any>\n tokens: GenericTamaguiConfig['tokens']\n themes: {\n [key: string]: {\n [key: string]: string | number | Variable\n }\n }\n\n // for the first render, determines which media queries are true\n // useful for SSR\n mediaQueryDefaultActive?: MediaQueryKey[]\n\n // what's between each CSS style rule, set to \"\\n\" to be easier to read\n // defaults: \"\\n\" when NODE_ENV=development, \"\" otherwise\n cssStyleSeparator?: string\n\n // (Advanced)\n // on the web, tamagui treats `dark` and `light` themes as special and\n // generates extra CSS to avoid having to re-render the entire page.\n // this CSS relies on specificity hacks that multiply by your sub-themes.\n // this sets the maxiumum number of nested dark/light themes you can do\n // defaults to 3 for a balance, but can be higher if you nest them deeply.\n maxDarkLightNesting?: number\n\n // adds @media(prefers-color-scheme) media queries for dark/light\n shouldAddPrefersColorThemes?: boolean\n\n // only if you put the theme classname on the html element we have to generate diff\n themeClassNameOnRoot?: boolean\n }\n\n// config is re-run by the @tamagui/static, dont double validate\nconst createdConfigs = new WeakMap<any, boolean>()\n\nexport function createTamagui<Conf extends CreateTamaguiProps>(\n config: Conf\n): Conf extends Partial<CreateTamaguiConfig<infer A, infer B, infer C, infer D, infer E, infer F>>\n ? TamaguiInternalConfig<A, B, C, D, E, F>\n : unknown {\n if (createdConfigs.has(config)) {\n return config as any\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (!config.tokens) {\n throw new Error(`No tokens provided to Tamagui config`)\n }\n if (!config.themes) {\n throw new Error(`No themes provided to Tamagui config`)\n }\n }\n\n // test env loads a few times as it runs diff tests\n if (getHasConfigured()) {\n console.warn('Called createTamagui twice! Should never do so')\n // throw new Error(`#000 createTamagui called twice`)\n }\n\n configureMedia({\n queries: config.media as any,\n defaultActive: config.mediaQueryDefaultActive,\n })\n\n const themeConfig = (() => {\n let cssRules: string[] = []\n const varsByValue = new Map<string, Variable>()\n\n if (isWeb) {\n // tokens\n const tokenRules = new Set<string>()\n\n const addVar = (v: Variable) => {\n varsByValue[v.val] = v\n const rule = `--${createCSSVariable(v.name, false)}:${\n typeof v.val === 'number' ? `${v.val}px` : v.val\n }`\n tokenRules.add(rule)\n }\n\n for (const key in config.tokens) {\n for (const skey in config.tokens[key]) {\n const val = config.tokens[key][skey]\n if (key === 'font') {\n for (const fkey in val) {\n if (fkey === 'family') {\n addVar(val[fkey])\n } else {\n for (const fskey in val[fkey]) {\n addVar(val[fkey][fskey])\n }\n }\n }\n } else {\n addVar(val)\n }\n }\n }\n const sep = process.env.NODE_ENV === 'development' ? config.cssStyleSeparator || ' ' : ''\n cssRules.push(`:root {${sep}${[...tokenRules].join(`;${sep}`)}${sep}}`)\n }\n\n // special case for SSR\n const hasDarkLight = 'light' in config.themes && 'dark' in config.themes\n const CNP = `.${THEME_CLASSNAME_PREFIX}`\n\n // themes\n for (const themeName in config.themes) {\n // to allow using the same theme with diff names, be sure we don't mutate!\n const theme = { ...config.themes[themeName] }\n config.themes[themeName] = theme\n let vars = ''\n\n for (const themeKey in theme) {\n if (isWeb) {\n const val = theme[themeKey]\n // TODO sanity check is necessary\n const varName = val instanceof Variable ? val.name : varsByValue[val]?.name\n vars += `--${themeKey}:${varName ? createCSSVariable(varName) : `${val}`};`\n }\n // make sure properly names theme variables\n ensureThemeVariable(theme, themeKey)\n }\n\n if (isWeb) {\n const isDarkOrLightBase = themeName === 'dark' || themeName === 'light'\n const isDark = themeName.startsWith('dark')\n const selector = `${CNP}${themeName}`\n const selectors = [selector]\n\n // since we dont specify dark/light in classnames we have to do an awkward specificity war\n // use config.maxDarkLightNesting to determine how deep you can nest until it breaks\n if (hasDarkLight) {\n const childSelector = `${CNP}${themeName.replace('dark_', '').replace('light_', '')}`\n const order = isDark ? ['dark', 'light'] : ['light', 'dark']\n if (isDarkOrLightBase) {\n order.reverse()\n }\n const [stronger, weaker] = order\n const max = config.maxDarkLightNesting ?? 3\n new Array(max * 2).fill(undefined).forEach((_, pi) => {\n if (pi % 2 === 1) return\n const parents = new Array(pi + 1).fill(undefined).map((_, psi) => {\n return `${CNP}${psi % 2 === 0 ? stronger : weaker}`\n })\n selectors.push(\n `${(parents.length > 1 ? parents.slice(1) : parents).join(' ')} ${childSelector}`\n )\n })\n }\n\n const rootSep = config.themeClassNameOnRoot ? '' : ' '\n cssRules.push(`${selectors.map((x) => `:root${rootSep}${x}`).join(', ')} {${vars}}`)\n\n if (config.shouldAddPrefersColorThemes ?? true) {\n // add media prefers for dark/light base\n if (isDarkOrLightBase) {\n cssRules.push(\n `@media(prefers-color-scheme: ${isDark ? 'dark' : 'light'}) {\n body { background:${theme.background}; color: ${theme.color} }\n :root {${vars} } \n }`\n )\n }\n }\n }\n }\n\n varsByValue.clear()\n Object.freeze(cssRules)\n const css = cssRules.join('\\n')\n\n return {\n cssRules,\n css,\n }\n })()\n\n // faster lookups token keys become $keys to match input\n const tokensParsed: any = parseTokens(config.tokens)\n\n const fontsParsed = (() => {\n if (!config.fonts) {\n throw new Error(`No fonts defined!`)\n }\n const res = {} as typeof config.fonts\n for (const familyName in config.fonts) {\n const family = config.fonts[familyName]\n const parsed = {}\n for (const attrKey in family) {\n const attr = family[attrKey]\n if (attrKey === 'family') {\n parsed[attrKey] = attr\n continue\n }\n parsed[attrKey] = Object.keys(attr).reduce((acc, cur) => {\n acc[`$${cur}`] = attr[cur]\n return acc\n }, {})\n }\n res[`$${familyName}`] = parsed as any\n }\n return res!\n })()\n\n const getCSS = () => {\n return `${themeConfig.css}\\n${getInsertedRules().join('\\n')}`\n }\n\n if (config.shorthands) {\n for (const key in config.shorthands) {\n reversedShorthands[config.shorthands[key]] = key\n }\n }\n\n const next: TamaguiInternalConfig = {\n fonts: {},\n animations: {} as any,\n shorthands: {},\n media: {},\n ...config,\n Provider: createTamaguiProvider({\n getCSS,\n defaultTheme: 'light',\n ...config,\n }),\n fontsParsed,\n themeConfig,\n tokensParsed,\n parsed: true,\n getCSS,\n }\n\n setConfig(next)\n\n if (configListeners.size) {\n configListeners.forEach((cb) => cb(next))\n configListeners.clear()\n }\n\n createdConfigs.set(next, true)\n\n // @ts-expect-error\n return next\n}\n\nexport const reversedShorthands: Record<string, string> = {}\n\nconst parseTokens = (tokens: any) => {\n const res: any = {}\n for (const key in tokens) {\n res[key] = {}\n for (const skey in tokens[key]) {\n res[key][`$${skey}`] = tokens[key][skey]\n }\n }\n return res\n}\n\n// mutates, freeze after\n// shared by createTamagui so extracted here\nfunction ensureThemeVariable(theme: any, key: string) {\n const val = theme[key]\n if (!isVariable(val)) {\n theme[key] = createVariable({\n key,\n name: key,\n val,\n })\n } else {\n if (val.name !== key) {\n // rename to theme name\n theme[key] = createVariable({\n key,\n name: key,\n val: val.val,\n })\n }\n }\n}\n\n// for quick testing types:\n// const x = createTamagui({\n// shorthands: {},\n// media: {},\n// themes: {},\n// tokens: {\n// font: {},\n// color: {},\n// radius: {},\n// size: {},\n// space: {},\n// zIndex: {},\n// },\n// })\n"],
5
- "mappings": ";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AA4CA,MAAM,iBAAiB,oBAAI,QAAsB;AAE1C,uBACL,QAGU;AACV,MAAI,eAAe,IAAI,MAAM,GAAG;AAC9B,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,OAAO,QAAQ;AAClB,YAAM,IAAI,MAAM,sCAAsC;AAAA,IACxD;AACA,QAAI,CAAC,OAAO,QAAQ;AAClB,YAAM,IAAI,MAAM,sCAAsC;AAAA,IACxD;AAAA,EACF;AAGA,MAAI,iBAAiB,GAAG;AACtB,YAAQ,KAAK,gDAAgD;AAAA,EAE/D;AAEA,iBAAe;AAAA,IACb,SAAS,OAAO;AAAA,IAChB,eAAe,OAAO;AAAA,EACxB,CAAC;AAED,QAAM,cAAe,OAAM;AAjF7B;AAkFI,QAAI,WAAqB,CAAC;AAC1B,UAAM,cAAc,oBAAI,IAAsB;AAE9C,QAAI,OAAO;AAET,YAAM,aAAa,oBAAI,IAAY;AAEnC,YAAM,SAAS,wBAAC,MAAgB;AAC9B,oBAAY,EAAE,OAAO;AACrB,cAAM,OAAO,KAAK,kBAAkB,EAAE,MAAM,KAAK,KAC/C,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;AAmNT,MAAM,qBAA6C,CAAC;AAE3D,MAAM,cAAc,wBAAC,WAAgB;AACnC,QAAM,MAAW,CAAC;AAClB,aAAW,OAAO,QAAQ;AACxB,QAAI,OAAO,CAAC;AACZ,eAAW,QAAQ,OAAO,MAAM;AAC9B,UAAI,KAAK,IAAI,UAAU,OAAO,KAAK;AAAA,IACrC;AAAA,EACF;AACA,SAAO;AACT,GAToB;AAapB,6BAA6B,OAAY,KAAa;AACpD,QAAM,MAAM,MAAM;AAClB,MAAI,CAAC,WAAW,GAAG,GAAG;AACpB,UAAM,OAAO,eAAe;AAAA,MAC1B;AAAA,MACA,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,QAAI,IAAI,SAAS,KAAK;AAEpB,YAAM,OAAO,eAAe;AAAA,QAC1B;AAAA,QACA,MAAM;AAAA,QACN,KAAK,IAAI;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAlBS;",
4
+ "sourcesContent": ["import { configListeners, getHasConfigured, setConfig } from './conf'\nimport { THEME_CLASSNAME_PREFIX } from './constants/constants'\nimport { isWeb } from './constants/platform'\nimport { Variable, createCSSVariable, createVariable, isVariable } from './createVariable'\nimport { createTamaguiProvider } from './helpers/createTamaguiProvider'\nimport { getInsertedRules } from './helpers/insertStyleRule'\nimport { configureMedia } from './hooks/useMedia'\nimport {\n AnimationDriver,\n CreateTamaguiConfig,\n GenericTamaguiConfig,\n MediaQueryKey,\n TamaguiInternalConfig,\n ThemeObject,\n} from './types'\n\nexport type CreateTamaguiProps =\n // user then re-defines the types after createTamagui returns the typed object they want\n Partial<Omit<GenericTamaguiConfig, 'themes' | 'tokens' | 'animations'>> & {\n animations?: AnimationDriver<any>\n tokens: GenericTamaguiConfig['tokens']\n themes: {\n [key: string]: {\n [key: string]: string | number | Variable\n }\n }\n\n // for the first render, determines which media queries are true\n // useful for SSR\n mediaQueryDefaultActive?: MediaQueryKey[]\n\n // what's between each CSS style rule, set to \"\\n\" to be easier to read\n // defaults: \"\\n\" when NODE_ENV=development, \"\" otherwise\n cssStyleSeparator?: string\n\n // (Advanced)\n // on the web, tamagui treats `dark` and `light` themes as special and\n // generates extra CSS to avoid having to re-render the entire page.\n // this CSS relies on specificity hacks that multiply by your sub-themes.\n // this sets the maxiumum number of nested dark/light themes you can do\n // defaults to 3 for a balance, but can be higher if you nest them deeply.\n maxDarkLightNesting?: number\n\n // adds @media(prefers-color-scheme) media queries for dark/light\n shouldAddPrefersColorThemes?: boolean\n\n // only if you put the theme classname on the html element we have to generate diff\n themeClassNameOnRoot?: boolean\n }\n\n// config is re-run by the @tamagui/static, dont double validate\nconst createdConfigs = new WeakMap<any, boolean>()\n\nexport function createTamagui<Conf extends CreateTamaguiProps>(\n config: Conf\n): Conf extends Partial<CreateTamaguiConfig<infer A, infer B, infer C, infer D, infer E, infer F>>\n ? TamaguiInternalConfig<A, B, C, D, E, F>\n : unknown {\n if (createdConfigs.has(config)) {\n return config as any\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (!config.tokens) {\n throw new Error(`No tokens provided to Tamagui config`)\n }\n if (!config.themes) {\n throw new Error(`No themes provided to Tamagui config`)\n }\n }\n\n // test env loads a few times as it runs diff tests\n if (getHasConfigured()) {\n console.warn('Called createTamagui twice! Should never do so')\n // throw new Error(`#000 createTamagui called twice`)\n }\n\n configureMedia({\n queries: config.media as any,\n defaultActive: config.mediaQueryDefaultActive,\n })\n\n const themeConfig = (() => {\n const themes = { ...config.themes }\n let cssRules: string[] = []\n const varsByValue = new Map<string, Variable>()\n\n if (isWeb) {\n // tokens\n const tokenRules = new Set<string>()\n\n const addVar = (v: Variable) => {\n varsByValue[v.val] = v\n const rule = `--${createCSSVariable(v.name, false)}:${\n typeof v.val === 'number' ? `${v.val}px` : v.val\n }`\n tokenRules.add(rule)\n }\n\n for (const key in config.tokens) {\n for (const skey in config.tokens[key]) {\n const val = config.tokens[key][skey]\n if (key === 'font') {\n for (const fkey in val) {\n if (fkey === 'family') {\n addVar(val[fkey])\n } else {\n for (const fskey in val[fkey]) {\n addVar(val[fkey][fskey])\n }\n }\n }\n } else {\n addVar(val)\n }\n }\n }\n const sep = process.env.NODE_ENV === 'development' ? config.cssStyleSeparator || ' ' : ''\n cssRules.push(`:root {${sep}${[...tokenRules].join(`;${sep}`)}${sep}}`)\n }\n\n // special case for SSR\n const hasDarkLight = 'light' in config.themes && 'dark' in config.themes\n const CNP = `.${THEME_CLASSNAME_PREFIX}`\n\n // dedupe themes to avoid duplicate CSS generation\n const existing = new WeakMap()\n const dedupedThemes: {\n [key: string]: {\n names: string[]\n theme: ThemeObject\n }\n } = {}\n\n // first, de-dupe and parse them\n for (const themeName in themes) {\n const rawTheme = themes[themeName]\n\n // if existing, avoid\n if (existing.has(rawTheme)) {\n const e = existing.get(rawTheme)\n e.names.push(themeName)\n continue\n }\n\n // parse into variables\n const theme = { ...config.themes[themeName] }\n for (const key in theme) {\n // make sure properly names theme variables\n ensureThemeVariable(theme, key)\n }\n themes[themeName] = theme\n\n // set deduped\n dedupedThemes[themeName] = {\n names: [themeName],\n theme,\n }\n existing.set(theme, dedupedThemes[themeName])\n }\n\n // then, generate from de-duped\n for (const themeName in dedupedThemes) {\n const { theme, names } = dedupedThemes[themeName]\n let vars = ''\n\n for (const themeKey in theme) {\n if (isWeb) {\n const val = theme[themeKey]\n let varName: string\n let varVal: string\n\n if (isVariable(val)) {\n varName = val.key\n varVal = val.isFloating ? val.val : createCSSVariable(varName)\n } else {\n varName = varsByValue[val]?.key\n varVal = varName ? createCSSVariable(varName) : `${val}`\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (!varName) {\n console.warn('no var name in theme', themeName, themeKey)\n continue\n }\n }\n\n vars += `--${themeKey}:${varVal};`\n }\n }\n\n if (isWeb) {\n const isDarkOrLightBase = themeName === 'dark' || themeName === 'light'\n const isDark = themeName.startsWith('dark')\n const selectors = names.map((name) => {\n return `${CNP}${name}`\n })\n\n // since we dont specify dark/light in classnames we have to do an awkward specificity war\n // use config.maxDarkLightNesting to determine how deep you can nest until it breaks\n if (hasDarkLight) {\n for (const subName of names) {\n const childSelector = `${CNP}${subName.replace('dark_', '').replace('light_', '')}`\n const order = isDark ? ['dark', 'light'] : ['light', 'dark']\n if (isDarkOrLightBase) {\n order.reverse()\n }\n const [stronger, weaker] = order\n const max = config.maxDarkLightNesting ?? 3\n new Array(max * 2).fill(undefined).forEach((_, pi) => {\n if (pi % 2 === 1) return\n const parents = new Array(pi + 1).fill(undefined).map((_, psi) => {\n return `${CNP}${psi % 2 === 0 ? stronger : weaker}`\n })\n selectors.push(\n `${(parents.length > 1 ? parents.slice(1) : parents).join(' ')} ${childSelector}`\n )\n })\n }\n }\n\n const rootSep = config.themeClassNameOnRoot ? '' : ' '\n cssRules.push(`${selectors.map((x) => `:root${rootSep}${x}`).join(', ')} {${vars}}`)\n\n if (config.shouldAddPrefersColorThemes ?? true) {\n // add media prefers for dark/light base\n if (isDarkOrLightBase) {\n cssRules.push(\n `@media(prefers-color-scheme: ${isDark ? 'dark' : 'light'}) {\n body { background:${theme.background}; color: ${theme.color} }\n :root {${vars} } \n }`\n )\n }\n }\n }\n }\n\n varsByValue.clear()\n Object.freeze(cssRules)\n const css = cssRules.join('\\n')\n\n return {\n themes,\n cssRules,\n css,\n }\n })()\n\n // faster lookups token keys become $keys to match input\n const tokensParsed: any = parseTokens(config.tokens)\n\n const fontsParsed = (() => {\n if (!config.fonts) {\n throw new Error(`No fonts defined!`)\n }\n const res = {} as typeof config.fonts\n for (const familyName in config.fonts) {\n const family = config.fonts[familyName]\n const parsed = {}\n for (const attrKey in family) {\n const attr = family[attrKey]\n if (attrKey === 'family') {\n parsed[attrKey] = attr\n continue\n }\n parsed[attrKey] = Object.keys(attr).reduce((acc, cur) => {\n acc[`$${cur}`] = attr[cur]\n return acc\n }, {})\n }\n res[`$${familyName}`] = parsed as any\n }\n return res!\n })()\n\n const getCSS = () => {\n return `${themeConfig.css}\\n${getInsertedRules().join('\\n')}`\n }\n\n if (config.shorthands) {\n for (const key in config.shorthands) {\n reversedShorthands[config.shorthands[key]] = key\n }\n }\n\n const next: TamaguiInternalConfig = {\n fonts: {},\n animations: {} as any,\n shorthands: {},\n media: {},\n ...config,\n themes: themeConfig.themes,\n Provider: createTamaguiProvider({\n getCSS,\n defaultTheme: 'light',\n ...config,\n themes: themeConfig.themes,\n }),\n fontsParsed,\n themeConfig,\n tokensParsed,\n parsed: true,\n getCSS,\n }\n\n setConfig(next)\n\n if (configListeners.size) {\n configListeners.forEach((cb) => cb(next))\n configListeners.clear()\n }\n\n createdConfigs.set(next, true)\n\n // @ts-expect-error\n return next\n}\n\nexport const reversedShorthands: Record<string, string> = {}\n\nconst parseTokens = (tokens: any) => {\n const res: any = {}\n for (const key in tokens) {\n res[key] = {}\n for (const skey in tokens[key]) {\n res[key][`$${skey}`] = tokens[key][skey]\n }\n }\n return res\n}\n\n// mutates, freeze after\n// shared by createTamagui so extracted here\nfunction ensureThemeVariable(theme: any, key: string) {\n const val = theme[key]\n const themeKey = key\n if (!isVariable(val)) {\n theme[key] = createVariable({\n key: themeKey,\n name: themeKey,\n val,\n isFloating: true,\n })\n } else {\n if (val.name !== themeKey) {\n // rename to theme name\n theme[key] = createVariable({\n key: val.name,\n name: themeKey,\n val: val.val,\n })\n }\n }\n}\n\n// for quick testing types:\n// const x = createTamagui({\n// shorthands: {},\n// media: {},\n// themes: {},\n// tokens: {\n// font: {},\n// color: {},\n// radius: {},\n// size: {},\n// space: {},\n// zIndex: {},\n// },\n// })\n"],
5
+ "mappings": ";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AA6CA,MAAM,iBAAiB,oBAAI,QAAsB;AAE1C,uBACL,QAGU;AACV,MAAI,eAAe,IAAI,MAAM,GAAG;AAC9B,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,OAAO,QAAQ;AAClB,YAAM,IAAI,MAAM,sCAAsC;AAAA,IACxD;AACA,QAAI,CAA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CAAC;AACxC,oBAAgB,MAAM;AAAA,EACxB;AAEA,iBAAe,IAAI,MAAM,IAAI;AAG7B,SAAO;AACT;AAxQgB;AA0QT,MAAM,qBAA6C,CAAC;AAE3D,MAAM,cAAc,wBAAC,WAAgB;AACnC,QAAM,MAAW,CAAC;AAClB,aAAW,OAAO,QAAQ;AACxB,QAAI,OAAO,CAAC;AACZ,eAAW,QAAQ,OAAO,MAAM;AAC9B,UAAI,KAAK,IAAI,UAAU,OAAO,KAAK;AAAA,IACrC;AAAA,EACF;AACA,SAAO;AACT,GAToB;AAapB,6BAA6B,OAAY,KAAa;AACpD,QAAM,MAAM,MAAM;AAClB,QAAM,WAAW;AACjB,MAAI,CAAC,WAAW,GAAG,GAAG;AACpB,UAAM,OAAO,eAAe;AAAA,MAC1B,KAAK;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,YAAY;AAAA,IACd,CAAC;AAAA,EACH,OAAO;AACL,QAAI,IAAI,SAAS,UAAU;AAEzB,YAAM,OAAO,eAAe;AAAA,QAC1B,KAAK,IAAI;AAAA,QACT,MAAM;AAAA,QACN,KAAK,IAAI;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AACF;AApBS;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,8 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const createTheme = /* @__PURE__ */ __name((theme) => theme, "createTheme");
3
+ const createTheme = /* @__PURE__ */ __name((theme) => {
4
+ return theme;
5
+ }, "createTheme");
4
6
  export {
5
7
  createTheme
6
8
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/createTheme.ts"],
4
- "sourcesContent": ["import { Variable } from './createVariable'\n\ntype GenericTheme = { [key: string]: string | Variable }\n\nexport const createTheme = <Theme extends GenericTheme>(\n theme: Theme\n): {\n [K in keyof Theme]: Theme[K] | string | Variable\n} => theme\n"],
5
- "mappings": ";;AAIO,MAAM,cAAc,wBACzB,UAGG,OAJsB;",
4
+ "sourcesContent": ["import { Variable } from './createVariable'\n\ntype GenericTheme = { [key: string]: string | Variable }\n\nexport const createTheme = <Theme extends GenericTheme>(\n theme: Theme\n): {\n [K in keyof Theme]: Theme[K] | string | Variable\n} => {\n return theme\n}\n"],
5
+ "mappings": ";;AAIO,MAAM,cAAc,wBACzB,UAGG;AACH,SAAO;AACT,GAN2B;",
6
6
  "names": []
7
7
  }
@@ -1,29 +1,15 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- import { createVariable } from "./createVariable";
3
+ import { createVariables } from "./createVariables";
4
4
  import { validateTokens } from "./helpers/validate";
5
5
  function createTokens(tokens) {
6
6
  if (process.env.NODE_ENV === "development") {
7
7
  validateTokens(tokens);
8
8
  }
9
- return mapTokensToVariables(tokens);
9
+ return createVariables(tokens);
10
10
  }
11
11
  __name(createTokens, "createTokens");
12
- const mapTokensToVariables = /* @__PURE__ */ __name((tokens, parentPath = "") => {
13
- const res = {};
14
- for (const key in tokens) {
15
- let val = tokens[key];
16
- const name = parentPath ? `${parentPath}-${key}` : key;
17
- if (val && typeof val === "object") {
18
- res[key] = mapTokensToVariables(tokens[key], name);
19
- } else {
20
- res[key] = createVariable({ val, name, key });
21
- }
22
- }
23
- return res;
24
- }, "mapTokensToVariables");
25
12
  export {
26
- createTokens,
27
- mapTokensToVariables
13
+ createTokens
28
14
  };
29
15
  //# sourceMappingURL=createTokens.js.map