@tamagui/web 3.0.18 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Tamagui.cjs +2 -1
- package/dist/cjs/Tamagui.native.cjs +2 -1
- package/dist/cjs/Tamagui.native.js +2 -1
- package/dist/cjs/Tamagui.native.js.map +1 -1
- package/dist/cjs/_withStableStyle.cjs +2 -1
- package/dist/cjs/_withStableStyle.native.cjs +2 -1
- package/dist/cjs/_withStableStyle.native.js +2 -1
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.cjs +8 -7
- package/dist/cjs/config.native.cjs +8 -7
- package/dist/cjs/config.native.js +8 -7
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants/constants.cjs +2 -1
- package/dist/cjs/constants/constants.native.cjs +2 -1
- package/dist/cjs/constants/constants.native.js +2 -1
- package/dist/cjs/constants/constants.native.js.map +1 -1
- package/dist/cjs/constants/isDevTools.cjs +2 -1
- package/dist/cjs/constants/isDevTools.native.cjs +2 -1
- package/dist/cjs/constants/isDevTools.native.js +2 -1
- package/dist/cjs/constants/isDevTools.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +40 -39
- package/dist/cjs/createComponent.native.cjs +40 -39
- package/dist/cjs/createComponent.native.js +40 -39
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +2 -1
- package/dist/cjs/createTamagui.native.cjs +2 -1
- package/dist/cjs/createTamagui.native.js +2 -1
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/createTokens.cjs +2 -1
- package/dist/cjs/createTokens.native.cjs +2 -1
- package/dist/cjs/createTokens.native.js +2 -1
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.cjs +2 -1
- package/dist/cjs/createVariable.native.cjs +2 -1
- package/dist/cjs/createVariable.native.js +2 -1
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +3 -2
- package/dist/cjs/helpers/createDesignSystem.native.cjs +2 -1
- package/dist/cjs/helpers/createDesignSystem.native.js +2 -1
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/formatDiagnostic.cjs +2 -1
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -1
- package/dist/cjs/helpers/formatDiagnostic.native.js +2 -1
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +37 -36
- package/dist/cjs/helpers/getSplitStyles.native.cjs +40 -39
- package/dist/cjs/helpers/getSplitStyles.native.js +40 -39
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +4 -3
- package/dist/cjs/helpers/insertStyleRule.cjs +4 -3
- package/dist/cjs/helpers/insertStyleRule.native.cjs +4 -3
- package/dist/cjs/helpers/insertStyleRule.native.js +4 -3
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +2 -1
- package/dist/cjs/helpers/log.native.cjs +2 -1
- package/dist/cjs/helpers/log.native.js +2 -1
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.cjs +3 -2
- package/dist/cjs/helpers/matchMedia.native.js +3 -2
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/noteOnce.cjs +2 -1
- package/dist/cjs/helpers/noteOnce.native.cjs +2 -1
- package/dist/cjs/helpers/noteOnce.native.js +2 -1
- package/dist/cjs/helpers/noteOnce.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeAreaVariable.native.cjs +2 -1
- package/dist/cjs/helpers/resolveSafeAreaVariable.native.js +2 -1
- package/dist/cjs/helpers/resolveSafeAreaVariable.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSizing.cjs +2 -1
- package/dist/cjs/helpers/resolveSizing.native.cjs +2 -1
- package/dist/cjs/helpers/resolveSizing.native.js +2 -1
- package/dist/cjs/helpers/resolveSizing.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +3 -2
- package/dist/cjs/helpers/skipProps.native.cjs +3 -2
- package/dist/cjs/helpers/skipProps.native.js +3 -2
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/styledDynamic.cjs +2 -1
- package/dist/cjs/helpers/styledDynamic.native.cjs +2 -1
- package/dist/cjs/helpers/styledDynamic.native.js +2 -1
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -1
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +2 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +2 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +2 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/variableValue.cjs +2 -1
- package/dist/cjs/helpers/variableValue.native.cjs +2 -1
- package/dist/cjs/helpers/variableValue.native.js +2 -1
- package/dist/cjs/helpers/variableValue.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +5 -4
- package/dist/cjs/helpers/variables.native.cjs +5 -4
- package/dist/cjs/helpers/variables.native.js +5 -4
- package/dist/cjs/helpers/variables.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +4 -3
- package/dist/cjs/helpers/warnOnce.native.cjs +4 -3
- package/dist/cjs/helpers/warnOnce.native.js +4 -3
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.cjs +2 -1
- package/dist/cjs/hooks/getThemeProxied.native.cjs +5 -4
- package/dist/cjs/hooks/getThemeProxied.native.js +5 -4
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/useAnimationDriver.cjs +3 -2
- package/dist/cjs/hooks/useAnimationDriver.native.cjs +3 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js +3 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +3 -2
- package/dist/cjs/hooks/useMedia.native.cjs +3 -2
- package/dist/cjs/hooks/useMedia.native.js +3 -2
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs +2 -1
- package/dist/cjs/hooks/useTheme.native.cjs +2 -1
- package/dist/cjs/hooks/useTheme.native.js +2 -1
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +2 -1
- package/dist/cjs/hooks/useThemeState.native.cjs +2 -1
- package/dist/cjs/hooks/useThemeState.native.js +2 -1
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/style.cjs +2 -1
- package/dist/cjs/style.native.cjs +2 -1
- package/dist/cjs/style.native.js +2 -1
- package/dist/cjs/style.native.js.map +1 -1
- package/dist/cjs/styled.cjs +3 -2
- package/dist/cjs/styled.native.cjs +2 -1
- package/dist/cjs/styled.native.js +2 -1
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +2 -1
- package/dist/cjs/views/TamaguiProvider.native.cjs +2 -1
- package/dist/cjs/views/TamaguiProvider.native.js +2 -1
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +5 -4
- package/dist/cjs/views/Theme.native.cjs +5 -4
- package/dist/cjs/views/Theme.native.js +5 -4
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +3 -2
- package/dist/esm/Tamagui.mjs +2 -1
- package/dist/esm/Tamagui.mjs.map +1 -1
- package/dist/esm/Tamagui.native.js +2 -1
- package/dist/esm/Tamagui.native.js.map +1 -1
- package/dist/esm/_withStableStyle.mjs +2 -1
- package/dist/esm/_withStableStyle.mjs.map +1 -1
- package/dist/esm/_withStableStyle.native.js +2 -1
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.mjs +8 -7
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +8 -7
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/constants.mjs +2 -1
- package/dist/esm/constants/constants.mjs.map +1 -1
- package/dist/esm/constants/constants.native.js +2 -1
- package/dist/esm/constants/constants.native.js.map +1 -1
- package/dist/esm/constants/isDevTools.mjs +2 -1
- package/dist/esm/constants/isDevTools.mjs.map +1 -1
- package/dist/esm/constants/isDevTools.native.js +2 -1
- package/dist/esm/constants/isDevTools.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +40 -39
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +40 -39
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +2 -1
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +2 -1
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTokens.mjs +2 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js +2 -1
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.mjs +2 -1
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.native.js +2 -1
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +3 -2
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +2 -1
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +2 -1
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +2 -1
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +37 -36
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +40 -39
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +4 -3
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +4 -3
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +4 -3
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +2 -1
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +2 -1
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/matchMedia.native.js +3 -2
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/noteOnce.mjs +2 -1
- package/dist/esm/helpers/noteOnce.mjs.map +1 -1
- package/dist/esm/helpers/noteOnce.native.js +2 -1
- package/dist/esm/helpers/noteOnce.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeAreaVariable.native.js +2 -1
- package/dist/esm/helpers/resolveSafeAreaVariable.native.js.map +1 -1
- package/dist/esm/helpers/resolveSizing.mjs +2 -1
- package/dist/esm/helpers/resolveSizing.mjs.map +1 -1
- package/dist/esm/helpers/resolveSizing.native.js +2 -1
- package/dist/esm/helpers/resolveSizing.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +3 -2
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +3 -2
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styledDynamic.mjs +2 -1
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -1
- package/dist/esm/helpers/styledDynamic.native.js +2 -1
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs +2 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +2 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/variableValue.mjs +2 -1
- package/dist/esm/helpers/variableValue.mjs.map +1 -1
- package/dist/esm/helpers/variableValue.native.js +2 -1
- package/dist/esm/helpers/variableValue.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +5 -4
- package/dist/esm/helpers/variables.mjs.map +1 -1
- package/dist/esm/helpers/variables.native.js +5 -4
- package/dist/esm/helpers/variables.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +4 -3
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +4 -3
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +2 -1
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +5 -4
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.mjs +3 -2
- package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.native.js +3 -2
- package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +3 -2
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +3 -2
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs +2 -1
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +2 -1
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +2 -1
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +2 -1
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/style.mjs +2 -1
- package/dist/esm/style.mjs.map +1 -1
- package/dist/esm/style.native.js +2 -1
- package/dist/esm/style.native.js.map +1 -1
- package/dist/esm/styled.mjs +3 -2
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +2 -1
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +2 -1
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +2 -1
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +5 -4
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +5 -4
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +3 -2
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/package.json +20 -20
- package/src/Tamagui.ts +3 -1
- package/src/_withStableStyle.tsx +3 -1
- package/src/config.ts +9 -6
- package/src/constants/constants.ts +3 -1
- package/src/constants/isDevTools.ts +2 -1
- package/src/createComponent.tsx +61 -42
- package/src/createTamagui.ts +3 -1
- package/src/createTokens.ts +3 -1
- package/src/createVariable.ts +3 -1
- package/src/helpers/createDesignSystem.ts +4 -2
- package/src/helpers/formatDiagnostic.ts +2 -1
- package/src/helpers/getSplitStyles.tsx +56 -29
- package/src/helpers/getThemeCSSRules.ts +5 -3
- package/src/helpers/insertStyleRule.tsx +5 -3
- package/src/helpers/log.ts +3 -1
- package/src/helpers/matchMedia.native.ts +4 -2
- package/src/helpers/noteOnce.ts +2 -1
- package/src/helpers/resolveSafeAreaVariable.native.ts +3 -1
- package/src/helpers/resolveSizing.ts +3 -1
- package/src/helpers/skipProps.ts +4 -2
- package/src/helpers/styledDynamic.ts +3 -1
- package/src/helpers/subscribeToContextGroup.tsx +3 -1
- package/src/helpers/variableValue.ts +3 -1
- package/src/helpers/variables.ts +6 -4
- package/src/helpers/warnOnce.ts +4 -3
- package/src/hooks/getThemeProxied.ts +14 -4
- package/src/hooks/useAnimationDriver.ts +4 -2
- package/src/hooks/useMedia.tsx +4 -2
- package/src/hooks/useTheme.tsx +3 -1
- package/src/hooks/useThemeState.ts +3 -1
- package/src/index.ts +1 -0
- package/src/style.ts +3 -1
- package/src/styled.tsx +14 -26
- package/src/views/TamaguiProvider.tsx +4 -1
- package/src/views/Theme.tsx +6 -4
- package/src/views/ThemeDebug.tsx +8 -2
- package/types/Tamagui.d.ts.map +1 -1
- package/types/_withStableStyle.d.ts.map +1 -1
- package/types/config.d.ts.map +1 -1
- package/types/constants/constants.d.ts.map +1 -1
- package/types/constants/isDevTools.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariable.d.ts.map +1 -1
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/formatDiagnostic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/log.d.ts.map +1 -1
- package/types/helpers/matchMedia.native.d.ts.map +1 -1
- package/types/helpers/noteOnce.d.ts.map +1 -1
- package/types/helpers/resolveSafeAreaVariable.native.d.ts.map +1 -1
- package/types/helpers/resolveSizing.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/styledDynamic.d.ts.map +1 -1
- package/types/helpers/subscribeToContextGroup.d.ts.map +1 -1
- package/types/helpers/variableValue.d.ts.map +1 -1
- package/types/helpers/variables.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/hooks/getThemeProxied.d.ts.map +1 -1
- package/types/hooks/useAnimationDriver.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/style.d.ts.map +1 -1
- package/types/styled.d.ts +1 -2
- package/types/styled.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts.map +1 -1
package/dist/esm/style.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":[],"sources":["esm/style.js"],"sourcesContent":["import React from \"react\";\nimport { stylePieceSymbol } from \"./types\";\nimport { warnOnce } from \"./helpers/warnOnce\";\nlet compileStylePiece;\nlet resolveStylePiece;\nconst uncacheablePieces = /* @__PURE__ */ new WeakSet();\nconst flatClausePattern = /(?:^|\\s)@?[A-Za-z][A-Za-z0-9-]*(?:\\/[A-Za-z0-9_-]+)?:/;\nfunction setStylePieceCompiler(compiler) {\n compileStylePiece = compiler;\n}\nfunction setStylePieceResolver(resolver) {\n resolveStylePiece = resolver;\n}\nfunction isStylePiece(value) {\n return !!value && typeof value === \"object\" && stylePieceSymbol in value;\n}\nfunction isStylePieceCacheable(piece) {\n return !uncacheablePieces.has(piece);\n}\nfunction canCacheByTheme(definition) {\n for (const key in definition) {\n const value = definition[key];\n if (typeof value === \"string\" && flatClausePattern.test(value) || value && typeof value === \"object\") {\n return false;\n }\n }\n return true;\n}\nfunction createStylePiece(definition, layer = \"style\") {\n const piece = {\n className: \"\",\n [stylePieceSymbol]: {\n byKey: {},\n styleObject: definition\n }\n };\n if (!canCacheByTheme(definition)) {\n uncacheablePieces.add(piece);\n }\n compileStylePiece?.(piece, layer);\n return piece;\n}\nfunction style(definition) {\n if (process.env.NODE_ENV === \"development\") {\n const internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n if (internals?.A?.getOwner?.()) {\n warnOnce(\n \"[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.\"\n );\n }\n }\n return createStylePiece(definition);\n}\nfunction resolveStylePieceForTheme(piece, theme, themeName) {\n return resolveStylePiece ? resolveStylePiece(piece, theme, themeName) : piece[stylePieceSymbol].styleObject;\n}\nexport {\n createStylePiece,\n isStylePiece,\n isStylePieceCacheable,\n resolveStylePieceForTheme,\n setStylePieceCompiler,\n setStylePieceResolver,\n style\n};\n//# sourceMappingURL=style.js.map\n"],"mappings":";;;;;AAGA,IAAI;AACJ,IAAI;AACJ,MAAM,oCAAoC,IAAI,QAAQ;AACtD,MAAM,oBAAoB;AAC1B,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,oBAAoB;AACrE;AACA,SAAS,sBAAsB,OAAO;CACpC,OAAO,CAAC,kBAAkB,IAAI,KAAK;AACrC;AACA,SAAS,gBAAgB,YAAY;CACnC,KAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,QAAQ,WAAW;EACzB,IAAI,OAAO,UAAU,YAAY,kBAAkB,KAAK,KAAK,KAAK,SAAS,OAAO,UAAU,UAAU;GACpG,OAAO;EACT;CACF;CACA,OAAO;AACT;AACA,SAAS,iBAAiB,YAAY,QAAQ,SAAS;CACrD,MAAM,QAAQ;EACZ,WAAW;GACV,mBAAmB;GAClB,OAAO,CAAC;GACR,aAAa;EACf;CACF;CACA,IAAI,CAAC,gBAAgB,UAAU,GAAG;EAChC,kBAAkB,IAAI,KAAK;CAC7B;CACA,oBAAoB,OAAO,KAAK;CAChC,OAAO;AACT;AACA,SAAS,MAAM,YAAY;CACzB,IAAI,QAAQ,IAAI,aAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["esm/style.js"],"sourcesContent":["import React from \"react\";\nimport { stylePieceSymbol } from \"./types\";\nimport { warnOnce } from \"./helpers/warnOnce\";\nconst isProd = process.env.NODE_ENV === \"production\";\nlet compileStylePiece;\nlet resolveStylePiece;\nconst uncacheablePieces = /* @__PURE__ */ new WeakSet();\nconst flatClausePattern = /(?:^|\\s)@?[A-Za-z][A-Za-z0-9-]*(?:\\/[A-Za-z0-9_-]+)?:/;\nfunction setStylePieceCompiler(compiler) {\n compileStylePiece = compiler;\n}\nfunction setStylePieceResolver(resolver) {\n resolveStylePiece = resolver;\n}\nfunction isStylePiece(value) {\n return !!value && typeof value === \"object\" && stylePieceSymbol in value;\n}\nfunction isStylePieceCacheable(piece) {\n return !uncacheablePieces.has(piece);\n}\nfunction canCacheByTheme(definition) {\n for (const key in definition) {\n const value = definition[key];\n if (typeof value === \"string\" && flatClausePattern.test(value) || value && typeof value === \"object\") {\n return false;\n }\n }\n return true;\n}\nfunction createStylePiece(definition, layer = \"style\") {\n const piece = {\n className: \"\",\n [stylePieceSymbol]: {\n byKey: {},\n styleObject: definition\n }\n };\n if (!canCacheByTheme(definition)) {\n uncacheablePieces.add(piece);\n }\n compileStylePiece?.(piece, layer);\n return piece;\n}\nfunction style(definition) {\n if (!isProd && process.env.NODE_ENV === \"development\") {\n const internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n if (internals?.A?.getOwner?.()) {\n warnOnce(\n \"[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.\"\n );\n }\n }\n return createStylePiece(definition);\n}\nfunction resolveStylePieceForTheme(piece, theme, themeName) {\n return resolveStylePiece ? resolveStylePiece(piece, theme, themeName) : piece[stylePieceSymbol].styleObject;\n}\nexport {\n createStylePiece,\n isStylePiece,\n isStylePieceCacheable,\n resolveStylePieceForTheme,\n setStylePieceCompiler,\n setStylePieceResolver,\n style\n};\n//# sourceMappingURL=style.js.map\n"],"mappings":";;;;;AAGA,MAAM,SAAS,QAAQ,IAAI,aAAa;AACxC,IAAI;AACJ,IAAI;AACJ,MAAM,oCAAoC,IAAI,QAAQ;AACtD,MAAM,oBAAoB;AAC1B,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,oBAAoB;AACrE;AACA,SAAS,sBAAsB,OAAO;CACpC,OAAO,CAAC,kBAAkB,IAAI,KAAK;AACrC;AACA,SAAS,gBAAgB,YAAY;CACnC,KAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,QAAQ,WAAW;EACzB,IAAI,OAAO,UAAU,YAAY,kBAAkB,KAAK,KAAK,KAAK,SAAS,OAAO,UAAU,UAAU;GACpG,OAAO;EACT;CACF;CACA,OAAO;AACT;AACA,SAAS,iBAAiB,YAAY,QAAQ,SAAS;CACrD,MAAM,QAAQ;EACZ,WAAW;GACV,mBAAmB;GAClB,OAAO,CAAC;GACR,aAAa;EACf;CACF;CACA,IAAI,CAAC,gBAAgB,UAAU,GAAG;EAChC,kBAAkB,IAAI,KAAK;CAC7B;CACA,oBAAoB,OAAO,KAAK;CAChC,OAAO;AACT;AACA,SAAS,MAAM,YAAY;CACzB,IAAI,CAAC,UAAU,QAAQ,IAAI,aAAa,eAAe;EACrD,MAAM,YAAY,MAAM;EACxB,IAAI,WAAW,GAAG,WAAW,GAAG;GAC9B,SACE,8GACF;EACF;CACF;CACA,OAAO,iBAAiB,UAAU;AACpC;AACA,SAAS,0BAA0B,OAAO,OAAO,WAAW;CAC1D,OAAO,oBAAoB,kBAAkB,OAAO,OAAO,SAAS,IAAI,MAAM,iBAAiB,CAAC;AAClG"}
|
package/dist/esm/style.native.js
CHANGED
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { stylePieceSymbol } from "./types.native.js";
|
|
3
3
|
import { warnOnce } from "./helpers/warnOnce.native.js";
|
|
4
4
|
|
|
5
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
5
6
|
var compileStylePiece;
|
|
6
7
|
var resolveStylePiece;
|
|
7
8
|
var uncacheablePieces = /* @__PURE__ */ new WeakSet();
|
|
@@ -43,7 +44,7 @@ function createStylePiece(definition) {
|
|
|
43
44
|
return piece;
|
|
44
45
|
}
|
|
45
46
|
function style(definition) {
|
|
46
|
-
if (process.env.NODE_ENV === "development") {
|
|
47
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
47
48
|
var _internals_A_getOwner, _internals_A;
|
|
48
49
|
var internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
49
50
|
if (internals === null || internals === void 0 ? void 0 : (_internals_A = internals.A) === null || _internals_A === void 0 ? void 0 : (_internals_A_getOwner = _internals_A.getOwner) === null || _internals_A_getOwner === void 0 ? void 0 : _internals_A_getOwner.call(_internals_A)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.native.js","names":[],"sources":["esm/style.native.js"],"sourcesContent":["import React from \"react\";\nimport { stylePieceSymbol } from \"./types\";\nimport { warnOnce } from \"./helpers/warnOnce\";\nvar compileStylePiece;\nvar resolveStylePiece;\nvar uncacheablePieces = /* @__PURE__ */ new WeakSet();\nvar flatClausePattern = /(?:^|\\s)@?[A-Za-z][A-Za-z0-9-]*(?:\\/[A-Za-z0-9_-]+)?:/;\nfunction setStylePieceCompiler(compiler) {\n compileStylePiece = compiler;\n}\nfunction setStylePieceResolver(resolver) {\n resolveStylePiece = resolver;\n}\nfunction isStylePiece(value) {\n return !!value && typeof value === \"object\" && stylePieceSymbol in value;\n}\nfunction isStylePieceCacheable(piece) {\n return !uncacheablePieces.has(piece);\n}\nfunction canCacheByTheme(definition) {\n for (var key in definition) {\n var value = definition[key];\n if (typeof value === \"string\" && flatClausePattern.test(value) || value && typeof value === \"object\") {\n return false;\n }\n }\n return true;\n}\nfunction createStylePiece(definition) {\n var layer = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"style\";\n var piece = {\n className: \"\",\n [stylePieceSymbol]: {\n byKey: {},\n styleObject: definition\n }\n };\n if (!canCacheByTheme(definition)) {\n uncacheablePieces.add(piece);\n }\n compileStylePiece === null || compileStylePiece === void 0 ? void 0 : compileStylePiece(piece, layer);\n return piece;\n}\nfunction style(definition) {\n if (process.env.NODE_ENV === \"development\") {\n var _internals_A_getOwner, _internals_A;\n var internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n if (internals === null || internals === void 0 ? void 0 : (_internals_A = internals.A) === null || _internals_A === void 0 ? void 0 : (_internals_A_getOwner = _internals_A.getOwner) === null || _internals_A_getOwner === void 0 ? void 0 : _internals_A_getOwner.call(_internals_A)) {\n warnOnce(\"[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.\");\n }\n }\n return createStylePiece(definition);\n}\nfunction resolveStylePieceForTheme(piece, theme, themeName) {\n return resolveStylePiece ? resolveStylePiece(piece, theme, themeName) : piece[stylePieceSymbol].styleObject;\n}\nexport {\n createStylePiece,\n isStylePiece,\n isStylePieceCacheable,\n resolveStylePieceForTheme,\n setStylePieceCompiler,\n setStylePieceResolver,\n style\n};\n//# sourceMappingURL=style.js.map\n"],"mappings":";;;;;AAGA,IAAI;AACJ,IAAI;AACJ,IAAI,oCAAoC,IAAI,QAAQ;AACpD,IAAI,oBAAoB;AACxB,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,oBAAoB;AACrE;AACA,SAAS,sBAAsB,OAAO;CACpC,OAAO,CAAC,kBAAkB,IAAI,KAAK;AACrC;AACA,SAAS,gBAAgB,YAAY;CACnC,KAAK,IAAI,OAAO,YAAY;EAC1B,IAAI,QAAQ,WAAW;EACvB,IAAI,OAAO,UAAU,YAAY,kBAAkB,KAAK,KAAK,KAAK,SAAS,OAAO,UAAU,UAAU;GACpG,OAAO;EACT;CACF;CACA,OAAO;AACT;AACA,SAAS,iBAAiB,YAAY;CACpC,IAAI,QAAQ,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC7E,IAAI,QAAQ;EACV,WAAW;GACV,mBAAmB;GAClB,OAAO,CAAC;GACR,aAAa;EACf;CACF;CACA,IAAI,CAAC,gBAAgB,UAAU,GAAG;EAChC,kBAAkB,IAAI,KAAK;CAC7B;CACA,sBAAsB,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB,OAAO,KAAK;CACpG,OAAO;AACT;AACA,SAAS,MAAM,YAAY;CACzB,IAAI,QAAQ,IAAI,aAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"style.native.js","names":[],"sources":["esm/style.native.js"],"sourcesContent":["import React from \"react\";\nimport { stylePieceSymbol } from \"./types\";\nimport { warnOnce } from \"./helpers/warnOnce\";\nvar isProd = process.env.NODE_ENV === \"production\";\nvar compileStylePiece;\nvar resolveStylePiece;\nvar uncacheablePieces = /* @__PURE__ */ new WeakSet();\nvar flatClausePattern = /(?:^|\\s)@?[A-Za-z][A-Za-z0-9-]*(?:\\/[A-Za-z0-9_-]+)?:/;\nfunction setStylePieceCompiler(compiler) {\n compileStylePiece = compiler;\n}\nfunction setStylePieceResolver(resolver) {\n resolveStylePiece = resolver;\n}\nfunction isStylePiece(value) {\n return !!value && typeof value === \"object\" && stylePieceSymbol in value;\n}\nfunction isStylePieceCacheable(piece) {\n return !uncacheablePieces.has(piece);\n}\nfunction canCacheByTheme(definition) {\n for (var key in definition) {\n var value = definition[key];\n if (typeof value === \"string\" && flatClausePattern.test(value) || value && typeof value === \"object\") {\n return false;\n }\n }\n return true;\n}\nfunction createStylePiece(definition) {\n var layer = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"style\";\n var piece = {\n className: \"\",\n [stylePieceSymbol]: {\n byKey: {},\n styleObject: definition\n }\n };\n if (!canCacheByTheme(definition)) {\n uncacheablePieces.add(piece);\n }\n compileStylePiece === null || compileStylePiece === void 0 ? void 0 : compileStylePiece(piece, layer);\n return piece;\n}\nfunction style(definition) {\n if (!isProd && process.env.NODE_ENV === \"development\") {\n var _internals_A_getOwner, _internals_A;\n var internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n if (internals === null || internals === void 0 ? void 0 : (_internals_A = internals.A) === null || _internals_A === void 0 ? void 0 : (_internals_A_getOwner = _internals_A.getOwner) === null || _internals_A_getOwner === void 0 ? void 0 : _internals_A_getOwner.call(_internals_A)) {\n warnOnce(\"[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.\");\n }\n }\n return createStylePiece(definition);\n}\nfunction resolveStylePieceForTheme(piece, theme, themeName) {\n return resolveStylePiece ? resolveStylePiece(piece, theme, themeName) : piece[stylePieceSymbol].styleObject;\n}\nexport {\n createStylePiece,\n isStylePiece,\n isStylePieceCacheable,\n resolveStylePieceForTheme,\n setStylePieceCompiler,\n setStylePieceResolver,\n style\n};\n//# sourceMappingURL=style.js.map\n"],"mappings":";;;;;AAGA,IAAI,SAAS,QAAQ,IAAI,aAAa;AACtC,IAAI;AACJ,IAAI;AACJ,IAAI,oCAAoC,IAAI,QAAQ;AACpD,IAAI,oBAAoB;AACxB,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,oBAAoB;AACrE;AACA,SAAS,sBAAsB,OAAO;CACpC,OAAO,CAAC,kBAAkB,IAAI,KAAK;AACrC;AACA,SAAS,gBAAgB,YAAY;CACnC,KAAK,IAAI,OAAO,YAAY;EAC1B,IAAI,QAAQ,WAAW;EACvB,IAAI,OAAO,UAAU,YAAY,kBAAkB,KAAK,KAAK,KAAK,SAAS,OAAO,UAAU,UAAU;GACpG,OAAO;EACT;CACF;CACA,OAAO;AACT;AACA,SAAS,iBAAiB,YAAY;CACpC,IAAI,QAAQ,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC7E,IAAI,QAAQ;EACV,WAAW;GACV,mBAAmB;GAClB,OAAO,CAAC;GACR,aAAa;EACf;CACF;CACA,IAAI,CAAC,gBAAgB,UAAU,GAAG;EAChC,kBAAkB,IAAI,KAAK;CAC7B;CACA,sBAAsB,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB,OAAO,KAAK;CACpG,OAAO;AACT;AACA,SAAS,MAAM,YAAY;CACzB,IAAI,CAAC,UAAU,QAAQ,IAAI,aAAa,eAAe;EACrD,IAAI,uBAAuB;EAC3B,IAAI,YAAY,MAAM;EACtB,IAAI,cAAc,QAAQ,cAAc,KAAK,IAAI,KAAK,KAAK,eAAe,UAAU,OAAO,QAAQ,iBAAiB,KAAK,IAAI,KAAK,KAAK,wBAAwB,aAAa,cAAc,QAAQ,0BAA0B,KAAK,IAAI,KAAK,IAAI,sBAAsB,KAAK,YAAY,GAAG;GACtR,SAAS,8GAA8G;EACzH;CACF;CACA,OAAO,iBAAiB,UAAU;AACpC;AACA,SAAS,0BAA0B,OAAO,OAAO,WAAW;CAC1D,OAAO,oBAAoB,kBAAkB,OAAO,OAAO,SAAS,IAAI,MAAM,iBAAiB,CAAC;AAClG"}
|
package/dist/esm/styled.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { resolveVariantStyle } from "./helpers/resolveVariantStyle.mjs";
|
|
|
6
6
|
import { styledDynamic } from "./helpers/styledDynamic.mjs";
|
|
7
7
|
import { warnOnce } from "./helpers/warnOnce.mjs";
|
|
8
8
|
|
|
9
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
9
10
|
function styledFn(...args) {
|
|
10
11
|
return styledImpl(void 0, ...args);
|
|
11
12
|
}
|
|
@@ -20,10 +21,10 @@ function styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptio
|
|
|
20
21
|
const config = hasBaseClassName ? maybeConfig : configOrOptions;
|
|
21
22
|
const options = optionsIn;
|
|
22
23
|
const displayName = options?.displayName;
|
|
23
|
-
if (!ComponentIn) throw new Error(process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
24
|
+
if (!ComponentIn) throw new Error(!isProd && process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
24
25
|
const parentStaticConfig = ComponentIn["staticConfig"];
|
|
25
26
|
const requestedReactNativeInterop = Boolean(config?.isReactNative || parentStaticConfig?.isReactNative);
|
|
26
|
-
if (process.env.NODE_ENV === "development" && requestedReactNativeInterop) warnOnce("isReactNative-web-removed", "The isReactNative styled-component option is native-only in Tamagui v3. React Native Web hosts on web are no longer adapted; use a component that accepts className, data-* attributes, and DOM events.");
|
|
27
|
+
if (!isProd && process.env.NODE_ENV === "development" && requestedReactNativeInterop) warnOnce("isReactNative-web-removed", "The isReactNative styled-component option is native-only in Tamagui v3. React Native Web hosts on web are no longer adapted; use a component that accepts className, data-* attributes, and DOM events.");
|
|
27
28
|
const isReactNative = false;
|
|
28
29
|
const isPlainStyledComponent = !!parentStaticConfig && !parentStaticConfig.isHOC;
|
|
29
30
|
let Component = parentStaticConfig?.isHOC && !parentStaticConfig?.isStyledHOC || isPlainStyledComponent ? ComponentIn : parentStaticConfig?.Component || ComponentIn;
|
package/dist/esm/styled.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","names":[],"sources":["esm/styled.js"],"sourcesContent":["import { stylePropsInput, stylePropsText } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { componentDisplayName } from \"./helpers/componentDisplayName\";\nimport { mergeVariants } from \"./helpers/mergeVariants\";\nimport { resolveVariantStyle } from \"./helpers/resolveVariantStyle\";\nimport { styledDynamic } from \"./helpers/styledDynamic\";\nimport { warnOnce } from \"./helpers/warnOnce\";\n\nfunction styledFn(...args) {\n\treturn styledImpl(void 0, ...args);\n}\nconst styled = Object.assign(styledFn, { dynamic: styledDynamic });\nfunction createFrontendStyled(frontend) {\n\treturn (ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) => styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig);\n}\nfunction styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\tconst hasBaseClassName = typeof optionsOrBaseClassName === \"string\";\n\tconst baseClassName = hasBaseClassName ? optionsOrBaseClassName : void 0;\n\tconst optionsIn = hasBaseClassName ? configOrOptions : optionsOrBaseClassName;\n\tconst config = hasBaseClassName ? maybeConfig : configOrOptions;\n\tconst options = optionsIn;\n\tconst displayName = options?.displayName;\n\tif (!ComponentIn) throw new Error(process.env.NODE_ENV === \"development\" ? \"No component given to styled()\" : \"❌ Error 006\");\n\tconst parentStaticConfig = ComponentIn[\"staticConfig\"];\n\tconst requestedReactNativeInterop = Boolean(config?.isReactNative || parentStaticConfig?.isReactNative);\n\tif (process.env.NODE_ENV === \"development\" && requestedReactNativeInterop) warnOnce(\"isReactNative-web-removed\", \"The isReactNative styled-component option is native-only in Tamagui v3. React Native Web hosts on web are no longer adapted; use a component that accepts className, data-* attributes, and DOM events.\");\n\tconst isReactNative = false;\n\tconst isPlainStyledComponent = !!parentStaticConfig && !parentStaticConfig.isHOC;\n\tlet Component = parentStaticConfig?.isHOC && !parentStaticConfig?.isStyledHOC || isPlainStyledComponent ? ComponentIn : parentStaticConfig?.Component || ComponentIn;\n\tconst resolvedIsReactNative = Boolean(isReactNative);\n\tconst component = createComponent((() => {\n\t\tlet { variants, displayName: _displayName, defaultVariants, context, contextProps, ...defaultProps } = options || {};\n\t\tlet parentDefaultVariants;\n\t\tlet parentDefaultProps;\n\t\tconst mergedBaseClassName = parentStaticConfig?.baseClassName && baseClassName ? `${parentStaticConfig.baseClassName} ${baseClassName}` : baseClassName || parentStaticConfig?.baseClassName;\n\t\tif (parentStaticConfig) {\n\t\t\tif (!(parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC)) {\n\t\t\t\tconst pdp = parentStaticConfig.defaultProps;\n\t\t\t\tfor (const key in pdp) {\n\t\t\t\t\tconst val = pdp[key];\n\t\t\t\t\tif (parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\tif (key in parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\t\tif (!defaultVariants || !(key in defaultVariants)) {\n\t\t\t\t\t\t\t\tparentDefaultVariants ||= {};\n\t\t\t\t\t\t\t\tparentDefaultVariants[key] = val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!(key in defaultProps) && (!defaultVariants || !(key in defaultVariants))) {\n\t\t\t\t\t\tparentDefaultProps ||= {};\n\t\t\t\t\t\tparentDefaultProps[key] = pdp[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (parentStaticConfig.variants) variants = mergeVariants(parentStaticConfig.variants, variants);\n\t\t\t}\n\t\t}\n\t\tconst mergedContext = context || parentStaticConfig?.context;\n\t\tconst mergedContextProps = context ? contextProps : contextProps || parentStaticConfig?.contextProps;\n\t\tif (parentDefaultProps || defaultVariants || parentDefaultVariants) defaultProps = {\n\t\t\t...parentDefaultProps,\n\t\t\t...parentDefaultVariants,\n\t\t\t...defaultProps,\n\t\t\t...defaultVariants\n\t\t};\n\t\tconst isInput = Boolean(config?.isInput || parentStaticConfig?.isInput);\n\t\tconst isText = Boolean(config?.isText || parentStaticConfig?.isText);\n\t\tconst validStyles = config?.validStyles || (config?.isInput ? stylePropsInput : config?.isText ? stylePropsText : parentStaticConfig?.validStyles);\n\t\tconst acceptsClassName = config?.acceptsClassName ?? (isPlainStyledComponent || resolvedIsReactNative || parentStaticConfig?.isHOC && parentStaticConfig?.acceptsClassName);\n\t\tconst conf = {\n\t\t\t...parentStaticConfig,\n\t\t\t...config,\n\t\t\t...!isPlainStyledComponent && { Component },\n\t\t\tvariants,\n\t\t\tbaseClassName: mergedBaseClassName,\n\t\t\tdefaultProps,\n\t\t\tdefaultVariants,\n\t\t\tisText,\n\t\t\tisInput,\n\t\t\tvalidStyles,\n\t\t\tacceptsClassName,\n\t\t\tcontext: mergedContext,\n\t\t\tcontextProps: mergedContextProps,\n\t\t\tisStyledHOC: Boolean(parentStaticConfig?.isHOC),\n\t\t\tparentStaticConfig,\n\t\t\tdisplayName: displayName || ComponentIn[componentDisplayName],\n\t\t\t...frontend && { styleFrontend: frontend }\n\t\t};\n\t\tconf.variantStyleResolver = resolveVariantStyle;\n\t\tdelete conf.isReactNative;\n\t\tif (defaultProps[\"children\"] || !acceptsClassName || mergedContext) conf.neverFlatten = true;\n\t\treturn conf;\n\t})() || {});\n\tfor (const key in ComponentIn) {\n\t\tif (key === \"propTypes\") continue;\n\t\tif (key in component) continue;\n\t\tcomponent[key] = ComponentIn[key];\n\t}\n\treturn component;\n}\n\nexport { createFrontendStyled, styled };"],"mappings":";;;;;;;;;AAQA,SAAS,SAAS,GAAG,MAAM;CAC1B,OAAO,WAAW,KAAK,GAAG,GAAG,IAAI;AAClC;AACA,MAAM,SAAS,OAAO,OAAO,UAAU,EAAE,SAAS,cAAc,CAAC;AACjE,SAAS,qBAAqB,UAAU;CACvC,QAAQ,aAAa,wBAAwB,iBAAiB,gBAAgB,WAAW,UAAU,aAAa,wBAAwB,iBAAiB,WAAW;AACrK;AACA,SAAS,WAAW,UAAU,aAAa,wBAAwB,iBAAiB,aAAa;CAChG,MAAM,mBAAmB,OAAO,2BAA2B;CAC3D,MAAM,gBAAgB,mBAAmB,yBAAyB,KAAK;CACvE,MAAM,YAAY,mBAAmB,kBAAkB;CACvD,MAAM,SAAS,mBAAmB,cAAc;CAChD,MAAM,UAAU;CAChB,MAAM,cAAc,SAAS;CAC7B,IAAI,CAAC,aAAa,MAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,gBAAgB,mCAAmC,aAAa;
|
|
1
|
+
{"version":3,"file":"styled.js","names":[],"sources":["esm/styled.js"],"sourcesContent":["import { stylePropsInput, stylePropsText } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { componentDisplayName } from \"./helpers/componentDisplayName\";\nimport { mergeVariants } from \"./helpers/mergeVariants\";\nimport { resolveVariantStyle } from \"./helpers/resolveVariantStyle\";\nimport { styledDynamic } from \"./helpers/styledDynamic\";\nimport { warnOnce } from \"./helpers/warnOnce\";\n\nconst isProd = process.env.NODE_ENV === \"production\";\nfunction styledFn(...args) {\n\treturn styledImpl(void 0, ...args);\n}\nconst styled = Object.assign(styledFn, { dynamic: styledDynamic });\nfunction createFrontendStyled(frontend) {\n\treturn (ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) => styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig);\n}\nfunction styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\tconst hasBaseClassName = typeof optionsOrBaseClassName === \"string\";\n\tconst baseClassName = hasBaseClassName ? optionsOrBaseClassName : void 0;\n\tconst optionsIn = hasBaseClassName ? configOrOptions : optionsOrBaseClassName;\n\tconst config = hasBaseClassName ? maybeConfig : configOrOptions;\n\tconst options = optionsIn;\n\tconst displayName = options?.displayName;\n\tif (!ComponentIn) throw new Error(!isProd && process.env.NODE_ENV === \"development\" ? \"No component given to styled()\" : \"❌ Error 006\");\n\tconst parentStaticConfig = ComponentIn[\"staticConfig\"];\n\tconst requestedReactNativeInterop = Boolean(config?.isReactNative || parentStaticConfig?.isReactNative);\n\tif (!isProd && process.env.NODE_ENV === \"development\" && requestedReactNativeInterop) warnOnce(\"isReactNative-web-removed\", \"The isReactNative styled-component option is native-only in Tamagui v3. React Native Web hosts on web are no longer adapted; use a component that accepts className, data-* attributes, and DOM events.\");\n\tconst isReactNative = false;\n\tconst isPlainStyledComponent = !!parentStaticConfig && !parentStaticConfig.isHOC;\n\tlet Component = parentStaticConfig?.isHOC && !parentStaticConfig?.isStyledHOC || isPlainStyledComponent ? ComponentIn : parentStaticConfig?.Component || ComponentIn;\n\tconst resolvedIsReactNative = Boolean(isReactNative);\n\tconst component = createComponent((() => {\n\t\tlet { variants, displayName: _displayName, defaultVariants, context, contextProps, ...defaultProps } = options || {};\n\t\tlet parentDefaultVariants;\n\t\tlet parentDefaultProps;\n\t\tconst mergedBaseClassName = parentStaticConfig?.baseClassName && baseClassName ? `${parentStaticConfig.baseClassName} ${baseClassName}` : baseClassName || parentStaticConfig?.baseClassName;\n\t\tif (parentStaticConfig) {\n\t\t\tif (!(parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC)) {\n\t\t\t\tconst pdp = parentStaticConfig.defaultProps;\n\t\t\t\tfor (const key in pdp) {\n\t\t\t\t\tconst val = pdp[key];\n\t\t\t\t\tif (parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\tif (key in parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\t\tif (!defaultVariants || !(key in defaultVariants)) {\n\t\t\t\t\t\t\t\tparentDefaultVariants ||= {};\n\t\t\t\t\t\t\t\tparentDefaultVariants[key] = val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!(key in defaultProps) && (!defaultVariants || !(key in defaultVariants))) {\n\t\t\t\t\t\tparentDefaultProps ||= {};\n\t\t\t\t\t\tparentDefaultProps[key] = pdp[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (parentStaticConfig.variants) variants = mergeVariants(parentStaticConfig.variants, variants);\n\t\t\t}\n\t\t}\n\t\tconst mergedContext = context || parentStaticConfig?.context;\n\t\tconst mergedContextProps = context ? contextProps : contextProps || parentStaticConfig?.contextProps;\n\t\tif (parentDefaultProps || defaultVariants || parentDefaultVariants) defaultProps = {\n\t\t\t...parentDefaultProps,\n\t\t\t...parentDefaultVariants,\n\t\t\t...defaultProps,\n\t\t\t...defaultVariants\n\t\t};\n\t\tconst isInput = Boolean(config?.isInput || parentStaticConfig?.isInput);\n\t\tconst isText = Boolean(config?.isText || parentStaticConfig?.isText);\n\t\tconst validStyles = config?.validStyles || (config?.isInput ? stylePropsInput : config?.isText ? stylePropsText : parentStaticConfig?.validStyles);\n\t\tconst acceptsClassName = config?.acceptsClassName ?? (isPlainStyledComponent || resolvedIsReactNative || parentStaticConfig?.isHOC && parentStaticConfig?.acceptsClassName);\n\t\tconst conf = {\n\t\t\t...parentStaticConfig,\n\t\t\t...config,\n\t\t\t...!isPlainStyledComponent && { Component },\n\t\t\tvariants,\n\t\t\tbaseClassName: mergedBaseClassName,\n\t\t\tdefaultProps,\n\t\t\tdefaultVariants,\n\t\t\tisText,\n\t\t\tisInput,\n\t\t\tvalidStyles,\n\t\t\tacceptsClassName,\n\t\t\tcontext: mergedContext,\n\t\t\tcontextProps: mergedContextProps,\n\t\t\tisStyledHOC: Boolean(parentStaticConfig?.isHOC),\n\t\t\tparentStaticConfig,\n\t\t\tdisplayName: displayName || ComponentIn[componentDisplayName],\n\t\t\t...frontend && { styleFrontend: frontend }\n\t\t};\n\t\tconf.variantStyleResolver = resolveVariantStyle;\n\t\tdelete conf.isReactNative;\n\t\tif (defaultProps[\"children\"] || !acceptsClassName || mergedContext) conf.neverFlatten = true;\n\t\treturn conf;\n\t})() || {});\n\tfor (const key in ComponentIn) {\n\t\tif (key === \"propTypes\") continue;\n\t\tif (key in component) continue;\n\t\tcomponent[key] = ComponentIn[key];\n\t}\n\treturn component;\n}\n\nexport { createFrontendStyled, styled };"],"mappings":";;;;;;;;;AAQA,MAAM,SAAS,QAAQ,IAAI,aAAa;AACxC,SAAS,SAAS,GAAG,MAAM;CAC1B,OAAO,WAAW,KAAK,GAAG,GAAG,IAAI;AAClC;AACA,MAAM,SAAS,OAAO,OAAO,UAAU,EAAE,SAAS,cAAc,CAAC;AACjE,SAAS,qBAAqB,UAAU;CACvC,QAAQ,aAAa,wBAAwB,iBAAiB,gBAAgB,WAAW,UAAU,aAAa,wBAAwB,iBAAiB,WAAW;AACrK;AACA,SAAS,WAAW,UAAU,aAAa,wBAAwB,iBAAiB,aAAa;CAChG,MAAM,mBAAmB,OAAO,2BAA2B;CAC3D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AC9E,uBAAuB,CAAC;MACxB,mBAAmB,OAAO,IAAI;KAC/B;IACD;IACA,IAAI,mBAAmB,UAAU,WAAW,cAAc,mBAAmB,UAAU,QAAQ;GAChG;EACD;EACA,MAAM,gBAAgB,WAAW,oBAAoB;EACrD,MAAM,qBAAqB,UAAU,eAAe,gBAAgB,oBAAoB;EACxF,IAAI,sBAAsB,mBAAmB,uBAAuB,eAAe;GAClF,GAAG;GACH,GAAG;GACH,GAAG;GACH,GAAG;EACJ;EACA,MAAM,UAAU,QAAQ,QAAQ,WAAW,oBAAoB,OAAO;EACtE,MAAM,SAAS,QAAQ,QAAQ,UAAU,oBAAoB,MAAM;EACnE,MAAM,cAAc,QAAQ,gBAAgB,QAAQ,UAAU,kBAAkB,QAAQ,SAAS,iBAAiB,oBAAoB;EACtI,MAAM,mBAAmB,QAAQ,qBAAqB,0BAA0B,yBAAyB,oBAAoB,SAAS,oBAAoB;EAC1J,MAAM,OAAO;GACZ,GAAG;GACH,GAAG;GACH,GAAG,CAAC,0BAA0B,EAAE,UAAU;GAC1C;GACA,eAAe;GACf;GACA;GACA;GACA;GACA;GACA;GACA,SAAS;GACT,cAAc;GACd,aAAa,QAAQ,oBAAoB,KAAK;GAC9C;GACA,aAAa,eAAe,YAAY;GACxC,GAAG,YAAY,EAAE,eAAe,SAAS;EAC1C;EACA,KAAK,uBAAuB;EAC5B,OAAO,KAAK;EACZ,IAAI,aAAa,eAAe,CAAC,oBAAoB,eAAe,KAAK,eAAe;EACxF,OAAO;CACR,EAAC,CAAE,KAAK,CAAC,CAAC;CACV,KAAK,MAAM,OAAO,aAAa;EAC9B,IAAI,QAAQ,aAAa;EACzB,IAAI,OAAO,WAAW;EACtB,UAAU,OAAO,YAAY;CAC9B;CACA,OAAO;AACR"}
|
|
@@ -6,6 +6,7 @@ import { resolveVariantStyle } from "./helpers/resolveVariantStyle.native.js";
|
|
|
6
6
|
import { styledDynamic } from "./helpers/styledDynamic.native.js";
|
|
7
7
|
import { getReactNativeConfig } from "./setupReactNative.native.js";
|
|
8
8
|
|
|
9
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
9
10
|
function styledFn() {
|
|
10
11
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
11
12
|
return styledImpl(void 0, ...args);
|
|
@@ -23,7 +24,7 @@ function styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptio
|
|
|
23
24
|
var config = hasBaseClassName ? maybeConfig : configOrOptions;
|
|
24
25
|
var options = optionsIn;
|
|
25
26
|
var displayName = options === null || options === void 0 ? void 0 : options.displayName;
|
|
26
|
-
if (!ComponentIn) throw new Error(process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
27
|
+
if (!ComponentIn) throw new Error(!isProd && process.env.NODE_ENV === "development" ? "No component given to styled()" : "❌ Error 006");
|
|
27
28
|
var parentStaticConfig = ComponentIn["staticConfig"];
|
|
28
29
|
Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));
|
|
29
30
|
var isReactNative = Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.native.js","names":[],"sources":["esm/styled.native.js"],"sourcesContent":["import { stylePropsInput, stylePropsText } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { componentDisplayName } from \"./helpers/componentDisplayName\";\nimport { mergeVariants } from \"./helpers/mergeVariants\";\nimport { resolveVariantStyle } from \"./helpers/resolveVariantStyle\";\nimport { styledDynamic } from \"./helpers/styledDynamic\";\nimport { getReactNativeConfig } from \"./setupReactNative\";\n\nfunction styledFn() {\n\tfor (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\treturn styledImpl(void 0, ...args);\n}\nvar styled = Object.assign(styledFn, { dynamic: styledDynamic });\nfunction createFrontendStyled(frontend) {\n\treturn function(ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\t\treturn styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig);\n\t};\n}\nfunction styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\tvar hasBaseClassName = typeof optionsOrBaseClassName === \"string\";\n\tvar baseClassName = hasBaseClassName ? optionsOrBaseClassName : void 0;\n\tvar optionsIn = hasBaseClassName ? configOrOptions : optionsOrBaseClassName;\n\tvar config = hasBaseClassName ? maybeConfig : configOrOptions;\n\tvar options = optionsIn;\n\tvar displayName = options === null || options === void 0 ? void 0 : options.displayName;\n\tif (!ComponentIn) throw new Error(process.env.NODE_ENV === \"development\" ? \"No component given to styled()\" : \"❌ Error 006\");\n\tvar parentStaticConfig = ComponentIn[\"staticConfig\"];\n\tBoolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));\n\tvar isReactNative = Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));\n\tvar isPlainStyledComponent = !!parentStaticConfig && !(isReactNative || parentStaticConfig.isHOC);\n\tvar Component = (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC) && !(parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isStyledHOC) || isPlainStyledComponent ? ComponentIn : (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.Component) || ComponentIn;\n\tvar reactNativeConfig = !parentStaticConfig ? getReactNativeConfig(Component) : void 0;\n\tvar resolvedIsReactNative = Boolean(reactNativeConfig || isReactNative);\n\tvar component = createComponent((function() {\n\t\tvar _ref;\n\t\tvar { variants, displayName: _displayName, defaultVariants, context, contextProps, ...defaultProps } = options || {};\n\t\tvar parentDefaultVariants;\n\t\tvar parentDefaultProps;\n\t\tvar mergedBaseClassName = (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.baseClassName) && baseClassName ? `${parentStaticConfig.baseClassName} ${baseClassName}` : baseClassName || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.baseClassName);\n\t\tif (parentStaticConfig) {\n\t\t\tif (!(parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC)) {\n\t\t\t\tvar pdp = parentStaticConfig.defaultProps;\n\t\t\t\tfor (var key2 in pdp) {\n\t\t\t\t\tvar val = pdp[key2];\n\t\t\t\t\tif (parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\tif (key2 in parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\t\tif (!defaultVariants || !(key2 in defaultVariants)) {\n\t\t\t\t\t\t\t\tparentDefaultVariants || (parentDefaultVariants = {});\n\t\t\t\t\t\t\t\tparentDefaultVariants[key2] = val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!(key2 in defaultProps) && (!defaultVariants || !(key2 in defaultVariants))) {\n\t\t\t\t\t\tparentDefaultProps || (parentDefaultProps = {});\n\t\t\t\t\t\tparentDefaultProps[key2] = pdp[key2];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (parentStaticConfig.variants) variants = mergeVariants(parentStaticConfig.variants, variants);\n\t\t\t}\n\t\t}\n\t\tvar mergedContext = context || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.context);\n\t\tvar mergedContextProps = context ? contextProps : contextProps || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.contextProps);\n\t\tif (parentDefaultProps || defaultVariants || parentDefaultVariants) defaultProps = {\n\t\t\t...parentDefaultProps,\n\t\t\t...parentDefaultVariants,\n\t\t\t...defaultProps,\n\t\t\t...defaultVariants\n\t\t};\n\t\tvar isInput = Boolean((config === null || config === void 0 ? void 0 : config.isInput) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isInput));\n\t\tvar isText = Boolean((config === null || config === void 0 ? void 0 : config.isText) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isText));\n\t\tvar validStyles = (config === null || config === void 0 ? void 0 : config.validStyles) || ((config === null || config === void 0 ? void 0 : config.isInput) ? stylePropsInput : (config === null || config === void 0 ? void 0 : config.isText) ? stylePropsText : parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.validStyles);\n\t\tvar acceptsClassName = (_ref = config === null || config === void 0 ? void 0 : config.acceptsClassName) !== null && _ref !== void 0 ? _ref : isPlainStyledComponent || resolvedIsReactNative || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.acceptsClassName);\n\t\tvar conf = {\n\t\t\t...parentStaticConfig,\n\t\t\t...config,\n\t\t\t...!isPlainStyledComponent && { Component },\n\t\t\tvariants,\n\t\t\tbaseClassName: mergedBaseClassName,\n\t\t\tdefaultProps,\n\t\t\tdefaultVariants,\n\t\t\tisReactNative: resolvedIsReactNative,\n\t\t\tisText,\n\t\t\tisInput,\n\t\t\tvalidStyles,\n\t\t\tacceptsClassName,\n\t\t\tcontext: mergedContext,\n\t\t\tcontextProps: mergedContextProps,\n\t\t\t...reactNativeConfig,\n\t\t\tisStyledHOC: Boolean(parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC),\n\t\t\tparentStaticConfig,\n\t\t\tdisplayName: displayName || ComponentIn[componentDisplayName],\n\t\t\t...frontend && { styleFrontend: frontend }\n\t\t};\n\t\tconf.variantStyleResolver = resolveVariantStyle;\n\t\tif (defaultProps[\"children\"] || !acceptsClassName || mergedContext) conf.neverFlatten = true;\n\t\treturn conf;\n\t})() || {});\n\tfor (var key in ComponentIn) {\n\t\tif (key === \"propTypes\") continue;\n\t\tif (key in component) continue;\n\t\tcomponent[key] = ComponentIn[key];\n\t}\n\treturn component;\n}\n\nexport { createFrontendStyled, styled };"],"mappings":";;;;;;;;;AAQA,SAAS,WAAW;CACnB,KAAK,IAAI,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,QAAQ,KAAK,QAAQ,UAAU;CAChH,OAAO,WAAW,KAAK,GAAG,GAAG,IAAI;AAClC;AACA,IAAI,SAAS,OAAO,OAAO,UAAU,EAAE,SAAS,cAAc,CAAC;AAC/D,SAAS,qBAAqB,UAAU;CACvC,OAAO,SAAS,aAAa,wBAAwB,iBAAiB,aAAa;EAClF,OAAO,WAAW,UAAU,aAAa,wBAAwB,iBAAiB,WAAW;CAC9F;AACD;AACA,SAAS,WAAW,UAAU,aAAa,wBAAwB,iBAAiB,aAAa;CAChG,IAAI,mBAAmB,OAAO,2BAA2B;CACzD,IAAI,gBAAgB,mBAAmB,yBAAyB,KAAK;CACrE,IAAI,YAAY,mBAAmB,kBAAkB;CACrD,IAAI,SAAS,mBAAmB,cAAc;CAC9C,IAAI,UAAU;CACd,IAAI,cAAc,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;CAC5E,IAAI,CAAC,aAAa,MAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,gBAAgB,mCAAmC,aAAa;CAC3H,IAAI,qBAAqB,YAAY;CACrC,SAAS,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,mBAAmB,uBAAuB,QAAQ,uBAAuB,KAAK,IAAI,KAAK,IAAI,mBAAmB,cAAc;CAC5L,IAAI,gBAAgB,SAAS,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,mBAAmB,uBAAuB,QAAQ,uBAAuB,KAAK,IAAI,KAAK,IAAI,mBAAmB,cA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f;GACA;GACA,eAAe;GACf;GACA;GACA;GACA;GACA,SAAS;GACT,cAAc;GACd,GAAG;GACH,aAAa,QAAQ,uBAAuB,QAAQ,uBAAuB,KAAK,IAAI,KAAK,IAAI,mBAAmB,KAAK;GACrH;GACA,aAAa,eAAe,YAAY;GACxC,GAAG,YAAY,EAAE,eAAe,SAAS;EAC1C;EACA,KAAK,uBAAuB;EAC5B,IAAI,aAAa,eAAe,CAAC,oBAAoB,eAAe,KAAK,eAAe;EACxF,OAAO;CACR,EAAC,CAAE,KAAK,CAAC,CAAC;CACV,KAAK,IAAI,OAAO,aAAa;EAC5B,IAAI,QAAQ,aAAa;EACzB,IAAI,OAAO,WAAW;EACtB,UAAU,OAAO,YAAY;CAC9B;CACA,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"styled.native.js","names":[],"sources":["esm/styled.native.js"],"sourcesContent":["import { stylePropsInput, stylePropsText } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { componentDisplayName } from \"./helpers/componentDisplayName\";\nimport { mergeVariants } from \"./helpers/mergeVariants\";\nimport { resolveVariantStyle } from \"./helpers/resolveVariantStyle\";\nimport { styledDynamic } from \"./helpers/styledDynamic\";\nimport { getReactNativeConfig } from \"./setupReactNative\";\n\nvar isProd = process.env.NODE_ENV === \"production\";\nfunction styledFn() {\n\tfor (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\treturn styledImpl(void 0, ...args);\n}\nvar styled = Object.assign(styledFn, { dynamic: styledDynamic });\nfunction createFrontendStyled(frontend) {\n\treturn function(ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\t\treturn styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig);\n\t};\n}\nfunction styledImpl(frontend, ComponentIn, optionsOrBaseClassName, configOrOptions, maybeConfig) {\n\tvar hasBaseClassName = typeof optionsOrBaseClassName === \"string\";\n\tvar baseClassName = hasBaseClassName ? optionsOrBaseClassName : void 0;\n\tvar optionsIn = hasBaseClassName ? configOrOptions : optionsOrBaseClassName;\n\tvar config = hasBaseClassName ? maybeConfig : configOrOptions;\n\tvar options = optionsIn;\n\tvar displayName = options === null || options === void 0 ? void 0 : options.displayName;\n\tif (!ComponentIn) throw new Error(!isProd && process.env.NODE_ENV === \"development\" ? \"No component given to styled()\" : \"❌ Error 006\");\n\tvar parentStaticConfig = ComponentIn[\"staticConfig\"];\n\tBoolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));\n\tvar isReactNative = Boolean((config === null || config === void 0 ? void 0 : config.isReactNative) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isReactNative));\n\tvar isPlainStyledComponent = !!parentStaticConfig && !(isReactNative || parentStaticConfig.isHOC);\n\tvar Component = (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC) && !(parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isStyledHOC) || isPlainStyledComponent ? ComponentIn : (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.Component) || ComponentIn;\n\tvar reactNativeConfig = !parentStaticConfig ? getReactNativeConfig(Component) : void 0;\n\tvar resolvedIsReactNative = Boolean(reactNativeConfig || isReactNative);\n\tvar component = createComponent((function() {\n\t\tvar _ref;\n\t\tvar { variants, displayName: _displayName, defaultVariants, context, contextProps, ...defaultProps } = options || {};\n\t\tvar parentDefaultVariants;\n\t\tvar parentDefaultProps;\n\t\tvar mergedBaseClassName = (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.baseClassName) && baseClassName ? `${parentStaticConfig.baseClassName} ${baseClassName}` : baseClassName || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.baseClassName);\n\t\tif (parentStaticConfig) {\n\t\t\tif (!(parentStaticConfig.isHOC && !parentStaticConfig.isStyledHOC)) {\n\t\t\t\tvar pdp = parentStaticConfig.defaultProps;\n\t\t\t\tfor (var key2 in pdp) {\n\t\t\t\t\tvar val = pdp[key2];\n\t\t\t\t\tif (parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\tif (key2 in parentStaticConfig.defaultVariants) {\n\t\t\t\t\t\t\tif (!defaultVariants || !(key2 in defaultVariants)) {\n\t\t\t\t\t\t\t\tparentDefaultVariants || (parentDefaultVariants = {});\n\t\t\t\t\t\t\t\tparentDefaultVariants[key2] = val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!(key2 in defaultProps) && (!defaultVariants || !(key2 in defaultVariants))) {\n\t\t\t\t\t\tparentDefaultProps || (parentDefaultProps = {});\n\t\t\t\t\t\tparentDefaultProps[key2] = pdp[key2];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (parentStaticConfig.variants) variants = mergeVariants(parentStaticConfig.variants, variants);\n\t\t\t}\n\t\t}\n\t\tvar mergedContext = context || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.context);\n\t\tvar mergedContextProps = context ? contextProps : contextProps || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.contextProps);\n\t\tif (parentDefaultProps || defaultVariants || parentDefaultVariants) defaultProps = {\n\t\t\t...parentDefaultProps,\n\t\t\t...parentDefaultVariants,\n\t\t\t...defaultProps,\n\t\t\t...defaultVariants\n\t\t};\n\t\tvar isInput = Boolean((config === null || config === void 0 ? void 0 : config.isInput) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isInput));\n\t\tvar isText = Boolean((config === null || config === void 0 ? void 0 : config.isText) || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isText));\n\t\tvar validStyles = (config === null || config === void 0 ? void 0 : config.validStyles) || ((config === null || config === void 0 ? void 0 : config.isInput) ? stylePropsInput : (config === null || config === void 0 ? void 0 : config.isText) ? stylePropsText : parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.validStyles);\n\t\tvar acceptsClassName = (_ref = config === null || config === void 0 ? void 0 : config.acceptsClassName) !== null && _ref !== void 0 ? _ref : isPlainStyledComponent || resolvedIsReactNative || (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC) && (parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.acceptsClassName);\n\t\tvar conf = {\n\t\t\t...parentStaticConfig,\n\t\t\t...config,\n\t\t\t...!isPlainStyledComponent && { Component },\n\t\t\tvariants,\n\t\t\tbaseClassName: mergedBaseClassName,\n\t\t\tdefaultProps,\n\t\t\tdefaultVariants,\n\t\t\tisReactNative: resolvedIsReactNative,\n\t\t\tisText,\n\t\t\tisInput,\n\t\t\tvalidStyles,\n\t\t\tacceptsClassName,\n\t\t\tcontext: mergedContext,\n\t\t\tcontextProps: mergedContextProps,\n\t\t\t...reactNativeConfig,\n\t\t\tisStyledHOC: Boolean(parentStaticConfig === null || parentStaticConfig === void 0 ? void 0 : parentStaticConfig.isHOC),\n\t\t\tparentStaticConfig,\n\t\t\tdisplayName: displayName || ComponentIn[componentDisplayName],\n\t\t\t...frontend && { styleFrontend: frontend }\n\t\t};\n\t\tconf.variantStyleResolver = resolveVariantStyle;\n\t\tif (defaultProps[\"children\"] || !acceptsClassName || mergedContext) conf.neverFlatten = true;\n\t\treturn conf;\n\t})() || {});\n\tfor (var key in ComponentIn) {\n\t\tif (key === \"propTypes\") continue;\n\t\tif (key in component) continue;\n\t\tcomponent[key] = ComponentIn[key];\n\t}\n\treturn component;\n}\n\nexport { createFrontendStyled, styled };"],"mappings":";;;;;;;;;AAQA,IAAI,SAAS,QAAQ,IAAI,aAAa;AACtC,SAAS,WAAW;CACnB,KAAK,IAAI,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,M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AC,oBAAoB,eAAe,KAAK,eAAe;EACxF,OAAO;CACR,EAAC,CAAE,KAAK,CAAC,CAAC;CACV,KAAK,IAAI,OAAO,aAAa;EAC5B,IAAI,QAAQ,aAAa;EACzB,IAAI,OAAO,WAAW;EACtB,UAAU,OAAO,YAAY;CAC9B;CACA,OAAO;AACR"}
|
|
@@ -11,6 +11,7 @@ import { TamaguiRoot } from "./TamaguiRoot.mjs";
|
|
|
11
11
|
import { ThemeProvider } from "./ThemeProvider.mjs";
|
|
12
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
|
|
14
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
14
15
|
let _cachedFirstKey;
|
|
15
16
|
let _cachedConfig;
|
|
16
17
|
function firstThemeKey(config) {
|
|
@@ -61,7 +62,7 @@ function TamaguiProvider({ children, disableInjectCSS, config, className, defaul
|
|
|
61
62
|
href: "tamagui-css",
|
|
62
63
|
children: config.getCSS()
|
|
63
64
|
}, "tamagui-css"),
|
|
64
|
-
process.env.NODE_ENV !== "production" && config && /* @__PURE__ */ jsx(ConfigRevisionCheck, { config }),
|
|
65
|
+
!isProd && process.env.NODE_ENV !== "production" && config && /* @__PURE__ */ jsx(ConfigRevisionCheck, { config }),
|
|
65
66
|
hasSafeAreaTracker() && /* @__PURE__ */ jsx(SafeAreaTracker, {}),
|
|
66
67
|
contents
|
|
67
68
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TamaguiProvider.js","names":[],"sources":["esm/views/TamaguiProvider.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { ClientOnly } from \"@tamagui/use-did-finish-ssr\";\nimport React, { useEffect } from \"react\";\nimport { getSetting } from \"../config\";\nimport { ComponentContext } from \"../contexts/ComponentContext\";\nimport { stopAccumulatingRules } from \"../helpers/insertStyleRule\";\nimport { updateMediaListeners } from \"../hooks/useMedia\";\nimport { ConfigRevisionCheck } from \"./ConfigRevisionCheck\";\nimport { SafeAreaTracker, hasSafeAreaTracker } from \"./SafeAreaTracker\";\nimport { TamaguiRoot } from \"./TamaguiRoot\";\nimport { ThemeProvider } from \"./ThemeProvider\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nlet _cachedFirstKey;\nlet _cachedConfig;\nfunction firstThemeKey(config) {\n\tif (config !== _cachedConfig) {\n\t\t_cachedConfig = config;\n\t\t_cachedFirstKey = config?.themes ? Object.keys(config.themes)[0] : void 0;\n\t}\n\treturn _cachedFirstKey;\n}\nfunction TamaguiProvider({ children, disableInjectCSS, config, className, defaultTheme: defaultThemeProp, insets, isSubtreeRoot }) {\n\tconst defaultTheme = defaultThemeProp || firstThemeKey(config) || \"light\";\n\tuseIsomorphicLayoutEffect(() => {\n\t\tupdateMediaListeners();\n\t\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) return stopAccumulatingRules();\n\t}, []);\n\tconst memoizedInsets = React.useMemo(() => insets, [\n\t\tinsets?.top,\n\t\tinsets?.right,\n\t\tinsets?.bottom,\n\t\tinsets?.left\n\t]);\n\tconst configuredAnimationDriver = config?.animations;\n\tconst defaultAnimationDriver = !configuredAnimationDriver || configuredAnimationDriver.isStub ? null : configuredAnimationDriver;\n\tuseEffect(() => {\n\t\tdefaultAnimationDriver?.onMount?.();\n\t}, []);\n\tlet contents = /* @__PURE__ */ jsx(ComponentContext.Provider, {\n\t\tanimationDriver: defaultAnimationDriver,\n\t\tinsets: memoizedInsets,\n\t\tchildren: /* @__PURE__ */ jsx(ThemeProvider, {\n\t\t\tdefaultTheme,\n\t\t\tclassName,\n\t\t\tisSubtreeRoot,\n\t\t\tchildren: /* @__PURE__ */ jsx(TamaguiRoot, {\n\t\t\t\ttheme: defaultTheme,\n\t\t\t\tisRootRoot: true,\n\t\t\t\tchildren\n\t\t\t})\n\t\t})\n\t});\n\tif (getSetting(\"disableSSR\")) contents = /* @__PURE__ */ jsx(ClientOnly, {\n\t\tenabled: true,\n\t\tchildren: contents\n\t});\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [\n\t\t!process.env.TAMAGUI_DID_OUTPUT_CSS && config && !disableInjectCSS && /* @__PURE__ */ jsx(\"style\", {\n\t\t\tprecedence: \"default\",\n\t\t\thref: \"tamagui-css\",\n\t\t\tchildren: config.getCSS()\n\t\t}, \"tamagui-css\"),\n\t\
|
|
1
|
+
{"version":3,"file":"TamaguiProvider.js","names":[],"sources":["esm/views/TamaguiProvider.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { ClientOnly } from \"@tamagui/use-did-finish-ssr\";\nimport React, { useEffect } from \"react\";\nimport { getSetting } from \"../config\";\nimport { ComponentContext } from \"../contexts/ComponentContext\";\nimport { stopAccumulatingRules } from \"../helpers/insertStyleRule\";\nimport { updateMediaListeners } from \"../hooks/useMedia\";\nimport { ConfigRevisionCheck } from \"./ConfigRevisionCheck\";\nimport { SafeAreaTracker, hasSafeAreaTracker } from \"./SafeAreaTracker\";\nimport { TamaguiRoot } from \"./TamaguiRoot\";\nimport { ThemeProvider } from \"./ThemeProvider\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nconst isProd = process.env.NODE_ENV === \"production\";\nlet _cachedFirstKey;\nlet _cachedConfig;\nfunction firstThemeKey(config) {\n\tif (config !== _cachedConfig) {\n\t\t_cachedConfig = config;\n\t\t_cachedFirstKey = config?.themes ? Object.keys(config.themes)[0] : void 0;\n\t}\n\treturn _cachedFirstKey;\n}\nfunction TamaguiProvider({ children, disableInjectCSS, config, className, defaultTheme: defaultThemeProp, insets, isSubtreeRoot }) {\n\tconst defaultTheme = defaultThemeProp || firstThemeKey(config) || \"light\";\n\tuseIsomorphicLayoutEffect(() => {\n\t\tupdateMediaListeners();\n\t\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) return stopAccumulatingRules();\n\t}, []);\n\tconst memoizedInsets = React.useMemo(() => insets, [\n\t\tinsets?.top,\n\t\tinsets?.right,\n\t\tinsets?.bottom,\n\t\tinsets?.left\n\t]);\n\tconst configuredAnimationDriver = config?.animations;\n\tconst defaultAnimationDriver = !configuredAnimationDriver || configuredAnimationDriver.isStub ? null : configuredAnimationDriver;\n\tuseEffect(() => {\n\t\tdefaultAnimationDriver?.onMount?.();\n\t}, []);\n\tlet contents = /* @__PURE__ */ jsx(ComponentContext.Provider, {\n\t\tanimationDriver: defaultAnimationDriver,\n\t\tinsets: memoizedInsets,\n\t\tchildren: /* @__PURE__ */ jsx(ThemeProvider, {\n\t\t\tdefaultTheme,\n\t\t\tclassName,\n\t\t\tisSubtreeRoot,\n\t\t\tchildren: /* @__PURE__ */ jsx(TamaguiRoot, {\n\t\t\t\ttheme: defaultTheme,\n\t\t\t\tisRootRoot: true,\n\t\t\t\tchildren\n\t\t\t})\n\t\t})\n\t});\n\tif (getSetting(\"disableSSR\")) contents = /* @__PURE__ */ jsx(ClientOnly, {\n\t\tenabled: true,\n\t\tchildren: contents\n\t});\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [\n\t\t!process.env.TAMAGUI_DID_OUTPUT_CSS && config && !disableInjectCSS && /* @__PURE__ */ jsx(\"style\", {\n\t\t\tprecedence: \"default\",\n\t\t\thref: \"tamagui-css\",\n\t\t\tchildren: config.getCSS()\n\t\t}, \"tamagui-css\"),\n\t\t!isProd && process.env.NODE_ENV !== \"production\" && config && /* @__PURE__ */ jsx(ConfigRevisionCheck, { config }),\n\t\thasSafeAreaTracker() && /* @__PURE__ */ jsx(SafeAreaTracker, {}),\n\t\tcontents\n\t] });\n}\n\nexport { TamaguiProvider };"],"mappings":";;;;;;;;;;;;;;AAaA,MAAM,SAAS,QAAQ,IAAI,aAAa;AACxC,IAAI;AACJ,IAAI;AACJ,SAAS,cAAc,QAAQ;CAC9B,IAAI,WAAW,eAAe;EAC7B,gBAAgB;EAChB,kBAAkB,QAAQ,SAAS,OAAO,KAAK,OAAO,MAAM,CAAC,CAAC,KAAK,KAAK;CACzE;CACA,OAAO;AACR;AACA,SAAS,gBAAgB,EAAE,UAAU,kBAAkB,QAAQ,WAAW,cAAc,kBAAkB,QAAQ,iBAAiB;CAClI,MAAM,eAAe,oBAAoB,cAAc,MAAM,KAAK;CAClE,gCAAgC;EAC/B,qBAAqB;EACrB,IAAI,CAAC,QAAQ,IAAI,wBAAwB,OAAO,sBAAsB;CACvE,GAAG,CAAC,CAAC;CACL,MAAM,iBAAiB,MAAM,cAAc,QAAQ;EAClD,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;CACT,CAAC;CACD,MAAM,4BAA4B,QAAQ;CAC1C,MAAM,yBAAyB,CAAC,6BAA6B,0BAA0B,SAAS,OAAO;CACvG,gBAAgB;EACf,wBAAwB,UAAU;CACnC,GAAG,CAAC,CAAC;CACL,IAAI,WAA2B,oBAAI,iBAAiB,UAAU;EAC7D,iBAAiB;EACjB,QAAQ;EACR,UAA0B,oBAAI,eAAe;GAC5C;GACA;GACA;GACA,UAA0B,oBAAI,aAAa;IAC1C,OAAO;IACP,YAAY;IACZ;GACD,CAAC;EACF,CAAC;CACF,CAAC;CACD,IAAI,WAAW,YAAY,GAAG,WAA2B,oBAAI,YAAY;EACxE,SAAS;EACT,UAAU;CACX,CAAC;CACD,OAAuB,qBAAK,UAAU,EAAE,UAAU;EACjD,CAAC,QAAQ,IAAI,0BAA0B,UAAU,CAAC,oBAAoC,oBAAI,SAAS;GAClG,YAAY;GACZ,MAAM;GACN,UAAU,OAAO,OAAO;EACzB,GAAG,aAAa;EAChB,CAAC,UAAU,QAAQ,IAAI,aAAa,gBAAgB,UAA0B,oBAAI,qBAAqB,EAAE,OAAO,CAAC;EACjH,mBAAmB,KAAqB,oBAAI,iBAAiB,CAAC,CAAC;EAC/D;CACD,EAAE,CAAC;AACJ"}
|
|
@@ -10,6 +10,7 @@ import { SafeAreaTracker, hasSafeAreaTracker } from "./SafeAreaTracker.native.js
|
|
|
10
10
|
import { TamaguiRoot } from "./TamaguiRoot.native.js";
|
|
11
11
|
import { ThemeProvider } from "./ThemeProvider.native.js";
|
|
12
12
|
|
|
13
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
13
14
|
var _cachedFirstKey;
|
|
14
15
|
var _cachedConfig;
|
|
15
16
|
function firstThemeKey(config) {
|
|
@@ -60,7 +61,7 @@ function TamaguiProvider(param) {
|
|
|
60
61
|
});
|
|
61
62
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
63
|
!process.env.TAMAGUI_DID_OUTPUT_CSS && false,
|
|
63
|
-
process.env.NODE_ENV !== "production" && false,
|
|
64
|
+
!isProd && process.env.NODE_ENV !== "production" && false,
|
|
64
65
|
hasSafeAreaTracker() && /* @__PURE__ */ jsx(SafeAreaTracker, {}),
|
|
65
66
|
contents
|
|
66
67
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TamaguiProvider.native.js","names":[],"sources":["esm/views/TamaguiProvider.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { ClientOnly } from \"@tamagui/use-did-finish-ssr\";\nimport React, { useEffect } from \"react\";\nimport { getSetting } from \"../config\";\nimport { ComponentContext } from \"../contexts/ComponentContext\";\nimport { stopAccumulatingRules } from \"../helpers/insertStyleRule\";\nimport { updateMediaListeners } from \"../hooks/useMedia\";\nimport { SafeAreaTracker, hasSafeAreaTracker } from \"./SafeAreaTracker\";\nimport { TamaguiRoot } from \"./TamaguiRoot\";\nimport { ThemeProvider } from \"./ThemeProvider\";\n\nvar _cachedFirstKey;\nvar _cachedConfig;\nfunction firstThemeKey(config) {\n\tif (config !== _cachedConfig) {\n\t\t_cachedConfig = config;\n\t\t_cachedFirstKey = (config === null || config === void 0 ? void 0 : config.themes) ? Object.keys(config.themes)[0] : void 0;\n\t}\n\treturn _cachedFirstKey;\n}\nfunction TamaguiProvider(param) {\n\tvar { children, disableInjectCSS, config, className, defaultTheme: defaultThemeProp, insets, isSubtreeRoot } = param;\n\tvar defaultTheme = defaultThemeProp || firstThemeKey(config) || \"light\";\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateMediaListeners();\n\t\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) return stopAccumulatingRules();\n\t}, []);\n\tvar memoizedInsets = React.useMemo(function() {\n\t\treturn insets;\n\t}, [\n\t\tinsets === null || insets === void 0 ? void 0 : insets.top,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.right,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.bottom,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.left\n\t]);\n\tvar configuredAnimationDriver = config === null || config === void 0 ? void 0 : config.animations;\n\tvar defaultAnimationDriver = !configuredAnimationDriver || configuredAnimationDriver.isStub ? null : configuredAnimationDriver;\n\tuseEffect(function() {\n\t\tvar _defaultAnimationDriver_onMount;\n\t\tdefaultAnimationDriver === null || defaultAnimationDriver === void 0 || (_defaultAnimationDriver_onMount = defaultAnimationDriver.onMount) == null || _defaultAnimationDriver_onMount.call(defaultAnimationDriver);\n\t}, []);\n\tvar contents = /* @__PURE__ */ jsx(ComponentContext.Provider, {\n\t\tanimationDriver: defaultAnimationDriver,\n\t\tinsets: memoizedInsets,\n\t\tchildren: /* @__PURE__ */ jsx(ThemeProvider, {\n\t\t\tdefaultTheme,\n\t\t\tclassName,\n\t\t\tisSubtreeRoot,\n\t\t\tchildren: /* @__PURE__ */ jsx(TamaguiRoot, {\n\t\t\t\ttheme: defaultTheme,\n\t\t\t\tisRootRoot: true,\n\t\t\t\tchildren\n\t\t\t})\n\t\t})\n\t});\n\tif (getSetting(\"disableSSR\")) contents = /* @__PURE__ */ jsx(ClientOnly, {\n\t\tenabled: true,\n\t\tchildren: contents\n\t});\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [\n\t\t!process.env.TAMAGUI_DID_OUTPUT_CSS && false,\n\t\
|
|
1
|
+
{"version":3,"file":"TamaguiProvider.native.js","names":[],"sources":["esm/views/TamaguiProvider.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { ClientOnly } from \"@tamagui/use-did-finish-ssr\";\nimport React, { useEffect } from \"react\";\nimport { getSetting } from \"../config\";\nimport { ComponentContext } from \"../contexts/ComponentContext\";\nimport { stopAccumulatingRules } from \"../helpers/insertStyleRule\";\nimport { updateMediaListeners } from \"../hooks/useMedia\";\nimport { SafeAreaTracker, hasSafeAreaTracker } from \"./SafeAreaTracker\";\nimport { TamaguiRoot } from \"./TamaguiRoot\";\nimport { ThemeProvider } from \"./ThemeProvider\";\n\nvar isProd = process.env.NODE_ENV === \"production\";\nvar _cachedFirstKey;\nvar _cachedConfig;\nfunction firstThemeKey(config) {\n\tif (config !== _cachedConfig) {\n\t\t_cachedConfig = config;\n\t\t_cachedFirstKey = (config === null || config === void 0 ? void 0 : config.themes) ? Object.keys(config.themes)[0] : void 0;\n\t}\n\treturn _cachedFirstKey;\n}\nfunction TamaguiProvider(param) {\n\tvar { children, disableInjectCSS, config, className, defaultTheme: defaultThemeProp, insets, isSubtreeRoot } = param;\n\tvar defaultTheme = defaultThemeProp || firstThemeKey(config) || \"light\";\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateMediaListeners();\n\t\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) return stopAccumulatingRules();\n\t}, []);\n\tvar memoizedInsets = React.useMemo(function() {\n\t\treturn insets;\n\t}, [\n\t\tinsets === null || insets === void 0 ? void 0 : insets.top,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.right,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.bottom,\n\t\tinsets === null || insets === void 0 ? void 0 : insets.left\n\t]);\n\tvar configuredAnimationDriver = config === null || config === void 0 ? void 0 : config.animations;\n\tvar defaultAnimationDriver = !configuredAnimationDriver || configuredAnimationDriver.isStub ? null : configuredAnimationDriver;\n\tuseEffect(function() {\n\t\tvar _defaultAnimationDriver_onMount;\n\t\tdefaultAnimationDriver === null || defaultAnimationDriver === void 0 || (_defaultAnimationDriver_onMount = defaultAnimationDriver.onMount) == null || _defaultAnimationDriver_onMount.call(defaultAnimationDriver);\n\t}, []);\n\tvar contents = /* @__PURE__ */ jsx(ComponentContext.Provider, {\n\t\tanimationDriver: defaultAnimationDriver,\n\t\tinsets: memoizedInsets,\n\t\tchildren: /* @__PURE__ */ jsx(ThemeProvider, {\n\t\t\tdefaultTheme,\n\t\t\tclassName,\n\t\t\tisSubtreeRoot,\n\t\t\tchildren: /* @__PURE__ */ jsx(TamaguiRoot, {\n\t\t\t\ttheme: defaultTheme,\n\t\t\t\tisRootRoot: true,\n\t\t\t\tchildren\n\t\t\t})\n\t\t})\n\t});\n\tif (getSetting(\"disableSSR\")) contents = /* @__PURE__ */ jsx(ClientOnly, {\n\t\tenabled: true,\n\t\tchildren: contents\n\t});\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [\n\t\t!process.env.TAMAGUI_DID_OUTPUT_CSS && false,\n\t\t!isProd && process.env.NODE_ENV !== \"production\" && false,\n\t\thasSafeAreaTracker() && /* @__PURE__ */ jsx(SafeAreaTracker, {}),\n\t\tcontents\n\t] });\n}\n\nexport { TamaguiProvider };"],"mappings":";;;;;;;;;;;;;AAYA,IAAI,SAAS,QAAQ,IAAI,aAAa;AACtC,IAAI;AACJ,IAAI;AACJ,SAAS,cAAc,QAAQ;CAC9B,IAAI,WAAW,eAAe;EAC7B,gBAAgB;EAChB,mBAAmB,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,UAAU,OAAO,KAAK,OAAO,MAAM,CAAC,CAAC,KAAK,KAAK;CAC1H;CACA,OAAO;AACR;AACA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,EAAE,UAAU,kBAAkB,QAAQ,WAAW,cAAc,kBAAkB,QAAQ,kBAAkB;CAC/G,IAAI,eAAe,oBAAoB,cAAc,MAAM,KAAK;CAChE,0BAA0B,WAAW;EACpC,qB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
|
10
10
|
import { ThemeDebug } from "./ThemeDebug.mjs";
|
|
11
11
|
import { jsx } from "react/jsx-runtime";
|
|
12
12
|
|
|
13
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
13
14
|
const Theme = createRefComponent(function Theme2(props, ref) {
|
|
14
15
|
"use no memo";
|
|
15
16
|
if (props.disable) return props.children;
|
|
16
|
-
if (process.env.NODE_ENV === "development") {
|
|
17
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
17
18
|
for (const key in props) if (!reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
|
|
18
19
|
}
|
|
19
20
|
const { passThrough } = props;
|
|
@@ -34,7 +35,7 @@ function getThemedChildren(themeState, children, props, isRoot = false, stateRef
|
|
|
34
35
|
const { shallow, forceClassName } = props;
|
|
35
36
|
const state = stateRef.current;
|
|
36
37
|
let shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);
|
|
37
|
-
if (process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ jsx(ThemeDebug, {
|
|
38
|
+
if (!isProd && process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ jsx(ThemeDebug, {
|
|
38
39
|
themeState,
|
|
39
40
|
themeProps: props,
|
|
40
41
|
children
|
|
@@ -51,7 +52,7 @@ function getThemedChildren(themeState, children, props, isRoot = false, stateRef
|
|
|
51
52
|
if (requiresExtraWrapper || isFirstThemedRender && (themeState.name === "dark" || themeState.name === "light")) state.hasEverThemed = "wrapped";
|
|
52
53
|
if (shallow) if (!themeState.parentId) {} else {
|
|
53
54
|
const parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);
|
|
54
|
-
if (!parentState) throw new Error(process.env.NODE_ENV !== "production" ? formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
55
|
+
if (!parentState) throw new Error(!isProd && process.env.NODE_ENV !== "production" ? formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
55
56
|
name: themeState.name,
|
|
56
57
|
parentId: themeState.parentId
|
|
57
58
|
}) : "❌ Error 014");
|
|
@@ -62,7 +63,7 @@ function getThemedChildren(themeState, children, props, isRoot = false, stateRef
|
|
|
62
63
|
})) : child;
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
if (process.env.NODE_ENV === "development") {
|
|
66
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
66
67
|
if (!passThrough && props.debug) console.warn(` getThemedChildren`, {
|
|
67
68
|
requiresExtraWrapper,
|
|
68
69
|
forceClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (const key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tconst { passThrough } = props;\n\tconst isRoot = !!props[\"_isRoot\"];\n\tconst [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(() => {}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tlet finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { [\"data-disable-theme\"]: true })) : props.children;\n\tif (ref && isValidElement(finalChildren)) finalChildren = cloneElement(finalChildren, { ref });\n\tconst stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props, isRoot = false, stateRef, passThrough = false) {\n\tconst { shallow, forceClassName } = props;\n\tconst state = stateRef.current;\n\tlet shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tconst { isInverse } = themeState;\n\tconst requiresExtraWrapper = isInverse || forceClassName;\n\tconst isFirstThemedRender = !state.hasEverThemed;\n\tif (isFirstThemedRender) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || isFirstThemedRender && (themeState.name === \"dark\" || themeState.name === \"light\")) state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tconst parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map((child) => {\n\t\t\treturn isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tconst baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tconst { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tconst inlineClassName = passThrough ? void 0 : props._themeUpdate?.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tconst scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;\n\t\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: scheme ? `t_${scheme} _dsp_contents` : \"_dsp_contents\",\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nconst inertStyle = { display: \"contents\" };\nconst inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nconst empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot, themeState.schemeAuthored)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC5D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst isProd = process.env.NODE_ENV === \"production\";\nconst Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (!isProd && process.env.NODE_ENV === \"development\") {\n\t\tfor (const key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tconst { passThrough } = props;\n\tconst isRoot = !!props[\"_isRoot\"];\n\tconst [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(() => {}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tlet finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { [\"data-disable-theme\"]: true })) : props.children;\n\tif (ref && isValidElement(finalChildren)) finalChildren = cloneElement(finalChildren, { ref });\n\tconst stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props, isRoot = false, stateRef, passThrough = false) {\n\tconst { shallow, forceClassName } = props;\n\tconst state = stateRef.current;\n\tlet shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (!isProd && process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tconst { isInverse } = themeState;\n\tconst requiresExtraWrapper = isInverse || forceClassName;\n\tconst isFirstThemedRender = !state.hasEverThemed;\n\tif (isFirstThemedRender) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || isFirstThemedRender && (themeState.name === \"dark\" || themeState.name === \"light\")) state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tconst parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(!isProd && process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map((child) => {\n\t\t\treturn isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (!isProd && process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tconst baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tconst { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tconst inlineClassName = passThrough ? void 0 : props._themeUpdate?.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tconst scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;\n\t\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: scheme ? `t_${scheme} _dsp_contents` : \"_dsp_contents\",\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nconst inertStyle = { display: \"contents\" };\nconst inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nconst empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot, themeState.schemeAuthored)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,SAAS,QAAQ,IAAI,aAAa;AACxC,MAAM,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC5D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,CAAC,UAAU,QAAQ,IAAI,aAAa,eAAe;EACtD,KAAK,MAAM,OAAO,OAAO,IAAI,CAAC,mBAAmB,QAAQ,QAAQ,YAAY,CAAC,IAAI,WAAW,OAAO,GAAG,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACnP;CACA,MAAM,EAAE,gBAAgB;CACxB,MAAM,SAAS,CAAC,CAAC,MAAM;CACvB,MAAM,CAAC,GAAG,cAAc,kBAAkB,OAAO,QAAQ,IAAI;CAC7D,gCAAgC,CAAC,GAAG;EACnC,WAAW;EACX,WAAW;EACX,WAAW;CACZ,CAAC;CACD,IAAI,gBAAgB,MAAM,yBAAyB,SAAS,IAAI,MAAM,WAAW,UAAU,eAAe,CAAC,eAAe,KAAK,IAAI,QAAQ,aAAa,OAAO,GAAG,uBAAuB,KAAK,CAAC,CAAC,IAAI,MAAM;CAC1M,IAAI,OAAO,eAAe,aAAa,GAAG,gBAAgB,aAAa,eAAe,EAAE,IAAI,CAAC;CAC7F,MAAM,WAAW,OAAO,EAAE,eAAe,MAAM,CAAC;CAChD,OAAO,kBAAkB,YAAY,eAAe,OAAO,QAAQ,UAAU,WAAW;AACzF,CAAC;AACD,MAAM,qBAAqB;AAC3B,SAAS,kBAAkB,YAAY,UAAU,OAAO,SAAS,OAAO,UAAU,cAAc,OAAO;CACtG,MAAM,EAAE,SAAS,mBAAmB;CACpC,MAAM,QAAQ,SAAS;CACv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C,IAAI,OAAO;EACV,MAAM,YAAY,MAAM,UAAU,sBAAsB;EACxD,MAAM,EAAE,YAAY,IAAI,UAAU,cAAc,CAAC,IAAI,0BAA0B,YAAY,OAAO,MAAM;EACxG,MAAM,kBAAkB,cAAc,KAAK,IAAI,MAAM,cAAc;EACnE,WAA2B,oBAAI,QAAQ;GACtC,WAAW,GAAG,UAAU,WAAW,kBAAkB,IAAI,oBAAoB;GAC7E,OAAO,cAAc,YAAY;IAChC;IACA,GAAG;GACJ;GACA;EACD,CAAC;EACD,IAAI,MAAM,kBAAkB,WAAW;GACtC,MAAM,SAAS,wBAAwB,WAAW,kBAAkB,WAAW;GAC/E,WAA2B,oBAAI,QAAQ;IACtC,WAAW,SAAS,KAAK,OAAO,kBAAkB;IAClD;GACD,CAAC;EACF;EACA,OAAO;CACR;CACA,OAAO;AACR;AACA,MAAM,aAAa,EAAE,SAAS,WAAW;AACzC,MAAM,sBAAsB;CAC3B,SAAS;CACT,SAAS;AACV;AACA,MAAM,QAAQ;CACb,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO,QAAQ;CAC7D,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,OAAO,YAAY,SAAS,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EAC1F,WAAW,mBAAmB,WAAW,MAAM,QAAQ,WAAW,cAAc;CACjF;AACD"}
|
|
@@ -11,10 +11,11 @@ import { useThemeWithState } from "../hooks/useTheme.native.js";
|
|
|
11
11
|
import { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from "../hooks/useThemeState.native.js";
|
|
12
12
|
import { ThemeDebug } from "./ThemeDebug.native.js";
|
|
13
13
|
|
|
14
|
+
var isProd = process.env.NODE_ENV === "production";
|
|
14
15
|
var Theme = createRefComponent(function Theme2(props, ref) {
|
|
15
16
|
"use no memo";
|
|
16
17
|
if (props.disable) return props.children;
|
|
17
|
-
if (process.env.NODE_ENV === "development") {
|
|
18
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
18
19
|
for (var key in props) if (!reservedThemeProps[key] && key !== "srcloc" && !key.startsWith("data-")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);
|
|
19
20
|
}
|
|
20
21
|
var { passThrough } = props;
|
|
@@ -43,7 +44,7 @@ function getThemedChildren(themeState, children, props) {
|
|
|
43
44
|
var { shallow, forceClassName } = props;
|
|
44
45
|
var state = stateRef.current;
|
|
45
46
|
var shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);
|
|
46
|
-
if (process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ jsx(ThemeDebug, {
|
|
47
|
+
if (!isProd && process.env.NODE_ENV === "development" && props.debug === "visualize") children = /* @__PURE__ */ jsx(ThemeDebug, {
|
|
47
48
|
themeState,
|
|
48
49
|
themeProps: props,
|
|
49
50
|
children
|
|
@@ -60,7 +61,7 @@ function getThemedChildren(themeState, children, props) {
|
|
|
60
61
|
if (requiresExtraWrapper || isFirstThemedRender && (themeState.name === "dark" || themeState.name === "light")) state.hasEverThemed = "wrapped";
|
|
61
62
|
if (shallow) if (!themeState.parentId) {} else {
|
|
62
63
|
var parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);
|
|
63
|
-
if (!parentState) throw new Error(process.env.NODE_ENV !== "production" ? formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
64
|
+
if (!parentState) throw new Error(!isProd && process.env.NODE_ENV !== "production" ? formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
64
65
|
name: themeState.name,
|
|
65
66
|
parentId: themeState.parentId
|
|
66
67
|
}) : "❌ Error 014");
|
|
@@ -71,7 +72,7 @@ function getThemedChildren(themeState, children, props) {
|
|
|
71
72
|
})) : child;
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
if (process.env.NODE_ENV === "development") {
|
|
75
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
75
76
|
if (!passThrough && props.debug) console.warn(` getThemedChildren`, {
|
|
76
77
|
requiresExtraWrapper,
|
|
77
78
|
forceClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { removeNativeStyleScope, updateNativeStyleScope } from \"../helpers/nativeStyleEngine\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\n\nvar Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateNativeStyleScope(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn removeNativeStyleScope(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref && /* @__PURE__ */ isValidElement(finalChildren)) finalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });\n\tvar stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tvar isFirstThemedRender = !state.hasEverThemed;\n\tif (isFirstThemedRender) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || isFirstThemedRender && (themeState.name === \"dark\" || themeState.name === \"light\")) state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tvar scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;\n\t\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: scheme ? `t_${scheme} _dsp_contents` : \"_dsp_contents\",\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot, themeState.schemeAuthored)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;AAaA,IAAI,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC1D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { removeNativeStyleScope, updateNativeStyleScope } from \"../helpers/nativeStyleEngine\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\n\nvar isProd = process.env.NODE_ENV === \"production\";\nvar Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (!isProd && process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateNativeStyleScope(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn removeNativeStyleScope(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref && /* @__PURE__ */ isValidElement(finalChildren)) finalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });\n\tvar stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (!isProd && process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tvar isFirstThemedRender = !state.hasEverThemed;\n\tif (isFirstThemedRender) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || isFirstThemedRender && (themeState.name === \"dark\" || themeState.name === \"light\")) state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(!isProd && process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (!isProd && process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tvar scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;\n\t\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: scheme ? `t_${scheme} _dsp_contents` : \"_dsp_contents\",\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot, themeState.schemeAuthored)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;AAaA,IAAI,SAAS,QAAQ,IAAI,aAAa;AACtC,IAAI,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC1D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,CAAC,UAAU,QAAQ,IAAI,aAAa,eAAe;EACtD,KAAK,IAAI,OAAO,OAAO,IAAI,CAAC,mBAAmB,QAAQ,QAAQ,YAAY,CAAC,IAAI,WAAW,OAAO,GAAG,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACjP;CACA,IAAI,EAAE,gBAA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AAoB;EAClK,WAA2B,oBAAI,QAAQ;GACtC,WAAW,GAAG,UAAU,WAAW,kBAAkB,IAAI,oBAAoB;GAC7E,OAAO,cAAc,YAAY;IAChC;IACA,GAAG;GACJ;GACA;EACD,CAAC;EACD,IAAI,MAAM,kBAAkB,WAAW;GACtC,IAAI,SAAS,wBAAwB,WAAW,kBAAkB,WAAW;GAC7E,WAA2B,oBAAI,QAAQ;IACtC,WAAW,SAAS,KAAK,OAAO,kBAAkB;IAClD;GACD,CAAC;EACF;EACA,OAAO;CACR;CACA,OAAO;AACR;AACA,IAAI,aAAa,EAAE,SAAS,WAAW;AACvC,IAAI,sBAAsB;CACzB,SAAS;CACT,SAAS;AACV;AACA,IAAI,QAAQ;CACX,WAAW;CACX,OAAO,KAAK;AACb;AACA,SAAS,0BAA0B,YAAY,OAAO,QAAQ;CAC7D,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EACnJ,WAAW,mBAAmB,WAAW,MAAM,QAAQ,WAAW,cAAc;CACjF;AACD"}
|
|
@@ -4,11 +4,12 @@ import { createPortal } from "react-dom";
|
|
|
4
4
|
import { getThemeState } from "../hooks/useThemeState.mjs";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
|
+
const isProd = process.env.NODE_ENV === "production";
|
|
7
8
|
let node;
|
|
8
9
|
function ThemeDebug({ themeState, themeProps, children }) {
|
|
9
|
-
if (process.env.NODE_ENV === "development") {
|
|
10
|
+
if (!isProd && process.env.NODE_ENV === "development") {
|
|
10
11
|
const isHydrated = useDidFinishSSR();
|
|
11
|
-
if (process.env.NODE_ENV === "development" && typeof document !== "undefined") {
|
|
12
|
+
if (!isProd && process.env.NODE_ENV === "development" && typeof document !== "undefined") {
|
|
12
13
|
if (!node) {
|
|
13
14
|
node = document.createElement("div");
|
|
14
15
|
node.style.height = "200px";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeDebug.js","names":[],"sources":["esm/views/ThemeDebug.js"],"sourcesContent":["import { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { getThemeState } from \"../hooks/useThemeState\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nlet node;\nfunction ThemeDebug({\n themeState,\n themeProps,\n children\n}) {\n if (process.env.NODE_ENV === \"development\") {\n const isHydrated = useDidFinishSSR();\n if (process.env.NODE_ENV === \"development\" && typeof document !== \"undefined\") {\n if (!node) {\n node = document.createElement(\"div\");\n node.style.height = \"200px\";\n node.style.overflowY = \"scroll\";\n node.style.position = \"fixed\";\n node.style.zIndex = 1e7;\n node.style.bottom = \"30px\";\n node.style.left = \"30px\";\n node.style.right = \"30px\";\n node.style.display = \"flex\";\n node.style.border = \"1px solid #888\";\n node.style.flexDirection = \"row\";\n node.style.background = \"var(--background)\";\n }\n }\n useEffect(() => {\n document.body.appendChild(node);\n }, []);\n if (themeProps[\"disable-child-theme\"] || !isHydrated) {\n return children;\n }\n const parentState = themeState.parentId ? getThemeState(themeState.parentId) : null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n createPortal(\n /* @__PURE__ */ jsxs(\n \"code\",\n {\n style: {\n whiteSpace: \"pre\",\n maxWidth: 250,\n overflow: \"auto\",\n padding: 5\n },\n children: [\n \"<Theme \",\n themeState.id,\n \" />\\xA0\",\n JSON.stringify(\n {\n name: themeState.name,\n \"color-1\": themeState.theme[\"color-1\"].val,\n parentId: themeState.parentId,\n // inverses: themeState.inverses,\n isNew: themeState.isNew,\n themeProps: {\n name: themeProps.name\n },\n parentState: {\n name: parentState?.name,\n isNew: parentState?.isNew\n }\n },\n null,\n 2\n )\n ]\n }\n ),\n node\n ),\n /* @__PURE__ */ jsx(\"div\", { style: { color: \"red\" }, children: themeState.id }),\n children\n ] });\n }\n return children;\n}\nThemeDebug[\"displayName\"] = \"ThemeDebug\";\nexport {\n ThemeDebug\n};\n//# sourceMappingURL=ThemeDebug.js.map\n"],"mappings":";;;;;;;AAKA,IAAI;AACJ,SAAS,WAAW,EAClB,YACA,YACA,YACC;CACD,IAAI,QAAQ,IAAI,aAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"ThemeDebug.js","names":[],"sources":["esm/views/ThemeDebug.js"],"sourcesContent":["import { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { getThemeState } from \"../hooks/useThemeState\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nconst isProd = process.env.NODE_ENV === \"production\";\nlet node;\nfunction ThemeDebug({\n themeState,\n themeProps,\n children\n}) {\n if (!isProd && process.env.NODE_ENV === \"development\") {\n const isHydrated = useDidFinishSSR();\n if (!isProd && process.env.NODE_ENV === \"development\" && typeof document !== \"undefined\") {\n if (!node) {\n node = document.createElement(\"div\");\n node.style.height = \"200px\";\n node.style.overflowY = \"scroll\";\n node.style.position = \"fixed\";\n node.style.zIndex = 1e7;\n node.style.bottom = \"30px\";\n node.style.left = \"30px\";\n node.style.right = \"30px\";\n node.style.display = \"flex\";\n node.style.border = \"1px solid #888\";\n node.style.flexDirection = \"row\";\n node.style.background = \"var(--background)\";\n }\n }\n useEffect(() => {\n document.body.appendChild(node);\n }, []);\n if (themeProps[\"disable-child-theme\"] || !isHydrated) {\n return children;\n }\n const parentState = themeState.parentId ? getThemeState(themeState.parentId) : null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n createPortal(\n /* @__PURE__ */ jsxs(\n \"code\",\n {\n style: {\n whiteSpace: \"pre\",\n maxWidth: 250,\n overflow: \"auto\",\n padding: 5\n },\n children: [\n \"<Theme \",\n themeState.id,\n \" />\\xA0\",\n JSON.stringify(\n {\n name: themeState.name,\n \"color-1\": themeState.theme[\"color-1\"].val,\n parentId: themeState.parentId,\n // inverses: themeState.inverses,\n isNew: themeState.isNew,\n themeProps: {\n name: themeProps.name\n },\n parentState: {\n name: parentState?.name,\n isNew: parentState?.isNew\n }\n },\n null,\n 2\n )\n ]\n }\n ),\n node\n ),\n /* @__PURE__ */ jsx(\"div\", { style: { color: \"red\" }, children: themeState.id }),\n children\n ] });\n }\n return children;\n}\nThemeDebug[\"displayName\"] = \"ThemeDebug\";\nexport {\n ThemeDebug\n};\n//# sourceMappingURL=ThemeDebug.js.map\n"],"mappings":";;;;;;;AAKA,MAAM,SAAS,QAAQ,IAAI,aAAa;AACxC,IAAI;AACJ,SAAS,WAAW,EAClB,YACA,YACA,YACC;CACD,IAAI,CAAC,UAAU,QAAQ,IAAI,aAAa,eAAe;EACrD,MAAM,aAAa,gBAAgB;EACnC,IAAI,CAAC,UAAU,QAAQ,IAAI,aAAa,iBAAiB,OAAO,aAAa,aAAa;GACxF,IAAI,CAAC,MAAM;IACT,OAAO,SAAS,cAAc,KAAK;IACnC,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,YAAY;IACvB,KAAK,MAAM,WAAW;IACtB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,OAAO;IAClB,KAAK,MAAM,QAAQ;IACnB,KAAK,MAAM,UAAU;IACrB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,gBAAgB;IAC3B,KAAK,MAAM,aAAa;GAC1B;EACF;EACA,gBAAgB;GACd,SAAS,KAAK,YAAY,IAAI;EAChC,GAAG,CAAC,CAAC;EACL,IAAI,WAAW,0BAA0B,CAAC,YAAY;GACpD,OAAO;EACT;EACA,MAAM,cAAc,WAAW,WAAW,cAAc,WAAW,QAAQ,IAAI;EAC/E,OAAuB,qBAAK,UAAU,EAAE,UAAU;GAChD,aACkB,qBACd,QACA;IACE,OAAO;KACL,YAAY;KACZ,UAAU;KACV,UAAU;KACV,SAAS;IACX;IACA,UAAU;KACR;KACA,WAAW;KACX;KACA,KAAK,UACH;MACE,MAAM,WAAW;MACjB,WAAW,WAAW,MAAM,UAAU,CAAC;MACvC,UAAU,WAAW;MAErB,OAAO,WAAW;MAClB,YAAY,EACV,MAAM,WAAW,KACnB;MACA,aAAa;OACX,MAAM,aAAa;OACnB,OAAO,aAAa;MACtB;KACF,GACA,MACA,CACF;IACF;GACF,CACF,GACA,IACF;GACgB,oBAAI,OAAO;IAAE,OAAO,EAAE,OAAO,MAAM;IAAG,UAAU,WAAW;GAAG,CAAC;GAC/E;EACF,EAAE,CAAC;CACL;CACA,OAAO;AACT;AACA,WAAW,iBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Nate Wienert"
|
|
@@ -100,28 +100,28 @@
|
|
|
100
100
|
"test:web": "vitest --typecheck --run"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@tamagui/animation-helpers": "3.
|
|
104
|
-
"@tamagui/compose-refs": "3.
|
|
105
|
-
"@tamagui/constants": "3.
|
|
106
|
-
"@tamagui/dom": "3.
|
|
107
|
-
"@tamagui/helpers": "3.
|
|
108
|
-
"@tamagui/is-equal-shallow": "3.
|
|
109
|
-
"@tamagui/native": "3.
|
|
110
|
-
"@tamagui/normalize-css-color": "3.
|
|
111
|
-
"@tamagui/react-native-types": "3.
|
|
112
|
-
"@tamagui/style-grammar": "3.
|
|
113
|
-
"@tamagui/types": "3.
|
|
114
|
-
"@tamagui/use-did-finish-ssr": "3.
|
|
115
|
-
"@tamagui/use-event": "3.
|
|
116
|
-
"@tamagui/use-force-update": "3.
|
|
103
|
+
"@tamagui/animation-helpers": "3.1.1",
|
|
104
|
+
"@tamagui/compose-refs": "3.1.1",
|
|
105
|
+
"@tamagui/constants": "3.1.1",
|
|
106
|
+
"@tamagui/dom": "3.1.1",
|
|
107
|
+
"@tamagui/helpers": "3.1.1",
|
|
108
|
+
"@tamagui/is-equal-shallow": "3.1.1",
|
|
109
|
+
"@tamagui/native": "3.1.1",
|
|
110
|
+
"@tamagui/normalize-css-color": "3.1.1",
|
|
111
|
+
"@tamagui/react-native-types": "3.1.1",
|
|
112
|
+
"@tamagui/style-grammar": "3.1.1",
|
|
113
|
+
"@tamagui/types": "3.1.1",
|
|
114
|
+
"@tamagui/use-did-finish-ssr": "3.1.1",
|
|
115
|
+
"@tamagui/use-event": "3.1.1",
|
|
116
|
+
"@tamagui/use-force-update": "3.1.1"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
|
-
"@tamagui/build": "3.
|
|
119
|
+
"@tamagui/build": "3.1.1",
|
|
120
120
|
"@testing-library/react": "^16.1.0",
|
|
121
121
|
"csstype": "^3.0.10",
|
|
122
|
-
"react": "19.
|
|
123
|
-
"react-dom": "19.
|
|
124
|
-
"react-native": "0.
|
|
122
|
+
"react": "19.3.0",
|
|
123
|
+
"react-dom": "19.3.0",
|
|
124
|
+
"react-native": "0.88.0",
|
|
125
125
|
"typescript": "7.0.2",
|
|
126
126
|
"vitest": "4.1.0"
|
|
127
127
|
},
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"./dist/cjs": "./dist/esm/index.native.js",
|
|
134
134
|
"./theme-update": "./dist/esm/theme-update.native.js"
|
|
135
135
|
},
|
|
136
|
-
"releaseSourceCommit": "
|
|
136
|
+
"releaseSourceCommit": "9c48b9263440e4062a9302751b7f8b2d24a3bbed"
|
|
137
137
|
}
|
package/src/Tamagui.ts
CHANGED
|
@@ -4,11 +4,13 @@ import { getConfig } from './config'
|
|
|
4
4
|
import { getAllRules, getAllSelectors } from './helpers/insertStyleRule'
|
|
5
5
|
import { mediaState } from './helpers/mediaState'
|
|
6
6
|
|
|
7
|
+
const isProd = process.env.NODE_ENV === 'production'
|
|
8
|
+
|
|
7
9
|
// easy introspection
|
|
8
10
|
// only included in dev mode
|
|
9
11
|
|
|
10
12
|
export const Tamagui = (() => {
|
|
11
|
-
if (process.env.NODE_ENV === 'development') {
|
|
13
|
+
if (!isProd && process.env.NODE_ENV === 'development') {
|
|
12
14
|
class TamaguiManager {
|
|
13
15
|
Helpers = Helpers
|
|
14
16
|
|
package/src/_withStableStyle.tsx
CHANGED
|
@@ -5,6 +5,8 @@ import { useMedia } from './hooks/useMedia'
|
|
|
5
5
|
import { useTheme } from './hooks/useTheme'
|
|
6
6
|
import { ThemeStateContext } from './hooks/useThemeState'
|
|
7
7
|
|
|
8
|
+
const isProd = process.env.NODE_ENV === 'production'
|
|
9
|
+
|
|
8
10
|
/** internal: this is for tamagui babel plugin usage only */
|
|
9
11
|
|
|
10
12
|
const EMPTY_EXPRESSIONS: any[] = []
|
|
@@ -67,7 +69,7 @@ export const _withStableStyle = (
|
|
|
67
69
|
break
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
|
-
if (process.env.NODE_ENV === 'development') {
|
|
72
|
+
if (!isProd && process.env.NODE_ENV === 'development') {
|
|
71
73
|
console.warn(
|
|
72
74
|
'[@tamagui] _withStableStyle: no ThemeStateContext found. ' +
|
|
73
75
|
'This usually means duplicate tamagui instances in a monorepo. ' +
|