@tamagui/core 1.0.0-alpha.8 → 1.0.0-beta.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Tamagui.js +57 -0
- package/dist/cjs/Tamagui.js.map +7 -0
- package/dist/cjs/ThemeContext.js +25 -0
- package/dist/cjs/ThemeContext.js.map +7 -0
- package/dist/cjs/ThemeManager.js +195 -0
- package/dist/cjs/ThemeManager.js.map +7 -0
- package/dist/cjs/conf.js +55 -0
- package/dist/cjs/conf.js.map +7 -0
- package/dist/cjs/constants/constants.js +15 -15
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/constants/platform.js +18 -18
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/pseudos.js +15 -3
- package/dist/cjs/constants/pseudos.js.map +1 -1
- package/dist/cjs/constants/rnw.js +17 -3
- package/dist/cjs/constants/rnw.js.map +2 -2
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +25 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +7 -0
- package/dist/cjs/createComponent.js +326 -206
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js +11 -15
- package/dist/cjs/createFont.js.map +1 -1
- package/dist/cjs/createShallowUpdate.js +1 -0
- package/dist/{helpers/pseudos.js.map → cjs/createShallowUpdate.js.map} +0 -0
- package/dist/cjs/createShorthands.js +15 -3
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createTamagui.js +115 -102
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTheme.js +11 -28
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +12 -16
- package/dist/cjs/createTokens.js.map +1 -1
- package/dist/cjs/createVariable.js +33 -19
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/defaultComponentState.js +1 -0
- package/dist/{types.js.map → cjs/defaultComponentState.js.map} +0 -0
- package/dist/cjs/devtools.js +32 -0
- package/dist/cjs/devtools.js.map +7 -0
- package/dist/cjs/helpers/RNComponents.js +34 -0
- package/dist/cjs/helpers/RNComponents.js.map +7 -0
- package/dist/cjs/helpers/addStylesUsingClassname.js +29 -29
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +2 -2
- package/dist/cjs/helpers/areEqualSets.js +34 -0
- package/dist/cjs/helpers/areEqualSets.js.map +7 -0
- package/dist/cjs/helpers/createMediaStyle.js +16 -21
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +155 -117
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +51 -0
- package/dist/cjs/helpers/createShallowUpdate.js.map +7 -0
- package/dist/cjs/helpers/createTamaguiProvider.js +41 -26
- package/dist/cjs/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/cjs/helpers/extendStaticConfig.js +23 -26
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +15 -3
- package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
- package/dist/cjs/helpers/fixNativeShadow.native.js +38 -22
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +2 -2
- package/dist/cjs/helpers/getExpandedShorthands.js +37 -0
- package/dist/cjs/helpers/getExpandedShorthands.js.map +7 -0
- package/dist/cjs/helpers/getSplitStyles.js +187 -100
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +99 -56
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +15 -3
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.js +86 -24
- package/dist/cjs/helpers/insertStyleRule.js.map +2 -2
- package/dist/cjs/helpers/isObj.js +15 -3
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.js +11 -15
- package/dist/cjs/helpers/isTamaguiElement.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.js +15 -3
- package/dist/cjs/helpers/matchMedia.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +12 -13
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/themeable.js +24 -24
- package/dist/cjs/helpers/themeable.js.map +2 -2
- package/dist/cjs/helpers/validate.js +46 -47
- package/dist/cjs/helpers/validate.js.map +2 -2
- package/dist/cjs/helpers/withStaticProperties.js +28 -0
- package/dist/cjs/helpers/withStaticProperties.js.map +7 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js +35 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +7 -0
- package/dist/cjs/hooks/useConstant.js +11 -15
- package/dist/cjs/hooks/useConstant.js.map +1 -1
- package/dist/cjs/hooks/useFeatures.js +142 -18
- package/dist/cjs/hooks/useFeatures.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +37 -0
- package/dist/cjs/hooks/useIsMounted.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +35 -0
- package/dist/cjs/hooks/useIsTouchDevice.js.map +7 -0
- package/dist/cjs/hooks/useMedia.js +39 -59
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/usePressable.js +11 -15
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +162 -68
- package/dist/cjs/hooks/useTheme.js.map +2 -2
- package/dist/cjs/hooks/useUnmountEffect.js +29 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +7 -0
- package/dist/cjs/index.js +56 -43
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/spacedChildren.js +86 -0
- package/dist/cjs/spacedChildren.js.map +7 -0
- package/dist/cjs/static.js +23 -27
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +37 -18
- package/dist/cjs/styled.js.map +3 -3
- package/dist/cjs/tamagui-base.css +8 -0
- package/dist/cjs/tamagui-base.css.map +7 -0
- package/dist/cjs/types-rnw.js +16 -0
- package/dist/cjs/types-rnw.js.map +7 -0
- package/dist/cjs/types.js +14 -2
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/views/Stack.js +13 -16
- package/dist/cjs/views/Stack.js.map +2 -2
- package/dist/cjs/views/Text.js +19 -21
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/TextAncestorContext.js +19 -21
- package/dist/cjs/views/TextAncestorContext.js.map +2 -2
- package/dist/cjs/views/Theme.js +31 -63
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/ThemeInverse.js +15 -16
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +32 -37
- package/dist/cjs/views/ThemeProvider.js.map +2 -2
- package/dist/cjs/views/ThemeReset.js +59 -0
- package/dist/cjs/views/ThemeReset.js.map +7 -0
- package/dist/esm/Tamagui.js +36 -0
- package/dist/esm/Tamagui.js.map +7 -0
- package/dist/{views → esm}/ThemeContext.js +0 -0
- package/dist/esm/ThemeContext.js.map +7 -0
- package/dist/esm/ThemeManager.js +177 -0
- package/dist/esm/ThemeManager.js.map +7 -0
- package/dist/esm/conf.js +37 -0
- package/dist/esm/conf.js.map +7 -0
- package/dist/{constants → esm/constants}/constants.js +4 -0
- package/dist/esm/constants/constants.js.map +7 -0
- package/dist/{constants → esm/constants}/platform.js +6 -1
- package/dist/esm/constants/platform.js.map +7 -0
- package/dist/{constants → esm/constants}/pseudos.js +0 -0
- package/dist/{constants → esm/constants}/pseudos.js.map +2 -2
- package/dist/{constants → esm/constants}/rnw.js +2 -0
- package/dist/esm/constants/rnw.js.map +7 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js +6 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js.map +7 -0
- package/dist/esm/createComponent.js +590 -0
- package/dist/esm/createComponent.js.map +7 -0
- package/dist/{createFont.js → esm/createFont.js} +0 -0
- package/dist/{createFont.js.map → esm/createFont.js.map} +2 -2
- package/dist/esm/createShallowUpdate.js +1 -0
- package/dist/esm/createShallowUpdate.js.map +7 -0
- package/dist/{createShorthands.js → esm/createShorthands.js} +0 -0
- package/dist/{createShorthands.js.map → esm/createShorthands.js.map} +2 -2
- package/dist/esm/createTamagui.js +185 -0
- package/dist/esm/createTamagui.js.map +7 -0
- package/dist/esm/createTheme.js +7 -0
- package/dist/esm/createTheme.js.map +7 -0
- package/dist/{createTokens.js → esm/createTokens.js} +0 -0
- package/dist/{createTokens.js.map → esm/createTokens.js.map} +2 -2
- package/dist/esm/createVariable.js +43 -0
- package/dist/esm/createVariable.js.map +7 -0
- package/dist/esm/defaultComponentState.js +1 -0
- package/dist/esm/defaultComponentState.js.map +7 -0
- package/dist/esm/devtools.js +14 -0
- package/dist/esm/devtools.js.map +7 -0
- package/dist/esm/helpers/RNComponents.js +12 -0
- package/dist/esm/helpers/RNComponents.js.map +7 -0
- package/dist/{helpers → esm/helpers}/addStylesUsingClassname.js +16 -12
- package/dist/esm/helpers/addStylesUsingClassname.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +16 -0
- package/dist/esm/helpers/areEqualSets.js.map +7 -0
- package/dist/{helpers → esm/helpers}/createMediaStyle.js +5 -6
- package/dist/esm/helpers/createMediaStyle.js.map +7 -0
- package/dist/esm/helpers/createPropMapper.js +210 -0
- package/dist/esm/helpers/createPropMapper.js.map +7 -0
- package/dist/esm/helpers/createShallowUpdate.js +19 -0
- package/dist/esm/helpers/createShallowUpdate.js.map +7 -0
- package/dist/esm/helpers/createTamaguiProvider.js +40 -0
- package/dist/esm/helpers/createTamaguiProvider.js.map +7 -0
- package/dist/{helpers → esm/helpers}/extendStaticConfig.js +14 -14
- package/dist/esm/helpers/extendStaticConfig.js.map +7 -0
- package/dist/{helpers → esm/helpers}/fixNativeShadow.js +0 -0
- package/dist/{helpers → esm/helpers}/fixNativeShadow.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.native.js +34 -0
- package/dist/esm/helpers/fixNativeShadow.native.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +19 -0
- package/dist/esm/helpers/getExpandedShorthands.js.map +7 -0
- package/dist/esm/helpers/getSplitStyles.js +244 -0
- package/dist/esm/helpers/getSplitStyles.js.map +7 -0
- package/dist/esm/helpers/getStylesAtomic.js +119 -0
- package/dist/esm/helpers/getStylesAtomic.js.map +7 -0
- package/dist/{helpers → esm/helpers}/getStylesAtomic.native.js +0 -0
- package/dist/{helpers → esm/helpers}/getStylesAtomic.native.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +90 -0
- package/dist/esm/helpers/insertStyleRule.js.map +7 -0
- package/dist/{helpers → esm/helpers}/isObj.js +0 -0
- package/dist/{helpers → esm/helpers}/isObj.js.map +2 -2
- package/dist/{helpers → esm/helpers}/isTamaguiElement.js +2 -1
- package/dist/{helpers → esm/helpers}/isTamaguiElement.js.map +2 -2
- package/dist/{helpers → esm/helpers}/matchMedia.js +0 -0
- package/dist/{helpers → esm/helpers}/matchMedia.js.map +2 -2
- package/dist/{helpers → esm/helpers}/matchMedia.native.js +0 -0
- package/dist/{helpers → esm/helpers}/matchMedia.native.js.map +2 -2
- package/dist/{helpers → esm/helpers}/themeable.js +11 -10
- package/dist/esm/helpers/themeable.js.map +7 -0
- package/dist/esm/helpers/validate.js +63 -0
- package/dist/esm/helpers/validate.js.map +7 -0
- package/dist/esm/helpers/withStaticProperties.js +10 -0
- package/dist/esm/helpers/withStaticProperties.js.map +7 -0
- package/dist/esm/helpers/wrapThemeManagerContext.js +14 -0
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +7 -0
- package/dist/{hooks → esm/hooks}/useConstant.js +0 -0
- package/dist/{hooks → esm/hooks}/useConstant.js.map +2 -2
- package/dist/esm/hooks/useFeatures.js +173 -0
- package/dist/esm/hooks/useFeatures.js.map +7 -0
- package/dist/esm/hooks/useIsMounted.js +19 -0
- package/dist/esm/hooks/useIsMounted.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +17 -0
- package/dist/esm/hooks/useIsTouchDevice.js.map +7 -0
- package/dist/{hooks → esm/hooks}/useMedia.js +27 -42
- package/dist/esm/hooks/useMedia.js.map +7 -0
- package/dist/{hooks → esm/hooks}/usePressable.js +2 -1
- package/dist/{hooks → esm/hooks}/usePressable.js.map +2 -2
- package/dist/esm/hooks/useTheme.js +172 -0
- package/dist/esm/hooks/useTheme.js.map +7 -0
- package/dist/esm/hooks/useUnmountEffect.js +11 -0
- package/dist/esm/hooks/useUnmountEffect.js.map +7 -0
- package/dist/{index.js → esm/index.js} +21 -5
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/spacedChildren.js +52 -0
- package/dist/esm/spacedChildren.js.map +7 -0
- package/dist/{static.js → esm/static.js} +1 -2
- package/dist/{static.js.map → esm/static.js.map} +3 -3
- package/dist/esm/styled.js +46 -0
- package/dist/esm/styled.js.map +7 -0
- package/dist/esm/tamagui-base.css +8 -0
- package/dist/esm/tamagui-base.css.map +7 -0
- package/dist/esm/types-rnw.js +1 -0
- package/dist/esm/types-rnw.js.map +7 -0
- package/dist/{types.js → esm/types.js} +0 -0
- package/dist/esm/types.js.map +7 -0
- package/dist/{views → esm/views}/Stack.js +1 -0
- package/dist/esm/views/Stack.js.map +7 -0
- package/dist/{views → esm/views}/Text.js +6 -4
- package/dist/esm/views/Text.js.map +7 -0
- package/dist/esm/views/TextAncestorContext.js +18 -0
- package/dist/esm/views/TextAncestorContext.js.map +7 -0
- package/dist/esm/views/Theme.js +35 -0
- package/dist/esm/views/Theme.js.map +7 -0
- package/dist/{views → esm/views}/ThemeInverse.js +1 -1
- package/dist/{views → esm/views}/ThemeInverse.js.map +3 -3
- package/dist/esm/views/ThemeProvider.js +41 -0
- package/dist/esm/views/ThemeProvider.js.map +7 -0
- package/dist/esm/views/ThemeReset.js +38 -0
- package/dist/esm/views/ThemeReset.js.map +7 -0
- package/dist/jsx/Tamagui.js +35 -0
- package/dist/jsx/ThemeContext.js +5 -0
- package/dist/jsx/ThemeManager.js +176 -0
- package/dist/jsx/conf.js +36 -0
- package/dist/jsx/constants/constants.js +17 -0
- package/dist/jsx/constants/platform.js +23 -0
- package/dist/jsx/constants/pseudos.js +17 -0
- package/dist/jsx/constants/rnw.js +23 -0
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +5 -0
- package/dist/jsx/createComponent.js +576 -0
- package/dist/jsx/createFont.js +27 -0
- package/dist/jsx/createShallowUpdate.js +0 -0
- package/dist/jsx/createShorthands.js +9 -0
- package/dist/jsx/createTamagui.js +184 -0
- package/dist/jsx/createTheme.js +6 -0
- package/dist/jsx/createTokens.js +32 -0
- package/dist/jsx/createVariable.js +42 -0
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/devtools.js +13 -0
- package/dist/jsx/helpers/RNComponents.js +11 -0
- package/dist/jsx/helpers/addStylesUsingClassname.js +60 -0
- package/dist/jsx/helpers/areEqualSets.js +15 -0
- package/dist/jsx/helpers/createMediaStyle.js +32 -0
- package/dist/jsx/helpers/createPropMapper.js +209 -0
- package/dist/jsx/helpers/createShallowUpdate.js +18 -0
- package/dist/jsx/helpers/createTamaguiProvider.js +34 -0
- package/dist/jsx/helpers/extendStaticConfig.js +58 -0
- package/dist/jsx/helpers/fixNativeShadow.js +7 -0
- package/dist/jsx/helpers/fixNativeShadow.native.js +33 -0
- package/dist/jsx/helpers/getExpandedShorthands.js +18 -0
- package/dist/jsx/helpers/getSplitStyles.js +243 -0
- package/dist/jsx/helpers/getStylesAtomic.js +118 -0
- package/dist/jsx/helpers/getStylesAtomic.native.js +9 -0
- package/dist/jsx/helpers/insertStyleRule.js +89 -0
- package/dist/jsx/helpers/isObj.js +6 -0
- package/dist/jsx/helpers/isTamaguiElement.js +10 -0
- package/dist/jsx/helpers/matchMedia.js +17 -0
- package/dist/jsx/helpers/matchMedia.native.js +8 -0
- package/dist/jsx/helpers/themeable.js +24 -0
- package/dist/jsx/helpers/validate.js +62 -0
- package/dist/jsx/helpers/withStaticProperties.js +9 -0
- package/dist/jsx/helpers/wrapThemeManagerContext.js +10 -0
- package/dist/jsx/hooks/useConstant.js +14 -0
- package/dist/jsx/hooks/useFeatures.js +167 -0
- package/dist/jsx/hooks/useIsMounted.js +18 -0
- package/dist/jsx/hooks/useIsTouchDevice.js +16 -0
- package/dist/jsx/hooks/useMedia.js +155 -0
- package/dist/jsx/hooks/usePressable.js +13 -0
- package/dist/jsx/hooks/useTheme.js +171 -0
- package/dist/jsx/hooks/useUnmountEffect.js +10 -0
- package/dist/jsx/index.js +47 -0
- package/dist/jsx/spacedChildren.js +44 -0
- package/dist/jsx/static.js +13 -0
- package/dist/jsx/styled.js +45 -0
- package/dist/jsx/tamagui-base.css +7 -0
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Stack.js +12 -0
- package/dist/jsx/views/Text.js +61 -0
- package/dist/jsx/views/TextAncestorContext.js +15 -0
- package/dist/jsx/views/Theme.js +31 -0
- package/dist/jsx/views/ThemeInverse.js +22 -0
- package/dist/jsx/views/ThemeProvider.js +35 -0
- package/dist/jsx/views/ThemeReset.js +34 -0
- package/package.json +22 -20
- package/types/Tamagui.d.ts +15 -0
- package/types/Tamagui.d.ts.map +1 -0
- package/types/ThemeContext.d.ts +7 -0
- package/types/ThemeContext.d.ts.map +1 -0
- package/types/ThemeManager.d.ts +49 -0
- package/types/ThemeManager.d.ts.map +1 -0
- package/types/conf.d.ts +25 -0
- package/types/conf.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/constants/constants.d.ts +2 -0
- package/types/constants/constants.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/constants/platform.d.ts +2 -0
- package/types/constants/platform.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/constants/rnw.d.ts +0 -0
- package/types/constants/rnw.d.ts.map +1 -0
- package/types/contexts/ButtonInsideButtonContext.d.ts +3 -0
- package/types/contexts/ButtonInsideButtonContext.d.ts.map +1 -0
- package/types/createComponent.d.ts +20 -0
- package/types/createComponent.d.ts.map +1 -0
- package/types/createFont.d.ts +3 -0
- package/types/createFont.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/createShorthands.d.ts +0 -0
- package/types/createShorthands.d.ts.map +1 -0
- package/types/createTamagui.d.ts +16 -0
- package/types/createTamagui.d.ts.map +1 -0
- package/types/createTheme.d.ts +7 -0
- package/types/createTheme.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/createTokens.d.ts +24 -14
- package/types/createTokens.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/createVariable.d.ts +6 -1
- package/types/createVariable.d.ts.map +1 -0
- package/types/defaultComponentState.d.ts +1 -0
- package/types/defaultComponentState.d.ts.map +1 -0
- package/types/helpers/RNComponents.d.ts +2 -0
- package/types/helpers/RNComponents.d.ts.map +1 -0
- package/types/helpers/addStylesUsingClassname.d.ts +3 -0
- package/types/helpers/addStylesUsingClassname.d.ts.map +1 -0
- package/types/helpers/areEqualSets.d.ts +2 -0
- package/types/helpers/areEqualSets.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/createMediaStyle.d.ts +1 -1
- package/types/helpers/createMediaStyle.d.ts.map +1 -0
- package/types/helpers/createPropMapper.d.ts +4 -0
- package/types/helpers/createPropMapper.d.ts.map +1 -0
- package/types/helpers/createShallowUpdate.d.ts +4 -0
- package/types/helpers/createShallowUpdate.d.ts.map +1 -0
- package/types/helpers/createTamaguiProvider.d.ts +7 -0
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -0
- package/types/helpers/extendStaticConfig.d.ts +4 -0
- package/types/helpers/extendStaticConfig.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/fixNativeShadow.d.ts +0 -0
- package/types/helpers/fixNativeShadow.d.ts.map +1 -0
- package/types/helpers/fixNativeShadow.native.d.ts +2 -0
- package/types/helpers/fixNativeShadow.native.d.ts.map +1 -0
- package/types/helpers/getExpandedShorthands.d.ts +3 -0
- package/types/helpers/getExpandedShorthands.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts +16 -0
- package/types/helpers/getSplitStyles.d.ts.map +1 -0
- package/types/helpers/getStylesAtomic.d.ts +27 -0
- package/types/helpers/getStylesAtomic.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/getStylesAtomic.native.d.ts +0 -0
- package/types/helpers/getStylesAtomic.native.d.ts.map +1 -0
- package/types/helpers/insertStyleRule.d.ts +7 -0
- package/types/helpers/insertStyleRule.d.ts.map +1 -0
- package/types/helpers/isObj.d.ts +2 -0
- package/types/helpers/isObj.d.ts.map +1 -0
- package/types/helpers/isTamaguiElement.d.ts +3 -0
- package/types/helpers/isTamaguiElement.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/matchMedia.d.ts +0 -0
- package/types/helpers/matchMedia.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/helpers/matchMedia.native.d.ts +0 -0
- package/types/helpers/matchMedia.native.d.ts.map +1 -0
- package/types/helpers/themeable.d.ts +10 -0
- package/types/helpers/themeable.d.ts.map +1 -0
- package/types/helpers/validate.d.ts +4 -0
- package/types/helpers/validate.d.ts.map +1 -0
- package/types/helpers/withStaticProperties.d.ts +2 -0
- package/types/helpers/withStaticProperties.d.ts.map +1 -0
- package/types/helpers/wrapThemeManagerContext.d.ts +3 -0
- package/types/helpers/wrapThemeManagerContext.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/hooks/useConstant.d.ts +0 -0
- package/types/hooks/useConstant.d.ts.map +1 -0
- package/types/hooks/useFeatures.d.ts +18 -0
- package/types/hooks/useFeatures.d.ts.map +1 -0
- package/types/hooks/useIsMounted.d.ts +3 -0
- package/types/hooks/useIsMounted.d.ts.map +1 -0
- package/types/hooks/useIsTouchDevice.d.ts +2 -0
- package/types/hooks/useIsTouchDevice.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/hooks/useMedia.d.ts +0 -0
- package/types/hooks/useMedia.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/hooks/usePressable.d.ts +0 -0
- package/types/hooks/usePressable.d.ts.map +1 -0
- package/types/hooks/useTheme.d.ts +36 -0
- package/types/hooks/useTheme.d.ts.map +1 -0
- package/types/hooks/useUnmountEffect.d.ts +2 -0
- package/types/hooks/useUnmountEffect.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/index.d.ts +16 -3
- package/types/index.d.ts.map +1 -0
- package/types/spacedChildren.d.ts +9 -0
- package/types/spacedChildren.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/static.d.ts +4 -2
- package/types/static.d.ts.map +1 -0
- package/types/styled.d.ts +7 -0
- package/types/styled.d.ts.map +1 -0
- package/types/types-rnw.d.ts +74 -0
- package/types/types-rnw.d.ts.map +1 -0
- package/types/types.d.ts +381 -0
- package/types/types.d.ts.map +1 -0
- package/types/views/Stack.d.ts +4 -0
- package/types/views/Stack.d.ts.map +1 -0
- package/types/views/Text.d.ts +4 -0
- package/types/views/Text.d.ts.map +1 -0
- package/types/views/TextAncestorContext.d.ts +5 -0
- package/types/views/TextAncestorContext.d.ts.map +1 -0
- package/types/views/Theme.d.ts +11 -0
- package/types/views/Theme.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/views/ThemeInverse.d.ts +0 -0
- package/types/views/ThemeInverse.d.ts.map +1 -0
- package/{dist/packages/core/src → types}/views/ThemeProvider.d.ts +0 -1
- package/types/views/ThemeProvider.d.ts.map +1 -0
- package/types/views/ThemeReset.d.ts +4 -0
- package/types/views/ThemeReset.d.ts.map +1 -0
- package/dist/cjs/static/postProcessStyles.js +0 -40
- package/dist/cjs/static/postProcessStyles.js.map +0 -7
- package/dist/cjs/views/Animated.js +0 -129
- package/dist/cjs/views/Animated.js.map +0 -7
- package/dist/cjs/views/ThemeContext.js +0 -29
- package/dist/cjs/views/ThemeContext.js.map +0 -7
- package/dist/cjs/views/ThemeManagerContext.js +0 -84
- package/dist/cjs/views/ThemeManagerContext.js.map +0 -7
- package/dist/constants/constants.js.map +0 -7
- package/dist/constants/platform.js.map +0 -7
- package/dist/constants/rnw.js.map +0 -7
- package/dist/constants/styleConstants.js +0 -46
- package/dist/constants/styleConstants.js.map +0 -7
- package/dist/createComponent.js +0 -463
- package/dist/createComponent.js.map +0 -7
- package/dist/createTamagui.js +0 -168
- package/dist/createTamagui.js.map +0 -7
- package/dist/createTheme.js +0 -20
- package/dist/createTheme.js.map +0 -7
- package/dist/createVariable.js +0 -25
- package/dist/createVariable.js.map +0 -7
- package/dist/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/helpers/createMediaStyle.js.map +0 -7
- package/dist/helpers/createPropMapper.js +0 -153
- package/dist/helpers/createPropMapper.js.map +0 -7
- package/dist/helpers/createTamaguiProvider.js +0 -25
- package/dist/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/helpers/extendStaticConfig.js.map +0 -7
- package/dist/helpers/fixNativeShadow.native.js +0 -30
- package/dist/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/helpers/getSplitStyles.js +0 -150
- package/dist/helpers/getSplitStyles.js.map +0 -7
- package/dist/helpers/getStylesAtomic.js +0 -83
- package/dist/helpers/getStylesAtomic.js.map +0 -7
- package/dist/helpers/insertStyleRule.js +0 -24
- package/dist/helpers/insertStyleRule.js.map +0 -7
- package/dist/helpers/isComponent.js +0 -10
- package/dist/helpers/isComponent.js.map +0 -7
- package/dist/helpers/isTamaguiComponent.js +0 -10
- package/dist/helpers/isTamaguiComponent.js.map +0 -7
- package/dist/helpers/pseudos.js +0 -1
- package/dist/helpers/themeable.js.map +0 -7
- package/dist/helpers/validate.js +0 -60
- package/dist/helpers/validate.js.map +0 -7
- package/dist/helpers/validateConfig.js +0 -46
- package/dist/helpers/validateConfig.js.map +0 -7
- package/dist/helpers/validateTokens.js +0 -29
- package/dist/helpers/validateTokens.js.map +0 -7
- package/dist/hooks/useFeatures.js +0 -63
- package/dist/hooks/useFeatures.js.map +0 -7
- package/dist/hooks/useForceUpdate.js +0 -28
- package/dist/hooks/useForceUpdate.js.map +0 -7
- package/dist/hooks/useMedia.js.map +0 -7
- package/dist/hooks/useTheme.js +0 -89
- package/dist/hooks/useTheme.js.map +0 -7
- package/dist/index.cjs +0 -2202
- package/dist/index.cjs.map +0 -7
- package/dist/index.js.map +0 -7
- package/dist/packages/core/src/constants/constants.d.ts.map +0 -1
- package/dist/packages/core/src/constants/platform.d.ts.map +0 -1
- package/dist/packages/core/src/constants/pseudos.d.ts +0 -15
- package/dist/packages/core/src/constants/pseudos.d.ts.map +0 -1
- package/dist/packages/core/src/constants/rnw.d.ts.map +0 -1
- package/dist/packages/core/src/createComponent.d.ts +0 -16
- package/dist/packages/core/src/createComponent.d.ts.map +0 -1
- package/dist/packages/core/src/createShorthands.d.ts.map +0 -1
- package/dist/packages/core/src/createTamagui.d.ts +0 -37
- package/dist/packages/core/src/createTamagui.d.ts.map +0 -1
- package/dist/packages/core/src/createTheme.d.ts +0 -5
- package/dist/packages/core/src/createTheme.d.ts.map +0 -1
- package/dist/packages/core/src/createTokens.d.ts.map +0 -1
- package/dist/packages/core/src/createVariable.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/addStylesUsingClassname.d.ts +0 -2
- package/dist/packages/core/src/helpers/addStylesUsingClassname.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/createMediaStyle.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/createTamaguiProvider.d.ts +0 -5
- package/dist/packages/core/src/helpers/createTamaguiProvider.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/extendStaticConfig.d.ts +0 -5
- package/dist/packages/core/src/helpers/extendStaticConfig.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/fixNativeShadow.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/fixNativeShadow.native.d.ts +0 -2
- package/dist/packages/core/src/helpers/fixNativeShadow.native.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/getSplitStyles.d.ts +0 -15
- package/dist/packages/core/src/helpers/getSplitStyles.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/getStylesAtomic.d.ts +0 -3
- package/dist/packages/core/src/helpers/getStylesAtomic.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/getStylesAtomic.native.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/insertStyleRule.d.ts +0 -2
- package/dist/packages/core/src/helpers/insertStyleRule.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/matchMedia.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/matchMedia.native.d.ts.map +0 -1
- package/dist/packages/core/src/helpers/themeable.d.ts +0 -10
- package/dist/packages/core/src/helpers/themeable.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useConstant.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useFeatures.d.ts +0 -5
- package/dist/packages/core/src/hooks/useFeatures.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useForceUpdate.d.ts +0 -2
- package/dist/packages/core/src/hooks/useForceUpdate.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useMedia.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/usePressable.d.ts.map +0 -1
- package/dist/packages/core/src/hooks/useTheme.d.ts +0 -18
- package/dist/packages/core/src/hooks/useTheme.d.ts.map +0 -1
- package/dist/packages/core/src/index.d.ts.map +0 -1
- package/dist/packages/core/src/static/postProcessStyles.d.ts +0 -7
- package/dist/packages/core/src/static/postProcessStyles.d.ts.map +0 -1
- package/dist/packages/core/src/static.d.ts.map +0 -1
- package/dist/packages/core/src/styled.d.ts +0 -16
- package/dist/packages/core/src/styled.d.ts.map +0 -1
- package/dist/packages/core/src/types.d.ts +0 -305
- package/dist/packages/core/src/types.d.ts.map +0 -1
- package/dist/packages/core/src/views/Animated.d.ts +0 -15
- package/dist/packages/core/src/views/Animated.d.ts.map +0 -1
- package/dist/packages/core/src/views/Stack.d.ts +0 -3
- package/dist/packages/core/src/views/Stack.d.ts.map +0 -1
- package/dist/packages/core/src/views/Text.d.ts +0 -3
- package/dist/packages/core/src/views/Text.d.ts.map +0 -1
- package/dist/packages/core/src/views/TextAncestorContext.d.ts +0 -3
- package/dist/packages/core/src/views/TextAncestorContext.d.ts.map +0 -1
- package/dist/packages/core/src/views/Theme.d.ts +0 -8
- package/dist/packages/core/src/views/Theme.d.ts.map +0 -1
- package/dist/packages/core/src/views/ThemeContext.d.ts +0 -18
- package/dist/packages/core/src/views/ThemeContext.d.ts.map +0 -1
- package/dist/packages/core/src/views/ThemeInverse.d.ts.map +0 -1
- package/dist/packages/core/src/views/ThemeManagerContext.d.ts +0 -15
- package/dist/packages/core/src/views/ThemeManagerContext.d.ts.map +0 -1
- package/dist/packages/core/src/views/ThemeProvider.d.ts.map +0 -1
- package/dist/packages/helpers/src/AllRules.d.ts +0 -3
- package/dist/packages/helpers/src/AllRules.d.ts.map +0 -1
- package/dist/packages/helpers/src/concatClassName.d.ts +0 -2
- package/dist/packages/helpers/src/concatClassName.d.ts.map +0 -1
- package/dist/packages/helpers/src/index.d.ts +0 -5
- package/dist/packages/helpers/src/index.d.ts.map +0 -1
- package/dist/packages/helpers/src/types.d.ts +0 -8
- package/dist/packages/helpers/src/types.d.ts.map +0 -1
- package/dist/packages/helpers/src/validStyleProps.d.ts +0 -475
- package/dist/packages/helpers/src/validStyleProps.d.ts.map +0 -1
- package/dist/static/postProcessStyles.js +0 -18
- package/dist/static/postProcessStyles.js.map +0 -7
- package/dist/styled.js +0 -21
- package/dist/styled.js.map +0 -7
- package/dist/views/Animated.js +0 -79
- package/dist/views/Animated.js.map +0 -7
- package/dist/views/SafeAreaProvider.js +0 -30
- package/dist/views/SafeAreaProvider.js.map +0 -7
- package/dist/views/Stack.js.map +0 -7
- package/dist/views/Text.js.map +0 -7
- package/dist/views/TextAncestorContext.js +0 -18
- package/dist/views/TextAncestorContext.js.map +0 -7
- package/dist/views/Theme.js +0 -65
- package/dist/views/Theme.js.map +0 -7
- package/dist/views/ThemeContext.js.map +0 -7
- package/dist/views/ThemeManagerContext.js +0 -61
- package/dist/views/ThemeManagerContext.js.map +0 -7
- package/dist/views/ThemeProvider.js +0 -45
- package/dist/views/ThemeProvider.js.map +0 -7
- package/src/constants/constants.ts +0 -12
- package/src/constants/platform.ts +0 -15
- package/src/constants/pseudos.ts +0 -14
- package/src/constants/rnw.tsx +0 -20
- package/src/createComponent.tsx +0 -612
- package/src/createFont.ts +0 -31
- package/src/createShorthands.ts +0 -5
- package/src/createTamagui.ts +0 -217
- package/src/createTheme.ts +0 -19
- package/src/createTokens.ts +0 -88
- package/src/createVariable.ts +0 -26
- package/src/helpers/addStylesUsingClassname.tsx +0 -60
- package/src/helpers/createMediaStyle.ts +0 -46
- package/src/helpers/createPropMapper.ts +0 -184
- package/src/helpers/createTamaguiProvider.tsx +0 -22
- package/src/helpers/extendStaticConfig.ts +0 -68
- package/src/helpers/fixNativeShadow.native.tsx +0 -27
- package/src/helpers/fixNativeShadow.tsx +0 -2
- package/src/helpers/getSplitStyles.tsx +0 -200
- package/src/helpers/getStylesAtomic.native.ts +0 -3
- package/src/helpers/getStylesAtomic.ts +0 -103
- package/src/helpers/insertStyleRule.tsx +0 -18
- package/src/helpers/isObj.ts +0 -1
- package/src/helpers/isTamaguiElement.tsx +0 -5
- package/src/helpers/matchMedia.native.ts +0 -6
- package/src/helpers/matchMedia.ts +0 -17
- package/src/helpers/themeable.tsx +0 -42
- package/src/helpers/validate.ts +0 -59
- package/src/hooks/useConstant.tsx +0 -10
- package/src/hooks/useFeatures.tsx +0 -79
- package/src/hooks/useMedia.tsx +0 -194
- package/src/hooks/usePressable.tsx +0 -9
- package/src/hooks/useTheme.tsx +0 -106
- package/src/index.ts +0 -32
- package/src/static/postProcessStyles.tsx +0 -20
- package/src/static.ts +0 -22
- package/src/styled.ts +0 -82
- package/src/types.tsx +0 -562
- package/src/views/Animated.tsx +0 -121
- package/src/views/Stack.tsx +0 -21
- package/src/views/Text.tsx +0 -66
- package/src/views/TextAncestorContext.tsx +0 -12
- package/src/views/Theme.tsx +0 -90
- package/src/views/ThemeContext.tsx +0 -5
- package/src/views/ThemeInverse.tsx +0 -22
- package/src/views/ThemeManagerContext.tsx +0 -62
- package/src/views/ThemeProvider.tsx +0 -52
- package/types.d.ts +0 -559
package/dist/cjs/types.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/types.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { RefObject } from 'react'\nimport { TextProps as ReactTextProps, TextStyle } from 'react-native'\nimport { GestureResponderEvent, View, ViewProps, ViewStyle } from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\n// to prevent things from going circular, hoisting some types in this file\n// to generally order them as building up towards TamaguiConfig\n\nexport interface CreateTokens<Val extends number | string | Variable = number | string | Variable> {\n font: { [key: string]: GenericFont }\n color: { [key: string]: Val }\n space: { [key: string]: Val }\n size: { [key: string]: Val }\n radius: { [key: string]: Val }\n zIndex: { [key: string]: Val }\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]: {\n // defined for our tamagui kit , we could do this inside `tamagui`\n // but maybe helpful to have some sort of universally shared things +\n // + enforce if they want their own, redefine in their design sys\n bg: string | Variable\n bg2: string | Variable\n bg3: string | Variable\n bg4: string | Variable\n color: string | Variable\n color2: string | Variable\n color3: string | Variable\n color4: string | Variable\n borderColor: string | Variable\n borderColor2: string | Variable\n shadowColor: string | Variable\n shadowColor2: string | Variable\n }\n}\ntype GenericShorthands = {}\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\n\n// this is the \"main\" typed object, which users re-define\n// (internal) keep all types directly on this object and reference them from elsewhere\n//\n// const config = createTamagui(...)\n// type MyConfig = typeof config\n// declare module 'tamagui' {\n// export interface TamaguiCustomConfig extends MyConfig {}\n// }\n// now your whole app/kit should be typed correctly\n//\nexport interface TamaguiCustomConfig {}\n\nexport interface TamaguiConfig\n extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>,\n TamaguiCustomConfig {}\n\nexport type CreateTamaguiConfig<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands,\n D extends GenericMedia\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n tokens: A\n themes: B\n shorthands: C\n media: D\n}\n\n// for use in creation functions so it doesnt get overwrtitten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeObject = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\n// themes\nexport type ThemeName = keyof Themes extends `${infer Prefix}-${string}`\n ? Prefix | keyof Themes\n : keyof Themes\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeKeyVariables = `$${ThemeKeys}`\n// export type Spaces = TamaguiConfig['tokens']['spaces'][keyof TamaguiConfig['tokens']['spaces']]\n// export type FontSizes = TamaguiConfig['tokens']['fontSizes'][keyof TamaguiConfig['tokens']['fontSizes']]\n// export type Colors = TamaguiConfig['tokens']['colors'][keyof TamaguiConfig['tokens']['colors']]\n\n// this is the config generated via createTamagui()\nexport type TamaguiInternalConfig<\n A extends GenericTokens = GenericTokens,\n B extends GenericThemes = GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia\n> = CreateTamaguiConfig<A, B, C, D> & {\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n themeParsed: { [key: string]: Variable }\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n getCSS: () => string\n parsed: boolean\n}\n\n// prevents const intersections from being clobbered into string, keeping the consts\nexport type UnionableString = string & {}\nexport type UnionableNumber = number & {}\nexport type PropTypes<A extends StaticComponent> = A extends React.FunctionComponent<infer Props>\n ? Props\n : unknown\n\nexport type GenericFont = {\n size: { [key: string | number]: number | Variable }\n lineHeight: { [key: string | number]: number | Variable }\n letterSpacing: { [key: string | number]: number | Variable }\n weight: { [key: string | number]: string | Variable }\n family: string | Variable\n}\n\n// media\nexport type MediaKeys = keyof Media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryState = {\n [key in string]: boolean\n}\nexport type MediaQueryKey = keyof Media\nexport type MediaProps<A> = {\n [key in `$${MediaQueryKey}`]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\nexport type ConfigureMediaQueryOptions = {\n queries?: MediaQueries\n defaultActive?: MediaQueryKey[]\n}\n\nexport type TransformStyleProps = {\n x?: number\n y?: number\n perspective?: number\n scale?: number\n scaleX?: number\n scaleY?: number\n skewX?: string\n skewY?: string\n matrix?: number[]\n rotate?: string\n rotateY?: string\n rotateX?: string\n rotateZ?: string\n}\n\n// createComponent props helpers\n\n//\n// base props that are accepted by createComponent (additional to react-native-web)\n//\ntype ComponentPropsBase = {\n className?: string\n tag?: string\n animated?: boolean\n onHoverIn?: (e: MouseEvent) => any\n onHoverOut?: (e: MouseEvent) => any\n onPress?: (e: GestureResponderEvent) => any\n onPressIn?: (e: GestureResponderEvent) => any\n onPressOut?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseEnter?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseLeave?: (e: GestureResponderEvent) => any\n space?: Tokens['space'][keyof Tokens['space']] | boolean | string | number\n pointerEvents?: string\n}\n\ntype GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight'> =\n keyof Tokens['font'][keyof Tokens['font']][A]\n\nexport type SpaceTokens = `$${keyof Tokens['space']}`\n\n//\n// adds in theme short values to relevant props\n//\ntype ThemeValue<A> = Omit<A, string> | UnionableString | Variable\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]:\n | ThemeValue<T[K]>\n | (K extends ColorableKeys\n ? ThemeKeyVariables\n : K extends SizeKeys\n ? `$${keyof Tokens['size']}`\n : K extends FontKeys\n ? `$${keyof Tokens['font']}`\n : K extends FontSizeKeys\n ? `$${GetTokenFontKeysFor<'size'>}`\n : K extends SpaceKeys\n ? `$${keyof Tokens['space']}`\n : K extends ColorKeys\n ? `$${keyof Tokens['color']}`\n : K extends ZIndexKeys\n ? `$${keyof Tokens['zIndex']}`\n : K extends LineHeightKeys\n ? `$${GetTokenFontKeysFor<'lineHeight'>}`\n : K extends FontWeightKeys\n ? `$${GetTokenFontKeysFor<'weight'>}`\n : K extends FontLetterSpacingKeys\n ? `$${GetTokenFontKeysFor<'letterSpacing'>}`\n : {})\n}\n\n//\n// adds in shorthand props\n//\ntype WithShorthands<StyleProps> = {\n [Key in keyof Shorthands]?: Shorthands[Key] extends keyof StyleProps\n ? StyleProps[Shorthands[Key]] | null\n : {}\n}\n\n//\n// add both theme and shorthands\n//\ntype WithThemeAndShorthands<A extends object> = WithThemeValues<A> &\n WithShorthands<WithThemeValues<A>>\n\n//\n// adds theme and shorthands + pseudo styles with both\n//\ntype WithThemeShorthandsAndPseudos<A extends object> = WithThemeAndShorthands<A> & {\n hoverStyle?: WithThemeAndShorthands<A> | null\n pressStyle?: WithThemeAndShorthands<A> | null\n}\n\n//\n// adds theme, shorthands, psuedos, then all the previous to media queries\n//\ntype WithThemeShorthandsPseudosAndMedia<A extends object> = WithThemeShorthandsAndPseudos<A> &\n MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n//\n// Stack\n//\n\ntype WebOnlyStyleProps = {\n // WEB ONLY\n cursor?: string\n // WEB ONLY\n contain?: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'paint' | string\n // WEB ONLY values: inherit, inline, block, content\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n // WEB ONLY pointerEvents can be a style prop\n pointerEvents?: ViewProps['pointerEvents']\n}\n\ntype StackStyleProps = WithThemeShorthandsPseudosAndMedia<\n Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> &\n TransformStyleProps &\n WebOnlyStyleProps\n>\n\nexport type StackProps = Omit<RNWInternalProps, 'children'> &\n Omit<ViewProps, 'display' | 'children'> &\n StackStyleProps &\n ComponentPropsBase & {\n ref?: RefObject<View | HTMLElement> | ((node: View | HTMLElement) => any)\n children?: any | any[]\n }\n\n//\n// Text props\n//\n\n// type EnhancedTextStyleProps = WithThemeValues<\n// Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps\n// >\n// export type TextStylePropsBase = EnhancedTextStyleProps\n// export type TextStyleProps<S = TextStylePropsBase> = S & {\n// hoverStyle?: S | null\n// pressStyle?: S | null\n// }\n\ntype TextStyleProps = WithThemeShorthandsPseudosAndMedia<\n Omit<TextStyle, 'display' | 'backfaceVisibility'> & TransformStyleProps & WebOnlyStyleProps\n>\n\nexport type TextProps = Omit<ReactTextProps, 'style'> &\n TextStyleProps &\n ComponentPropsBase & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n }\n\n//\n// StaticComponent\n//\n\nexport type StaticComponent<\n Props = any,\n VariantProps = any,\n StaticConfParsed = StaticConfigParsed,\n ParentVariantProps = any\n> = React.FunctionComponent<Props> & {\n staticConfig: StaticConfParsed\n variantProps?: VariantProps\n\n /*\n * Only needed for more complex components\n * If you create a styled frame component this is a HoC to extract\n * styles from all parents.\n */\n extractable: <X>(a: X, opts?: StaticConfig) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n initialWindowMetrics?: any\n fallback?: any\n children?: any\n}\n\nexport type RNWInternalProps = {\n accessibilityState?: {\n busy?: boolean\n checked?: boolean | 'mixed'\n disabled?: boolean\n expanded?: boolean\n grabbed?: boolean\n hidden?: boolean\n invalid?: boolean\n modal?: boolean\n pressed?: boolean\n readonly?: boolean\n required?: boolean\n selected?: boolean\n }\n accessibilityValue?: {\n max?: number\n min?: number\n now?: number\n text?: string\n }\n children?: any\n focusable?: boolean\n nativeID?: string\n onBlur?: (e: any) => void\n onClick?: (e: any) => void\n onClickCapture?: (e: any) => void\n onContextMenu?: (e: any) => void\n onFocus?: (e: any) => void\n onKeyDown?: (e: any) => void\n onKeyUp?: (e: any) => void\n onMoveShouldSetResponder?: (e: any) => boolean\n onMoveShouldSetResponderCapture?: (e: any) => boolean\n onResponderEnd?: (e: any) => void\n onResponderGrant?: (e: any) => void\n onResponderMove?: (e: any) => void\n onResponderReject?: (e: any) => void\n onResponderRelease?: (e: any) => void\n onResponderStart?: (e: any) => void\n onResponderTerminate?: (e: any) => void\n onResponderTerminationRequest?: (e: any) => boolean\n onScrollShouldSetResponder?: (e: any) => boolean\n onScrollShouldSetResponderCapture?: (e: any) => boolean\n onSelectionChangeShouldSetResponder?: (e: any) => boolean\n onSelectionChangeShouldSetResponderCapture?: (e: any) => boolean\n onStartShouldSetResponder?: (e: any) => boolean\n onStartShouldSetResponderCapture?: (e: any) => boolean\n pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto'\n testID?: string\n // unstable\n dataSet?: Object\n onMouseDown?: (e: any) => void\n onMouseEnter?: (e: any) => void\n onMouseLeave?: (e: any) => void\n onMouseMove?: (e: any) => void\n onMouseOver?: (e: any) => void\n onMouseOut?: (e: any) => void\n onMouseUp?: (e: any) => void\n onScroll?: (e: any) => void\n onTouchCancel?: (e: any) => void\n onTouchCancelCapture?: (e: any) => void\n onTouchEnd?: (e: any) => void\n onTouchEndCapture?: (e: any) => void\n onTouchMove?: (e: any) => void\n onTouchMoveCapture?: (e: any) => void\n onTouchStart?: (e: any) => void\n onTouchStartCapture?: (e: any) => void\n onWheel?: (e: any) => void\n href?: string\n hrefAttrs?: { download?: boolean; rel?: string; target?: string }\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: StaticComponent\n\n variants?: {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n }\n\n /*\n * If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /*\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /*\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /*\n * Allows for defining extra valid props to be extracted beyond\n * the default ones.\n */\n validPropsExtra?: { [key: string]: any }\n\n /*\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /*\n * If this prop is encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /*\n * A bit odd, only for more advanced heirarchies.\n * Indicates that the component will set this prop so the\n * static extraction can ensure it sets them to ={undefined}\n * so they get overriddent. In the future, this can be smarter.\n */\n ensureOverriddenProp?: { [key: string]: boolean }\n\n /*\n * We need to wrap children\n */\n isZStack?: boolean\n}\n\ntype ColorableKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderTopColor'\n | 'borderBottomColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n | 'shadowColor'\n\ntype SizeKeys = 'width' | 'height' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight'\n\ntype FontKeys = 'fontFamily'\n\ntype FontSizeKeys = 'fontSize'\n\ntype FontWeightKeys = 'fontWeight'\n\ntype FontLetterSpacingKeys = 'letterSpacing'\n\ntype LineHeightKeys = 'lineHeight'\n\ntype ZIndexKeys = 'zIndex'\n\ntype ColorKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderTopColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n\ntype SpaceKeys =\n | 'padding'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingLeft'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingEnd'\n | 'paddingStart'\n | 'margin'\n | 'marginHorizontal'\n | 'marginVertical'\n | 'marginLeft'\n | 'marginTop'\n | 'marginBottom'\n | 'marginLeft'\n | 'marginRight'\n | 'marginEnd'\n | 'marginStart'\n | 'x'\n | 'y'\n | 'scale'\n | 'scaleX'\n | 'scaleY'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderTopStartRadius'\n | 'borderBottomEndRadius'\n | 'borderBottomLeftRadius'\n | 'borderBottomRightRadius'\n | 'borderBottomStartRadius'\n | 'borderBottomWidth'\n | 'borderLeftWidth'\n | 'borderRadius'\n | 'borderRightWidth'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderEndWidth'\n | 'borderStartWidth'\n | 'borderTopStartRadius'\n | 'borderTopWidth'\n | 'borderWidth'\n | 'left'\n | 'top'\n | 'right'\n | 'bottom'\n | 'shadowOffset'\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["// TODO split this into own package @tamagui/types to share with animations packages\n\nimport CSS from 'csstype'\nimport React from 'react'\nimport {\n GestureResponderEvent,\n Image,\n TextProps as ReactTextProps,\n Text,\n TextInput,\n TextInputProps,\n TextStyle,\n View,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport { Variable } from './createVariable'\nimport { ResolveVariableTypes } from './helpers/createPropMapper'\nimport { RNWTextProps, RNWViewProps } from './types-rnw'\nimport { ThemeProviderProps } from './views/ThemeProvider'\n\nexport type ReactComponentWithRef<Props, Ref> = React.ForwardRefExoticComponent<\n Props & React.RefAttributes<Ref>\n>\n\nexport type ConfigListener = (conf: TamaguiInternalConfig) => void\n\n// to prevent things from going circular, hoisting some types in this file\n// to generally order them as building up towards TamaguiConfig\n\nexport type VariableVal = number | string | Variable\nexport type VariableColorVal = string | Variable\n\ntype GenericKey = string | number | symbol\n\nexport interface CreateTokens<Val extends VariableVal = VariableVal> {\n font: { [key: GenericKey]: GenericFont }\n color: { [key: GenericKey]: Val }\n space: { [key: GenericKey]: Val }\n size: { [key: GenericKey]: Val }\n radius: { [key: GenericKey]: Val }\n zIndex: { [key: GenericKey]: Val }\n}\n\nexport type TamaguiBaseTheme = {\n // defined for our tamagui kit , we could do this inside `tamagui`\n // but maybe helpful to have some sort of universally shared things +\n // + enforce if they want their own, redefine in their design sys\n background: VariableColorVal\n backgroundHover: VariableColorVal\n backgroundPress: VariableColorVal\n backgroundFocus: VariableColorVal\n color: VariableColorVal\n colorHover: VariableColorVal\n colorPress: VariableColorVal\n colorFocus: VariableColorVal\n borderColor: VariableColorVal\n borderColorHover: VariableColorVal\n borderColorPress: VariableColorVal\n borderColorFocus: VariableColorVal\n shadowColor: VariableColorVal\n shadowColorHover: VariableColorVal\n shadowColorPress: VariableColorVal\n shadowColorFocus: VariableColorVal\n}\n\ntype GenericTokens = CreateTokens\ntype GenericThemes = {\n [key: string]:\n | Partial<TamaguiBaseTheme> & {\n [key: string]: VariableVal\n }\n}\ntype GenericShorthands = {\n // [key: string]: string\n}\n\ntype GenericMedia<K extends string = string> = {\n // name => media shorthand name (camelCase) => value\n [key in K]: {\n [key: string]: number | string\n }\n}\ntype GenericAnimations = {\n [key: string]:\n | string\n | {\n [key: string]: any\n }\n}\n\n// this is the \"main\" typed object, which users re-define\n// (internal) keep all types directly on this object and reference them from elsewhere\n//\n// const config = createTamagui(...)\n// type MyConfig = typeof config\n// declare module 'tamagui' {\n// export interface TamaguiCustomConfig extends MyConfig {}\n// }\n// now your whole app/kit should be typed correctly\n//\nexport interface TamaguiCustomConfig {}\n\nexport interface TamaguiConfig\n extends Omit<GenericTamaguiConfig, keyof TamaguiCustomConfig>,\n TamaguiCustomConfig {}\n\nexport type CreateTamaguiConfig<\n A extends GenericTokens,\n B extends GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations\n> = Partial<Pick<ThemeProviderProps, 'defaultTheme' | 'disableRootThemeClass'>> & {\n tokens: A\n themes: B\n shorthands: C\n media: D\n animations: AnimationDriver<E>\n}\n\n// for use in creation functions so it doesnt get overwrtitten\nexport type GenericTamaguiConfig = CreateTamaguiConfig<\n GenericTokens,\n GenericThemes,\n GenericShorthands,\n GenericMedia,\n GenericAnimations\n>\n\n// since TamaguiConfig will be re-declared, these will all be typed globally\nexport type ThemeObject = TamaguiConfig['themes'][keyof TamaguiConfig['themes']]\nexport type Tokens = TamaguiConfig['tokens']\nexport type Shorthands = TamaguiConfig['shorthands']\nexport type Media = TamaguiConfig['media']\nexport type Themes = TamaguiConfig['themes']\nexport type ThemeName = GetAltThemeNames<keyof Themes>\n// export type ThemeNameWithSubThemes = GetSubThemes<ThemeName>\nexport type ThemeKeys = keyof ThemeObject\nexport type ThemeTokens = `$${ThemeKeys}`\nexport type AnimationKeys = GetAnimationKeys<TamaguiConfig>\n\ntype GetAltThemeNames<S> = (S extends `${string}_${infer Alt}` ? GetAltThemeNames<Alt> : S) | S\n\n// this is the config generated via createTamagui()\nexport type TamaguiInternalConfig<\n A extends GenericTokens = GenericTokens,\n B extends GenericThemes = GenericThemes,\n C extends GenericShorthands = GenericShorthands,\n D extends GenericMedia = GenericMedia,\n E extends GenericAnimations = GenericAnimations\n> = CreateTamaguiConfig<A, B, C, D, E> & {\n // TODO need to make it this but this breaks types, revisit\n // animations: E //AnimationDriver<E>\n Provider: (props: TamaguiProviderProps) => any\n // with $ prefixes for fast lookups (one time cost at startup vs every render)\n tokensParsed: CreateTokens<Variable>\n themeConfig: any\n getCSS: () => string\n parsed: boolean\n}\n\nexport type GetAnimationKeys<A extends GenericTamaguiConfig> = keyof A['animations']['animations']\n\n// prevents const intersections from being clobbered into string, keeping the consts\nexport type UnionableString = string & {}\nexport type UnionableNumber = number & {}\nexport type PropTypes<A extends TamaguiComponent> = A extends React.FunctionComponent<infer Props>\n ? Props\n : unknown\n\nexport type GenericFont<Key extends number | string = number | string> = {\n size: { [key in Key]: number | Variable }\n lineHeight: { [key in Key]: number | Variable }\n letterSpacing: { [key in Key]: number | Variable }\n weight: { [key in Key]: number | string | Variable }\n family: string | Variable\n}\n\n// media\nexport type MediaKeys = keyof Media\nexport type MediaQueryObject = { [key: string]: string | number | string }\nexport type MediaQueryState = {\n [key in string]: boolean\n}\nexport type MediaQueryKey = keyof Media\nexport type MediaPropKeys = `$${MediaQueryKey}`\nexport type MediaProps<A> = {\n [key in MediaPropKeys]?: A\n}\nexport type MediaQueries = {\n [key in MediaQueryKey]: MediaQueryObject\n}\nexport type ConfigureMediaQueryOptions = {\n queries?: MediaQueries\n defaultActive?: MediaQueryKey[]\n}\n\nexport type TransformStyleProps = {\n x?: number\n y?: number\n perspective?: number\n scale?: number\n scaleX?: number\n scaleY?: number\n skewX?: string\n skewY?: string\n matrix?: number[]\n rotate?: string\n rotateY?: string\n rotateX?: string\n rotateZ?: string\n}\n\n// createComponent props helpers\n\n//\n// base props that are accepted by createComponent (additional to react-native-web)\n//\nexport type TamaguiComponentPropsBase = {\n animation?: AnimationKeys\n animateOnly?: string[]\n children?: any | any[]\n debug?: boolean | 'break' | 'verbose'\n disabled?: boolean\n className?: string\n id?: string\n tag?: string\n theme?: ThemeName | null\n onHoverIn?: (e: MouseEvent) => any\n onHoverOut?: (e: MouseEvent) => any\n onPress?: (e: GestureResponderEvent) => any\n onPressIn?: (e: GestureResponderEvent) => any\n onPressOut?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseEnter?: (e: GestureResponderEvent) => any\n // WEB ONLY\n onMouseLeave?: (e: GestureResponderEvent) => any\n space?: SpaceTokens\n}\n\ntype GetTokenFontKeysFor<A extends 'size' | 'weight' | 'letterSpacing' | 'family' | 'lineHeight'> =\n keyof Tokens['font'][keyof Tokens['font']][A]\n\ntype GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`\n\nexport type SizeTokens = GetTokenString<keyof Tokens['size']> | number\nexport type FontTokens = GetTokenString<keyof Tokens['font']>\nexport type FontSizeTokens = GetTokenString<GetTokenFontKeysFor<'size'>> | number\nexport type FontLineHeightTokens = `$${GetTokenFontKeysFor<'lineHeight'>}` | number\nexport type FontWeightTokens =\n | `$${GetTokenFontKeysFor<'weight'>}`\n | `${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}00`\nexport type FontLetterSpacingTokens = `$${GetTokenFontKeysFor<'letterSpacing'>}` | number\nexport type SpaceTokens = GetTokenString<keyof Tokens['space']> | number | boolean\nexport type ColorTokens =\n | GetTokenString<keyof Tokens['color']>\n | GetTokenString<keyof ThemeObject>\n | CSSColorNames\nexport type ZIndexTokens = GetTokenString<keyof Tokens['zIndex']> | number\nexport type RadiusTokens = GetTokenString<keyof Tokens['radius']> | number\n\n//\n// adds theme short values to relevant props\n//\n\nexport type ThemeValueByCategory<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends 'size'\n ? SizeTokens\n : K extends 'font'\n ? FontTokens\n : K extends 'fontSize'\n ? FontSizeTokens\n : K extends 'space'\n ? SpaceTokens\n : K extends 'color'\n ? ColorTokens\n : K extends 'zIndex'\n ? ZIndexTokens\n : K extends 'lineHeight'\n ? FontLineHeightTokens\n : K extends 'fontWeight'\n ? FontWeightTokens\n : K extends 'letterSpacing'\n ? FontLetterSpacingTokens\n : {}\n\nexport type ThemeValueGet<K extends string | number | symbol> = K extends 'theme'\n ? ThemeTokens\n : K extends SizeKeys\n ? SizeTokens\n : K extends FontKeys\n ? FontTokens\n : K extends FontSizeKeys\n ? FontSizeTokens\n : K extends SpaceKeys\n ? K extends 'shadowOffset'\n ? { width: SpaceTokens; height: SpaceTokens }\n : SpaceTokens\n : K extends ColorKeys\n ? ColorTokens\n : K extends ZIndexKeys\n ? ZIndexTokens\n : K extends LineHeightKeys\n ? FontLineHeightTokens\n : K extends FontWeightKeys\n ? FontWeightTokens\n : K extends FontLetterSpacingKeys\n ? FontLetterSpacingTokens\n : never\n\nexport type ThemeValueFallback = UnionableString | Variable\n\nexport type WithThemeValues<T extends object> = {\n [K in keyof T]: ThemeValueGet<K> extends never\n ? T[K]\n : ThemeValueGet<K> | Exclude<T[K], string> | ThemeValueFallback\n}\n\n// adds shorthand props\nexport type WithShorthands<StyleProps> = {\n [Key in keyof Shorthands]?: Shorthands[Key] extends keyof StyleProps\n ? StyleProps[Shorthands[Key]] | null\n : undefined\n}\n\n// adds pseudo props\nexport type PseudoProps<A> = {\n hoverStyle?: A | null\n pressStyle?: A | null\n focusStyle?: A | null\n exitStyle?: A | null\n enterStyle?: A | null\n}\n\nexport type PsuedoPropKeys = keyof PseudoProps<any>\n\nexport type PseudoStyles = {\n hoverStyle?: ViewStyle\n pressStyle?: ViewStyle\n focusStyle?: ViewStyle\n enterStyle?: ViewStyle\n exitStyle?: ViewStyle\n}\n\n//\n// add both theme and shorthands\n//\ntype WithThemeAndShorthands<A extends object> = WithThemeValues<A> &\n WithShorthands<WithThemeValues<A>>\n\n//\n// combines all of theme, shorthands, psuedos...\n//\ntype WithThemeShorthandsAndPseudos<A extends object> =\n | WithThemeAndShorthands<A> & PseudoProps<WithThemeAndShorthands<A>>\n\n//\n// ... media queries and animations\n//\ntype WithThemeShorthandsPseudosMediaAnimation<A extends object> = WithThemeShorthandsAndPseudos<A> &\n MediaProps<WithThemeShorthandsAndPseudos<A>>\n\n//\n// Stack\n//\n\ntype WebOnlyStyleProps = {\n // WEB ONLY\n cursor?: string\n // WEB ONLY\n contain?: 'none' | 'strict' | 'content' | 'size' | 'layout' | 'paint' | string\n // WEB ONLY values: inherit, inline, block, content\n display?: 'inherit' | 'none' | 'inline' | 'block' | 'contents' | 'flex' | 'inline-flex'\n // WEB ONLY pointerEvents can be a style prop\n pointerEvents?: ViewProps['pointerEvents']\n}\n\nexport type StackStylePropsBase = Omit<ViewStyle, 'display' | 'backfaceVisibility' | 'elevation'> &\n TransformStyleProps &\n WebOnlyStyleProps\n\nexport type StackPropsBaseShared = Omit<ViewProps, 'display' | 'children'> &\n RNWViewProps &\n TamaguiComponentPropsBase\nexport type StackStyleProps = WithThemeShorthandsPseudosMediaAnimation<StackStylePropsBase>\nexport type StackPropsBase = StackPropsBaseShared & WithThemeAndShorthands<StackStylePropsBase>\nexport type StackProps = StackPropsBaseShared & StackStyleProps\n\n//\n// Text props\n//\n\nexport type TextStylePropsBase = Omit<TextStyle, 'display' | 'backfaceVisibility'> &\n TransformStyleProps &\n WebOnlyStyleProps & {\n ellipse?: boolean\n selectable?: boolean\n textDecorationDistance?: number\n userSelect?: CSS.Properties['userSelect']\n textOverflow?: CSS.Properties['textOverflow']\n whiteSpace?: CSS.Properties['whiteSpace']\n wordWrap?: CSS.Properties['wordWrap']\n cursor?: CSS.Properties['cursor']\n }\n\nexport type TextPropsBaseShared = Omit<ReactTextProps, 'children'> &\n RNWTextProps &\n TamaguiComponentPropsBase\nexport type TextPropsBase = TextPropsBaseShared & WithThemeAndShorthands<TextStylePropsBase>\nexport type TextStyleProps = WithThemeShorthandsPseudosMediaAnimation<TextStylePropsBase>\nexport type TextProps = TextPropsBaseShared & TextStyleProps\n\n// could actually infer from parent\nexport type ViewOrTextProps = WithThemeShorthandsPseudosMediaAnimation<\n Omit<TextStylePropsBase, keyof StackStylePropsBase> & StackStylePropsBase\n>\n\n//\n// StaticComponent\n//\n\nexport type TamaguiComponent<\n Props = any,\n Ref = any,\n BaseProps = {},\n VariantProps = {}\n> = ReactComponentWithRef<Props, Ref> & StaticComponentObject\n\ntype StaticComponentObject = {\n staticConfig: StaticConfig\n /*\n * Only needed for more complex components\n * If you create a styled frame component this is a HoC to extract\n * styles from all parents.\n */\n extractable: <X>(a: X, opts?: StaticConfig) => X\n}\n\nexport type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>> & {\n injectCSS?: boolean\n children?: React.ReactNode\n}\n\nexport type StaticConfigParsed = StaticConfig & {\n parsed: true\n propMapper: (\n key: string,\n value: any,\n theme: ThemeObject,\n props: any,\n resolveVariablesAs?: ResolveVariableTypes,\n avoidDefaultProps?: boolean\n ) => undefined | boolean | { [key: string]: any }\n variantsParsed?: {\n [key: string]: {\n [key: string]: any\n }\n }\n}\n\nexport type StaticConfig = {\n Component?: React.FunctionComponent<any> & StaticComponentObject\n\n variants?: {\n [key: string]: {\n [key: string]:\n | ((a: any, b: any) => any)\n | {\n [key: string]: any\n }\n }\n }\n\n /**\n * Used for applying sub theme style\n */\n componentName?: string\n\n /**\n * If you need to pass context or something, prevents from ever\n * flattening. The 'jsx' option means it will never flatten. if you\n * pass JSX as a children (if its purely string, it will still flatten).\n */\n neverFlatten?: boolean | 'jsx'\n\n /**\n * Determines ultimate output tag (Text vs View)\n */\n isText?: boolean\n\n /**\n * Attempts to attach focus styles at runtime (useful for native)\n */\n isInput?: boolean\n\n /**\n * React native web images need special handling for className support\n */\n isImage?: boolean\n\n /**\n * Which style keys are allowed to be extracted.\n */\n validStyles?: { [key: string]: boolean }\n\n /**\n * Same as React.defaultProps, be sure to sync\n */\n defaultProps?: any\n\n /**\n * If these props are encountered, bail on all optimization.\n */\n deoptProps?: Set<string>\n\n /**\n * If these props are encountered, leave them un-extracted.\n */\n inlineProps?: Set<string>\n\n /**\n * A bit odd, only for more advanced heirarchies.\n * Indicates that the component will set this prop so the\n * static extraction can ensure it sets them to ={undefined}\n * so they get overriddent. In the future, this can be smarter.\n */\n ensureOverriddenProp?: { [key: string]: boolean }\n\n /**\n * Auto-detected, but can ovverride. Wraps children to space them on top\n */\n isZStack?: boolean\n\n /**\n * Merges into defaultProps later on, used internally yonly\n */\n defaultVariants?: { [key: string]: any }\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isReactNativeWeb?: boolean\n\n /**\n * Memoize the component\n */\n memo?: boolean\n\n /**\n * Auto-detect, but can ovverride, passes styles properly to react-native-web\n */\n isTamagui?: boolean\n}\n\n/**\n * --------------------------------------------\n * variants\n * --------------------------------------------\n */\n\nexport type StylableComponent =\n | TamaguiComponent\n | React.Component\n | React.ForwardRefExoticComponent<any>\n | (new (props: any) => any)\n | typeof View\n | typeof Text\n | typeof TextInput\n | typeof Image\n\nexport type GetBaseProps<A extends StylableComponent> = A extends TamaguiComponent<\n any,\n any,\n infer BaseProps\n>\n ? BaseProps\n : never\n\nexport type GetProps<A extends StylableComponent> = A extends TamaguiComponent<infer Props>\n ? Props\n : A extends React.Component<infer Props>\n ? GetGenericComponentTamaguiProps<Props>\n : A extends new (props: infer Props) => any\n ? GetGenericComponentTamaguiProps<Props>\n : {}\n\ntype GetGenericComponentTamaguiProps<P> = P &\n Omit<'textAlign' extends keyof P ? TextProps : StackProps, keyof P>\n\nexport type SpreadKeys =\n | '...fontSize'\n | '...size'\n | '...color'\n | '...lineHeight'\n | '...letterSpacing'\n | '...zIndex'\n | '...theme'\n | '...radius'\n\nexport type VariantDefinitions<\n Parent extends StylableComponent = TamaguiComponent,\n MyProps = GetProps<Parent>,\n Val = any\n> = MyProps extends Object\n ? {\n [propName: string]:\n | VariantSpreadFunction<MyProps, Val>\n | {\n [Key in SpreadKeys]?: Key extends '...fontSize'\n ? FontSizeVariantSpreadFunction<MyProps>\n : Key extends '...size'\n ? SizeVariantSpreadFunction<MyProps>\n : Key extends '...color'\n ? ColorVariantSpreadFunction<MyProps>\n : Key extends '...lineHeight'\n ? FontLineHeightVariantSpreadFunction<MyProps>\n : Key extends '...letterSpacing'\n ? FontLetterSpacingVariantSpreadFunction<MyProps>\n : Key extends '...zIndex'\n ? ZIndexVariantSpreadFunction<MyProps>\n : Key extends '...radius'\n ? RadiusVariantSpreadFunction<MyProps>\n : Key extends '...theme'\n ? ThemeVariantSpreadFunction<MyProps>\n : never\n }\n | {\n [Key in string]?: MyProps | VariantSpreadFunction<MyProps, any>\n }\n }\n : never\n\nexport type GetVariantProps<Variants extends Object> = {\n [Key in keyof Variants]?: Variants[Key] extends VariantSpreadFunction<any, infer Val>\n ? Val\n : GetVariantValues<keyof Variants[Key]>\n}\n\nexport type VariantSpreadExtras<Props> = {\n tokens: TamaguiConfig['tokens']\n theme: Themes extends { [key: string]: infer B } ? B : unknown\n props: Props\n}\n\ntype PropLike = { [key: string]: any }\n\nexport type VariantSpreadFunction<Props extends PropLike, Val = any> = (\n val: Val,\n config: VariantSpreadExtras<Props>\n) =>\n | {\n [Key in keyof Props]: Props[Key] | Variable\n }\n | null\n | undefined\n\nexport type GetVariantValues<Key> = Key extends `...${infer VariantSpread}`\n ? ThemeValueByCategory<VariantSpread>\n : Key extends 'true' | 'false'\n ? boolean\n : Key extends ':string'\n ? string\n : Key extends ':boolean'\n ? boolean\n : Key extends ':number'\n ? number\n : Key\n\nexport type FontSizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontSizeTokens\n>\nexport type SizeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, SizeTokens>\nexport type ColorVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ColorTokens>\nexport type FontLineHeightVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontLineHeightTokens\n>\nexport type FontLetterSpacingVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<\n A,\n FontLetterSpacingTokens\n>\nexport type ZIndexVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ZIndexTokens>\nexport type RadiusVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, RadiusTokens>\nexport type ThemeVariantSpreadFunction<A extends PropLike> = VariantSpreadFunction<A, ThemeTokens>\n\n/**\n * --------------------------------------------\n * end variants\n * --------------------------------------------\n */\n\ntype SizeKeys = 'width' | 'height' | 'minWidth' | 'minHeight' | 'maxWidth' | 'maxHeight'\n\ntype FontKeys = 'fontFamily'\n\ntype FontSizeKeys = 'fontSize'\n\ntype FontWeightKeys = 'fontWeight'\n\ntype FontLetterSpacingKeys = 'letterSpacing'\n\ntype LineHeightKeys = 'lineHeight'\n\ntype ZIndexKeys = 'zIndex'\n\ntype ColorKeys =\n | 'color'\n | 'backgroundColor'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderTopColor'\n | 'borderLeftColor'\n | 'borderRightColor'\n | 'shadowColor'\n\ntype SpaceKeys =\n | 'space'\n | 'padding'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingLeft'\n | 'paddingTop'\n | 'paddingBottom'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingEnd'\n | 'paddingStart'\n | 'margin'\n | 'marginHorizontal'\n | 'marginVertical'\n | 'marginLeft'\n | 'marginTop'\n | 'marginBottom'\n | 'marginLeft'\n | 'marginRight'\n | 'marginEnd'\n | 'marginStart'\n | 'x'\n | 'y'\n | 'scale'\n | 'scaleX'\n | 'scaleY'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderTopStartRadius'\n | 'borderBottomEndRadius'\n | 'borderBottomLeftRadius'\n | 'borderBottomRightRadius'\n | 'borderBottomStartRadius'\n | 'borderBottomWidth'\n | 'borderLeftWidth'\n | 'borderRadius'\n | 'borderRightWidth'\n | 'borderTopEndRadius'\n | 'borderTopLeftRadius'\n | 'borderTopRightRadius'\n | 'borderEndWidth'\n | 'borderStartWidth'\n | 'borderTopStartRadius'\n | 'borderTopWidth'\n | 'borderWidth'\n | 'left'\n | 'top'\n | 'right'\n | 'bottom'\n | 'shadowOffset'\n\ntype CSSColorNames =\n | 'aliceblue'\n | 'antiquewhite'\n | 'aqua'\n | 'aquamarine'\n | 'azure'\n | 'beige'\n | 'bisque'\n | 'black'\n | 'blanchedalmond'\n | 'blue'\n | 'blueviolet'\n | 'brown'\n | 'burlywood'\n | 'cadetblue'\n | 'chartreuse'\n | 'chocolate'\n | 'coral'\n | 'cornflowerblue'\n | 'cornsilk'\n | 'crimson'\n | 'cyan'\n | 'darkblue'\n | 'darkcyan'\n | 'darkgoldenrod'\n | 'darkgray'\n | 'darkgreen'\n | 'darkkhaki'\n | 'darkmagenta'\n | 'darkolivegreen'\n | 'darkorange'\n | 'darkorchid'\n | 'darkred'\n | 'darksalmon'\n | 'darkseagreen'\n | 'darkslateblue'\n | 'darkslategray'\n | 'darkturquoise'\n | 'darkviolet'\n | 'deeppink'\n | 'deepskyblue'\n | 'dimgray'\n | 'dodgerblue'\n | 'firebrick'\n | 'floralwhite'\n | 'forestgreen'\n | 'fuchsia'\n | 'gainsboro'\n | 'ghostwhite'\n | 'gold'\n | 'goldenrod'\n | 'gray'\n | 'green'\n | 'greenyellow'\n | 'honeydew'\n | 'hotpink'\n | 'indianred '\n | 'indigo '\n | 'ivory'\n | 'khaki'\n | 'lavender'\n | 'lavenderblush'\n | 'lawngreen'\n | 'lemonchiffon'\n | 'lightblue'\n | 'lightcoral'\n | 'lightcyan'\n | 'lightgoldenrodyellow'\n | 'lightgrey'\n | 'lightgreen'\n | 'lightpink'\n | 'lightsalmon'\n | 'lightseagreen'\n | 'lightskyblue'\n | 'lightslategray'\n | 'lightsteelblue'\n | 'lightyellow'\n | 'lime'\n | 'limegreen'\n | 'linen'\n | 'magenta'\n | 'maroon'\n | 'mediumaquamarine'\n | 'mediumblue'\n | 'mediumorchid'\n | 'mediumpurple'\n | 'mediumseagreen'\n | 'mediumslateblue'\n | 'mediumspringgreen'\n | 'mediumturquoise'\n | 'mediumvioletred'\n | 'midnightblue'\n | 'mintcream'\n | 'mistyrose'\n | 'moccasin'\n | 'navajowhite'\n | 'navy'\n | 'oldlace'\n | 'olive'\n | 'olivedrab'\n | 'orange'\n | 'orangered'\n | 'orchid'\n | 'palegoldenrod'\n | 'palegreen'\n | 'paleturquoise'\n | 'palevioletred'\n | 'papayawhip'\n | 'peachpuff'\n | 'peru'\n | 'pink'\n | 'plum'\n | 'powderblue'\n | 'purple'\n | 'red'\n | 'rosybrown'\n | 'royalblue'\n | 'saddlebrown'\n | 'salmon'\n | 'sandybrown'\n | 'seagreen'\n | 'seashell'\n | 'sienna'\n | 'silver'\n | 'skyblue'\n | 'slateblue'\n | 'slategray'\n | 'snow'\n | 'springgreen'\n | 'steelblue'\n | 'tan'\n | 'teal'\n | 'thistle'\n | 'tomato'\n | 'turquoise'\n | 'violet'\n | 'wheat'\n | 'white'\n | 'whitesmoke'\n | 'yellow'\n | 'yellowgreen'\n\nexport type TamaguiComponentState = {\n hover: boolean\n press: boolean\n pressIn: boolean\n focus: boolean\n mounted: boolean\n animation?: null | {\n style?: any\n avoidClasses?: boolean\n }\n}\n\nexport type SplitStyleState = TamaguiComponentState & {\n noClassNames?: boolean\n resolveVariablesAs?: ResolveVariableTypes\n fallbackProps?: Object\n}\n\n// Animations:\n\ntype AnimationConfig = {\n [key: string]: any\n}\n\nexport type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {\n avoidClasses?: boolean\n useAnimations: UseAnimationHook\n animations: A\n View?: any\n Text?: any\n}\n\nexport type UseAnimationProps = TamaguiComponentPropsBase &\n Record<string, any> & {\n animation: string\n }\n\nexport type UseAnimationHelpers = {\n staticConfig: StaticConfigParsed\n getStyle: (props?: {\n isEntering?: boolean\n exitVariant?: string | null\n enterVariant?: string | null\n }) => ViewStyle\n state: SplitStyleState\n pseudos: PseudoProps<ViewStyle>\n // style: ViewStyle | null | undefined\n // isMounted: boolean\n // exitStyle?: ViewStyle | null\n onDidAnimate?: any\n delay?: number\n // mergedStyles(props?: { isExiting?: boolean }): ViewStyle\n}\n\nexport type UseAnimationHook = (\n props: UseAnimationProps,\n helpers: UseAnimationHelpers\n) => {\n style?: StackStylePropsBase | StackStylePropsBase[]\n safeToUnmount?: () => void\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/views/Stack.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
6
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
8
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
9
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -21,29 +19,28 @@ var __spreadValues = (a, b) => {
|
|
|
21
19
|
return a;
|
|
22
20
|
};
|
|
23
21
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
22
|
var __export = (target, all) => {
|
|
26
|
-
__markAsModule(target);
|
|
27
23
|
for (var name in all)
|
|
28
24
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
29
25
|
};
|
|
30
|
-
var
|
|
31
|
-
if (
|
|
32
|
-
for (let key of __getOwnPropNames(
|
|
33
|
-
if (!__hasOwnProp.call(
|
|
34
|
-
__defProp(
|
|
26
|
+
var __copyProps = (to, from, except, desc) => {
|
|
27
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(from))
|
|
29
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
35
31
|
}
|
|
36
|
-
return
|
|
32
|
+
return to;
|
|
37
33
|
};
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
__export(exports, {
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
var Stack_exports = {};
|
|
36
|
+
__export(Stack_exports, {
|
|
42
37
|
Stack: () => Stack
|
|
43
38
|
});
|
|
44
|
-
|
|
45
|
-
var
|
|
39
|
+
module.exports = __toCommonJS(Stack_exports);
|
|
40
|
+
var import_constants = require("../constants/constants");
|
|
41
|
+
var import_createComponent = require("../createComponent");
|
|
46
42
|
const Stack = (0, import_createComponent.createComponent)({
|
|
43
|
+
componentName: "Stack",
|
|
47
44
|
defaultProps: __spreadProps(__spreadValues({}, import_constants.stackDefaultStyles), {
|
|
48
45
|
flexDirection: "column"
|
|
49
46
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Stack.tsx"],
|
|
4
|
-
"sourcesContent": ["import { stackDefaultStyles } from '../constants/constants'\nimport { createComponent } from '../createComponent'\nimport { StackProps } from '../types'\n\nexport const Stack = createComponent<StackProps>({\n defaultProps: {\n ...stackDefaultStyles,\n flexDirection: 'column',\n },\n})\n\n// test types\n// export const YStack = styled(Stack, {\n// flexDirection: 'column',\n// })\n// // test types\n// const x00 = <Stack missing={0} /> // should err\n// const x0 = <YStack missing={0} /> // should err\n// const x1 = (props: StackProps) => <YStack {...props} />\n// type ys = typeof YStack\n// type ysv = ys extends StaticComponent<any, infer V> ? V : unknown\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { View } from 'react-native'\n\nimport { stackDefaultStyles } from '../constants/constants'\nimport { createComponent } from '../createComponent'\nimport { StackProps, StackPropsBase } from '../types'\n\nexport const Stack = createComponent<StackProps, View, StackPropsBase>({\n componentName: 'Stack',\n defaultProps: {\n ...stackDefaultStyles,\n flexDirection: 'column',\n },\n})\n\n// test types\n// export const YStack = styled(Stack, {\n// flexDirection: 'column',\n// })\n// // test types\n// const x00 = <Stack missing={0} /> // should err\n// const x0 = <YStack missing={0} /> // should err\n// const x1 = (props: StackProps) => <YStack {...props} />\n// type ys = typeof YStack\n// type ysv = ys extends StaticComponent<any, infer V> ? V : unknown\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAAmC;AACnC,6BAAgC;AAGzB,MAAM,QAAQ,4CAAkD;AAAA,EACrE,eAAe;AAAA,EACf,cAAc,iCACT,sCADS;AAAA,IAEZ,eAAe;AAAA,EACjB;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/views/Text.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -18,29 +16,27 @@ var __spreadValues = (a, b) => {
|
|
|
18
16
|
}
|
|
19
17
|
return a;
|
|
20
18
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
19
|
var __export = (target, all) => {
|
|
23
|
-
__markAsModule(target);
|
|
24
20
|
for (var name in all)
|
|
25
21
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
22
|
};
|
|
27
|
-
var
|
|
28
|
-
if (
|
|
29
|
-
for (let key of __getOwnPropNames(
|
|
30
|
-
if (!__hasOwnProp.call(
|
|
31
|
-
__defProp(
|
|
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 });
|
|
32
28
|
}
|
|
33
|
-
return
|
|
29
|
+
return to;
|
|
34
30
|
};
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
__export(exports, {
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
var Text_exports = {};
|
|
33
|
+
__export(Text_exports, {
|
|
39
34
|
Text: () => Text
|
|
40
35
|
});
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
var
|
|
36
|
+
module.exports = __toCommonJS(Text_exports);
|
|
37
|
+
var import_helpers = require("@tamagui/helpers");
|
|
38
|
+
var import_platform = require("../constants/platform");
|
|
39
|
+
var import_createComponent = require("../createComponent");
|
|
44
40
|
const ellipseStyle = {
|
|
45
41
|
maxWidth: "100%",
|
|
46
42
|
overflow: "hidden",
|
|
@@ -48,9 +44,10 @@ const ellipseStyle = {
|
|
|
48
44
|
whiteSpace: "nowrap"
|
|
49
45
|
};
|
|
50
46
|
const Text = (0, import_createComponent.createComponent)({
|
|
47
|
+
componentName: "Text",
|
|
51
48
|
isText: true,
|
|
52
49
|
defaultProps: {
|
|
53
|
-
display: import_platform.isWeb ? "inline" : "
|
|
50
|
+
display: import_platform.isWeb ? "inline" : "flex",
|
|
54
51
|
boxSizing: "border-box",
|
|
55
52
|
fontFamily: "System",
|
|
56
53
|
wordWrap: "break-word"
|
|
@@ -58,11 +55,12 @@ const Text = (0, import_createComponent.createComponent)({
|
|
|
58
55
|
variants: {
|
|
59
56
|
numberOfLines: {
|
|
60
57
|
1: ellipseStyle,
|
|
61
|
-
"
|
|
58
|
+
":number": (lines) => lines > 1 ? { WebkitLineClamp: 1 } : null
|
|
62
59
|
},
|
|
63
60
|
selectable: {
|
|
64
61
|
true: {
|
|
65
|
-
userSelect: "text"
|
|
62
|
+
userSelect: "text",
|
|
63
|
+
cursor: "text"
|
|
66
64
|
},
|
|
67
65
|
false: {
|
|
68
66
|
userSelect: "none"
|
|
@@ -81,7 +79,7 @@ const Text = (0, import_createComponent.createComponent)({
|
|
|
81
79
|
}
|
|
82
80
|
},
|
|
83
81
|
deoptProps: new Set(import_platform.isWeb ? [] : ["ellipse"]),
|
|
84
|
-
validStyles: __spreadValues(__spreadValues(__spreadValues({},
|
|
82
|
+
validStyles: __spreadValues(__spreadValues(__spreadValues({}, import_helpers.validStyles), import_helpers.stylePropsTextOnly), import_platform.isWeb && {
|
|
85
83
|
userSelect: true,
|
|
86
84
|
textOverflow: true,
|
|
87
85
|
whiteSpace: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Text.tsx"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { stylePropsTextOnly, validStyles } from '@tamagui/helpers'\nimport { Text as TextView } from 'react-native'\n\nimport { isWeb } from '../constants/platform'\nimport { createComponent } from '../createComponent'\nimport { TextProps, TextPropsBase } from '../types'\n\nconst ellipseStyle = {\n maxWidth: '100%',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}\n\nexport const Text = createComponent<TextProps, TextView, TextPropsBase>({\n componentName: 'Text',\n isText: true,\n defaultProps: {\n display: isWeb ? 'inline' : 'flex',\n boxSizing: 'border-box',\n fontFamily: 'System',\n wordWrap: 'break-word',\n },\n variants: {\n numberOfLines: {\n 1: ellipseStyle,\n // TODO imply fn, test 1, could do types `>1` `<2`\n ':number': (lines) => (lines > 1 ? { WebkitLineClamp: 1 } : null),\n },\n\n selectable: {\n true: {\n userSelect: 'text',\n cursor: 'text',\n },\n false: {\n userSelect: 'none',\n },\n },\n\n pressable: {\n true: {\n cursor: 'pointer',\n },\n },\n\n ellipse: {\n true: isWeb\n ? ellipseStyle\n : {\n numberOfLines: 1,\n lineBreakMode: 'clip',\n },\n },\n },\n deoptProps: new Set(isWeb ? [] : ['ellipse']),\n validStyles: {\n ...validStyles,\n ...stylePropsTextOnly,\n ...(isWeb && {\n userSelect: true,\n textOverflow: true,\n whiteSpace: true,\n wordWrap: true,\n selectable: true,\n cursor: true,\n }),\n },\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAgD;AAGhD,sBAAsB;AACtB,6BAAgC;AAGhC,MAAM,eAAe;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;AACd;AAEO,MAAM,OAAO,4CAAoD;AAAA,EACtE,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,cAAc;AAAA,IACZ,SAAS,wBAAQ,WAAW;AAAA,IAC5B,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,eAAe;AAAA,MACb,GAAG;AAAA,MAEH,WAAW,CAAC,UAAW,QAAQ,IAAI,EAAE,iBAAiB,EAAE,IAAI;AAAA,IAC9D;AAAA,IAEA,YAAY;AAAA,MACV,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,QACJ,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IAEA,SAAS;AAAA,MACP,MAAM,wBACF,eACA;AAAA,QACE,eAAe;AAAA,QACf,eAAe;AAAA,MACjB;AAAA,IACN;AAAA,EACF;AAAA,EACA,YAAY,IAAI,IAAI,wBAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;AAAA,EAC5C,aAAa,iDACR,6BACA,oCACC,yBAAS;AAAA,IACX,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,QAAQ;AAAA,EACV;AAEJ,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,38 +4,36 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
8
|
var __export = (target, all) => {
|
|
10
|
-
__markAsModule(target);
|
|
11
9
|
for (var name in all)
|
|
12
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
11
|
};
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
for (let key of __getOwnPropNames(
|
|
17
|
-
if (!__hasOwnProp.call(
|
|
18
|
-
__defProp(
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
17
|
}
|
|
20
|
-
return
|
|
18
|
+
return to;
|
|
21
19
|
};
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
__export(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var TextAncestorContext_exports = {};
|
|
23
|
+
__export(TextAncestorContext_exports, {
|
|
24
|
+
FallbackNativeContext: () => FallbackNativeContext,
|
|
26
25
|
TextAncestorContext: () => TextAncestorContext,
|
|
27
26
|
TextAncestorProvider: () => TextAncestorProvider
|
|
28
27
|
});
|
|
29
|
-
|
|
30
|
-
var
|
|
28
|
+
module.exports = __toCommonJS(TextAncestorContext_exports);
|
|
29
|
+
var import_react = __toESM(require("react"));
|
|
30
|
+
var import_rnw = require("../constants/rnw");
|
|
31
31
|
var _a;
|
|
32
|
-
const
|
|
32
|
+
const FallbackNativeContext = (0, import_react.createContext)(false);
|
|
33
|
+
const TextAncestorContext = ((_a = import_rnw.rnw) == null ? void 0 : _a.TextAncestorContext) ?? FallbackNativeContext;
|
|
33
34
|
const TextAncestorProvider = /* @__PURE__ */ __name((props) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, props.children);
|
|
38
|
-
}
|
|
39
|
-
return props.children;
|
|
35
|
+
return /* @__PURE__ */ import_react.default.createElement(TextAncestorContext.Provider, {
|
|
36
|
+
value: false
|
|
37
|
+
}, props.children);
|
|
40
38
|
}, "TextAncestorProvider");
|
|
41
39
|
//# sourceMappingURL=TextAncestorContext.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/TextAncestorContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\nimport { rnw } from '../constants/rnw'\n\nexport const TextAncestorContext = rnw?.TextAncestorContext\n\nexport const TextAncestorProvider = (props) => {\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React, { createContext } from 'react'\n\nimport { rnw } from '../constants/rnw'\n\nexport const FallbackNativeContext = createContext(false)\n\nexport const TextAncestorContext = rnw?.TextAncestorContext ?? FallbackNativeContext\n\nexport const TextAncestorProvider = (props) => {\n return <TextAncestorContext.Provider value={false}>{props.children}</TextAncestorContext.Provider>\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAErC,iBAAoB;AAFpB;AAIO,MAAM,wBAAwB,gCAAc,KAAK;AAEjD,MAAM,sBAAsB,6CAAK,wBAAuB;AAExD,MAAM,uBAAuB,wBAAC,UAAU;AAC7C,SAAO,mDAAC,oBAAoB,UAApB;AAAA,IAA6B,OAAO;AAAA,KAAQ,MAAM,QAAS;AACrE,GAFoC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/views/Theme.js
CHANGED
|
@@ -4,85 +4,53 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
8
|
var __export = (target, all) => {
|
|
10
|
-
__markAsModule(target);
|
|
11
9
|
for (var name in all)
|
|
12
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
11
|
};
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
for (let key of __getOwnPropNames(
|
|
17
|
-
if (!__hasOwnProp.call(
|
|
18
|
-
__defProp(
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
17
|
}
|
|
20
|
-
return
|
|
18
|
+
return to;
|
|
21
19
|
};
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
__export(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var Theme_exports = {};
|
|
23
|
+
__export(Theme_exports, {
|
|
26
24
|
Theme: () => Theme
|
|
27
25
|
});
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
const Theme = /* @__PURE__ */ __name((props)
|
|
26
|
+
module.exports = __toCommonJS(Theme_exports);
|
|
27
|
+
var import_react = __toESM(require("react"));
|
|
28
|
+
var import_platform = require("../constants/platform");
|
|
29
|
+
var import_wrapThemeManagerContext = require("../helpers/wrapThemeManagerContext");
|
|
30
|
+
var import_static = require("../static");
|
|
31
|
+
import_react.default["createElement"];
|
|
32
|
+
const Theme = (0, import_react.memo)(/* @__PURE__ */ __name(function Theme2(props) {
|
|
35
33
|
var _a, _b;
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
console.warn("Error, no themes in context", props);
|
|
41
|
-
return props.children;
|
|
42
|
-
}
|
|
43
|
-
const name = props.name;
|
|
44
|
-
const nextNameParent = `${name}-${parentName}`;
|
|
45
|
-
const nextNameParentParent = `${name}-${parent.parentName}`;
|
|
46
|
-
const activeName = !name ? null : name in themes ? name : nextNameParent in themes ? nextNameParent : nextNameParentParent in themes ? nextNameParentParent : null;
|
|
47
|
-
const theme = activeName ? themes[activeName] : null;
|
|
48
|
-
const themeManager = (0, import_useConstant.useConstant)(() => {
|
|
49
|
-
if (!theme) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
const manager = new import_ThemeManagerContext.ThemeManager();
|
|
53
|
-
if (name) {
|
|
54
|
-
manager.setActiveTheme({ name, theme: themes[name], parentName });
|
|
34
|
+
const { name, theme, themeManager, themes, className } = (0, import_static.useChangeThemeEffect)(props.name, void 0, props);
|
|
35
|
+
if (!themes || !name || !theme) {
|
|
36
|
+
if (name && !theme && process.env.NODE_ENV === "development") {
|
|
37
|
+
console.warn(`No theme found by name ${name}`);
|
|
55
38
|
}
|
|
56
|
-
return manager;
|
|
57
|
-
});
|
|
58
|
-
(0, import_platform.useIsomorphicLayoutEffect)(() => {
|
|
59
|
-
if (!themeManager) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
themeManager.setActiveTheme({ name: activeName, theme, parentName });
|
|
63
|
-
return parent.onChangeTheme((next) => {
|
|
64
|
-
if (next) {
|
|
65
|
-
themeManager.setActiveTheme({ name: next, theme: themes[next], parentName });
|
|
66
|
-
setParentName(next);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}, [themes, activeName, parentName]);
|
|
70
|
-
if (!name || !theme) {
|
|
71
39
|
return props.children;
|
|
72
40
|
}
|
|
73
|
-
const contents =
|
|
74
|
-
value: themeManager
|
|
75
|
-
}, props.children) : props.children;
|
|
41
|
+
const contents = (0, import_react.useMemo)(() => (0, import_wrapThemeManagerContext.wrapThemeManagerContext)(props.children, themeManager), [props.children, themeManager]);
|
|
76
42
|
if (import_platform.isWeb) {
|
|
77
|
-
if (props.disableThemeClass) {
|
|
78
|
-
return contents;
|
|
79
|
-
}
|
|
80
|
-
const color = (_b = (_a = themes[name]) == null ? void 0 : _a["color"]) == null ? void 0 : _b["variable"];
|
|
81
43
|
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
82
|
-
className:
|
|
83
|
-
|
|
44
|
+
className: [
|
|
45
|
+
`tui_Theme`,
|
|
46
|
+
...!props.disableThemeClass ? [props.className, className].filter(Boolean) : []
|
|
47
|
+
].join(" "),
|
|
48
|
+
style: {
|
|
49
|
+
display: "contents",
|
|
50
|
+
color: (_b = (_a = themes[name]) == null ? void 0 : _a.color) == null ? void 0 : _b.toString()
|
|
51
|
+
}
|
|
84
52
|
}, contents);
|
|
85
53
|
}
|
|
86
54
|
return contents;
|
|
87
|
-
}, "Theme");
|
|
55
|
+
}, "Theme"));
|
|
88
56
|
//# sourceMappingURL=Theme.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Theme.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React, { memo, useMemo } from 'react'\n\nimport { isWeb } from '../constants/platform'\nimport { wrapThemeManagerContext } from '../helpers/wrapThemeManagerContext'\nimport { useChangeThemeEffect } from '../static'\nimport { ThemeName } from '../types'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\nexport type ThemeProps = {\n className?: string\n disableThemeClass?: boolean\n name: Exclude<ThemeName, number> | null\n children?: any\n debug?: boolean\n}\n\nexport const Theme = memo(function Theme(props: ThemeProps) {\n const { name, theme, themeManager, themes, className } = useChangeThemeEffect(\n props.name,\n undefined,\n props\n )\n\n if (!themes || !name || !theme) {\n if (name && !theme && process.env.NODE_ENV === 'development') {\n console.warn(`No theme found by name ${name}`)\n }\n return props.children\n }\n\n // memo here, changing theme without re-rendering all children is a critical optimization\n // may require some effort of end user to memoize but without this memo they'd have no option\n const contents = useMemo(\n () => wrapThemeManagerContext(props.children, themeManager),\n [props.children, themeManager]\n )\n\n if (isWeb) {\n return (\n <div\n className={[\n `tui_Theme`,\n ...(!props.disableThemeClass ? [props.className, className].filter(Boolean) : []),\n ].join(' ')}\n style={{\n display: 'contents',\n // in order to provide currentColor, set color by default\n color: themes[name]?.color?.toString(),\n }}\n >\n {contents}\n </div>\n )\n }\n\n return contents\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAErC,sBAAsB;AACtB,qCAAwC;AACxC,oBAAqC;AAIrC,qBAAM;AAUC,MAAM,QAAQ,uBAAK,uCAAe,OAAmB;AAlB5D;AAmBE,QAAM,EAAE,MAAM,OAAO,cAAc,QAAQ,cAAc,wCACvD,MAAM,MACN,QACA,KACF;AAEA,MAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO;AAC9B,QAAI,QAAQ,CAAC,SAAS,QAAQ,IAAI,aAAa,eAAe;AAC5D,cAAQ,KAAK,0BAA0B,MAAM;AAAA,IAC/C;AACA,WAAO,MAAM;AAAA,EACf;AAIA,QAAM,WAAW,0BACf,MAAM,4DAAwB,MAAM,UAAU,YAAY,GAC1D,CAAC,MAAM,UAAU,YAAY,CAC/B;AAEA,MAAI,uBAAO;AACT,WACE,mDAAC;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,GAAI,CAAC,MAAM,oBAAoB,CAAC,MAAM,WAAW,SAAS,EAAE,OAAO,OAAO,IAAI,CAAC;AAAA,MACjF,EAAE,KAAK,GAAG;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,QAET,OAAO,mBAAO,UAAP,mBAAc,UAAd,mBAAqB;AAAA,MAC9B;AAAA,OAEC,QACH;AAAA,EAEJ;AAEA,SAAO;AACT,GAxC0B,QAwCzB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,31 +4,30 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
8
|
var __export = (target, all) => {
|
|
10
|
-
__markAsModule(target);
|
|
11
9
|
for (var name in all)
|
|
12
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
11
|
};
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
for (let key of __getOwnPropNames(
|
|
17
|
-
if (!__hasOwnProp.call(
|
|
18
|
-
__defProp(
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
17
|
}
|
|
20
|
-
return
|
|
18
|
+
return to;
|
|
21
19
|
};
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
__export(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var ThemeInverse_exports = {};
|
|
23
|
+
__export(ThemeInverse_exports, {
|
|
26
24
|
ThemeInverse: () => ThemeInverse,
|
|
27
25
|
setThemeInversions: () => setThemeInversions
|
|
28
26
|
});
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
var
|
|
27
|
+
module.exports = __toCommonJS(ThemeInverse_exports);
|
|
28
|
+
var import_react = __toESM(require("react"));
|
|
29
|
+
var import_useTheme = require("../hooks/useTheme");
|
|
30
|
+
var import_Theme = require("./Theme");
|
|
32
31
|
let inversions = {
|
|
33
32
|
light: "dark",
|
|
34
33
|
dark: "light"
|
|
@@ -40,7 +39,7 @@ __name(setThemeInversions, "setThemeInversions");
|
|
|
40
39
|
const ThemeInverse = /* @__PURE__ */ __name((props) => {
|
|
41
40
|
const themeName = (0, import_useTheme.useThemeName)();
|
|
42
41
|
const defaultTheme = (0, import_useTheme.useDefaultThemeName)();
|
|
43
|
-
const name = inversions[themeName] || inversions[defaultTheme] || null;
|
|
42
|
+
const name = inversions[themeName] || inversions[defaultTheme || ""] || null;
|
|
44
43
|
return /* @__PURE__ */ import_react.default.createElement(import_Theme.Theme, {
|
|
45
44
|
name
|
|
46
45
|
}, props.children);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/ThemeInverse.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\nimport { useDefaultThemeName, useThemeName } from '../hooks/useTheme'\nimport { Theme } from './Theme'\n\ntype StringRecord = { [key: string]: string }\n\nlet inversions: StringRecord = {\n light: 'dark',\n dark: 'light',\n}\n\nexport function setThemeInversions(next: StringRecord) {\n inversions = next\n}\n\nexport const ThemeInverse = (props: { children: any }) => {\n const themeName = useThemeName()\n const defaultTheme = useDefaultThemeName()\n const name = inversions[themeName] || inversions[defaultTheme] || null\n return <Theme name={name}>{props.children}</Theme>\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React from 'react'\n\nimport { useDefaultThemeName, useThemeName } from '../hooks/useTheme'\nimport { Theme } from './Theme'\n\ntype StringRecord = { [key: string]: string }\n\nlet inversions: StringRecord = {\n light: 'dark',\n dark: 'light',\n}\n\nexport function setThemeInversions(next: StringRecord) {\n inversions = next\n}\n\nexport const ThemeInverse = (props: { children: any }) => {\n const themeName = useThemeName()\n const defaultTheme = useDefaultThemeName()\n const name = inversions[themeName] || inversions[defaultTheme || ''] || null\n return <Theme name={name}>{props.children}</Theme>\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,sBAAkD;AAClD,mBAAsB;AAItB,IAAI,aAA2B;AAAA,EAC7B,OAAO;AAAA,EACP,MAAM;AACR;AAEO,4BAA4B,MAAoB;AACrD,eAAa;AACf;AAFgB;AAIT,MAAM,eAAe,wBAAC,UAA6B;AACxD,QAAM,YAAY,kCAAa;AAC/B,QAAM,eAAe,yCAAoB;AACzC,QAAM,OAAO,WAAW,cAAc,WAAW,gBAAgB,OAAO;AACxE,SAAO,mDAAC;AAAA,IAAM;AAAA,KAAa,MAAM,QAAS;AAC5C,GAL4B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|