@tamagui/web 3.0.0-beta.831.1 → 3.0.0-beta.889.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/createComponent.cjs +12 -1
- package/dist/cjs/createComponent.native.cjs +12 -1
- package/dist/cjs/createComponent.native.js +12 -1
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +1 -1
- package/dist/cjs/createStyledHOC.native.cjs +1 -1
- package/dist/cjs/createStyledHOC.native.js +1 -1
- package/dist/cjs/createStyledHOC.native.js.map +1 -1
- package/dist/cjs/createVariable.cjs +0 -10
- package/dist/cjs/createVariable.native.cjs +0 -10
- package/dist/cjs/createVariable.native.js +0 -10
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/helpers/borderComponents.cjs +62 -0
- package/dist/cjs/helpers/borderComponents.native.cjs +82 -0
- package/dist/cjs/helpers/borderComponents.native.js +84 -0
- package/dist/cjs/helpers/borderComponents.native.js.map +1 -0
- package/dist/cjs/helpers/createDesignSystem.cjs +0 -2
- package/dist/cjs/helpers/createStyledContext.cjs +10 -18
- package/dist/cjs/helpers/createStyledContext.native.cjs +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/formatDiagnostic.cjs +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +128 -109
- package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.cjs +13 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.cjs +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/cjs/helpers/getDynamicVal.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +1042 -1715
- package/dist/cjs/helpers/getSplitStyles.native.cjs +1081 -1887
- package/dist/cjs/helpers/getSplitStyles.native.js +1081 -1887
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/grammarConfig.cjs +163 -1
- package/dist/cjs/helpers/grammarConfig.native.cjs +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +5 -1
- package/dist/cjs/helpers/insertStyleRule.native.cjs +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +9 -8
- package/dist/cjs/helpers/log.native.cjs +9 -8
- package/dist/cjs/helpers/log.native.js +9 -8
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.cjs +44 -13
- package/dist/cjs/helpers/mergeVariants.native.cjs +79 -14
- package/dist/cjs/helpers/mergeVariants.native.js +79 -14
- package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
- package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeStyleEngine.cjs +34 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.cjs +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +7 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/parseBorderShorthand.native.cjs +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeArea.cjs +35 -100
- package/dist/cjs/helpers/resolveVariantStyle.cjs +57 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.cjs +67 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js +69 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/cjs/helpers/styleStaticConfig.cjs +1 -50
- package/dist/cjs/helpers/styleStaticConfig.native.cjs +1 -51
- package/dist/cjs/helpers/styleStaticConfig.native.js +1 -51
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -1
- package/dist/cjs/helpers/styleStaticConfigCore.cjs +107 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +127 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js +129 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/cjs/helpers/styledDynamic.cjs +160 -0
- package/dist/cjs/helpers/styledDynamic.native.cjs +195 -0
- package/dist/cjs/helpers/styledDynamic.native.js +197 -0
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -0
- package/dist/cjs/helpers/tokenCategories.cjs +15 -38
- package/dist/cjs/helpers/tokenCategories.native.cjs +15 -40
- package/dist/cjs/helpers/tokenCategories.native.js +15 -40
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variableValue.cjs +17 -12
- package/dist/cjs/helpers/variableValue.native.cjs +46 -23
- package/dist/cjs/helpers/variableValue.native.js +46 -23
- package/dist/cjs/helpers/variableValue.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +5 -4
- package/dist/cjs/helpers/warnOnce.native.cjs +6 -4
- package/dist/cjs/helpers/warnOnce.native.js +6 -4
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/hooks/useAnimationDriver.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +41 -82
- package/dist/cjs/hooks/useComponentState.native.cjs +45 -84
- package/dist/cjs/hooks/useComponentState.native.js +45 -84
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.js +2 -2
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/{helpers/directStyleCSS.native.js → hooks/useStyle.cjs} +16 -8
- package/dist/cjs/{helpers/directStyleCSS.native.cjs → hooks/useStyle.native.cjs} +16 -4
- package/dist/cjs/hooks/useStyle.native.js +34 -0
- package/dist/cjs/hooks/useStyle.native.js.map +1 -0
- package/dist/cjs/hooks/useThemeState.cjs +25 -90
- package/dist/cjs/hooks/useThemeState.native.cjs +34 -94
- package/dist/cjs/hooks/useThemeState.native.js +34 -94
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +6 -3
- package/dist/cjs/index.native.cjs +6 -3
- package/dist/cjs/index.native.js +6 -3
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +2 -2
- package/dist/cjs/static-resolve.native.cjs +2 -2
- package/dist/cjs/static-resolve.native.js +2 -2
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/style.cjs +91 -0
- package/dist/cjs/style.native.cjs +98 -0
- package/dist/cjs/style.native.js +100 -0
- package/dist/cjs/style.native.js.map +1 -0
- package/dist/cjs/styled.cjs +11 -6
- package/dist/cjs/styled.native.cjs +11 -6
- package/dist/cjs/styled.native.js +11 -6
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +6 -4
- package/dist/cjs/types.native.cjs +6 -4
- package/dist/cjs/types.native.js +6 -4
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +17 -12
- package/dist/cjs/views/Text.native.cjs +1 -0
- package/dist/cjs/views/Text.native.js +1 -0
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +3 -3
- package/dist/cjs/views/Theme.native.cjs +3 -3
- package/dist/cjs/views/Theme.native.js +3 -3
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -4
- package/dist/esm/createComponent.mjs +12 -1
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +12 -1
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +1 -1
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +1 -1
- package/dist/esm/createStyledHOC.native.js.map +1 -1
- package/dist/esm/createVariable.mjs +1 -9
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.native.js +1 -9
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/helpers/borderComponents.mjs +37 -0
- package/dist/esm/helpers/borderComponents.mjs.map +1 -0
- package/dist/esm/helpers/borderComponents.native.js +55 -0
- package/dist/esm/helpers/borderComponents.native.js.map +1 -0
- package/dist/esm/helpers/createDesignSystem.mjs +0 -2
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.mjs +10 -18
- package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +14 -18
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +6 -6
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +6 -6
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +126 -109
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.native.js +7 -4
- package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +8 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +10 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/esm/helpers/getDynamicVal.mjs +5 -1
- package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
- package/dist/esm/helpers/getDynamicVal.native.js +5 -1
- package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +1034 -1705
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +1071 -1871
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +164 -2
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.native.js +187 -2
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +5 -2
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +7 -2
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +9 -8
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +9 -8
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.mjs +44 -13
- package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +79 -14
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.mjs +34 -15
- package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.native.js +36 -15
- package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +7 -8
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/parseBorderShorthand.native.js +23 -56
- package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/esm/helpers/parseOutlineShorthand.native.js +10 -49
- package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeArea.mjs +35 -97
- package/dist/esm/helpers/resolveSafeArea.mjs.map +1 -1
- package/dist/esm/helpers/resolveVariantStyle.mjs +38 -0
- package/dist/esm/helpers/resolveVariantStyle.mjs.map +1 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js +46 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.mjs +1 -50
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -1
- package/dist/esm/helpers/styleStaticConfig.native.js +1 -51
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.mjs +88 -0
- package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js +106 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/esm/helpers/styledDynamic.mjs +136 -0
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -0
- package/dist/esm/helpers/styledDynamic.native.js +169 -0
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -0
- package/dist/esm/helpers/tokenCategories.mjs +15 -36
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +15 -38
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variableValue.mjs +17 -12
- package/dist/esm/helpers/variableValue.mjs.map +1 -1
- package/dist/esm/helpers/variableValue.native.js +46 -23
- package/dist/esm/helpers/variableValue.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +5 -4
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +6 -4
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.mjs +2 -2
- package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.native.js +2 -2
- package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +41 -82
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +45 -84
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +2 -2
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +2 -2
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useStyle.mjs +11 -0
- package/dist/esm/hooks/useStyle.mjs.map +1 -0
- package/dist/esm/hooks/useStyle.native.js +11 -0
- package/dist/esm/hooks/useStyle.native.js.map +1 -0
- package/dist/esm/hooks/useThemeState.mjs +25 -90
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +34 -94
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +6 -4
- package/dist/esm/index.mjs +6 -4
- package/dist/esm/index.native.js +6 -4
- package/dist/esm/static-resolve.mjs +3 -3
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +3 -3
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/style.mjs +58 -0
- package/dist/esm/style.mjs.map +1 -0
- package/dist/esm/style.native.js +63 -0
- package/dist/esm/style.native.js.map +1 -0
- package/dist/esm/styled.mjs +12 -6
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +12 -6
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +3 -4
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +3 -4
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +1 -2
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +1 -2
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +17 -12
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Theme.mjs +3 -3
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +3 -3
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -4
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/package.json +15 -15
- package/src/createComponent.tsx +21 -1
- package/src/createStyledHOC.tsx +4 -2
- package/src/createVariable.ts +0 -10
- package/src/helpers/borderComponents.ts +62 -0
- package/src/helpers/createDesignSystem.ts +0 -2
- package/src/helpers/createStyledContext.tsx +15 -53
- package/src/helpers/formatDiagnostic.ts +9 -9
- package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
- package/src/helpers/getCSSStylesAtomic.ts +192 -207
- package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
- package/src/helpers/getDynamicVal.ts +4 -0
- package/src/helpers/getSplitStyles.tsx +2080 -3270
- package/src/helpers/grammarConfig.ts +218 -1
- package/src/helpers/insertStyleRule.tsx +4 -2
- package/src/helpers/log.ts +12 -11
- package/src/helpers/mergeVariants.ts +55 -18
- package/src/helpers/nativeOnlyProps.ts +0 -1
- package/src/helpers/nativeStyleEngine.ts +55 -14
- package/src/helpers/normalizeValueWithProperty.ts +10 -12
- package/src/helpers/parseBorderShorthand.native.ts +23 -45
- package/src/helpers/parseOutlineShorthand.native.ts +9 -40
- package/src/helpers/resolveSafeArea.ts +34 -101
- package/src/helpers/resolveVariantStyle.ts +77 -0
- package/src/helpers/styleFrontend.ts +8 -5
- package/src/helpers/styleStaticConfig.ts +5 -72
- package/src/helpers/styleStaticConfigCore.ts +110 -0
- package/src/helpers/styledDynamic.ts +191 -0
- package/src/helpers/tokenCategories.ts +40 -65
- package/src/helpers/variableValue.ts +20 -15
- package/src/helpers/warnOnce.ts +5 -4
- package/src/hooks/useAnimationDriver.ts +6 -2
- package/src/hooks/useComponentState.ts +55 -183
- package/src/hooks/useMedia.tsx +10 -8
- package/src/hooks/useStyle.ts +10 -0
- package/src/hooks/useThemeState.ts +51 -264
- package/src/index.ts +6 -6
- package/src/internalRuntimeTypes.ts +1 -0
- package/src/static-resolve.ts +7 -4
- package/src/style.ts +97 -0
- package/src/styled.tsx +39 -68
- package/src/types.tsx +105 -169
- package/src/views/TamaguiProvider.tsx +0 -2
- package/src/views/Text.tsx +20 -14
- package/src/views/Theme.tsx +13 -9
- package/src/views/ThemeDebug.tsx +0 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts +1 -1
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/createVariable.d.ts +0 -2
- package/types/createVariable.d.ts.map +1 -1
- package/types/helpers/borderComponents.d.ts +10 -0
- package/types/helpers/borderComponents.d.ts.map +1 -0
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/createStyledContext.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +20 -19
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.native.d.ts +5 -0
- package/types/helpers/getCSSStylesAtomic.native.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts +6 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -1
- package/types/helpers/getDynamicVal.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +3 -5
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts +25 -2
- package/types/helpers/grammarConfig.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts +1 -0
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/log.d.ts.map +1 -1
- package/types/helpers/mergeVariants.d.ts.map +1 -1
- package/types/helpers/nativeOnlyProps.d.ts +0 -1
- package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
- package/types/helpers/nativeStyleEngine.d.ts +6 -0
- package/types/helpers/nativeStyleEngine.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/parseBorderShorthand.native.d.ts +1 -0
- package/types/helpers/parseBorderShorthand.native.d.ts.map +1 -1
- package/types/helpers/parseOutlineShorthand.native.d.ts.map +1 -1
- package/types/helpers/resolveSafeArea.d.ts +0 -1
- package/types/helpers/resolveSafeArea.d.ts.map +1 -1
- package/types/helpers/resolveVariantStyle.d.ts +3 -0
- package/types/helpers/resolveVariantStyle.d.ts.map +1 -0
- package/types/helpers/styleFrontend.d.ts +3 -5
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +4 -9
- package/types/helpers/styleStaticConfig.d.ts.map +1 -1
- package/types/helpers/styleStaticConfigCore.d.ts +4 -0
- package/types/helpers/styleStaticConfigCore.d.ts.map +1 -0
- package/types/helpers/styledDynamic.d.ts +18 -0
- package/types/helpers/styledDynamic.d.ts.map +1 -0
- package/types/helpers/tokenCategories.d.ts +0 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/variableValue.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +68 -68
- package/types/hooks/useAnimationDriver.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useStyle.d.ts +4 -0
- package/types/hooks/useStyle.d.ts.map +1 -0
- package/types/hooks/useThemeState.d.ts +1 -11
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +6 -4
- package/types/index.d.ts.map +1 -1
- package/types/internalRuntimeTypes.d.ts +1 -1
- package/types/internalRuntimeTypes.d.ts.map +1 -1
- package/types/static-resolve.d.ts.map +1 -1
- package/types/style.d.ts +18 -0
- package/types/style.d.ts.map +1 -0
- package/types/styled.d.ts +10 -10
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +74 -49
- package/types/types.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +0 -345
- package/dist/cjs/helpers/directStyleCSS.native.js.map +0 -1
- package/dist/cjs/helpers/directStyleCSSCompiled.cjs +0 -40
- package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +0 -46
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js +0 -48
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +0 -91
- package/dist/cjs/helpers/getVariantExtras.native.cjs +0 -94
- package/dist/cjs/helpers/getVariantExtras.native.js +0 -96
- package/dist/cjs/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/cjs/helpers/variantResolvers.cjs +0 -87
- package/dist/cjs/helpers/variantResolvers.native.cjs +0 -140
- package/dist/cjs/helpers/variantResolvers.native.js +0 -142
- package/dist/cjs/helpers/variantResolvers.native.js.map +0 -1
- package/dist/esm/helpers/directStyleCSS.mjs +0 -317
- package/dist/esm/helpers/directStyleCSS.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSS.native.js +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.mjs +0 -11
- package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.native.js +0 -15
- package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/esm/helpers/getVariantExtras.mjs +0 -69
- package/dist/esm/helpers/getVariantExtras.mjs.map +0 -1
- package/dist/esm/helpers/getVariantExtras.native.js +0 -70
- package/dist/esm/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/esm/helpers/variantResolvers.mjs +0 -65
- package/dist/esm/helpers/variantResolvers.mjs.map +0 -1
- package/dist/esm/helpers/variantResolvers.native.js +0 -116
- package/dist/esm/helpers/variantResolvers.native.js.map +0 -1
- package/src/helpers/directStyleCSS.native.ts +0 -1
- package/src/helpers/directStyleCSS.ts +0 -513
- package/src/helpers/directStyleCSSCompiled.ts +0 -32
- package/src/helpers/getVariantExtras.tsx +0 -95
- package/src/helpers/variantResolvers.ts +0 -121
- package/types/helpers/directStyleCSS.d.ts +0 -28
- package/types/helpers/directStyleCSS.d.ts.map +0 -1
- package/types/helpers/directStyleCSS.native.d.ts +0 -2
- package/types/helpers/directStyleCSS.native.d.ts.map +0 -1
- package/types/helpers/directStyleCSSCompiled.d.ts +0 -10
- package/types/helpers/directStyleCSSCompiled.d.ts.map +0 -1
- package/types/helpers/getVariantExtras.d.ts +0 -4
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/variantResolvers.d.ts +0 -9
- package/types/helpers/variantResolvers.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStyledHOC.native.js","names":[],"sources":["cjs/createStyledHOC.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar createStyledHOC_exports = {};\n__export(createStyledHOC_exports, {\n createStyledHOC: () => createStyledHOC\n});\nmodule.exports = __toCommonJS(createStyledHOC_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_componentDisplayName = require(\"./helpers/componentDisplayName\");\nvar import_Theme = require(\"./views/Theme\");\nfunction createStyledHOC(component, render, options) {\n var staticConfig = component.staticConfig;\n var extendedConfig = {\n ...staticConfig,\n ...options === null || options === void 0 ? void 0 : options.staticConfig,\n neverFlatten: true,\n isHOC: true,\n isStyledHOC: false\n };\n var out = function StyledHOCComponent(props) {\n \"use no memo\";\n var _extendedConfig_defaultProps;\n var { ref, ...rest } = props;\n if (options === null || options === void 0 ? void 0 : options.disableTheme) {\n return render(rest, ref);\n }\n var defaultTheme = (_extendedConfig_defaultProps = extendedConfig.defaultProps) === null || _extendedConfig_defaultProps === void 0 ? void 0 : _extendedConfig_defaultProps.theme;\n var { theme: _, ...themedRest } = rest;\n var element = render({\n ...themedRest,\n \"data-disable-theme\": true\n }, ref);\n var themeProps = null;\n if (\"debug\" in props) {\n themeProps = {\n debug: props.debug\n };\n }\n if (\"theme\" in props || defaultTheme) {\n ;\n (themeProps || (themeProps = {})).name = \"theme\" in props ? props.theme : defaultTheme;\n }\n if (!themeProps) {\n return element;\n }\n var context = extendedConfig.context;\n if (!context) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n });\n }\n var contextValue = import_react.default.useContext(context);\n var overriddenContextProps;\n for (var key in context.props) {\n var value = props[key];\n if (value !== void 0) {\n ;\n (overriddenContextProps || (overriddenContextProps = {}))[key] = value;\n }\n }\n var Provider = context.Provider;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, {\n ...contextValue,\n ...overriddenContextProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n })\n });\n };\n if (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLED_HOC) {\n out = /* @__PURE__ */ import_react.default.memo(out);\n }\n var displayName = (options === null || options === void 0 ? void 0 : options.displayName) || component[import_componentDisplayName.componentDisplayName];\n if (displayName) {\n out.displayName = displayName;\n out[import_componentDisplayName.componentDisplayName] = displayName;\n }\n out.staticConfig = extendedConfig;\n return out;\n}\n//# sourceMappingURL=createStyledHOC.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,0BAA0B,CAAC;AAC/B,SAAS,yBAAyB,EAChC,uBAAuB,gBACzB,CAAC;AACD,OAAO,UAAU,aAAa,uBAAuB;AACrD,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,eAAe,QAAQ,QAAQ,OAAO,GAAG,CAAC;AAC9C,IAAI,8BAA8B,QAAQ,0CAAgC;AAC1E,IAAI,eAAe,QAAQ,yBAAe;AAC1C,SAAS,gBAAgB,WAAW,QAAQ,SAAS;CACnD,IAAI,eAAe,UAAU;CAC7B,IAAI,iBAAiB;EACnB,GAAG;EACH,GAAG,YAAY,QAAQ,YAAY,KAAK,IAAI,KAAK,IAAI,QAAQ;EAC7D,cAAc;EACd,OAAO;EACP,aAAa;CACf;CACA,IAAI,MAAM,SAAS,mBAAmB,OAAO;EAC3C;EACA,IAAI;EACJ,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"createStyledHOC.native.js","names":[],"sources":["cjs/createStyledHOC.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar createStyledHOC_exports = {};\n__export(createStyledHOC_exports, {\n createStyledHOC: () => createStyledHOC\n});\nmodule.exports = __toCommonJS(createStyledHOC_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_componentDisplayName = require(\"./helpers/componentDisplayName\");\nvar import_Theme = require(\"./views/Theme\");\nfunction createStyledHOC(component, render, options) {\n var staticConfig = component.staticConfig;\n var extendedConfig = {\n ...staticConfig,\n ...options === null || options === void 0 ? void 0 : options.staticConfig,\n neverFlatten: true,\n isHOC: true,\n isStyledHOC: false\n };\n var out = function StyledHOCComponent(props) {\n \"use no memo\";\n var _extendedConfig_defaultProps;\n var { ref = null, ...rest } = props;\n if (options === null || options === void 0 ? void 0 : options.disableTheme) {\n return render(rest, ref);\n }\n var defaultTheme = (_extendedConfig_defaultProps = extendedConfig.defaultProps) === null || _extendedConfig_defaultProps === void 0 ? void 0 : _extendedConfig_defaultProps.theme;\n var { theme: _, ...themedRest } = rest;\n var element = render({\n ...themedRest,\n \"data-disable-theme\": true\n }, ref);\n var themeProps = null;\n if (\"debug\" in props) {\n themeProps = {\n debug: props.debug\n };\n }\n if (\"theme\" in props || defaultTheme) {\n ;\n (themeProps || (themeProps = {})).name = \"theme\" in props ? props.theme : defaultTheme;\n }\n if (!themeProps) {\n return element;\n }\n var context = extendedConfig.context;\n if (!context) {\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n });\n }\n var contextValue = import_react.default.useContext(context);\n var overriddenContextProps;\n for (var key in context.props) {\n var value = props[key];\n if (value !== void 0) {\n ;\n (overriddenContextProps || (overriddenContextProps = {}))[key] = value;\n }\n }\n var Provider = context.Provider;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, {\n ...contextValue,\n ...overriddenContextProps,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Theme.Theme, {\n \"disable-child-theme\": true,\n ...themeProps,\n children: element\n })\n });\n };\n if (extendedConfig.memo || process.env.TAMAGUI_MEMOIZE_STYLED_HOC) {\n out = /* @__PURE__ */ import_react.default.memo(out);\n }\n var displayName = (options === null || options === void 0 ? void 0 : options.displayName) || component[import_componentDisplayName.componentDisplayName];\n if (displayName) {\n out.displayName = displayName;\n out[import_componentDisplayName.componentDisplayName] = displayName;\n }\n out.staticConfig = extendedConfig;\n return out;\n}\n//# sourceMappingURL=createStyledHOC.js.map\n"],"mappings":"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"}
|
|
@@ -24,9 +24,7 @@ __export(createVariable_exports, {
|
|
|
24
24
|
createVariable: () => createVariable,
|
|
25
25
|
didGetVariableValue: () => didGetVariableValue,
|
|
26
26
|
getVariable: () => getVariable,
|
|
27
|
-
getVariableName: () => getVariableName,
|
|
28
27
|
getVariableValue: () => getVariableValue,
|
|
29
|
-
getVariableVariable: () => getVariableVariable,
|
|
30
28
|
isVariable: () => isVariable,
|
|
31
29
|
px: () => px,
|
|
32
30
|
setDidGetVariableValue: () => setDidGetVariableValue,
|
|
@@ -102,14 +100,6 @@ function getVariableValue(v, group) {
|
|
|
102
100
|
}
|
|
103
101
|
return v;
|
|
104
102
|
}
|
|
105
|
-
function getVariableName(v) {
|
|
106
|
-
if (isVariable(v)) return v.name;
|
|
107
|
-
return v;
|
|
108
|
-
}
|
|
109
|
-
function getVariableVariable(v) {
|
|
110
|
-
if (isVariable(v)) return v.variable;
|
|
111
|
-
return v;
|
|
112
|
-
}
|
|
113
103
|
const createCSSVariable = (nameProp, includeVar = true) => {
|
|
114
104
|
if (process.env.NODE_ENV === "development") {
|
|
115
105
|
if (!nameProp || typeof nameProp !== "string") {
|
|
@@ -26,9 +26,7 @@ __export(createVariable_exports, {
|
|
|
26
26
|
createVariable: () => createVariable,
|
|
27
27
|
didGetVariableValue: () => didGetVariableValue,
|
|
28
28
|
getVariable: () => getVariable,
|
|
29
|
-
getVariableName: () => getVariableName,
|
|
30
29
|
getVariableValue: () => getVariableValue,
|
|
31
|
-
getVariableVariable: () => getVariableVariable,
|
|
32
30
|
isVariable: () => isVariable,
|
|
33
31
|
px: () => px,
|
|
34
32
|
setDidGetVariableValue: () => setDidGetVariableValue,
|
|
@@ -118,14 +116,6 @@ function getVariableValue(v, group) {
|
|
|
118
116
|
}
|
|
119
117
|
return v;
|
|
120
118
|
}
|
|
121
|
-
function getVariableName(v) {
|
|
122
|
-
if (isVariable(v)) return v.name;
|
|
123
|
-
return v;
|
|
124
|
-
}
|
|
125
|
-
function getVariableVariable(v) {
|
|
126
|
-
if (isVariable(v)) return v.variable;
|
|
127
|
-
return v;
|
|
128
|
-
}
|
|
129
119
|
var createCSSVariable = function(nameProp) {
|
|
130
120
|
var includeVar = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
131
121
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -26,9 +26,7 @@ __export(createVariable_exports, {
|
|
|
26
26
|
createVariable: () => createVariable,
|
|
27
27
|
didGetVariableValue: () => didGetVariableValue,
|
|
28
28
|
getVariable: () => getVariable,
|
|
29
|
-
getVariableName: () => getVariableName,
|
|
30
29
|
getVariableValue: () => getVariableValue,
|
|
31
|
-
getVariableVariable: () => getVariableVariable,
|
|
32
30
|
isVariable: () => isVariable,
|
|
33
31
|
px: () => px,
|
|
34
32
|
setDidGetVariableValue: () => setDidGetVariableValue,
|
|
@@ -118,14 +116,6 @@ function getVariableValue(v, group) {
|
|
|
118
116
|
}
|
|
119
117
|
return v;
|
|
120
118
|
}
|
|
121
|
-
function getVariableName(v) {
|
|
122
|
-
if (isVariable(v)) return v.name;
|
|
123
|
-
return v;
|
|
124
|
-
}
|
|
125
|
-
function getVariableVariable(v) {
|
|
126
|
-
if (isVariable(v)) return v.variable;
|
|
127
|
-
return v;
|
|
128
|
-
}
|
|
129
119
|
var createCSSVariable = function(nameProp) {
|
|
130
120
|
var includeVar = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
131
121
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createVariable.native.js","names":[],"sources":["cjs/createVariable.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar createVariable_exports = {};\n__export(createVariable_exports, {\n createCSSVariable: () => createCSSVariable,\n createVariable: () => createVariable,\n didGetVariableValue: () => didGetVariableValue,\n getVariable: () => getVariable,\n
|
|
1
|
+
{"version":3,"file":"createVariable.native.js","names":[],"sources":["cjs/createVariable.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar createVariable_exports = {};\n__export(createVariable_exports, {\n createCSSVariable: () => createCSSVariable,\n createVariable: () => createVariable,\n didGetVariableValue: () => didGetVariableValue,\n getVariable: () => getVariable,\n getVariableValue: () => getVariableValue,\n isVariable: () => isVariable,\n px: () => px,\n setDidGetVariableValue: () => setDidGetVariableValue,\n variableToString: () => variableToString\n});\nmodule.exports = __toCommonJS(createVariable_exports);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_config = require(\"./config\");\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nfunction constructCSSVariableName(name) {\n return `var(--${process.env.TAMAGUI_CSS_VARIABLE_PREFIX || \"\"}${name})`;\n}\nvar pxStringRe = /^-?\\d*\\.?\\d+px$/;\nvar createVariable = function(props) {\n var skipHash = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n if (!skipHash && isVariable(props)) return props;\n var { key, name, val } = props;\n var finalVal = val;\n var needsPx = false;\n if (typeof val === \"string\" && pxStringRe.test(val)) {\n finalVal = Number.parseFloat(val);\n needsPx = true;\n }\n var variable = {\n isVar: true,\n key,\n name: skipHash ? name : (0, import_helpers.simpleHash)(name, 40),\n val: finalVal,\n variable: import_constants.isWeb ? skipHash ? constructCSSVariableName(name) : createCSSVariable(name) : \"\"\n };\n if (needsPx && import_constants.isWeb) {\n variable.needsPx = true;\n }\n return variable;\n};\nfunction variableToString(vrble) {\n var getValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n if (isVariable(vrble)) {\n if (!getValue && import_constants.isWeb && vrble.variable) {\n return vrble.variable;\n }\n return `${vrble.val}`;\n }\n return `${vrble || \"\"}`;\n}\nfunction isVariable(v) {\n return v && (typeof v === \"undefined\" ? \"undefined\" : _type_of(v)) === \"object\" && \"isVar\" in v;\n}\nfunction getVariable(nameOrVariable) {\n var group = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"size\";\n var _tokens_group;\n if (nameOrVariable === null || nameOrVariable === void 0 ? void 0 : nameOrVariable.dynamic) {\n return nameOrVariable;\n }\n setDidGetVariableValue(true);\n if (isVariable(nameOrVariable)) {\n return variableToString(nameOrVariable);\n }\n var tokens = (0, import_config.getConfig)().tokensParsed;\n var _tokens_group_nameOrVariable;\n return variableToString((_tokens_group_nameOrVariable = (_tokens_group = tokens[group]) === null || _tokens_group === void 0 ? void 0 : _tokens_group[nameOrVariable]) !== null && _tokens_group_nameOrVariable !== void 0 ? _tokens_group_nameOrVariable : nameOrVariable);\n}\nvar accessed = false;\nvar setDidGetVariableValue = function(val) {\n return accessed = val;\n};\nvar didGetVariableValue = function() {\n return accessed;\n};\nfunction getVariableValue(v, group) {\n if (isVariable(v)) {\n setDidGetVariableValue(true);\n return v.val;\n }\n if (group) {\n var _tokens_group;\n var tokens = (0, import_config.getConfig)().tokensParsed;\n var token = (_tokens_group = tokens[group]) === null || _tokens_group === void 0 ? void 0 : _tokens_group[v];\n if (token) {\n setDidGetVariableValue(true);\n return token.val;\n }\n }\n return v;\n}\nvar createCSSVariable = function(nameProp) {\n var includeVar = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;\n if (process.env.NODE_ENV === \"development\") {\n if (!nameProp || typeof nameProp !== \"string\") {\n throw new Error(`createCSSVariable expected string, got: ${nameProp}`);\n }\n }\n var name = (0, import_helpers.simpleHash)(nameProp, 60);\n return includeVar ? constructCSSVariableName(name) : name;\n};\nfunction px(value) {\n return {\n val: value,\n needsPx: true\n };\n}\n//# sourceMappingURL=createVariable.js.map\n"],"mappings":"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"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var borderComponents_exports = {};
|
|
22
|
+
__export(borderComponents_exports, {
|
|
23
|
+
classifyBorderComponents: () => classifyBorderComponents,
|
|
24
|
+
lineStyles: () => lineStyles,
|
|
25
|
+
splitComponents: () => splitComponents,
|
|
26
|
+
startsValueFunction: () => startsValueFunction
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(borderComponents_exports);
|
|
29
|
+
const lineStyles = /* @__PURE__ */ new Set([
|
|
30
|
+
"none",
|
|
31
|
+
"hidden",
|
|
32
|
+
"dotted",
|
|
33
|
+
"dashed",
|
|
34
|
+
"solid",
|
|
35
|
+
"double",
|
|
36
|
+
"groove",
|
|
37
|
+
"ridge",
|
|
38
|
+
"inset",
|
|
39
|
+
"outset"
|
|
40
|
+
]);
|
|
41
|
+
function splitComponents(value) {
|
|
42
|
+
return value.match(/(?:[^\s("']+|\((?:[^()]|\([^)]*\))*\)|"(?:\\.|[^"])*"|'(?:\\.|[^'])*')+/g) || [];
|
|
43
|
+
}
|
|
44
|
+
function startsValueFunction(value) {
|
|
45
|
+
return /^-?[a-z][a-z0-9-]*\(/i.test(value);
|
|
46
|
+
}
|
|
47
|
+
const colorFunction = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i;
|
|
48
|
+
function classifyBorderComponents(raw, allowAuto = false) {
|
|
49
|
+
const out = {};
|
|
50
|
+
for (const part of splitComponents(raw)) {
|
|
51
|
+
if (lineStyles.has(part) || allowAuto && part === "auto") {
|
|
52
|
+
out.style = part;
|
|
53
|
+
} else if (colorFunction.test(part)) {
|
|
54
|
+
out.color = part;
|
|
55
|
+
} else if (part === "thin" || part === "medium" || part === "thick" || /^[+-]?(?:\d+\.?\d*|\.\d+)(?:%|[a-z]+)?$/.test(part) || startsValueFunction(part)) {
|
|
56
|
+
out.width = part;
|
|
57
|
+
} else {
|
|
58
|
+
out.color = part;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var borderComponents_exports = {};
|
|
24
|
+
__export(borderComponents_exports, {
|
|
25
|
+
classifyBorderComponents: () => classifyBorderComponents,
|
|
26
|
+
lineStyles: () => lineStyles,
|
|
27
|
+
splitComponents: () => splitComponents,
|
|
28
|
+
startsValueFunction: () => startsValueFunction
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(borderComponents_exports);
|
|
31
|
+
var lineStyles = /* @__PURE__ */ new Set([
|
|
32
|
+
"none",
|
|
33
|
+
"hidden",
|
|
34
|
+
"dotted",
|
|
35
|
+
"dashed",
|
|
36
|
+
"solid",
|
|
37
|
+
"double",
|
|
38
|
+
"groove",
|
|
39
|
+
"ridge",
|
|
40
|
+
"inset",
|
|
41
|
+
"outset"
|
|
42
|
+
]);
|
|
43
|
+
function splitComponents(value) {
|
|
44
|
+
return value.match(/(?:[^\s("']+|\((?:[^()]|\([^)]*\))*\)|"(?:\\.|[^"])*"|'(?:\\.|[^'])*')+/g) || [];
|
|
45
|
+
}
|
|
46
|
+
function startsValueFunction(value) {
|
|
47
|
+
return /^-?[a-z][a-z0-9-]*\(/i.test(value);
|
|
48
|
+
}
|
|
49
|
+
var colorFunction = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i;
|
|
50
|
+
function classifyBorderComponents(raw) {
|
|
51
|
+
var allowAuto = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
52
|
+
var out = {};
|
|
53
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
54
|
+
try {
|
|
55
|
+
for (var _iterator = splitComponents(raw)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
56
|
+
var part = _step.value;
|
|
57
|
+
if (lineStyles.has(part) || allowAuto && part === "auto") {
|
|
58
|
+
out.style = part;
|
|
59
|
+
} else if (colorFunction.test(part)) {
|
|
60
|
+
out.color = part;
|
|
61
|
+
} else if (part === "thin" || part === "medium" || part === "thick" || /^[+-]?(?:\d+\.?\d*|\.\d+)(?:%|[a-z]+)?$/.test(part) || startsValueFunction(part)) {
|
|
62
|
+
out.width = part;
|
|
63
|
+
} else {
|
|
64
|
+
out.color = part;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} catch (err) {
|
|
68
|
+
_didIteratorError = true;
|
|
69
|
+
_iteratorError = err;
|
|
70
|
+
} finally {
|
|
71
|
+
try {
|
|
72
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
73
|
+
_iterator.return();
|
|
74
|
+
}
|
|
75
|
+
} finally {
|
|
76
|
+
if (_didIteratorError) {
|
|
77
|
+
throw _iteratorError;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var borderComponents_exports = {};
|
|
24
|
+
__export(borderComponents_exports, {
|
|
25
|
+
classifyBorderComponents: () => classifyBorderComponents,
|
|
26
|
+
lineStyles: () => lineStyles,
|
|
27
|
+
splitComponents: () => splitComponents,
|
|
28
|
+
startsValueFunction: () => startsValueFunction
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(borderComponents_exports);
|
|
31
|
+
var lineStyles = /* @__PURE__ */ new Set([
|
|
32
|
+
"none",
|
|
33
|
+
"hidden",
|
|
34
|
+
"dotted",
|
|
35
|
+
"dashed",
|
|
36
|
+
"solid",
|
|
37
|
+
"double",
|
|
38
|
+
"groove",
|
|
39
|
+
"ridge",
|
|
40
|
+
"inset",
|
|
41
|
+
"outset"
|
|
42
|
+
]);
|
|
43
|
+
function splitComponents(value) {
|
|
44
|
+
return value.match(/(?:[^\s("']+|\((?:[^()]|\([^)]*\))*\)|"(?:\\.|[^"])*"|'(?:\\.|[^'])*')+/g) || [];
|
|
45
|
+
}
|
|
46
|
+
function startsValueFunction(value) {
|
|
47
|
+
return /^-?[a-z][a-z0-9-]*\(/i.test(value);
|
|
48
|
+
}
|
|
49
|
+
var colorFunction = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(/i;
|
|
50
|
+
function classifyBorderComponents(raw) {
|
|
51
|
+
var allowAuto = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
52
|
+
var out = {};
|
|
53
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
54
|
+
try {
|
|
55
|
+
for (var _iterator = splitComponents(raw)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
56
|
+
var part = _step.value;
|
|
57
|
+
if (lineStyles.has(part) || allowAuto && part === "auto") {
|
|
58
|
+
out.style = part;
|
|
59
|
+
} else if (colorFunction.test(part)) {
|
|
60
|
+
out.color = part;
|
|
61
|
+
} else if (part === "thin" || part === "medium" || part === "thick" || /^[+-]?(?:\d+\.?\d*|\.\d+)(?:%|[a-z]+)?$/.test(part) || startsValueFunction(part)) {
|
|
62
|
+
out.width = part;
|
|
63
|
+
} else {
|
|
64
|
+
out.color = part;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} catch (err) {
|
|
68
|
+
_didIteratorError = true;
|
|
69
|
+
_iteratorError = err;
|
|
70
|
+
} finally {
|
|
71
|
+
try {
|
|
72
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
73
|
+
_iterator.return();
|
|
74
|
+
}
|
|
75
|
+
} finally {
|
|
76
|
+
if (_didIteratorError) {
|
|
77
|
+
throw _iteratorError;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=borderComponents.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borderComponents.native.js","names":[],"sources":["cjs/helpers/borderComponents.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar borderComponents_exports = {};\n__export(borderComponents_exports, {\n classifyBorderComponents: () => classifyBorderComponents,\n lineStyles: () => lineStyles,\n splitComponents: () => splitComponents,\n startsValueFunction: () => startsValueFunction\n});\nmodule.exports = __toCommonJS(borderComponents_exports);\nvar lineStyles = /* @__PURE__ */ new Set([\n \"none\",\n \"hidden\",\n \"dotted\",\n \"dashed\",\n \"solid\",\n \"double\",\n \"groove\",\n \"ridge\",\n \"inset\",\n \"outset\"\n]);\nfunction splitComponents(value) {\n return value.match(/(?:[^\\s(\"']+|\\((?:[^()]|\\([^)]*\\))*\\)|\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*')+/g) || [];\n}\nfunction startsValueFunction(value) {\n return /^-?[a-z][a-z0-9-]*\\(/i.test(value);\n}\nvar colorFunction = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\\(/i;\nfunction classifyBorderComponents(raw) {\n var allowAuto = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;\n var out = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = splitComponents(raw)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var part = _step.value;\n if (lineStyles.has(part) || allowAuto && part === \"auto\") {\n out.style = part;\n } else if (colorFunction.test(part)) {\n out.color = part;\n } else if (part === \"thin\" || part === \"medium\" || part === \"thick\" || /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:%|[a-z]+)?$/.test(part) || startsValueFunction(part)) {\n out.width = part;\n } else {\n out.color = part;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return out;\n}\n//# sourceMappingURL=borderComponents.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,2BAA2B,CAAC;AAChC,SAAS,0BAA0B;CACjC,gCAAgC;CAChC,kBAAkB;CAClB,uBAAuB;CACvB,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,wBAAwB;AACtD,IAAI,6BAA6B,IAAI,IAAI;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,SAAS,gBAAgB,OAAO;CAC9B,OAAO,MAAM,MAAM,0EAA0E,KAAK,CAAC;AACrG;AACA,SAAS,oBAAoB,OAAO;CAClC,OAAO,wBAAwB,KAAK,KAAK;AAC3C;AACA,IAAI,gBAAgB;AACpB,SAAS,yBAAyB,KAAK;CACrC,IAAI,YAAY,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CACjF,IAAI,MAAM,CAAC;CACX,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,gBAAgB,GAAG,CAAC,CAAC,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;GACrK,IAAI,OAAO,MAAM;GACjB,IAAI,WAAW,IAAI,IAAI,KAAK,aAAa,SAAS,QAAQ;IACxD,IAAI,QAAQ;GACd,OAAO,IAAI,cAAc,KAAK,IAAI,GAAG;IACnC,IAAI,QAAQ;GACd,OAAO,IAAI,SAAS,UAAU,SAAS,YAAY,SAAS,WAAW,0CAA0C,KAAK,IAAI,KAAK,oBAAoB,IAAI,GAAG;IACxJ,IAAI,QAAQ;GACd,OAAO;IACL,IAAI,QAAQ;GACd;EACF;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO;AACT"}
|
|
@@ -141,8 +141,6 @@ const getStaticCSS = (themeConfig, separator, withThemes, state) => {
|
|
|
141
141
|
@scope (.is_Text) to (.is_View) { :where(.is_Text) { white-space: inherit; word-wrap: inherit; } }
|
|
142
142
|
._dsp_contents {display:contents;}
|
|
143
143
|
._no_backdrop::backdrop {display: none;}
|
|
144
|
-
.is_Input::selection, .is_TextArea::selection {background-color: var(--t_selectionColor);}
|
|
145
|
-
.is_Input::placeholder, .is_TextArea::placeholder {color: var(--t_placeholderColor);}
|
|
146
144
|
:root ._pe-boxonly>* {pointer-events:none;}
|
|
147
145
|
:root ._pe-boxnone>* {pointer-events:auto;}
|
|
148
146
|
._hsb-x::-webkit-scrollbar:horizontal { display: none !important; }
|
|
@@ -34,20 +34,18 @@ var import_objectIdentityKey = require("./objectIdentityKey.cjs");
|
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
const createStyledContext = ((defaultValues, namespaceOrOptions = "") => {
|
|
36
36
|
"use no memo";
|
|
37
|
-
const createReactContext = import_react.default[Math.random() ? "createContext" : "createContext"];
|
|
38
|
-
const useReactMemo = import_react.default[Math.random() ? "useMemo" : "useMemo"];
|
|
39
|
-
const useReactContext = import_react.default[Math.random() ? "useContext" : "useContext"];
|
|
40
37
|
const namespace = typeof namespaceOrOptions === "string" ? namespaceOrOptions : namespaceOrOptions.namespace || "";
|
|
41
|
-
const
|
|
42
|
-
const
|
|
38
|
+
const defaultKeys = (0, import_isObj.isPlainObject)(defaultValues) ? Object.keys(defaultValues) : void 0;
|
|
39
|
+
const propKeys = typeof namespaceOrOptions === "object" && namespaceOrOptions.keys ? namespaceOrOptions.keys : defaultKeys;
|
|
40
|
+
const OGContext = import_react.default.createContext(defaultValues);
|
|
43
41
|
const OGProvider = OGContext.Provider;
|
|
44
42
|
const Context = OGContext;
|
|
45
43
|
const scopedContexts = /* @__PURE__ */ new Map();
|
|
46
|
-
const LastScopeInNamespace =
|
|
44
|
+
const LastScopeInNamespace = import_react.default.createContext(namespace);
|
|
47
45
|
function getOrCreateScopedContext(scope) {
|
|
48
46
|
let ScopedContext = scopedContexts.get(scope);
|
|
49
47
|
if (!ScopedContext) {
|
|
50
|
-
ScopedContext =
|
|
48
|
+
ScopedContext = import_react.default.createContext(defaultValues);
|
|
51
49
|
scopedContexts.set(scope, ScopedContext);
|
|
52
50
|
}
|
|
53
51
|
return ScopedContext;
|
|
@@ -55,16 +53,11 @@ const createStyledContext = ((defaultValues, namespaceOrOptions = "") => {
|
|
|
55
53
|
const getNamespacedScope = (scope) => namespace ? `${namespace}--${scope}` : scope;
|
|
56
54
|
const Provider = ({ children, scope: scopeIn, __disableMergeDefaultValues, ...values }) => {
|
|
57
55
|
const scope = getNamespacedScope(scopeIn);
|
|
58
|
-
const next =
|
|
59
|
-
if (__disableMergeDefaultValues)
|
|
60
|
-
return values;
|
|
61
|
-
}
|
|
56
|
+
const next = import_react.default.useMemo(() => {
|
|
57
|
+
if (__disableMergeDefaultValues) return values;
|
|
62
58
|
return (0, import_mergeProps.mergeProps)(defaultValues || {}, values);
|
|
63
59
|
}, [(0, import_objectIdentityKey.objectIdentityKey)(values)]);
|
|
64
|
-
|
|
65
|
-
if (scope) {
|
|
66
|
-
ScopedProvider = getOrCreateScopedContext(scope).Provider;
|
|
67
|
-
}
|
|
60
|
+
const ScopedProvider = scope ? getOrCreateScopedContext(scope).Provider : OGProvider;
|
|
68
61
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LastScopeInNamespace.Provider, {
|
|
69
62
|
value: scope,
|
|
70
63
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScopedProvider, {
|
|
@@ -74,11 +67,10 @@ const createStyledContext = ((defaultValues, namespaceOrOptions = "") => {
|
|
|
74
67
|
});
|
|
75
68
|
};
|
|
76
69
|
const useStyledContext = (scopeIn = "") => {
|
|
77
|
-
const lastScopeInNamespace =
|
|
70
|
+
const lastScopeInNamespace = import_react.default.useContext(LastScopeInNamespace);
|
|
78
71
|
const scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn;
|
|
79
72
|
const context = scope ? getOrCreateScopedContext(scope) : OGContext;
|
|
80
|
-
|
|
81
|
-
return value;
|
|
73
|
+
return import_react.default.useContext(context);
|
|
82
74
|
};
|
|
83
75
|
Context.Provider = Provider;
|
|
84
76
|
Context.props = defaultValues;
|
|
@@ -34,23 +34,25 @@ var import_react = __toESM(require("react"), 1);
|
|
|
34
34
|
var import_isObj = require("./isObj.native.js");
|
|
35
35
|
var import_mergeProps = require("./mergeProps.native.js");
|
|
36
36
|
var import_objectIdentityKey = require("./objectIdentityKey.native.js");
|
|
37
|
+
function _type_of(obj) {
|
|
38
|
+
"@swc/helpers - typeof";
|
|
39
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
40
|
+
}
|
|
37
41
|
var createStyledContext = function(defaultValues) {
|
|
38
42
|
"use no memo";
|
|
39
43
|
var namespaceOrOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
40
|
-
var createReactContext = import_react.default[Math.random() ? "createContext" : "createContext"];
|
|
41
|
-
var useReactMemo = import_react.default[Math.random() ? "useMemo" : "useMemo"];
|
|
42
|
-
var useReactContext = import_react.default[Math.random() ? "useContext" : "useContext"];
|
|
43
44
|
var namespace = typeof namespaceOrOptions === "string" ? namespaceOrOptions : namespaceOrOptions.namespace || "";
|
|
44
|
-
var
|
|
45
|
-
var
|
|
45
|
+
var defaultKeys = (0, import_isObj.isPlainObject)(defaultValues) ? Object.keys(defaultValues) : void 0;
|
|
46
|
+
var propKeys = (typeof namespaceOrOptions === "undefined" ? "undefined" : _type_of(namespaceOrOptions)) === "object" && namespaceOrOptions.keys ? namespaceOrOptions.keys : defaultKeys;
|
|
47
|
+
var OGContext = /* @__PURE__ */ import_react.default.createContext(defaultValues);
|
|
46
48
|
var OGProvider = OGContext.Provider;
|
|
47
49
|
var Context = OGContext;
|
|
48
50
|
var scopedContexts = /* @__PURE__ */ new Map();
|
|
49
|
-
var LastScopeInNamespace =
|
|
51
|
+
var LastScopeInNamespace = /* @__PURE__ */ import_react.default.createContext(namespace);
|
|
50
52
|
function getOrCreateScopedContext(scope) {
|
|
51
53
|
var ScopedContext = scopedContexts.get(scope);
|
|
52
54
|
if (!ScopedContext) {
|
|
53
|
-
ScopedContext =
|
|
55
|
+
ScopedContext = /* @__PURE__ */ import_react.default.createContext(defaultValues);
|
|
54
56
|
scopedContexts.set(scope, ScopedContext);
|
|
55
57
|
}
|
|
56
58
|
return ScopedContext;
|
|
@@ -61,16 +63,11 @@ var createStyledContext = function(defaultValues) {
|
|
|
61
63
|
var Provider = function(param) {
|
|
62
64
|
var { children, scope: scopeIn, __disableMergeDefaultValues, ...values } = param;
|
|
63
65
|
var scope = getNamespacedScope(scopeIn);
|
|
64
|
-
var next =
|
|
65
|
-
if (__disableMergeDefaultValues)
|
|
66
|
-
return values;
|
|
67
|
-
}
|
|
66
|
+
var next = import_react.default.useMemo(function() {
|
|
67
|
+
if (__disableMergeDefaultValues) return values;
|
|
68
68
|
return (0, import_mergeProps.mergeProps)(defaultValues || {}, values);
|
|
69
69
|
}, [(0, import_objectIdentityKey.objectIdentityKey)(values)]);
|
|
70
|
-
var ScopedProvider = OGProvider;
|
|
71
|
-
if (scope) {
|
|
72
|
-
ScopedProvider = getOrCreateScopedContext(scope).Provider;
|
|
73
|
-
}
|
|
70
|
+
var ScopedProvider = scope ? getOrCreateScopedContext(scope).Provider : OGProvider;
|
|
74
71
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LastScopeInNamespace.Provider, {
|
|
75
72
|
value: scope,
|
|
76
73
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScopedProvider, {
|
|
@@ -81,11 +78,10 @@ var createStyledContext = function(defaultValues) {
|
|
|
81
78
|
};
|
|
82
79
|
var useStyledContext = function() {
|
|
83
80
|
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
84
|
-
var lastScopeInNamespace =
|
|
81
|
+
var lastScopeInNamespace = import_react.default.useContext(LastScopeInNamespace);
|
|
85
82
|
var scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn;
|
|
86
83
|
var context = scope ? getOrCreateScopedContext(scope) : OGContext;
|
|
87
|
-
|
|
88
|
-
return value;
|
|
84
|
+
return import_react.default.useContext(context);
|
|
89
85
|
};
|
|
90
86
|
Context.Provider = Provider;
|
|
91
87
|
Context.props = defaultValues;
|
|
@@ -34,23 +34,25 @@ var import_react = __toESM(require("react"), 1);
|
|
|
34
34
|
var import_isObj = require("./isObj.native.js");
|
|
35
35
|
var import_mergeProps = require("./mergeProps.native.js");
|
|
36
36
|
var import_objectIdentityKey = require("./objectIdentityKey.native.js");
|
|
37
|
+
function _type_of(obj) {
|
|
38
|
+
"@swc/helpers - typeof";
|
|
39
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
40
|
+
}
|
|
37
41
|
var createStyledContext = function(defaultValues) {
|
|
38
42
|
"use no memo";
|
|
39
43
|
var namespaceOrOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
40
|
-
var createReactContext = import_react.default[Math.random() ? "createContext" : "createContext"];
|
|
41
|
-
var useReactMemo = import_react.default[Math.random() ? "useMemo" : "useMemo"];
|
|
42
|
-
var useReactContext = import_react.default[Math.random() ? "useContext" : "useContext"];
|
|
43
44
|
var namespace = typeof namespaceOrOptions === "string" ? namespaceOrOptions : namespaceOrOptions.namespace || "";
|
|
44
|
-
var
|
|
45
|
-
var
|
|
45
|
+
var defaultKeys = (0, import_isObj.isPlainObject)(defaultValues) ? Object.keys(defaultValues) : void 0;
|
|
46
|
+
var propKeys = (typeof namespaceOrOptions === "undefined" ? "undefined" : _type_of(namespaceOrOptions)) === "object" && namespaceOrOptions.keys ? namespaceOrOptions.keys : defaultKeys;
|
|
47
|
+
var OGContext = /* @__PURE__ */ import_react.default.createContext(defaultValues);
|
|
46
48
|
var OGProvider = OGContext.Provider;
|
|
47
49
|
var Context = OGContext;
|
|
48
50
|
var scopedContexts = /* @__PURE__ */ new Map();
|
|
49
|
-
var LastScopeInNamespace =
|
|
51
|
+
var LastScopeInNamespace = /* @__PURE__ */ import_react.default.createContext(namespace);
|
|
50
52
|
function getOrCreateScopedContext(scope) {
|
|
51
53
|
var ScopedContext = scopedContexts.get(scope);
|
|
52
54
|
if (!ScopedContext) {
|
|
53
|
-
ScopedContext =
|
|
55
|
+
ScopedContext = /* @__PURE__ */ import_react.default.createContext(defaultValues);
|
|
54
56
|
scopedContexts.set(scope, ScopedContext);
|
|
55
57
|
}
|
|
56
58
|
return ScopedContext;
|
|
@@ -61,16 +63,11 @@ var createStyledContext = function(defaultValues) {
|
|
|
61
63
|
var Provider = function(param) {
|
|
62
64
|
var { children, scope: scopeIn, __disableMergeDefaultValues, ...values } = param;
|
|
63
65
|
var scope = getNamespacedScope(scopeIn);
|
|
64
|
-
var next =
|
|
65
|
-
if (__disableMergeDefaultValues)
|
|
66
|
-
return values;
|
|
67
|
-
}
|
|
66
|
+
var next = import_react.default.useMemo(function() {
|
|
67
|
+
if (__disableMergeDefaultValues) return values;
|
|
68
68
|
return (0, import_mergeProps.mergeProps)(defaultValues || {}, values);
|
|
69
69
|
}, [(0, import_objectIdentityKey.objectIdentityKey)(values)]);
|
|
70
|
-
var ScopedProvider = OGProvider;
|
|
71
|
-
if (scope) {
|
|
72
|
-
ScopedProvider = getOrCreateScopedContext(scope).Provider;
|
|
73
|
-
}
|
|
70
|
+
var ScopedProvider = scope ? getOrCreateScopedContext(scope).Provider : OGProvider;
|
|
74
71
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LastScopeInNamespace.Provider, {
|
|
75
72
|
value: scope,
|
|
76
73
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScopedProvider, {
|
|
@@ -81,11 +78,10 @@ var createStyledContext = function(defaultValues) {
|
|
|
81
78
|
};
|
|
82
79
|
var useStyledContext = function() {
|
|
83
80
|
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
84
|
-
var lastScopeInNamespace =
|
|
81
|
+
var lastScopeInNamespace = import_react.default.useContext(LastScopeInNamespace);
|
|
85
82
|
var scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn;
|
|
86
83
|
var context = scope ? getOrCreateScopedContext(scope) : OGContext;
|
|
87
|
-
|
|
88
|
-
return value;
|
|
84
|
+
return import_react.default.useContext(context);
|
|
89
85
|
};
|
|
90
86
|
Context.Provider = Provider;
|
|
91
87
|
Context.props = defaultValues;
|