@tamagui/web 1.114.4 → 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,176 @@
|
|
|
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 getStylesAtomic_exports = {};
|
|
22
|
+
__export(getStylesAtomic_exports, {
|
|
23
|
+
getStyleAtomic: () => getStyleAtomic,
|
|
24
|
+
getStylesAtomic: () => getStylesAtomic,
|
|
25
|
+
styleToCSS: () => styleToCSS
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(getStylesAtomic_exports);
|
|
28
|
+
var import_helpers = require("@tamagui/helpers"),
|
|
29
|
+
import_config = require("../config.cjs"),
|
|
30
|
+
import_defaultOffset = require("./defaultOffset.cjs"),
|
|
31
|
+
import_normalizeColor = require("./normalizeColor.cjs"),
|
|
32
|
+
import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs"),
|
|
33
|
+
import_pseudoDescriptors = require("./pseudoDescriptors.cjs"),
|
|
34
|
+
import_transformsToString = require("./transformsToString.cjs"),
|
|
35
|
+
import_useMedia = require("../hooks/useMedia.cjs");
|
|
36
|
+
function getStylesAtomic(style) {
|
|
37
|
+
styleToCSS(style);
|
|
38
|
+
const out = [];
|
|
39
|
+
for (const key in style) {
|
|
40
|
+
if (key === "$$css") continue;
|
|
41
|
+
const val = style[key];
|
|
42
|
+
if (key in import_pseudoDescriptors.pseudoDescriptors) val && out.push(...getStyleAtomic(val, import_pseudoDescriptors.pseudoDescriptors[key]));else if ((0, import_useMedia.isMediaKey)(key)) for (const subKey in val) {
|
|
43
|
+
const so = getStyleObject(val, subKey);
|
|
44
|
+
so && (so[0] = key, out.push(so));
|
|
45
|
+
} else {
|
|
46
|
+
const so = getStyleObject(style, key);
|
|
47
|
+
so && out.push(so);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
const getStyleAtomic = (style, pseudo) => {
|
|
53
|
+
styleToCSS(style);
|
|
54
|
+
const out = [];
|
|
55
|
+
for (const key in style) {
|
|
56
|
+
const so = getStyleObject(style, key, pseudo);
|
|
57
|
+
so && out.push(so);
|
|
58
|
+
}
|
|
59
|
+
return out;
|
|
60
|
+
};
|
|
61
|
+
let conf = null;
|
|
62
|
+
const getStyleObject = (style, key, pseudo) => {
|
|
63
|
+
let val = style[key];
|
|
64
|
+
if (val == null) return;
|
|
65
|
+
key === "transform" && Array.isArray(style.transform) && (val = (0, import_transformsToString.transformsToString)(val));
|
|
66
|
+
const value = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key),
|
|
67
|
+
hash = (0, import_helpers.simpleHash)(typeof value == "string" ? value : `${value}`),
|
|
68
|
+
pseudoPrefix = pseudo ? `0${pseudo.name}-` : "";
|
|
69
|
+
conf ||= (0, import_config.getConfigMaybe)();
|
|
70
|
+
const identifier = `_${conf?.inverseShorthands[key] || key}-${pseudoPrefix}${hash}`,
|
|
71
|
+
rules = createAtomicRules(identifier, key, value, pseudo);
|
|
72
|
+
return [
|
|
73
|
+
// array for performance
|
|
74
|
+
key, value, identifier, pseudo?.name, rules];
|
|
75
|
+
};
|
|
76
|
+
function styleToCSS(style) {
|
|
77
|
+
const {
|
|
78
|
+
shadowOffset,
|
|
79
|
+
shadowRadius,
|
|
80
|
+
shadowColor,
|
|
81
|
+
shadowOpacity
|
|
82
|
+
} = style;
|
|
83
|
+
if (shadowRadius || shadowColor) {
|
|
84
|
+
const offset = shadowOffset || import_defaultOffset.defaultOffset,
|
|
85
|
+
width = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(offset.width),
|
|
86
|
+
height = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(offset.height),
|
|
87
|
+
radius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(shadowRadius),
|
|
88
|
+
color = (0, import_normalizeColor.normalizeColor)(shadowColor, shadowOpacity),
|
|
89
|
+
shadow = `${width} ${height} ${radius} ${color}`;
|
|
90
|
+
style.boxShadow = style.boxShadow ? `${style.boxShadow}, ${shadow}` : shadow, delete style.shadowOffset, delete style.shadowRadius, delete style.shadowColor, delete style.shadowOpacity;
|
|
91
|
+
}
|
|
92
|
+
const {
|
|
93
|
+
textShadowColor,
|
|
94
|
+
textShadowOffset,
|
|
95
|
+
textShadowRadius
|
|
96
|
+
} = style;
|
|
97
|
+
if (textShadowColor || textShadowOffset || textShadowRadius) {
|
|
98
|
+
const {
|
|
99
|
+
height,
|
|
100
|
+
width
|
|
101
|
+
} = textShadowOffset || import_defaultOffset.defaultOffset,
|
|
102
|
+
radius = textShadowRadius || 0,
|
|
103
|
+
color = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(textShadowColor, "textShadowColor");
|
|
104
|
+
if (color && (height !== 0 || width !== 0 || radius !== 0)) {
|
|
105
|
+
const blurRadius = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(radius),
|
|
106
|
+
offsetX = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(width),
|
|
107
|
+
offsetY = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(height);
|
|
108
|
+
style.textShadow = `${offsetX} ${offsetY} ${blurRadius} ${color}`;
|
|
109
|
+
}
|
|
110
|
+
delete style.textShadowColor, delete style.textShadowOffset, delete style.textShadowRadius;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function createDeclarationBlock(style, important = !1) {
|
|
114
|
+
let next = "";
|
|
115
|
+
for (const [key, value] of style) next += `${hyphenateStyleName(key)}:${value}${important ? " !important" : ""};`;
|
|
116
|
+
return `{${next}}`;
|
|
117
|
+
}
|
|
118
|
+
const hcache = {},
|
|
119
|
+
toHyphenLower = match => `-${match.toLowerCase()}`,
|
|
120
|
+
hyphenateStyleName = key => {
|
|
121
|
+
if (key in hcache) return hcache[key];
|
|
122
|
+
const val = key.replace(/[A-Z]/g, toHyphenLower);
|
|
123
|
+
return hcache[key] = val, val;
|
|
124
|
+
},
|
|
125
|
+
selectorPriority = (() => {
|
|
126
|
+
const res = {};
|
|
127
|
+
for (const key in import_pseudoDescriptors.pseudoDescriptors) {
|
|
128
|
+
const pseudo = import_pseudoDescriptors.pseudoDescriptors[key];
|
|
129
|
+
res[pseudo.name] = `${[...Array(pseudo.priority)].map(() => ":root").join("")} `;
|
|
130
|
+
}
|
|
131
|
+
return res;
|
|
132
|
+
})();
|
|
133
|
+
function createAtomicRules(identifier, property, value, pseudo) {
|
|
134
|
+
const pseudoIdPostfix = pseudo ? pseudo.name === "disabled" ? "[aria-disabled]" : `:${pseudo.name}` : "",
|
|
135
|
+
pseudoSelector = pseudo?.selector;
|
|
136
|
+
let selector = pseudo ? pseudoSelector ? `${pseudoSelector} .${identifier}` : `${selectorPriority[pseudo.name]} .${identifier}${pseudoIdPostfix}` : `:root .${identifier}`;
|
|
137
|
+
pseudoSelector === import_pseudoDescriptors.pseudoDescriptors.enterStyle.selector && (selector = `${selector}, .${identifier}${pseudoSelector}`);
|
|
138
|
+
const important = !!pseudo;
|
|
139
|
+
let rules = [];
|
|
140
|
+
switch (property) {
|
|
141
|
+
// Equivalent to using '::placeholder'
|
|
142
|
+
case "placeholderTextColor":
|
|
143
|
+
{
|
|
144
|
+
const block = createDeclarationBlock([["color", value], ["opacity", 1]], important);
|
|
145
|
+
rules.push(`${selector}::placeholder${block}`);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
// all webkit prefixed rules
|
|
149
|
+
case "backgroundClip":
|
|
150
|
+
case "userSelect":
|
|
151
|
+
{
|
|
152
|
+
const webkitProperty = `Webkit${`${property[0].toUpperCase()}${property.slice(1)}`}`,
|
|
153
|
+
block = createDeclarationBlock([[property, value], [webkitProperty, value]], important);
|
|
154
|
+
rules.push(`${selector}${block}`);
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
// Polyfill for additional 'pointer-events' values
|
|
158
|
+
case "pointerEvents":
|
|
159
|
+
{
|
|
160
|
+
let finalValue = value;
|
|
161
|
+
value === "auto" || value === "box-only" ? (finalValue = "auto", value === "box-only" && rules.push(`${selector}>*${boxOnly}`)) : (value === "none" || value === "box-none") && (finalValue = "none", value === "box-none" && rules.push(`${selector}>*${boxNone}`));
|
|
162
|
+
const block = createDeclarationBlock([["pointerEvents", finalValue]], !0);
|
|
163
|
+
rules.push(`${selector}${block}`);
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
default:
|
|
167
|
+
{
|
|
168
|
+
const block = createDeclarationBlock([[property, value]], important);
|
|
169
|
+
rules.push(`${selector}${block}`);
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return pseudo?.name === "hover" && (rules = rules.map(r => `@media (hover) {${r}}`)), rules;
|
|
174
|
+
}
|
|
175
|
+
const boxNone = createDeclarationBlock([["pointerEvents", "auto"]], !0),
|
|
176
|
+
boxOnly = createDeclarationBlock([["pointerEvents", "none"]], !0);
|
|
@@ -0,0 +1,33 @@
|
|
|
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 getStylesAtomic_native_exports = {};
|
|
22
|
+
__export(getStylesAtomic_native_exports, {
|
|
23
|
+
getStyleAtomic: () => getStyleAtomic,
|
|
24
|
+
getStylesAtomic: () => getStylesAtomic,
|
|
25
|
+
styleToCSS: () => styleToCSS
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(getStylesAtomic_native_exports);
|
|
28
|
+
const empty = () => {
|
|
29
|
+
console.warn("no-op native");
|
|
30
|
+
},
|
|
31
|
+
getStylesAtomic = empty,
|
|
32
|
+
getStyleAtomic = empty,
|
|
33
|
+
styleToCSS = empty;
|
|
@@ -0,0 +1,119 @@
|
|
|
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 getThemeCSSRules_exports = {};
|
|
22
|
+
__export(getThemeCSSRules_exports, {
|
|
23
|
+
getThemeCSSRules: () => getThemeCSSRules
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(getThemeCSSRules_exports);
|
|
26
|
+
var import_helpers = require("@tamagui/helpers"),
|
|
27
|
+
import_constants = require("../constants/constants.cjs"),
|
|
28
|
+
import_createVariable = require("../createVariable.cjs"),
|
|
29
|
+
import_registerCSSVariable = require("./registerCSSVariable.cjs"),
|
|
30
|
+
import_config = require("../config.cjs"),
|
|
31
|
+
import_sortString = require("./sortString.cjs");
|
|
32
|
+
const darkLight = ["dark", "light"],
|
|
33
|
+
lightDark = ["light", "dark"];
|
|
34
|
+
function getThemeCSSRules(props) {
|
|
35
|
+
const cssRuleSets = [];
|
|
36
|
+
if (!process.env.TAMAGUI_DOES_SSR_CSS || process.env.TAMAGUI_DOES_SSR_CSS === "mutates-themes" || process.env.TAMAGUI_DOES_SSR_CSS === "false") {
|
|
37
|
+
const {
|
|
38
|
+
config,
|
|
39
|
+
themeName,
|
|
40
|
+
theme,
|
|
41
|
+
names
|
|
42
|
+
} = props,
|
|
43
|
+
hasDarkLight = props.hasDarkLight ?? (config.themes && ("light" in config.themes || "dark" in config.themes)),
|
|
44
|
+
CNP = `.${import_constants.THEME_CLASSNAME_PREFIX}`;
|
|
45
|
+
let vars = "";
|
|
46
|
+
for (const themeKey in theme) {
|
|
47
|
+
const variable = theme[themeKey];
|
|
48
|
+
let value = null;
|
|
49
|
+
import_registerCSSVariable.tokensValueToVariable.has(variable.val) ? value = import_registerCSSVariable.tokensValueToVariable.get(variable.val).variable : value = variable.val, vars += `--${process.env.TAMAGUI_CSS_VARIABLE_PREFIX || ""}${(0, import_helpers.simpleHash)(themeKey, 40)}:${value};`;
|
|
50
|
+
}
|
|
51
|
+
const isDarkBase = themeName === "dark",
|
|
52
|
+
isLightBase = themeName === "light",
|
|
53
|
+
baseSelectors = names.map(name => `${CNP}${name}`),
|
|
54
|
+
selectorsSet = new Set(isDarkBase || isLightBase ? baseSelectors : []);
|
|
55
|
+
if (hasDarkLight) {
|
|
56
|
+
const maxDepth = (0, import_config.getSetting)("maxDarkLightNesting") ?? 3;
|
|
57
|
+
for (const subName of names) {
|
|
58
|
+
const isDark = isDarkBase || subName.startsWith("dark_"),
|
|
59
|
+
isLight = !isDark && (isLightBase || subName.startsWith("light_"));
|
|
60
|
+
if (!(isDark || isLight)) {
|
|
61
|
+
selectorsSet.add(`${CNP}${subName}`);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const childSelector = `${CNP}${subName.replace(/^(dark|light)_/, "")}`,
|
|
65
|
+
order = isDark ? darkLight : lightDark,
|
|
66
|
+
[stronger, weaker] = order,
|
|
67
|
+
numSelectors = Math.round(maxDepth * 1.5);
|
|
68
|
+
for (let depth = 0; depth < numSelectors; depth++) {
|
|
69
|
+
const isOdd = depth % 2 === 1;
|
|
70
|
+
if (isOdd && depth < 3) continue;
|
|
71
|
+
const parents = new Array(depth + 1).fill(0).map((_, idx) => `${CNP}${idx % 2 === 0 ? stronger : weaker}`);
|
|
72
|
+
let parentSelectors = parents.length > 1 ? parents.slice(1) : parents;
|
|
73
|
+
if (isOdd) {
|
|
74
|
+
const [_first, second, ...rest] = parentSelectors;
|
|
75
|
+
parentSelectors = [second, ...rest, second];
|
|
76
|
+
}
|
|
77
|
+
const lastParentSelector = parentSelectors[parentSelectors.length - 1],
|
|
78
|
+
nextChildSelector = childSelector === lastParentSelector ? "" : childSelector,
|
|
79
|
+
parentSelectorString = parentSelectors.join(" ");
|
|
80
|
+
selectorsSet.add(`${parentSelectorString} ${nextChildSelector}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const selectors = [...selectorsSet].sort(import_sortString.sortString),
|
|
85
|
+
css = `${selectors.map(x => `:root${isBaseTheme(x) && (0, import_config.getSetting)("themeClassNameOnRoot") ? "" : " "}${x}`).join(", ")} {${vars}}`;
|
|
86
|
+
if (cssRuleSets.push(css), (0, import_config.getSetting)("shouldAddPrefersColorThemes")) {
|
|
87
|
+
const bgString = theme.background ? `background:${(0, import_createVariable.variableToString)(theme.background)};` : "",
|
|
88
|
+
fgString = theme.color ? `color:${(0, import_createVariable.variableToString)(theme.color)}` : "",
|
|
89
|
+
bodyRules = `body{${bgString}${fgString}}`,
|
|
90
|
+
isDark = themeName.startsWith("dark"),
|
|
91
|
+
baseName = isDark ? "dark" : "light",
|
|
92
|
+
themeRules = `${selectors.map(x => {
|
|
93
|
+
if (x == darkSelector || x === lightSelector) return ":root";
|
|
94
|
+
if (!(isDark && x.startsWith(lightSelector) || !isDark && x.startsWith(darkSelector))) return x.replace(/^\.t_(dark|light) /, "").trim();
|
|
95
|
+
}).filter(Boolean).join(", ")} {${vars}}`,
|
|
96
|
+
prefersMediaSelectors = `@media(prefers-color-scheme:${baseName}){
|
|
97
|
+
${bodyRules}
|
|
98
|
+
${themeRules}
|
|
99
|
+
}`;
|
|
100
|
+
cssRuleSets.push(prefersMediaSelectors);
|
|
101
|
+
}
|
|
102
|
+
const selectionStyles = (0, import_config.getSetting)("selectionStyles");
|
|
103
|
+
if (selectionStyles) {
|
|
104
|
+
const rules = selectionStyles(theme);
|
|
105
|
+
if (rules) {
|
|
106
|
+
const selectionSelectors = baseSelectors.map(s => `${s} ::selection`).join(", "),
|
|
107
|
+
styles = Object.entries(rules).flatMap(([k, v]) => v ? `${k === "backgroundColor" ? "background" : k}:${(0, import_createVariable.variableToString)(v)}` : []).join(";");
|
|
108
|
+
if (styles) {
|
|
109
|
+
const css2 = `${selectionSelectors}{${styles}}`;
|
|
110
|
+
cssRuleSets.push(css2);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return cssRuleSets;
|
|
116
|
+
}
|
|
117
|
+
const darkSelector = ".t_dark",
|
|
118
|
+
lightSelector = ".t_light",
|
|
119
|
+
isBaseTheme = x => x === darkSelector || x === lightSelector || x.startsWith(".t_dark ") || x.startsWith(".t_light ");
|
|
@@ -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 getThemeCSSRules_native_exports = {};
|
|
22
|
+
__export(getThemeCSSRules_native_exports, {
|
|
23
|
+
getThemeCSSRules: () => getThemeCSSRules
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(getThemeCSSRules_native_exports);
|
|
26
|
+
function getThemeCSSRules() {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 getVariantExtras_exports = {};
|
|
22
|
+
__export(getVariantExtras_exports, {
|
|
23
|
+
getFontsForLanguage: () => getFontsForLanguage,
|
|
24
|
+
getVariantExtras: () => getVariantExtras
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(getVariantExtras_exports);
|
|
27
|
+
var import_createVariable = require("../createVariable.cjs");
|
|
28
|
+
const cache = /* @__PURE__ */new WeakMap(),
|
|
29
|
+
getVariantExtras = styleState => {
|
|
30
|
+
if (cache.has(styleState)) return cache.get(styleState);
|
|
31
|
+
const {
|
|
32
|
+
props,
|
|
33
|
+
conf,
|
|
34
|
+
context,
|
|
35
|
+
theme
|
|
36
|
+
} = styleState;
|
|
37
|
+
let fonts = conf.fontsParsed;
|
|
38
|
+
context?.language && (fonts = getFontsForLanguage(conf.fontsParsed, context.language));
|
|
39
|
+
const next = {
|
|
40
|
+
fonts,
|
|
41
|
+
tokens: conf.tokensParsed,
|
|
42
|
+
theme,
|
|
43
|
+
get fontFamily() {
|
|
44
|
+
return (0, import_createVariable.getVariableValue)(styleState.fontFamily || styleState.props.fontFamily) || props.fontFamily || (0, import_createVariable.getVariableValue)(styleState.conf.defaultFont);
|
|
45
|
+
},
|
|
46
|
+
get font() {
|
|
47
|
+
return fonts[this.fontFamily] || (!props.fontFamily || props.fontFamily[0] === "$" ? fonts[styleState.conf.defaultFont] : void 0);
|
|
48
|
+
},
|
|
49
|
+
props
|
|
50
|
+
};
|
|
51
|
+
return cache.set(styleState, next), next;
|
|
52
|
+
},
|
|
53
|
+
fontLanguageCache = /* @__PURE__ */new WeakMap();
|
|
54
|
+
function getFontsForLanguage(fonts, language) {
|
|
55
|
+
if (fontLanguageCache.has(language)) return fontLanguageCache.get(language);
|
|
56
|
+
const next = {
|
|
57
|
+
...fonts,
|
|
58
|
+
...Object.fromEntries(Object.entries(language).map(([name, lang]) => {
|
|
59
|
+
if (lang === "default") return [];
|
|
60
|
+
const langKey = `$${name}_${lang}`;
|
|
61
|
+
return [`$${name}`, fonts[langKey]];
|
|
62
|
+
}))
|
|
63
|
+
};
|
|
64
|
+
return fontLanguageCache.set(language, next), next;
|
|
65
|
+
}
|