@tamagui/web 3.0.0-beta.831.1 → 3.0.0-beta.889.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 +12 -1
- package/dist/cjs/createComponent.native.cjs +12 -1
- package/dist/cjs/createComponent.native.js +12 -1
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +1 -1
- package/dist/cjs/createStyledHOC.native.cjs +1 -1
- package/dist/cjs/createStyledHOC.native.js +1 -1
- package/dist/cjs/createStyledHOC.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/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/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 +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +128 -109
- 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 +1042 -1715
- package/dist/cjs/helpers/getSplitStyles.native.cjs +1081 -1887
- package/dist/cjs/helpers/getSplitStyles.native.js +1081 -1887
- 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/styleStaticConfig.cjs +1 -50
- package/dist/cjs/helpers/styleStaticConfig.native.cjs +1 -51
- package/dist/cjs/helpers/styleStaticConfig.native.js +1 -51
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -1
- 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 +15 -38
- package/dist/cjs/helpers/tokenCategories.native.cjs +15 -40
- package/dist/cjs/helpers/tokenCategories.native.js +15 -40
- 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/{helpers/directStyleCSS.native.js → hooks/useStyle.cjs} +16 -8
- package/dist/cjs/{helpers/directStyleCSS.native.cjs → hooks/useStyle.native.cjs} +16 -4
- 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 +6 -3
- package/dist/cjs/index.native.cjs +6 -3
- package/dist/cjs/index.native.js +6 -3
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +2 -2
- package/dist/cjs/static-resolve.native.cjs +2 -2
- package/dist/cjs/static-resolve.native.js +2 -2
- 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 +11 -6
- package/dist/cjs/styled.native.cjs +11 -6
- package/dist/cjs/styled.native.js +11 -6
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +6 -4
- package/dist/cjs/types.native.cjs +6 -4
- package/dist/cjs/types.native.js +6 -4
- 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 +17 -12
- package/dist/cjs/views/Text.native.cjs +1 -0
- package/dist/cjs/views/Text.native.js +1 -0
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +3 -3
- package/dist/cjs/views/Theme.native.cjs +3 -3
- package/dist/cjs/views/Theme.native.js +3 -3
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -4
- package/dist/esm/createComponent.mjs +12 -1
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +12 -1
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +1 -1
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +1 -1
- package/dist/esm/createStyledHOC.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/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/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 +6 -6
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +6 -6
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +126 -109
- 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 +1034 -1705
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +1071 -1871
- 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/styleStaticConfig.mjs +1 -50
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -1
- package/dist/esm/helpers/styleStaticConfig.native.js +1 -51
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -1
- 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 +15 -36
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +15 -38
- 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/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 +6 -4
- package/dist/esm/index.mjs +6 -4
- package/dist/esm/index.native.js +6 -4
- package/dist/esm/static-resolve.mjs +3 -3
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +3 -3
- 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 +12 -6
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +12 -6
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +3 -4
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +3 -4
- 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 +17 -12
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Theme.mjs +3 -3
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +3 -3
- 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/package.json +15 -15
- package/src/createComponent.tsx +21 -1
- package/src/createStyledHOC.tsx +4 -2
- package/src/createVariable.ts +0 -10
- package/src/helpers/borderComponents.ts +62 -0
- package/src/helpers/createDesignSystem.ts +0 -2
- package/src/helpers/createStyledContext.tsx +15 -53
- package/src/helpers/formatDiagnostic.ts +9 -9
- package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
- package/src/helpers/getCSSStylesAtomic.ts +192 -207
- package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
- package/src/helpers/getDynamicVal.ts +4 -0
- package/src/helpers/getSplitStyles.tsx +2080 -3270
- 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/styleFrontend.ts +8 -5
- package/src/helpers/styleStaticConfig.ts +5 -72
- package/src/helpers/styleStaticConfigCore.ts +110 -0
- package/src/helpers/styledDynamic.ts +191 -0
- package/src/helpers/tokenCategories.ts +40 -65
- 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/useStyle.ts +10 -0
- package/src/hooks/useThemeState.ts +51 -264
- package/src/index.ts +6 -6
- package/src/internalRuntimeTypes.ts +1 -0
- package/src/static-resolve.ts +7 -4
- package/src/style.ts +97 -0
- package/src/styled.tsx +39 -68
- package/src/types.tsx +105 -169
- package/src/views/TamaguiProvider.tsx +0 -2
- package/src/views/Text.tsx +20 -14
- package/src/views/Theme.tsx +13 -9
- package/src/views/ThemeDebug.tsx +0 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts +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/helpers/borderComponents.d.ts +10 -0
- package/types/helpers/borderComponents.d.ts.map +1 -0
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/createStyledContext.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +20 -19
- 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 +3 -5
- 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/styleFrontend.d.ts +3 -5
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +4 -9
- package/types/helpers/styleStaticConfig.d.ts.map +1 -1
- 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/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 +6 -4
- package/types/index.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.map +1 -1
- package/types/style.d.ts +18 -0
- package/types/style.d.ts.map +1 -0
- package/types/styled.d.ts +10 -10
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +74 -49
- 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/dist/cjs/helpers/directStyleCSS.cjs +0 -345
- 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/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/variantResolvers.cjs +0 -87
- package/dist/cjs/helpers/variantResolvers.native.cjs +0 -140
- package/dist/cjs/helpers/variantResolvers.native.js +0 -142
- package/dist/cjs/helpers/variantResolvers.native.js.map +0 -1
- package/dist/esm/helpers/directStyleCSS.mjs +0 -317
- 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/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/variantResolvers.mjs +0 -65
- package/dist/esm/helpers/variantResolvers.mjs.map +0 -1
- package/dist/esm/helpers/variantResolvers.native.js +0 -116
- package/dist/esm/helpers/variantResolvers.native.js.map +0 -1
- package/src/helpers/directStyleCSS.native.ts +0 -1
- package/src/helpers/directStyleCSS.ts +0 -513
- package/src/helpers/directStyleCSSCompiled.ts +0 -32
- package/src/helpers/getVariantExtras.tsx +0 -95
- package/src/helpers/variantResolvers.ts +0 -121
- 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/getVariantExtras.d.ts +0 -4
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/variantResolvers.d.ts +0 -9
- package/types/helpers/variantResolvers.d.ts.map +0 -1
|
@@ -25,9 +25,15 @@ __export(grammarConfig_exports, {
|
|
|
25
25
|
prepareConfigRevision: () => prepareConfigRevision
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(grammarConfig_exports);
|
|
28
|
+
var import_constants = require("@tamagui/constants");
|
|
28
29
|
var import_helpers = require("@tamagui/helpers");
|
|
29
30
|
var import_runtime = require("@tamagui/style-grammar/runtime");
|
|
31
|
+
var import_borderComponents = require("./borderComponents.cjs");
|
|
30
32
|
var import_mediaObjectToString = require("./mediaObjectToString.cjs");
|
|
33
|
+
var import_tokenCategories = require("./tokenCategories.cjs");
|
|
34
|
+
var import_resolveSafeArea = require("./resolveSafeArea.cjs");
|
|
35
|
+
var import_resolveSafeAreaVariable = require("./resolveSafeAreaVariable.cjs");
|
|
36
|
+
var import_styleStaticConfigCore = require("./styleStaticConfigCore.cjs");
|
|
31
37
|
function prepareConfigRevision(config) {
|
|
32
38
|
const target = config;
|
|
33
39
|
const previous = target[import_runtime.configRevisionSymbol];
|
|
@@ -56,10 +62,166 @@ function prepareConfigRevision(config) {
|
|
|
56
62
|
for (const name of mediaNames) {
|
|
57
63
|
mediaQueries[name] = (0, import_mediaObjectToString.mediaObjectToString)(media[name]);
|
|
58
64
|
}
|
|
65
|
+
const conditionModifiers = /* @__PURE__ */ Object.create(null);
|
|
66
|
+
for (const name in modifiers) {
|
|
67
|
+
const code = modifiers[name];
|
|
68
|
+
const kind = code & 7;
|
|
69
|
+
const rank = code >> 3;
|
|
70
|
+
conditionModifiers[name] = kind === import_runtime.modifierKindState ? [
|
|
71
|
+
import_runtime.canonicalStateModifierNames[rank],
|
|
72
|
+
kind,
|
|
73
|
+
rank,
|
|
74
|
+
import_runtime.stateModifierSelectors[rank]
|
|
75
|
+
] : kind === import_runtime.modifierKindMedia ? [
|
|
76
|
+
name,
|
|
77
|
+
kind,
|
|
78
|
+
rank,
|
|
79
|
+
mediaQueries[name]
|
|
80
|
+
] : kind === import_runtime.modifierKindPlatform ? [
|
|
81
|
+
name,
|
|
82
|
+
kind,
|
|
83
|
+
rank,
|
|
84
|
+
void 0,
|
|
85
|
+
void 0,
|
|
86
|
+
void 0,
|
|
87
|
+
(0, import_constants.platformMatches)(name)
|
|
88
|
+
] : [
|
|
89
|
+
name,
|
|
90
|
+
kind,
|
|
91
|
+
rank
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
const resolveCondition = (authored) => {
|
|
95
|
+
const cached = conditionModifiers[authored];
|
|
96
|
+
if (cached !== void 0) return cached;
|
|
97
|
+
let result = null;
|
|
98
|
+
if (authored.startsWith("group-")) {
|
|
99
|
+
const slash = authored.indexOf("/");
|
|
100
|
+
const state = authored.slice(6, slash === -1 ? void 0 : slash);
|
|
101
|
+
const code = modifiers[state] || 0;
|
|
102
|
+
const rank = code >> 3;
|
|
103
|
+
const groupName = slash === -1 ? "true" : authored.slice(slash + 1);
|
|
104
|
+
if ((code & 7) === import_runtime.modifierKindState && rank !== 6 && rank !== 7 && (slash === -1 || /^[\w-]+$/.test(groupName))) {
|
|
105
|
+
result = [
|
|
106
|
+
`group-${import_runtime.canonicalStateModifierNames[rank]}${slash === -1 ? "" : authored.slice(slash)}`,
|
|
107
|
+
5,
|
|
108
|
+
rank,
|
|
109
|
+
import_runtime.stateModifierSelectors[rank],
|
|
110
|
+
groupName,
|
|
111
|
+
import_runtime.canonicalStateModifierNames[rank]
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
} else if (authored.charCodeAt(0) === 64) {
|
|
115
|
+
const slash = authored.indexOf("/");
|
|
116
|
+
const size = authored.slice(1, slash === -1 ? void 0 : slash);
|
|
117
|
+
const containerName = slash === -1 ? "" : authored.slice(slash + 1);
|
|
118
|
+
const code = modifiers[size] || 0;
|
|
119
|
+
const query = mediaQueries[size];
|
|
120
|
+
if (/^[\w-]+$/.test(size) && (slash === -1 || /^[\w-]+$/.test(containerName)) && (code & 7) === import_runtime.modifierKindMedia && (0, import_runtime.isContainerSizeQueryText)(query)) {
|
|
121
|
+
result = [
|
|
122
|
+
authored,
|
|
123
|
+
6,
|
|
124
|
+
code >> 3,
|
|
125
|
+
query,
|
|
126
|
+
size,
|
|
127
|
+
containerName
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return conditionModifiers[authored] = result;
|
|
132
|
+
};
|
|
133
|
+
const propertyKinds = {
|
|
134
|
+
shadowColor: 1,
|
|
135
|
+
shadowOffset: 2,
|
|
136
|
+
shadowOpacity: 3,
|
|
137
|
+
shadowRadius: 4,
|
|
138
|
+
matrix: 5,
|
|
139
|
+
perspective: 5,
|
|
140
|
+
rotateX: 5,
|
|
141
|
+
rotateY: 5,
|
|
142
|
+
rotateZ: 5,
|
|
143
|
+
scaleZ: 5,
|
|
144
|
+
skewX: 5,
|
|
145
|
+
skewY: 5,
|
|
146
|
+
textShadowColor: 6,
|
|
147
|
+
textShadowOffset: 6,
|
|
148
|
+
textShadowRadius: 6,
|
|
149
|
+
border: 7,
|
|
150
|
+
borderTop: 7,
|
|
151
|
+
borderRight: 7,
|
|
152
|
+
borderBottom: 7,
|
|
153
|
+
borderLeft: 7,
|
|
154
|
+
borderBlock: 7,
|
|
155
|
+
borderInline: 7,
|
|
156
|
+
outline: 7,
|
|
157
|
+
padding: 8,
|
|
158
|
+
paddingBlock: 8,
|
|
159
|
+
paddingInline: 8,
|
|
160
|
+
margin: 8,
|
|
161
|
+
marginBlock: 8,
|
|
162
|
+
marginInline: 8,
|
|
163
|
+
inset: 8,
|
|
164
|
+
insetBlock: 8,
|
|
165
|
+
insetInline: 8,
|
|
166
|
+
borderRadius: 8
|
|
167
|
+
};
|
|
168
|
+
const propertyKind = (property) => propertyKinds[property] || 0;
|
|
169
|
+
const normalizedTransitions = /* @__PURE__ */ new Map();
|
|
59
170
|
const next = {
|
|
60
171
|
revision: captured.revision,
|
|
61
172
|
modifiers,
|
|
62
|
-
mediaQueries
|
|
173
|
+
mediaQueries,
|
|
174
|
+
resolveCondition,
|
|
175
|
+
tokenCategory: import_tokenCategories.getTokenCategoryForProperty,
|
|
176
|
+
expandSafeArea: import_resolveSafeArea.expandSafeAreaValue,
|
|
177
|
+
safeAreaVariable: import_resolveSafeAreaVariable.resolveSafeAreaVariable,
|
|
178
|
+
parseFlatValue: import_runtime.parseFlatValue,
|
|
179
|
+
styleStaticConfig: (staticConfig, conf) => (0, import_styleStaticConfigCore.resolveStyleStaticConfig)(staticConfig, conf, captured.revision),
|
|
180
|
+
propertyKind,
|
|
181
|
+
compositeValue: (property, raw, context, resolve) => {
|
|
182
|
+
const kind = propertyKinds[property];
|
|
183
|
+
if (kind < 7) return;
|
|
184
|
+
if (kind === 7) {
|
|
185
|
+
const { width, style, color } = (0, import_borderComponents.classifyBorderComponents)(raw, property === "outline");
|
|
186
|
+
if (style === "none" && !color) return "none";
|
|
187
|
+
const prefix = property === "outline" ? "outline" : "border";
|
|
188
|
+
return [
|
|
189
|
+
width && resolve(context, `${prefix}Width`, width),
|
|
190
|
+
style,
|
|
191
|
+
color && resolve(context, `${prefix}Color`, color)
|
|
192
|
+
].filter(Boolean).join(" ");
|
|
193
|
+
}
|
|
194
|
+
if (!/\s/.test(raw)) return;
|
|
195
|
+
const parts = (0, import_borderComponents.splitComponents)(raw);
|
|
196
|
+
if (parts.length > 1) {
|
|
197
|
+
let value = "";
|
|
198
|
+
for (const part of parts) {
|
|
199
|
+
value += `${value ? " " : ""}${resolve(context, property, part)}`;
|
|
200
|
+
}
|
|
201
|
+
return value;
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
normalizeTransition: (raw) => {
|
|
205
|
+
const known = normalizedTransitions.get(raw);
|
|
206
|
+
if (known !== void 0) return known;
|
|
207
|
+
const out = raw.replace(/\/\*[\s\S]*?\*\/|(["'])(?:\\.|(?!\1)[^\\])*\1|[A-Za-z_][\w-]*/g, (authored, quote, offset) => {
|
|
208
|
+
if (quote || raw.charCodeAt(offset + authored.length) === 40 || raw.charCodeAt(offset - 1) === 45 && raw.charCodeAt(offset - 2) === 45) {
|
|
209
|
+
return authored;
|
|
210
|
+
}
|
|
211
|
+
let property = config.shorthands[authored] || authored;
|
|
212
|
+
if (property === "x" || property === "y") property = "translate";
|
|
213
|
+
else if (property === "scaleX" || property === "scaleY") property = "scale";
|
|
214
|
+
else if (propertyKind(property) === 5) property = "transform";
|
|
215
|
+
return property.replace(/[A-Z]/g, "-$&").toLowerCase();
|
|
216
|
+
});
|
|
217
|
+
if (normalizedTransitions.size > 2048) normalizedTransitions.clear();
|
|
218
|
+
normalizedTransitions.set(raw, out);
|
|
219
|
+
return out;
|
|
220
|
+
},
|
|
221
|
+
embeddedTokens: (raw, resolve) => raw.replace(/\/\*[\s\S]*?\*\/|(["'])(?:\\.|(?!\1)[^\\])*\1|[$A-Za-z_][\w.$-]*(?:\/\d+)?/g, (word, quote, offset) => {
|
|
222
|
+
const before = raw.charCodeAt(offset - 1);
|
|
223
|
+
return quote || word[0] !== "$" && (before >= 48 && before <= 57 || before === 35 || before === 45 && raw.charCodeAt(offset - 2) === 45 || raw.charCodeAt(offset + word.length) === 40) ? word : resolve(word);
|
|
224
|
+
})
|
|
63
225
|
};
|
|
64
226
|
if (target[import_runtime.configRevisionSymbol] === captured) {
|
|
65
227
|
target[import_runtime.configRevisionSymbol] = next;
|
|
@@ -27,9 +27,15 @@ __export(grammarConfig_exports, {
|
|
|
27
27
|
prepareConfigRevision: () => prepareConfigRevision
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(grammarConfig_exports);
|
|
30
|
+
var import_constants = require("@tamagui/constants");
|
|
30
31
|
var import_helpers = require("@tamagui/helpers");
|
|
31
32
|
var import_runtime = require("@tamagui/style-grammar/runtime");
|
|
33
|
+
var import_borderComponents = require("./borderComponents.native.js");
|
|
32
34
|
var import_mediaObjectToString = require("./mediaObjectToString.native.js");
|
|
35
|
+
var import_tokenCategories = require("./tokenCategories.native.js");
|
|
36
|
+
var import_resolveSafeArea = require("./resolveSafeArea.native.js");
|
|
37
|
+
var import_resolveSafeAreaVariable = require("./resolveSafeAreaVariable.native.js");
|
|
38
|
+
var import_styleStaticConfigCore = require("./styleStaticConfigCore.native.js");
|
|
33
39
|
function prepareConfigRevision(config) {
|
|
34
40
|
var target = config;
|
|
35
41
|
var previous = target[import_runtime.configRevisionSymbol];
|
|
@@ -75,10 +81,189 @@ function prepareConfigRevision(config) {
|
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
}
|
|
84
|
+
var conditionModifiers = /* @__PURE__ */ Object.create(null);
|
|
85
|
+
for (var name1 in modifiers) {
|
|
86
|
+
var code = modifiers[name1];
|
|
87
|
+
var kind = code & 7;
|
|
88
|
+
var rank = code >> 3;
|
|
89
|
+
conditionModifiers[name1] = kind === import_runtime.modifierKindState ? [
|
|
90
|
+
import_runtime.canonicalStateModifierNames[rank],
|
|
91
|
+
kind,
|
|
92
|
+
rank,
|
|
93
|
+
import_runtime.stateModifierSelectors[rank]
|
|
94
|
+
] : kind === import_runtime.modifierKindMedia ? [
|
|
95
|
+
name1,
|
|
96
|
+
kind,
|
|
97
|
+
rank,
|
|
98
|
+
mediaQueries[name1]
|
|
99
|
+
] : kind === import_runtime.modifierKindPlatform ? [
|
|
100
|
+
name1,
|
|
101
|
+
kind,
|
|
102
|
+
rank,
|
|
103
|
+
void 0,
|
|
104
|
+
void 0,
|
|
105
|
+
void 0,
|
|
106
|
+
(0, import_constants.platformMatches)(name1)
|
|
107
|
+
] : [
|
|
108
|
+
name1,
|
|
109
|
+
kind,
|
|
110
|
+
rank
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
var resolveCondition = function(authored) {
|
|
114
|
+
var cached = conditionModifiers[authored];
|
|
115
|
+
if (cached !== void 0) return cached;
|
|
116
|
+
var result = null;
|
|
117
|
+
if (authored.startsWith("group-")) {
|
|
118
|
+
var slash = authored.indexOf("/");
|
|
119
|
+
var state = authored.slice(6, slash === -1 ? void 0 : slash);
|
|
120
|
+
var code2 = modifiers[state] || 0;
|
|
121
|
+
var rank2 = code2 >> 3;
|
|
122
|
+
var groupName = slash === -1 ? "true" : authored.slice(slash + 1);
|
|
123
|
+
if ((code2 & 7) === import_runtime.modifierKindState && rank2 !== 6 && rank2 !== 7 && (slash === -1 || /^[\w-]+$/.test(groupName))) {
|
|
124
|
+
result = [
|
|
125
|
+
`group-${import_runtime.canonicalStateModifierNames[rank2]}${slash === -1 ? "" : authored.slice(slash)}`,
|
|
126
|
+
5,
|
|
127
|
+
rank2,
|
|
128
|
+
import_runtime.stateModifierSelectors[rank2],
|
|
129
|
+
groupName,
|
|
130
|
+
import_runtime.canonicalStateModifierNames[rank2]
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
} else if (authored.charCodeAt(0) === 64) {
|
|
134
|
+
var slash1 = authored.indexOf("/");
|
|
135
|
+
var size = authored.slice(1, slash1 === -1 ? void 0 : slash1);
|
|
136
|
+
var containerName = slash1 === -1 ? "" : authored.slice(slash1 + 1);
|
|
137
|
+
var code1 = modifiers[size] || 0;
|
|
138
|
+
var query = mediaQueries[size];
|
|
139
|
+
if (/^[\w-]+$/.test(size) && (slash1 === -1 || /^[\w-]+$/.test(containerName)) && (code1 & 7) === import_runtime.modifierKindMedia && (0, import_runtime.isContainerSizeQueryText)(query)) {
|
|
140
|
+
result = [
|
|
141
|
+
authored,
|
|
142
|
+
6,
|
|
143
|
+
code1 >> 3,
|
|
144
|
+
query,
|
|
145
|
+
size,
|
|
146
|
+
containerName
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return conditionModifiers[authored] = result;
|
|
151
|
+
};
|
|
152
|
+
var propertyKinds = {
|
|
153
|
+
shadowColor: 1,
|
|
154
|
+
shadowOffset: 2,
|
|
155
|
+
shadowOpacity: 3,
|
|
156
|
+
shadowRadius: 4,
|
|
157
|
+
matrix: 5,
|
|
158
|
+
perspective: 5,
|
|
159
|
+
rotateX: 5,
|
|
160
|
+
rotateY: 5,
|
|
161
|
+
rotateZ: 5,
|
|
162
|
+
scaleZ: 5,
|
|
163
|
+
skewX: 5,
|
|
164
|
+
skewY: 5,
|
|
165
|
+
textShadowColor: 6,
|
|
166
|
+
textShadowOffset: 6,
|
|
167
|
+
textShadowRadius: 6,
|
|
168
|
+
border: 7,
|
|
169
|
+
borderTop: 7,
|
|
170
|
+
borderRight: 7,
|
|
171
|
+
borderBottom: 7,
|
|
172
|
+
borderLeft: 7,
|
|
173
|
+
borderBlock: 7,
|
|
174
|
+
borderInline: 7,
|
|
175
|
+
outline: 7,
|
|
176
|
+
padding: 8,
|
|
177
|
+
paddingBlock: 8,
|
|
178
|
+
paddingInline: 8,
|
|
179
|
+
margin: 8,
|
|
180
|
+
marginBlock: 8,
|
|
181
|
+
marginInline: 8,
|
|
182
|
+
inset: 8,
|
|
183
|
+
insetBlock: 8,
|
|
184
|
+
insetInline: 8,
|
|
185
|
+
borderRadius: 8
|
|
186
|
+
};
|
|
187
|
+
var propertyKind = function(property) {
|
|
188
|
+
return propertyKinds[property] || 0;
|
|
189
|
+
};
|
|
190
|
+
var normalizedTransitions = /* @__PURE__ */ new Map();
|
|
78
191
|
var next = {
|
|
79
192
|
revision: captured.revision,
|
|
80
193
|
modifiers,
|
|
81
|
-
mediaQueries
|
|
194
|
+
mediaQueries,
|
|
195
|
+
resolveCondition,
|
|
196
|
+
tokenCategory: import_tokenCategories.getTokenCategoryForProperty,
|
|
197
|
+
expandSafeArea: import_resolveSafeArea.expandSafeAreaValue,
|
|
198
|
+
safeAreaVariable: import_resolveSafeAreaVariable.resolveSafeAreaVariable,
|
|
199
|
+
parseFlatValue: import_runtime.parseFlatValue,
|
|
200
|
+
styleStaticConfig: function(staticConfig, conf) {
|
|
201
|
+
return (0, import_styleStaticConfigCore.resolveStyleStaticConfig)(staticConfig, conf, captured.revision);
|
|
202
|
+
},
|
|
203
|
+
propertyKind,
|
|
204
|
+
compositeValue: function(property, raw, context, resolve) {
|
|
205
|
+
var kind2 = propertyKinds[property];
|
|
206
|
+
if (kind2 < 7) return;
|
|
207
|
+
if (kind2 === 7) {
|
|
208
|
+
var { width, style, color } = (0, import_borderComponents.classifyBorderComponents)(raw, property === "outline");
|
|
209
|
+
if (style === "none" && !color) return "none";
|
|
210
|
+
var prefix = property === "outline" ? "outline" : "border";
|
|
211
|
+
return [
|
|
212
|
+
width && resolve(context, `${prefix}Width`, width),
|
|
213
|
+
style,
|
|
214
|
+
color && resolve(context, `${prefix}Color`, color)
|
|
215
|
+
].filter(Boolean).join(" ");
|
|
216
|
+
}
|
|
217
|
+
if (!/\s/.test(raw)) return;
|
|
218
|
+
var parts = (0, import_borderComponents.splitComponents)(raw);
|
|
219
|
+
if (parts.length > 1) {
|
|
220
|
+
var value = "";
|
|
221
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
222
|
+
try {
|
|
223
|
+
for (var _iterator2 = parts[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
224
|
+
var part = _step2.value;
|
|
225
|
+
value += `${value ? " " : ""}${resolve(context, property, part)}`;
|
|
226
|
+
}
|
|
227
|
+
} catch (err) {
|
|
228
|
+
_didIteratorError2 = true;
|
|
229
|
+
_iteratorError2 = err;
|
|
230
|
+
} finally {
|
|
231
|
+
try {
|
|
232
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
233
|
+
_iterator2.return();
|
|
234
|
+
}
|
|
235
|
+
} finally {
|
|
236
|
+
if (_didIteratorError2) {
|
|
237
|
+
throw _iteratorError2;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return value;
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
normalizeTransition: function(raw) {
|
|
245
|
+
var known = normalizedTransitions.get(raw);
|
|
246
|
+
if (known !== void 0) return known;
|
|
247
|
+
var out = raw.replace(/\/\*[\s\S]*?\*\/|(["'])(?:\\.|(?!\1)[^\\])*\1|[A-Za-z_][\w-]*/g, function(authored, quote, offset) {
|
|
248
|
+
if (quote || raw.charCodeAt(offset + authored.length) === 40 || raw.charCodeAt(offset - 1) === 45 && raw.charCodeAt(offset - 2) === 45) {
|
|
249
|
+
return authored;
|
|
250
|
+
}
|
|
251
|
+
var property = config.shorthands[authored] || authored;
|
|
252
|
+
if (property === "x" || property === "y") property = "translate";
|
|
253
|
+
else if (property === "scaleX" || property === "scaleY") property = "scale";
|
|
254
|
+
else if (propertyKind(property) === 5) property = "transform";
|
|
255
|
+
return property.replace(/[A-Z]/g, "-$&").toLowerCase();
|
|
256
|
+
});
|
|
257
|
+
if (normalizedTransitions.size > 2048) normalizedTransitions.clear();
|
|
258
|
+
normalizedTransitions.set(raw, out);
|
|
259
|
+
return out;
|
|
260
|
+
},
|
|
261
|
+
embeddedTokens: function(raw, resolve) {
|
|
262
|
+
return raw.replace(/\/\*[\s\S]*?\*\/|(["'])(?:\\.|(?!\1)[^\\])*\1|[$A-Za-z_][\w.$-]*(?:\/\d+)?/g, function(word, quote, offset) {
|
|
263
|
+
var before = raw.charCodeAt(offset - 1);
|
|
264
|
+
return quote || word[0] !== "$" && (before >= 48 && before <= 57 || before === 35 || before === 45 && raw.charCodeAt(offset - 2) === 45 || raw.charCodeAt(offset + word.length) === 40) ? word : resolve(word);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
82
267
|
};
|
|
83
268
|
if (target[import_runtime.configRevisionSymbol] === captured) {
|
|
84
269
|
target[import_runtime.configRevisionSymbol] = next;
|
|
@@ -27,9 +27,15 @@ __export(grammarConfig_exports, {
|
|
|
27
27
|
prepareConfigRevision: () => prepareConfigRevision
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(grammarConfig_exports);
|
|
30
|
+
var import_constants = require("@tamagui/constants");
|
|
30
31
|
var import_helpers = require("@tamagui/helpers");
|
|
31
32
|
var import_runtime = require("@tamagui/style-grammar/runtime");
|
|
33
|
+
var import_borderComponents = require("./borderComponents.native.js");
|
|
32
34
|
var import_mediaObjectToString = require("./mediaObjectToString.native.js");
|
|
35
|
+
var import_tokenCategories = require("./tokenCategories.native.js");
|
|
36
|
+
var import_resolveSafeArea = require("./resolveSafeArea.native.js");
|
|
37
|
+
var import_resolveSafeAreaVariable = require("./resolveSafeAreaVariable.native.js");
|
|
38
|
+
var import_styleStaticConfigCore = require("./styleStaticConfigCore.native.js");
|
|
33
39
|
function prepareConfigRevision(config) {
|
|
34
40
|
var target = config;
|
|
35
41
|
var previous = target[import_runtime.configRevisionSymbol];
|
|
@@ -75,10 +81,189 @@ function prepareConfigRevision(config) {
|
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
}
|
|
84
|
+
var conditionModifiers = /* @__PURE__ */ Object.create(null);
|
|
85
|
+
for (var name1 in modifiers) {
|
|
86
|
+
var code = modifiers[name1];
|
|
87
|
+
var kind = code & 7;
|
|
88
|
+
var rank = code >> 3;
|
|
89
|
+
conditionModifiers[name1] = kind === import_runtime.modifierKindState ? [
|
|
90
|
+
import_runtime.canonicalStateModifierNames[rank],
|
|
91
|
+
kind,
|
|
92
|
+
rank,
|
|
93
|
+
import_runtime.stateModifierSelectors[rank]
|
|
94
|
+
] : kind === import_runtime.modifierKindMedia ? [
|
|
95
|
+
name1,
|
|
96
|
+
kind,
|
|
97
|
+
rank,
|
|
98
|
+
mediaQueries[name1]
|
|
99
|
+
] : kind === import_runtime.modifierKindPlatform ? [
|
|
100
|
+
name1,
|
|
101
|
+
kind,
|
|
102
|
+
rank,
|
|
103
|
+
void 0,
|
|
104
|
+
void 0,
|
|
105
|
+
void 0,
|
|
106
|
+
(0, import_constants.platformMatches)(name1)
|
|
107
|
+
] : [
|
|
108
|
+
name1,
|
|
109
|
+
kind,
|
|
110
|
+
rank
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
var resolveCondition = function(authored) {
|
|
114
|
+
var cached = conditionModifiers[authored];
|
|
115
|
+
if (cached !== void 0) return cached;
|
|
116
|
+
var result = null;
|
|
117
|
+
if (authored.startsWith("group-")) {
|
|
118
|
+
var slash = authored.indexOf("/");
|
|
119
|
+
var state = authored.slice(6, slash === -1 ? void 0 : slash);
|
|
120
|
+
var code2 = modifiers[state] || 0;
|
|
121
|
+
var rank2 = code2 >> 3;
|
|
122
|
+
var groupName = slash === -1 ? "true" : authored.slice(slash + 1);
|
|
123
|
+
if ((code2 & 7) === import_runtime.modifierKindState && rank2 !== 6 && rank2 !== 7 && (slash === -1 || /^[\w-]+$/.test(groupName))) {
|
|
124
|
+
result = [
|
|
125
|
+
`group-${import_runtime.canonicalStateModifierNames[rank2]}${slash === -1 ? "" : authored.slice(slash)}`,
|
|
126
|
+
5,
|
|
127
|
+
rank2,
|
|
128
|
+
import_runtime.stateModifierSelectors[rank2],
|
|
129
|
+
groupName,
|
|
130
|
+
import_runtime.canonicalStateModifierNames[rank2]
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
} else if (authored.charCodeAt(0) === 64) {
|
|
134
|
+
var slash1 = authored.indexOf("/");
|
|
135
|
+
var size = authored.slice(1, slash1 === -1 ? void 0 : slash1);
|
|
136
|
+
var containerName = slash1 === -1 ? "" : authored.slice(slash1 + 1);
|
|
137
|
+
var code1 = modifiers[size] || 0;
|
|
138
|
+
var query = mediaQueries[size];
|
|
139
|
+
if (/^[\w-]+$/.test(size) && (slash1 === -1 || /^[\w-]+$/.test(containerName)) && (code1 & 7) === import_runtime.modifierKindMedia && (0, import_runtime.isContainerSizeQueryText)(query)) {
|
|
140
|
+
result = [
|
|
141
|
+
authored,
|
|
142
|
+
6,
|
|
143
|
+
code1 >> 3,
|
|
144
|
+
query,
|
|
145
|
+
size,
|
|
146
|
+
containerName
|
|
147
|
+
];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return conditionModifiers[authored] = result;
|
|
151
|
+
};
|
|
152
|
+
var propertyKinds = {
|
|
153
|
+
shadowColor: 1,
|
|
154
|
+
shadowOffset: 2,
|
|
155
|
+
shadowOpacity: 3,
|
|
156
|
+
shadowRadius: 4,
|
|
157
|
+
matrix: 5,
|
|
158
|
+
perspective: 5,
|
|
159
|
+
rotateX: 5,
|
|
160
|
+
rotateY: 5,
|
|
161
|
+
rotateZ: 5,
|
|
162
|
+
scaleZ: 5,
|
|
163
|
+
skewX: 5,
|
|
164
|
+
skewY: 5,
|
|
165
|
+
textShadowColor: 6,
|
|
166
|
+
textShadowOffset: 6,
|
|
167
|
+
textShadowRadius: 6,
|
|
168
|
+
border: 7,
|
|
169
|
+
borderTop: 7,
|
|
170
|
+
borderRight: 7,
|
|
171
|
+
borderBottom: 7,
|
|
172
|
+
borderLeft: 7,
|
|
173
|
+
borderBlock: 7,
|
|
174
|
+
borderInline: 7,
|
|
175
|
+
outline: 7,
|
|
176
|
+
padding: 8,
|
|
177
|
+
paddingBlock: 8,
|
|
178
|
+
paddingInline: 8,
|
|
179
|
+
margin: 8,
|
|
180
|
+
marginBlock: 8,
|
|
181
|
+
marginInline: 8,
|
|
182
|
+
inset: 8,
|
|
183
|
+
insetBlock: 8,
|
|
184
|
+
insetInline: 8,
|
|
185
|
+
borderRadius: 8
|
|
186
|
+
};
|
|
187
|
+
var propertyKind = function(property) {
|
|
188
|
+
return propertyKinds[property] || 0;
|
|
189
|
+
};
|
|
190
|
+
var normalizedTransitions = /* @__PURE__ */ new Map();
|
|
78
191
|
var next = {
|
|
79
192
|
revision: captured.revision,
|
|
80
193
|
modifiers,
|
|
81
|
-
mediaQueries
|
|
194
|
+
mediaQueries,
|
|
195
|
+
resolveCondition,
|
|
196
|
+
tokenCategory: import_tokenCategories.getTokenCategoryForProperty,
|
|
197
|
+
expandSafeArea: import_resolveSafeArea.expandSafeAreaValue,
|
|
198
|
+
safeAreaVariable: import_resolveSafeAreaVariable.resolveSafeAreaVariable,
|
|
199
|
+
parseFlatValue: import_runtime.parseFlatValue,
|
|
200
|
+
styleStaticConfig: function(staticConfig, conf) {
|
|
201
|
+
return (0, import_styleStaticConfigCore.resolveStyleStaticConfig)(staticConfig, conf, captured.revision);
|
|
202
|
+
},
|
|
203
|
+
propertyKind,
|
|
204
|
+
compositeValue: function(property, raw, context, resolve) {
|
|
205
|
+
var kind2 = propertyKinds[property];
|
|
206
|
+
if (kind2 < 7) return;
|
|
207
|
+
if (kind2 === 7) {
|
|
208
|
+
var { width, style, color } = (0, import_borderComponents.classifyBorderComponents)(raw, property === "outline");
|
|
209
|
+
if (style === "none" && !color) return "none";
|
|
210
|
+
var prefix = property === "outline" ? "outline" : "border";
|
|
211
|
+
return [
|
|
212
|
+
width && resolve(context, `${prefix}Width`, width),
|
|
213
|
+
style,
|
|
214
|
+
color && resolve(context, `${prefix}Color`, color)
|
|
215
|
+
].filter(Boolean).join(" ");
|
|
216
|
+
}
|
|
217
|
+
if (!/\s/.test(raw)) return;
|
|
218
|
+
var parts = (0, import_borderComponents.splitComponents)(raw);
|
|
219
|
+
if (parts.length > 1) {
|
|
220
|
+
var value = "";
|
|
221
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
222
|
+
try {
|
|
223
|
+
for (var _iterator2 = parts[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
224
|
+
var part = _step2.value;
|
|
225
|
+
value += `${value ? " " : ""}${resolve(context, property, part)}`;
|
|
226
|
+
}
|
|
227
|
+
} catch (err) {
|
|
228
|
+
_didIteratorError2 = true;
|
|
229
|
+
_iteratorError2 = err;
|
|
230
|
+
} finally {
|
|
231
|
+
try {
|
|
232
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
233
|
+
_iterator2.return();
|
|
234
|
+
}
|
|
235
|
+
} finally {
|
|
236
|
+
if (_didIteratorError2) {
|
|
237
|
+
throw _iteratorError2;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return value;
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
normalizeTransition: function(raw) {
|
|
245
|
+
var known = normalizedTransitions.get(raw);
|
|
246
|
+
if (known !== void 0) return known;
|
|
247
|
+
var out = raw.replace(/\/\*[\s\S]*?\*\/|(["'])(?:\\.|(?!\1)[^\\])*\1|[A-Za-z_][\w-]*/g, function(authored, quote, offset) {
|
|
248
|
+
if (quote || raw.charCodeAt(offset + authored.length) === 40 || raw.charCodeAt(offset - 1) === 45 && raw.charCodeAt(offset - 2) === 45) {
|
|
249
|
+
return authored;
|
|
250
|
+
}
|
|
251
|
+
var property = config.shorthands[authored] || authored;
|
|
252
|
+
if (property === "x" || property === "y") property = "translate";
|
|
253
|
+
else if (property === "scaleX" || property === "scaleY") property = "scale";
|
|
254
|
+
else if (propertyKind(property) === 5) property = "transform";
|
|
255
|
+
return property.replace(/[A-Z]/g, "-$&").toLowerCase();
|
|
256
|
+
});
|
|
257
|
+
if (normalizedTransitions.size > 2048) normalizedTransitions.clear();
|
|
258
|
+
normalizedTransitions.set(raw, out);
|
|
259
|
+
return out;
|
|
260
|
+
},
|
|
261
|
+
embeddedTokens: function(raw, resolve) {
|
|
262
|
+
return raw.replace(/\/\*[\s\S]*?\*\/|(["'])(?:\\.|(?!\1)[^\\])*\1|[$A-Za-z_][\w.$-]*(?:\/\d+)?/g, function(word, quote, offset) {
|
|
263
|
+
var before = raw.charCodeAt(offset - 1);
|
|
264
|
+
return quote || word[0] !== "$" && (before >= 48 && before <= 57 || before === 35 || before === 45 && raw.charCodeAt(offset - 2) === 45 || raw.charCodeAt(offset + word.length) === 40) ? word : resolve(word);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
82
267
|
};
|
|
83
268
|
if (target[import_runtime.configRevisionSymbol] === captured) {
|
|
84
269
|
target[import_runtime.configRevisionSymbol] = next;
|