@tamagui/web 1.114.3 → 1.115.0
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.cjs +80 -0
- package/dist/cjs/_withStableStyle.cjs +51 -0
- package/dist/cjs/config.cjs +111 -0
- package/dist/cjs/constants/{accessibilityDirectMap.js → accessibilityDirectMap.cjs} +19 -11
- package/dist/cjs/constants/accessibilityDirectMap.native.cjs +34 -0
- package/dist/cjs/constants/accessibilityDirectMap.native.cjs.map +6 -0
- package/dist/cjs/constants/constants.cjs +45 -0
- package/dist/cjs/constants/isDevTools.cjs +31 -0
- package/dist/cjs/constants/webToNativeProps.cjs +28 -0
- package/dist/cjs/constants/webToNativeProps.native.cjs +102 -0
- package/dist/cjs/constants/webToNativeProps.native.cjs.map +6 -0
- package/dist/cjs/contexts/{ComponentContext.js → ComponentContext.cjs} +17 -12
- package/dist/cjs/{createComponent.js → createComponent.cjs} +407 -317
- package/dist/cjs/createFont.cjs +42 -0
- package/dist/cjs/createShorthands.cjs +28 -0
- package/dist/cjs/createTamagui.cjs +235 -0
- package/dist/cjs/createTheme.cjs +26 -0
- package/dist/cjs/createTokens.cjs +29 -0
- package/dist/cjs/{createVariable.js → createVariable.cjs} +31 -24
- package/dist/cjs/createVariables.cjs +58 -0
- package/dist/cjs/defaultComponentState.cjs +44 -0
- package/dist/cjs/helpers/ThemeManager.cjs +184 -0
- package/dist/cjs/helpers/{ThemeManagerContext.js → ThemeManagerContext.cjs} +22 -14
- package/dist/cjs/helpers/createMediaStyle.cjs +96 -0
- package/dist/cjs/helpers/{createShallowSetState.js → createShallowSetState.cjs} +29 -22
- package/dist/cjs/helpers/createStyledContext.cjs +70 -0
- package/dist/cjs/helpers/defaultOffset.cjs +29 -0
- package/dist/cjs/helpers/expandStyle.cjs +67 -0
- package/dist/cjs/helpers/expandStyles.cjs +40 -0
- package/dist/cjs/helpers/getExpandedShorthands.cjs +33 -0
- package/dist/cjs/helpers/getFontLanguage.cjs +26 -0
- package/dist/cjs/helpers/getGroupPropParts.cjs +37 -0
- package/dist/cjs/helpers/{getSplitStyles.js → getSplitStyles.cjs} +362 -335
- package/dist/cjs/helpers/getStylesAtomic.cjs +176 -0
- package/dist/cjs/helpers/getStylesAtomic.native.cjs +33 -0
- package/dist/cjs/helpers/getStylesAtomic.native.cjs.map +6 -0
- package/dist/cjs/helpers/getThemeCSSRules.cjs +119 -0
- package/dist/cjs/helpers/getThemeCSSRules.native.cjs +28 -0
- package/dist/cjs/helpers/getThemeCSSRules.native.cjs.map +6 -0
- package/dist/cjs/helpers/getVariantExtras.cjs +65 -0
- package/dist/cjs/helpers/{insertStyleRule.js → insertStyleRule.cjs} +93 -96
- package/dist/cjs/helpers/isActivePlatform.cjs +35 -0
- package/dist/cjs/helpers/isObj.cjs +26 -0
- package/dist/cjs/helpers/isTamaguiComponent.cjs +29 -0
- package/dist/cjs/helpers/{isTamaguiElement.js → isTamaguiElement.cjs} +24 -15
- package/dist/cjs/helpers/log.cjs +36 -0
- package/dist/cjs/helpers/matchMedia.cjs +36 -0
- package/dist/cjs/helpers/matchMedia.native.cjs +39 -0
- package/dist/cjs/helpers/matchMedia.native.cjs.map +6 -0
- package/dist/cjs/helpers/mergeProps.cjs +45 -0
- package/dist/cjs/helpers/{mergeVariants.js → mergeVariants.cjs} +19 -17
- package/dist/cjs/helpers/normalizeColor.cjs +48 -0
- package/dist/cjs/helpers/{normalizeShadow.js → normalizeShadow.cjs} +22 -13
- package/dist/cjs/helpers/normalizeStyle.cjs +47 -0
- package/dist/cjs/helpers/normalizeStylePropKeys.cjs +26 -0
- package/dist/cjs/helpers/normalizeStylePropKeys.native.cjs +37 -0
- package/dist/cjs/helpers/normalizeStylePropKeys.native.cjs.map +6 -0
- package/dist/cjs/helpers/{normalizeValueWithProperty.js → normalizeValueWithProperty.cjs} +22 -19
- package/dist/cjs/helpers/objectIdentityKey.cjs +39 -0
- package/dist/cjs/helpers/propMapper.cjs +254 -0
- package/dist/cjs/helpers/proxyThemeToParents.cjs +61 -0
- package/dist/cjs/helpers/{proxyThemeVariables.js → proxyThemeVariables.cjs} +16 -11
- package/dist/cjs/helpers/pseudoDescriptors.cjs +72 -0
- package/dist/cjs/helpers/registerCSSVariable.cjs +33 -0
- package/dist/cjs/helpers/setElementProps.cjs +29 -0
- package/dist/cjs/helpers/setElementProps.native.cjs +30 -0
- package/dist/cjs/helpers/setElementProps.native.cjs.map +6 -0
- package/dist/cjs/helpers/{skipProps.js → skipProps.cjs} +17 -12
- package/dist/cjs/helpers/sortString.cjs +26 -0
- package/dist/cjs/helpers/{subscribeToContextGroup.js → subscribeToContextGroup.cjs} +25 -17
- package/dist/cjs/helpers/themeable.cjs +83 -0
- package/dist/cjs/helpers/{themes.js → themes.cjs} +17 -12
- package/dist/cjs/helpers/timer.cjs +32 -0
- package/dist/cjs/helpers/transformsToString.cjs +37 -0
- package/dist/cjs/helpers/webPropsToSkip.cjs +26 -0
- package/dist/cjs/helpers/webPropsToSkip.native.cjs +79 -0
- package/dist/cjs/helpers/webPropsToSkip.native.cjs.map +6 -0
- package/dist/cjs/helpers/wrapStyleTags.cjs +40 -0
- package/dist/cjs/hooks/{useComponentState.js → useComponentState.cjs} +75 -30
- package/dist/cjs/hooks/useConfiguration.cjs +55 -0
- package/dist/cjs/hooks/{useDidHydrateOnce.js → useDidHydrateOnce.cjs} +27 -16
- package/dist/cjs/hooks/useDisableSSR.cjs +29 -0
- package/dist/cjs/hooks/useIsTouchDevice.cjs +28 -0
- package/dist/cjs/hooks/useMedia.cjs +227 -0
- package/dist/cjs/hooks/useProps.cjs +108 -0
- package/dist/cjs/hooks/useTheme.cjs +277 -0
- package/dist/cjs/hooks/useThemeName.cjs +50 -0
- package/dist/cjs/index.cjs +106 -0
- package/dist/cjs/inject-styles.cjs +37 -0
- package/dist/cjs/insertFont.cjs +72 -0
- package/dist/cjs/interfaces/CSSColorNames.cjs +16 -0
- package/dist/cjs/interfaces/GetRef.cjs +16 -0
- package/dist/cjs/interfaces/KeyTypes.cjs +16 -0
- package/dist/cjs/interfaces/RNExclusiveTypes.cjs +16 -0
- package/dist/cjs/interfaces/Role.cjs +16 -0
- package/dist/cjs/interfaces/TamaguiComponentEvents.cjs +16 -0
- package/dist/cjs/interfaces/{TamaguiComponentPropsBaseBase.js → TamaguiComponentPropsBaseBase.cjs} +8 -6
- package/dist/cjs/interfaces/TamaguiComponentState.cjs +16 -0
- package/dist/cjs/interfaces/WebOnlyPressEvents.cjs +16 -0
- package/dist/cjs/setupHooks.cjs +30 -0
- package/dist/cjs/setupReactNative.cjs +49 -0
- package/dist/cjs/styled.cjs +87 -0
- package/dist/cjs/type-utils.cjs +16 -0
- package/dist/cjs/types.cjs +19 -0
- package/dist/cjs/views/Configuration.cjs +47 -0
- package/dist/cjs/views/FontLanguage.cjs +37 -0
- package/dist/cjs/views/FontLanguage.native.cjs +50 -0
- package/dist/cjs/views/FontLanguage.native.cjs.map +6 -0
- package/dist/cjs/views/FontLanguage.types.cjs +16 -0
- package/dist/cjs/views/Slot.cjs +78 -0
- package/dist/cjs/views/Stack.cjs +34 -0
- package/dist/cjs/views/TamaguiProvider.cjs +93 -0
- package/dist/cjs/views/Text.cjs +86 -0
- package/dist/cjs/views/Theme.cjs +145 -0
- package/dist/cjs/views/ThemeDebug.cjs +92 -0
- package/dist/cjs/views/ThemeDebug.native.cjs +33 -0
- package/dist/cjs/views/ThemeDebug.native.cjs.map +6 -0
- package/dist/cjs/views/ThemeProvider.cjs +56 -0
- package/dist/cjs/views/View.cjs +33 -0
- package/package.json +15 -14
- package/dist/cjs/Tamagui.js +0 -63
- package/dist/cjs/_withStableStyle.js +0 -33
- package/dist/cjs/config.js +0 -97
- package/dist/cjs/constants/constants.js +0 -36
- package/dist/cjs/constants/isDevTools.js +0 -28
- package/dist/cjs/constants/webToNativeProps.js +0 -22
- package/dist/cjs/createFont.js +0 -53
- package/dist/cjs/createShorthands.js +0 -23
- package/dist/cjs/createTamagui.js +0 -189
- package/dist/cjs/createTheme.js +0 -21
- package/dist/cjs/createTokens.js +0 -24
- package/dist/cjs/createVariables.js +0 -47
- package/dist/cjs/defaultComponentState.js +0 -37
- package/dist/cjs/helpers/ThemeManager.js +0 -166
- package/dist/cjs/helpers/createMediaStyle.js +0 -74
- package/dist/cjs/helpers/createStyledContext.js +0 -53
- package/dist/cjs/helpers/defaultOffset.js +0 -21
- package/dist/cjs/helpers/expandStyle.js +0 -73
- package/dist/cjs/helpers/expandStyles.js +0 -34
- package/dist/cjs/helpers/getExpandedShorthands.js +0 -29
- package/dist/cjs/helpers/getFontLanguage.js +0 -21
- package/dist/cjs/helpers/getGroupPropParts.js +0 -27
- package/dist/cjs/helpers/getStylesAtomic.js +0 -152
- package/dist/cjs/helpers/getThemeCSSRules.js +0 -89
- package/dist/cjs/helpers/getVariantExtras.js +0 -58
- package/dist/cjs/helpers/isActivePlatform.js +0 -29
- package/dist/cjs/helpers/isObj.js +0 -21
- package/dist/cjs/helpers/isTamaguiComponent.js +0 -24
- package/dist/cjs/helpers/log.js +0 -31
- package/dist/cjs/helpers/matchMedia.js +0 -34
- package/dist/cjs/helpers/mergeProps.js +0 -41
- package/dist/cjs/helpers/normalizeColor.js +0 -43
- package/dist/cjs/helpers/normalizeStyle.js +0 -36
- package/dist/cjs/helpers/normalizeStylePropKeys.js +0 -21
- package/dist/cjs/helpers/objectIdentityKey.js +0 -38
- package/dist/cjs/helpers/propMapper.js +0 -238
- package/dist/cjs/helpers/proxyThemeToParents.js +0 -52
- package/dist/cjs/helpers/pseudoDescriptors.js +0 -65
- package/dist/cjs/helpers/registerCSSVariable.js +0 -29
- package/dist/cjs/helpers/setElementProps.js +0 -24
- package/dist/cjs/helpers/sortString.js +0 -21
- package/dist/cjs/helpers/themeable.js +0 -63
- package/dist/cjs/helpers/timer.js +0 -27
- package/dist/cjs/helpers/transformsToString.js +0 -32
- package/dist/cjs/helpers/webPropsToSkip.js +0 -21
- package/dist/cjs/helpers/wrapStyleTags.js +0 -39
- package/dist/cjs/hooks/useConfiguration.js +0 -37
- package/dist/cjs/hooks/useDisableSSR.js +0 -24
- package/dist/cjs/hooks/useIsTouchDevice.js +0 -22
- package/dist/cjs/hooks/useMedia.js +0 -206
- package/dist/cjs/hooks/useProps.js +0 -95
- package/dist/cjs/hooks/useTheme.js +0 -263
- package/dist/cjs/hooks/useThemeName.js +0 -39
- package/dist/cjs/index.js +0 -99
- package/dist/cjs/inject-styles.js +0 -28
- package/dist/cjs/insertFont.js +0 -65
- package/dist/cjs/interfaces/CSSColorNames.js +0 -14
- package/dist/cjs/interfaces/GetRef.js +0 -14
- package/dist/cjs/interfaces/KeyTypes.js +0 -14
- package/dist/cjs/interfaces/RNExclusiveTypes.js +0 -14
- package/dist/cjs/interfaces/Role.js +0 -14
- package/dist/cjs/interfaces/TamaguiComponentEvents.js +0 -14
- package/dist/cjs/interfaces/TamaguiComponentState.js +0 -14
- package/dist/cjs/interfaces/WebOnlyPressEvents.js +0 -14
- package/dist/cjs/setupHooks.js +0 -25
- package/dist/cjs/setupReactNative.js +0 -46
- package/dist/cjs/styled.js +0 -74
- package/dist/cjs/type-utils.js +0 -14
- package/dist/cjs/types.js +0 -16
- package/dist/cjs/views/Configuration.js +0 -34
- package/dist/cjs/views/FontLanguage.js +0 -32
- package/dist/cjs/views/FontLanguage.types.js +0 -14
- package/dist/cjs/views/Slot.js +0 -59
- package/dist/cjs/views/Stack.js +0 -27
- package/dist/cjs/views/TamaguiProvider.js +0 -76
- package/dist/cjs/views/Text.js +0 -77
- package/dist/cjs/views/Theme.js +0 -103
- package/dist/cjs/views/ThemeDebug.js +0 -94
- package/dist/cjs/views/ThemeProvider.js +0 -45
- package/dist/cjs/views/View.js +0 -26
- /package/dist/cjs/{Tamagui.js.map → Tamagui.cjs.map} +0 -0
- /package/dist/cjs/{_withStableStyle.js.map → _withStableStyle.cjs.map} +0 -0
- /package/dist/cjs/{config.js.map → config.cjs.map} +0 -0
- /package/dist/cjs/constants/{accessibilityDirectMap.js.map → accessibilityDirectMap.cjs.map} +0 -0
- /package/dist/cjs/constants/{constants.js.map → constants.cjs.map} +0 -0
- /package/dist/cjs/constants/{isDevTools.js.map → isDevTools.cjs.map} +0 -0
- /package/dist/cjs/constants/{webToNativeProps.js.map → webToNativeProps.cjs.map} +0 -0
- /package/dist/cjs/contexts/{ComponentContext.js.map → ComponentContext.cjs.map} +0 -0
- /package/dist/cjs/{createComponent.js.map → createComponent.cjs.map} +0 -0
- /package/dist/cjs/{createFont.js.map → createFont.cjs.map} +0 -0
- /package/dist/cjs/{createShorthands.js.map → createShorthands.cjs.map} +0 -0
- /package/dist/cjs/{createTamagui.js.map → createTamagui.cjs.map} +0 -0
- /package/dist/cjs/{createTheme.js.map → createTheme.cjs.map} +0 -0
- /package/dist/cjs/{createTokens.js.map → createTokens.cjs.map} +0 -0
- /package/dist/cjs/{createVariable.js.map → createVariable.cjs.map} +0 -0
- /package/dist/cjs/{createVariables.js.map → createVariables.cjs.map} +0 -0
- /package/dist/cjs/{defaultComponentState.js.map → defaultComponentState.cjs.map} +0 -0
- /package/dist/cjs/helpers/{ThemeManager.js.map → ThemeManager.cjs.map} +0 -0
- /package/dist/cjs/helpers/{ThemeManagerContext.js.map → ThemeManagerContext.cjs.map} +0 -0
- /package/dist/cjs/helpers/{createMediaStyle.js.map → createMediaStyle.cjs.map} +0 -0
- /package/dist/cjs/helpers/{createShallowSetState.js.map → createShallowSetState.cjs.map} +0 -0
- /package/dist/cjs/helpers/{createStyledContext.js.map → createStyledContext.cjs.map} +0 -0
- /package/dist/cjs/helpers/{defaultOffset.js.map → defaultOffset.cjs.map} +0 -0
- /package/dist/cjs/helpers/{expandStyle.js.map → expandStyle.cjs.map} +0 -0
- /package/dist/cjs/helpers/{expandStyles.js.map → expandStyles.cjs.map} +0 -0
- /package/dist/cjs/helpers/{getExpandedShorthands.js.map → getExpandedShorthands.cjs.map} +0 -0
- /package/dist/cjs/helpers/{getFontLanguage.js.map → getFontLanguage.cjs.map} +0 -0
- /package/dist/cjs/helpers/{getGroupPropParts.js.map → getGroupPropParts.cjs.map} +0 -0
- /package/dist/cjs/helpers/{getSplitStyles.js.map → getSplitStyles.cjs.map} +0 -0
- /package/dist/cjs/helpers/{getStylesAtomic.js.map → getStylesAtomic.cjs.map} +0 -0
- /package/dist/cjs/helpers/{getThemeCSSRules.js.map → getThemeCSSRules.cjs.map} +0 -0
- /package/dist/cjs/helpers/{getVariantExtras.js.map → getVariantExtras.cjs.map} +0 -0
- /package/dist/cjs/helpers/{insertStyleRule.js.map → insertStyleRule.cjs.map} +0 -0
- /package/dist/cjs/helpers/{isActivePlatform.js.map → isActivePlatform.cjs.map} +0 -0
- /package/dist/cjs/helpers/{isObj.js.map → isObj.cjs.map} +0 -0
- /package/dist/cjs/helpers/{isTamaguiComponent.js.map → isTamaguiComponent.cjs.map} +0 -0
- /package/dist/cjs/helpers/{isTamaguiElement.js.map → isTamaguiElement.cjs.map} +0 -0
- /package/dist/cjs/helpers/{log.js.map → log.cjs.map} +0 -0
- /package/dist/cjs/helpers/{matchMedia.js.map → matchMedia.cjs.map} +0 -0
- /package/dist/cjs/helpers/{mergeProps.js.map → mergeProps.cjs.map} +0 -0
- /package/dist/cjs/helpers/{mergeVariants.js.map → mergeVariants.cjs.map} +0 -0
- /package/dist/cjs/helpers/{normalizeColor.js.map → normalizeColor.cjs.map} +0 -0
- /package/dist/cjs/helpers/{normalizeShadow.js.map → normalizeShadow.cjs.map} +0 -0
- /package/dist/cjs/helpers/{normalizeStyle.js.map → normalizeStyle.cjs.map} +0 -0
- /package/dist/cjs/helpers/{normalizeStylePropKeys.js.map → normalizeStylePropKeys.cjs.map} +0 -0
- /package/dist/cjs/helpers/{normalizeValueWithProperty.js.map → normalizeValueWithProperty.cjs.map} +0 -0
- /package/dist/cjs/helpers/{objectIdentityKey.js.map → objectIdentityKey.cjs.map} +0 -0
- /package/dist/cjs/helpers/{propMapper.js.map → propMapper.cjs.map} +0 -0
- /package/dist/cjs/helpers/{proxyThemeToParents.js.map → proxyThemeToParents.cjs.map} +0 -0
- /package/dist/cjs/helpers/{proxyThemeVariables.js.map → proxyThemeVariables.cjs.map} +0 -0
- /package/dist/cjs/helpers/{pseudoDescriptors.js.map → pseudoDescriptors.cjs.map} +0 -0
- /package/dist/cjs/helpers/{registerCSSVariable.js.map → registerCSSVariable.cjs.map} +0 -0
- /package/dist/cjs/helpers/{setElementProps.js.map → setElementProps.cjs.map} +0 -0
- /package/dist/cjs/helpers/{skipProps.js.map → skipProps.cjs.map} +0 -0
- /package/dist/cjs/helpers/{sortString.js.map → sortString.cjs.map} +0 -0
- /package/dist/cjs/helpers/{subscribeToContextGroup.js.map → subscribeToContextGroup.cjs.map} +0 -0
- /package/dist/cjs/helpers/{themeable.js.map → themeable.cjs.map} +0 -0
- /package/dist/cjs/helpers/{themes.js.map → themes.cjs.map} +0 -0
- /package/dist/cjs/helpers/{timer.js.map → timer.cjs.map} +0 -0
- /package/dist/cjs/helpers/{transformsToString.js.map → transformsToString.cjs.map} +0 -0
- /package/dist/cjs/helpers/{webPropsToSkip.js.map → webPropsToSkip.cjs.map} +0 -0
- /package/dist/cjs/helpers/{wrapStyleTags.js.map → wrapStyleTags.cjs.map} +0 -0
- /package/dist/cjs/hooks/{useComponentState.js.map → useComponentState.cjs.map} +0 -0
- /package/dist/cjs/hooks/{useConfiguration.js.map → useConfiguration.cjs.map} +0 -0
- /package/dist/cjs/hooks/{useDidHydrateOnce.js.map → useDidHydrateOnce.cjs.map} +0 -0
- /package/dist/cjs/hooks/{useDisableSSR.js.map → useDisableSSR.cjs.map} +0 -0
- /package/dist/cjs/hooks/{useIsTouchDevice.js.map → useIsTouchDevice.cjs.map} +0 -0
- /package/dist/cjs/hooks/{useMedia.js.map → useMedia.cjs.map} +0 -0
- /package/dist/cjs/hooks/{useProps.js.map → useProps.cjs.map} +0 -0
- /package/dist/cjs/hooks/{useTheme.js.map → useTheme.cjs.map} +0 -0
- /package/dist/cjs/hooks/{useThemeName.js.map → useThemeName.cjs.map} +0 -0
- /package/dist/cjs/{index.js.map → index.cjs.map} +0 -0
- /package/dist/cjs/{inject-styles.js.map → inject-styles.cjs.map} +0 -0
- /package/dist/cjs/{insertFont.js.map → insertFont.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{CSSColorNames.js.map → CSSColorNames.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{GetRef.js.map → GetRef.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{KeyTypes.js.map → KeyTypes.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{RNExclusiveTypes.js.map → RNExclusiveTypes.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{Role.js.map → Role.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{TamaguiComponentEvents.js.map → TamaguiComponentEvents.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{TamaguiComponentPropsBaseBase.js.map → TamaguiComponentPropsBaseBase.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{TamaguiComponentState.js.map → TamaguiComponentState.cjs.map} +0 -0
- /package/dist/cjs/interfaces/{WebOnlyPressEvents.js.map → WebOnlyPressEvents.cjs.map} +0 -0
- /package/dist/cjs/{setupHooks.js.map → setupHooks.cjs.map} +0 -0
- /package/dist/cjs/{setupReactNative.js.map → setupReactNative.cjs.map} +0 -0
- /package/dist/cjs/{styled.js.map → styled.cjs.map} +0 -0
- /package/dist/cjs/{type-utils.js.map → type-utils.cjs.map} +0 -0
- /package/dist/cjs/{types.js.map → types.cjs.map} +0 -0
- /package/dist/cjs/views/{Configuration.js.map → Configuration.cjs.map} +0 -0
- /package/dist/cjs/views/{FontLanguage.js.map → FontLanguage.cjs.map} +0 -0
- /package/dist/cjs/views/{FontLanguage.types.js.map → FontLanguage.types.cjs.map} +0 -0
- /package/dist/cjs/views/{Slot.js.map → Slot.cjs.map} +0 -0
- /package/dist/cjs/views/{Stack.js.map → Stack.cjs.map} +0 -0
- /package/dist/cjs/views/{TamaguiProvider.js.map → TamaguiProvider.cjs.map} +0 -0
- /package/dist/cjs/views/{Text.js.map → Text.cjs.map} +0 -0
- /package/dist/cjs/views/{Theme.js.map → Theme.cjs.map} +0 -0
- /package/dist/cjs/views/{ThemeDebug.js.map → ThemeDebug.cjs.map} +0 -0
- /package/dist/cjs/views/{ThemeProvider.js.map → ThemeProvider.cjs.map} +0 -0
- /package/dist/cjs/views/{View.js.map → View.cjs.map} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var createFont_exports = {};
|
|
22
|
+
__export(createFont_exports, {
|
|
23
|
+
createFont: () => createFont
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(createFont_exports);
|
|
26
|
+
const fontWeights = ["100", "200", "300", "400", "500", "600", "700", "800", "900"],
|
|
27
|
+
processSection = (section, keys, defaultValue) => {
|
|
28
|
+
if (typeof section == "string") return section;
|
|
29
|
+
const sectionKeys = Object.keys(section);
|
|
30
|
+
let fillValue = section[sectionKeys[0]];
|
|
31
|
+
return Object.fromEntries([... /* @__PURE__ */new Set([...keys, ...sectionKeys])].map(key => {
|
|
32
|
+
const value = section[key] ?? defaultValue ?? fillValue;
|
|
33
|
+
return fillValue = value, defaultValue = value, [key, value];
|
|
34
|
+
}));
|
|
35
|
+
},
|
|
36
|
+
createFont = font => {
|
|
37
|
+
const sizeKeys = Object.keys(font.size),
|
|
38
|
+
processedFont = Object.fromEntries(Object.entries(font).map(([key, section]) => [key, processSection(section, key === "face" ? fontWeights : sizeKeys, key === "face" ? {
|
|
39
|
+
normal: font.family
|
|
40
|
+
} : void 0)]));
|
|
41
|
+
return Object.freeze(processedFont);
|
|
42
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var createShorthands_exports = {};
|
|
22
|
+
__export(createShorthands_exports, {
|
|
23
|
+
createShorthands: () => createShorthands
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(createShorthands_exports);
|
|
26
|
+
function createShorthands(shorthands) {
|
|
27
|
+
return Object.freeze(shorthands);
|
|
28
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var createTamagui_exports = {};
|
|
22
|
+
__export(createTamagui_exports, {
|
|
23
|
+
createTamagui: () => createTamagui
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(createTamagui_exports);
|
|
26
|
+
var import_constants = require("@tamagui/constants"),
|
|
27
|
+
import_config = require("./config.cjs"),
|
|
28
|
+
import_createVariables = require("./createVariables.cjs"),
|
|
29
|
+
import_getThemeCSSRules = require("./helpers/getThemeCSSRules.cjs"),
|
|
30
|
+
import_insertStyleRule = require("./helpers/insertStyleRule.cjs"),
|
|
31
|
+
import_proxyThemeToParents = require("./helpers/proxyThemeToParents.cjs"),
|
|
32
|
+
import_registerCSSVariable = require("./helpers/registerCSSVariable.cjs"),
|
|
33
|
+
import_themes = require("./helpers/themes.cjs"),
|
|
34
|
+
import_useMedia = require("./hooks/useMedia.cjs"),
|
|
35
|
+
import_insertFont = require("./insertFont.cjs"),
|
|
36
|
+
import_Tamagui = require("./Tamagui.cjs");
|
|
37
|
+
const createdConfigs = /* @__PURE__ */new WeakMap();
|
|
38
|
+
function createTamagui(configIn) {
|
|
39
|
+
if (createdConfigs.has(configIn)) return configIn;
|
|
40
|
+
const tokensParsed = {},
|
|
41
|
+
tokens = (0, import_createVariables.createVariables)(configIn.tokens || {});
|
|
42
|
+
if (configIn.tokens) {
|
|
43
|
+
const tokensMerged = {};
|
|
44
|
+
for (const cat in tokens) {
|
|
45
|
+
tokensParsed[cat] = {}, tokensMerged[cat] = {};
|
|
46
|
+
const tokenCat = tokens[cat];
|
|
47
|
+
for (const key in tokenCat) {
|
|
48
|
+
const val = tokenCat[key],
|
|
49
|
+
prefixedKey = `$${key}`;
|
|
50
|
+
tokensParsed[cat][prefixedKey] = val, tokensMerged[cat][prefixedKey] = val, tokensMerged[cat][key] = val;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
(0, import_config.setTokens)(tokensMerged);
|
|
54
|
+
}
|
|
55
|
+
let foundThemes;
|
|
56
|
+
if (configIn.themes) {
|
|
57
|
+
const noThemes = Object.keys(configIn.themes).length === 0;
|
|
58
|
+
noThemes && (foundThemes = (0, import_insertStyleRule.scanAllSheets)(noThemes, tokensParsed)), process.env.TAMAGUI_REACT_19 && process.env.TAMAGUI_SKIP_THEME_OPTIMIZATION || noThemes && (0, import_insertStyleRule.listenForSheetChanges)();
|
|
59
|
+
}
|
|
60
|
+
let fontSizeTokens = null,
|
|
61
|
+
fontsParsed;
|
|
62
|
+
if (configIn.fonts) {
|
|
63
|
+
const fontTokens = Object.fromEntries(Object.entries(configIn.fonts).map(([k, v]) => [k, (0, import_createVariables.createVariables)(v, "f", !0)]));
|
|
64
|
+
fontsParsed = (() => {
|
|
65
|
+
const res = {};
|
|
66
|
+
for (const familyName in fontTokens) {
|
|
67
|
+
const font = fontTokens[familyName],
|
|
68
|
+
fontParsed = (0, import_insertFont.parseFont)(font);
|
|
69
|
+
res[`$${familyName}`] = fontParsed, !fontSizeTokens && fontParsed.size && (fontSizeTokens = new Set(Object.keys(fontParsed.size)));
|
|
70
|
+
}
|
|
71
|
+
return res;
|
|
72
|
+
})();
|
|
73
|
+
}
|
|
74
|
+
const specificTokens = {},
|
|
75
|
+
themeConfig = (() => {
|
|
76
|
+
const cssRuleSets = [],
|
|
77
|
+
declarations = [],
|
|
78
|
+
fontDeclarations = {};
|
|
79
|
+
for (const key in tokens) for (const skey in tokens[key]) {
|
|
80
|
+
const variable = tokens[key][skey];
|
|
81
|
+
if (specificTokens[`$${key}.${skey}`] = variable, process.env.NODE_ENV === "development" && typeof variable > "u") throw new Error(`No value for tokens.${key}.${skey}:
|
|
82
|
+
${JSON.stringify(variable, null, 2)}`);
|
|
83
|
+
import_constants.isWeb && ((0, import_registerCSSVariable.registerCSSVariable)(variable), declarations.push((0, import_registerCSSVariable.variableToCSS)(variable, key === "zIndex")));
|
|
84
|
+
}
|
|
85
|
+
if (import_constants.isWeb) {
|
|
86
|
+
let declarationsToRuleSet = function (decs, selector = "") {
|
|
87
|
+
return `:root${selector} {${sep}${[...decs].join(`;${sep}`)}${sep}}`;
|
|
88
|
+
};
|
|
89
|
+
for (const key in fontsParsed) {
|
|
90
|
+
const fontParsed = fontsParsed[key],
|
|
91
|
+
[name, language] = key.includes("_") ? key.split("_") : [key],
|
|
92
|
+
fontVars = (0, import_insertFont.registerFontVariables)(fontParsed);
|
|
93
|
+
fontDeclarations[key] = {
|
|
94
|
+
name: name.slice(1),
|
|
95
|
+
declarations: fontVars,
|
|
96
|
+
language
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const sep = configIn.cssStyleSeparator || "";
|
|
100
|
+
if (cssRuleSets.push(declarationsToRuleSet(declarations)), fontDeclarations) for (const key in fontDeclarations) {
|
|
101
|
+
const {
|
|
102
|
+
name,
|
|
103
|
+
declarations: declarations2,
|
|
104
|
+
language = "default"
|
|
105
|
+
} = fontDeclarations[key],
|
|
106
|
+
fontSelector = `.font_${name}`,
|
|
107
|
+
langSelector = `:root .t_lang-${name}-${language} ${fontSelector}`,
|
|
108
|
+
selectors = language === "default" ? ` ${fontSelector}, ${langSelector}` : langSelector,
|
|
109
|
+
specificRuleSet = declarationsToRuleSet(declarations2, selectors);
|
|
110
|
+
cssRuleSets.push(specificRuleSet);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const themesIn = configIn.themes,
|
|
114
|
+
dedupedThemes = foundThemes ?? getThemesDeduped(themesIn);
|
|
115
|
+
return {
|
|
116
|
+
themes: (0, import_proxyThemeToParents.proxyThemesToParents)(dedupedThemes),
|
|
117
|
+
cssRuleSets,
|
|
118
|
+
getThemeRulesSets() {
|
|
119
|
+
let themeRuleSets = [];
|
|
120
|
+
if (import_constants.isWeb) for (const {
|
|
121
|
+
names,
|
|
122
|
+
theme
|
|
123
|
+
} of dedupedThemes) {
|
|
124
|
+
const nextRules = (0, import_getThemeCSSRules.getThemeCSSRules)({
|
|
125
|
+
config: configIn,
|
|
126
|
+
themeName: names[0],
|
|
127
|
+
names,
|
|
128
|
+
theme
|
|
129
|
+
});
|
|
130
|
+
themeRuleSets = [...themeRuleSets, ...nextRules];
|
|
131
|
+
}
|
|
132
|
+
return themeRuleSets;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
})(),
|
|
136
|
+
shorthands = configIn.shorthands || {};
|
|
137
|
+
let lastCSSInsertedRulesIndex = -1;
|
|
138
|
+
const getCSS = (opts = {}) => {
|
|
139
|
+
const {
|
|
140
|
+
separator = `
|
|
141
|
+
`,
|
|
142
|
+
sinceLastCall,
|
|
143
|
+
exclude
|
|
144
|
+
} = opts;
|
|
145
|
+
if (sinceLastCall && lastCSSInsertedRulesIndex >= 0) {
|
|
146
|
+
const rules = (0, import_insertStyleRule.getAllRules)();
|
|
147
|
+
return lastCSSInsertedRulesIndex = rules.length, rules.slice(lastCSSInsertedRulesIndex).join(separator);
|
|
148
|
+
}
|
|
149
|
+
lastCSSInsertedRulesIndex = 0;
|
|
150
|
+
const runtimeStyles = (0, import_insertStyleRule.getAllRules)().join(separator);
|
|
151
|
+
return exclude === "design-system" ? runtimeStyles : `${`._ovs-contain {overscroll-behavior:contain;}
|
|
152
|
+
.is_Text .is_Text {display:inline-flex;}
|
|
153
|
+
._dsp_contents {display:contents;}
|
|
154
|
+
${themeConfig.cssRuleSets.join(separator)}`}
|
|
155
|
+
${exclude ? "" : themeConfig.getThemeRulesSets().join(separator)}
|
|
156
|
+
${runtimeStyles}`;
|
|
157
|
+
},
|
|
158
|
+
getNewCSS = opts => getCSS({
|
|
159
|
+
...opts,
|
|
160
|
+
sinceLastCall: !0
|
|
161
|
+
}),
|
|
162
|
+
defaultFontSetting = configIn.settings?.defaultFont ?? configIn.defaultFont,
|
|
163
|
+
defaultFont = (() => {
|
|
164
|
+
let val = defaultFontSetting;
|
|
165
|
+
return val?.[0] === "$" && (val = val.slice(1)), val;
|
|
166
|
+
})(),
|
|
167
|
+
defaultFontToken = defaultFont ? `$${defaultFont}` : "",
|
|
168
|
+
unset = {
|
|
169
|
+
...configIn.unset
|
|
170
|
+
};
|
|
171
|
+
!unset.fontFamily && defaultFont && (unset.fontFamily = defaultFontToken);
|
|
172
|
+
const config = {
|
|
173
|
+
fonts: {},
|
|
174
|
+
onlyAllowShorthands: !1,
|
|
175
|
+
fontLanguages: [],
|
|
176
|
+
animations: {},
|
|
177
|
+
media: {},
|
|
178
|
+
...configIn,
|
|
179
|
+
unset,
|
|
180
|
+
settings: {
|
|
181
|
+
// move deprecated settings here so we can reference them all using `getSetting`
|
|
182
|
+
// TODO remove this on v2
|
|
183
|
+
disableSSR: configIn.disableSSR,
|
|
184
|
+
defaultFont: configIn.defaultFont,
|
|
185
|
+
disableRootThemeClass: configIn.disableRootThemeClass,
|
|
186
|
+
onlyAllowShorthands: configIn.onlyAllowShorthands,
|
|
187
|
+
mediaQueryDefaultActive: configIn.mediaQueryDefaultActive,
|
|
188
|
+
themeClassNameOnRoot: configIn.themeClassNameOnRoot,
|
|
189
|
+
cssStyleSeparator: configIn.cssStyleSeparator,
|
|
190
|
+
webContainerType: "inline-size",
|
|
191
|
+
...configIn.settings
|
|
192
|
+
},
|
|
193
|
+
tokens,
|
|
194
|
+
// vite made this into a function if it wasn't set
|
|
195
|
+
shorthands,
|
|
196
|
+
inverseShorthands: shorthands ? Object.fromEntries(Object.entries(shorthands).map(([k, v]) => [v, k])) : {},
|
|
197
|
+
themes: themeConfig.themes,
|
|
198
|
+
fontsParsed: fontsParsed || {},
|
|
199
|
+
themeConfig,
|
|
200
|
+
tokensParsed,
|
|
201
|
+
parsed: !0,
|
|
202
|
+
getNewCSS,
|
|
203
|
+
getCSS,
|
|
204
|
+
defaultFont,
|
|
205
|
+
fontSizeTokens: fontSizeTokens || /* @__PURE__ */new Set(),
|
|
206
|
+
specificTokens,
|
|
207
|
+
defaultFontToken
|
|
208
|
+
// const tokens = [...getToken(tokens.size[0])]
|
|
209
|
+
// .spacer-sm + ._dsp_contents._dsp-sm-hidden { margin-left: -var(--${}) }
|
|
210
|
+
};
|
|
211
|
+
return (0, import_config.setConfig)(config), (0, import_useMedia.configureMedia)(config), createdConfigs.set(config, !0), import_config.configListeners.size && (import_config.configListeners.forEach(cb => cb(config)), import_config.configListeners.clear()), process.env.NODE_ENV === "development" && (process.env.DEBUG?.startsWith("tamagui") && console.info("Tamagui config:", config), globalThis.Tamagui || (globalThis.Tamagui = import_Tamagui.Tamagui)), config;
|
|
212
|
+
}
|
|
213
|
+
function getThemesDeduped(themes) {
|
|
214
|
+
const dedupedThemes = [],
|
|
215
|
+
existing = /* @__PURE__ */new Map();
|
|
216
|
+
for (const themeName in themes) {
|
|
217
|
+
const darkOrLightSpecificPrefix = themeName.startsWith("dark") ? "dark" : themeName.startsWith("light") ? "light" : "",
|
|
218
|
+
rawTheme = themes[themeName],
|
|
219
|
+
key = darkOrLightSpecificPrefix + JSON.stringify(rawTheme);
|
|
220
|
+
if (existing.has(key)) {
|
|
221
|
+
existing.get(key).names.push(themeName);
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
const theme = {
|
|
225
|
+
...rawTheme
|
|
226
|
+
};
|
|
227
|
+
for (const key2 in theme) (0, import_themes.ensureThemeVariable)(theme, key2);
|
|
228
|
+
const deduped = {
|
|
229
|
+
names: [themeName],
|
|
230
|
+
theme
|
|
231
|
+
};
|
|
232
|
+
dedupedThemes.push(deduped), existing.set(key, deduped);
|
|
233
|
+
}
|
|
234
|
+
return dedupedThemes;
|
|
235
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var createTheme_exports = {};
|
|
22
|
+
__export(createTheme_exports, {
|
|
23
|
+
createTheme: () => createTheme
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(createTheme_exports);
|
|
26
|
+
const createTheme = theme => theme;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var createTokens_exports = {};
|
|
22
|
+
__export(createTokens_exports, {
|
|
23
|
+
createTokens: () => createTokens
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(createTokens_exports);
|
|
26
|
+
var import_createVariables = require("./createVariables.cjs");
|
|
27
|
+
function createTokens(tokens) {
|
|
28
|
+
return (0, import_createVariables.createVariables)(tokens, process.env.TAMAGUI_TOKEN_PREFIX ?? "t");
|
|
29
|
+
}
|
|
@@ -3,15 +3,21 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
15
21
|
var createVariable_exports = {};
|
|
16
22
|
__export(createVariable_exports, {
|
|
17
23
|
createCSSVariable: () => createCSSVariable,
|
|
@@ -26,13 +32,19 @@ __export(createVariable_exports, {
|
|
|
26
32
|
variableToString: () => variableToString
|
|
27
33
|
});
|
|
28
34
|
module.exports = __toCommonJS(createVariable_exports);
|
|
29
|
-
var import_constants = require("@tamagui/constants"),
|
|
35
|
+
var import_constants = require("@tamagui/constants"),
|
|
36
|
+
import_helpers = require("@tamagui/helpers"),
|
|
37
|
+
import_config = require("./config.cjs");
|
|
30
38
|
function constructCSSVariableName(name) {
|
|
31
39
|
return `var(--${process.env.TAMAGUI_CSS_VARIABLE_PREFIX || ""}${name})`;
|
|
32
40
|
}
|
|
33
41
|
const createVariable = (props, skipHash = !1) => {
|
|
34
42
|
if (!skipHash && isVariable(props)) return props;
|
|
35
|
-
const {
|
|
43
|
+
const {
|
|
44
|
+
key,
|
|
45
|
+
name,
|
|
46
|
+
val
|
|
47
|
+
} = props;
|
|
36
48
|
return {
|
|
37
49
|
isVar: !0,
|
|
38
50
|
key,
|
|
@@ -48,22 +60,19 @@ function isVariable(v) {
|
|
|
48
60
|
return v && typeof v == "object" && "isVar" in v;
|
|
49
61
|
}
|
|
50
62
|
function getVariable(nameOrVariable, group = "size") {
|
|
51
|
-
if (nameOrVariable?.dynamic)
|
|
52
|
-
|
|
53
|
-
if (setDidGetVariableValue(!0), isVariable(nameOrVariable))
|
|
54
|
-
return variableToString(nameOrVariable);
|
|
63
|
+
if (nameOrVariable?.dynamic) return nameOrVariable;
|
|
64
|
+
if (setDidGetVariableValue(!0), isVariable(nameOrVariable)) return variableToString(nameOrVariable);
|
|
55
65
|
const tokens = (0, import_config.getConfig)().tokensParsed;
|
|
56
66
|
return variableToString(tokens[group]?.[nameOrVariable] ?? nameOrVariable);
|
|
57
67
|
}
|
|
58
68
|
let accessed = !1;
|
|
59
|
-
const setDidGetVariableValue =
|
|
69
|
+
const setDidGetVariableValue = val => accessed = val,
|
|
70
|
+
didGetVariableValue = () => accessed;
|
|
60
71
|
function getVariableValue(v, group) {
|
|
61
|
-
if (isVariable(v))
|
|
62
|
-
return setDidGetVariableValue(!0), v.val;
|
|
72
|
+
if (isVariable(v)) return setDidGetVariableValue(!0), v.val;
|
|
63
73
|
if (group) {
|
|
64
74
|
const token = (0, import_config.getConfig)().tokensParsed[group]?.[v];
|
|
65
|
-
if (token)
|
|
66
|
-
return setDidGetVariableValue(!0), token.val;
|
|
75
|
+
if (token) return setDidGetVariableValue(!0), token.val;
|
|
67
76
|
}
|
|
68
77
|
return v;
|
|
69
78
|
}
|
|
@@ -74,9 +83,7 @@ function getVariableVariable(v) {
|
|
|
74
83
|
return isVariable(v) ? v.variable : v;
|
|
75
84
|
}
|
|
76
85
|
const createCSSVariable = (nameProp, includeVar = !0) => {
|
|
77
|
-
if (process.env.NODE_ENV === "development" && (!nameProp || typeof nameProp != "string"))
|
|
78
|
-
throw new Error(`createCSSVariable expected string, got: ${nameProp}`);
|
|
86
|
+
if (process.env.NODE_ENV === "development" && (!nameProp || typeof nameProp != "string")) throw new Error(`createCSSVariable expected string, got: ${nameProp}`);
|
|
79
87
|
const name = (0, import_helpers.simpleHash)(nameProp, 60);
|
|
80
88
|
return includeVar ? constructCSSVariableName(name) : name;
|
|
81
|
-
};
|
|
82
|
-
//# sourceMappingURL=createVariable.js.map
|
|
89
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var createVariables_exports = {};
|
|
22
|
+
__export(createVariables_exports, {
|
|
23
|
+
createVariables: () => createVariables
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(createVariables_exports);
|
|
26
|
+
var import_helpers = require("@tamagui/helpers"),
|
|
27
|
+
import_createVariable = require("./createVariable.cjs");
|
|
28
|
+
const cache = /* @__PURE__ */new WeakMap(),
|
|
29
|
+
createVariables = (tokens, parentPath = "", isFont = !1) => {
|
|
30
|
+
if (cache.has(tokens)) return tokens;
|
|
31
|
+
const res = {};
|
|
32
|
+
let i = 0;
|
|
33
|
+
for (let keyIn in tokens) {
|
|
34
|
+
i++;
|
|
35
|
+
const val = tokens[keyIn],
|
|
36
|
+
isPrefixed = keyIn[0] === "$",
|
|
37
|
+
keyWithPrefix = isPrefixed ? keyIn : `$${keyIn}`,
|
|
38
|
+
key = isPrefixed ? keyWithPrefix.slice(1) : keyIn;
|
|
39
|
+
if ((0, import_createVariable.isVariable)(val)) {
|
|
40
|
+
res[key] = val;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const niceKey = (0, import_helpers.simpleHash)(key, 1e3),
|
|
44
|
+
name = parentPath && parentPath !== "t-color" ? `${parentPath}-${niceKey}` : `c-${niceKey}`;
|
|
45
|
+
if (val && typeof val == "object") {
|
|
46
|
+
res[key] = createVariables(tokens[key], name, !1
|
|
47
|
+
/* note: don't pass isFont down, we want to avoid it past the first level */);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const finalValue = (0, import_createVariable.isVariable)(val) ? val : (0, import_createVariable.createVariable)({
|
|
51
|
+
val,
|
|
52
|
+
name,
|
|
53
|
+
key: keyWithPrefix
|
|
54
|
+
});
|
|
55
|
+
res[key] = finalValue;
|
|
56
|
+
}
|
|
57
|
+
return cache.set(res, !0), res;
|
|
58
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var defaultComponentState_exports = {};
|
|
22
|
+
__export(defaultComponentState_exports, {
|
|
23
|
+
defaultComponentState: () => defaultComponentState,
|
|
24
|
+
defaultComponentStateMounted: () => defaultComponentStateMounted,
|
|
25
|
+
defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(defaultComponentState_exports);
|
|
28
|
+
const defaultComponentState = {
|
|
29
|
+
hover: !1,
|
|
30
|
+
press: !1,
|
|
31
|
+
pressIn: !1,
|
|
32
|
+
focus: !1,
|
|
33
|
+
focusVisible: !1,
|
|
34
|
+
unmounted: !0,
|
|
35
|
+
disabled: !1
|
|
36
|
+
},
|
|
37
|
+
defaultComponentStateMounted = {
|
|
38
|
+
...defaultComponentState,
|
|
39
|
+
unmounted: !1
|
|
40
|
+
},
|
|
41
|
+
defaultComponentStateShouldEnter = {
|
|
42
|
+
...defaultComponentState,
|
|
43
|
+
unmounted: "should-enter"
|
|
44
|
+
};
|