@tamagui/web 3.0.0-beta.807.1 → 3.0.0-beta.881.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/config.cjs +1 -1
- package/dist/cjs/config.native.cjs +1 -1
- package/dist/cjs/config.native.js +1 -1
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +40 -19
- package/dist/cjs/createComponent.native.cjs +42 -21
- package/dist/cjs/createComponent.native.js +42 -21
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +54 -4
- package/dist/cjs/createStyledHOC.native.cjs +55 -4
- package/dist/cjs/createStyledHOC.native.js +55 -4
- package/dist/cjs/createStyledHOC.native.js.map +1 -1
- package/dist/cjs/createTokens.cjs +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -1
- package/dist/cjs/createTokens.native.js +1 -1
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.cjs +0 -10
- package/dist/cjs/createVariable.native.cjs +0 -10
- package/dist/cjs/createVariable.native.js +0 -10
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +147 -99
- package/dist/cjs/dom/htmlRuntime.native.cjs +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/primitives.native.cjs +16 -13
- package/dist/cjs/dom/primitives.native.js +16 -13
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/helpers/borderComponents.cjs +62 -0
- package/dist/cjs/helpers/borderComponents.native.cjs +82 -0
- package/dist/cjs/helpers/borderComponents.native.js +84 -0
- package/dist/cjs/helpers/borderComponents.native.js.map +1 -0
- package/dist/cjs/helpers/componentDisplayName.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +0 -2
- package/dist/cjs/helpers/createStyledContext.cjs +10 -18
- package/dist/cjs/helpers/createStyledContext.native.cjs +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/formatDiagnostic.cjs +8 -10
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +8 -10
- package/dist/cjs/helpers/formatDiagnostic.native.js +8 -10
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +133 -114
- package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.cjs +13 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.cjs +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/cjs/helpers/getDynamicVal.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +1063 -2168
- package/dist/cjs/helpers/getSplitStyles.native.cjs +1115 -2515
- package/dist/cjs/helpers/getSplitStyles.native.js +1115 -2515
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/grammarConfig.cjs +163 -1
- package/dist/cjs/helpers/grammarConfig.native.cjs +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +5 -1
- package/dist/cjs/helpers/insertStyleRule.native.cjs +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +9 -8
- package/dist/cjs/helpers/log.native.cjs +9 -8
- package/dist/cjs/helpers/log.native.js +9 -8
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.cjs +44 -13
- package/dist/cjs/helpers/mergeVariants.native.cjs +79 -14
- package/dist/cjs/helpers/mergeVariants.native.js +79 -14
- package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
- package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeStyleEngine.cjs +34 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.cjs +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +7 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/parseBorderShorthand.native.cjs +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeArea.cjs +35 -100
- package/dist/cjs/helpers/resolveVariantStyle.cjs +57 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.cjs +67 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js +69 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/cjs/helpers/splitStyleProps.cjs +46 -0
- package/dist/cjs/helpers/splitStyleProps.native.cjs +49 -0
- package/dist/cjs/helpers/splitStyleProps.native.js +51 -0
- package/dist/cjs/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/cjs/helpers/{getDefaultProps.native.cjs → styleStaticConfig.cjs} +7 -8
- package/dist/cjs/helpers/{getDefaultProps.native.js → styleStaticConfig.native.cjs} +7 -8
- package/dist/cjs/helpers/styleStaticConfig.native.js +31 -0
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/cjs/helpers/styleStaticConfigCore.cjs +107 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +127 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js +129 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/cjs/helpers/styledDynamic.cjs +160 -0
- package/dist/cjs/helpers/styledDynamic.native.cjs +195 -0
- package/dist/cjs/helpers/styledDynamic.native.js +197 -0
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -0
- package/dist/cjs/helpers/tokenCategories.cjs +12 -74
- package/dist/cjs/helpers/tokenCategories.native.cjs +12 -76
- package/dist/cjs/helpers/tokenCategories.native.js +12 -76
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variableValue.cjs +17 -12
- package/dist/cjs/helpers/variableValue.native.cjs +46 -23
- package/dist/cjs/helpers/variableValue.native.js +46 -23
- package/dist/cjs/helpers/variableValue.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +5 -4
- package/dist/cjs/helpers/warnOnce.native.cjs +6 -4
- package/dist/cjs/helpers/warnOnce.native.js +6 -4
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/hooks/useAnimationDriver.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +41 -82
- package/dist/cjs/hooks/useComponentState.native.cjs +45 -84
- package/dist/cjs/hooks/useComponentState.native.js +45 -84
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.js +2 -2
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/{helpers/getDefaultProps.cjs → hooks/useStyle.cjs} +10 -4
- package/dist/cjs/{helpers/directStyleCSS.native.js → hooks/useStyle.native.cjs} +16 -6
- package/dist/cjs/hooks/useStyle.native.js +34 -0
- package/dist/cjs/hooks/useStyle.native.js.map +1 -0
- package/dist/cjs/hooks/useThemeState.cjs +25 -90
- package/dist/cjs/hooks/useThemeState.native.cjs +34 -94
- package/dist/cjs/hooks/useThemeState.native.js +34 -94
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -12
- package/dist/cjs/index.native.cjs +9 -12
- package/dist/cjs/index.native.js +9 -12
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +8 -7
- package/dist/cjs/internal-runtime.native.cjs +8 -7
- package/dist/cjs/internal-runtime.native.js +8 -7
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +8 -7
- package/dist/cjs/static-resolve.native.cjs +8 -7
- package/dist/cjs/static-resolve.native.js +8 -7
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/style.cjs +91 -0
- package/dist/cjs/style.native.cjs +98 -0
- package/dist/cjs/style.native.js +100 -0
- package/dist/cjs/style.native.js.map +1 -0
- package/dist/cjs/styled.cjs +15 -62
- package/dist/cjs/styled.native.cjs +15 -64
- package/dist/cjs/styled.native.js +15 -64
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +4 -22
- package/dist/cjs/types.native.cjs +4 -22
- package/dist/cjs/types.native.js +4 -22
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +21 -14
- package/dist/cjs/views/Text.native.cjs +5 -2
- package/dist/cjs/views/Text.native.js +5 -2
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +2 -2
- package/dist/cjs/views/Theme.native.cjs +2 -2
- package/dist/cjs/views/Theme.native.js +2 -2
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -4
- package/dist/cjs/views/View.cjs +4 -2
- package/dist/cjs/views/View.native.cjs +4 -2
- package/dist/cjs/views/View.native.js +4 -2
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/config.mjs +1 -1
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +1 -1
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +41 -20
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +43 -22
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +55 -5
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +56 -5
- package/dist/esm/createStyledHOC.native.js.map +1 -1
- package/dist/esm/createTokens.mjs +1 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js +1 -1
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.mjs +1 -9
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.native.js +1 -9
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +147 -99
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/htmlRuntime.native.js +7 -3
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/primitives.native.js +16 -13
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/helpers/borderComponents.mjs +37 -0
- package/dist/esm/helpers/borderComponents.mjs.map +1 -0
- package/dist/esm/helpers/borderComponents.native.js +55 -0
- package/dist/esm/helpers/borderComponents.native.js.map +1 -0
- package/dist/esm/helpers/componentDisplayName.mjs +1 -8
- package/dist/esm/helpers/componentDisplayName.mjs.map +1 -1
- package/dist/esm/helpers/componentDisplayName.native.js +1 -8
- package/dist/esm/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +0 -2
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.mjs +10 -18
- package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +14 -18
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +8 -10
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +8 -10
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +131 -114
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.native.js +7 -4
- package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +8 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +10 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/esm/helpers/getDynamicVal.mjs +5 -1
- package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
- package/dist/esm/helpers/getDynamicVal.native.js +5 -1
- package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +1052 -2151
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +1090 -2481
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +164 -2
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.native.js +187 -2
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +5 -2
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +7 -2
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +9 -8
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +9 -8
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.mjs +44 -13
- package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +79 -14
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.mjs +34 -15
- package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.native.js +36 -15
- package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +7 -8
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/parseBorderShorthand.native.js +23 -56
- package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/esm/helpers/parseOutlineShorthand.native.js +10 -49
- package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeArea.mjs +35 -97
- package/dist/esm/helpers/resolveSafeArea.mjs.map +1 -1
- package/dist/esm/helpers/resolveVariantStyle.mjs +38 -0
- package/dist/esm/helpers/resolveVariantStyle.mjs.map +1 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js +46 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/esm/helpers/splitStyleProps.mjs +27 -0
- package/dist/esm/helpers/splitStyleProps.mjs.map +1 -0
- package/dist/esm/helpers/splitStyleProps.native.js +28 -0
- package/dist/esm/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.mjs +8 -0
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.native.js +8 -0
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfigCore.mjs +88 -0
- package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js +106 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/esm/helpers/styledDynamic.mjs +136 -0
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -0
- package/dist/esm/helpers/styledDynamic.native.js +169 -0
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -0
- package/dist/esm/helpers/tokenCategories.mjs +12 -72
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +12 -74
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variableValue.mjs +17 -12
- package/dist/esm/helpers/variableValue.mjs.map +1 -1
- package/dist/esm/helpers/variableValue.native.js +46 -23
- package/dist/esm/helpers/variableValue.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +5 -4
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +6 -4
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.mjs +2 -2
- package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.native.js +2 -2
- package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +41 -82
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +45 -84
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +2 -2
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +2 -2
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +2 -2
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +2 -2
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/hooks/useStyle.mjs +11 -0
- package/dist/esm/hooks/useStyle.mjs.map +1 -0
- package/dist/esm/hooks/useStyle.native.js +11 -0
- package/dist/esm/hooks/useStyle.native.js.map +1 -0
- package/dist/esm/hooks/useThemeState.mjs +25 -90
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +34 -94
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +8 -8
- package/dist/esm/index.mjs +8 -8
- package/dist/esm/index.native.js +8 -8
- package/dist/esm/internal-runtime.mjs +8 -7
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +8 -7
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.mjs +11 -9
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +11 -9
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/style.mjs +58 -0
- package/dist/esm/style.mjs.map +1 -0
- package/dist/esm/style.native.js +63 -0
- package/dist/esm/style.native.js.map +1 -0
- package/dist/esm/styled.mjs +17 -62
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +17 -64
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +3 -21
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +3 -21
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +1 -2
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +1 -2
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +21 -14
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +4 -2
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +2 -2
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +2 -2
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -4
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/View.mjs +4 -2
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js +4 -2
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +15 -15
- package/src/config.ts +1 -1
- package/src/createComponent.tsx +62 -31
- package/src/createStyledHOC.tsx +56 -9
- package/src/createTokens.ts +1 -1
- package/src/createVariable.ts +0 -10
- package/src/dom/html.tsx +778 -877
- package/src/dom/htmlRuntime.native.tsx +7 -3
- package/src/dom/primitives.native.tsx +30 -39
- package/src/helpers/borderComponents.ts +62 -0
- package/src/helpers/componentDisplayName.ts +0 -11
- package/src/helpers/createDesignSystem.ts +0 -2
- package/src/helpers/createStyledContext.tsx +15 -53
- package/src/helpers/formatDiagnostic.ts +11 -13
- package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
- package/src/helpers/getCSSStylesAtomic.ts +197 -206
- package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
- package/src/helpers/getDynamicVal.ts +4 -0
- package/src/helpers/getSplitStyles.tsx +2058 -4052
- package/src/helpers/grammarConfig.ts +218 -1
- package/src/helpers/insertStyleRule.tsx +4 -2
- package/src/helpers/log.ts +12 -11
- package/src/helpers/mergeVariants.ts +55 -18
- package/src/helpers/nativeOnlyProps.ts +0 -1
- package/src/helpers/nativeStyleEngine.ts +55 -14
- package/src/helpers/normalizeValueWithProperty.ts +10 -12
- package/src/helpers/parseBorderShorthand.native.ts +23 -45
- package/src/helpers/parseOutlineShorthand.native.ts +9 -40
- package/src/helpers/resolveSafeArea.ts +34 -101
- package/src/helpers/resolveVariantStyle.ts +77 -0
- package/src/helpers/splitStyleProps.ts +166 -0
- package/src/helpers/styleFrontend.ts +16 -9
- package/src/helpers/styleStaticConfig.ts +21 -0
- package/src/helpers/styleStaticConfigCore.ts +110 -0
- package/src/helpers/styledDynamic.ts +191 -0
- package/src/helpers/tokenCategories.ts +32 -88
- package/src/helpers/variableValue.ts +20 -15
- package/src/helpers/warnOnce.ts +5 -4
- package/src/hooks/useAnimationDriver.ts +6 -2
- package/src/hooks/useComponentState.ts +55 -183
- package/src/hooks/useMedia.tsx +10 -8
- package/src/hooks/useSplitStyles.tsx +17 -2
- package/src/hooks/useStyle.ts +10 -0
- package/src/hooks/useTheme.tsx +1 -1
- package/src/hooks/useThemeState.ts +51 -264
- package/src/index.ts +14 -10
- package/src/internal-runtime.ts +10 -9
- package/src/internalRuntimeTypes.ts +1 -0
- package/src/static-resolve.ts +25 -18
- package/src/style.ts +97 -0
- package/src/styled.tsx +46 -332
- package/src/types.tsx +107 -192
- package/src/views/TamaguiProvider.tsx +0 -2
- package/src/views/Text.tsx +26 -21
- package/src/views/Theme.tsx +10 -8
- package/src/views/ThemeDebug.tsx +0 -1
- package/src/views/View.tsx +6 -7
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/createVariable.d.ts +0 -2
- package/types/createVariable.d.ts.map +1 -1
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/helpers/borderComponents.d.ts +10 -0
- package/types/helpers/borderComponents.d.ts.map +1 -0
- package/types/helpers/componentDisplayName.d.ts +0 -3
- package/types/helpers/componentDisplayName.d.ts.map +1 -1
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/createStyledContext.d.ts.map +1 -1
- package/types/helpers/formatDiagnostic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +25 -22
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.native.d.ts +5 -0
- package/types/helpers/getCSSStylesAtomic.native.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts +6 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -1
- package/types/helpers/getDynamicVal.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +9 -11
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts +25 -2
- package/types/helpers/grammarConfig.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts +1 -0
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/log.d.ts.map +1 -1
- package/types/helpers/mergeVariants.d.ts.map +1 -1
- package/types/helpers/nativeOnlyProps.d.ts +0 -1
- package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
- package/types/helpers/nativeStyleEngine.d.ts +6 -0
- package/types/helpers/nativeStyleEngine.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/parseBorderShorthand.native.d.ts +1 -0
- package/types/helpers/parseBorderShorthand.native.d.ts.map +1 -1
- package/types/helpers/parseOutlineShorthand.native.d.ts.map +1 -1
- package/types/helpers/resolveSafeArea.d.ts +0 -1
- package/types/helpers/resolveSafeArea.d.ts.map +1 -1
- package/types/helpers/resolveVariantStyle.d.ts +3 -0
- package/types/helpers/resolveVariantStyle.d.ts.map +1 -0
- package/types/helpers/splitStyleProps.d.ts +44 -0
- package/types/helpers/splitStyleProps.d.ts.map +1 -0
- package/types/helpers/styleFrontend.d.ts +7 -9
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +14 -0
- package/types/helpers/styleStaticConfig.d.ts.map +1 -0
- package/types/helpers/styleStaticConfigCore.d.ts +4 -0
- package/types/helpers/styleStaticConfigCore.d.ts.map +1 -0
- package/types/helpers/styledDynamic.d.ts +18 -0
- package/types/helpers/styledDynamic.d.ts.map +1 -0
- package/types/helpers/tokenCategories.d.ts +0 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/variableValue.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +68 -68
- package/types/hooks/useAnimationDriver.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/hooks/useStyle.d.ts +4 -0
- package/types/hooks/useStyle.d.ts.map +1 -0
- package/types/hooks/useThemeState.d.ts +1 -11
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +8 -8
- package/types/index.d.ts.map +1 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/internalRuntimeTypes.d.ts +1 -1
- package/types/internalRuntimeTypes.d.ts.map +1 -1
- package/types/static-resolve.d.ts +2 -2
- package/types/static-resolve.d.ts.map +1 -1
- package/types/style.d.ts +18 -0
- package/types/style.d.ts.map +1 -0
- package/types/styled.d.ts +12 -48
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +75 -60
- package/types/types.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts.map +1 -1
- package/types/views/View.d.ts.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +0 -348
- package/dist/cjs/helpers/directStyleCSS.native.cjs +0 -20
- package/dist/cjs/helpers/directStyleCSS.native.js.map +0 -1
- package/dist/cjs/helpers/directStyleCSSCompiled.cjs +0 -40
- package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +0 -46
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js +0 -48
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/cjs/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +0 -91
- package/dist/cjs/helpers/getVariantExtras.native.cjs +0 -94
- package/dist/cjs/helpers/getVariantExtras.native.js +0 -96
- package/dist/cjs/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/cjs/helpers/themeable.cjs +0 -92
- package/dist/cjs/helpers/themeable.native.cjs +0 -95
- package/dist/cjs/helpers/themeable.native.js +0 -97
- package/dist/cjs/helpers/themeable.native.js.map +0 -1
- package/dist/cjs/hooks/useProps.cjs +0 -129
- package/dist/cjs/hooks/useProps.native.cjs +0 -135
- package/dist/cjs/hooks/useProps.native.js +0 -137
- package/dist/cjs/hooks/useProps.native.js.map +0 -1
- package/dist/esm/helpers/directStyleCSS.mjs +0 -320
- package/dist/esm/helpers/directStyleCSS.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSS.native.js +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.mjs +0 -11
- package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.native.js +0 -15
- package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/esm/helpers/getDefaultProps.mjs +0 -4
- package/dist/esm/helpers/getDefaultProps.mjs.map +0 -1
- package/dist/esm/helpers/getDefaultProps.native.js +0 -6
- package/dist/esm/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/esm/helpers/getVariantExtras.mjs +0 -69
- package/dist/esm/helpers/getVariantExtras.mjs.map +0 -1
- package/dist/esm/helpers/getVariantExtras.native.js +0 -70
- package/dist/esm/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/esm/helpers/themeable.mjs +0 -67
- package/dist/esm/helpers/themeable.mjs.map +0 -1
- package/dist/esm/helpers/themeable.native.js +0 -68
- package/dist/esm/helpers/themeable.native.js.map +0 -1
- package/dist/esm/hooks/useProps.mjs +0 -100
- package/dist/esm/hooks/useProps.mjs.map +0 -1
- package/dist/esm/hooks/useProps.native.js +0 -104
- package/dist/esm/hooks/useProps.native.js.map +0 -1
- package/src/helpers/directStyleCSS.native.ts +0 -1
- package/src/helpers/directStyleCSS.ts +0 -534
- package/src/helpers/directStyleCSSCompiled.ts +0 -32
- package/src/helpers/getDefaultProps.ts +0 -3
- package/src/helpers/getVariantExtras.tsx +0 -95
- package/src/helpers/themeable.tsx +0 -96
- package/src/hooks/useProps.tsx +0 -186
- package/types/helpers/directStyleCSS.d.ts +0 -28
- package/types/helpers/directStyleCSS.d.ts.map +0 -1
- package/types/helpers/directStyleCSS.native.d.ts +0 -2
- package/types/helpers/directStyleCSS.native.d.ts.map +0 -1
- package/types/helpers/directStyleCSSCompiled.d.ts +0 -10
- package/types/helpers/directStyleCSSCompiled.d.ts.map +0 -1
- package/types/helpers/getDefaultProps.d.ts +0 -3
- package/types/helpers/getDefaultProps.d.ts.map +0 -1
- package/types/helpers/getVariantExtras.d.ts +0 -4
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts +0 -3
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/hooks/useProps.d.ts +0 -39
- package/types/hooks/useProps.d.ts.map +0 -1
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import type { StaticConfig, ThemeableProps, ThemeProps } from '../types'
|
|
4
|
-
import { Theme } from '../views/Theme'
|
|
5
|
-
import { getDefaultProps } from './getDefaultProps'
|
|
6
|
-
|
|
7
|
-
export function themeable<ComponentType extends (props: any) => any>(
|
|
8
|
-
Component: ComponentType,
|
|
9
|
-
staticConfig: Partial<StaticConfig>,
|
|
10
|
-
optimize = false
|
|
11
|
-
) {
|
|
12
|
-
const withThemeComponent = function WithTheme(props: ThemeableProps & { ref?: any }) {
|
|
13
|
-
'use no memo'
|
|
14
|
-
|
|
15
|
-
const userDefaults = getDefaultProps(staticConfig)
|
|
16
|
-
const defaultTheme = userDefaults?.theme
|
|
17
|
-
const defaultResetTheme = userDefaults?.themeReset
|
|
18
|
-
const { theme, themeReset, ref, ...rest } = props
|
|
19
|
-
|
|
20
|
-
let overriddenContextProps: object | undefined
|
|
21
|
-
const context = staticConfig?.context
|
|
22
|
-
if (context) {
|
|
23
|
-
for (const key in context.props) {
|
|
24
|
-
const val = props[key]
|
|
25
|
-
if (val !== undefined) {
|
|
26
|
-
overriddenContextProps = overriddenContextProps || {}
|
|
27
|
-
overriddenContextProps[key] = val
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const element = (
|
|
33
|
-
// @ts-expect-error its ok
|
|
34
|
-
<Component ref={ref} {...rest} data-disable-theme />
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
// we filter out the props here, why?
|
|
38
|
-
// Theme internally avoids wrapping <span /> unless 'theme' in props
|
|
39
|
-
// reason for this is to avoid wrapping every single component with span
|
|
40
|
-
// *if* ever it themes once, it leaves the span, to avoid reparenting
|
|
41
|
-
// its expected if users want to avoid re-parenting, they keep the theme prop
|
|
42
|
-
// and just set it to null. but we need to "respect" that here by filtering
|
|
43
|
-
// one example of a bug caused by not doing this is in <Select native> on web
|
|
44
|
-
// where it renders to an <option />, and then Theme would wrap a <span /> in that
|
|
45
|
-
// which is not allowed in HTML and causes hydration errors / logs
|
|
46
|
-
let filteredProps: Partial<ThemeProps> | null = null
|
|
47
|
-
|
|
48
|
-
if ('debug' in props) {
|
|
49
|
-
filteredProps = filteredProps || {}
|
|
50
|
-
filteredProps.debug = props.debug
|
|
51
|
-
}
|
|
52
|
-
if ('theme' in props || defaultTheme) {
|
|
53
|
-
filteredProps = filteredProps || {}
|
|
54
|
-
filteredProps.name = 'theme' in props ? props.theme : defaultTheme
|
|
55
|
-
}
|
|
56
|
-
if ('themeReset' in props || defaultResetTheme) {
|
|
57
|
-
filteredProps = filteredProps || {}
|
|
58
|
-
filteredProps.reset = 'themeReset' in props ? themeReset : defaultResetTheme
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (optimize && !filteredProps) {
|
|
62
|
-
// optimize by avoiding theme! this can re-parent but we should just document that to avoid performance
|
|
63
|
-
// in cases where you remove/add themes, just keep a theme={x ? '' : null} pattern
|
|
64
|
-
return element
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
let contents = (
|
|
68
|
-
<Theme disable-child-theme {...filteredProps}>
|
|
69
|
-
{element}
|
|
70
|
-
</Theme>
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
if (context) {
|
|
74
|
-
const Provider = context.Provider
|
|
75
|
-
const contextValue = React.useContext(context)
|
|
76
|
-
contents = (
|
|
77
|
-
<Provider {...contextValue} {...overriddenContextProps}>
|
|
78
|
-
{contents}
|
|
79
|
-
</Provider>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return contents
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const withTheme: any = withThemeComponent
|
|
87
|
-
withTheme.displayName = `Themed(${
|
|
88
|
-
(Component as any)?.displayName || (Component as any)?.name || 'Anonymous'
|
|
89
|
-
})`
|
|
90
|
-
|
|
91
|
-
type FinalComponentType = ComponentType extends (props: infer P) => infer R
|
|
92
|
-
? (props: Omit<P, 'theme'> & ThemeableProps) => R
|
|
93
|
-
: unknown
|
|
94
|
-
|
|
95
|
-
return withTheme as FinalComponentType
|
|
96
|
-
}
|
package/src/hooks/useProps.tsx
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { getConfig } from '../config'
|
|
4
|
-
import { ComponentContext } from '../contexts/ComponentContext'
|
|
5
|
-
import { GroupContext } from '../contexts/GroupContext'
|
|
6
|
-
import { useSplitStyles } from './useSplitStyles'
|
|
7
|
-
import { subscribeToSafeArea } from '../helpers/resolveSafeAreaVariable'
|
|
8
|
-
import {
|
|
9
|
-
subscribeToContextGroup,
|
|
10
|
-
useGroupSetRevision,
|
|
11
|
-
} from '../helpers/subscribeToContextGroup'
|
|
12
|
-
import type { SplitStyleProps, StaticConfig, ThemeParsed, UseMediaState } from '../types'
|
|
13
|
-
import type { ViewProps, ViewStyle } from '../views/View'
|
|
14
|
-
import { View } from '../views/View'
|
|
15
|
-
import { useComponentState } from './useComponentState'
|
|
16
|
-
import { mediaState } from '../helpers/mediaState'
|
|
17
|
-
import { useMedia } from './useMedia'
|
|
18
|
-
import { useThemeWithState } from './useTheme'
|
|
19
|
-
|
|
20
|
-
type UsePropsOptions = Pick<
|
|
21
|
-
SplitStyleProps,
|
|
22
|
-
'noExpand' | 'noNormalize' | 'noClass' | 'resolveValues'
|
|
23
|
-
> & {
|
|
24
|
-
disableExpandShorthands?: boolean
|
|
25
|
-
forComponent?: { staticConfig: StaticConfig }
|
|
26
|
-
noClass?: boolean
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Disable watching for media queries
|
|
30
|
-
*/
|
|
31
|
-
noMedia?: boolean
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export type PropsWithoutMediaStyles<A> = Partial<A>
|
|
35
|
-
|
|
36
|
-
type PropsLikeObject = (ViewProps & Record<string, any>) | object
|
|
37
|
-
type StyleLikeObject = (ViewStyle & Record<string, any>) | object
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Returns props and style as a single object, expanding and merging shorthands and media queries.
|
|
41
|
-
*
|
|
42
|
-
* Use sparingly, it will loop props and trigger re-render on all media queries you access.
|
|
43
|
-
*
|
|
44
|
-
* */
|
|
45
|
-
export function useProps<A extends PropsLikeObject>(
|
|
46
|
-
props: A,
|
|
47
|
-
opts?: UsePropsOptions
|
|
48
|
-
): PropsWithoutMediaStyles<A> {
|
|
49
|
-
const [propsOut, styleOut] = usePropsAndStyle(props, {
|
|
50
|
-
...opts,
|
|
51
|
-
noExpand: true,
|
|
52
|
-
noNormalize: true,
|
|
53
|
-
resolveValues: 'none',
|
|
54
|
-
})
|
|
55
|
-
return {
|
|
56
|
-
...propsOut,
|
|
57
|
-
...styleOut,
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Returns only style values fully resolved and flattened with merged media queries and shorthands with all theme and token values resolved.
|
|
63
|
-
*
|
|
64
|
-
* Use sparingly, it will loop props and trigger re-render on all media queries you access.
|
|
65
|
-
*
|
|
66
|
-
* */
|
|
67
|
-
export function useStyle<A extends StyleLikeObject>(
|
|
68
|
-
props: A,
|
|
69
|
-
opts?: UsePropsOptions
|
|
70
|
-
): PropsWithoutMediaStyles<A> {
|
|
71
|
-
return usePropsAndStyle(props, opts)[1] || {}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Returns [props, styles, theme, media] fully resolved and flattened with merged media queries and shorthands with all theme and token values resolved.
|
|
76
|
-
*
|
|
77
|
-
* Use sparingly, it will loop props and trigger re-render on all media queries you access.
|
|
78
|
-
*
|
|
79
|
-
* */
|
|
80
|
-
export function usePropsAndStyle<A extends PropsLikeObject>(
|
|
81
|
-
props: A,
|
|
82
|
-
opts?: UsePropsOptions
|
|
83
|
-
): [PropsWithoutMediaStyles<A>, PropsWithoutMediaStyles<A>, ThemeParsed, UseMediaState] {
|
|
84
|
-
const staticConfig = opts?.forComponent?.staticConfig ?? View.staticConfig
|
|
85
|
-
const [theme, themeState] = useThemeWithState({
|
|
86
|
-
name: 'theme' in props ? props.theme : undefined,
|
|
87
|
-
needsUpdate() {
|
|
88
|
-
return true
|
|
89
|
-
},
|
|
90
|
-
})
|
|
91
|
-
const componentContext = React.useContext(ComponentContext)
|
|
92
|
-
const groupContext = React.useContext(GroupContext)
|
|
93
|
-
// useComponentState injects enter/exit presence variants onto a fresh copy
|
|
94
|
-
// (it no longer mutates our `props` in place), so use the returned object for
|
|
95
|
-
// style resolution below to keep those variants applied
|
|
96
|
-
const componentState = useComponentState(
|
|
97
|
-
props,
|
|
98
|
-
componentContext.animationDriver,
|
|
99
|
-
staticConfig,
|
|
100
|
-
getConfig()
|
|
101
|
-
)
|
|
102
|
-
const {
|
|
103
|
-
props: statefulProps,
|
|
104
|
-
state,
|
|
105
|
-
disabled,
|
|
106
|
-
setState,
|
|
107
|
-
setStateShallow,
|
|
108
|
-
} = componentState
|
|
109
|
-
|
|
110
|
-
const mediaStateNow = opts?.noMedia
|
|
111
|
-
? // not safe to use mediaState but really marginal to hit this
|
|
112
|
-
mediaState
|
|
113
|
-
: useMedia()
|
|
114
|
-
|
|
115
|
-
const splitStyles = useSplitStyles(
|
|
116
|
-
statefulProps,
|
|
117
|
-
staticConfig,
|
|
118
|
-
theme,
|
|
119
|
-
themeState?.name || '',
|
|
120
|
-
state,
|
|
121
|
-
{
|
|
122
|
-
isAnimated: false,
|
|
123
|
-
mediaState: mediaStateNow,
|
|
124
|
-
noSkip: true,
|
|
125
|
-
noMergeStyle: true,
|
|
126
|
-
noClass: true,
|
|
127
|
-
resolveValues: 'auto',
|
|
128
|
-
...opts,
|
|
129
|
-
},
|
|
130
|
-
null,
|
|
131
|
-
componentContext,
|
|
132
|
-
groupContext
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
componentState.finalizeStyleFlags(
|
|
136
|
-
!!splitStyles?.hasEnterStyle,
|
|
137
|
-
!!splitStyles?.platformPseudo
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
const { mediaGroups, pseudoGroups } = splitStyles || {}
|
|
141
|
-
const groupSetRevision = useGroupSetRevision(pseudoGroups, mediaGroups)
|
|
142
|
-
|
|
143
|
-
useIsomorphicLayoutEffect(() => {
|
|
144
|
-
let disposeSafeArea: (() => void) | undefined
|
|
145
|
-
if (splitStyles?.usesSafeArea) {
|
|
146
|
-
const updateSafeArea = () => {
|
|
147
|
-
setState((previous) => ({ ...previous }))
|
|
148
|
-
}
|
|
149
|
-
disposeSafeArea = subscribeToSafeArea(updateSafeArea)
|
|
150
|
-
// close the render-to-subscribe race: the provider tracker may have
|
|
151
|
-
// published new insets after this hook evaluated its styles.
|
|
152
|
-
updateSafeArea()
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (disabled) {
|
|
156
|
-
return disposeSafeArea
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (state.unmounted) {
|
|
160
|
-
setStateShallow({ unmounted: false })
|
|
161
|
-
return disposeSafeArea
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (groupContext) {
|
|
165
|
-
const disposeGroup = subscribeToContextGroup({
|
|
166
|
-
groupContext,
|
|
167
|
-
setStateShallow,
|
|
168
|
-
mediaGroups,
|
|
169
|
-
pseudoGroups,
|
|
170
|
-
})
|
|
171
|
-
if (!disposeSafeArea) return disposeGroup
|
|
172
|
-
return () => {
|
|
173
|
-
disposeSafeArea()
|
|
174
|
-
disposeGroup?.()
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return disposeSafeArea
|
|
178
|
-
}, [disabled, groupContext, splitStyles?.usesSafeArea, groupSetRevision])
|
|
179
|
-
|
|
180
|
-
return [
|
|
181
|
-
splitStyles?.viewProps || {},
|
|
182
|
-
splitStyles?.style || {},
|
|
183
|
-
theme,
|
|
184
|
-
mediaState,
|
|
185
|
-
] as any
|
|
186
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { GetStyleState } from '../types';
|
|
2
|
-
export declare const canGenerateCSS: boolean;
|
|
3
|
-
/**
|
|
4
|
-
* A border width was authored, so its edge needs `borderStyle: solid` unless
|
|
5
|
-
* an authored border style owns the property by completion time. Requests key
|
|
6
|
-
* off the authored (pre-expansion) property, matching the emitted class.
|
|
7
|
-
*/
|
|
8
|
-
export declare function requestBorderStyleDefault(state: GetStyleState, property: string, condition: number, identity: string, selector: string, wrapperSource: readonly string[] | undefined, wrapperStart: number, wrapperCount: number): void;
|
|
9
|
-
export declare function directStyleSignature(property: string, value: unknown, conditionKey?: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Stream one CSS contribution. A property's first contribution serializes its
|
|
12
|
-
* class immediately (the overwhelmingly common case pays one cached build and
|
|
13
|
-
* no entry). A second contribution promotes the property to a combined slot,
|
|
14
|
-
* finished at completion by precedence order - the deferred arrangement the
|
|
15
|
-
* equal-specificity cascade tie-break requires (clauseOrderIndependence).
|
|
16
|
-
*/
|
|
17
|
-
export declare function streamAtomic(state: GetStyleState, property: string, value: any, condition: number, identity: string, selector: string, wrapperSource: readonly string[] | undefined, wrapperStart: number, wrapperCount: number, weak: boolean, original?: any): void;
|
|
18
|
-
/**
|
|
19
|
-
* The CSS residue that genuinely cannot stream: border-style defaults resolve
|
|
20
|
-
* against what the pass authored, promoted multi-contribution slots combine
|
|
21
|
-
* in precedence order, transition longhands group into one record, and the
|
|
22
|
-
* transform accumulator becomes the transform slot's base.
|
|
23
|
-
*/
|
|
24
|
-
export declare function completeStreamingCSS(state: GetStyleState): void;
|
|
25
|
-
export declare function flushDirectStyles(state: GetStyleState, clear?: boolean): void;
|
|
26
|
-
export declare function addComposition(state: GetStyleState, property: 'translate' | 'scale'): void;
|
|
27
|
-
export declare function clearFrameAtomic(state: GetStyleState, atomicKey: string): void;
|
|
28
|
-
//# sourceMappingURL=directStyleCSS.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directStyleCSS.d.ts","sourceRoot":"","sources":["../../src/helpers/directStyleCSS.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAW7C,eAAO,MAAM,cAAc,SACkD,CAAA;AAmB7E;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC5C,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,QA2BrB;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,YAAY,SAAK,UAGlB;AAmGD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC5C,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EACb,QAAQ,CAAC,EAAE,GAAG,QA8Kf;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,QA6ExD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,UAAQ,QAoBpE;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,QA8BnF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,QAMvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directStyleCSS.native.d.ts","sourceRoot":"","sources":["../../src/helpers/directStyleCSS.native.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { GetStyleState } from '../types';
|
|
2
|
-
export declare const canGenerateCSS = false;
|
|
3
|
-
export declare const directStyleSignature: () => string;
|
|
4
|
-
export declare function streamAtomic(_state: GetStyleState, _property: string, _value: any, _condition: number, _identity: string, _selector: string, _wrapperSource: readonly string[] | undefined, _wrapperStart: number, _wrapperCount: number, _weak: boolean, _original?: any): void;
|
|
5
|
-
export declare function completeStreamingCSS(_state: GetStyleState): void;
|
|
6
|
-
export declare function requestBorderStyleDefault(_state: GetStyleState, _property: string, _condition: number, _identity: string, _selector: string, _wrapperSource: readonly string[] | undefined, _wrapperStart: number, _wrapperCount: number): void;
|
|
7
|
-
export declare function flushDirectStyles(_state: GetStyleState, _clear?: boolean): void;
|
|
8
|
-
export declare function addComposition(_state: GetStyleState, _property: 'translate' | 'scale'): void;
|
|
9
|
-
export declare function clearFrameAtomic(_state: GetStyleState, _atomicKey: string): void;
|
|
10
|
-
//# sourceMappingURL=directStyleCSSCompiled.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"directStyleCSSCompiled.d.ts","sourceRoot":"","sources":["../../src/helpers/directStyleCSSCompiled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,eAAO,MAAM,cAAc,QAAQ,CAAA;AACnC,eAAO,MAAM,oBAAoB,cAAW,CAAA;AAE5C,wBAAgB,YAAY,CAC1B,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,GAAG,EACX,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC7C,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,GAAG,QACb;AACJ,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,QAAI;AAC9D,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC7C,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,QACnB;AACJ,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,UAAQ,QAAI;AAC3E,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,GAAG,OAAO,QAAI;AAC1F,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,QAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultProps.d.ts","sourceRoot":"","sources":["../../src/helpers/getDefaultProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,eAAO,MAAM,eAAe,iBAAkB,YAAY,oCAA8B,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { GenericFonts, GetStyleState, LanguageContextType } from '../types';
|
|
2
|
-
export declare const getVariantExtras: (styleState: GetStyleState) => any;
|
|
3
|
-
export declare function getFontsForLanguage(fonts: GenericFonts, language: LanguageContextType): any;
|
|
4
|
-
//# sourceMappingURL=getVariantExtras.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getVariantExtras.d.ts","sourceRoot":"","sources":["../../src/helpers/getVariantExtras.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAIhF,eAAO,MAAM,gBAAgB,eAAgB,aAAa,QAkEzD,CAAA;AAID,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,mBAAmB,OAkBrF"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { StaticConfig, ThemeableProps } from '../types';
|
|
2
|
-
export declare function themeable<ComponentType extends (props: any) => any>(Component: ComponentType, staticConfig: Partial<StaticConfig>, optimize?: boolean): ComponentType extends (props: infer P) => infer R ? (props: Omit<P, 'theme'> & ThemeableProps) => R : unknown;
|
|
3
|
-
//# sourceMappingURL=themeable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"themeable.d.ts","sourceRoot":"","sources":["../../src/helpers/themeable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAc,MAAM,UAAU,CAAA;AAIxE,wBAAgB,SAAS,CAAC,aAAa,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,EACjE,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,EACnC,QAAQ,UAAQ,iCAiFwC,MAAM,CAAC,KAAK,MAAM,CAAC,WAC/D,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,cAAc,KAAK,CAAC,WAIpD"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { SplitStyleProps, StaticConfig, ThemeParsed, UseMediaState } from '../types';
|
|
2
|
-
import type { ViewProps, ViewStyle } from '../views/View';
|
|
3
|
-
type UsePropsOptions = Pick<SplitStyleProps, 'noExpand' | 'noNormalize' | 'noClass' | 'resolveValues'> & {
|
|
4
|
-
disableExpandShorthands?: boolean;
|
|
5
|
-
forComponent?: {
|
|
6
|
-
staticConfig: StaticConfig;
|
|
7
|
-
};
|
|
8
|
-
noClass?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Disable watching for media queries
|
|
11
|
-
*/
|
|
12
|
-
noMedia?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export type PropsWithoutMediaStyles<A> = Partial<A>;
|
|
15
|
-
type PropsLikeObject = (ViewProps & Record<string, any>) | object;
|
|
16
|
-
type StyleLikeObject = (ViewStyle & Record<string, any>) | object;
|
|
17
|
-
/**
|
|
18
|
-
* Returns props and style as a single object, expanding and merging shorthands and media queries.
|
|
19
|
-
*
|
|
20
|
-
* Use sparingly, it will loop props and trigger re-render on all media queries you access.
|
|
21
|
-
*
|
|
22
|
-
* */
|
|
23
|
-
export declare function useProps<A extends PropsLikeObject>(props: A, opts?: UsePropsOptions): PropsWithoutMediaStyles<A>;
|
|
24
|
-
/**
|
|
25
|
-
* Returns only style values fully resolved and flattened with merged media queries and shorthands with all theme and token values resolved.
|
|
26
|
-
*
|
|
27
|
-
* Use sparingly, it will loop props and trigger re-render on all media queries you access.
|
|
28
|
-
*
|
|
29
|
-
* */
|
|
30
|
-
export declare function useStyle<A extends StyleLikeObject>(props: A, opts?: UsePropsOptions): PropsWithoutMediaStyles<A>;
|
|
31
|
-
/**
|
|
32
|
-
* Returns [props, styles, theme, media] fully resolved and flattened with merged media queries and shorthands with all theme and token values resolved.
|
|
33
|
-
*
|
|
34
|
-
* Use sparingly, it will loop props and trigger re-render on all media queries you access.
|
|
35
|
-
*
|
|
36
|
-
* */
|
|
37
|
-
export declare function usePropsAndStyle<A extends PropsLikeObject>(props: A, opts?: UsePropsOptions): [PropsWithoutMediaStyles<A>, PropsWithoutMediaStyles<A>, ThemeParsed, UseMediaState];
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=useProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useProps.d.ts","sourceRoot":"","sources":["../../src/hooks/useProps.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAOzD,KAAK,eAAe,GAAG,IAAI,CACzB,eAAe,EACf,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,eAAe,CACzD,GAAG;IACF,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,YAAY,CAAC,EAAE;QAAE,YAAY,EAAE,YAAY,CAAA;KAAE,CAAA;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAA;AAEnD,KAAK,eAAe,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,CAAA;AACjE,KAAK,eAAe,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,CAAA;AAEjE;;;;;KAKK;AACL,wBAAgB,QAAQ,CAAC,CAAC,SAAS,eAAe,EAChD,KAAK,EAAE,CAAC,EACR,IAAI,CAAC,EAAE,eAAe,GACrB,uBAAuB,CAAC,CAAC,CAAC,CAW5B;AAED;;;;;KAKK;AACL,wBAAgB,QAAQ,CAAC,CAAC,SAAS,eAAe,EAChD,KAAK,EAAE,CAAC,EACR,IAAI,CAAC,EAAE,eAAe,GACrB,uBAAuB,CAAC,CAAC,CAAC,CAE5B;AAED;;;;;KAKK;AACL,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,eAAe,EACxD,KAAK,EAAE,CAAC,EACR,IAAI,CAAC,EAAE,eAAe,GACrB,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC,CAuGtF"}
|