@tamagui/web 3.0.0-beta.765.1 → 3.0.0-beta.804.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/createComponent.cjs +83 -86
- package/dist/cjs/createComponent.native.cjs +96 -103
- package/dist/cjs/createComponent.native.js +96 -103
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +9 -7
- package/dist/cjs/createTamagui.native.cjs +9 -7
- package/dist/cjs/createTamagui.native.js +9 -7
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.cjs +0 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.cjs +0 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js +0 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +348 -0
- package/dist/cjs/helpers/directStyleCSS.native.cjs +20 -0
- package/dist/cjs/helpers/directStyleCSS.native.js +22 -0
- package/dist/cjs/helpers/directStyleCSS.native.js.map +1 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.cjs +40 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +46 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js +48 -0
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +1 -0
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +92 -74
- package/dist/cjs/helpers/{getFontLanguage.native.cjs → getCSSStylesAtomicCompiled.cjs} +12 -8
- package/dist/cjs/helpers/{getFontLanguage.native.js → getCSSStylesAtomicCompiled.native.cjs} +12 -8
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +36 -0
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -0
- package/dist/cjs/helpers/getSplitStyles.cjs +2417 -548
- package/dist/cjs/helpers/getSplitStyles.native.cjs +2758 -621
- package/dist/cjs/helpers/getSplitStyles.native.js +2758 -621
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +8 -3
- package/dist/cjs/helpers/getVariantExtras.native.cjs +8 -3
- package/dist/cjs/helpers/getVariantExtras.native.js +8 -3
- package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +2 -1
- package/dist/cjs/helpers/insertStyleRule.native.cjs +68 -5
- package/dist/cjs/helpers/insertStyleRule.native.js +68 -5
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/mediaState.cjs +12 -0
- package/dist/cjs/helpers/mediaState.native.cjs +12 -0
- package/dist/cjs/helpers/mediaState.native.js +12 -0
- package/dist/cjs/helpers/mediaState.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStyle.cjs +16 -2
- package/dist/cjs/helpers/normalizeStyle.native.cjs +16 -2
- package/dist/cjs/helpers/normalizeStyle.native.js +16 -2
- package/dist/cjs/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/resolveRem.cjs +1 -1
- package/dist/cjs/helpers/skipProps.cjs +6 -1
- package/dist/cjs/helpers/skipProps.native.cjs +6 -1
- package/dist/cjs/helpers/skipProps.native.js +6 -1
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/styleFrontend.cjs +2 -8
- package/dist/cjs/helpers/styleFrontend.native.cjs +2 -10
- package/dist/cjs/helpers/styleFrontend.native.js +2 -10
- package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
- package/dist/cjs/helpers/styleToCSS.cjs +59 -0
- package/dist/cjs/helpers/{normalizeStylePropKeys.cjs → styleToCSS.native.cjs} +6 -4
- package/dist/cjs/helpers/{getFontLanguage.cjs → styleToCSS.native.js} +8 -4
- package/dist/cjs/helpers/styleToCSS.native.js.map +1 -0
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +28 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +45 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +45 -1
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +3 -2
- package/dist/cjs/helpers/variables.native.cjs +3 -2
- package/dist/cjs/helpers/variables.native.js +3 -2
- package/dist/cjs/helpers/variables.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +5 -3
- package/dist/cjs/helpers/wrapStyleTags.native.cjs +3 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js +3 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +70 -89
- package/dist/cjs/hooks/useComponentState.native.cjs +70 -88
- package/dist/cjs/hooks/useComponentState.native.js +70 -88
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +3 -15
- package/dist/cjs/hooks/useMedia.native.cjs +3 -15
- package/dist/cjs/hooks/useMedia.native.js +3 -15
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useProps.cjs +7 -5
- package/dist/cjs/hooks/useProps.native.cjs +7 -5
- package/dist/cjs/hooks/useProps.native.js +7 -5
- package/dist/cjs/hooks/useProps.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +42 -0
- package/dist/cjs/hooks/useSplitStyles.native.cjs +42 -0
- package/dist/cjs/hooks/useSplitStyles.native.js +44 -0
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -0
- package/dist/cjs/index.cjs +184 -70
- package/dist/cjs/index.native.cjs +184 -70
- package/dist/cjs/index.native.js +184 -70
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/insertFont.cjs +1 -1
- package/dist/cjs/insertFont.native.cjs +1 -0
- package/dist/cjs/insertFont.native.js +1 -0
- package/dist/cjs/insertFont.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +33 -6
- package/dist/cjs/internal-runtime.native.cjs +33 -6
- package/dist/cjs/internal-runtime.native.js +33 -6
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/setupReactNative.cjs +1 -29
- package/dist/cjs/setupReactNative.native.cjs +1 -3
- package/dist/cjs/setupReactNative.native.js +1 -3
- package/dist/cjs/setupReactNative.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +229 -0
- package/dist/cjs/static-resolve.native.cjs +242 -0
- package/dist/cjs/static-resolve.native.js +244 -0
- package/dist/cjs/static-resolve.native.js.map +1 -0
- package/dist/cjs/styled.cjs +23 -37
- package/dist/cjs/styled.native.cjs +22 -37
- package/dist/cjs/styled.native.js +22 -37
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +4 -8
- package/dist/cjs/views/TamaguiProvider.native.cjs +4 -8
- package/dist/cjs/views/TamaguiProvider.native.js +4 -8
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/ThemeUpdate.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +85 -88
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +98 -105
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +9 -7
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +9 -7
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs +0 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js +0 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js.map +1 -1
- package/dist/esm/helpers/directStyleCSS.mjs +320 -0
- package/dist/esm/helpers/directStyleCSS.mjs.map +1 -0
- package/dist/esm/helpers/directStyleCSS.native.js +1 -0
- package/dist/esm/helpers/directStyleCSSCompiled.mjs +11 -0
- package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +1 -0
- package/dist/esm/helpers/directStyleCSSCompiled.native.js +15 -0
- package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +1 -0
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +86 -72
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +9 -0
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -0
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +9 -0
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -0
- package/dist/esm/helpers/getSplitStyles.mjs +2406 -545
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +2751 -618
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.mjs +8 -3
- package/dist/esm/helpers/getVariantExtras.mjs.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js +8 -3
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +2 -1
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +69 -3
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/mediaState.mjs +12 -1
- package/dist/esm/helpers/mediaState.mjs.map +1 -1
- package/dist/esm/helpers/mediaState.native.js +12 -1
- package/dist/esm/helpers/mediaState.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStyle.mjs +16 -2
- package/dist/esm/helpers/normalizeStyle.mjs.map +1 -1
- package/dist/esm/helpers/normalizeStyle.native.js +16 -2
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/esm/helpers/resolveRem.mjs +1 -1
- package/dist/esm/helpers/resolveRem.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +3 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +3 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styleFrontend.mjs +2 -4
- package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
- package/dist/esm/helpers/styleFrontend.native.js +2 -6
- package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
- package/dist/esm/helpers/styleToCSS.mjs +40 -0
- package/dist/esm/helpers/styleToCSS.mjs.map +1 -0
- package/dist/esm/helpers/styleToCSS.native.js +4 -0
- package/dist/esm/helpers/styleToCSS.native.js.map +1 -0
- package/dist/esm/helpers/subscribeToContextGroup.mjs +25 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +42 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +2 -1
- package/dist/esm/helpers/variables.mjs.map +1 -1
- package/dist/esm/helpers/variables.native.js +2 -1
- package/dist/esm/helpers/variables.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +5 -3
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +3 -1
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +71 -90
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +71 -89
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +2 -15
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +2 -15
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useProps.mjs +7 -5
- package/dist/esm/hooks/useProps.mjs.map +1 -1
- package/dist/esm/hooks/useProps.native.js +7 -5
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +17 -0
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -0
- package/dist/esm/hooks/useSplitStyles.native.js +14 -0
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -0
- package/dist/esm/index.js +57 -137
- package/dist/esm/index.mjs +57 -137
- package/dist/esm/index.native.js +57 -137
- package/dist/esm/insertFont.mjs +1 -1
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +1 -0
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/internal-runtime.mjs +23 -4
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +23 -4
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/setupReactNative.mjs +1 -29
- package/dist/esm/setupReactNative.mjs.map +1 -1
- package/dist/esm/setupReactNative.native.js +1 -3
- package/dist/esm/setupReactNative.native.js.map +1 -1
- package/dist/esm/static-resolve.mjs +194 -0
- package/dist/esm/static-resolve.mjs.map +1 -0
- package/dist/esm/static-resolve.native.js +205 -0
- package/dist/esm/static-resolve.native.js.map +1 -0
- package/dist/esm/styled.mjs +24 -40
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +23 -40
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +4 -8
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +4 -8
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/ThemeUpdate.mjs +1 -1
- package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.native.js +1 -1
- package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
- package/package.json +25 -15
- package/reset.css +3 -3
- package/src/createComponent.tsx +175 -192
- package/src/createTamagui.ts +10 -9
- package/src/helpers/defaultAnimationDriver.tsx +0 -1
- package/src/helpers/directStyleCSS.native.ts +1 -0
- package/src/helpers/directStyleCSS.ts +534 -0
- package/src/helpers/directStyleCSSCompiled.ts +32 -0
- package/src/helpers/getCSSStylesAtomic.ts +168 -88
- package/src/helpers/getCSSStylesAtomicCompiled.ts +9 -0
- package/src/helpers/getSplitStyles.tsx +4653 -1003
- package/src/helpers/getVariantExtras.tsx +15 -3
- package/src/helpers/insertStyleRule.tsx +4 -2
- package/src/helpers/mediaState.ts +15 -0
- package/src/helpers/normalizeStyle.ts +27 -2
- package/src/helpers/resolveRem.ts +1 -1
- package/src/helpers/skipProps.ts +3 -0
- package/src/helpers/styleFrontend.ts +20 -27
- package/src/helpers/styleToCSS.native.ts +1 -0
- package/src/helpers/styleToCSS.ts +43 -0
- package/src/helpers/subscribeToContextGroup.tsx +30 -0
- package/src/helpers/variables.ts +2 -1
- package/src/helpers/warnOnce.ts +3 -4
- package/src/helpers/wrapStyleTags.tsx +1 -1
- package/src/hooks/useComponentState.ts +118 -158
- package/src/hooks/useMedia.tsx +2 -18
- package/src/hooks/useProps.tsx +19 -15
- package/src/hooks/useSplitStyles.tsx +26 -0
- package/src/index.ts +298 -73
- package/src/insertFont.ts +5 -1
- package/src/internal-runtime.ts +49 -24
- package/src/internalRuntimeTypes.ts +2 -7
- package/src/setupReactNative.ts +7 -30
- package/src/static-resolve.ts +396 -0
- package/src/styled.tsx +34 -11
- package/src/types.tsx +40 -30
- package/src/views/TamaguiProvider.tsx +23 -22
- package/src/views/ThemeUpdate.tsx +3 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/defaultAnimationDriver.d.ts.map +1 -1
- package/types/helpers/directStyleCSS.d.ts +28 -0
- package/types/helpers/directStyleCSS.d.ts.map +1 -0
- package/types/helpers/directStyleCSS.native.d.ts +2 -0
- package/types/helpers/directStyleCSS.native.d.ts.map +1 -0
- package/types/helpers/directStyleCSSCompiled.d.ts +10 -0
- package/types/helpers/directStyleCSSCompiled.d.ts.map +1 -0
- package/types/helpers/getCSSStylesAtomic.d.ts +22 -1
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts +4 -0
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts +11 -4
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/mediaState.d.ts +4 -0
- package/types/helpers/mediaState.d.ts.map +1 -1
- package/types/helpers/normalizeStyle.d.ts +1 -1
- package/types/helpers/normalizeStyle.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts +2 -0
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/styleFrontend.d.ts +13 -17
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleToCSS.d.ts +2 -0
- package/types/helpers/styleToCSS.d.ts.map +1 -0
- package/types/helpers/styleToCSS.native.d.ts +2 -0
- package/types/helpers/styleToCSS.native.d.ts.map +1 -0
- package/types/helpers/subscribeToContextGroup.d.ts +1 -0
- package/types/helpers/subscribeToContextGroup.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/helpers/webPropsToSkip.native.d.ts +5 -0
- package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts +3 -2
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +1 -5
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useProps.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts +3 -0
- package/types/hooks/useSplitStyles.d.ts.map +1 -0
- package/types/index.d.ts +58 -72
- package/types/index.d.ts.map +1 -1
- package/types/insertFont.d.ts.map +1 -1
- package/types/internal-runtime.d.ts +24 -11
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/internalRuntimeTypes.d.ts +1 -6
- package/types/internalRuntimeTypes.d.ts.map +1 -1
- package/types/setupReactNative.d.ts +2 -3
- package/types/setupReactNative.d.ts.map +1 -1
- package/types/static-resolve.d.ts +79 -0
- package/types/static-resolve.d.ts.map +1 -0
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +29 -22
- package/types/types.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/ThemeUpdate.d.ts.map +1 -1
- package/dist/cjs/constants/accessibilityDirectMap.cjs +0 -34
- package/dist/cjs/constants/accessibilityDirectMap.native.cjs +0 -36
- package/dist/cjs/constants/accessibilityDirectMap.native.js +0 -38
- package/dist/cjs/constants/accessibilityDirectMap.native.js.map +0 -1
- package/dist/cjs/helpers/directStyle.cjs +0 -962
- package/dist/cjs/helpers/directStyle.native.cjs +0 -1165
- package/dist/cjs/helpers/directStyle.native.js +0 -1167
- package/dist/cjs/helpers/directStyle.native.js.map +0 -1
- package/dist/cjs/helpers/frontendProgram.cjs +0 -43
- package/dist/cjs/helpers/frontendProgram.native.cjs +0 -49
- package/dist/cjs/helpers/frontendProgram.native.js +0 -51
- package/dist/cjs/helpers/frontendProgram.native.js.map +0 -1
- package/dist/cjs/helpers/getFontLanguage.native.js.map +0 -1
- package/dist/cjs/helpers/normalizeStylePropKeys.native.cjs +0 -37
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js +0 -39
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +0 -1
- package/dist/cjs/helpers/propMapper.cjs +0 -384
- package/dist/cjs/helpers/propMapper.native.cjs +0 -536
- package/dist/cjs/helpers/propMapper.native.js +0 -538
- package/dist/cjs/helpers/propMapper.native.js.map +0 -1
- package/dist/cjs/helpers/useRenderElement.cjs +0 -47
- package/dist/cjs/helpers/useRenderElement.native.cjs +0 -53
- package/dist/cjs/helpers/useRenderElement.native.js +0 -55
- package/dist/cjs/helpers/useRenderElement.native.js.map +0 -1
- package/dist/esm/constants/accessibilityDirectMap.mjs +0 -8
- package/dist/esm/constants/accessibilityDirectMap.mjs.map +0 -1
- package/dist/esm/constants/accessibilityDirectMap.native.js +0 -8
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +0 -1
- package/dist/esm/helpers/directStyle.mjs +0 -929
- package/dist/esm/helpers/directStyle.mjs.map +0 -1
- package/dist/esm/helpers/directStyle.native.js +0 -1132
- package/dist/esm/helpers/directStyle.native.js.map +0 -1
- package/dist/esm/helpers/frontendProgram.mjs +0 -20
- package/dist/esm/helpers/frontendProgram.mjs.map +0 -1
- package/dist/esm/helpers/frontendProgram.native.js +0 -24
- package/dist/esm/helpers/frontendProgram.native.js.map +0 -1
- package/dist/esm/helpers/getFontLanguage.mjs +0 -4
- package/dist/esm/helpers/getFontLanguage.mjs.map +0 -1
- package/dist/esm/helpers/getFontLanguage.native.js +0 -6
- package/dist/esm/helpers/getFontLanguage.native.js.map +0 -1
- package/dist/esm/helpers/normalizeStylePropKeys.mjs +0 -4
- package/dist/esm/helpers/normalizeStylePropKeys.mjs.map +0 -1
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +0 -15
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +0 -1
- package/dist/esm/helpers/propMapper.mjs +0 -360
- package/dist/esm/helpers/propMapper.mjs.map +0 -1
- package/dist/esm/helpers/propMapper.native.js +0 -511
- package/dist/esm/helpers/propMapper.native.js.map +0 -1
- package/dist/esm/helpers/useRenderElement.mjs +0 -26
- package/dist/esm/helpers/useRenderElement.mjs.map +0 -1
- package/dist/esm/helpers/useRenderElement.native.js +0 -31
- package/dist/esm/helpers/useRenderElement.native.js.map +0 -1
- package/src/constants/accessibilityDirectMap.native.tsx +0 -10
- package/src/constants/accessibilityDirectMap.tsx +0 -11
- package/src/helpers/directStyle.ts +0 -2294
- package/src/helpers/frontendProgram.ts +0 -48
- package/src/helpers/getFontLanguage.ts +0 -2
- package/src/helpers/normalizeStylePropKeys.native.ts +0 -12
- package/src/helpers/normalizeStylePropKeys.ts +0 -3
- package/src/helpers/propMapper.ts +0 -721
- package/src/helpers/useRenderElement.tsx +0 -73
- package/types/constants/accessibilityDirectMap.d.ts +0 -6
- package/types/constants/accessibilityDirectMap.d.ts.map +0 -1
- package/types/constants/accessibilityDirectMap.native.d.ts +0 -6
- package/types/constants/accessibilityDirectMap.native.d.ts.map +0 -1
- package/types/helpers/directStyle.d.ts +0 -15
- package/types/helpers/directStyle.d.ts.map +0 -1
- package/types/helpers/frontendProgram.d.ts +0 -10
- package/types/helpers/frontendProgram.d.ts.map +0 -1
- package/types/helpers/getFontLanguage.d.ts +0 -2
- package/types/helpers/getFontLanguage.d.ts.map +0 -1
- package/types/helpers/normalizeStylePropKeys.d.ts +0 -2
- package/types/helpers/normalizeStylePropKeys.d.ts.map +0 -1
- package/types/helpers/normalizeStylePropKeys.native.d.ts +0 -13
- package/types/helpers/normalizeStylePropKeys.native.d.ts.map +0 -1
- package/types/helpers/propMapper.d.ts +0 -6
- package/types/helpers/propMapper.d.ts.map +0 -1
- package/types/helpers/useRenderElement.d.ts +0 -13
- package/types/helpers/useRenderElement.d.ts.map +0 -1
|
@@ -38,9 +38,21 @@ export const getVariantExtras = (styleState: GetStyleState) => {
|
|
|
38
38
|
// font identity survives in the font_<name> class.
|
|
39
39
|
const className = props.className
|
|
40
40
|
if (typeof className === 'string') {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
let start = 0
|
|
42
|
+
for (let index = 0; index <= className.length; index++) {
|
|
43
|
+
if (index !== className.length && className.charCodeAt(index) > 32) continue
|
|
44
|
+
if (
|
|
45
|
+
index - start > 5 &&
|
|
46
|
+
className.charCodeAt(start) === 102 &&
|
|
47
|
+
className.charCodeAt(start + 1) === 111 &&
|
|
48
|
+
className.charCodeAt(start + 2) === 110 &&
|
|
49
|
+
className.charCodeAt(start + 3) === 116 &&
|
|
50
|
+
className.charCodeAt(start + 4) === 95
|
|
51
|
+
) {
|
|
52
|
+
const name = className.slice(start + 5, index)
|
|
53
|
+
if (fonts[name]) return fonts[name]
|
|
54
|
+
}
|
|
55
|
+
start = index + 1
|
|
44
56
|
}
|
|
45
57
|
}
|
|
46
58
|
|
|
@@ -339,7 +339,7 @@ export function stopAccumulatingRules() {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
export function updateRules(identifier: string, rules: string[]) {
|
|
342
|
-
if (trackAllRules) {
|
|
342
|
+
if (!process.env.TAMAGUI_DID_OUTPUT_CSS && trackAllRules) {
|
|
343
343
|
allRules[identifier] = rules.join(' ')
|
|
344
344
|
sortedRulesStale = true
|
|
345
345
|
}
|
|
@@ -352,7 +352,9 @@ export function setNonce(_: string) {
|
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
export function insertStyleRules(rulesToInsert: RulesToInsert) {
|
|
355
|
-
if (process.env.TAMAGUI_TARGET !== 'web')
|
|
355
|
+
if (process.env.TAMAGUI_DID_OUTPUT_CSS || process.env.TAMAGUI_TARGET !== 'web') {
|
|
356
|
+
return
|
|
357
|
+
}
|
|
356
358
|
|
|
357
359
|
if (!sheet && document.head) {
|
|
358
360
|
const styleTag = document.createElement('style')
|
|
@@ -11,3 +11,18 @@ export const mediaQueryConfig: MediaQueries = {}
|
|
|
11
11
|
export const getMedia = () => mediaState
|
|
12
12
|
|
|
13
13
|
export const mediaKeys = new Set<string>()
|
|
14
|
+
|
|
15
|
+
export function mediaKeyMatch(
|
|
16
|
+
key: string,
|
|
17
|
+
dimensions: { width: number; height: number }
|
|
18
|
+
) {
|
|
19
|
+
const mediaQueries = mediaQueryConfig[key]
|
|
20
|
+
for (const query in mediaQueries) {
|
|
21
|
+
const expectedVal = +mediaQueries[query]
|
|
22
|
+
const isMax = query.startsWith('max')
|
|
23
|
+
const isWidth = query.endsWith('Width')
|
|
24
|
+
const givenVal = dimensions[isWidth ? 'width' : 'height']
|
|
25
|
+
if (isMax ? givenVal >= expectedVal : givenVal <= expectedVal) return false
|
|
26
|
+
}
|
|
27
|
+
return true
|
|
28
|
+
}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { isWeb } from '@tamagui/constants'
|
|
2
|
+
import { stylePropsTransform } from '@tamagui/helpers'
|
|
3
|
+
import {
|
|
4
|
+
addTransformValue,
|
|
5
|
+
createTransformAccumulator,
|
|
6
|
+
finalizeTransformAccumulator,
|
|
7
|
+
type TransformAccumulator,
|
|
8
|
+
} from '@tamagui/style-grammar/runtime'
|
|
1
9
|
import { expandStyle } from './expandStyle'
|
|
2
10
|
import { fixStyles } from './expandStyles'
|
|
3
11
|
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
4
12
|
import { styleOriginalValues } from './styleOriginalValues'
|
|
13
|
+
import { transformsToString } from './transformsToString'
|
|
5
14
|
|
|
6
15
|
/**
|
|
7
16
|
* This is what you want to run before Object.assign() a style onto another.
|
|
@@ -11,18 +20,28 @@ import { styleOriginalValues } from './styleOriginalValues'
|
|
|
11
20
|
* 3. Preserves original-value provenance across expanded longhands
|
|
12
21
|
*/
|
|
13
22
|
|
|
14
|
-
export function normalizeStyle(
|
|
23
|
+
export function normalizeStyle(
|
|
24
|
+
style: Record<string, any>,
|
|
25
|
+
disableNormalize = false,
|
|
26
|
+
mergeTransforms = false
|
|
27
|
+
) {
|
|
15
28
|
const res: Record<string, any> = {}
|
|
16
29
|
const originalValues = styleOriginalValues.get(style)
|
|
17
30
|
let nextOriginalValues: Record<string, any> | undefined
|
|
31
|
+
let transformAccumulator: TransformAccumulator | undefined
|
|
18
32
|
|
|
19
33
|
for (let key in style) {
|
|
20
34
|
const prop = style[key]
|
|
21
35
|
if (prop == null) continue
|
|
22
36
|
const originalValue = originalValues?.[key]
|
|
37
|
+
if (mergeTransforms && (key === 'transform' || key in stylePropsTransform)) {
|
|
38
|
+
transformAccumulator ||= createTransformAccumulator()
|
|
39
|
+
addTransformValue(transformAccumulator, key, prop)
|
|
40
|
+
continue
|
|
41
|
+
}
|
|
23
42
|
const value = disableNormalize ? prop : normalizeValueWithProperty(prop, key)
|
|
24
43
|
// expand react-native shorthands
|
|
25
|
-
const out = expandStyle(key, value)
|
|
44
|
+
const out = mergeTransforms ? undefined : expandStyle(key, value)
|
|
26
45
|
if (out) {
|
|
27
46
|
for (const [nextKey, nextValue] of out) {
|
|
28
47
|
res[nextKey] = nextValue
|
|
@@ -40,6 +59,12 @@ export function normalizeStyle(style: Record<string, any>, disableNormalize = fa
|
|
|
40
59
|
}
|
|
41
60
|
}
|
|
42
61
|
|
|
62
|
+
if (transformAccumulator) {
|
|
63
|
+
const transform = finalizeTransformAccumulator(transformAccumulator)
|
|
64
|
+
res.transform =
|
|
65
|
+
isWeb && Array.isArray(transform) ? transformsToString(transform) : transform
|
|
66
|
+
}
|
|
67
|
+
|
|
43
68
|
fixStyles(res)
|
|
44
69
|
|
|
45
70
|
if (nextOriginalValues) {
|
|
@@ -13,5 +13,5 @@ export function resolveRem(value: string): string {
|
|
|
13
13
|
* Checks if a value is a rem string
|
|
14
14
|
*/
|
|
15
15
|
export function isRemValue(value: unknown): value is string {
|
|
16
|
-
return typeof value === 'string' && value.
|
|
16
|
+
return typeof value === 'string' && value.endsWith('rem')
|
|
17
17
|
}
|
package/src/helpers/skipProps.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { nativeOnlyProps } from './nativeOnlyProps'
|
|
2
2
|
import { webPropsToSkip } from './webPropsToSkip'
|
|
3
3
|
|
|
4
|
+
export const HOC_CLASSNAME_MARKER = 'data-tamagui-hoc-class'
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* These are props that dont pass down below Tamagui styled components
|
|
6
8
|
*/
|
|
@@ -17,6 +19,7 @@ export const skipProps = {
|
|
|
17
19
|
disableNativeStyle: 1,
|
|
18
20
|
render: 1,
|
|
19
21
|
style: 1, // handled after the prop loop to preserve authored order
|
|
22
|
+
[HOC_CLASSNAME_MARKER]: 1,
|
|
20
23
|
group: 1,
|
|
21
24
|
container: 1,
|
|
22
25
|
animatePresence: 1,
|
|
@@ -44,6 +44,22 @@ export type FrontendComponent = FunctionComponent<any> & {
|
|
|
44
44
|
staticConfig: FrontendStaticConfig
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
export type FrontendClassPlanEntry = readonly [
|
|
48
|
+
property: string,
|
|
49
|
+
value: unknown,
|
|
50
|
+
condition?: string,
|
|
51
|
+
modifiers?: readonly string[],
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
export type FrontendClassPlan =
|
|
55
|
+
| 'raw'
|
|
56
|
+
| null
|
|
57
|
+
| readonly FrontendClassPlanEntry[]
|
|
58
|
+
| {
|
|
59
|
+
entries: readonly FrontendClassPlanEntry[]
|
|
60
|
+
preserveRawClass: boolean
|
|
61
|
+
}
|
|
62
|
+
|
|
47
63
|
/**
|
|
48
64
|
* A component's authoring syntax. It is chosen by the package the component was
|
|
49
65
|
* imported from and frozen onto its static config when the component is created:
|
|
@@ -58,15 +74,10 @@ export type FrontendComponent = FunctionComponent<any> & {
|
|
|
58
74
|
*/
|
|
59
75
|
export type StyleFrontend = {
|
|
60
76
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* because reconstructed enter/exit, pseudo, media and related state props must
|
|
64
|
-
* exist before the animation and state machinery reads them.
|
|
77
|
+
* Classifies one class candidate. The shared style cursor owns the className
|
|
78
|
+
* character walk and feeds every returned entry through its one property sink.
|
|
65
79
|
*/
|
|
66
|
-
|
|
67
|
-
props: Record<string, any>,
|
|
68
|
-
config: StyleFrontendConfig
|
|
69
|
-
) => Record<string, any>
|
|
80
|
+
getClassPlan?: (candidate: string, config: StyleFrontendConfig) => FrontendClassPlan
|
|
70
81
|
|
|
71
82
|
/**
|
|
72
83
|
* Resolves frontend-specific static style input (a class-string base, string
|
|
@@ -79,26 +90,8 @@ export type StyleFrontend = {
|
|
|
79
90
|
) => Config
|
|
80
91
|
}
|
|
81
92
|
|
|
82
|
-
/**
|
|
83
|
-
* Marks props that already went through `preprocessProps`, so the style split does
|
|
84
|
-
* not tokenize a second time. A Symbol key is invisible to the `for..in` prop loop,
|
|
85
|
-
* so it never leaks into style processing.
|
|
86
|
-
*/
|
|
87
|
-
export const STYLE_FRONTEND_PREPROCESSED: unique symbol = Symbol(
|
|
88
|
-
'tamaguiStyleFrontendPreprocessed'
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Internal ordered-prop channel for raw CSS classes a frontend does not own.
|
|
93
|
-
* Numbered keys let passthrough segments keep their exact position among claimed
|
|
94
|
-
* style contributions while the shared renderer still handles them as className.
|
|
95
|
-
*/
|
|
96
|
-
export const STYLE_FRONTEND_PASSTHROUGH_PREFIX = '__tamagui_frontend_passthrough_'
|
|
97
|
-
|
|
98
93
|
/**
|
|
99
94
|
* The regular Tamagui frontend: props are already the renderer's input shape, so
|
|
100
95
|
* preprocessing is identity and costs one property read plus one call.
|
|
101
96
|
*/
|
|
102
|
-
export const regularStyleFrontend: StyleFrontend = {
|
|
103
|
-
preprocessProps: (props) => props,
|
|
104
|
-
}
|
|
97
|
+
export const regularStyleFrontend: StyleFrontend = {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function styleToCSS(_style: Record<string, any>) {}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defaultOffset } from './defaultOffset'
|
|
2
|
+
import { normalizeColor } from './normalizeColor'
|
|
3
|
+
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
4
|
+
|
|
5
|
+
export function styleToCSS(style: Record<string, any>) {
|
|
6
|
+
const { shadowOffset, shadowRadius, shadowColor, shadowOpacity } = style
|
|
7
|
+
if (
|
|
8
|
+
shadowRadius != null ||
|
|
9
|
+
shadowColor ||
|
|
10
|
+
shadowOffset != null ||
|
|
11
|
+
shadowOpacity != null
|
|
12
|
+
) {
|
|
13
|
+
const offset = shadowOffset || defaultOffset
|
|
14
|
+
const width = normalizeValueWithProperty(offset.width)
|
|
15
|
+
const height = normalizeValueWithProperty(offset.height)
|
|
16
|
+
const radius = normalizeValueWithProperty(shadowRadius)
|
|
17
|
+
const color = normalizeColor(shadowColor, shadowOpacity)
|
|
18
|
+
if (color) {
|
|
19
|
+
const shadow = `${width} ${height} ${radius} ${color}`
|
|
20
|
+
style.boxShadow = style.boxShadow ? `${style.boxShadow}, ${shadow}` : shadow
|
|
21
|
+
}
|
|
22
|
+
delete style.shadowOffset
|
|
23
|
+
delete style.shadowRadius
|
|
24
|
+
delete style.shadowColor
|
|
25
|
+
delete style.shadowOpacity
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const { textShadowColor, textShadowOffset, textShadowRadius } = style
|
|
29
|
+
if (textShadowColor || textShadowOffset || textShadowRadius) {
|
|
30
|
+
const { height, width } = textShadowOffset || defaultOffset
|
|
31
|
+
const radius = textShadowRadius || 0
|
|
32
|
+
const color = normalizeValueWithProperty(textShadowColor, 'textShadowColor')
|
|
33
|
+
if (color && (height !== 0 || width !== 0 || radius !== 0)) {
|
|
34
|
+
const blurRadius = normalizeValueWithProperty(radius)
|
|
35
|
+
const offsetX = normalizeValueWithProperty(width)
|
|
36
|
+
const offsetY = normalizeValueWithProperty(height)
|
|
37
|
+
style.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`
|
|
38
|
+
}
|
|
39
|
+
delete style.textShadowColor
|
|
40
|
+
delete style.textShadowOffset
|
|
41
|
+
delete style.textShadowRadius
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mergeIfNotShallowEqual } from '@tamagui/is-equal-shallow'
|
|
2
|
+
import { useRef } from 'react'
|
|
2
3
|
import { getMediaState } from '../hooks/useMedia'
|
|
3
4
|
import type { ComponentSetStateShallow, DisposeFn, AllGroupContexts } from '../types'
|
|
4
5
|
|
|
@@ -9,6 +10,35 @@ type SubscribeToContextGroupProps = {
|
|
|
9
10
|
groupContext: AllGroupContexts
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
export const useGroupSetRevision = (
|
|
14
|
+
pseudoGroups: Set<string> | undefined,
|
|
15
|
+
mediaGroups: Set<string> | undefined
|
|
16
|
+
) => {
|
|
17
|
+
const previous = useRef({ pseudoGroups, mediaGroups, revision: 0 })
|
|
18
|
+
|
|
19
|
+
if (
|
|
20
|
+
!setsEqual(previous.current.pseudoGroups, pseudoGroups) ||
|
|
21
|
+
!setsEqual(previous.current.mediaGroups, mediaGroups)
|
|
22
|
+
) {
|
|
23
|
+
previous.current = {
|
|
24
|
+
pseudoGroups,
|
|
25
|
+
mediaGroups,
|
|
26
|
+
revision: previous.current.revision + 1,
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return previous.current.revision
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const setsEqual = (a: Set<string> | undefined, b: Set<string> | undefined) => {
|
|
34
|
+
if (a === b) return true
|
|
35
|
+
if (!a || !b || a.size !== b.size) return false
|
|
36
|
+
for (const value of a) {
|
|
37
|
+
if (!b.has(value)) return false
|
|
38
|
+
}
|
|
39
|
+
return true
|
|
40
|
+
}
|
|
41
|
+
|
|
12
42
|
export const subscribeToContextGroup = (props: SubscribeToContextGroupProps) => {
|
|
13
43
|
const { pseudoGroups, mediaGroups, groupContext } = props
|
|
14
44
|
if (pseudoGroups || mediaGroups) {
|
package/src/helpers/variables.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { reservedThemeProps, simpleHash } from '@tamagui/helpers'
|
|
2
|
+
import { platformMatches } from '@tamagui/constants'
|
|
2
3
|
import {
|
|
3
4
|
grammarPlatformNames,
|
|
4
5
|
isRootThemeName,
|
|
@@ -12,7 +13,6 @@ import { getSetting } from '../config'
|
|
|
12
13
|
import { createVariable, isVariable } from '../createVariable'
|
|
13
14
|
import { getConfigRevisionState, type ConfigRevisionState } from './grammarConfig'
|
|
14
15
|
import { themeUpdateStateKey, type ThemeUpdateLayerInfo } from './themeUpdateState'
|
|
15
|
-
import { platformMatches } from './directStyle'
|
|
16
16
|
import { findVariableToken, isUnitlessVariableKey } from './variableValue'
|
|
17
17
|
import { warnOnce } from './warnOnce'
|
|
18
18
|
import type {
|
|
@@ -278,6 +278,7 @@ export function getVariablesCSSRules(
|
|
|
278
278
|
props: InlineValues,
|
|
279
279
|
conf: TamaguiInternalConfig
|
|
280
280
|
): VariablesCSS | null {
|
|
281
|
+
if (process.env.TAMAGUI_DID_OUTPUT_CSS) return null
|
|
281
282
|
const cycleDropped = getCycleDroppedKeys(props)
|
|
282
283
|
const themes = props.themes as
|
|
283
284
|
| Record<string, InlineValues['values'] | undefined>
|
package/src/helpers/warnOnce.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// One development warning per key, for the whole runtime.
|
|
2
2
|
//
|
|
3
3
|
// The set is BOUNDED rather than trusted to stay small, and that bound is what
|
|
4
|
-
// lets a warning quote the offending value.
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// value alone would grow this set forever.
|
|
4
|
+
// lets a warning quote the offending value. A page rendering a CMS-supplied
|
|
5
|
+
// colour can vary a refused value without limit, and keying on the value alone
|
|
6
|
+
// would grow this set forever.
|
|
8
7
|
//
|
|
9
8
|
// Keying on the PROPERTY alone was the first answer to that and it was too
|
|
10
9
|
// quiet: a second, different typo in the same prop said nothing, and once a
|
|
@@ -67,7 +67,7 @@ function getCachedStyleTag(styleObject: StyleObject) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export function getStyleTags(styles: StyleObject[]) {
|
|
70
|
-
if (process.env.TAMAGUI_TARGET !== 'native') {
|
|
70
|
+
if (!process.env.TAMAGUI_DID_OUTPUT_CSS && process.env.TAMAGUI_TARGET !== 'native') {
|
|
71
71
|
if (styles.length) {
|
|
72
72
|
queueStyleTagCacheClear()
|
|
73
73
|
return <>{styles.map(getCachedStyleTag)}</>
|