@tamagui/web 1.88.13 → 1.88.15
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/LICENSE +21 -0
- package/dist/cjs/createComponent.js +2 -2
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createComponent.native.js +1 -1
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.js.map +1 -1
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/createVariables.js.map +1 -1
- package/dist/cjs/createVariables.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +15 -19
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js +12 -18
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.js +3 -3
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +3 -3
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.js.map +1 -1
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/registerCSSVariable.js.map +1 -1
- package/dist/cjs/helpers/registerCSSVariable.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.js +66 -0
- package/dist/cjs/hooks/getThemeProxied.js.map +6 -0
- package/dist/cjs/hooks/getThemeProxied.native.js +100 -0
- package/dist/cjs/hooks/getThemeProxied.native.js.map +6 -0
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/insertFont.js.map +1 -1
- package/dist/cjs/insertFont.native.js.map +1 -1
- package/dist/cjs/setupHooks.js.map +1 -1
- package/dist/cjs/setupHooks.native.js.map +1 -1
- package/dist/cjs/views/FontLanguage.native.js.map +1 -1
- package/dist/cjs/views/Slot.js.map +1 -1
- package/dist/cjs/views/Slot.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.js +5 -5
- package/dist/cjs/views/TamaguiProvider.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.native.js +5 -5
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/Theme.js.map +1 -1
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/esm/Tamagui.mjs +43 -0
- package/dist/esm/config.mjs +51 -0
- package/dist/esm/constants/accessibilityDirectMap.mjs +50 -0
- package/dist/esm/constants/constants.mjs +16 -0
- package/dist/esm/constants/isDevTools.mjs +7 -0
- package/dist/esm/contexts/ComponentContext.mjs +13 -0
- package/dist/esm/createComponent.js +2 -2
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createComponent.mjs +771 -0
- package/dist/esm/createComponent.native.js +1 -1
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createFont.mjs +18 -0
- package/dist/esm/createShorthands.mjs +4 -0
- package/dist/esm/createTamagui.js.map +1 -1
- package/dist/esm/createTamagui.mjs +206 -0
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTheme.mjs +2 -0
- package/dist/esm/createTokens.mjs +5 -0
- package/dist/esm/createVariable.mjs +48 -0
- package/dist/esm/createVariables.js.map +1 -1
- package/dist/esm/createVariables.mjs +35 -0
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/defaultComponentState.mjs +16 -0
- package/dist/esm/helpers/ThemeManager.mjs +156 -0
- package/dist/esm/helpers/ThemeManagerContext.mjs +3 -0
- package/dist/esm/helpers/createMediaStyle.mjs +71 -0
- package/dist/esm/helpers/createShallowSetState.mjs +17 -0
- package/dist/esm/helpers/createStyledContext.mjs +35 -0
- package/dist/esm/helpers/defaultOffset.mjs +5 -0
- package/dist/esm/helpers/expandStyle.mjs +38 -0
- package/dist/esm/helpers/expandStyles.mjs +15 -0
- package/dist/esm/helpers/getExpandedShorthands.mjs +9 -0
- package/dist/esm/helpers/getFontLanguage.mjs +2 -0
- package/dist/esm/helpers/getGroupPropParts.mjs +13 -0
- package/dist/esm/helpers/getSplitStyles.js +15 -18
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +638 -0
- package/dist/esm/helpers/getSplitStyles.native.js +12 -18
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.js +1 -4
- package/dist/esm/helpers/getStylesAtomic.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.mjs +150 -0
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +87 -0
- package/dist/esm/helpers/getVariantExtras.mjs +43 -0
- package/dist/esm/helpers/insertStyleRule.js +3 -3
- package/dist/esm/helpers/insertStyleRule.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +177 -0
- package/dist/esm/helpers/insertStyleRule.native.js +3 -3
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isObj.mjs +2 -0
- package/dist/esm/helpers/isTamaguiComponent.mjs +5 -0
- package/dist/esm/helpers/isTamaguiElement.mjs +4 -0
- package/dist/esm/helpers/log.mjs +4 -0
- package/dist/esm/helpers/matchMedia.mjs +11 -0
- package/dist/esm/helpers/mergeProps.mjs +21 -0
- package/dist/esm/helpers/mergeVariants.mjs +16 -0
- package/dist/esm/helpers/normalizeColor.mjs +17 -0
- package/dist/esm/helpers/normalizeShadow.mjs +23 -0
- package/dist/esm/helpers/normalizeStyle.mjs +23 -0
- package/dist/esm/helpers/normalizeStylePropKeys.mjs +2 -0
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +32 -0
- package/dist/esm/helpers/objectIdentityKey.mjs +15 -0
- package/dist/esm/helpers/propMapper.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +239 -0
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.mjs +36 -0
- package/dist/esm/helpers/proxyThemeVariables.mjs +12 -0
- package/dist/esm/helpers/pseudoDescriptors.mjs +34 -0
- package/dist/esm/helpers/registerCSSVariable.js.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.mjs +7 -0
- package/dist/esm/helpers/registerCSSVariable.native.js.map +1 -1
- package/dist/esm/helpers/themeable.mjs +33 -0
- package/dist/esm/helpers/themes.mjs +14 -0
- package/dist/esm/helpers/timer.mjs +8 -0
- package/dist/esm/hooks/getThemeProxied.js +52 -0
- package/dist/esm/hooks/getThemeProxied.js.map +6 -0
- package/dist/esm/hooks/getThemeProxied.mjs +41 -0
- package/dist/esm/hooks/getThemeProxied.native.js +100 -0
- package/dist/esm/hooks/getThemeProxied.native.js.map +6 -0
- package/dist/esm/hooks/useConfiguration.mjs +20 -0
- package/dist/esm/hooks/useDisableSSR.mjs +5 -0
- package/dist/esm/hooks/useIsTouchDevice.mjs +4 -0
- package/dist/esm/hooks/useMedia.mjs +146 -0
- package/dist/esm/hooks/useProps.mjs +40 -0
- package/dist/esm/hooks/useTheme.js +1 -4
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs +222 -0
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeName.mjs +15 -0
- package/dist/esm/index.mjs +61 -0
- package/dist/esm/inject-styles.mjs +13 -0
- package/dist/esm/insertFont.js.map +1 -1
- package/dist/esm/insertFont.mjs +44 -0
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/interfaces/CSSColorNames.mjs +0 -0
- package/dist/esm/interfaces/GetRef.mjs +0 -0
- package/dist/esm/interfaces/KeyTypes.mjs +0 -0
- package/dist/esm/interfaces/RNExclusiveTypes.mjs +0 -0
- package/dist/esm/interfaces/Role.mjs +0 -0
- package/dist/esm/interfaces/TamaguiComponentEvents.mjs +0 -0
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.mjs +0 -0
- package/dist/esm/interfaces/TamaguiComponentState.mjs +0 -0
- package/dist/esm/interfaces/WebOnlyPressEvents.mjs +0 -0
- package/dist/esm/internalWithTheme.mjs +14 -0
- package/dist/esm/setupHooks.js.map +1 -1
- package/dist/esm/setupHooks.mjs +5 -0
- package/dist/esm/setupHooks.native.js.map +1 -1
- package/dist/esm/setupReactNative.mjs +24 -0
- package/dist/esm/styled.mjs +56 -0
- package/dist/esm/type-utils.mjs +0 -0
- package/dist/esm/types.mjs +2 -0
- package/dist/esm/views/Configuration.mjs +12 -0
- package/dist/esm/views/FontLanguage.mjs +13 -0
- package/dist/esm/views/FontLanguage.native.js.map +1 -1
- package/dist/esm/views/FontLanguage.types.mjs +0 -0
- package/dist/esm/views/Slot.js.map +1 -1
- package/dist/esm/views/Slot.mjs +53 -0
- package/dist/esm/views/Slot.native.js.map +1 -1
- package/dist/esm/views/Stack.mjs +10 -0
- package/dist/esm/views/TamaguiProvider.js +5 -5
- package/dist/esm/views/TamaguiProvider.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +32 -0
- package/dist/esm/views/TamaguiProvider.native.js +5 -5
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +64 -0
- package/dist/esm/views/Theme.js.map +1 -1
- package/dist/esm/views/Theme.mjs +104 -0
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +57 -0
- package/dist/esm/views/ThemeProvider.mjs +20 -0
- package/dist/esm/views/View.mjs +9 -0
- package/package.json +11 -11
- package/src/config.ts +1 -1
- package/src/contexts/ComponentContext.tsx +1 -1
- package/src/createComponent.tsx +7 -5
- package/src/createFont.ts +1 -1
- package/src/createShorthands.ts +1 -1
- package/src/createTamagui.ts +4 -3
- package/src/createTokens.ts +2 -2
- package/src/createVariables.ts +2 -1
- package/src/defaultComponentState.tsx +1 -1
- package/src/helpers/ThemeManager.tsx +1 -1
- package/src/helpers/createShallowSetState.tsx +2 -2
- package/src/helpers/expandStyle.ts +1 -1
- package/src/helpers/getExpandedShorthands.ts +1 -1
- package/src/helpers/getSplitStyles.tsx +33 -26
- package/src/helpers/getStylesAtomic.ts +4 -6
- package/src/helpers/getThemeCSSRules.ts +2 -1
- package/src/helpers/getVariantExtras.tsx +2 -2
- package/src/helpers/insertStyleRule.tsx +8 -3
- package/src/helpers/isTamaguiComponent.tsx +1 -1
- package/src/helpers/isTamaguiElement.tsx +1 -1
- package/src/helpers/matchMedia.native.ts +1 -1
- package/src/helpers/matchMedia.ts +1 -1
- package/src/helpers/propMapper.ts +2 -1
- package/src/helpers/proxyThemeToParents.ts +1 -1
- package/src/helpers/registerCSSVariable.ts +3 -2
- package/src/helpers/themeable.tsx +1 -1
- package/src/hooks/useDisableSSR.tsx +1 -1
- package/src/hooks/useProps.tsx +1 -1
- package/src/hooks/useTheme.tsx +4 -6
- package/src/hooks/useThemeName.tsx +1 -1
- package/src/insertFont.ts +4 -3
- package/src/interfaces/GetRef.tsx +2 -2
- package/src/interfaces/TamaguiComponentPropsBaseBase.tsx +2 -2
- package/src/interfaces/TamaguiComponentState.tsx +1 -1
- package/src/interfaces/WebOnlyPressEvents.tsx +1 -1
- package/src/setupHooks.ts +4 -8
- package/src/setupReactNative.ts +1 -1
- package/src/styled.tsx +1 -1
- package/src/types.tsx +9 -9
- package/src/views/FontLanguage.native.tsx +0 -1
- package/src/views/FontLanguage.types.ts +2 -2
- package/src/views/Slot.tsx +2 -1
- package/src/views/TamaguiProvider.tsx +8 -5
- package/src/views/Text.tsx +1 -1
- package/src/views/Theme.tsx +2 -1
- package/src/views/ThemeDebug.native.tsx +2 -2
- package/src/views/ThemeDebug.tsx +2 -2
- package/types/config.d.ts +1 -1
- package/types/config.d.ts.map +1 -1
- package/types/contexts/ComponentContext.d.ts +1 -1
- package/types/contexts/ComponentContext.d.ts.map +1 -1
- package/types/createComponent.d.ts +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createFont.d.ts +1 -1
- package/types/createFont.d.ts.map +1 -1
- package/types/createShorthands.d.ts +1 -1
- package/types/createShorthands.d.ts.map +1 -1
- package/types/createTamagui.d.ts +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/createTokens.d.ts +2 -2
- package/types/createTokens.d.ts.map +1 -1
- package/types/createVariables.d.ts +1 -1
- package/types/createVariables.d.ts.map +1 -1
- package/types/defaultComponentState.d.ts +1 -1
- package/types/defaultComponentState.d.ts.map +1 -1
- package/types/helpers/ThemeManager.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts.map +1 -1
- package/types/helpers/createShallowSetState.d.ts +2 -2
- package/types/helpers/createShallowSetState.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts +1 -1
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/getExpandedShorthands.d.ts +1 -1
- package/types/helpers/getExpandedShorthands.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts +2 -2
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts +2 -2
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/isTamaguiComponent.d.ts +1 -1
- package/types/helpers/isTamaguiComponent.d.ts.map +1 -1
- package/types/helpers/isTamaguiElement.d.ts +1 -1
- package/types/helpers/isTamaguiElement.d.ts.map +1 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/matchMedia.d.ts.map +1 -1
- package/types/helpers/matchMedia.native.d.ts +1 -1
- package/types/helpers/matchMedia.native.d.ts.map +1 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/helpers/proxyThemeToParents.d.ts +1 -1
- package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
- package/types/helpers/registerCSSVariable.d.ts +2 -2
- package/types/helpers/registerCSSVariable.d.ts.map +1 -1
- package/types/helpers/themeable.d.ts +1 -1
- package/types/helpers/themeable.d.ts.map +1 -1
- package/types/hooks/getThemeProxied.d.ts.map +1 -0
- package/types/hooks/useDisableSSR.d.ts +1 -1
- package/types/hooks/useDisableSSR.d.ts.map +1 -1
- package/types/hooks/useProps.d.ts +1 -1
- package/types/hooks/useProps.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +3 -2
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useThemeName.d.ts +1 -1
- package/types/hooks/useThemeName.d.ts.map +1 -1
- package/types/insertFont.d.ts +2 -2
- package/types/insertFont.d.ts.map +1 -1
- package/types/interfaces/GetRef.d.ts +2 -2
- package/types/interfaces/GetRef.d.ts.map +1 -1
- package/types/interfaces/TamaguiComponentPropsBaseBase.d.ts +2 -2
- package/types/interfaces/TamaguiComponentPropsBaseBase.d.ts.map +1 -1
- package/types/interfaces/TamaguiComponentState.d.ts +1 -1
- package/types/interfaces/TamaguiComponentState.d.ts.map +1 -1
- package/types/interfaces/WebOnlyPressEvents.d.ts +1 -1
- package/types/interfaces/WebOnlyPressEvents.d.ts.map +1 -1
- package/types/setupHooks.d.ts +3 -3
- package/types/setupHooks.d.ts.map +1 -1
- package/types/setupReactNative.d.ts +1 -1
- package/types/setupReactNative.d.ts.map +1 -1
- package/types/styled.d.ts +1 -1
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +9 -9
- package/types/types.d.ts.map +1 -1
- package/types/views/FontLanguage.native.d.ts.map +1 -1
- package/types/views/FontLanguage.types.d.ts +2 -2
- package/types/views/FontLanguage.types.d.ts.map +1 -1
- package/types/views/Slot.d.ts +1 -1
- package/types/views/Slot.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/Text.d.ts +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts +2 -2
- package/types/views/ThemeDebug.d.ts.map +1 -1
- package/types/views/ThemeDebug.native.d.ts +2 -2
- package/types/views/ThemeDebug.native.d.ts.map +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/views/Theme.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB,+BACtB,eAAkF,2BAElF,wBAAiC,8BACjC,6BAAsC,
|
|
4
|
+
"mappings": "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",
|
|
5
5
|
"names": ["React"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useDidFinishSSR } from "@tamagui/use-did-finish-ssr";
|
|
2
|
+
import { useForceUpdate } from "@tamagui/use-force-update";
|
|
3
|
+
import { useEffect, useId, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
let node;
|
|
7
|
+
function ThemeDebug({
|
|
8
|
+
themeState,
|
|
9
|
+
themeProps,
|
|
10
|
+
children
|
|
11
|
+
}) {
|
|
12
|
+
if (process.env.NODE_ENV === "development") {
|
|
13
|
+
const isHydrated = useDidFinishSSR(),
|
|
14
|
+
[onChangeCount, setOnChangeCount] = useState(0),
|
|
15
|
+
rerender = useForceUpdate(),
|
|
16
|
+
id = useId();
|
|
17
|
+
return process.env.NODE_ENV === "development" && typeof document < "u" && (node || (node = document.createElement("div"), node.style.height = "200px", node.style.overflowY = "scroll", node.style.position = "fixed", node.style.zIndex = 1e7, node.style.bottom = "30px", node.style.left = "30px", node.style.right = "30px", node.style.display = "flex", node.style.border = "1px solid #888", node.style.flexDirection = "row", node.style.background = "var(--background)", document.body.appendChild(node))), useEffect(() => {
|
|
18
|
+
themeState.themeManager?.parentManager?.onChangeTheme((name, manager) => {
|
|
19
|
+
setOnChangeCount(p => ++p), console.warn(`theme changed for ${themeState.themeManager?.id} from parent ${themeState.themeManager?.parentManager?.id} to new name`, name);
|
|
20
|
+
});
|
|
21
|
+
}, [themeState.themeManager]), useEffect(() => {
|
|
22
|
+
const tm = setInterval(rerender, 1e3);
|
|
23
|
+
return () => clearTimeout(tm);
|
|
24
|
+
}, []), themeProps["disable-child-theme"] || !isHydrated ? children : /* @__PURE__ */jsxs(Fragment, {
|
|
25
|
+
children: [createPortal( /* @__PURE__ */jsxs("code", {
|
|
26
|
+
style: {
|
|
27
|
+
whiteSpace: "pre",
|
|
28
|
+
maxWidth: 250,
|
|
29
|
+
overflow: "auto",
|
|
30
|
+
padding: 5
|
|
31
|
+
},
|
|
32
|
+
children: ["<Theme ", id, " />\xA0", JSON.stringify({
|
|
33
|
+
propsName: themeProps.name,
|
|
34
|
+
name: themeState?.state?.name,
|
|
35
|
+
className: themeState?.state?.className,
|
|
36
|
+
inverse: themeProps.inverse,
|
|
37
|
+
forceClassName: themeProps.forceClassName,
|
|
38
|
+
parent: themeState.themeManager?.state.parentName,
|
|
39
|
+
id: themeState.themeManager?.id,
|
|
40
|
+
parentId: themeState.themeManager?.parentManager?.id,
|
|
41
|
+
isNew: themeState.isNewTheme,
|
|
42
|
+
onChangeCount,
|
|
43
|
+
listening: [...(themeState.themeManager?._listeningIds || [])].join(","),
|
|
44
|
+
_numChangeEventsSent: themeState.themeManager?._numChangeEventsSent
|
|
45
|
+
}, null, 2)]
|
|
46
|
+
}), node), /* @__PURE__ */jsx("div", {
|
|
47
|
+
style: {
|
|
48
|
+
color: "red"
|
|
49
|
+
},
|
|
50
|
+
children: id
|
|
51
|
+
}), children]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return children;
|
|
55
|
+
}
|
|
56
|
+
ThemeDebug.displayName = "ThemeDebug";
|
|
57
|
+
export { ThemeDebug };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isClient } from "@tamagui/constants";
|
|
2
|
+
import { useLayoutEffect } from "react";
|
|
3
|
+
import { THEME_CLASSNAME_PREFIX } from "../constants/constants.mjs";
|
|
4
|
+
import { Theme } from "./Theme.mjs";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
const ThemeProvider = props => (isClient && useLayoutEffect(() => {
|
|
7
|
+
if (props.disableRootThemeClass) return;
|
|
8
|
+
const cn = `${THEME_CLASSNAME_PREFIX}${props.defaultTheme}`,
|
|
9
|
+
target = props.themeClassNameOnRoot ? document.documentElement : document.body;
|
|
10
|
+
return target.classList.add(cn), () => {
|
|
11
|
+
target.classList.remove(cn);
|
|
12
|
+
};
|
|
13
|
+
}, [props.defaultTheme, props.disableRootThemeClass, props.themeClassNameOnRoot]), /* @__PURE__ */jsx(Theme, {
|
|
14
|
+
className: props.className,
|
|
15
|
+
name: props.defaultTheme,
|
|
16
|
+
forceClassName: !props.disableRootThemeClass,
|
|
17
|
+
_isRoot: !0,
|
|
18
|
+
children: props.children
|
|
19
|
+
}));
|
|
20
|
+
export { ThemeProvider };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { validStyles } from "@tamagui/helpers";
|
|
2
|
+
import { stackDefaultStyles } from "../constants/constants.mjs";
|
|
3
|
+
import { createComponent } from "../createComponent.mjs";
|
|
4
|
+
const View = createComponent({
|
|
5
|
+
acceptsClassName: !0,
|
|
6
|
+
defaultProps: stackDefaultStyles,
|
|
7
|
+
validStyles
|
|
8
|
+
});
|
|
9
|
+
export { View };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "1.88.
|
|
3
|
+
"version": "1.88.15",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"reset.css"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/compose-refs": "1.88.
|
|
31
|
-
"@tamagui/constants": "1.88.
|
|
32
|
-
"@tamagui/helpers": "1.88.
|
|
33
|
-
"@tamagui/normalize-css-color": "1.88.
|
|
34
|
-
"@tamagui/timer": "1.88.
|
|
35
|
-
"@tamagui/use-did-finish-ssr": "1.88.
|
|
36
|
-
"@tamagui/use-event": "1.88.
|
|
37
|
-
"@tamagui/use-force-update": "1.88.
|
|
30
|
+
"@tamagui/compose-refs": "1.88.15",
|
|
31
|
+
"@tamagui/constants": "1.88.15",
|
|
32
|
+
"@tamagui/helpers": "1.88.15",
|
|
33
|
+
"@tamagui/normalize-css-color": "1.88.15",
|
|
34
|
+
"@tamagui/timer": "1.88.15",
|
|
35
|
+
"@tamagui/use-did-finish-ssr": "1.88.15",
|
|
36
|
+
"@tamagui/use-event": "1.88.15",
|
|
37
|
+
"@tamagui/use-force-update": "1.88.15",
|
|
38
38
|
"react": "^18.2.0",
|
|
39
39
|
"react-dom": "^18.2.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "1.88.
|
|
42
|
+
"@tamagui/build": "1.88.15",
|
|
43
43
|
"@testing-library/react": "^14.0.0",
|
|
44
44
|
"csstype": "^3.0.10",
|
|
45
45
|
"typescript": "^5.3.3",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"./native": {
|
|
58
58
|
"import": "./dist/esm/index.native.js",
|
|
59
59
|
"require": "./dist/cjs/index.native.js",
|
|
60
|
-
"react-native": "./dist/cjs/index.native.
|
|
60
|
+
"react-native": "./dist/cjs/index.native.js"
|
|
61
61
|
},
|
|
62
62
|
"./inject-styles": {
|
|
63
63
|
"types": "./types/inject-styles.d.ts",
|
package/src/config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createStyledContext } from '../helpers/createStyledContext'
|
|
2
|
-
import { ComponentContextI, GroupStateListener } from '../types'
|
|
2
|
+
import type { ComponentContextI, GroupStateListener } from '../types'
|
|
3
3
|
|
|
4
4
|
export const ComponentContext = createStyledContext<ComponentContextI>({
|
|
5
5
|
disableSSR: undefined,
|
package/src/createComponent.tsx
CHANGED
|
@@ -37,7 +37,7 @@ import { themeable } from './helpers/themeable'
|
|
|
37
37
|
import { mediaKeyMatch, setMediaShouldUpdate, useMedia } from './hooks/useMedia'
|
|
38
38
|
import { useThemeWithState } from './hooks/useTheme'
|
|
39
39
|
import { hooks } from './setupHooks'
|
|
40
|
-
import {
|
|
40
|
+
import type {
|
|
41
41
|
ComponentContextI,
|
|
42
42
|
DebugProp,
|
|
43
43
|
DisposeFn,
|
|
@@ -62,9 +62,9 @@ import {
|
|
|
62
62
|
UseAnimationProps,
|
|
63
63
|
UseThemeWithStateProps,
|
|
64
64
|
} from './types'
|
|
65
|
-
import { WebOnlyPressEvents } from './interfaces/WebOnlyPressEvents'
|
|
66
|
-
import { TamaguiComponentState } from './interfaces/TamaguiComponentState'
|
|
67
|
-
import { TamaguiComponentEvents } from './interfaces/TamaguiComponentEvents'
|
|
65
|
+
import type { WebOnlyPressEvents } from './interfaces/WebOnlyPressEvents'
|
|
66
|
+
import type { TamaguiComponentState } from './interfaces/TamaguiComponentState'
|
|
67
|
+
import type { TamaguiComponentEvents } from './interfaces/TamaguiComponentEvents'
|
|
68
68
|
import { Slot } from './views/Slot'
|
|
69
69
|
import { getThemedChildren } from './views/Theme'
|
|
70
70
|
import { ThemeDebug } from './views/ThemeDebug'
|
|
@@ -925,6 +925,8 @@ export function createComponent<
|
|
|
925
925
|
onPress ||
|
|
926
926
|
onPressOut ||
|
|
927
927
|
onPressIn ||
|
|
928
|
+
onMouseDown ||
|
|
929
|
+
onMouseUp ||
|
|
928
930
|
onLongPress ||
|
|
929
931
|
onClick
|
|
930
932
|
)
|
|
@@ -1192,7 +1194,7 @@ export function createComponent<
|
|
|
1192
1194
|
}
|
|
1193
1195
|
|
|
1194
1196
|
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
1195
|
-
if (isReactNative && !asChild
|
|
1197
|
+
if (isReactNative && !asChild) {
|
|
1196
1198
|
content = (
|
|
1197
1199
|
<span
|
|
1198
1200
|
{...(!isHydrated
|
package/src/createFont.ts
CHANGED
package/src/createShorthands.ts
CHANGED
package/src/createTamagui.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { isWeb } from '@tamagui/constants'
|
|
2
2
|
|
|
3
3
|
import { configListeners, setConfig, setTokens } from './config'
|
|
4
|
-
import { Variable } from './createVariable'
|
|
5
|
-
import { DeepVariableObject
|
|
4
|
+
import type { Variable } from './createVariable'
|
|
5
|
+
import type { DeepVariableObject } from './createVariables'
|
|
6
|
+
import { createVariables } from './createVariables'
|
|
6
7
|
import { getThemeCSSRules } from './helpers/getThemeCSSRules'
|
|
7
8
|
import {
|
|
8
9
|
getAllRules,
|
|
@@ -15,7 +16,7 @@ import { ensureThemeVariable } from './helpers/themes'
|
|
|
15
16
|
import { configureMedia } from './hooks/useMedia'
|
|
16
17
|
import { parseFont, registerFontVariables } from './insertFont'
|
|
17
18
|
import { Tamagui } from './Tamagui'
|
|
18
|
-
import {
|
|
19
|
+
import type {
|
|
19
20
|
CreateTamaguiProps,
|
|
20
21
|
DedupedTheme,
|
|
21
22
|
DedupedThemes,
|
package/src/createTokens.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Variable } from './createVariable'
|
|
1
|
+
import type { Variable } from './createVariable'
|
|
2
2
|
import { createVariables } from './createVariables'
|
|
3
|
-
import { CreateTokens } from './types'
|
|
3
|
+
import type { CreateTokens } from './types'
|
|
4
4
|
|
|
5
5
|
// tokens.color.dark.red ===> { var: `color-dark-red`, val: '' }
|
|
6
6
|
export function createTokens<T extends CreateTokens>(tokens: T): MakeTokens<T> {
|
package/src/createVariables.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { simpleHash } from '@tamagui/helpers'
|
|
2
2
|
|
|
3
|
-
import { Variable
|
|
3
|
+
import type { Variable } from './createVariable'
|
|
4
|
+
import { createVariable, isVariable } from './createVariable'
|
|
4
5
|
|
|
5
6
|
type DeepTokenObject<Val extends string | number = any> = {
|
|
6
7
|
[key: string]: Val | DeepTokenObject<Val>
|
|
@@ -2,7 +2,7 @@ import { isWeb } from '@tamagui/constants'
|
|
|
2
2
|
|
|
3
3
|
import { getThemes } from '../config'
|
|
4
4
|
import { THEME_CLASSNAME_PREFIX, THEME_NAME_SEPARATOR } from '../constants/constants'
|
|
5
|
-
import { ColorScheme, ThemeParsed, ThemeProps } from '../types'
|
|
5
|
+
import type { ColorScheme, ThemeParsed, ThemeProps } from '../types'
|
|
6
6
|
|
|
7
7
|
type ThemeListener = (
|
|
8
8
|
name: string | null,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { isAndroid, isWeb } from '@tamagui/constants'
|
|
7
7
|
|
|
8
|
-
import { PropMappedValue } from '../types'
|
|
8
|
+
import type { PropMappedValue } from '../types'
|
|
9
9
|
|
|
10
10
|
export function expandStyle(key: string, value: any): PropMappedValue {
|
|
11
11
|
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
@@ -77,6 +77,7 @@ import {
|
|
|
77
77
|
} from './normalizeValueWithProperty'
|
|
78
78
|
import { getPropMappedFontFamily, propMapper } from './propMapper'
|
|
79
79
|
import { pseudoDescriptors, pseudoPriorities } from './pseudoDescriptors'
|
|
80
|
+
import { isObj } from './isObj'
|
|
80
81
|
|
|
81
82
|
// bugfix for some reason it gets reset
|
|
82
83
|
const IS_STATIC = process.env.IS_STATIC === 'is_static'
|
|
@@ -363,8 +364,8 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
363
364
|
continue
|
|
364
365
|
}
|
|
365
366
|
|
|
366
|
-
if (keyInit
|
|
367
|
-
|
|
367
|
+
if (keyInit.startsWith('_style') && isObj(valInit)) {
|
|
368
|
+
Object.assign(styleState.style, valInit)
|
|
368
369
|
continue
|
|
369
370
|
}
|
|
370
371
|
|
|
@@ -530,6 +531,11 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
530
531
|
const shouldPassThrough = shouldPassProp || isHOCShouldPassThrough
|
|
531
532
|
|
|
532
533
|
if (process.env.NODE_ENV === 'development' && debug === 'verbose') {
|
|
534
|
+
// fix native group nesting issues
|
|
535
|
+
console.groupEnd()
|
|
536
|
+
console.groupEnd()
|
|
537
|
+
// fix native group nesting issues
|
|
538
|
+
|
|
533
539
|
console.groupCollapsed(
|
|
534
540
|
` 🔑 ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ''} ${
|
|
535
541
|
shouldPassThrough ? '(pass)' : ''
|
|
@@ -1037,7 +1043,19 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1037
1043
|
// also it makes sense that props.style is basically the last to apply,
|
|
1038
1044
|
// at least more sense than "it applies at the position its defined in the prop loop"
|
|
1039
1045
|
if (props.style) {
|
|
1040
|
-
|
|
1046
|
+
if (isHOC) {
|
|
1047
|
+
viewProps.style = props.style
|
|
1048
|
+
} else {
|
|
1049
|
+
for (const style of [].concat(props.style)) {
|
|
1050
|
+
if (style) {
|
|
1051
|
+
if (style['$$css']) {
|
|
1052
|
+
Object.assign(styleState.classNames, style)
|
|
1053
|
+
} else {
|
|
1054
|
+
Object.assign(styleState.style, style)
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1041
1059
|
}
|
|
1042
1060
|
|
|
1043
1061
|
const avoidNormalize = styleProps.noNormalize === false
|
|
@@ -1069,16 +1087,17 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1069
1087
|
.forEach(([key, val]) => {
|
|
1070
1088
|
mergeTransform(style, key, val, true)
|
|
1071
1089
|
})
|
|
1090
|
+
}
|
|
1072
1091
|
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
)
|
|
1080
|
-
|
|
1081
|
-
|
|
1092
|
+
// Button for example uses disableClassName: true but renders to a 'button' element, so needs this
|
|
1093
|
+
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
1094
|
+
if (
|
|
1095
|
+
!staticConfig.isReactNative &&
|
|
1096
|
+
!staticConfig.isHOC &&
|
|
1097
|
+
(styleProps.isAnimated && !conf.animations.supportsCSSVars ? false : true) &&
|
|
1098
|
+
Array.isArray(style.transform)
|
|
1099
|
+
) {
|
|
1100
|
+
style.transform = transformsToString(style.transform) as any
|
|
1082
1101
|
}
|
|
1083
1102
|
}
|
|
1084
1103
|
|
|
@@ -1385,20 +1404,6 @@ export const getSubStyle = (
|
|
|
1385
1404
|
return styleOut
|
|
1386
1405
|
}
|
|
1387
1406
|
|
|
1388
|
-
function mergeStylePropIntoStyle(styleState: GetStyleState, cur: Object[] | Object) {
|
|
1389
|
-
if (!cur) return
|
|
1390
|
-
const styles = Array.isArray(cur) ? cur : [cur]
|
|
1391
|
-
for (const style of styles) {
|
|
1392
|
-
if (!style) continue
|
|
1393
|
-
const isRNW = style['$$css']
|
|
1394
|
-
if (isRNW) {
|
|
1395
|
-
Object.assign(styleState.classNames, style)
|
|
1396
|
-
} else {
|
|
1397
|
-
Object.assign(styleState.style, style)
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
1407
|
// on native no need to insert any css
|
|
1403
1408
|
const useInsertEffectCompat = isWeb
|
|
1404
1409
|
? useInsertionEffect || useIsomorphicLayoutEffect
|
|
@@ -1508,8 +1513,10 @@ if (process.env.TAMAGUI_TARGET === 'native') {
|
|
|
1508
1513
|
dataDetectorType: 1,
|
|
1509
1514
|
dynamicTypeRamp: 1,
|
|
1510
1515
|
elevationAndroid: 1,
|
|
1516
|
+
hapticFeedback: 1,
|
|
1511
1517
|
importantForAccessibility: 1,
|
|
1512
1518
|
lineBreakStrategyIOS: 1,
|
|
1519
|
+
maxFontSizeMultiplier: 1,
|
|
1513
1520
|
minimumFontScale: 1,
|
|
1514
1521
|
needsOffscreenAlphaCompositing: 1,
|
|
1515
1522
|
nextFocusDown: 1,
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
* Copyright (c) Nicolas Gallagher licensed under the MIT license.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { StyleObject
|
|
6
|
+
import type { StyleObject } from '@tamagui/helpers'
|
|
7
|
+
import { simpleHash } from '@tamagui/helpers'
|
|
7
8
|
|
|
8
9
|
import { getConfig } from '../config'
|
|
9
10
|
import type { DebugProp, TamaguiInternalConfig, ViewStyleWithPseudos } from '../types'
|
|
10
11
|
import { defaultOffset } from './defaultOffset'
|
|
11
12
|
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
pseudoDescriptors,
|
|
15
|
-
pseudoDescriptorsBase,
|
|
16
|
-
} from './pseudoDescriptors'
|
|
13
|
+
import type { PseudoDescriptor } from './pseudoDescriptors'
|
|
14
|
+
import { pseudoDescriptors, pseudoDescriptorsBase } from './pseudoDescriptors'
|
|
17
15
|
import { normalizeColor } from './normalizeColor'
|
|
18
16
|
|
|
19
17
|
// refactor this file away next...
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { simpleHash } from '@tamagui/helpers'
|
|
2
2
|
|
|
3
3
|
import { THEME_CLASSNAME_PREFIX } from '../constants/constants'
|
|
4
|
-
import { Variable
|
|
4
|
+
import type { Variable } from '../createVariable'
|
|
5
|
+
import { variableToString } from '../createVariable'
|
|
5
6
|
import type { CreateTamaguiProps, ThemeParsed } from '../types'
|
|
6
7
|
import { tokensValueToVariable } from './registerCSSVariable'
|
|
7
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getVariableValue } from '../createVariable'
|
|
2
|
-
import { GenericFonts, GetStyleState } from '../types'
|
|
3
|
-
import { LanguageContextType } from '../views/FontLanguage.types'
|
|
2
|
+
import type { GenericFonts, GetStyleState } from '../types'
|
|
3
|
+
import type { LanguageContextType } from '../views/FontLanguage.types'
|
|
4
4
|
|
|
5
5
|
export function getVariantExtras(styleState: GetStyleState) {
|
|
6
6
|
const { curProps, conf, context, theme } = styleState
|
|
@@ -186,7 +186,7 @@ function updateSheetStyles(
|
|
|
186
186
|
delete allSelectors[identifier]
|
|
187
187
|
}
|
|
188
188
|
} else if (!(identifier in allSelectors)) {
|
|
189
|
-
const isTransform = identifier.startsWith('_transform')
|
|
189
|
+
const isTransform = identifier.startsWith('_transform-')
|
|
190
190
|
const shouldInsert = isTransform
|
|
191
191
|
? addTransform(identifier, cssRule.cssText, cssRule)
|
|
192
192
|
: true
|
|
@@ -269,7 +269,12 @@ function addThemesFromCSS(cssStyleRule: CSSStyleRule, tokens?: TokensParsed) {
|
|
|
269
269
|
const [_0, _1, scheme, _2, name] = matches
|
|
270
270
|
const themeName =
|
|
271
271
|
name && scheme && scheme !== name ? `${scheme}_${name}` : name || scheme
|
|
272
|
-
if (
|
|
272
|
+
if (
|
|
273
|
+
!themeName ||
|
|
274
|
+
dedupedEntry.names.includes(themeName) ||
|
|
275
|
+
themeName === 'light_dark' ||
|
|
276
|
+
themeName === 'dark_light'
|
|
277
|
+
) {
|
|
273
278
|
continue
|
|
274
279
|
}
|
|
275
280
|
dedupedEntry.names.push(themeName)
|
|
@@ -322,7 +327,7 @@ export function updateRules(identifier: string, rules: string[]) {
|
|
|
322
327
|
return false
|
|
323
328
|
}
|
|
324
329
|
allRules[identifier] = rules.join(' ')
|
|
325
|
-
if (identifier.startsWith('_transform')) {
|
|
330
|
+
if (identifier.startsWith('_transform-')) {
|
|
326
331
|
return addTransform(identifier, rules[0])
|
|
327
332
|
}
|
|
328
333
|
return true
|
|
@@ -3,7 +3,8 @@ import { tokenCategories } from '@tamagui/helpers'
|
|
|
3
3
|
|
|
4
4
|
import { getConfig } from '../config'
|
|
5
5
|
import { isDevTools } from '../constants/isDevTools'
|
|
6
|
-
import { Variable
|
|
6
|
+
import type { Variable } from '../createVariable'
|
|
7
|
+
import { getVariableValue, isVariable } from '../createVariable'
|
|
7
8
|
import type {
|
|
8
9
|
GetStyleState,
|
|
9
10
|
PropMapper,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Variable
|
|
2
|
-
import {
|
|
1
|
+
import type { Variable } from '../createVariable'
|
|
2
|
+
import { createCSSVariable, getVariableValue } from '../createVariable'
|
|
3
|
+
import type { VariableVal } from '../types'
|
|
3
4
|
|
|
4
5
|
export const registerCSSVariable = (v: Variable | VariableVal) => {
|
|
5
6
|
tokensValueToVariable.set(getVariableValue(v), v)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react'
|
|
2
2
|
|
|
3
|
-
import { StaticConfig, ThemeableProps } from '../types'
|
|
3
|
+
import type { StaticConfig, ThemeableProps } from '../types'
|
|
4
4
|
import { Theme } from '../views/Theme'
|
|
5
5
|
|
|
6
6
|
export function themeable<ComponentType extends (props: any) => any>(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfig } from '../config'
|
|
2
|
-
import { ComponentContextI } from '../types'
|
|
2
|
+
import type { ComponentContextI } from '../types'
|
|
3
3
|
|
|
4
4
|
export function getDisableSSR(componentContext?: ComponentContextI) {
|
|
5
5
|
return componentContext?.disableSSR ?? getConfig().disableSSR
|
package/src/hooks/useProps.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { useContext } from 'react'
|
|
|
3
3
|
import { ComponentContext } from '../contexts/ComponentContext'
|
|
4
4
|
import { defaultComponentStateMounted } from '../defaultComponentState'
|
|
5
5
|
import { useSplitStyles } from '../helpers/getSplitStyles'
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
7
|
SplitStyleProps,
|
|
8
8
|
StackStyle,
|
|
9
9
|
StaticConfig,
|
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -2,13 +2,11 @@ import { isClient, isIos, isServer } from '@tamagui/constants'
|
|
|
2
2
|
import { useContext, useEffect, useMemo, useRef, useState } from 'react'
|
|
3
3
|
|
|
4
4
|
import { getConfig } from '../config'
|
|
5
|
-
import { Variable
|
|
5
|
+
import type { Variable } from '../createVariable'
|
|
6
|
+
import { getVariable } from '../createVariable'
|
|
6
7
|
import { isEqualShallow } from '../helpers/createShallowSetState'
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
ThemeManagerState,
|
|
10
|
-
getHasThemeUpdatingProps,
|
|
11
|
-
} from '../helpers/ThemeManager'
|
|
8
|
+
import type { ThemeManagerState } from '../helpers/ThemeManager'
|
|
9
|
+
import { ThemeManager, getHasThemeUpdatingProps } from '../helpers/ThemeManager'
|
|
12
10
|
import { ThemeManagerIDContext } from '../helpers/ThemeManagerContext'
|
|
13
11
|
import type {
|
|
14
12
|
DebugProp,
|
|
@@ -2,7 +2,7 @@ import { useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
|
2
2
|
import { useContext, useState } from 'react'
|
|
3
3
|
|
|
4
4
|
import { ThemeManagerIDContext } from '../helpers/ThemeManagerContext'
|
|
5
|
-
import { ThemeName } from '../types'
|
|
5
|
+
import type { ThemeName } from '../types'
|
|
6
6
|
import { getThemeManager } from './useTheme'
|
|
7
7
|
|
|
8
8
|
export function useThemeName(opts?: { parent?: true }): ThemeName {
|
package/src/insertFont.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { setConfigFont } from './config'
|
|
2
2
|
import { createFont } from './createFont'
|
|
3
|
-
import { Variable } from './createVariable'
|
|
4
|
-
import { DeepVariableObject
|
|
3
|
+
import type { Variable } from './createVariable'
|
|
4
|
+
import type { DeepVariableObject } from './createVariables'
|
|
5
|
+
import { createVariables } from './createVariables'
|
|
5
6
|
import { registerCSSVariable, variableToCSS } from './helpers/registerCSSVariable'
|
|
6
|
-
import { GenericFont } from './types'
|
|
7
|
+
import type { GenericFont } from './types'
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Runtime dynamic insert font
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Component, JSXElementConstructor, Ref } from 'react'
|
|
1
|
+
import type { Component, JSXElementConstructor, Ref } from 'react'
|
|
2
2
|
|
|
3
|
-
import { TamaguiComponent } from '../types'
|
|
3
|
+
import type { TamaguiComponent } from '../types'
|
|
4
4
|
|
|
5
5
|
// gets the ref type of any type of react component
|
|
6
6
|
|