@tamagui/web 1.114.4 → 1.115.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/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
|
@@ -2,24 +2,33 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
7
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
15
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
18
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
23
32
|
var getSplitStyles_exports = {};
|
|
24
33
|
__export(getSplitStyles_exports, {
|
|
25
34
|
PROP_SPLIT: () => PROP_SPLIT,
|
|
@@ -28,7 +37,27 @@ __export(getSplitStyles_exports, {
|
|
|
28
37
|
useSplitStyles: () => useSplitStyles
|
|
29
38
|
});
|
|
30
39
|
module.exports = __toCommonJS(getSplitStyles_exports);
|
|
31
|
-
var import_react = __toESM(require("react")),
|
|
40
|
+
var import_react = __toESM(require("react")),
|
|
41
|
+
import_constants = require("@tamagui/constants"),
|
|
42
|
+
import_helpers = require("@tamagui/helpers"),
|
|
43
|
+
import_config = require("../config.cjs"),
|
|
44
|
+
import_accessibilityDirectMap = require("../constants/accessibilityDirectMap.cjs"),
|
|
45
|
+
import_constants2 = require("../constants/constants.cjs"),
|
|
46
|
+
import_isDevTools = require("../constants/isDevTools.cjs"),
|
|
47
|
+
import_useMedia = require("../hooks/useMedia.cjs"),
|
|
48
|
+
import_createMediaStyle = require("./createMediaStyle.cjs"),
|
|
49
|
+
import_expandStyles = require("./expandStyles.cjs"),
|
|
50
|
+
import_getGroupPropParts = require("./getGroupPropParts.cjs"),
|
|
51
|
+
import_getStylesAtomic = require("./getStylesAtomic.cjs"),
|
|
52
|
+
import_insertStyleRule = require("./insertStyleRule.cjs"),
|
|
53
|
+
import_log = require("./log.cjs"),
|
|
54
|
+
import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs"),
|
|
55
|
+
import_propMapper = require("./propMapper.cjs"),
|
|
56
|
+
import_pseudoDescriptors = require("./pseudoDescriptors.cjs"),
|
|
57
|
+
import_skipProps = require("./skipProps.cjs"),
|
|
58
|
+
import_transformsToString = require("./transformsToString.cjs"),
|
|
59
|
+
import_isActivePlatform = require("./isActivePlatform.cjs"),
|
|
60
|
+
import_sortString = require("./sortString.cjs");
|
|
32
61
|
const consoleGroupCollapsed = import_constants.isWeb ? console.groupCollapsed : console.info;
|
|
33
62
|
let conf;
|
|
34
63
|
const PROP_SPLIT = "-";
|
|
@@ -37,18 +66,35 @@ function isValidStyleKey(key, staticConfig) {
|
|
|
37
66
|
}
|
|
38
67
|
const getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
39
68
|
conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
|
|
40
|
-
const {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
69
|
+
const {
|
|
70
|
+
shorthands
|
|
71
|
+
} = conf,
|
|
72
|
+
{
|
|
73
|
+
isHOC,
|
|
74
|
+
isText,
|
|
75
|
+
isInput,
|
|
76
|
+
variants,
|
|
77
|
+
isReactNative,
|
|
78
|
+
inlineProps,
|
|
79
|
+
inlineWhenUnflattened,
|
|
80
|
+
parentStaticConfig,
|
|
81
|
+
acceptsClassName
|
|
82
|
+
} = staticConfig,
|
|
83
|
+
viewProps = {},
|
|
84
|
+
mediaState = styleProps.mediaState || import_useMedia.mediaState,
|
|
85
|
+
usedKeys = {},
|
|
86
|
+
shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames,
|
|
87
|
+
rulesToInsert = {},
|
|
88
|
+
classNames = {},
|
|
89
|
+
transforms = {};
|
|
90
|
+
let pseudos = null,
|
|
91
|
+
space = props.space,
|
|
92
|
+
hasMedia = !1,
|
|
93
|
+
dynamicThemeAccess,
|
|
94
|
+
pseudoGroups,
|
|
95
|
+
mediaGroups,
|
|
96
|
+
className = props.className || "",
|
|
97
|
+
mediaStylesSeen = 0;
|
|
52
98
|
const styleState = {
|
|
53
99
|
classNames,
|
|
54
100
|
conf,
|
|
@@ -71,62 +117,67 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
71
117
|
rulesToInsert,
|
|
72
118
|
componentState,
|
|
73
119
|
styleState,
|
|
74
|
-
theme: {
|
|
120
|
+
theme: {
|
|
121
|
+
...theme
|
|
122
|
+
}
|
|
75
123
|
}), console.groupEnd());
|
|
76
|
-
const {
|
|
124
|
+
const {
|
|
125
|
+
asChild
|
|
126
|
+
} = props,
|
|
127
|
+
{
|
|
128
|
+
accept
|
|
129
|
+
} = staticConfig,
|
|
130
|
+
{
|
|
131
|
+
noSkip,
|
|
132
|
+
disableExpandShorthands,
|
|
133
|
+
noExpand
|
|
134
|
+
} = styleProps,
|
|
135
|
+
{
|
|
136
|
+
webContainerType
|
|
137
|
+
} = conf.settings,
|
|
138
|
+
parentVariants = parentStaticConfig?.variants;
|
|
77
139
|
for (const keyOg in props) {
|
|
78
|
-
let keyInit = keyOg,
|
|
140
|
+
let keyInit = keyOg,
|
|
141
|
+
valInit = props[keyInit];
|
|
79
142
|
if (accept) {
|
|
80
143
|
const accepted = accept[keyInit];
|
|
81
144
|
if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") {
|
|
82
|
-
viewProps[keyInit] = getSubStyle(
|
|
83
|
-
styleState,
|
|
84
|
-
keyInit,
|
|
85
|
-
valInit,
|
|
86
|
-
styleProps.noClassNames
|
|
87
|
-
);
|
|
145
|
+
viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClassNames);
|
|
88
146
|
continue;
|
|
89
147
|
}
|
|
90
148
|
}
|
|
91
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || asChild && import_constants2.webViewFlexCompatStyles[keyInit] === valInit)
|
|
92
|
-
continue;
|
|
149
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && console.groupEnd(), disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys || asChild && import_constants2.webViewFlexCompatStyles[keyInit] === valInit) continue;
|
|
93
150
|
if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
|
|
94
151
|
if (keyInit === "group") {
|
|
95
|
-
const identifier = `t_group_${valInit}`,
|
|
96
|
-
"continer",
|
|
97
|
-
void 0,
|
|
98
|
-
identifier,
|
|
99
|
-
void 0,
|
|
100
|
-
[
|
|
101
|
-
`.${identifier} { container-name: ${valInit}; container-type: ${webContainerType || "inline-size"}; }`
|
|
102
|
-
]
|
|
103
|
-
];
|
|
152
|
+
const identifier = `t_group_${valInit}`,
|
|
153
|
+
containerCSS = ["continer", void 0, identifier, void 0, [`.${identifier} { container-name: ${valInit}; container-type: ${webContainerType || "inline-size"}; }`]];
|
|
104
154
|
addStyleToInsertRules(rulesToInsert, containerCSS);
|
|
105
155
|
}
|
|
106
156
|
continue;
|
|
107
157
|
}
|
|
108
|
-
const valInitType = typeof valInit,
|
|
158
|
+
const valInitType = typeof valInit,
|
|
159
|
+
isValidStyleKeyInit = isValidStyleKey(keyInit, staticConfig);
|
|
109
160
|
if (staticConfig.isReactNative && keyInit.startsWith("data-")) {
|
|
110
161
|
keyInit = keyInit.replace("data-", ""), viewProps.dataSet ||= {}, viewProps.dataSet[keyInit] = valInit;
|
|
111
162
|
continue;
|
|
112
163
|
}
|
|
113
164
|
if (isValidStyleKeyInit && valInitType === "string" && valInit[0] === "_") {
|
|
114
|
-
const isValidClassName = keyInit in import_helpers.validStyles,
|
|
115
|
-
|
|
116
|
-
|
|
165
|
+
const isValidClassName = keyInit in import_helpers.validStyles,
|
|
166
|
+
isMediaOrPseudo2 = !isValidClassName &&
|
|
167
|
+
// media are flattened for some reason to color-hover keys,
|
|
168
|
+
// we should probably just leave them in place to avoid extra complexity
|
|
169
|
+
keyInit.includes(PROP_SPLIT) && import_helpers.validStyles[keyInit.split(PROP_SPLIT)[0]];
|
|
117
170
|
if (isValidClassName || isMediaOrPseudo2) {
|
|
118
171
|
shouldDoClasses ? (mergeClassName(transforms, classNames, keyInit, valInit, isMediaOrPseudo2), styleState.style && delete styleState.style[keyInit]) : (styleState.style ||= {}, styleState.style[keyInit] = (0, import_normalizeValueWithProperty.reverseMapClassNameToValue)(keyInit, valInit), delete classNames[keyInit]);
|
|
119
172
|
continue;
|
|
120
173
|
}
|
|
121
174
|
}
|
|
122
175
|
if (keyInit === "dataSet") {
|
|
123
|
-
for (const keyInit2 in valInit)
|
|
124
|
-
viewProps[`data-${hyphenate(keyInit2)}`] = valInit[keyInit2];
|
|
176
|
+
for (const keyInit2 in valInit) viewProps[`data-${hyphenate(keyInit2)}`] = valInit[keyInit2];
|
|
125
177
|
continue;
|
|
126
178
|
}
|
|
127
179
|
if (!noExpand) {
|
|
128
|
-
if (keyInit === "disabled" && valInit === !0 && (viewProps["aria-disabled"] = !0, (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") && (viewProps.disabled = !0), !variants?.disabled))
|
|
129
|
-
continue;
|
|
180
|
+
if (keyInit === "disabled" && valInit === !0 && (viewProps["aria-disabled"] = !0, (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") && (viewProps.disabled = !0), !variants?.disabled)) continue;
|
|
130
181
|
if (keyInit === "testID") {
|
|
131
182
|
viewProps[isReactNative ? keyInit : "data-testid"] = valInit;
|
|
132
183
|
continue;
|
|
@@ -147,56 +198,68 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
147
198
|
continue;
|
|
148
199
|
}
|
|
149
200
|
switch (keyInit) {
|
|
150
|
-
case "accessibilityRole":
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
201
|
+
case "accessibilityRole":
|
|
202
|
+
{
|
|
203
|
+
valInit === "none" ? viewProps.role = "presentation" : viewProps.role = accessibilityRoleToWebRole[valInit] || valInit;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
154
206
|
case "accessibilityLabelledBy":
|
|
155
207
|
case "accessibilityFlowTo":
|
|
156
208
|
case "accessibilityControls":
|
|
157
|
-
case "accessibilityDescribedBy":
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
209
|
+
case "accessibilityDescribedBy":
|
|
210
|
+
{
|
|
211
|
+
viewProps[`aria-${keyInit.replace("accessibility", "").toLowerCase()}`] = processIDRefList(valInit);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
case "accessibilityKeyShortcuts":
|
|
215
|
+
{
|
|
216
|
+
Array.isArray(valInit) && (viewProps["aria-keyshortcuts"] = valInit.join(" "));
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
case "accessibilityLiveRegion":
|
|
220
|
+
{
|
|
221
|
+
viewProps["aria-live"] = valInit === "none" ? "off" : valInit;
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
case "accessibilityReadOnly":
|
|
225
|
+
{
|
|
226
|
+
viewProps["aria-readonly"] = valInit, (elementType === "input" || elementType === "select" || elementType === "textarea") && (viewProps.readOnly = !0);
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
case "accessibilityRequired":
|
|
230
|
+
{
|
|
231
|
+
viewProps["aria-required"] = valInit, (elementType === "input" || elementType === "select" || elementType === "textarea") && (viewProps.required = valInit);
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
177
234
|
default:
|
|
178
235
|
didUseKeyInit = !1;
|
|
179
236
|
}
|
|
180
237
|
}
|
|
181
|
-
if (didUseKeyInit)
|
|
182
|
-
continue;
|
|
238
|
+
if (didUseKeyInit) continue;
|
|
183
239
|
}
|
|
184
240
|
const isShorthand = keyInit in shorthands;
|
|
185
241
|
let isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
|
|
186
242
|
const isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant;
|
|
187
|
-
let isPseudo = keyInit in import_helpers.validPseudoKeys,
|
|
243
|
+
let isPseudo = keyInit in import_helpers.validPseudoKeys,
|
|
244
|
+
isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit),
|
|
245
|
+
isMediaOrPseudo = !!(isMedia || isPseudo);
|
|
188
246
|
if (isMediaOrPseudo && keyInit.startsWith("$group-")) {
|
|
189
247
|
const name = keyInit.split("-")[1];
|
|
190
248
|
context?.groups.subscribe && !context?.groups.state[name] && (keyInit = keyInit.replace("$group-", "$group-true-"));
|
|
191
249
|
}
|
|
192
250
|
const isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand || isShorthand;
|
|
193
|
-
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web"))
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
251
|
+
if (isStyleProp && (asChild === "except-style" || asChild === "except-style-web")) continue;
|
|
252
|
+
const shouldPassProp = !isStyleProp && isHOC ||
|
|
253
|
+
// is in parent variants
|
|
254
|
+
isHOC && parentVariants && keyInit in parentVariants || inlineProps?.has(keyInit),
|
|
255
|
+
parentVariant = parentVariants?.[keyInit],
|
|
256
|
+
isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentVariant || keyInit in import_skipProps.skipProps)),
|
|
257
|
+
shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
258
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupEnd(), console.groupEnd(), consoleGroupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`), (0, import_log.log)({
|
|
259
|
+
isVariant,
|
|
260
|
+
valInit,
|
|
261
|
+
shouldPassProp
|
|
262
|
+
}), import_constants.isClient && (0, import_log.log)({
|
|
200
263
|
variants,
|
|
201
264
|
variant: variants?.[keyInit],
|
|
202
265
|
isVariant,
|
|
@@ -211,7 +274,8 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
211
274
|
continue;
|
|
212
275
|
}
|
|
213
276
|
(isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
214
|
-
const avoidPropMap = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit,
|
|
277
|
+
const avoidPropMap = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit,
|
|
278
|
+
expanded = avoidPropMap ? null : (0, import_propMapper.propMapper)(keyInit, valInit, styleState);
|
|
215
279
|
if (!avoidPropMap) {
|
|
216
280
|
if (!expanded) continue;
|
|
217
281
|
const next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
@@ -228,17 +292,21 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
228
292
|
variant: variants?.[keyInit],
|
|
229
293
|
shouldPassProp,
|
|
230
294
|
isHOCShouldPassThrough,
|
|
231
|
-
usedKeys: {
|
|
295
|
+
usedKeys: {
|
|
296
|
+
...usedKeys
|
|
297
|
+
}
|
|
232
298
|
}), globalThis.tamaguiAvoidTracking = !0, (0, import_log.log)("expanded", expanded, `
|
|
233
|
-
usedKeys`, {
|
|
299
|
+
usedKeys`, {
|
|
300
|
+
...usedKeys
|
|
301
|
+
}, `
|
|
234
302
|
current`, {
|
|
235
303
|
...styleState.style
|
|
236
304
|
}), globalThis.tamaguiAvoidTracking = !1);
|
|
237
|
-
} catch {
|
|
238
|
-
}
|
|
305
|
+
} catch {}
|
|
239
306
|
console.groupEnd();
|
|
240
307
|
}
|
|
241
|
-
let key = keyInit,
|
|
308
|
+
let key = keyInit,
|
|
309
|
+
val = valInit;
|
|
242
310
|
const max = expanded ? expanded.length : 1;
|
|
243
311
|
for (let i = 0; i < max; i++) {
|
|
244
312
|
if (expanded) {
|
|
@@ -247,49 +315,53 @@ current`, {
|
|
|
247
315
|
}
|
|
248
316
|
if (val == null || key in usedKeys) continue;
|
|
249
317
|
if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key in variants, (inlineProps?.has(key) || process.env.IS_STATIC === "is_static" && inlineWhenUnflattened?.has(key)) && (viewProps[key] = props[key] ?? val), styleProps.noExpand && isPseudo || isHOC && (isMediaOrPseudo || parentStaticConfig?.variants?.[keyInit])) {
|
|
250
|
-
passDownProp(viewProps, key, val, isMediaOrPseudo), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(` - passing down prop ${key}`), (0, import_log.log)({
|
|
318
|
+
passDownProp(viewProps, key, val, isMediaOrPseudo), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed(` - passing down prop ${key}`), (0, import_log.log)({
|
|
319
|
+
val,
|
|
320
|
+
after: {
|
|
321
|
+
...viewProps[key]
|
|
322
|
+
}
|
|
323
|
+
}), console.groupEnd());
|
|
251
324
|
continue;
|
|
252
325
|
}
|
|
253
326
|
if (isPseudo) {
|
|
254
327
|
if (!val) continue;
|
|
255
|
-
const pseudoStyleObject = getSubStyle(
|
|
256
|
-
|
|
257
|
-
key,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
|
|
261
|
-
if (!descriptor)
|
|
262
|
-
continue;
|
|
328
|
+
const pseudoStyleObject = getSubStyle(styleState, key, val, styleProps.noClassNames),
|
|
329
|
+
descriptor = import_pseudoDescriptors.pseudoDescriptors[key],
|
|
330
|
+
isEnter = key === "enterStyle",
|
|
331
|
+
isExit = key === "exitStyle";
|
|
332
|
+
if (!descriptor) continue;
|
|
263
333
|
if ((!shouldDoClasses || process.env.IS_STATIC === "is_static") && (pseudos ||= {}, pseudos[key] ||= {}, process.env.IS_STATIC === "is_static")) {
|
|
264
334
|
Object.assign(pseudos[key], pseudoStyleObject);
|
|
265
335
|
continue;
|
|
266
336
|
}
|
|
267
337
|
if (shouldDoClasses && !isExit) {
|
|
268
338
|
const pseudoStyles = (0, import_getStylesAtomic.getStyleAtomic)(pseudoStyleObject, descriptor);
|
|
269
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo (classes)", key), (0, import_log.log)({
|
|
339
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo (classes)", key), (0, import_log.log)({
|
|
340
|
+
pseudoStyleObject,
|
|
341
|
+
pseudoStyles
|
|
342
|
+
}), console.groupEnd());
|
|
270
343
|
for (const psuedoStyle of pseudoStyles) {
|
|
271
344
|
const fullKey = `${psuedoStyle[import_helpers.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
|
|
272
|
-
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(
|
|
273
|
-
transforms,
|
|
274
|
-
classNames,
|
|
275
|
-
fullKey,
|
|
276
|
-
psuedoStyle[import_helpers.StyleObjectIdentifier],
|
|
277
|
-
isMediaOrPseudo,
|
|
278
|
-
!0
|
|
279
|
-
));
|
|
345
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(transforms, classNames, fullKey, psuedoStyle[import_helpers.StyleObjectIdentifier], isMediaOrPseudo, !0));
|
|
280
346
|
}
|
|
281
347
|
}
|
|
282
348
|
if (!shouldDoClasses || isExit || isEnter) {
|
|
283
349
|
const descriptorKey = descriptor.stateKey || descriptor.name;
|
|
284
350
|
let isDisabled = componentState[descriptorKey] === !1;
|
|
285
|
-
isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo", key, {
|
|
351
|
+
isExit && (isDisabled = !styleProps.isExiting), isEnter && componentState.unmounted === !1 && (isDisabled = !0), process.env.NODE_ENV === "development" && debug === "verbose" && (consoleGroupCollapsed("pseudo", key, {
|
|
352
|
+
isDisabled
|
|
353
|
+
}), (0, import_log.log)({
|
|
354
|
+
pseudoStyleObject,
|
|
355
|
+
isDisabled,
|
|
356
|
+
descriptor,
|
|
357
|
+
componentState
|
|
358
|
+
}), console.groupEnd());
|
|
286
359
|
const importance = descriptor.priority;
|
|
287
360
|
for (const pkey in pseudoStyleObject) {
|
|
288
361
|
const val2 = pseudoStyleObject[pkey];
|
|
289
|
-
if (isDisabled)
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
|
|
362
|
+
if (isDisabled) applyDefaultStyle(pkey, styleState);else {
|
|
363
|
+
const curImportance = usedKeys[pkey] || 0,
|
|
364
|
+
shouldMerge = importance >= curImportance;
|
|
293
365
|
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(" subKey", pkey, shouldMerge, {
|
|
294
366
|
importance,
|
|
295
367
|
curImportance,
|
|
@@ -298,19 +370,18 @@ current`, {
|
|
|
298
370
|
});
|
|
299
371
|
}
|
|
300
372
|
}
|
|
301
|
-
if (!isDisabled)
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
373
|
+
if (!isDisabled) for (const key2 in val) {
|
|
374
|
+
const k = shorthands[key2] || key2;
|
|
375
|
+
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
376
|
+
}
|
|
306
377
|
}
|
|
307
378
|
continue;
|
|
308
379
|
}
|
|
309
380
|
if (isMedia) {
|
|
310
381
|
if (!val) continue;
|
|
311
|
-
const hasSpace = val.space,
|
|
312
|
-
|
|
313
|
-
|
|
382
|
+
const hasSpace = val.space,
|
|
383
|
+
mediaKeyShort = key.slice(isMedia == "theme" ? 7 : 1);
|
|
384
|
+
if (hasMedia ||= !0, (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && (typeof hasMedia != "object" && (hasMedia = {}), hasMedia[mediaKeyShort] = !0), isMedia === "platform" && !(0, import_isActivePlatform.isActivePlatform)(key)) continue;
|
|
314
385
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} ${key}`, {
|
|
315
386
|
key,
|
|
316
387
|
val,
|
|
@@ -322,55 +393,26 @@ current`, {
|
|
|
322
393
|
}), shouldDoClasses) {
|
|
323
394
|
const mediaStyle = getSubStyle(styleState, key, val, !1);
|
|
324
395
|
if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
|
|
325
|
-
const importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(
|
|
326
|
-
|
|
327
|
-
"space",
|
|
328
|
-
usedKeys,
|
|
329
|
-
!0
|
|
330
|
-
);
|
|
331
|
-
importance && (space = val.space, usedKeys.space = importance, process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(
|
|
332
|
-
`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`
|
|
333
|
-
));
|
|
396
|
+
const importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", usedKeys, !0);
|
|
397
|
+
importance && (space = val.space, usedKeys.space = importance, process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`));
|
|
334
398
|
}
|
|
335
|
-
const mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle),
|
|
399
|
+
const mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle),
|
|
400
|
+
priority = mediaStylesSeen;
|
|
336
401
|
mediaStylesSeen += 1;
|
|
337
402
|
for (const style of mediaStyles) {
|
|
338
403
|
const property = style[0];
|
|
339
|
-
if (property[0] === "$" && property.startsWith("$platform") && !(0, import_isActivePlatform.isActivePlatform)(property))
|
|
340
|
-
|
|
341
|
-
const out = (0, import_createMediaStyle.createMediaStyle)(
|
|
342
|
-
style,
|
|
343
|
-
mediaKeyShort,
|
|
344
|
-
import_useMedia.mediaQueryConfig,
|
|
345
|
-
isMedia,
|
|
346
|
-
!1,
|
|
347
|
-
priority
|
|
348
|
-
);
|
|
404
|
+
if (property[0] === "$" && property.startsWith("$platform") && !(0, import_isActivePlatform.isActivePlatform)(property)) continue;
|
|
405
|
+
const out = (0, import_createMediaStyle.createMediaStyle)(style, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority);
|
|
349
406
|
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)("\u{1F4FA} media style:", out);
|
|
350
407
|
const fullKey = `${style[import_helpers.StyleObjectProperty]}${PROP_SPLIT}${mediaKeyShort}${style[import_helpers.StyleObjectPseudo] || ""}`;
|
|
351
|
-
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(
|
|
352
|
-
transforms,
|
|
353
|
-
classNames,
|
|
354
|
-
fullKey,
|
|
355
|
-
out[import_helpers.StyleObjectIdentifier],
|
|
356
|
-
!0,
|
|
357
|
-
!0
|
|
358
|
-
));
|
|
408
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey, out[import_helpers.StyleObjectIdentifier], !0, !0));
|
|
359
409
|
}
|
|
360
410
|
} else {
|
|
361
|
-
let mergeMediaStyle = function(key2, val2) {
|
|
362
|
-
styleState.style ||= {}, mergeMediaByImportance(
|
|
363
|
-
styleState,
|
|
364
|
-
mediaKeyShort,
|
|
365
|
-
key2,
|
|
366
|
-
val2,
|
|
367
|
-
usedKeys,
|
|
368
|
-
mediaState[mediaKeyShort],
|
|
369
|
-
importanceBump,
|
|
370
|
-
debug
|
|
371
|
-
) && key2 === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
411
|
+
let mergeMediaStyle = function (key2, val2) {
|
|
412
|
+
styleState.style ||= {}, mergeMediaByImportance(styleState, mediaKeyShort, key2, val2, usedKeys, mediaState[mediaKeyShort], importanceBump, debug) && key2 === "fontFamily" && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
372
413
|
};
|
|
373
|
-
const isThemeMedia = isMedia === "theme",
|
|
414
|
+
const isThemeMedia = isMedia === "theme",
|
|
415
|
+
isGroupMedia = isMedia === "group";
|
|
374
416
|
if (!isThemeMedia && !(isMedia === "platform") && !isGroupMedia) {
|
|
375
417
|
if (!mediaState[mediaKeyShort]) {
|
|
376
418
|
process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F4FA} \u274C DISABLED ${mediaKeyShort}`);
|
|
@@ -383,35 +425,36 @@ current`, {
|
|
|
383
425
|
if (isThemeMedia) {
|
|
384
426
|
dynamicThemeAccess = !0;
|
|
385
427
|
const mediaThemeName = mediaKeyShort.slice(6);
|
|
386
|
-
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
|
|
387
|
-
continue;
|
|
428
|
+
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName))) continue;
|
|
388
429
|
} else if (isGroupMedia) {
|
|
389
|
-
const groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort),
|
|
430
|
+
const groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort),
|
|
431
|
+
groupName = groupInfo.name,
|
|
432
|
+
groupContext = context?.groups.state[groupName];
|
|
390
433
|
if (!groupContext) {
|
|
391
434
|
process.env.NODE_ENV === "development" && debug && (0, import_log.log)(`No parent with group prop, skipping styles: ${groupName}`);
|
|
392
435
|
continue;
|
|
393
436
|
}
|
|
394
|
-
const groupPseudoKey = groupInfo.pseudo,
|
|
437
|
+
const groupPseudoKey = groupInfo.pseudo,
|
|
438
|
+
groupMediaKey = groupInfo.media,
|
|
439
|
+
componentGroupState = componentState.group?.[groupName];
|
|
395
440
|
if (groupMediaKey) {
|
|
396
|
-
mediaGroups ||= /* @__PURE__ */
|
|
441
|
+
mediaGroups ||= /* @__PURE__ */new Set(), mediaGroups.add(groupMediaKey);
|
|
397
442
|
const mediaState2 = componentGroupState?.media;
|
|
398
443
|
let isActive = mediaState2?.[groupMediaKey];
|
|
399
444
|
if (!mediaState2 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`), !isActive) {
|
|
400
|
-
for (const pkey in mediaStyle)
|
|
401
|
-
applyDefaultStyle(pkey, styleState);
|
|
445
|
+
for (const pkey in mediaStyle) applyDefaultStyle(pkey, styleState);
|
|
402
446
|
continue;
|
|
403
447
|
}
|
|
404
448
|
importanceBump = 2;
|
|
405
449
|
}
|
|
406
450
|
if (groupPseudoKey) {
|
|
407
|
-
pseudoGroups ||= /* @__PURE__ */
|
|
408
|
-
const isActive = (componentGroupState ||
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
), !isActive) {
|
|
413
|
-
for (const pkey in mediaStyle)
|
|
414
|
-
applyDefaultStyle(pkey, styleState);
|
|
451
|
+
pseudoGroups ||= /* @__PURE__ */new Set(), pseudoGroups.add(groupName);
|
|
452
|
+
const isActive = (componentGroupState ||
|
|
453
|
+
// fallback to context initially
|
|
454
|
+
context.groups.state[groupName]).pseudo?.[groupPseudoKey],
|
|
455
|
+
priority = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
|
|
456
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive}, priority ${priority}`), !isActive) {
|
|
457
|
+
for (const pkey in mediaStyle) applyDefaultStyle(pkey, styleState);
|
|
415
458
|
continue;
|
|
416
459
|
}
|
|
417
460
|
importanceBump = priority;
|
|
@@ -423,104 +466,95 @@ current`, {
|
|
|
423
466
|
continue;
|
|
424
467
|
}
|
|
425
468
|
if (subKey[0] === "$") {
|
|
426
|
-
if (!(0, import_isActivePlatform.isActivePlatform)(subKey))
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
mergeMediaStyle(subSubKey, mediaStyle[subKey][subSubKey]);
|
|
430
|
-
} else
|
|
431
|
-
mergeMediaStyle(subKey, mediaStyle[subKey]);
|
|
469
|
+
if (!(0, import_isActivePlatform.isActivePlatform)(subKey)) continue;
|
|
470
|
+
for (const subSubKey in mediaStyle[subKey]) mergeMediaStyle(subSubKey, mediaStyle[subKey][subSubKey]);
|
|
471
|
+
} else mergeMediaStyle(subKey, mediaStyle[subKey]);
|
|
432
472
|
}
|
|
433
473
|
}
|
|
434
474
|
continue;
|
|
435
475
|
}
|
|
436
476
|
if (
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
) {
|
|
477
|
+
// is HOC we can just pass through the styles as props
|
|
478
|
+
// this fixes issues where style prop got merged with wrong priority
|
|
479
|
+
!isHOC && isValidStyleKey(key, staticConfig)) {
|
|
441
480
|
mergeStyle(styleState, key, val);
|
|
442
481
|
continue;
|
|
443
482
|
}
|
|
444
483
|
if (!isVariant) {
|
|
445
|
-
if (styleProps.styledContextProps && key in styleProps.styledContextProps)
|
|
446
|
-
continue;
|
|
484
|
+
if (styleProps.styledContextProps && key in styleProps.styledContextProps) continue;
|
|
447
485
|
viewProps[key] = val;
|
|
448
486
|
}
|
|
449
487
|
}
|
|
450
488
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
451
489
|
try {
|
|
452
|
-
(0, import_log.log)(" \u2714\uFE0F expand complete", keyInit), (0, import_log.log)("style", {
|
|
453
|
-
|
|
454
|
-
|
|
490
|
+
(0, import_log.log)(" \u2714\uFE0F expand complete", keyInit), (0, import_log.log)("style", {
|
|
491
|
+
...styleState.style
|
|
492
|
+
}), (0, import_log.log)("transforms", {
|
|
493
|
+
...transforms
|
|
494
|
+
}), (0, import_log.log)("viewProps", {
|
|
495
|
+
...viewProps
|
|
496
|
+
});
|
|
497
|
+
} catch {}
|
|
455
498
|
console.groupEnd();
|
|
456
499
|
}
|
|
457
500
|
}
|
|
458
501
|
if (!(styleProps.noNormalize === !1) && (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), import_constants.isWeb && !isReactNative && (0, import_getStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms && (styleState.style ||= {}, Object.entries(styleState.flatTransforms).sort(([a], [b]) => (0, import_sortString.sortString)(a, b)).forEach(([key, val]) => {
|
|
459
502
|
mergeTransform(styleState.style, key, val, !0);
|
|
460
503
|
})), parentSplitStyles)) {
|
|
461
|
-
if (shouldDoClasses)
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
if (!shouldDoClasses)
|
|
467
|
-
for (const key in parentSplitStyles.style)
|
|
468
|
-
key in classNames || styleState.style && key in styleState.style || (styleState.style ||= {}, styleState.style[key] = parentSplitStyles.style[key]);
|
|
504
|
+
if (shouldDoClasses) for (const key in parentSplitStyles.classNames) {
|
|
505
|
+
const val = parentSplitStyles.classNames[key];
|
|
506
|
+
styleState.style && key in styleState.style || key in classNames || (classNames[key] = val);
|
|
507
|
+
}
|
|
508
|
+
if (!shouldDoClasses) for (const key in parentSplitStyles.style) key in classNames || styleState.style && key in styleState.style || (styleState.style ||= {}, styleState.style[key] = parentSplitStyles.style[key]);
|
|
469
509
|
}
|
|
470
510
|
if (!styleProps.noNormalize && !staticConfig.isReactNative && !staticConfig.isHOC && (!styleProps.isAnimated || conf.animations.supportsCSSVars) && Array.isArray(styleState.style?.transform) && (styleState.style.transform = (0, import_transformsToString.transformsToString)(styleState.style.transform)), styleState.style && shouldDoClasses) {
|
|
471
|
-
let retainedStyles,
|
|
511
|
+
let retainedStyles,
|
|
512
|
+
shouldRetain = !1;
|
|
472
513
|
if (!styleState.style.$$css) {
|
|
473
514
|
const atomic = (0, import_getStylesAtomic.getStylesAtomic)(styleState.style);
|
|
474
515
|
for (const atomicStyle of atomic) {
|
|
475
|
-
const [key, value, identifier] = atomicStyle,
|
|
516
|
+
const [key, value, identifier] = atomicStyle,
|
|
517
|
+
isAnimatedAndAnimateOnly = styleProps.isAnimated && styleProps.noClassNames && (!props.animateOnly || props.animateOnly.includes(key)),
|
|
518
|
+
nonAnimatedAnimateOnly = !isAnimatedAndAnimateOnly && !styleProps.isAnimated && props.animateOnly?.includes(key);
|
|
476
519
|
isAnimatedAndAnimateOnly ? (retainedStyles ||= {}, retainedStyles[key] = styleState.style[key]) : nonAnimatedAnimateOnly ? (retainedStyles ||= {}, retainedStyles[key] = value, shouldRetain = !0) : (addStyleToInsertRules(rulesToInsert, atomicStyle), mergeClassName(transforms, classNames, key, identifier, !1, !0));
|
|
477
520
|
}
|
|
478
521
|
process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupEnd(), consoleGroupCollapsed("\u{1F539} getSplitStyles final style object"), console.info(styleState.style), console.groupEnd()), (shouldRetain || process.env.IS_STATIC !== "is_static") && (styleState.style = retainedStyles || {});
|
|
479
522
|
}
|
|
480
|
-
if (transforms)
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
namespace,
|
|
491
|
-
val,
|
|
492
|
-
identifier,
|
|
493
|
-
void 0,
|
|
494
|
-
[rule]
|
|
495
|
-
]);
|
|
496
|
-
}
|
|
497
|
-
classNames[namespace] = identifier;
|
|
523
|
+
if (transforms) for (const namespace in transforms) {
|
|
524
|
+
if (!transforms[namespace]) {
|
|
525
|
+
process.env.NODE_ENV === "development" && (0, import_log.log)("Error no transform", transforms, namespace);
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
528
|
+
const [hash, val] = transforms[namespace],
|
|
529
|
+
identifier = `_transform${hash}`;
|
|
530
|
+
if (import_constants.isClient && !import_insertStyleRule.insertedTransforms[identifier]) {
|
|
531
|
+
const rule = `.${identifier} { transform: ${val}; }`;
|
|
532
|
+
addStyleToInsertRules(rulesToInsert, [namespace, val, identifier, void 0, [rule]]);
|
|
498
533
|
}
|
|
534
|
+
classNames[namespace] = identifier;
|
|
535
|
+
}
|
|
499
536
|
}
|
|
500
|
-
if (isReactNative)
|
|
501
|
-
viewProps.tabIndex === 0 && (viewProps.accessible ??= !0);
|
|
502
|
-
else if (viewProps.tabIndex == null) {
|
|
537
|
+
if (isReactNative) viewProps.tabIndex === 0 && (viewProps.accessible ??= !0);else if (viewProps.tabIndex == null) {
|
|
503
538
|
const isFocusable = viewProps.focusable ?? viewProps.accessible;
|
|
504
539
|
viewProps.focusable && delete viewProps.focusable;
|
|
505
540
|
const role = viewProps.role;
|
|
506
|
-
isFocusable === !1 && (viewProps.tabIndex = "-1"),
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
541
|
+
isFocusable === !1 && (viewProps.tabIndex = "-1"),
|
|
542
|
+
// These native elements are focusable by default
|
|
543
|
+
elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea" ? (isFocusable === !1 || props.accessibilityDisabled === !0) && (viewProps.tabIndex = "-1") :
|
|
544
|
+
// These roles are made focusable by default
|
|
545
|
+
(role === "button" || role === "checkbox" || role === "link" || role === "radio" ||
|
|
546
|
+
// @ts-expect-error (consistent with RNW)
|
|
547
|
+
role === "textbox" || role === "switch") && isFocusable !== !1 && (viewProps.tabIndex = "0"), isFocusable && (viewProps.tabIndex = "0", delete viewProps.focusable);
|
|
512
548
|
}
|
|
513
549
|
const styleProp = props.style;
|
|
514
|
-
if (styleProp)
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
const style = isArray ? styleProp[i] : styleProp;
|
|
521
|
-
style && (style.$$css ? Object.assign(styleState.classNames, style) : (styleState.style ||= {}, Object.assign(styleState.style, normalizeStyle(style))));
|
|
522
|
-
}
|
|
550
|
+
if (styleProp) if (isHOC) viewProps.style = normalizeStyle(styleProp);else {
|
|
551
|
+
const isArray = Array.isArray(styleProp),
|
|
552
|
+
len = isArray ? styleProp.length : 1;
|
|
553
|
+
for (let i = 0; i < len; i++) {
|
|
554
|
+
const style = isArray ? styleProp[i] : styleProp;
|
|
555
|
+
style && (style.$$css ? Object.assign(styleState.classNames, style) : (styleState.style ||= {}, Object.assign(styleState.style, normalizeStyle(style))));
|
|
523
556
|
}
|
|
557
|
+
}
|
|
524
558
|
const result = {
|
|
525
559
|
space,
|
|
526
560
|
hasMedia,
|
|
@@ -539,21 +573,20 @@ current`, {
|
|
|
539
573
|
{
|
|
540
574
|
let fontFamily = isText || isInput ? styleState.fontFamily || staticConfig.defaultProps?.fontFamily : null;
|
|
541
575
|
fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
|
|
542
|
-
const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "",
|
|
576
|
+
const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "",
|
|
577
|
+
groupClassName = props.group ? `t_group_${props.group}` : "",
|
|
578
|
+
componentNameFinal = props.componentName || staticConfig.componentName,
|
|
579
|
+
componentClassName = props.asChild || !componentNameFinal ? "" : `is_${componentNameFinal}`;
|
|
543
580
|
let classList = [];
|
|
544
581
|
componentClassName && classList.push(componentClassName), fontFamilyClassName && classList.push(fontFamilyClassName), classNames && classList.push(Object.values(classNames).join(" ")), groupClassName && classList.push(groupClassName), props.className && classList.push(props.className);
|
|
545
582
|
const finalClassName = classList.join(" ");
|
|
546
|
-
if (styleProps.noMergeStyle)
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
cnStyles[name] = name;
|
|
554
|
-
viewProps.style = [...Array.isArray(style) ? style : [style], cnStyles];
|
|
555
|
-
} else
|
|
556
|
-
finalClassName && (viewProps.className = finalClassName), style && (viewProps.style = style);
|
|
583
|
+
if (styleProps.noMergeStyle) finalClassName && (viewProps.className = finalClassName);else if (styleProps.isAnimated && !conf.animations.supportsCSSVars && isReactNative) style && (viewProps.style = style);else if (isReactNative) {
|
|
584
|
+
const cnStyles = {
|
|
585
|
+
$$css: !0
|
|
586
|
+
};
|
|
587
|
+
for (const name of finalClassName.split(" ")) cnStyles[name] = name;
|
|
588
|
+
viewProps.style = [...(Array.isArray(style) ? style : [style]), cnStyles];
|
|
589
|
+
} else finalClassName && (viewProps.className = finalClassName), style && (viewProps.style = style);
|
|
557
590
|
}
|
|
558
591
|
}
|
|
559
592
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
|
|
@@ -568,54 +601,56 @@ current`, {
|
|
|
568
601
|
rulesToInsert,
|
|
569
602
|
parentSplitStyles
|
|
570
603
|
};
|
|
571
|
-
for (const key in logs)
|
|
572
|
-
|
|
573
|
-
} catch {
|
|
574
|
-
}
|
|
604
|
+
for (const key in logs) (0, import_log.log)(key, logs[key]);
|
|
605
|
+
} catch {}
|
|
575
606
|
console.groupEnd();
|
|
576
607
|
}
|
|
577
608
|
return result;
|
|
578
609
|
};
|
|
579
610
|
function mergeClassName(transforms, classNames, key, val, isMediaOrPseudo = !1, isInsertingNow = !1) {
|
|
580
|
-
if (val)
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
} else
|
|
586
|
-
classNames[key] = val;
|
|
611
|
+
if (val) if (!isInsertingNow && val[0] === "_" && val.startsWith("_transform-")) {
|
|
612
|
+
const ns = isMediaOrPseudo ? key : "transform";
|
|
613
|
+
let transform = import_insertStyleRule.insertedTransforms[val];
|
|
614
|
+
import_constants.isClient && !transform && ((0, import_insertStyleRule.scanAllSheets)(), transform = import_insertStyleRule.insertedTransforms[val], !transform && import_constants.isWeb && val[0] !== "_" && (transform = val)), transforms[ns] ||= ["", ""], transforms[ns][0] += val.replace("_transform", ""), transform && (transforms[ns][1] += transform);
|
|
615
|
+
} else classNames[key] = val;
|
|
587
616
|
}
|
|
588
617
|
function mergeStyle(styleState, key, val, disableNormalize = !1) {
|
|
589
|
-
const {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
618
|
+
const {
|
|
619
|
+
classNames,
|
|
620
|
+
viewProps,
|
|
621
|
+
usedKeys,
|
|
622
|
+
styleProps,
|
|
623
|
+
staticConfig
|
|
624
|
+
} = styleState;
|
|
625
|
+
if (import_constants.isWeb && val?.[0] === "_") classNames[key] = val, usedKeys[key] ||= 1;else if (key in import_helpers.stylePropsTransform) styleState.flatTransforms ||= {}, styleState.flatTransforms[key] = val;else {
|
|
595
626
|
const out = import_constants.isWeb && !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
596
627
|
// accept is for props not styles
|
|
597
628
|
staticConfig.accept && key in staticConfig.accept ? viewProps[key] = out : (styleState.style ||= {}, styleState.style[key] = out);
|
|
598
629
|
}
|
|
599
630
|
}
|
|
600
631
|
const getSubStyle = (styleState, subKey, styleIn, avoidMergeTransform) => {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
632
|
+
const {
|
|
633
|
+
staticConfig,
|
|
634
|
+
conf: conf2,
|
|
635
|
+
styleProps
|
|
636
|
+
} = styleState,
|
|
637
|
+
styleOut = {};
|
|
638
|
+
for (let key in styleIn) {
|
|
639
|
+
const val = styleIn[key];
|
|
640
|
+
key = conf2.shorthands[key] || key;
|
|
641
|
+
const expanded = (0, import_propMapper.propMapper)(key, val, styleState);
|
|
642
|
+
if (!(!expanded || !staticConfig.isHOC && key in import_skipProps.skipProps && !styleProps.noSkip)) for (let [skey, sval] of expanded) skey in import_helpers.validPseudoKeys && (sval = getSubStyle(styleState, skey, sval, avoidMergeTransform)), !avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = styleProps.noNormalize ? sval : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
643
|
+
}
|
|
644
|
+
return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
645
|
+
},
|
|
646
|
+
useInsertEffectCompat = import_constants.isWeb ? import_react.default.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : () => {},
|
|
647
|
+
useSplitStyles = (a, b, c, d, e, f, g, h, i, j) => {
|
|
648
|
+
conf = conf || (0, import_config.getConfig)();
|
|
649
|
+
const res = getSplitStyles(a, b, c, d, e, f, g, h, i, j);
|
|
650
|
+
return process.env.TAMAGUI_REACT_19 || useInsertEffectCompat(() => {
|
|
651
|
+
(0, import_insertStyleRule.insertStyleRules)(res.rulesToInsert);
|
|
652
|
+
}, [res.rulesToInsert]), res;
|
|
653
|
+
};
|
|
619
654
|
function addStyleToInsertRules(rulesToInsert, styleObject) {
|
|
620
655
|
{
|
|
621
656
|
const identifier = styleObject[import_helpers.StyleObjectIdentifier];
|
|
@@ -625,33 +660,37 @@ function addStyleToInsertRules(rulesToInsert, styleObject) {
|
|
|
625
660
|
function processIDRefList(idRefList) {
|
|
626
661
|
return Array.isArray(idRefList) ? idRefList.join(" ") : idRefList;
|
|
627
662
|
}
|
|
628
|
-
const defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)",
|
|
629
|
-
|
|
630
|
-
Object.entries(import_helpers.tokenCategories.color).map(([k, v]) => [k, defaultColor])
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
663
|
+
const defaultColor = process.env.TAMAGUI_DEFAULT_COLOR || "rgba(0,0,0,0)",
|
|
664
|
+
animatableDefaults = {
|
|
665
|
+
...Object.fromEntries(Object.entries(import_helpers.tokenCategories.color).map(([k, v]) => [k, defaultColor])),
|
|
666
|
+
opacity: 1,
|
|
667
|
+
scale: 1,
|
|
668
|
+
rotate: "0deg",
|
|
669
|
+
rotateY: "0deg",
|
|
670
|
+
rotateX: "0deg",
|
|
671
|
+
x: 0,
|
|
672
|
+
y: 0,
|
|
673
|
+
borderRadius: 0
|
|
674
|
+
},
|
|
675
|
+
lowercaseHyphenate = match => `-${match.toLowerCase()}`,
|
|
676
|
+
hyphenate = str => str.replace(/[A-Z]/g, lowercaseHyphenate),
|
|
677
|
+
mergeTransform = (obj, key, val, backwards = !1) => {
|
|
678
|
+
typeof obj.transform != "string" && (obj.transform ||= [], obj.transform[backwards ? "unshift" : "push"]({
|
|
679
|
+
[mapTransformKeys[key] || key]: val
|
|
680
|
+
}));
|
|
681
|
+
},
|
|
682
|
+
mapTransformKeys = {
|
|
683
|
+
x: "translateX",
|
|
684
|
+
y: "translateY"
|
|
685
|
+
},
|
|
686
|
+
accessibilityRoleToWebRole = {
|
|
687
|
+
adjustable: "slider",
|
|
688
|
+
header: "heading",
|
|
689
|
+
image: "img",
|
|
690
|
+
link: "link",
|
|
691
|
+
none: "presentation",
|
|
692
|
+
summary: "region"
|
|
693
|
+
};
|
|
655
694
|
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
656
695
|
if (shouldMergeObject) {
|
|
657
696
|
const next = {
|
|
@@ -659,28 +698,17 @@ function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
|
659
698
|
...val
|
|
660
699
|
};
|
|
661
700
|
delete viewProps[key], viewProps[key] = next;
|
|
662
|
-
} else
|
|
663
|
-
viewProps[key] = val;
|
|
701
|
+
} else viewProps[key] = val;
|
|
664
702
|
}
|
|
665
703
|
function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump, debugProp) {
|
|
666
|
-
let importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(
|
|
667
|
-
|
|
668
|
-
key,
|
|
669
|
-
importancesUsed,
|
|
670
|
-
isSizeMedia
|
|
671
|
-
);
|
|
672
|
-
if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(
|
|
673
|
-
`mergeMediaByImportance ${key} importance existing ${importancesUsed[key]} next ${importance}`
|
|
674
|
-
), importance === null)
|
|
675
|
-
return !1;
|
|
704
|
+
let importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, importancesUsed, isSizeMedia);
|
|
705
|
+
if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(`mergeMediaByImportance ${key} importance existing ${importancesUsed[key]} next ${importance}`), importance === null) return !1;
|
|
676
706
|
if (importancesUsed[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
|
|
677
|
-
const descriptor = import_pseudoDescriptors.pseudoDescriptors[key],
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
for (const subKey in value)
|
|
681
|
-
|
|
682
|
-
} else
|
|
683
|
-
mergeStyle(styleState, key, value);
|
|
707
|
+
const descriptor = import_pseudoDescriptors.pseudoDescriptors[key],
|
|
708
|
+
descriptorKey = descriptor.stateKey || descriptor.name;
|
|
709
|
+
if (styleState.componentState[descriptorKey] === !1) return !1;
|
|
710
|
+
for (const subKey in value) mergeStyle(styleState, subKey, value[subKey]);
|
|
711
|
+
} else mergeStyle(styleState, key, value);
|
|
684
712
|
return !0;
|
|
685
713
|
}
|
|
686
714
|
function normalizeStyle(style) {
|
|
@@ -694,5 +722,4 @@ function normalizeStyle(style) {
|
|
|
694
722
|
function applyDefaultStyle(pkey, styleState) {
|
|
695
723
|
const defaultValues = animatableDefaults[pkey];
|
|
696
724
|
defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
|
|
697
|
-
}
|
|
698
|
-
//# sourceMappingURL=getSplitStyles.js.map
|
|
725
|
+
}
|