@tamagui/core 1.0.0-beta.8 → 1.0.1-beta.100
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/Pressability.js +28 -0
- package/dist/cjs/Pressability.js.map +7 -0
- package/dist/cjs/Pressability.native.js +28 -0
- package/dist/cjs/Pressability.native.js.map +7 -0
- package/dist/cjs/Tamagui.js +6 -8
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/ThemeManager.js +25 -32
- package/dist/cjs/ThemeManager.js.map +2 -2
- package/dist/cjs/conf.js +20 -15
- package/dist/cjs/conf.js.map +2 -2
- package/dist/cjs/constants/constants.js +1 -1
- package/dist/cjs/constants/constants.js.map +1 -1
- package/dist/cjs/constants/platform.js +8 -8
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/rnw.js +5 -19
- package/dist/cjs/constants/rnw.js.map +2 -2
- package/dist/cjs/constants/rnw.native.js +28 -0
- package/dist/cjs/constants/rnw.native.js.map +7 -0
- package/dist/cjs/createComponent.js +612 -295
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js +2 -3
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createShorthands.js +0 -2
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createTamagui.js +147 -100
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTheme.js +3 -2
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +4 -21
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createVariable.js +39 -14
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariables.js +55 -0
- package/dist/cjs/createVariables.js.map +7 -0
- package/dist/cjs/helpers/areEqualSets.js +2 -3
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +187 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +29 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/cjs/helpers/calc.js +70 -0
- package/dist/cjs/helpers/calc.js.map +7 -0
- package/dist/cjs/helpers/createMediaStyle.js +4 -4
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +133 -113
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +3 -4
- package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
- package/dist/cjs/helpers/createTamaguiProvider.js +16 -18
- package/dist/cjs/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/cjs/helpers/cssHash.js +50 -0
- package/dist/cjs/helpers/cssHash.js.map +7 -0
- package/dist/cjs/helpers/expandStyle.js +111 -0
- package/dist/cjs/helpers/expandStyle.js.map +7 -0
- package/dist/cjs/helpers/expandStyles.js +126 -0
- package/dist/cjs/helpers/expandStyles.js.map +7 -0
- package/dist/cjs/helpers/extendStaticConfig.js +25 -17
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +2 -3
- package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.js +0 -2
- package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/cjs/helpers/getFont.js +61 -0
- package/dist/cjs/helpers/getFont.js.map +7 -0
- package/dist/cjs/helpers/getSize.js +17 -9
- package/dist/cjs/helpers/getSize.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +268 -168
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStackSize.js +45 -0
- package/dist/cjs/helpers/getStackSize.js.map +7 -0
- package/dist/cjs/helpers/getStylesAtomic.js +178 -118
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +0 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getTextSize.js +3 -4
- package/dist/cjs/helpers/getTextSize.js.map +2 -2
- package/dist/cjs/helpers/getVariantExtras.js +46 -0
- package/dist/cjs/helpers/getVariantExtras.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +55 -37
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/isObj.js +1 -2
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +36 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/cjs/helpers/isTamaguiElement.js +4 -5
- package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.js +2 -3
- package/dist/cjs/helpers/matchMedia.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +1 -2
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.js +49 -0
- package/dist/cjs/helpers/mergeProps.js.map +7 -0
- package/dist/cjs/helpers/mergeTransform.js +41 -0
- package/dist/cjs/helpers/mergeTransform.js.map +7 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js +18 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +7 -0
- package/dist/cjs/helpers/normalizeColor.js +76 -0
- package/dist/cjs/helpers/normalizeColor.js.map +7 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js +90 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +1 -3
- package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/cjs/helpers/pseudoDescriptors.js +41 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/cjs/helpers/registerCSSVariable.js +40 -0
- package/dist/cjs/helpers/registerCSSVariable.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +3 -5
- package/dist/cjs/helpers/themeable.js.map +2 -2
- package/dist/cjs/helpers/validate.js +39 -37
- package/dist/cjs/helpers/validate.js.map +2 -2
- package/dist/cjs/helpers/withStaticProperties.js +2 -3
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/helpers/wrapThemeManagerContext.js +0 -2
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +2 -2
- package/dist/cjs/hooks/useConstant.js +0 -2
- package/dist/cjs/hooks/useConstant.js.map +1 -1
- package/dist/cjs/hooks/useFeatures.js +22 -20
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/hooks/useId.js +5 -6
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +2 -4
- package/dist/cjs/hooks/useIsMounted.js.map +2 -2
- package/dist/cjs/hooks/useIsTouchDevice.js +3 -4
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +11 -15
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/usePressable.js +2 -3
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/usePrevious.js +1 -0
- package/dist/cjs/hooks/usePrevious.js.map +7 -0
- package/dist/cjs/hooks/useTheme.js +21 -33
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/hooks/useUnmountEffect.js +0 -2
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +21 -12
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/insertFont.js +89 -0
- package/dist/cjs/insertFont.js.map +7 -0
- package/dist/cjs/static.js +3 -1
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +0 -3
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types-rnw.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Slot.js +40 -26
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Text.js +11 -15
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/TextAncestorContext.js +4 -6
- package/dist/cjs/views/TextAncestorContext.js.map +2 -2
- package/dist/cjs/views/Theme.js +6 -9
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/ThemeInverse.js +7 -5
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +6 -6
- package/dist/cjs/views/ThemeProvider.js.map +2 -2
- package/dist/cjs/views/ThemeReset.js +3 -3
- package/dist/cjs/views/ThemeReset.js.map +2 -2
- package/dist/esm/Pressability.js +5 -0
- package/dist/esm/Pressability.js.map +7 -0
- package/dist/esm/Pressability.native.js +5 -0
- package/dist/esm/Pressability.native.js.map +7 -0
- package/dist/esm/Tamagui.js +5 -8
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/ThemeManager.js +25 -33
- package/dist/esm/ThemeManager.js.map +2 -2
- package/dist/esm/conf.js +18 -15
- package/dist/esm/conf.js.map +2 -2
- package/dist/esm/constants/constants.js +24 -9
- package/dist/esm/constants/constants.js.map +2 -2
- package/dist/esm/constants/platform.js +6 -6
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/constants/rnw.js +2 -20
- package/dist/esm/constants/rnw.js.map +2 -2
- package/dist/esm/constants/rnw.native.js +5 -0
- package/dist/esm/constants/rnw.native.js.map +7 -0
- package/dist/esm/createComponent.js +705 -331
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createFont.js +2 -4
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createShorthands.js +0 -3
- package/dist/esm/createShorthands.js.map +1 -1
- package/dist/esm/createTamagui.js +172 -105
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTheme.js +3 -3
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/createTokens.js +3 -20
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createVariable.js +38 -14
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariables.js +32 -0
- package/dist/esm/createVariables.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +2 -4
- package/dist/esm/helpers/areEqualSets.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.js +164 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +6 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/esm/helpers/calc.js +47 -0
- package/dist/esm/helpers/calc.js.map +7 -0
- package/dist/esm/helpers/createMediaStyle.js +4 -5
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +131 -114
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +19 -5
- package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
- package/dist/esm/helpers/createTamaguiProvider.js +46 -19
- package/dist/esm/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/esm/helpers/cssHash.js +27 -0
- package/dist/esm/helpers/cssHash.js.map +7 -0
- package/dist/esm/helpers/expandStyle.js +90 -0
- package/dist/esm/helpers/expandStyle.js.map +7 -0
- package/dist/esm/helpers/expandStyles.js +103 -0
- package/dist/esm/helpers/expandStyles.js.map +7 -0
- package/dist/esm/helpers/extendStaticConfig.js +46 -40
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.js +2 -4
- package/dist/esm/helpers/fixNativeShadow.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.js +0 -3
- package/dist/esm/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/{jsx/helpers/getTextSize.js → esm/helpers/getFont.js} +12 -7
- package/dist/esm/helpers/getFont.js.map +7 -0
- package/dist/esm/helpers/getSize.js +15 -9
- package/dist/esm/helpers/getSize.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +282 -176
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStackSize.js +22 -0
- package/dist/esm/helpers/getStackSize.js.map +7 -0
- package/dist/esm/helpers/getStylesAtomic.js +188 -110
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -3
- package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getTextSize.js +3 -5
- package/dist/esm/helpers/getTextSize.js.map +2 -2
- package/dist/esm/helpers/getVariantExtras.js +23 -0
- package/dist/esm/helpers/getVariantExtras.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +55 -38
- package/dist/esm/helpers/insertStyleRule.js.map +2 -2
- package/dist/esm/helpers/isObj.js +1 -3
- package/dist/esm/helpers/isObj.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.js +13 -0
- package/dist/esm/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/esm/helpers/isTamaguiElement.js +4 -6
- package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
- package/dist/esm/helpers/matchMedia.js +2 -4
- package/dist/esm/helpers/matchMedia.js.map +1 -1
- package/dist/esm/helpers/matchMedia.native.js +1 -3
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +26 -0
- package/dist/esm/helpers/mergeProps.js.map +7 -0
- package/dist/esm/helpers/mergeTransform.js +17 -0
- package/dist/esm/helpers/mergeTransform.js.map +7 -0
- package/dist/esm/helpers/nativeGestureHandler.native.js +2 -0
- package/dist/esm/helpers/nativeGestureHandler.native.js.map +7 -0
- package/dist/esm/helpers/normalizeColor.js +49 -0
- package/dist/esm/helpers/normalizeColor.js.map +7 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js +67 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/esm/helpers/proxyThemeVariables.js +1 -4
- package/dist/esm/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.js +18 -0
- package/dist/esm/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/esm/helpers/registerCSSVariable.js +15 -0
- package/dist/esm/helpers/registerCSSVariable.js.map +7 -0
- package/dist/esm/helpers/themeable.js +34 -5
- package/dist/esm/helpers/themeable.js.map +2 -2
- package/dist/esm/helpers/validate.js +42 -19
- package/dist/esm/helpers/validate.js.map +2 -2
- package/dist/esm/helpers/withStaticProperties.js +2 -4
- package/dist/esm/helpers/withStaticProperties.js.map +1 -1
- package/dist/esm/helpers/wrapThemeManagerContext.js +0 -3
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +2 -2
- package/dist/esm/hooks/useConstant.js +0 -3
- package/dist/esm/hooks/useConstant.js.map +1 -1
- package/dist/esm/hooks/useFeatures.js +59 -26
- package/dist/esm/hooks/useFeatures.js.map +2 -2
- package/dist/esm/hooks/useId.js +8 -11
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/hooks/useIsMounted.js +1 -4
- package/dist/esm/hooks/useIsMounted.js.map +2 -2
- package/dist/esm/hooks/useIsTouchDevice.js +4 -6
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +28 -21
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/usePressable.js +18 -5
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/usePrevious.js +1 -0
- package/dist/esm/hooks/usePrevious.js.map +7 -0
- package/dist/esm/hooks/useTheme.js +45 -41
- package/dist/esm/hooks/useTheme.js.map +2 -2
- package/dist/esm/hooks/useUnmountEffect.js +0 -3
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/index.js +18 -9
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/insertFont.js +64 -0
- package/dist/esm/insertFont.js.map +7 -0
- package/dist/esm/static.js +3 -1
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +37 -12
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/views/Slot.js +74 -34
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +21 -3
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/Text.js +27 -19
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/TextAncestorContext.js +4 -7
- package/dist/esm/views/TextAncestorContext.js.map +2 -2
- package/dist/esm/views/Theme.js +6 -10
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeInverse.js +8 -7
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +6 -7
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +3 -4
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +18 -11
- package/reset.css +41 -0
- package/types/Pressability.d.ts +2 -0
- package/types/Pressability.native.d.ts +2 -0
- package/types/Tamagui.d.ts +4 -6
- package/types/Tamagui.d.ts.map +1 -1
- package/types/ThemeContext.d.ts +0 -0
- package/types/ThemeContext.d.ts.map +0 -0
- package/types/ThemeManager.d.ts +10 -7
- package/types/ThemeManager.d.ts.map +1 -1
- package/types/conf.d.ts +3 -4
- package/types/conf.d.ts.map +1 -1
- package/types/constants/constants.d.ts +1 -1
- package/types/constants/platform.d.ts +2 -2
- package/types/constants/rnw.d.ts +1 -1
- package/types/constants/rnw.d.ts.map +1 -1
- package/types/constants/rnw.native.d.ts +2 -0
- package/types/contexts/ButtonInsideButtonContext.d.ts +0 -0
- package/types/createComponent.d.ts +40 -15
- package/types/createComponent.d.ts.map +1 -1
- package/types/createFont.d.ts +0 -0
- package/types/createFont.d.ts.map +0 -0
- package/types/createShorthands.d.ts +0 -0
- package/types/createTamagui.d.ts +10 -2
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTheme.d.ts +1 -1
- package/types/createTokens.d.ts +0 -1
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariable.d.ts +16 -11
- package/types/createVariables.d.ts +10 -0
- package/types/defaultComponentState.d.ts +0 -0
- package/types/helpers/RNComponents.d.ts +0 -0
- package/types/helpers/areEqualSets.d.ts +0 -0
- package/types/helpers/assignNativePropsToWeb.d.ts +2 -0
- package/types/helpers/assignNativePropsToWeb.d.ts.map +1 -0
- package/types/helpers/assignNativePropsToWeb.native.d.ts +2 -0
- package/types/helpers/calc.d.ts +12 -0
- package/types/helpers/calc.d.ts.map +1 -0
- package/types/helpers/createMediaStyle.d.ts +1 -1
- package/types/helpers/createMediaStyle.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts +4 -3
- package/types/helpers/createPropMapper.d.ts.map +1 -1
- package/types/helpers/createShallowUpdate.d.ts +1 -2
- package/types/helpers/createTamaguiProvider.d.ts +2 -6
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
- package/types/helpers/cssHash.d.ts +2 -0
- package/types/helpers/cssHash.d.ts.map +1 -0
- package/types/helpers/expandStyle.d.ts +2 -0
- package/types/helpers/expandStyle.d.ts.map +1 -0
- package/types/helpers/expandStyles.d.ts +7 -0
- package/types/helpers/expandStyles.d.ts.map +1 -0
- package/types/helpers/extendStaticConfig.d.ts +0 -0
- package/types/helpers/extendStaticConfig.d.ts.map +1 -1
- package/types/helpers/fixNativeShadow.d.ts +0 -0
- package/types/helpers/getExpandedShorthands.d.ts +0 -0
- package/types/helpers/getExpandedShorthands.d.ts.map +0 -0
- package/types/helpers/getFont.d.ts +3 -0
- package/types/helpers/getFont.d.ts.map +1 -0
- package/types/helpers/getSize.d.ts +3 -2
- package/types/helpers/getSize.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +10 -7
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStackSize.d.ts +8 -0
- package/types/helpers/getStackSize.d.ts.map +1 -0
- package/types/helpers/getStylesAtomic.d.ts +7 -17
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.native.d.ts +0 -0
- package/types/helpers/getVariantExtras.d.ts +7 -0
- package/types/helpers/getVariantExtras.d.ts.map +1 -0
- package/types/helpers/insertStyleRule.d.ts +1 -1
- package/types/helpers/isObj.d.ts +0 -0
- package/types/helpers/isTamaguiComponent.d.ts +5 -0
- package/types/helpers/isTamaguiComponent.d.ts.map +1 -0
- package/types/helpers/isTamaguiElement.d.ts +1 -1
- package/types/helpers/isTamaguiElement.d.ts.map +1 -1
- package/types/helpers/matchMedia.d.ts +0 -0
- package/types/helpers/matchMedia.native.d.ts +0 -0
- package/types/helpers/mergeProps.d.ts +2 -0
- package/types/helpers/mergeTransform.d.ts +7 -0
- package/types/helpers/nativeGestureHandler.native.d.ts +2 -0
- package/types/helpers/normalizeColor.d.ts +3 -0
- package/types/helpers/normalizeColor.d.ts.map +1 -0
- package/types/helpers/normalizeValueWithProperty.d.ts +2 -0
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -0
- package/types/helpers/proxyThemeVariables.d.ts +0 -0
- package/types/helpers/pseudoDescriptors.d.ts +16 -0
- package/types/helpers/registerCSSVariable.d.ts +5 -0
- package/types/helpers/themeable.d.ts +0 -0
- package/types/helpers/themeable.d.ts.map +1 -1
- package/types/helpers/validate.d.ts +0 -0
- package/types/helpers/withStaticProperties.d.ts +0 -0
- package/types/helpers/wrapThemeManagerContext.d.ts +0 -0
- package/types/helpers/wrapThemeManagerContext.d.ts.map +0 -0
- package/types/hooks/useConstant.d.ts +0 -0
- package/types/hooks/useFeatures.d.ts +11 -5
- package/types/hooks/useFeatures.d.ts.map +1 -1
- package/types/hooks/useId.d.ts +0 -0
- package/types/hooks/useIsMounted.d.ts +0 -0
- package/types/hooks/useIsTouchDevice.d.ts +0 -0
- package/types/hooks/useMedia.d.ts +0 -0
- package/types/hooks/useMedia.d.ts.map +0 -0
- package/types/hooks/usePressable.d.ts +0 -0
- package/types/hooks/usePrevious.d.ts +1 -0
- package/types/hooks/useTheme.d.ts +15 -6
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useUnmountEffect.d.ts +0 -0
- package/types/index.d.ts +16 -6
- package/types/index.d.ts.map +1 -1
- package/types/insertFont.d.ts +6 -0
- package/types/insertFont.d.ts.map +1 -0
- package/types/static.d.ts +3 -1
- package/types/static.d.ts.map +1 -1
- package/types/styled.d.ts +2 -2
- package/types/styled.d.ts.map +1 -1
- package/types/types-rnw.d.ts +0 -0
- package/types/types.d.ts +71 -51
- package/types/types.d.ts.map +1 -1
- package/types/views/Slot.d.ts +1 -0
- package/types/views/Stack.d.ts +0 -0
- package/types/views/Stack.d.ts.map +0 -0
- package/types/views/Text.d.ts +0 -0
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/TextAncestorContext.d.ts +0 -0
- package/types/views/TextAncestorContext.d.ts.map +1 -1
- package/types/views/Theme.d.ts +1 -9
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeInverse.d.ts +0 -0
- package/types/views/ThemeInverse.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +2 -0
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/types/views/ThemeReset.d.ts +0 -0
- package/types/views/ThemeReset.d.ts.map +0 -0
- package/dist/cjs/helpers/addStylesUsingClassname.js +0 -87
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/cjs/helpers/fixNativeShadow.native.js +0 -63
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/cjs/helpers/getButtonSize.js +0 -45
- package/dist/cjs/helpers/getButtonSize.js.map +0 -7
- package/dist/esm/helpers/addStylesUsingClassname.js +0 -64
- package/dist/esm/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/esm/helpers/fixNativeShadow.native.js +0 -41
- package/dist/esm/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/esm/helpers/getButtonSize.js +0 -24
- package/dist/esm/helpers/getButtonSize.js.map +0 -7
- package/dist/jsx/Tamagui.js +0 -41
- package/dist/jsx/ThemeContext.js +0 -5
- package/dist/jsx/ThemeManager.js +0 -186
- package/dist/jsx/conf.js +0 -35
- package/dist/jsx/constants/constants.js +0 -17
- package/dist/jsx/constants/platform.js +0 -25
- package/dist/jsx/constants/rnw.js +0 -23
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +0 -5
- package/dist/jsx/createComponent.js +0 -617
- package/dist/jsx/createFont.js +0 -27
- package/dist/jsx/createShorthands.js +0 -9
- package/dist/jsx/createTamagui.js +0 -201
- package/dist/jsx/createTheme.js +0 -6
- package/dist/jsx/createTokens.js +0 -28
- package/dist/jsx/createVariable.js +0 -48
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +0 -11
- package/dist/jsx/helpers/addStylesUsingClassname.js +0 -63
- package/dist/jsx/helpers/areEqualSets.js +0 -15
- package/dist/jsx/helpers/createMediaStyle.js +0 -30
- package/dist/jsx/helpers/createPropMapper.js +0 -237
- package/dist/jsx/helpers/createShallowUpdate.js +0 -18
- package/dist/jsx/helpers/createTamaguiProvider.js +0 -34
- package/dist/jsx/helpers/extendStaticConfig.js +0 -61
- package/dist/jsx/helpers/fixNativeShadow.js +0 -7
- package/dist/jsx/helpers/fixNativeShadow.native.js +0 -40
- package/dist/jsx/helpers/getButtonSize.js +0 -23
- package/dist/jsx/helpers/getExpandedShorthands.js +0 -18
- package/dist/jsx/helpers/getSize.js +0 -12
- package/dist/jsx/helpers/getSplitStyles.js +0 -302
- package/dist/jsx/helpers/getStylesAtomic.js +0 -130
- package/dist/jsx/helpers/getStylesAtomic.native.js +0 -9
- package/dist/jsx/helpers/insertStyleRule.js +0 -94
- package/dist/jsx/helpers/isObj.js +0 -6
- package/dist/jsx/helpers/isTamaguiElement.js +0 -10
- package/dist/jsx/helpers/matchMedia.js +0 -17
- package/dist/jsx/helpers/matchMedia.native.js +0 -8
- package/dist/jsx/helpers/proxyThemeVariables.js +0 -17
- package/dist/jsx/helpers/themeable.js +0 -24
- package/dist/jsx/helpers/validate.js +0 -75
- package/dist/jsx/helpers/withStaticProperties.js +0 -9
- package/dist/jsx/helpers/wrapThemeManagerContext.js +0 -10
- package/dist/jsx/hooks/useConstant.js +0 -14
- package/dist/jsx/hooks/useFeatures.js +0 -167
- package/dist/jsx/hooks/useId.js +0 -34
- package/dist/jsx/hooks/useIsMounted.js +0 -18
- package/dist/jsx/hooks/useIsTouchDevice.js +0 -16
- package/dist/jsx/hooks/useMedia.js +0 -158
- package/dist/jsx/hooks/usePressable.js +0 -13
- package/dist/jsx/hooks/useTheme.js +0 -177
- package/dist/jsx/hooks/useUnmountEffect.js +0 -10
- package/dist/jsx/index.js +0 -54
- package/dist/jsx/static.js +0 -16
- package/dist/jsx/styled.js +0 -48
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Slot.js +0 -56
- package/dist/jsx/views/Stack.js +0 -12
- package/dist/jsx/views/Text.js +0 -61
- package/dist/jsx/views/TextAncestorContext.js +0 -15
- package/dist/jsx/views/Theme.js +0 -31
- package/dist/jsx/views/ThemeInverse.js +0 -22
- package/dist/jsx/views/ThemeProvider.js +0 -35
- package/dist/jsx/views/ThemeReset.js +0 -34
- package/types/constants/constants.d.ts.map +0 -1
- package/types/constants/platform.d.ts.map +0 -1
- package/types/contexts/ButtonInsideButtonContext.d.ts.map +0 -1
- package/types/createShorthands.d.ts.map +0 -1
- package/types/createTheme.d.ts.map +0 -1
- package/types/createVariable.d.ts.map +0 -1
- package/types/defaultComponentState.d.ts.map +0 -1
- package/types/helpers/RNComponents.d.ts.map +0 -1
- package/types/helpers/addStylesUsingClassname.d.ts +0 -3
- package/types/helpers/addStylesUsingClassname.d.ts.map +0 -1
- package/types/helpers/areEqualSets.d.ts.map +0 -1
- package/types/helpers/createShallowUpdate.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.native.d.ts +0 -2
- package/types/helpers/fixNativeShadow.native.d.ts.map +0 -1
- package/types/helpers/getButtonSize.d.ts +0 -8
- package/types/helpers/getButtonSize.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.native.d.ts.map +0 -1
- package/types/helpers/getTextSize.d.ts +0 -3
- package/types/helpers/getTextSize.d.ts.map +0 -1
- package/types/helpers/insertStyleRule.d.ts.map +0 -1
- package/types/helpers/isObj.d.ts.map +0 -1
- package/types/helpers/matchMedia.d.ts.map +0 -1
- package/types/helpers/matchMedia.native.d.ts.map +0 -1
- package/types/helpers/proxyThemeVariables.d.ts.map +0 -1
- package/types/helpers/validate.d.ts.map +0 -1
- package/types/helpers/withStaticProperties.d.ts.map +0 -1
- package/types/hooks/useConstant.d.ts.map +0 -1
- package/types/hooks/useId.d.ts.map +0 -1
- package/types/hooks/useIsMounted.d.ts.map +0 -1
- package/types/hooks/useIsTouchDevice.d.ts.map +0 -1
- package/types/hooks/usePressable.d.ts.map +0 -1
- package/types/hooks/useUnmountEffect.d.ts.map +0 -1
- package/types/types-rnw.d.ts.map +0 -1
- package/types/views/Slot.d.ts.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __export = (target, all) => {
|
|
20
|
+
for (var name in all)
|
|
21
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
22
|
+
};
|
|
23
|
+
var __copyProps = (to, from, except, desc) => {
|
|
24
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
25
|
+
for (let key of __getOwnPropNames(from))
|
|
26
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
27
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
28
|
+
}
|
|
29
|
+
return to;
|
|
30
|
+
};
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
var expandStyle_exports = {};
|
|
33
|
+
__export(expandStyle_exports, {
|
|
34
|
+
expandStyle: () => expandStyle
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(expandStyle_exports);
|
|
37
|
+
var import_platform = require("../constants/platform");
|
|
38
|
+
function expandStyle(key, value) {
|
|
39
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
40
|
+
if (key === "flex") {
|
|
41
|
+
if (value <= -1) {
|
|
42
|
+
return [
|
|
43
|
+
["flexGrow", 0],
|
|
44
|
+
["flexShrink", 1],
|
|
45
|
+
["flexBasis", "auto"]
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
if (value >= 0) {
|
|
49
|
+
return [
|
|
50
|
+
["flexGrow", value],
|
|
51
|
+
["flexShrink", 1]
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
switch (key) {
|
|
57
|
+
case "aspectRatio": {
|
|
58
|
+
return [[key, value.toString()]];
|
|
59
|
+
}
|
|
60
|
+
case "backgroundClip": {
|
|
61
|
+
if (value === "text") {
|
|
62
|
+
return [
|
|
63
|
+
["backgroundClip", value],
|
|
64
|
+
["WebkitBackgroundClip", value]
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
case "textAlignVertical": {
|
|
70
|
+
return [["verticalAlign", value === "center" ? "middle" : value]];
|
|
71
|
+
}
|
|
72
|
+
case "textDecorationLine": {
|
|
73
|
+
return [["textDecorationLine", value]];
|
|
74
|
+
}
|
|
75
|
+
case "writingDirection": {
|
|
76
|
+
return [["direction", value]];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const longKey = STYLE_SHORT_FORM_EXPANSIONS[key];
|
|
81
|
+
if (longKey) {
|
|
82
|
+
return longKey.map((key2) => {
|
|
83
|
+
return [key2, value];
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const STYLE_SHORT_FORM_EXPANSIONS = __spreadValues({
|
|
88
|
+
borderColor: ["borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor"],
|
|
89
|
+
borderRadius: [
|
|
90
|
+
"borderTopLeftRadius",
|
|
91
|
+
"borderTopRightRadius",
|
|
92
|
+
"borderBottomRightRadius",
|
|
93
|
+
"borderBottomLeftRadius"
|
|
94
|
+
],
|
|
95
|
+
borderStyle: ["borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle"],
|
|
96
|
+
borderWidth: ["borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"],
|
|
97
|
+
margin: ["marginTop", "marginRight", "marginBottom", "marginLeft"],
|
|
98
|
+
marginHorizontal: ["marginRight", "marginLeft"],
|
|
99
|
+
marginVertical: ["marginTop", "marginBottom"],
|
|
100
|
+
overscrollBehavior: ["overscrollBehaviorX", "overscrollBehaviorY"],
|
|
101
|
+
padding: ["paddingTop", "paddingRight", "paddingBottom", "paddingLeft"],
|
|
102
|
+
paddingHorizontal: ["paddingRight", "paddingLeft"],
|
|
103
|
+
paddingVertical: ["paddingTop", "paddingBottom"]
|
|
104
|
+
}, import_platform.isWeb && {
|
|
105
|
+
overflow: ["overflowX", "overflowY"]
|
|
106
|
+
});
|
|
107
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
108
|
+
0 && (module.exports = {
|
|
109
|
+
expandStyle
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=expandStyle.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/expandStyle.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Some parts adapted from react-native-web\n * Copyright (c) Nicolas Gallagher licensed under the MIT license.\n */\n\nimport { isWeb } from '../constants/platform'\n\nexport function expandStyle(key: string, value: any) {\n if (process.env.TAMAGUI_TARGET === 'web') {\n if (key === 'flex') {\n // The 'flex' property value in React Native must be a positive integer,\n // 0, or -1.\n if (value <= -1) {\n return [\n ['flexGrow', 0],\n ['flexShrink', 1],\n ['flexBasis', 'auto'],\n ]\n }\n // normalizing to better align with native\n // see spec for flex shorthand https://developer.mozilla.org/en-US/docs/Web/CSS/flex\n if (value >= 0) {\n return [\n ['flexGrow', value],\n ['flexShrink', 1],\n ]\n }\n return\n }\n\n // web only\n switch (key) {\n case 'aspectRatio': {\n return [[key, value.toString()]]\n }\n\n // TODO: remove once this issue is fixed\n // https://github.com/rofrischmann/inline-style-prefixer/issues/159\n case 'backgroundClip': {\n if (value === 'text') {\n return [\n ['backgroundClip', value],\n ['WebkitBackgroundClip', value],\n ]\n }\n break\n }\n\n case 'textAlignVertical': {\n return [['verticalAlign', value === 'center' ? 'middle' : value]]\n }\n\n case 'textDecorationLine': {\n return [['textDecorationLine', value]]\n }\n\n case 'writingDirection': {\n return [['direction', value]]\n }\n }\n }\n\n const longKey = STYLE_SHORT_FORM_EXPANSIONS[key]\n if (longKey) {\n return longKey.map((key) => {\n return [key, value]\n })\n }\n}\n\nconst STYLE_SHORT_FORM_EXPANSIONS: Record<string, string[]> = {\n borderColor: ['borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor'],\n borderRadius: [\n 'borderTopLeftRadius',\n 'borderTopRightRadius',\n 'borderBottomRightRadius',\n 'borderBottomLeftRadius',\n ],\n borderStyle: ['borderTopStyle', 'borderRightStyle', 'borderBottomStyle', 'borderLeftStyle'],\n borderWidth: ['borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth'],\n margin: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n marginHorizontal: ['marginRight', 'marginLeft'],\n marginVertical: ['marginTop', 'marginBottom'],\n overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'],\n padding: ['paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n paddingHorizontal: ['paddingRight', 'paddingLeft'],\n paddingVertical: ['paddingTop', 'paddingBottom'],\n ...(isWeb && {\n // react-native doesn't support X / Y\n overflow: ['overflowX', 'overflowY'],\n }),\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,sBAAsB;AAEf,qBAAqB,KAAa,OAAY;AACnD,MAAI,QAAQ,IAAI,mBAAmB,OAAO;AACxC,QAAI,QAAQ,QAAQ;AAGlB,UAAI,SAAS,IAAI;AACf,eAAO;AAAA,UACL,CAAC,YAAY,CAAC;AAAA,UACd,CAAC,cAAc,CAAC;AAAA,UAChB,CAAC,aAAa,MAAM;AAAA,QACtB;AAAA,MACF;AAGA,UAAI,SAAS,GAAG;AACd,eAAO;AAAA,UACL,CAAC,YAAY,KAAK;AAAA,UAClB,CAAC,cAAc,CAAC;AAAA,QAClB;AAAA,MACF;AACA;AAAA,IACF;AAGA,YAAQ;AAAA,WACD,eAAe;AAClB,eAAO,CAAC,CAAC,KAAK,MAAM,SAAS,CAAC,CAAC;AAAA,MACjC;AAAA,WAIK,kBAAkB;AACrB,YAAI,UAAU,QAAQ;AACpB,iBAAO;AAAA,YACL,CAAC,kBAAkB,KAAK;AAAA,YACxB,CAAC,wBAAwB,KAAK;AAAA,UAChC;AAAA,QACF;AACA;AAAA,MACF;AAAA,WAEK,qBAAqB;AACxB,eAAO,CAAC,CAAC,iBAAiB,UAAU,WAAW,WAAW,KAAK,CAAC;AAAA,MAClE;AAAA,WAEK,sBAAsB;AACzB,eAAO,CAAC,CAAC,sBAAsB,KAAK,CAAC;AAAA,MACvC;AAAA,WAEK,oBAAoB;AACvB,eAAO,CAAC,CAAC,aAAa,KAAK,CAAC;AAAA,MAC9B;AAAA;AAAA,EAEJ;AAEA,QAAM,UAAU,4BAA4B;AAC5C,MAAI,SAAS;AACX,WAAO,QAAQ,IAAI,CAAC,SAAQ;AAC1B,aAAO,CAAC,MAAK,KAAK;AAAA,IACpB,CAAC;AAAA,EACH;AACF;AAEA,MAAM,8BAAwD;AAAA,EAC5D,aAAa,CAAC,kBAAkB,oBAAoB,qBAAqB,iBAAiB;AAAA,EAC1F,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,aAAa,CAAC,kBAAkB,oBAAoB,qBAAqB,iBAAiB;AAAA,EAC1F,aAAa,CAAC,kBAAkB,oBAAoB,qBAAqB,iBAAiB;AAAA,EAC1F,QAAQ,CAAC,aAAa,eAAe,gBAAgB,YAAY;AAAA,EACjE,kBAAkB,CAAC,eAAe,YAAY;AAAA,EAC9C,gBAAgB,CAAC,aAAa,cAAc;AAAA,EAC5C,oBAAoB,CAAC,uBAAuB,qBAAqB;AAAA,EACjE,SAAS,CAAC,cAAc,gBAAgB,iBAAiB,aAAa;AAAA,EACtE,mBAAmB,CAAC,gBAAgB,aAAa;AAAA,EACjD,iBAAiB,CAAC,cAAc,eAAe;AAAA,GAC3C,yBAAS;AAAA,EAEX,UAAU,CAAC,aAAa,WAAW;AACrC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __export = (target, all) => {
|
|
20
|
+
for (var name in all)
|
|
21
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
22
|
+
};
|
|
23
|
+
var __copyProps = (to, from, except, desc) => {
|
|
24
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
25
|
+
for (let key of __getOwnPropNames(from))
|
|
26
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
27
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
28
|
+
}
|
|
29
|
+
return to;
|
|
30
|
+
};
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
var expandStyles_exports = {};
|
|
33
|
+
__export(expandStyles_exports, {
|
|
34
|
+
defaultOffset: () => defaultOffset,
|
|
35
|
+
expandStyles: () => expandStyles,
|
|
36
|
+
fixStyles: () => fixStyles
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(expandStyles_exports);
|
|
39
|
+
var import_conf = require("../conf");
|
|
40
|
+
var import_platform = require("../constants/platform");
|
|
41
|
+
var import_expandStyle = require("./expandStyle");
|
|
42
|
+
var import_normalizeColor = require("./normalizeColor");
|
|
43
|
+
var import_normalizeValueWithProperty = require("./normalizeValueWithProperty");
|
|
44
|
+
var import_pseudoDescriptors = require("./pseudoDescriptors");
|
|
45
|
+
let shorthands = null;
|
|
46
|
+
const defaultOffset = { height: 0, width: 0 };
|
|
47
|
+
function expandStyles(style) {
|
|
48
|
+
const res = {};
|
|
49
|
+
for (let key in style) {
|
|
50
|
+
shorthands = shorthands || (0, import_conf.getConfig)().shorthands;
|
|
51
|
+
if (shorthands) {
|
|
52
|
+
key = shorthands[key] || key;
|
|
53
|
+
}
|
|
54
|
+
if (key in import_pseudoDescriptors.pseudoDescriptors) {
|
|
55
|
+
res[key] = expandStyles(style[key]);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const val = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(style[key], key);
|
|
59
|
+
const out = (0, import_expandStyle.expandStyle)(key, val);
|
|
60
|
+
if (out) {
|
|
61
|
+
Object.assign(res, Object.fromEntries(out));
|
|
62
|
+
} else {
|
|
63
|
+
res[key] = val;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
fixStyles(res);
|
|
67
|
+
return res;
|
|
68
|
+
}
|
|
69
|
+
function fixStyles(style) {
|
|
70
|
+
if (style.shadowRadius) {
|
|
71
|
+
Object.assign(style, normalizeShadow(style));
|
|
72
|
+
}
|
|
73
|
+
for (const key in borderDefaults) {
|
|
74
|
+
if (style[key] && !style[borderDefaults[key]]) {
|
|
75
|
+
style[borderDefaults[key]] = "solid";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const borderDefaults = {
|
|
80
|
+
borderWidth: "borderStyle",
|
|
81
|
+
borderBottomWidth: "borderBottomStyle",
|
|
82
|
+
borderTopWidth: "borderTopStyle",
|
|
83
|
+
borderLeftWidth: "borderLeftStyle",
|
|
84
|
+
borderRightWidth: "borderRightStyle"
|
|
85
|
+
};
|
|
86
|
+
function normalizeShadow({
|
|
87
|
+
shadowColor,
|
|
88
|
+
shadowOffset,
|
|
89
|
+
shadowOpacity,
|
|
90
|
+
shadowRadius
|
|
91
|
+
}) {
|
|
92
|
+
const { height, width } = shadowOffset || defaultOffset;
|
|
93
|
+
const colorStr = String(shadowColor || "black");
|
|
94
|
+
return __spreadValues(__spreadValues({
|
|
95
|
+
shadowOffset: {
|
|
96
|
+
width: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width || 0),
|
|
97
|
+
height: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height || 0)
|
|
98
|
+
},
|
|
99
|
+
shadowRadius: (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius || 0)
|
|
100
|
+
}, import_platform.isWeb && {
|
|
101
|
+
shadowColor: (0, import_normalizeColor.normalizeColor)(colorStr, shadowOpacity)
|
|
102
|
+
}), !import_platform.isWeb && (() => {
|
|
103
|
+
const rgba = (0, import_normalizeColor.colorToRGBA)(colorStr);
|
|
104
|
+
if (!rgba) {
|
|
105
|
+
if (process.env.NODE_ENV === "development") {
|
|
106
|
+
console.warn("No rgba form", colorStr);
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
shadowColor,
|
|
110
|
+
shadowOpacity
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const [r, g, b, a] = rgba;
|
|
114
|
+
return {
|
|
115
|
+
shadowColor: `rgb(${r},${g},${b})`,
|
|
116
|
+
shadowOpacity: shadowOpacity ?? a
|
|
117
|
+
};
|
|
118
|
+
})());
|
|
119
|
+
}
|
|
120
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
121
|
+
0 && (module.exports = {
|
|
122
|
+
defaultOffset,
|
|
123
|
+
expandStyles,
|
|
124
|
+
fixStyles
|
|
125
|
+
});
|
|
126
|
+
//# sourceMappingURL=expandStyles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/expandStyles.ts"],
|
|
4
|
+
"sourcesContent": ["import { getConfig } from '../conf'\nimport { isWeb } from '../constants/platform'\nimport { expandStyle } from './expandStyle'\nimport { colorToRGBA, normalizeColor } from './normalizeColor'\nimport { normalizeValueWithProperty } from './normalizeValueWithProperty'\nimport { pseudoDescriptors } from './pseudoDescriptors'\n\nlet shorthands: Record<string, string> | null = null\nexport const defaultOffset = { height: 0, width: 0 }\n\n/**\n * This is what you want to run before Object.assign() a style onto another.\n * It does the following:\n * 1. Turns user shorthands into longhands, ie px = paddingHorizontal\n * 2. Normalizes various inconsistent styles to be more consistent\n * 3. Expands react-native shorthands, ie paddingHorizontal => paddingLeft, paddingRight\n */\n\nexport function expandStyles(style: Record<string, any>) {\n const res: Record<string, any> = {}\n\n for (let key in style) {\n shorthands = shorthands || getConfig().shorthands\n if (shorthands) {\n key = shorthands[key] || key\n }\n if (key in pseudoDescriptors) {\n res[key] = expandStyles(style[key])\n continue\n }\n const val = normalizeValueWithProperty(style[key], key)\n // expand react-native shorthands\n const out = expandStyle(key, val)\n if (out) {\n Object.assign(res, Object.fromEntries(out))\n } else {\n res[key] = val\n }\n }\n\n fixStyles(res)\n\n return res\n}\n\nexport function fixStyles(style: Record<string, any>) {\n if (style.shadowRadius) {\n Object.assign(style, normalizeShadow(style))\n }\n\n // ensure border style set by default to solid\n for (const key in borderDefaults) {\n if (style[key] && !style[borderDefaults[key]]) {\n style[borderDefaults[key]] = 'solid'\n }\n }\n}\n\nconst borderDefaults = {\n borderWidth: 'borderStyle',\n borderBottomWidth: 'borderBottomStyle',\n borderTopWidth: 'borderTopStyle',\n borderLeftWidth: 'borderLeftStyle',\n borderRightWidth: 'borderRightStyle',\n}\n\nfunction normalizeShadow({\n shadowColor,\n shadowOffset,\n shadowOpacity,\n shadowRadius,\n}: Record<string, any>) {\n const { height, width } = shadowOffset || defaultOffset\n const colorStr = String(shadowColor || 'black')\n return {\n shadowOffset: {\n width: normalizeValueWithProperty(width || 0),\n height: normalizeValueWithProperty(height || 0),\n },\n shadowRadius: normalizeValueWithProperty(shadowRadius || 0),\n ...(isWeb && {\n shadowColor: normalizeColor(colorStr, shadowOpacity),\n }),\n ...(!isWeb &&\n (() => {\n // on native fix bug - shadows behave better if turned into non-alpha rgb() + shadowOpacity\n const rgba = colorToRGBA(colorStr)\n if (!rgba) {\n if (process.env.NODE_ENV === 'development') {\n console.warn('No rgba form', colorStr)\n }\n return {\n shadowColor,\n shadowOpacity,\n }\n }\n const [r, g, b, a] = rgba\n return {\n shadowColor: `rgb(${r},${g},${b})`,\n shadowOpacity: shadowOpacity ?? a,\n }\n })()),\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA0B;AAC1B,sBAAsB;AACtB,yBAA4B;AAC5B,4BAA4C;AAC5C,wCAA2C;AAC3C,+BAAkC;AAElC,IAAI,aAA4C;AACzC,MAAM,gBAAgB,EAAE,QAAQ,GAAG,OAAO,EAAE;AAU5C,sBAAsB,OAA4B;AACvD,QAAM,MAA2B,CAAC;AAElC,WAAS,OAAO,OAAO;AACrB,iBAAa,cAAc,2BAAU,EAAE;AACvC,QAAI,YAAY;AACd,YAAM,WAAW,QAAQ;AAAA,IAC3B;AACA,QAAI,OAAO,4CAAmB;AAC5B,UAAI,OAAO,aAAa,MAAM,IAAI;AAClC;AAAA,IACF;AACA,UAAM,MAAM,kEAA2B,MAAM,MAAM,GAAG;AAEtD,UAAM,MAAM,oCAAY,KAAK,GAAG;AAChC,QAAI,KAAK;AACP,aAAO,OAAO,KAAK,OAAO,YAAY,GAAG,CAAC;AAAA,IAC5C,OAAO;AACL,UAAI,OAAO;AAAA,IACb;AAAA,EACF;AAEA,YAAU,GAAG;AAEb,SAAO;AACT;AAEO,mBAAmB,OAA4B;AACpD,MAAI,MAAM,cAAc;AACtB,WAAO,OAAO,OAAO,gBAAgB,KAAK,CAAC;AAAA,EAC7C;AAGA,aAAW,OAAO,gBAAgB;AAChC,QAAI,MAAM,QAAQ,CAAC,MAAM,eAAe,OAAO;AAC7C,YAAM,eAAe,QAAQ;AAAA,IAC/B;AAAA,EACF;AACF;AAEA,MAAM,iBAAiB;AAAA,EACrB,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,kBAAkB;AACpB;AAEA,yBAAyB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GACsB;AACtB,QAAM,EAAE,QAAQ,UAAU,gBAAgB;AAC1C,QAAM,WAAW,OAAO,eAAe,OAAO;AAC9C,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,OAAO,kEAA2B,SAAS,CAAC;AAAA,MAC5C,QAAQ,kEAA2B,UAAU,CAAC;AAAA,IAChD;AAAA,IACA,cAAc,kEAA2B,gBAAgB,CAAC;AAAA,KACtD,yBAAS;AAAA,IACX,aAAa,0CAAe,UAAU,aAAa;AAAA,EACrD,IACI,CAAC,yBACF,OAAM;AAEL,UAAM,OAAO,uCAAY,QAAQ;AACjC,QAAI,CAAC,MAAM;AACT,UAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,gBAAQ,KAAK,gBAAgB,QAAQ;AAAA,MACvC;AACA,aAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF;AACA,UAAM,CAAC,GAAG,GAAG,GAAG,KAAK;AACrB,WAAO;AAAA,MACL,aAAa,OAAO,KAAK,KAAK;AAAA,MAC9B,eAAe,iBAAiB;AAAA,IAClC;AAAA,EACF,GAAG;AAET;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -19,7 +19,6 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
21
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
23
22
|
var __export = (target, all) => {
|
|
24
23
|
for (var name in all)
|
|
25
24
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -41,11 +40,13 @@ __export(extendStaticConfig_exports, {
|
|
|
41
40
|
module.exports = __toCommonJS(extendStaticConfig_exports);
|
|
42
41
|
var import_helpers = require("@tamagui/helpers");
|
|
43
42
|
var import_createPropMapper = require("./createPropMapper");
|
|
43
|
+
var import_mergeProps = require("./mergeProps");
|
|
44
44
|
function extendStaticConfig(config, parent) {
|
|
45
45
|
if (!parent || !("staticConfig" in parent)) {
|
|
46
46
|
return parseStaticConfig(config);
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const parentStaticConf = parent.staticConfig;
|
|
49
|
+
const variants = __spreadValues({}, parentStaticConf.variants);
|
|
49
50
|
if (config.variants) {
|
|
50
51
|
for (const key in config.variants) {
|
|
51
52
|
if (variants[key]) {
|
|
@@ -55,25 +56,32 @@ function extendStaticConfig(config, parent) {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
+
const parentNames = [...parentStaticConf.parentNames || []];
|
|
60
|
+
if (parentStaticConf.componentName) {
|
|
61
|
+
parentNames.push(parentStaticConf.componentName);
|
|
62
|
+
}
|
|
63
|
+
return parseStaticConfig(__spreadProps(__spreadValues(__spreadValues({}, parentStaticConf), config), {
|
|
59
64
|
variants,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
defaultProps:
|
|
65
|
+
parentNames,
|
|
66
|
+
isZStack: config.isZStack || parentStaticConf.isZStack,
|
|
67
|
+
isText: config.isText || parentStaticConf.isText || false,
|
|
68
|
+
isInput: config.isInput || parentStaticConf.isInput || false,
|
|
69
|
+
neverFlatten: config.neverFlatten || parentStaticConf.neverFlatten,
|
|
70
|
+
ensureOverriddenProp: config.ensureOverriddenProp ?? parentStaticConf.ensureOverriddenProp,
|
|
71
|
+
validStyles: config.validStyles ? __spreadValues(__spreadValues({}, parentStaticConf.validStyles), config.validStyles) : parentStaticConf.validStyles || import_helpers.stylePropsView,
|
|
72
|
+
defaultProps: (0, import_mergeProps.mergeProps)(__spreadValues(__spreadValues({}, parentStaticConf.defaultProps), parentStaticConf.defaultVariants), __spreadValues(__spreadValues({}, config.defaultProps), config.defaultVariants))[0]
|
|
68
73
|
}));
|
|
69
74
|
}
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
const parseStaticConfig = (config) => {
|
|
76
|
+
const parsed = __spreadProps(__spreadValues({
|
|
77
|
+
defaultProps: {}
|
|
78
|
+
}, config), {
|
|
79
|
+
parsed: true
|
|
80
|
+
});
|
|
81
|
+
return __spreadProps(__spreadValues({}, parsed), {
|
|
82
|
+
propMapper: (0, import_createPropMapper.createPropMapper)(parsed)
|
|
75
83
|
});
|
|
76
|
-
}
|
|
84
|
+
};
|
|
77
85
|
// Annotate the CommonJS export names for ESM import in node:
|
|
78
86
|
0 && (module.exports = {
|
|
79
87
|
extendStaticConfig,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/extendStaticConfig.ts"],
|
|
4
|
-
"sourcesContent": ["import { stylePropsView } from '@tamagui/helpers'\n\nimport { StaticConfig, StaticConfigParsed, StylableComponent } from '../types'\nimport { createPropMapper } from './createPropMapper'\n\nexport function extendStaticConfig(config: Partial<StaticConfig>, parent?: StylableComponent) {\n if (!parent || !('staticConfig' in parent)) {\n return parseStaticConfig(config)\n }\n\n const variants = {\n ...
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { stylePropsView } from '@tamagui/helpers'\n\nimport { StaticConfig, StaticConfigParsed, StylableComponent } from '../types'\nimport { createPropMapper } from './createPropMapper'\nimport { mergeProps } from './mergeProps'\n\nexport function extendStaticConfig(config: Partial<StaticConfig>, parent?: StylableComponent) {\n if (!parent || !('staticConfig' in parent)) {\n return parseStaticConfig(config)\n }\n\n const parentStaticConf = parent.staticConfig as StaticConfig\n const variants = {\n ...parentStaticConf.variants,\n }\n\n // merge variants... can we type this?\n if (config.variants) {\n for (const key in config.variants) {\n if (variants[key]) {\n variants[key] = {\n ...variants[key],\n ...config.variants[key],\n }\n } else {\n variants[key] = config.variants[key]\n }\n }\n }\n\n // include our own\n const parentNames = [...(parentStaticConf.parentNames || [])]\n if (parentStaticConf.componentName) {\n parentNames.push(parentStaticConf.componentName)\n }\n\n return parseStaticConfig({\n ...parentStaticConf,\n ...config,\n variants,\n parentNames,\n isZStack: config.isZStack || parentStaticConf.isZStack,\n isText: config.isText || parentStaticConf.isText || false,\n isInput: config.isInput || parentStaticConf.isInput || false,\n neverFlatten: config.neverFlatten || parentStaticConf.neverFlatten,\n ensureOverriddenProp: config.ensureOverriddenProp ?? parentStaticConf.ensureOverriddenProp,\n validStyles: config.validStyles\n ? {\n ...parentStaticConf.validStyles,\n ...config.validStyles,\n }\n : parentStaticConf.validStyles || stylePropsView,\n defaultProps: mergeProps(\n {\n ...parentStaticConf.defaultProps,\n ...parentStaticConf.defaultVariants,\n },\n {\n ...config.defaultProps,\n ...config.defaultVariants,\n }\n )[0],\n })\n}\n\nexport const parseStaticConfig = (config: Partial<StaticConfig>): StaticConfigParsed => {\n const parsed = {\n defaultProps: {},\n ...config,\n parsed: true,\n } as const\n return {\n ...parsed,\n propMapper: createPropMapper(parsed as StaticConfigParsed),\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA+B;AAG/B,8BAAiC;AACjC,wBAA2B;AAEpB,4BAA4B,QAA+B,QAA4B;AAC5F,MAAI,CAAC,UAAU,CAAE,mBAAkB,SAAS;AAC1C,WAAO,kBAAkB,MAAM;AAAA,EACjC;AAEA,QAAM,mBAAmB,OAAO;AAChC,QAAM,WAAW,mBACZ,iBAAiB;AAItB,MAAI,OAAO,UAAU;AACnB,eAAW,OAAO,OAAO,UAAU;AACjC,UAAI,SAAS,MAAM;AACjB,iBAAS,OAAO,kCACX,SAAS,OACT,OAAO,SAAS;AAAA,MAEvB,OAAO;AACL,iBAAS,OAAO,OAAO,SAAS;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AAGA,QAAM,cAAc,CAAC,GAAI,iBAAiB,eAAe,CAAC,CAAE;AAC5D,MAAI,iBAAiB,eAAe;AAClC,gBAAY,KAAK,iBAAiB,aAAa;AAAA,EACjD;AAEA,SAAO,kBAAkB,gDACpB,mBACA,SAFoB;AAAA,IAGvB;AAAA,IACA;AAAA,IACA,UAAU,OAAO,YAAY,iBAAiB;AAAA,IAC9C,QAAQ,OAAO,UAAU,iBAAiB,UAAU;AAAA,IACpD,SAAS,OAAO,WAAW,iBAAiB,WAAW;AAAA,IACvD,cAAc,OAAO,gBAAgB,iBAAiB;AAAA,IACtD,sBAAsB,OAAO,wBAAwB,iBAAiB;AAAA,IACtE,aAAa,OAAO,cAChB,kCACK,iBAAiB,cACjB,OAAO,eAEZ,iBAAiB,eAAe;AAAA,IACpC,cAAc,kCACZ,kCACK,iBAAiB,eACjB,iBAAiB,kBAEtB,kCACK,OAAO,eACP,OAAO,gBAEd,EAAE;AAAA,EACJ,EAAC;AACH;AAEO,MAAM,oBAAoB,CAAC,WAAsD;AACtF,QAAM,SAAS;AAAA,IACb,cAAc,CAAC;AAAA,KACZ,SAFU;AAAA,IAGb,QAAQ;AAAA,EACV;AACA,SAAO,iCACF,SADE;AAAA,IAEL,YAAY,8CAAiB,MAA4B;AAAA,EAC3D;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -21,8 +20,8 @@ __export(fixNativeShadow_exports, {
|
|
|
21
20
|
fixNativeShadow: () => fixNativeShadow
|
|
22
21
|
});
|
|
23
22
|
module.exports = __toCommonJS(fixNativeShadow_exports);
|
|
24
|
-
const fixNativeShadow =
|
|
25
|
-
}
|
|
23
|
+
const fixNativeShadow = (a) => {
|
|
24
|
+
};
|
|
26
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
26
|
0 && (module.exports = {
|
|
28
27
|
fixNativeShadow
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/fixNativeShadow.tsx"],
|
|
4
4
|
"sourcesContent": ["// only native of course\nexport const fixNativeShadow = (a: any) => {}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,MAAM,kBAAkB,CAAC,MAAW;AAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -33,7 +32,6 @@ function getExpandedShorthands(props) {
|
|
|
33
32
|
}
|
|
34
33
|
return res;
|
|
35
34
|
}
|
|
36
|
-
__name(getExpandedShorthands, "getExpandedShorthands");
|
|
37
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
36
|
0 && (module.exports = {
|
|
39
37
|
getExpandedShorthands
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/getExpandedShorthands.ts"],
|
|
4
4
|
"sourcesContent": ["import { getConfig } from '../conf'\nimport { Shorthands } from '../types'\n\nexport function getExpandedShorthands<A extends Object>(props: A): Omit<A, keyof Shorthands> {\n const shorthands = getConfig().shorthands\n if (!shorthands) {\n return props\n }\n let res: A = {} as any\n for (const key in props) {\n // @ts-ignore\n res[shorthands[key] || key] = props[key]\n }\n return res\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA0B;AAGnB,+BAAiD,OAAqC;AAC3F,QAAM,aAAa,2BAAU,EAAE;AAC/B,MAAI,CAAC,YAAY;AACf,WAAO;AAAA,EACT;AACA,MAAI,MAAS,CAAC;AACd,aAAW,OAAO,OAAO;AAEvB,QAAI,WAAW,QAAQ,OAAO,MAAM;AAAA,EACtC;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var getFont_exports = {};
|
|
19
|
+
__export(getFont_exports, {
|
|
20
|
+
getFont: () => getFont
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(getFont_exports);
|
|
23
|
+
var import_createVariable = require("../createVariable");
|
|
24
|
+
const getFont = (val = "$4", { fonts, theme, props }) => {
|
|
25
|
+
var _a, _b, _c;
|
|
26
|
+
const family = (0, import_createVariable.getVariableValue)(props.fontFamily) || "$body";
|
|
27
|
+
const font = fonts[family] || fonts["$body"];
|
|
28
|
+
if (!font) {
|
|
29
|
+
console.warn("\u26A0\uFE0F no font found", { family, fontTokens: Object.keys(fonts), val });
|
|
30
|
+
return {};
|
|
31
|
+
}
|
|
32
|
+
const fontFamily = font.family;
|
|
33
|
+
const fontSize = props.fontSize || font.size[val];
|
|
34
|
+
const lineHeight = props.lineHeight || font.lineHeight[val];
|
|
35
|
+
const fontWeight = props.fontWeight || font.weight[val];
|
|
36
|
+
const letterSpacing = props.letterSpacing || font.letterSpacing[val];
|
|
37
|
+
const fontStyle = props.fontStyle || ((_a = font.style) == null ? void 0 : _a[val]);
|
|
38
|
+
const textTransform = props.textTransform || ((_b = font.transform) == null ? void 0 : _b[val]);
|
|
39
|
+
const color = props.color || ((_c = font.color) == null ? void 0 : _c[val]) || theme.color;
|
|
40
|
+
const style = {
|
|
41
|
+
color,
|
|
42
|
+
fontStyle,
|
|
43
|
+
textTransform,
|
|
44
|
+
fontFamily,
|
|
45
|
+
fontWeight,
|
|
46
|
+
letterSpacing,
|
|
47
|
+
fontSize,
|
|
48
|
+
lineHeight
|
|
49
|
+
};
|
|
50
|
+
if (process.env.NODE_ENV === "development") {
|
|
51
|
+
if (props["debug"]) {
|
|
52
|
+
console.log("getFont", val, style, "from props", props);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return style;
|
|
56
|
+
};
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
getFont
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=getFont.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/getFont.tsx"],
|
|
4
|
+
"sourcesContent": ["import { getVariableValue } from '../createVariable'\nimport { FontSizeTokens, TextProps, VariantSpreadFunction } from '../types'\n\nexport const getFont: VariantSpreadFunction<TextProps, FontSizeTokens> = (\n val = '$4',\n { fonts, theme, props }\n) => {\n const family = getVariableValue(props.fontFamily) || '$body'\n const font = fonts[family] || fonts['$body']\n if (!font) {\n console.warn('\u26A0\uFE0F no font found', { family, fontTokens: Object.keys(fonts), val })\n return {} as any\n }\n const fontFamily = font.family\n const fontSize = props.fontSize || font.size[val]\n const lineHeight = props.lineHeight || font.lineHeight[val]\n const fontWeight = props.fontWeight || font.weight[val]\n const letterSpacing = props.letterSpacing || font.letterSpacing[val]\n const fontStyle = props.fontStyle || font.style?.[val]\n const textTransform = props.textTransform || font.transform?.[val]\n const color = props.color || font.color?.[val] || theme.color\n const style = {\n color,\n fontStyle,\n textTransform,\n fontFamily,\n fontWeight,\n letterSpacing,\n fontSize,\n lineHeight,\n }\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log('getFont', val, style, 'from props', props)\n }\n }\n return style\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAiC;AAG1B,MAAM,UAA4D,CACvE,MAAM,MACN,EAAE,OAAO,OAAO,YACb;AANL;AAOE,QAAM,SAAS,4CAAiB,MAAM,UAAU,KAAK;AACrD,QAAM,OAAO,MAAM,WAAW,MAAM;AACpC,MAAI,CAAC,MAAM;AACT,YAAQ,KAAK,8BAAoB,EAAE,QAAQ,YAAY,OAAO,KAAK,KAAK,GAAG,IAAI,CAAC;AAChF,WAAO,CAAC;AAAA,EACV;AACA,QAAM,aAAa,KAAK;AACxB,QAAM,WAAW,MAAM,YAAY,KAAK,KAAK;AAC7C,QAAM,aAAa,MAAM,cAAc,KAAK,WAAW;AACvD,QAAM,aAAa,MAAM,cAAc,KAAK,OAAO;AACnD,QAAM,gBAAgB,MAAM,iBAAiB,KAAK,cAAc;AAChE,QAAM,YAAY,MAAM,aAAa,YAAK,UAAL,mBAAa;AAClD,QAAM,gBAAgB,MAAM,iBAAiB,YAAK,cAAL,mBAAiB;AAC9D,QAAM,QAAQ,MAAM,SAAS,YAAK,UAAL,mBAAa,SAAQ,MAAM;AACxD,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,MAAM,UAAU;AAClB,cAAQ,IAAI,WAAW,KAAK,OAAO,cAAc,KAAK;AAAA,IACxD;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -2,7 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -18,18 +17,27 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
18
|
var getSize_exports = {};
|
|
20
19
|
__export(getSize_exports, {
|
|
21
|
-
getSize: () => getSize
|
|
20
|
+
getSize: () => getSize,
|
|
21
|
+
stepTokenUpOrDown: () => stepTokenUpOrDown
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(getSize_exports);
|
|
24
24
|
var import_conf = require("../conf");
|
|
25
|
-
const getSize =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
const getSize = (size, shift = 0, bounds = [0]) => {
|
|
26
|
+
return stepTokenUpOrDown((0, import_conf.getTokens)().size, size, shift, bounds);
|
|
27
|
+
};
|
|
28
|
+
const stepTokenUpOrDown = (tokens, current, shift = 0, bounds = [0]) => {
|
|
29
|
+
const sizeNames = Object.keys(tokens);
|
|
30
|
+
const currentKeyNum = (typeof current === "string" ? current.replace("$", "") : current) || "4";
|
|
31
|
+
const nextKeyName = `$${+currentKeyNum + shift}`;
|
|
32
|
+
const min = bounds[0] ?? 0;
|
|
33
|
+
const max = bounds[1] ?? sizeNames.length - 1;
|
|
34
|
+
const index = Math.min(max, Math.max(min, sizeNames.indexOf(nextKeyName)));
|
|
35
|
+
const key = sizeNames[index];
|
|
36
|
+
return tokens[key] || tokens["$4"];
|
|
37
|
+
};
|
|
31
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
39
|
0 && (module.exports = {
|
|
33
|
-
getSize
|
|
40
|
+
getSize,
|
|
41
|
+
stepTokenUpOrDown
|
|
34
42
|
});
|
|
35
43
|
//# sourceMappingURL=getSize.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/getSize.ts"],
|
|
4
|
-
"sourcesContent": ["import { getTokens } from '../conf'\nimport { SizeTokens } from '../types'\n\nexport const getSize = (size?: SizeTokens | undefined,
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { getTokens } from '../conf'\nimport { SizeTokens, SpaceTokens } from '../types'\n\nexport const getSize = (size?: SizeTokens | undefined, shift = 0, bounds = [0]) => {\n return stepTokenUpOrDown(getTokens().size, size, shift, bounds)\n}\n\nexport const stepTokenUpOrDown = (\n tokens: Object,\n current?: SizeTokens | SpaceTokens | string,\n shift = 0,\n bounds = [0]\n) => {\n const sizeNames = Object.keys(tokens)\n const currentKeyNum = (typeof current === 'string' ? current.replace('$', '') : current) || '4'\n const nextKeyName = `$${+currentKeyNum + shift}`\n const min = bounds[0] ?? 0\n const max = bounds[1] ?? sizeNames.length - 1\n const index = Math.min(max, Math.max(min, sizeNames.indexOf(nextKeyName)))\n const key = sizeNames[index]\n return tokens[key] || tokens['$4']\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA0B;AAGnB,MAAM,UAAU,CAAC,MAA+B,QAAQ,GAAG,SAAS,CAAC,CAAC,MAAM;AACjF,SAAO,kBAAkB,2BAAU,EAAE,MAAM,MAAM,OAAO,MAAM;AAChE;AAEO,MAAM,oBAAoB,CAC/B,QACA,SACA,QAAQ,GACR,SAAS,CAAC,CAAC,MACR;AACH,QAAM,YAAY,OAAO,KAAK,MAAM;AACpC,QAAM,gBAAiB,QAAO,YAAY,WAAW,QAAQ,QAAQ,KAAK,EAAE,IAAI,YAAY;AAC5F,QAAM,cAAc,IAAI,CAAC,gBAAgB;AACzC,QAAM,MAAM,OAAO,MAAM;AACzB,QAAM,MAAM,OAAO,MAAM,UAAU,SAAS;AAC5C,QAAM,QAAQ,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,UAAU,QAAQ,WAAW,CAAC,CAAC;AACzE,QAAM,MAAM,UAAU;AACtB,SAAO,OAAO,QAAQ,OAAO;AAC/B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|