@tamagui/web 1.61.2 → 1.62.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.js +10 -26
- package/dist/cjs/Tamagui.js.map +1 -1
- package/dist/cjs/Tamagui.native.js +64 -0
- package/dist/cjs/Tamagui.native.js.map +6 -0
- package/dist/cjs/config.js +25 -64
- package/dist/cjs/config.js.map +2 -2
- package/dist/cjs/config.native.js +90 -0
- package/dist/cjs/config.native.js.map +6 -0
- package/dist/cjs/constants/accessibilityDirectMap.js +41 -51
- package/dist/cjs/constants/accessibilityDirectMap.js.map +1 -1
- package/dist/cjs/constants/accessibilityDirectMap.native.js +9 -16
- package/dist/cjs/constants/accessibilityDirectMap.native.js.map +1 -1
- package/dist/cjs/constants/constants.js +16 -24
- package/dist/cjs/constants/constants.js.map +1 -1
- package/dist/cjs/constants/constants.native.js +32 -0
- package/dist/cjs/constants/constants.native.js.map +6 -0
- package/dist/cjs/constants/isDevTools.js +7 -12
- package/dist/cjs/constants/isDevTools.js.map +1 -1
- package/dist/cjs/constants/isDevTools.native.js +33 -0
- package/dist/cjs/constants/isDevTools.native.js.map +6 -0
- package/dist/cjs/contexts/ComponentContext.js +8 -14
- package/dist/cjs/contexts/ComponentContext.js.map +1 -1
- package/dist/cjs/contexts/ComponentContext.native.js +42 -0
- package/dist/cjs/contexts/ComponentContext.native.js.map +6 -0
- package/dist/cjs/createComponent.js +288 -710
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createComponent.native.js +643 -0
- package/dist/cjs/createComponent.native.js.map +6 -0
- package/dist/cjs/createFont.js +18 -29
- package/dist/cjs/createFont.js.map +1 -1
- package/dist/cjs/createFont.native.js +59 -0
- package/dist/cjs/createFont.native.js.map +6 -0
- package/dist/cjs/createShorthands.js +5 -9
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createShorthands.native.js +28 -0
- package/dist/cjs/createShorthands.native.js.map +6 -0
- package/dist/cjs/createTamagui.js +56 -144
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTamagui.native.js +186 -0
- package/dist/cjs/createTamagui.native.js.map +6 -0
- package/dist/cjs/createTheme.js +6 -12
- package/dist/cjs/createTheme.js.map +1 -1
- package/dist/cjs/createTheme.native.js +26 -0
- package/dist/cjs/createTheme.native.js.map +6 -0
- package/dist/cjs/createTokens.js +5 -9
- package/dist/cjs/createTokens.js.map +1 -1
- package/dist/cjs/createTokens.native.js +29 -0
- package/dist/cjs/createTokens.native.js.map +6 -0
- package/dist/cjs/createVariable.js +20 -47
- package/dist/cjs/createVariable.js.map +1 -1
- package/dist/cjs/createVariable.native.js +85 -0
- package/dist/cjs/createVariable.native.js.map +6 -0
- package/dist/cjs/createVariables.js +11 -22
- package/dist/cjs/createVariables.js.map +1 -1
- package/dist/cjs/createVariables.native.js +54 -0
- package/dist/cjs/createVariables.native.js.map +6 -0
- package/dist/cjs/helpers/ThemeManager.js +75 -169
- package/dist/cjs/helpers/ThemeManager.js.map +1 -1
- package/dist/cjs/helpers/ThemeManager.native.js +178 -0
- package/dist/cjs/helpers/ThemeManager.native.js.map +6 -0
- package/dist/cjs/helpers/ThemeManagerContext.js +5 -9
- package/dist/cjs/helpers/ThemeManagerContext.js.map +1 -1
- package/dist/cjs/helpers/ThemeManagerContext.native.js +27 -0
- package/dist/cjs/helpers/ThemeManagerContext.native.js.map +6 -0
- package/dist/cjs/helpers/createChainedWeakCache.js +14 -24
- package/dist/cjs/helpers/createChainedWeakCache.js.map +1 -1
- package/dist/cjs/helpers/createChainedWeakCache.native.js +54 -0
- package/dist/cjs/helpers/createChainedWeakCache.native.js.map +6 -0
- package/dist/cjs/helpers/createMediaStyle.js +20 -70
- package/dist/cjs/helpers/createMediaStyle.js.map +1 -1
- package/dist/cjs/helpers/createMediaStyle.native.js +72 -0
- package/dist/cjs/helpers/createMediaStyle.native.js.map +6 -0
- package/dist/cjs/helpers/createProxy.js +11 -20
- package/dist/cjs/helpers/createProxy.js.map +1 -1
- package/dist/cjs/helpers/createProxy.native.js +35 -0
- package/dist/cjs/helpers/createProxy.native.js.map +6 -0
- package/dist/cjs/helpers/createShallowSetState.js +7 -13
- package/dist/cjs/helpers/createShallowSetState.js.map +1 -1
- package/dist/cjs/helpers/createShallowSetState.native.js +36 -0
- package/dist/cjs/helpers/createShallowSetState.native.js.map +6 -0
- package/dist/cjs/helpers/createStyledContext.js +12 -26
- package/dist/cjs/helpers/createStyledContext.js.map +1 -1
- package/dist/cjs/helpers/createStyledContext.native.js +39 -0
- package/dist/cjs/helpers/createStyledContext.native.js.map +6 -0
- package/dist/cjs/helpers/defaultOffset.js +5 -9
- package/dist/cjs/helpers/defaultOffset.js.map +1 -1
- package/dist/cjs/helpers/defaultOffset.native.js +26 -0
- package/dist/cjs/helpers/defaultOffset.native.js.map +6 -0
- package/dist/cjs/helpers/expandStyle.js +20 -40
- package/dist/cjs/helpers/expandStyle.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.native.js +64 -0
- package/dist/cjs/helpers/expandStyle.native.js.map +6 -0
- package/dist/cjs/helpers/expandStyles.js +13 -39
- package/dist/cjs/helpers/expandStyles.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.native.js +55 -0
- package/dist/cjs/helpers/expandStyles.native.js.map +6 -0
- package/dist/cjs/helpers/getAnimationDriver.js +5 -9
- package/dist/cjs/helpers/getAnimationDriver.js.map +1 -1
- package/dist/cjs/helpers/getAnimationDriver.native.js +29 -0
- package/dist/cjs/helpers/getAnimationDriver.native.js.map +6 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +6 -11
- package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.native.js +35 -0
- package/dist/cjs/helpers/getExpandedShorthands.native.js.map +6 -0
- package/dist/cjs/helpers/getFontLanguage.js +5 -9
- package/dist/cjs/helpers/getFontLanguage.js.map +1 -1
- package/dist/cjs/helpers/getFontLanguage.native.js +26 -0
- package/dist/cjs/helpers/getFontLanguage.native.js.map +6 -0
- package/dist/cjs/helpers/getGroupPropParts.js +7 -17
- package/dist/cjs/helpers/getGroupPropParts.js.map +1 -1
- package/dist/cjs/helpers/getGroupPropParts.native.js +32 -0
- package/dist/cjs/helpers/getGroupPropParts.native.js.map +6 -0
- package/dist/cjs/helpers/getSplitStyles.js +364 -827
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.native.js +503 -0
- package/dist/cjs/helpers/getSplitStyles.native.js.map +6 -0
- package/dist/cjs/helpers/getStylesAtomic.js +39 -102
- package/dist/cjs/helpers/getStylesAtomic.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.native.js +6 -13
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +25 -70
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.native.js +5 -8
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.js +13 -26
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.native.js +72 -0
- package/dist/cjs/helpers/getVariantExtras.native.js.map +6 -0
- package/dist/cjs/helpers/insertStyleRule.js +85 -197
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +223 -0
- package/dist/cjs/helpers/insertStyleRule.native.js.map +6 -0
- package/dist/cjs/helpers/isObj.js +6 -10
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isObj.native.js +26 -0
- package/dist/cjs/helpers/isObj.native.js.map +6 -0
- package/dist/cjs/helpers/isTamaguiComponent.js +7 -11
- package/dist/cjs/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.native.js +29 -0
- package/dist/cjs/helpers/isTamaguiComponent.native.js.map +6 -0
- package/dist/cjs/helpers/isTamaguiElement.js +7 -14
- package/dist/cjs/helpers/isTamaguiElement.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.native.js +27 -0
- package/dist/cjs/helpers/isTamaguiElement.native.js.map +6 -0
- package/dist/cjs/helpers/matchMedia.js +8 -12
- package/dist/cjs/helpers/matchMedia.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +9 -16
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.js +10 -18
- package/dist/cjs/helpers/mergeProps.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.native.js +49 -0
- package/dist/cjs/helpers/mergeProps.native.js.map +6 -0
- package/dist/cjs/helpers/mergeVariants.js +16 -30
- package/dist/cjs/helpers/mergeVariants.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.native.js +56 -0
- package/dist/cjs/helpers/mergeVariants.native.js.map +6 -0
- package/dist/cjs/helpers/normalizeColor.js +9 -27
- package/dist/cjs/helpers/normalizeColor.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.native.js +40 -0
- package/dist/cjs/helpers/normalizeColor.native.js.map +6 -0
- package/dist/cjs/helpers/normalizeShadow.js +6 -12
- package/dist/cjs/helpers/normalizeShadow.js.map +1 -1
- package/dist/cjs/helpers/normalizeShadow.native.js +8 -17
- package/dist/cjs/helpers/normalizeShadow.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStylePropKeys.js +5 -9
- package/dist/cjs/helpers/normalizeStylePropKeys.js.map +1 -1
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js +15 -18
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.js +22 -63
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +60 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +6 -0
- package/dist/cjs/helpers/objectIdentityKey.js +9 -14
- package/dist/cjs/helpers/objectIdentityKey.js.map +1 -1
- package/dist/cjs/helpers/objectIdentityKey.native.js +43 -0
- package/dist/cjs/helpers/objectIdentityKey.native.js.map +6 -0
- package/dist/cjs/helpers/propMapper.js +91 -241
- package/dist/cjs/helpers/propMapper.js.map +1 -1
- package/dist/cjs/helpers/propMapper.native.js +201 -0
- package/dist/cjs/helpers/propMapper.native.js.map +6 -0
- package/dist/cjs/helpers/proxyThemeToParents.js +12 -29
- package/dist/cjs/helpers/proxyThemeToParents.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.native.js +62 -0
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +6 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +6 -10
- package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeVariables.native.js +37 -0
- package/dist/cjs/helpers/proxyThemeVariables.native.js.map +6 -0
- package/dist/cjs/helpers/pseudoDescriptors.js +7 -13
- package/dist/cjs/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/cjs/helpers/pseudoDescriptors.native.js +60 -0
- package/dist/cjs/helpers/pseudoDescriptors.native.js.map +6 -0
- package/dist/cjs/helpers/registerCSSVariable.js +6 -14
- package/dist/cjs/helpers/registerCSSVariable.js.map +1 -1
- package/dist/cjs/helpers/registerCSSVariable.native.js +33 -0
- package/dist/cjs/helpers/registerCSSVariable.native.js.map +6 -0
- package/dist/cjs/helpers/themeable.js +15 -27
- package/dist/cjs/helpers/themeable.js.map +1 -1
- package/dist/cjs/helpers/themeable.native.js +56 -0
- package/dist/cjs/helpers/themeable.native.js.map +6 -0
- package/dist/cjs/helpers/themes.js +15 -26
- package/dist/cjs/helpers/themes.js.map +1 -1
- package/dist/cjs/helpers/themes.native.js +38 -0
- package/dist/cjs/helpers/themes.native.js.map +6 -0
- package/dist/cjs/helpers/timer.js +6 -10
- package/dist/cjs/helpers/timer.js.map +1 -1
- package/dist/cjs/helpers/timer.native.js +32 -0
- package/dist/cjs/helpers/timer.native.js.map +6 -0
- package/dist/cjs/helpers/withStaticProperties.js +8 -15
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/helpers/withStaticProperties.native.js +41 -0
- package/dist/cjs/helpers/withStaticProperties.native.js.map +6 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js +6 -13
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.native.js +28 -0
- package/dist/cjs/hooks/getThemeUnwrapped.native.js.map +6 -0
- package/dist/cjs/hooks/useAnimationDriver.js +7 -15
- package/dist/cjs/hooks/useAnimationDriver.js.map +1 -1
- package/dist/cjs/hooks/useAnimationDriver.native.js +27 -0
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +6 -0
- package/dist/cjs/hooks/useId.js +5 -9
- package/dist/cjs/hooks/useId.js.map +1 -1
- package/dist/cjs/hooks/useId.native.js +26 -0
- package/dist/cjs/hooks/useId.native.js.map +6 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +7 -14
- package/dist/cjs/hooks/useIsTouchDevice.js.map +1 -1
- package/dist/cjs/hooks/useIsTouchDevice.native.js +27 -0
- package/dist/cjs/hooks/useIsTouchDevice.native.js.map +6 -0
- package/dist/cjs/hooks/useMedia.js +60 -170
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/useMedia.native.js +219 -0
- package/dist/cjs/hooks/useMedia.native.js.map +6 -0
- package/dist/cjs/hooks/useMemoDebug.js +7 -17
- package/dist/cjs/hooks/useMemoDebug.js.map +1 -1
- package/dist/cjs/hooks/useMemoDebug.native.js +31 -0
- package/dist/cjs/hooks/useMemoDebug.native.js.map +6 -0
- package/dist/cjs/hooks/useProps.js +7 -11
- package/dist/cjs/hooks/useProps.js.map +1 -1
- package/dist/cjs/hooks/useProps.native.js +32 -0
- package/dist/cjs/hooks/useProps.native.js.map +6 -0
- package/dist/cjs/hooks/useStyle.js +8 -21
- package/dist/cjs/hooks/useStyle.js.map +1 -1
- package/dist/cjs/hooks/useStyle.native.js +48 -0
- package/dist/cjs/hooks/useStyle.native.js.map +6 -0
- package/dist/cjs/hooks/useTheme.js +95 -215
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useTheme.native.js +215 -0
- package/dist/cjs/hooks/useTheme.native.js.map +6 -0
- package/dist/cjs/hooks/useThemeName.js +14 -26
- package/dist/cjs/hooks/useThemeName.js.map +1 -1
- package/dist/cjs/hooks/useThemeName.native.js +36 -0
- package/dist/cjs/hooks/useThemeName.native.js.map +6 -0
- package/dist/cjs/index.js +7 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +168 -0
- package/dist/cjs/index.native.js.map +6 -0
- package/dist/cjs/inject-styles.js +7 -15
- package/dist/cjs/inject-styles.js.map +1 -1
- package/dist/cjs/inject-styles.native.js +33 -0
- package/dist/cjs/inject-styles.native.js.map +6 -0
- package/dist/cjs/insertFont.js +25 -49
- package/dist/cjs/insertFont.js.map +1 -1
- package/dist/cjs/insertFont.native.js +69 -0
- package/dist/cjs/insertFont.native.js.map +6 -0
- package/dist/cjs/interfaces/CSSColorNames.js +3 -6
- package/dist/cjs/interfaces/CSSColorNames.js.map +1 -1
- package/dist/cjs/interfaces/CSSColorNames.native.js +15 -0
- package/dist/cjs/interfaces/CSSColorNames.native.js.map +6 -0
- package/dist/cjs/interfaces/GetRef.js +3 -6
- package/dist/cjs/interfaces/GetRef.js.map +1 -1
- package/dist/cjs/interfaces/GetRef.native.js +15 -0
- package/dist/cjs/interfaces/GetRef.native.js.map +6 -0
- package/dist/cjs/interfaces/Role.js +3 -6
- package/dist/cjs/interfaces/Role.js.map +1 -1
- package/dist/cjs/interfaces/Role.native.js +15 -0
- package/dist/cjs/interfaces/Role.native.js.map +6 -0
- package/dist/cjs/setupHooks.js +5 -9
- package/dist/cjs/setupHooks.js.map +1 -1
- package/dist/cjs/setupHooks.native.js +31 -0
- package/dist/cjs/setupHooks.native.js.map +6 -0
- package/dist/cjs/setupReactNative.js +11 -17
- package/dist/cjs/setupReactNative.js.map +1 -1
- package/dist/cjs/setupReactNative.native.js +44 -0
- package/dist/cjs/setupReactNative.native.js.map +6 -0
- package/dist/cjs/styled.js +25 -67
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/styled.native.js +75 -0
- package/dist/cjs/styled.native.js.map +6 -0
- package/dist/cjs/types.js +3 -6
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/types.native.js +15 -0
- package/dist/cjs/types.native.js.map +6 -0
- package/dist/cjs/views/AnimationDriverProvider.js +7 -14
- package/dist/cjs/views/AnimationDriverProvider.js.map +1 -1
- package/dist/cjs/views/AnimationDriverProvider.native.js +27 -0
- package/dist/cjs/views/AnimationDriverProvider.native.js.map +6 -0
- package/dist/cjs/views/FontLanguage.js +15 -21
- package/dist/cjs/views/FontLanguage.js.map +1 -1
- package/dist/cjs/views/FontLanguage.native.js +6 -11
- package/dist/cjs/views/FontLanguage.native.js.map +1 -1
- package/dist/cjs/views/FontLanguage.types.js +3 -6
- package/dist/cjs/views/FontLanguage.types.js.map +1 -1
- package/dist/cjs/views/FontLanguage.types.native.js +15 -0
- package/dist/cjs/views/FontLanguage.types.native.js.map +6 -0
- package/dist/cjs/views/Slot.js +15 -46
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Slot.native.js +58 -0
- package/dist/cjs/views/Slot.native.js.map +6 -0
- package/dist/cjs/views/Stack.js +7 -13
- package/dist/cjs/views/Stack.js.map +1 -1
- package/dist/cjs/views/Stack.native.js +31 -0
- package/dist/cjs/views/Stack.native.js.map +6 -0
- package/dist/cjs/views/TamaguiProvider.js +16 -38
- package/dist/cjs/views/TamaguiProvider.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.native.js +58 -0
- package/dist/cjs/views/TamaguiProvider.native.js.map +6 -0
- package/dist/cjs/views/Text.js +28 -45
- package/dist/cjs/views/Text.js.map +1 -1
- package/dist/cjs/views/Text.native.js +53 -0
- package/dist/cjs/views/Text.native.js.map +6 -0
- package/dist/cjs/views/Theme.js +41 -89
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/Theme.native.js +99 -0
- package/dist/cjs/views/Theme.native.js.map +6 -0
- package/dist/cjs/views/ThemeDebug.js +19 -52
- package/dist/cjs/views/ThemeDebug.js.map +2 -2
- package/dist/cjs/views/ThemeDebug.native.js +5 -8
- package/dist/cjs/views/ThemeDebug.native.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.js +22 -37
- package/dist/cjs/views/ThemeProvider.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.native.js +43 -0
- package/dist/cjs/views/ThemeProvider.native.js.map +6 -0
- package/dist/cjs/views/View.js +7 -12
- package/dist/cjs/views/View.js.map +1 -1
- package/dist/cjs/views/View.native.js +30 -0
- package/dist/cjs/views/View.native.js.map +6 -0
- package/dist/esm/Tamagui.js +2 -9
- package/dist/esm/Tamagui.js.map +1 -1
- package/dist/esm/config.js +20 -55
- package/dist/esm/config.js.map +2 -2
- package/dist/esm/constants/accessibilityDirectMap.js +36 -42
- package/dist/esm/constants/accessibilityDirectMap.js.map +1 -1
- package/dist/esm/constants/constants.js +11 -15
- package/dist/esm/constants/constants.js.map +1 -1
- package/dist/esm/constants/isDevTools.js +2 -3
- package/dist/esm/constants/isDevTools.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.js +3 -5
- package/dist/esm/contexts/ComponentContext.js.map +1 -1
- package/dist/esm/createComponent.js +281 -677
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createFont.js +13 -20
- package/dist/esm/createFont.js.map +1 -1
- package/dist/esm/createTamagui.js +50 -124
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTheme.js +1 -3
- package/dist/esm/createTheme.js.map +1 -1
- package/dist/esm/createVariable.js +14 -35
- package/dist/esm/createVariable.js.map +1 -1
- package/dist/esm/createVariables.js +5 -11
- package/dist/esm/createVariables.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.js +69 -157
- package/dist/esm/helpers/ThemeManager.js.map +1 -1
- package/dist/esm/helpers/createChainedWeakCache.js +9 -15
- package/dist/esm/helpers/createChainedWeakCache.js.map +1 -1
- package/dist/esm/helpers/createMediaStyle.js +14 -58
- package/dist/esm/helpers/createMediaStyle.js.map +1 -1
- package/dist/esm/helpers/createProxy.js +6 -11
- package/dist/esm/helpers/createProxy.js.map +1 -1
- package/dist/esm/helpers/createShallowSetState.js +2 -4
- package/dist/esm/helpers/createShallowSetState.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.js +7 -15
- package/dist/esm/helpers/createStyledContext.js.map +1 -1
- package/dist/esm/helpers/expandStyle.js +16 -32
- package/dist/esm/helpers/expandStyle.js.map +1 -1
- package/dist/esm/helpers/expandStyles.js +7 -25
- package/dist/esm/helpers/expandStyles.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.js +1 -2
- package/dist/esm/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.js +2 -8
- package/dist/esm/helpers/getGroupPropParts.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +360 -810
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +33 -88
- package/dist/esm/helpers/getStylesAtomic.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +19 -57
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.js +7 -15
- package/dist/esm/helpers/getVariantExtras.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.js +79 -186
- package/dist/esm/helpers/insertStyleRule.js.map +1 -1
- package/dist/esm/helpers/isObj.js +1 -1
- package/dist/esm/helpers/isObj.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.js +2 -2
- package/dist/esm/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/esm/helpers/isTamaguiElement.js +1 -3
- package/dist/esm/helpers/isTamaguiElement.js.map +1 -1
- package/dist/esm/helpers/matchMedia.js +3 -3
- package/dist/esm/helpers/matchMedia.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +5 -9
- package/dist/esm/helpers/mergeProps.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.js +11 -21
- package/dist/esm/helpers/mergeVariants.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.js +3 -15
- package/dist/esm/helpers/normalizeColor.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.js +16 -51
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.js +4 -5
- package/dist/esm/helpers/objectIdentityKey.js.map +1 -1
- package/dist/esm/helpers/propMapper.js +86 -223
- package/dist/esm/helpers/propMapper.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.js +6 -18
- package/dist/esm/helpers/proxyThemeToParents.js.map +1 -1
- package/dist/esm/helpers/proxyThemeVariables.js +1 -1
- package/dist/esm/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.js +2 -4
- package/dist/esm/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.js +1 -5
- package/dist/esm/helpers/registerCSSVariable.js.map +1 -1
- package/dist/esm/helpers/themeable.js +8 -12
- package/dist/esm/helpers/themeable.js.map +1 -1
- package/dist/esm/helpers/themes.js +10 -17
- package/dist/esm/helpers/themes.js.map +1 -1
- package/dist/esm/helpers/timer.js +1 -1
- package/dist/esm/helpers/withStaticProperties.js +3 -6
- package/dist/esm/helpers/withStaticProperties.js.map +1 -1
- package/dist/esm/hooks/getThemeUnwrapped.js +1 -4
- package/dist/esm/hooks/getThemeUnwrapped.js.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.js +1 -3
- package/dist/esm/hooks/useAnimationDriver.js.map +1 -1
- package/dist/esm/hooks/useIsTouchDevice.js +1 -3
- package/dist/esm/hooks/useIsTouchDevice.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +54 -152
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/useMemoDebug.js +2 -8
- package/dist/esm/hooks/useMemoDebug.js.map +1 -1
- package/dist/esm/hooks/useProps.js +2 -2
- package/dist/esm/hooks/useProps.js.map +1 -1
- package/dist/esm/hooks/useStyle.js +2 -6
- package/dist/esm/hooks/useStyle.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +89 -198
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/hooks/useThemeName.js +8 -14
- package/dist/esm/hooks/useThemeName.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject-styles.js +2 -6
- package/dist/esm/inject-styles.js.map +1 -1
- package/dist/esm/insertFont.js +19 -36
- package/dist/esm/insertFont.js.map +1 -1
- package/dist/esm/setupReactNative.js +6 -8
- package/dist/esm/setupReactNative.js.map +1 -1
- package/dist/esm/styled.js +19 -55
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/views/AnimationDriverProvider.js +2 -4
- package/dist/esm/views/AnimationDriverProvider.js.map +1 -1
- package/dist/esm/views/FontLanguage.js +10 -12
- package/dist/esm/views/FontLanguage.js.map +1 -1
- package/dist/esm/views/Slot.js +10 -33
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +1 -1
- package/dist/esm/views/TamaguiProvider.js +9 -20
- package/dist/esm/views/TamaguiProvider.js.map +1 -1
- package/dist/esm/views/Text.js +22 -34
- package/dist/esm/views/Text.js.map +1 -1
- package/dist/esm/views/Theme.js +34 -70
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeDebug.js +14 -40
- package/dist/esm/views/ThemeDebug.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +17 -24
- package/dist/esm/views/ThemeProvider.js.map +1 -1
- package/dist/esm/views/View.js +1 -1
- package/package.json +15 -10
- package/src/createTamagui.ts +8 -7
- package/src/helpers/getStylesAtomic.ts +1 -0
- package/src/helpers/getThemeCSSRules.ts +3 -1
- package/src/index.ts +2 -0
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/dist/esm/constants/accessibilityDirectMap.native.js +0 -63
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +0 -6
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -14
- package/dist/esm/helpers/getStylesAtomic.native.js.map +0 -6
- package/dist/esm/helpers/getThemeCSSRules.native.js +0 -7
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +0 -6
- package/dist/esm/helpers/matchMedia.native.js +0 -24
- package/dist/esm/helpers/matchMedia.native.js.map +0 -6
- package/dist/esm/helpers/normalizeShadow.native.js +0 -31
- package/dist/esm/helpers/normalizeShadow.native.js.map +0 -6
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +0 -16
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +0 -6
- package/dist/esm/views/FontLanguage.native.js +0 -11
- package/dist/esm/views/FontLanguage.native.js.map +0 -6
- package/dist/esm/views/ThemeDebug.native.js +0 -11
- package/dist/esm/views/ThemeDebug.native.js.map +0 -6
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var propMapper_exports = {};
|
|
17
|
+
__export(propMapper_exports, {
|
|
18
|
+
getFontFamilyFromNameOrVariable: () => getFontFamilyFromNameOrVariable,
|
|
19
|
+
getPropMappedFontFamily: () => getPropMappedFontFamily,
|
|
20
|
+
getTokenForKey: () => getTokenForKey,
|
|
21
|
+
propMapper: () => propMapper
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(propMapper_exports);
|
|
24
|
+
var import_constants = require("@tamagui/constants"), import_helpers = require("@tamagui/helpers"), import_config = require("../config"), import_isDevTools = require("../constants/isDevTools"), import_createVariable = require("../createVariable"), import_expandStyle = require("./expandStyle"), import_expandStyles = require("./expandStyles"), import_getVariantExtras = require("./getVariantExtras"), import_isObj = require("./isObj"), import_pseudoDescriptors = require("./pseudoDescriptors");
|
|
25
|
+
const propMapper = (key, value, styleStateIn, subPropsIn) => {
|
|
26
|
+
if (!import_constants.isAndroid && key === "elevationAndroid")
|
|
27
|
+
return;
|
|
28
|
+
const subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
|
|
29
|
+
get(_, k) {
|
|
30
|
+
return k === "curProps" ? subProps : Reflect.get(_, k);
|
|
31
|
+
}
|
|
32
|
+
}) : styleStateIn, { conf, styleProps, fontFamily, staticConfig } = styleState, { variants } = staticConfig;
|
|
33
|
+
if (process.env.NODE_ENV === "development" && fontFamily && fontFamily[0] === "$" && !(fontFamily in conf.fontsParsed) && console.warn(
|
|
34
|
+
`Warning: no fontFamily "${fontFamily}" found in config: ${Object.keys(conf.fontsParsed).join(
|
|
35
|
+
", "
|
|
36
|
+
)}`
|
|
37
|
+
), variants && key in variants) {
|
|
38
|
+
styleState.curProps[key] = value;
|
|
39
|
+
const variantValue = resolveVariants(key, value, styleProps, styleState, "");
|
|
40
|
+
if (variantValue)
|
|
41
|
+
return variantValue;
|
|
42
|
+
}
|
|
43
|
+
let shouldReturn = !1;
|
|
44
|
+
if (key in conf.shorthands && (shouldReturn = !0, key = conf.shorthands[key]), value && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps.resolveVariablesAs, styleState) : (0, import_createVariable.isVariable)(value) && (value = resolveVariableValue(value, styleProps.resolveVariablesAs))), shouldReturn || value != null)
|
|
45
|
+
return (0, import_expandStyle.expandStyle)(key, value) || [[key, value]];
|
|
46
|
+
}, resolveVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
47
|
+
const { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
|
|
48
|
+
if (!variants)
|
|
49
|
+
return;
|
|
50
|
+
let variantValue = getVariantDefinition(variants[key], key, value, conf);
|
|
51
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.log({
|
|
52
|
+
key,
|
|
53
|
+
value,
|
|
54
|
+
variantValue,
|
|
55
|
+
variants,
|
|
56
|
+
curProps: { ...styleState.curProps }
|
|
57
|
+
}), console.groupEnd()), !variantValue) {
|
|
58
|
+
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
|
|
59
|
+
const name = staticConfig.componentName || "[UnnamedComponent]";
|
|
60
|
+
console.warn(
|
|
61
|
+
`No variant found: ${name} has variant "${key}", but no matching value "${value}"`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (typeof variantValue == "function") {
|
|
67
|
+
const fn = variantValue, extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
|
|
68
|
+
variantValue = fn(value, extras), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(" expanded functional variant", key), console.log({ fn, variantValue, extras }), console.groupEnd());
|
|
69
|
+
}
|
|
70
|
+
let fontFamilyResult;
|
|
71
|
+
if ((0, import_isObj.isObj)(variantValue)) {
|
|
72
|
+
const fontFamilyUpdate = variantValue.fontFamily || variantValue[conf.inverseShorthands.fontFamily];
|
|
73
|
+
fontFamilyUpdate && (fontFamilyResult = getFontFamilyFromNameOrVariable(fontFamilyUpdate, conf), styleState.fontFamily = fontFamilyResult, process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" updating font family", fontFamilyResult)), variantValue = resolveTokensAndVariants(
|
|
74
|
+
key,
|
|
75
|
+
variantValue,
|
|
76
|
+
styleProps,
|
|
77
|
+
styleState,
|
|
78
|
+
parentVariantKey
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
if (variantValue) {
|
|
82
|
+
const expanded = (0, import_expandStyles.expandStylesAndRemoveNullishValues)(variantValue), next = Object.entries(expanded);
|
|
83
|
+
return fontFamilyResult && fontFamilyResult[0] === "$" && fontFamilyCache.set(next, (0, import_createVariable.getVariableValue)(fontFamilyResult)), next;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
87
|
+
if ((0, import_createVariable.isVariable)(input)) {
|
|
88
|
+
const val = variableToFontNameCache.get(input);
|
|
89
|
+
if (val)
|
|
90
|
+
return val;
|
|
91
|
+
for (const key in conf.fontsParsed) {
|
|
92
|
+
const familyVariable = conf.fontsParsed[key].family;
|
|
93
|
+
if ((0, import_createVariable.isVariable)(familyVariable) && (variableToFontNameCache.set(familyVariable, key), familyVariable === input))
|
|
94
|
+
return key;
|
|
95
|
+
}
|
|
96
|
+
} else if (typeof input == "string" && input[0] === "$")
|
|
97
|
+
return input;
|
|
98
|
+
}
|
|
99
|
+
const variableToFontNameCache = /* @__PURE__ */ new WeakMap(), fontFamilyCache = /* @__PURE__ */ new WeakMap(), getPropMappedFontFamily = (expanded) => expanded && fontFamilyCache.get(expanded), resolveTokensAndVariants = (key, value, styleProps, styleState, parentVariantKey) => {
|
|
100
|
+
const { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
|
|
101
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" - resolveTokensAndVariants", key, value);
|
|
102
|
+
for (const rKey in value) {
|
|
103
|
+
const fKey = conf.shorthands[rKey] || rKey, val = value[rKey];
|
|
104
|
+
if (variants && fKey in variants) {
|
|
105
|
+
if (styleState.curProps[fKey] = val, parentVariantKey && parentVariantKey === key)
|
|
106
|
+
res[fKey] = // SYNC WITH *1
|
|
107
|
+
val[0] === "$" ? getTokenForKey(fKey, val, styleProps.resolveVariablesAs, styleState) : val;
|
|
108
|
+
else {
|
|
109
|
+
const variantOut = resolveVariants(fKey, val, styleProps, styleState, key);
|
|
110
|
+
if (variantOut)
|
|
111
|
+
for (const [key2, val2] of variantOut)
|
|
112
|
+
val2 != null && (key2 in import_pseudoDescriptors.pseudoDescriptors ? (res[key2] ??= {}, Object.assign(res[key2], val2)) : res[key2] = val2);
|
|
113
|
+
}
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if ((0, import_createVariable.isVariable)(val)) {
|
|
117
|
+
res[fKey] = resolveVariableValue(val, styleProps.resolveVariablesAs);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (typeof val == "string") {
|
|
121
|
+
const fVal = (
|
|
122
|
+
// SYNC WITH *1
|
|
123
|
+
val[0] === "$" ? getTokenForKey(fKey, val, styleProps.resolveVariablesAs, styleState) : val
|
|
124
|
+
);
|
|
125
|
+
res[fKey] = fVal;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if ((0, import_isObj.isObj)(val)) {
|
|
129
|
+
const subObject = resolveTokensAndVariants(fKey, val, styleProps, styleState, key);
|
|
130
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.log("object", fKey, subObject), res[fKey] ??= {}, Object.assign(res[fKey], subObject);
|
|
131
|
+
} else
|
|
132
|
+
res[fKey] = val;
|
|
133
|
+
process.env.NODE_ENV === "development" && debug && res[fKey]?.[0] === "$" && console.warn(`\u26A0\uFE0F Missing token in theme ${theme.name}:`, fKey, res[fKey], theme);
|
|
134
|
+
}
|
|
135
|
+
return res;
|
|
136
|
+
}, tokenCats = ["size", "color", "radius", "space", "zIndex"].map((name) => ({
|
|
137
|
+
name,
|
|
138
|
+
spreadName: `...${name}`
|
|
139
|
+
}));
|
|
140
|
+
function getVariantDefinition(variant, key, value, conf) {
|
|
141
|
+
if (typeof variant == "function")
|
|
142
|
+
return variant;
|
|
143
|
+
if (variant[value])
|
|
144
|
+
return variant[value];
|
|
145
|
+
const { tokensParsed } = conf;
|
|
146
|
+
for (const { name, spreadName } of tokenCats)
|
|
147
|
+
if (spreadName in variant && value in tokensParsed[name])
|
|
148
|
+
return variant[spreadName];
|
|
149
|
+
const fontSizeVariant = variant["...fontSize"];
|
|
150
|
+
return fontSizeVariant && conf.fontSizeTokens.has(value) ? fontSizeVariant : variant[`:${typeof value}`] || variant["..."] || variant["...size"];
|
|
151
|
+
}
|
|
152
|
+
const fontShorthand = {
|
|
153
|
+
fontSize: "size",
|
|
154
|
+
fontWeight: "weight"
|
|
155
|
+
}, getTokenForKey = (key, value, resolveAs = "none", styleState) => {
|
|
156
|
+
if (resolveAs === "none")
|
|
157
|
+
return value;
|
|
158
|
+
const { theme, conf = (0, import_config.getConfig)(), context, fontFamily } = styleState, tokensParsed = conf.tokensParsed;
|
|
159
|
+
let valOrVar, hasSet = !1;
|
|
160
|
+
if (theme && value in theme)
|
|
161
|
+
process.env.NODE_ENV === "development" && styleState.debug === "verbose" && console.log(` - getting theme value for ${key} from ${value}`), valOrVar = theme[value], hasSet = !0;
|
|
162
|
+
else if (value in conf.specificTokens)
|
|
163
|
+
hasSet = !0, valOrVar = conf.specificTokens[value];
|
|
164
|
+
else {
|
|
165
|
+
switch (key) {
|
|
166
|
+
case "fontFamily": {
|
|
167
|
+
valOrVar = (context?.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[value]?.family || value, hasSet = !0;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
case "fontSize":
|
|
171
|
+
case "lineHeight":
|
|
172
|
+
case "letterSpacing":
|
|
173
|
+
case "fontWeight": {
|
|
174
|
+
const fam = fontFamily || conf.defaultFont;
|
|
175
|
+
fam && (valOrVar = (context?.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed)[fam]?.[fontShorthand[key] || key]?.[value] || value, hasSet = !0);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
for (const cat in import_helpers.tokenCategories)
|
|
180
|
+
if (key in import_helpers.tokenCategories[cat]) {
|
|
181
|
+
const res = tokensParsed[cat][value];
|
|
182
|
+
res != null && (valOrVar = res, hasSet = !0);
|
|
183
|
+
}
|
|
184
|
+
if (!hasSet) {
|
|
185
|
+
const spaceVar = tokensParsed.space[value];
|
|
186
|
+
spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return hasSet ? resolveVariableValue(valOrVar, resolveAs) : (process.env.NODE_ENV === "development" && import_isDevTools.isDevTools && styleState.debug === "verbose" && (console.groupCollapsed(" \uFE52 propMap (val)", key, value), console.log({ valOrVar, theme, hasSet }, theme ? theme[key] : ""), console.groupEnd()), value);
|
|
190
|
+
};
|
|
191
|
+
function resolveVariableValue(valOrVar, resolveVariablesAs) {
|
|
192
|
+
return resolveVariablesAs === "none" ? valOrVar : (0, import_createVariable.isVariable)(valOrVar) ? !import_constants.isWeb || resolveVariablesAs === "value" ? valOrVar.val : valOrVar.variable : valOrVar;
|
|
193
|
+
}
|
|
194
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
195
|
+
0 && (module.exports = {
|
|
196
|
+
getFontFamilyFromNameOrVariable,
|
|
197
|
+
getPropMappedFontFamily,
|
|
198
|
+
getTokenForKey,
|
|
199
|
+
propMapper
|
|
200
|
+
});
|
|
201
|
+
//# sourceMappingURL=propMapper.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/propMapper.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAiC,+BACjC,iBAAgC,6BAEhC,gBAA0B,sBAC1B,oBAA2B,oCAC3B,wBAAuD,8BAUvD,qBAA4B,0BAC5B,sBAAmD,2BACnD,0BAAsD,+BACtD,eAAsB,oBACtB,2BAAkC;AAE3B,MAAM,aAAyB,CAAC,KAAK,OAAO,cAAc,eAAe;AAC9E,MAAI,CAA6C,8BAE3C,QAAQ;AAAoB;AAMlC,QAAM,WAAW,aAAa,WAAW,iBAAiB,YAEpD,aAAa,WACf,IAAI,MAAM,cAAc;AAAA,IACtB,IAAI,GAAG,GAAG;AACR,aAAO,MAAM,aAAa,WAAW,QAAQ,IAAI,GAAG,CAAC;AAAA,IACvD;AAAA,EACF,CAAC,IACD,cAEE,EAAE,MAAM,YAAY,YAAY,aAAa,IAAI,YACjD,EAAE,SAAS,IAAI;AAiBrB,MAbE,QAAQ,IAAI,aAAa,iBACzB,cACA,WAAW,CAAC,MAAM,OAClB,EAAE,cAAc,KAAK,gBAGrB,QAAQ;AAAA,IACN,2BAA2B,UAAU,sBAAsB,OAAO,KAAK,KAAK,WAAW,EAAE;AAAA,MACvF;AAAA,IACF,CAAC;AAAA,EACH,GAGE,YAAY,OAAO,UAAU;AAC/B,eAAW,SAAS,GAAG,IAAI;AAE3B,UAAM,eAAe,gBAAgB,KAAK,OAAO,YAAY,YAAY,EAAE;AAC3E,QAAI;AACF,aAAO;AAAA,EAEX;AAEA,MAAI,eAAe;AAgBn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AK,GAAG,UAAU,OACzC,SAAS;AACT;AAAA,MACF;AAAA,MACA,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK,cAAc;AACjB,cAAM,MAAM,cAAc,KAAK;AAC/B,QAAI,QAKF,YAJoB,SAAS,eACzB,6CAAoB,KAAK,aAAa,QAAQ,QAAQ,IACtD,KAAK,aACgB,GAAG,IACV,cAAc,GAAG,KAAK,GAAG,IAAI,KAAK,KAAK,OACzD,SAAS;AAEX;AAAA,MACF;AAAA,IACF;AACA,eAAW,OAAO;AAChB,UAAI,OAAO,+BAAgB,GAAG,GAAG;AAC/B,cAAM,MAAM,aAAa,GAAG,EAAE,KAAK;AACnC,QAAI,OAAO,SACT,WAAW,KACX,SAAS;AAAA,MAEb;AAEF,QAAI,CAAC,QAAQ;AACX,YAAM,WAAW,aAAa,MAAM,KAAK;AACzC,MAAI,YAAY,SACd,WAAW,UACX,SAAS;AAAA,IAEb;AAAA,EACF;AAGF,SAAI,SACU,qBAAqB,UAAU,SAAS,KAKpD,QAAQ,IAAI,aAAa,iBACzB,gCACA,WAAW,UAAU,cAErB,QAAQ,eAAe,0BAAqB,KAAK,KAAK,GAEtD,QAAQ,IAAI,EAAE,UAAU,OAAO,OAAO,GAAG,QAAQ,MAAM,GAAG,IAAI,EAAE,GAChE,QAAQ,SAAS,IAGZ;AACT;AAEA,SAAS,qBACP,UACA,oBACA;AACA,SAAI,uBAAuB,SAAe,eACtC,kCAAW,QAAQ,IACjB,CAAC,0BAAS,uBAAuB,UAC5B,SAAS,MAEX,SAAS,WAEX;AACT;",
|
|
5
|
+
"names": ["key", "val"]
|
|
6
|
+
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var proxyThemeToParents_exports = {};
|
|
20
16
|
__export(proxyThemeToParents_exports, {
|
|
21
17
|
proxyThemeToParents: () => proxyThemeToParents,
|
|
@@ -23,47 +19,34 @@ __export(proxyThemeToParents_exports, {
|
|
|
23
19
|
themesRaw: () => themesRaw
|
|
24
20
|
});
|
|
25
21
|
module.exports = __toCommonJS(proxyThemeToParents_exports);
|
|
26
|
-
var import_config = require("../config");
|
|
27
|
-
var import_getThemeUnwrapped = require("../hooks/getThemeUnwrapped");
|
|
22
|
+
var import_config = require("../config"), import_getThemeUnwrapped = require("../hooks/getThemeUnwrapped");
|
|
28
23
|
const themesRaw = {};
|
|
29
24
|
function proxyThemesToParents(dedupedThemes) {
|
|
30
|
-
for (const { names, theme } of dedupedThemes)
|
|
31
|
-
for (const name of names)
|
|
25
|
+
for (const { names, theme } of dedupedThemes)
|
|
26
|
+
for (const name of names)
|
|
32
27
|
themesRaw[name] = theme;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
28
|
const themes = {};
|
|
36
|
-
for (const { names, theme } of dedupedThemes)
|
|
29
|
+
for (const { names, theme } of dedupedThemes)
|
|
37
30
|
for (const themeName of names) {
|
|
38
31
|
const proxiedTheme = proxyThemeToParents(themeName, theme);
|
|
39
32
|
themes[themeName] = proxiedTheme;
|
|
40
33
|
}
|
|
41
|
-
}
|
|
42
34
|
return themes;
|
|
43
35
|
}
|
|
44
36
|
function proxyThemeToParents(themeName, theme) {
|
|
45
|
-
const cur = [];
|
|
46
|
-
const parents = themeName.split("_").slice(0, -1).map((part) => {
|
|
47
|
-
cur.push(part);
|
|
48
|
-
return cur.join("_");
|
|
49
|
-
});
|
|
50
|
-
const numParents = parents.length;
|
|
37
|
+
const cur = [], parents = themeName.split("_").slice(0, -1).map((part) => (cur.push(part), cur.join("_"))), numParents = parents.length;
|
|
51
38
|
return new Proxy(theme, {
|
|
52
39
|
get(target, key) {
|
|
53
40
|
if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
|
|
54
41
|
return theme;
|
|
55
42
|
if (key == null || // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
56
43
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
57
|
-
key == "undefined" || Reflect.has(target, key))
|
|
44
|
+
key == "undefined" || Reflect.has(target, key))
|
|
58
45
|
return Reflect.get(target, key);
|
|
59
|
-
}
|
|
60
46
|
for (let i = numParents - 1; i >= 0; i--) {
|
|
61
47
|
const parent = themesRaw[parents[i]];
|
|
62
|
-
if (
|
|
63
|
-
continue;
|
|
64
|
-
if (Reflect.has(parent, key)) {
|
|
48
|
+
if (parent && Reflect.has(parent, key))
|
|
65
49
|
return Reflect.get(parent, key);
|
|
66
|
-
}
|
|
67
50
|
}
|
|
68
51
|
return (0, import_config.getTokenObject)(key) ?? Reflect.get(target, key);
|
|
69
52
|
}
|
|
@@ -1,6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|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var proxyThemeToParents_exports = {};
|
|
17
|
+
__export(proxyThemeToParents_exports, {
|
|
18
|
+
proxyThemeToParents: () => proxyThemeToParents,
|
|
19
|
+
proxyThemesToParents: () => proxyThemesToParents,
|
|
20
|
+
themesRaw: () => themesRaw
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(proxyThemeToParents_exports);
|
|
23
|
+
var import_config = require("../config"), import_getThemeUnwrapped = require("../hooks/getThemeUnwrapped");
|
|
24
|
+
const themesRaw = {};
|
|
25
|
+
function proxyThemesToParents(dedupedThemes) {
|
|
26
|
+
for (const { names, theme } of dedupedThemes)
|
|
27
|
+
for (const name of names)
|
|
28
|
+
themesRaw[name] = theme;
|
|
29
|
+
const themes = {};
|
|
30
|
+
for (const { names, theme } of dedupedThemes)
|
|
31
|
+
for (const themeName of names) {
|
|
32
|
+
const proxiedTheme = proxyThemeToParents(themeName, theme);
|
|
33
|
+
themes[themeName] = proxiedTheme;
|
|
34
|
+
}
|
|
35
|
+
return themes;
|
|
36
|
+
}
|
|
37
|
+
function proxyThemeToParents(themeName, theme) {
|
|
38
|
+
const cur = [], parents = themeName.split("_").slice(0, -1).map((part) => (cur.push(part), cur.join("_"))), numParents = parents.length;
|
|
39
|
+
return new Proxy(theme, {
|
|
40
|
+
get(target, key) {
|
|
41
|
+
if (key === import_getThemeUnwrapped.GetThemeUnwrapped)
|
|
42
|
+
return theme;
|
|
43
|
+
if (key == null || // dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
44
|
+
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
45
|
+
key == "undefined" || Reflect.has(target, key))
|
|
46
|
+
return Reflect.get(target, key);
|
|
47
|
+
for (let i = numParents - 1; i >= 0; i--) {
|
|
48
|
+
const parent = themesRaw[parents[i]];
|
|
49
|
+
if (parent && Reflect.has(parent, key))
|
|
50
|
+
return Reflect.get(parent, key);
|
|
51
|
+
}
|
|
52
|
+
return (0, import_config.getTokenObject)(key) ?? Reflect.get(target, key);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
proxyThemeToParents,
|
|
59
|
+
proxyThemesToParents,
|
|
60
|
+
themesRaw
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=proxyThemeToParents.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/proxyThemeToParents.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoD,sBACpD,2BAAkC;AAG3B,MAAM,YAAyC,CAAC;AAIhD,SAAS,qBACd,eAC6B;AAE7B,aAAW,EAAE,OAAO,MAAM,KAAK;AAC7B,eAAW,QAAQ;AACjB,gBAAU,IAAI,IAAI;AAItB,QAAM,SAAsC,CAAC;AAM7C,aAAW,EAAE,OAAO,MAAM,KAAK;AAC7B,eAAW,aAAa,OAAO;AAC7B,YAAM,eAAe,oBAAoB,WAAW,KAAK;AACzD,aAAO,SAAS,IAAI;AAAA,IACtB;AAGF,SAAO;AACT;AAEO,SAAS,oBAAoB,WAAmB,OAAoB;AACzE,QAAM,MAAgB,CAAC,GAIjB,UAAU,UACb,MAAM,GAAG,EACT,MAAM,GAAG,EAAE,EACX,IAAI,CAAC,UACJ,IAAI,KAAK,IAAI,GACN,IAAI,KAAK,GAAG,EACpB,GAEG,aAAa,QAAQ;AAG3B,SAAO,IAAI,MAAM,OAAO;AAAA,IACtB,IAAI,QAAQ,KAAK;AACf,UAAI,QAAQ;AAAmB,eAAO;AACtC,UACE,OAAO;AAAA;AAAA,MAGP,OAAO,eACP,QAAQ,IAAI,QAAQ,GAAG;AAEvB,eAAO,QAAQ,IAAI,QAAQ,GAAG;AAGhC,eAAS,IAAI,aAAa,GAAG,KAAK,GAAG,KAAK;AACxC,cAAM,SAAS,UAAU,QAAQ,CAAC,CAAC;AACnC,YAAK,UACD,QAAQ,IAAI,QAAQ,GAAG;AACzB,iBAAO,QAAQ,IAAI,QAAQ,GAAG;AAAA,MAElC;AACA,iBAAO,8BAAe,GAAU,KAAK,QAAQ,IAAI,QAAQ,GAAG;AAAA,IAC9D;AAAA,EACF,CAAC;AACH;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var proxyThemeVariables_exports = {};
|
|
20
16
|
__export(proxyThemeVariables_exports, {
|
|
21
17
|
proxyThemeVariables: () => proxyThemeVariables
|
|
@@ -32,7 +28,7 @@ function proxyThemeVariables(obj) {
|
|
|
32
28
|
}
|
|
33
29
|
});
|
|
34
30
|
}
|
|
35
|
-
const removeStarting$ = (str) => typeof str
|
|
31
|
+
const removeStarting$ = (str) => typeof str == "string" && str[0] === "$" ? str.slice(1) : str;
|
|
36
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
33
|
0 && (module.exports = {
|
|
38
34
|
proxyThemeVariables
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/proxyThemeVariables.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAErB,SAAS,oBAAsC,KAAW;AAC/D,aAAO,gCAAe,OAAO,CAAC,GAAG;AAAA,IAC/B,IAAI,QAAQ,KAAK;AACf,aAAO,QAAQ,IAAI,QAAQ,gBAAgB,GAAG,CAAC;AAAA,IACjD;AAAA,IACA,IAAI,QAAQ,KAAK;AACf,aAAO,QAAQ,IAAI,QAAQ,gBAAgB,GAAG,CAAC;AAAA,IACjD;AAAA,EACF,CAAC;AACH;AAEA,MAAM,kBAAkB,CAAC,QACvB,OAAO,OAAQ,YAAY,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var proxyThemeVariables_exports = {};
|
|
17
|
+
__export(proxyThemeVariables_exports, {
|
|
18
|
+
proxyThemeVariables: () => proxyThemeVariables
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(proxyThemeVariables_exports);
|
|
21
|
+
var import_createProxy = require("./createProxy");
|
|
22
|
+
function proxyThemeVariables(obj) {
|
|
23
|
+
return (0, import_createProxy.createProxy)(obj || {}, {
|
|
24
|
+
has(target, key) {
|
|
25
|
+
return Reflect.has(target, removeStarting$(key));
|
|
26
|
+
},
|
|
27
|
+
get(target, key) {
|
|
28
|
+
return Reflect.get(target, removeStarting$(key));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const removeStarting$ = (str) => typeof str == "string" && str[0] === "$" ? str.slice(1) : str;
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
proxyThemeVariables
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=proxyThemeVariables.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/proxyThemeVariables.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAErB,SAAS,oBAAsC,KAAW;AAC/D,aAAO,gCAAe,OAAO,CAAC,GAAG;AAAA,IAC/B,IAAI,QAAQ,KAAK;AACf,aAAO,QAAQ,IAAI,QAAQ,gBAAgB,GAAG,CAAC;AAAA,IACjD;AAAA,IACA,IAAI,QAAQ,KAAK;AACf,aAAO,QAAQ,IAAI,QAAQ,gBAAgB,GAAG,CAAC;AAAA,IACjD;AAAA,EACF,CAAC;AACH;AAEA,MAAM,kBAAkB,CAAC,QACvB,OAAO,OAAQ,YAAY,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var pseudoDescriptors_exports = {};
|
|
20
16
|
__export(pseudoDescriptors_exports, {
|
|
21
17
|
pseudoDescriptors: () => pseudoDescriptors,
|
|
@@ -38,13 +34,11 @@ const pseudoDescriptorsBase = {
|
|
|
38
34
|
name: "focus",
|
|
39
35
|
priority: 3
|
|
40
36
|
}
|
|
41
|
-
}
|
|
42
|
-
const pseudoPriorities = {
|
|
37
|
+
}, pseudoPriorities = {
|
|
43
38
|
hover: 1,
|
|
44
39
|
press: 2,
|
|
45
40
|
focus: 3
|
|
46
|
-
}
|
|
47
|
-
const pseudoDescriptors = {
|
|
41
|
+
}, pseudoDescriptors = {
|
|
48
42
|
...pseudoDescriptorsBase,
|
|
49
43
|
enterStyle: {
|
|
50
44
|
name: "enter",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/pseudoDescriptors.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,wBAAwB;AAAA;AAAA,EAEnC,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AACF,GAEa,mBAAmB;AAAA,EAC9B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT,GAEa,oBAGT;AAAA,EACF,GAAG;AAAA,EACH,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var pseudoDescriptors_exports = {};
|
|
17
|
+
__export(pseudoDescriptors_exports, {
|
|
18
|
+
pseudoDescriptors: () => pseudoDescriptors,
|
|
19
|
+
pseudoDescriptorsBase: () => pseudoDescriptorsBase,
|
|
20
|
+
pseudoPriorities: () => pseudoPriorities
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(pseudoDescriptors_exports);
|
|
23
|
+
const pseudoDescriptorsBase = {
|
|
24
|
+
// order of keys here important! in priority order
|
|
25
|
+
hoverStyle: {
|
|
26
|
+
name: "hover",
|
|
27
|
+
priority: 1
|
|
28
|
+
},
|
|
29
|
+
pressStyle: {
|
|
30
|
+
name: "active",
|
|
31
|
+
stateKey: "press",
|
|
32
|
+
priority: 2
|
|
33
|
+
},
|
|
34
|
+
focusStyle: {
|
|
35
|
+
name: "focus",
|
|
36
|
+
priority: 3
|
|
37
|
+
}
|
|
38
|
+
}, pseudoPriorities = {
|
|
39
|
+
hover: 1,
|
|
40
|
+
press: 2,
|
|
41
|
+
focus: 3
|
|
42
|
+
}, pseudoDescriptors = {
|
|
43
|
+
...pseudoDescriptorsBase,
|
|
44
|
+
enterStyle: {
|
|
45
|
+
name: "enter",
|
|
46
|
+
stateKey: "unmounted",
|
|
47
|
+
priority: 4
|
|
48
|
+
},
|
|
49
|
+
exitStyle: {
|
|
50
|
+
name: "exit",
|
|
51
|
+
priority: 5
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
pseudoDescriptors,
|
|
57
|
+
pseudoDescriptorsBase,
|
|
58
|
+
pseudoPriorities
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=pseudoDescriptors.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/pseudoDescriptors.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,wBAAwB;AAAA;AAAA,EAEnC,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AACF,GAEa,mBAAmB;AAAA,EAC9B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT,GAEa,oBAGT;AAAA,EACF,GAAG;AAAA,EACH,YAAY;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AACF;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var registerCSSVariable_exports = {};
|
|
20
16
|
__export(registerCSSVariable_exports, {
|
|
21
17
|
registerCSSVariable: () => registerCSSVariable,
|
|
@@ -26,11 +22,7 @@ module.exports = __toCommonJS(registerCSSVariable_exports);
|
|
|
26
22
|
var import_createVariable = require("../createVariable");
|
|
27
23
|
const registerCSSVariable = (v) => {
|
|
28
24
|
tokensValueToVariable.set((0, import_createVariable.getVariableValue)(v), v);
|
|
29
|
-
};
|
|
30
|
-
const variableToCSS = (v, unitless = false) => {
|
|
31
|
-
return `--${(0, import_createVariable.createCSSVariable)(v.name, false)}:${!unitless && typeof v.val === "number" ? `${v.val}px` : v.val}`;
|
|
32
|
-
};
|
|
33
|
-
const tokensValueToVariable = /* @__PURE__ */ new Map();
|
|
25
|
+
}, variableToCSS = (v, unitless = !1) => `--${(0, import_createVariable.createCSSVariable)(v.name, !1)}:${!unitless && typeof v.val == "number" ? `${v.val}px` : v.val}`, tokensValueToVariable = /* @__PURE__ */ new Map();
|
|
34
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
27
|
0 && (module.exports = {
|
|
36
28
|
registerCSSVariable,
|