@tamagui/web 1.10.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/addTheme.js.map +2 -2
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/updateTheme.js.map +2 -2
- package/dist/esm/addTheme.js.map +2 -2
- package/dist/esm/addTheme.mjs.map +2 -2
- package/dist/esm/index.js +10 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/index.mjs +10 -1
- package/dist/esm/index.mjs.map +2 -2
- package/dist/esm/updateTheme.js.map +2 -2
- package/dist/esm/updateTheme.mjs.map +2 -2
- package/package.json +9 -9
- package/src/addTheme.ts +1 -0
- package/src/index.ts +9 -1
- package/src/updateTheme.ts +1 -0
- package/types/addTheme.d.ts +1 -0
- package/types/addTheme.d.ts.map +1 -1
- package/types/index.d.ts +3 -1
- package/types/index.d.ts.map +1 -1
- package/types/updateTheme.d.ts +1 -0
- package/types/updateTheme.d.ts.map +1 -1
package/dist/cjs/addTheme.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/addTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\n\nimport { getConfig, updateConfig } from './config.js'\nimport { getThemeCSSRules } from './helpers/getThemeCSSRules'\nimport { ensureThemeVariable, proxyThemeToParents } from './helpers/themes.js'\nimport { ThemeDefinition, ThemeParsed } from './types.js'\n\nexport function addTheme(props: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n insertCSS?: boolean\n update?: boolean\n}) {\n const config = getConfig()\n\n if (process.env.NODE_ENV === 'development') {\n if (!config) {\n throw new Error('No config')\n }\n const theme = config.themes[props.name]\n if (!props.update && theme) {\n return { theme }\n }\n }\n\n const { name: themeName, theme: themeIn, insertCSS } = props\n const theme = { ...themeIn } as ThemeParsed\n for (const key in theme) {\n ensureThemeVariable(theme, key)\n }\n\n const themeProxied = proxyThemeToParents(themeName, theme, config.themes)\n config.themes[themeName] = themeProxied\n\n let cssRules: string[] = []\n\n if (isWeb) {\n if (insertCSS) {\n cssRules = getThemeCSSRules({\n // @ts-ignore this works but should be fixed types\n config,\n themeName,\n names: [themeName],\n theme,\n })\n const id = `t_theme_style_${themeName}`\n const existing = document.querySelector(`#${id}`)\n const style = document.createElement('style')\n style.id = id\n style.appendChild(document.createTextNode(cssRules.join('\\n')))\n document.head.appendChild(style)\n if (existing) {\n existing.parentElement?.removeChild(existing)\n }\n }\n }\n\n updateConfig('themes', { ...config.themes, [themeName]: themeProxied })\n\n // trigger updates in components\n return {\n theme: themeProxied,\n cssRules,\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AAEtB,oBAAwC;AACxC,8BAAiC;AACjC,oBAAyD;
|
|
4
|
+
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\n\nimport { getConfig, updateConfig } from './config.js'\nimport { getThemeCSSRules } from './helpers/getThemeCSSRules'\nimport { ensureThemeVariable, proxyThemeToParents } from './helpers/themes.js'\nimport { ThemeDefinition, ThemeParsed } from './types.js'\n\n/** @deprecated import from @tamagui/theme instead */\nexport function addTheme(props: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n insertCSS?: boolean\n update?: boolean\n}) {\n const config = getConfig()\n\n if (process.env.NODE_ENV === 'development') {\n if (!config) {\n throw new Error('No config')\n }\n const theme = config.themes[props.name]\n if (!props.update && theme) {\n return { theme }\n }\n }\n\n const { name: themeName, theme: themeIn, insertCSS } = props\n const theme = { ...themeIn } as ThemeParsed\n for (const key in theme) {\n ensureThemeVariable(theme, key)\n }\n\n const themeProxied = proxyThemeToParents(themeName, theme, config.themes)\n config.themes[themeName] = themeProxied\n\n let cssRules: string[] = []\n\n if (isWeb) {\n if (insertCSS) {\n cssRules = getThemeCSSRules({\n // @ts-ignore this works but should be fixed types\n config,\n themeName,\n names: [themeName],\n theme,\n })\n const id = `t_theme_style_${themeName}`\n const existing = document.querySelector(`#${id}`)\n const style = document.createElement('style')\n style.id = id\n style.appendChild(document.createTextNode(cssRules.join('\\n')))\n document.head.appendChild(style)\n if (existing) {\n existing.parentElement?.removeChild(existing)\n }\n }\n }\n\n updateConfig('themes', { ...config.themes, [themeName]: themeProxied })\n\n // trigger updates in components\n return {\n theme: themeProxied,\n cssRules,\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AAEtB,oBAAwC;AACxC,8BAAiC;AACjC,oBAAyD;AAIlD,SAAS,SAAS,OAKtB;AAbH;AAcE,QAAM,aAAS,yBAAU;AAEzB,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,WAAW;AAAA,IAC7B;AACA,UAAMA,SAAQ,OAAO,OAAO,MAAM,IAAI;AACtC,QAAI,CAAC,MAAM,UAAUA,QAAO;AAC1B,aAAO,EAAE,OAAAA,OAAM;AAAA,IACjB;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,WAAW,OAAO,SAAS,UAAU,IAAI;AACvD,QAAM,QAAQ,EAAE,GAAG,QAAQ;AAC3B,aAAW,OAAO,OAAO;AACvB,2CAAoB,OAAO,GAAG;AAAA,EAChC;AAEA,QAAM,mBAAe,mCAAoB,WAAW,OAAO,OAAO,MAAM;AACxE,SAAO,OAAO,SAAS,IAAI;AAE3B,MAAI,WAAqB,CAAC;AAE1B,MAAI,wBAAO;AACT,QAAI,WAAW;AACb,qBAAW,0CAAiB;AAAA;AAAA,QAE1B;AAAA,QACA;AAAA,QACA,OAAO,CAAC,SAAS;AAAA,QACjB;AAAA,MACF,CAAC;AACD,YAAM,KAAK,iBAAiB;AAC5B,YAAM,WAAW,SAAS,cAAc,IAAI,IAAI;AAChD,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,KAAK;AACX,YAAM,YAAY,SAAS,eAAe,SAAS,KAAK,IAAI,CAAC,CAAC;AAC9D,eAAS,KAAK,YAAY,KAAK;AAC/B,UAAI,UAAU;AACZ,uBAAS,kBAAT,mBAAwB,YAAY;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,kCAAa,UAAU,EAAE,GAAG,OAAO,QAAQ,CAAC,SAAS,GAAG,aAAa,CAAC;AAGtE,SAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["theme"]
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __export(src_exports, {
|
|
|
28
28
|
mediaQueryConfig: () => import_useMedia.mediaQueryConfig,
|
|
29
29
|
mediaState: () => import_useMedia.mediaState,
|
|
30
30
|
onConfiguredOnce: () => import_config.onConfiguredOnce,
|
|
31
|
+
updateConfig: () => import_config.updateConfig,
|
|
31
32
|
useMedia: () => import_useMedia.useMedia,
|
|
32
33
|
useMediaPropsActive: () => import_useMedia.useMediaPropsActive
|
|
33
34
|
});
|
|
@@ -61,6 +62,8 @@ __reExport(src_exports, require("./helpers/expandStyles.js"), module.exports);
|
|
|
61
62
|
__reExport(src_exports, require("./helpers/isTamaguiElement.js"), module.exports);
|
|
62
63
|
__reExport(src_exports, require("./helpers/isTamaguiComponent.js"), module.exports);
|
|
63
64
|
__reExport(src_exports, require("./helpers/matchMedia"), module.exports);
|
|
65
|
+
__reExport(src_exports, require("./helpers/themes.js"), module.exports);
|
|
66
|
+
__reExport(src_exports, require("./helpers/getThemeCSSRules.js"), module.exports);
|
|
64
67
|
__reExport(src_exports, require("./helpers/proxyThemeVariables.js"), module.exports);
|
|
65
68
|
__reExport(src_exports, require("./helpers/themeable.js"), module.exports);
|
|
66
69
|
__reExport(src_exports, require("./helpers/withStaticProperties.js"), module.exports);
|
|
@@ -101,6 +104,7 @@ __reExport(src_exports, require("./setupHooks.js"), module.exports);
|
|
|
101
104
|
mediaQueryConfig,
|
|
102
105
|
mediaState,
|
|
103
106
|
onConfiguredOnce,
|
|
107
|
+
updateConfig,
|
|
104
108
|
useMedia,
|
|
105
109
|
useMediaPropsActive
|
|
106
110
|
});
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './Tamagui.js'\nexport * from './createComponent.js'\nexport * from './createShorthands.js'\nexport * from './createTheme.js'\nexport * from './createTamagui.js'\nexport * from './createFont.js'\nexport * from './createTokens.js'\nexport * from './createVariable.js'\nexport * from './createVariables.js'\nexport * from './insertFont.js'\nexport * from './addTheme.js'\nexport * from './updateTheme.js'\nexport * from './styled.js'\nexport * from './types.js'\nexport * from './setupReactNative.js'\n\nexport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,yBAAd;AACA,wBAAc,iCADd;AAEA,wBAAc,kCAFd;AAGA,wBAAc,6BAHd;AAIA,wBAAc,+BAJd;AAKA,wBAAc,4BALd;AAMA,wBAAc,8BANd;AAOA,wBAAc,gCAPd;AAQA,wBAAc,iCARd;AASA,wBAAc,4BATd;AAUA,wBAAc,0BAVd;AAWA,wBAAc,6BAXd;AAYA,wBAAc,wBAZd;AAaA,wBAAc,uBAbd;AAcA,wBAAc,kCAdd;AAgBA,
|
|
4
|
+
"sourcesContent": ["export * from './Tamagui.js'\nexport * from './createComponent.js'\nexport * from './createShorthands.js'\nexport * from './createTheme.js'\nexport * from './createTamagui.js'\nexport * from './createFont.js'\nexport * from './createTokens.js'\nexport * from './createVariable.js'\nexport * from './createVariables.js'\nexport * from './insertFont.js'\nexport * from './addTheme.js'\nexport * from './updateTheme.js'\nexport * from './styled.js'\nexport * from './types.js'\nexport * from './setupReactNative.js'\n\nexport {\n getConfig,\n getThemes,\n getTokens,\n onConfiguredOnce,\n updateConfig,\n} from './config.js'\n\nexport * from './constants/constants.js'\n\nexport * from './helpers/useShallowSetState.js'\nexport * from './helpers/getVariantExtras.js'\nexport * from './helpers/getAnimationDriver.js'\nexport * from './helpers/getExpandedShorthands.js'\nexport * from './helpers/getSplitStyles.js'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors.js'\nexport * from './helpers/mergeProps.js'\nexport * from './helpers/expandStyles.js'\nexport * from './helpers/isTamaguiElement.js'\nexport * from './helpers/isTamaguiComponent.js'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themes.js'\nexport * from './helpers/getThemeCSSRules.js'\nexport * from './helpers/proxyThemeVariables.js'\nexport * from './helpers/themeable.js'\nexport * from './helpers/withStaticProperties.js'\nexport * from './helpers/normalizeColor.js'\n\nexport * from './contexts/ButtonNestingContext.js'\n\nexport * from './hooks/useId.js'\nexport * from './hooks/useIsTouchDevice.js'\n\nexport {\n configureMedia,\n getMedia,\n mediaState,\n useMedia,\n useMediaPropsActive,\n mediaObjectToString,\n mediaQueryConfig,\n} from './hooks/useMedia.js'\nexport * from './hooks/useTheme.js'\nexport * from './hooks/useThemeName.js'\nexport * from './hooks/useSafeRef.js'\nexport * from './hooks/useStyle.js'\nexport * from './hooks/useAnimationDriver.js'\n\nexport * from './views/Slot.js'\nexport * from './views/Stack.js'\nexport * from './views/Text.js'\nexport * from './contexts/TextAncestorContext.js'\nexport * from './views/Theme.js'\nexport * from './views/ThemeProvider.js'\nexport * from './views/FontLanguage'\nexport * from './views/TamaguiProvider.js'\nexport * from './views/AnimationDriverProvider.js'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-did-finish-ssr'\nexport * from '@tamagui/use-event'\nexport * from '@tamagui/compose-refs'\nexport * from '@tamagui/helpers'\nexport * from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BAAc,6BArEd;AAsEA,wBAAc,qCAtEd;AAuEA,wBAAc,iCAvEd;AAwEA,wBAAc,uCAxEd;AAyEA,wBAAc,+CAzEd;AA2EA,wBAAc,sCA3Ed;AA4EA,wBAAc,wCA5Ed;AA6EA,wBAAc,+BA7Ed;AA8EA,wBAAc,kCA9Ed;AA+EA,wBAAc,6BA/Ed;AAgFA,wBAAc,+BAhFd;AAkFA,wBAAc,4BAlFd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/updateTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { addTheme } from './addTheme.js'\nimport { activeThemeManagers } from './hooks/useTheme.js'\nimport type { ThemeDefinition } from './types.js'\n\nexport function updateTheme({\n name,\n theme,\n}: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n}) {\n const next = addTheme({ name, theme, insertCSS: true, update: true })\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n activeThemeManagers.forEach((manager) => {\n if (manager.state.name === name) {\n manager.updateState({\n name,\n forceTheme: next.theme,\n })\n }\n })\n }\n\n return next\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,sBAAoC;
|
|
4
|
+
"sourcesContent": ["import { addTheme } from './addTheme.js'\nimport { activeThemeManagers } from './hooks/useTheme.js'\nimport type { ThemeDefinition } from './types.js'\n\n/** @deprecated import from @tamagui/theme instead */\nexport function updateTheme({\n name,\n theme,\n}: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n}) {\n const next = addTheme({ name, theme, insertCSS: true, update: true })\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n activeThemeManagers.forEach((manager) => {\n if (manager.state.name === name) {\n manager.updateState({\n name,\n forceTheme: next.theme,\n })\n }\n })\n }\n\n return next\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,sBAAoC;AAI7B,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AACF,GAGG;AACD,QAAM,WAAO,0BAAS,EAAE,MAAM,OAAO,WAAW,MAAM,QAAQ,KAAK,CAAC;AAEpE,MAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,wCAAoB,QAAQ,CAAC,YAAY;AACvC,UAAI,QAAQ,MAAM,SAAS,MAAM;AAC/B,gBAAQ,YAAY;AAAA,UAClB;AAAA,UACA,YAAY,KAAK;AAAA,QACnB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/addTheme.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/addTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\n\nimport { getConfig, updateConfig } from './config.js'\nimport { getThemeCSSRules } from './helpers/getThemeCSSRules'\nimport { ensureThemeVariable, proxyThemeToParents } from './helpers/themes.js'\nimport { ThemeDefinition, ThemeParsed } from './types.js'\n\nexport function addTheme(props: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n insertCSS?: boolean\n update?: boolean\n}) {\n const config = getConfig()\n\n if (process.env.NODE_ENV === 'development') {\n if (!config) {\n throw new Error('No config')\n }\n const theme = config.themes[props.name]\n if (!props.update && theme) {\n return { theme }\n }\n }\n\n const { name: themeName, theme: themeIn, insertCSS } = props\n const theme = { ...themeIn } as ThemeParsed\n for (const key in theme) {\n ensureThemeVariable(theme, key)\n }\n\n const themeProxied = proxyThemeToParents(themeName, theme, config.themes)\n config.themes[themeName] = themeProxied\n\n let cssRules: string[] = []\n\n if (isWeb) {\n if (insertCSS) {\n cssRules = getThemeCSSRules({\n // @ts-ignore this works but should be fixed types\n config,\n themeName,\n names: [themeName],\n theme,\n })\n const id = `t_theme_style_${themeName}`\n const existing = document.querySelector(`#${id}`)\n const style = document.createElement('style')\n style.id = id\n style.appendChild(document.createTextNode(cssRules.join('\\n')))\n document.head.appendChild(style)\n if (existing) {\n existing.parentElement?.removeChild(existing)\n }\n }\n }\n\n updateConfig('themes', { ...config.themes, [themeName]: themeProxied })\n\n // trigger updates in components\n return {\n theme: themeProxied,\n cssRules,\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,WAAW,oBAAoB;AACxC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB,2BAA2B;
|
|
4
|
+
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\n\nimport { getConfig, updateConfig } from './config.js'\nimport { getThemeCSSRules } from './helpers/getThemeCSSRules'\nimport { ensureThemeVariable, proxyThemeToParents } from './helpers/themes.js'\nimport { ThemeDefinition, ThemeParsed } from './types.js'\n\n/** @deprecated import from @tamagui/theme instead */\nexport function addTheme(props: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n insertCSS?: boolean\n update?: boolean\n}) {\n const config = getConfig()\n\n if (process.env.NODE_ENV === 'development') {\n if (!config) {\n throw new Error('No config')\n }\n const theme = config.themes[props.name]\n if (!props.update && theme) {\n return { theme }\n }\n }\n\n const { name: themeName, theme: themeIn, insertCSS } = props\n const theme = { ...themeIn } as ThemeParsed\n for (const key in theme) {\n ensureThemeVariable(theme, key)\n }\n\n const themeProxied = proxyThemeToParents(themeName, theme, config.themes)\n config.themes[themeName] = themeProxied\n\n let cssRules: string[] = []\n\n if (isWeb) {\n if (insertCSS) {\n cssRules = getThemeCSSRules({\n // @ts-ignore this works but should be fixed types\n config,\n themeName,\n names: [themeName],\n theme,\n })\n const id = `t_theme_style_${themeName}`\n const existing = document.querySelector(`#${id}`)\n const style = document.createElement('style')\n style.id = id\n style.appendChild(document.createTextNode(cssRules.join('\\n')))\n document.head.appendChild(style)\n if (existing) {\n existing.parentElement?.removeChild(existing)\n }\n }\n }\n\n updateConfig('themes', { ...config.themes, [themeName]: themeProxied })\n\n // trigger updates in components\n return {\n theme: themeProxied,\n cssRules,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,WAAW,oBAAoB;AACxC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB,2BAA2B;AAIlD,SAAS,SAAS,OAKtB;AAbH;AAcE,QAAM,SAAS,UAAU;AAEzB,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI,MAAM,WAAW;AAAA,IAC7B;AACA,UAAMA,SAAQ,OAAO,OAAO,MAAM,IAAI;AACtC,QAAI,CAAC,MAAM,UAAUA,QAAO;AAC1B,aAAO,EAAE,OAAAA,OAAM;AAAA,IACjB;AAAA,EACF;AAEA,QAAM,EAAE,MAAM,WAAW,OAAO,SAAS,UAAU,IAAI;AACvD,QAAM,QAAQ,EAAE,GAAG,QAAQ;AAC3B,aAAW,OAAO,OAAO;AACvB,wBAAoB,OAAO,GAAG;AAAA,EAChC;AAEA,QAAM,eAAe,oBAAoB,WAAW,OAAO,OAAO,MAAM;AACxE,SAAO,OAAO,SAAS,IAAI;AAE3B,MAAI,WAAqB,CAAC;AAE1B,MAAI,OAAO;AACT,QAAI,WAAW;AACb,iBAAW,iBAAiB;AAAA;AAAA,QAE1B;AAAA,QACA;AAAA,QACA,OAAO,CAAC,SAAS;AAAA,QACjB;AAAA,MACF,CAAC;AACD,YAAM,KAAK,iBAAiB;AAC5B,YAAM,WAAW,SAAS,cAAc,IAAI,IAAI;AAChD,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,KAAK;AACX,YAAM,YAAY,SAAS,eAAe,SAAS,KAAK,IAAI,CAAC,CAAC;AAC9D,eAAS,KAAK,YAAY,KAAK;AAC/B,UAAI,UAAU;AACZ,uBAAS,kBAAT,mBAAwB,YAAY;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AAEA,eAAa,UAAU,EAAE,GAAG,OAAO,QAAQ,CAAC,SAAS,GAAG,aAAa,CAAC;AAGtE,SAAO;AAAA,IACL,OAAO;AAAA,IACP;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["theme"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/addTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\n\nimport { getConfig, updateConfig } from './config.js'\nimport { getThemeCSSRules } from './helpers/getThemeCSSRules'\nimport { ensureThemeVariable, proxyThemeToParents } from './helpers/themes.js'\nimport { ThemeDefinition, ThemeParsed } from './types.js'\n\nexport function addTheme(props: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n insertCSS?: boolean\n update?: boolean\n}) {\n const config = getConfig()\n\n if (process.env.NODE_ENV === 'development') {\n if (!config) {\n throw new Error('No config')\n }\n const theme = config.themes[props.name]\n if (!props.update && theme) {\n return { theme }\n }\n }\n\n const { name: themeName, theme: themeIn, insertCSS } = props\n const theme = { ...themeIn } as ThemeParsed\n for (const key in theme) {\n ensureThemeVariable(theme, key)\n }\n\n const themeProxied = proxyThemeToParents(themeName, theme, config.themes)\n config.themes[themeName] = themeProxied\n\n let cssRules: string[] = []\n\n if (isWeb) {\n if (insertCSS) {\n cssRules = getThemeCSSRules({\n // @ts-ignore this works but should be fixed types\n config,\n themeName,\n names: [themeName],\n theme,\n })\n const id = `t_theme_style_${themeName}`\n const existing = document.querySelector(`#${id}`)\n const style = document.createElement('style')\n style.id = id\n style.appendChild(document.createTextNode(cssRules.join('\\n')))\n document.head.appendChild(style)\n if (existing) {\n existing.parentElement?.removeChild(existing)\n }\n }\n }\n\n updateConfig('themes', { ...config.themes, [themeName]: themeProxied })\n\n // trigger updates in components\n return {\n theme: themeProxied,\n cssRules,\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,WAAW,oBAAoB;AACxC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB,2BAA2B;
|
|
4
|
+
"sourcesContent": ["import { isWeb } from '@tamagui/constants'\n\nimport { getConfig, updateConfig } from './config.js'\nimport { getThemeCSSRules } from './helpers/getThemeCSSRules'\nimport { ensureThemeVariable, proxyThemeToParents } from './helpers/themes.js'\nimport { ThemeDefinition, ThemeParsed } from './types.js'\n\n/** @deprecated import from @tamagui/theme instead */\nexport function addTheme(props: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n insertCSS?: boolean\n update?: boolean\n}) {\n const config = getConfig()\n\n if (process.env.NODE_ENV === 'development') {\n if (!config) {\n throw new Error('No config')\n }\n const theme = config.themes[props.name]\n if (!props.update && theme) {\n return { theme }\n }\n }\n\n const { name: themeName, theme: themeIn, insertCSS } = props\n const theme = { ...themeIn } as ThemeParsed\n for (const key in theme) {\n ensureThemeVariable(theme, key)\n }\n\n const themeProxied = proxyThemeToParents(themeName, theme, config.themes)\n config.themes[themeName] = themeProxied\n\n let cssRules: string[] = []\n\n if (isWeb) {\n if (insertCSS) {\n cssRules = getThemeCSSRules({\n // @ts-ignore this works but should be fixed types\n config,\n themeName,\n names: [themeName],\n theme,\n })\n const id = `t_theme_style_${themeName}`\n const existing = document.querySelector(`#${id}`)\n const style = document.createElement('style')\n style.id = id\n style.appendChild(document.createTextNode(cssRules.join('\\n')))\n document.head.appendChild(style)\n if (existing) {\n existing.parentElement?.removeChild(existing)\n }\n }\n }\n\n updateConfig('themes', { ...config.themes, [themeName]: themeProxied })\n\n // trigger updates in components\n return {\n theme: themeProxied,\n cssRules,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,WAAW,oBAAoB;AACxC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB,2BAA2B;AAIlD,SAAS,SAAS,OAKtB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
export * from "./styled.js";
|
|
14
14
|
export * from "./types.js";
|
|
15
15
|
export * from "./setupReactNative.js";
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
getConfig,
|
|
18
|
+
getThemes,
|
|
19
|
+
getTokens,
|
|
20
|
+
onConfiguredOnce,
|
|
21
|
+
updateConfig
|
|
22
|
+
} from "./config.js";
|
|
17
23
|
export * from "./constants/constants.js";
|
|
18
24
|
export * from "./helpers/useShallowSetState.js";
|
|
19
25
|
export * from "./helpers/getVariantExtras.js";
|
|
@@ -27,6 +33,8 @@ export * from "./helpers/expandStyles.js";
|
|
|
27
33
|
export * from "./helpers/isTamaguiElement.js";
|
|
28
34
|
export * from "./helpers/isTamaguiComponent.js";
|
|
29
35
|
export * from "./helpers/matchMedia";
|
|
36
|
+
export * from "./helpers/themes.js";
|
|
37
|
+
export * from "./helpers/getThemeCSSRules.js";
|
|
30
38
|
export * from "./helpers/proxyThemeVariables.js";
|
|
31
39
|
export * from "./helpers/themeable.js";
|
|
32
40
|
export * from "./helpers/withStaticProperties.js";
|
|
@@ -74,6 +82,7 @@ export {
|
|
|
74
82
|
mediaQueryConfig,
|
|
75
83
|
mediaState,
|
|
76
84
|
onConfiguredOnce,
|
|
85
|
+
updateConfig,
|
|
77
86
|
useMedia,
|
|
78
87
|
useMediaPropsActive
|
|
79
88
|
};
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './Tamagui.js'\nexport * from './createComponent.js'\nexport * from './createShorthands.js'\nexport * from './createTheme.js'\nexport * from './createTamagui.js'\nexport * from './createFont.js'\nexport * from './createTokens.js'\nexport * from './createVariable.js'\nexport * from './createVariables.js'\nexport * from './insertFont.js'\nexport * from './addTheme.js'\nexport * from './updateTheme.js'\nexport * from './styled.js'\nexport * from './types.js'\nexport * from './setupReactNative.js'\n\nexport {
|
|
5
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,
|
|
4
|
+
"sourcesContent": ["export * from './Tamagui.js'\nexport * from './createComponent.js'\nexport * from './createShorthands.js'\nexport * from './createTheme.js'\nexport * from './createTamagui.js'\nexport * from './createFont.js'\nexport * from './createTokens.js'\nexport * from './createVariable.js'\nexport * from './createVariables.js'\nexport * from './insertFont.js'\nexport * from './addTheme.js'\nexport * from './updateTheme.js'\nexport * from './styled.js'\nexport * from './types.js'\nexport * from './setupReactNative.js'\n\nexport {\n getConfig,\n getThemes,\n getTokens,\n onConfiguredOnce,\n updateConfig,\n} from './config.js'\n\nexport * from './constants/constants.js'\n\nexport * from './helpers/useShallowSetState.js'\nexport * from './helpers/getVariantExtras.js'\nexport * from './helpers/getAnimationDriver.js'\nexport * from './helpers/getExpandedShorthands.js'\nexport * from './helpers/getSplitStyles.js'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors.js'\nexport * from './helpers/mergeProps.js'\nexport * from './helpers/expandStyles.js'\nexport * from './helpers/isTamaguiElement.js'\nexport * from './helpers/isTamaguiComponent.js'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themes.js'\nexport * from './helpers/getThemeCSSRules.js'\nexport * from './helpers/proxyThemeVariables.js'\nexport * from './helpers/themeable.js'\nexport * from './helpers/withStaticProperties.js'\nexport * from './helpers/normalizeColor.js'\n\nexport * from './contexts/ButtonNestingContext.js'\n\nexport * from './hooks/useId.js'\nexport * from './hooks/useIsTouchDevice.js'\n\nexport {\n configureMedia,\n getMedia,\n mediaState,\n useMedia,\n useMediaPropsActive,\n mediaObjectToString,\n mediaQueryConfig,\n} from './hooks/useMedia.js'\nexport * from './hooks/useTheme.js'\nexport * from './hooks/useThemeName.js'\nexport * from './hooks/useSafeRef.js'\nexport * from './hooks/useStyle.js'\nexport * from './hooks/useAnimationDriver.js'\n\nexport * from './views/Slot.js'\nexport * from './views/Stack.js'\nexport * from './views/Text.js'\nexport * from './contexts/TextAncestorContext.js'\nexport * from './views/Theme.js'\nexport * from './views/ThemeProvider.js'\nexport * from './views/FontLanguage'\nexport * from './views/TamaguiProvider.js'\nexport * from './views/AnimationDriverProvider.js'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-did-finish-ssr'\nexport * from '@tamagui/use-event'\nexport * from '@tamagui/compose-refs'\nexport * from '@tamagui/helpers'\nexport * from '@tamagui/constants'\n\nexport * from './setupHooks.js'\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -13,7 +13,13 @@ export * from "./updateTheme.js";
|
|
|
13
13
|
export * from "./styled.js";
|
|
14
14
|
export * from "./types.js";
|
|
15
15
|
export * from "./setupReactNative.js";
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
getConfig,
|
|
18
|
+
getThemes,
|
|
19
|
+
getTokens,
|
|
20
|
+
onConfiguredOnce,
|
|
21
|
+
updateConfig
|
|
22
|
+
} from "./config.js";
|
|
17
23
|
export * from "./constants/constants.js";
|
|
18
24
|
export * from "./helpers/useShallowSetState.js";
|
|
19
25
|
export * from "./helpers/getVariantExtras.js";
|
|
@@ -27,6 +33,8 @@ export * from "./helpers/expandStyles.js";
|
|
|
27
33
|
export * from "./helpers/isTamaguiElement.js";
|
|
28
34
|
export * from "./helpers/isTamaguiComponent.js";
|
|
29
35
|
export * from "./helpers/matchMedia";
|
|
36
|
+
export * from "./helpers/themes.js";
|
|
37
|
+
export * from "./helpers/getThemeCSSRules.js";
|
|
30
38
|
export * from "./helpers/proxyThemeVariables.js";
|
|
31
39
|
export * from "./helpers/themeable.js";
|
|
32
40
|
export * from "./helpers/withStaticProperties.js";
|
|
@@ -74,6 +82,7 @@ export {
|
|
|
74
82
|
mediaQueryConfig,
|
|
75
83
|
mediaState,
|
|
76
84
|
onConfiguredOnce,
|
|
85
|
+
updateConfig,
|
|
77
86
|
useMedia,
|
|
78
87
|
useMediaPropsActive
|
|
79
88
|
};
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './Tamagui.js'\nexport * from './createComponent.js'\nexport * from './createShorthands.js'\nexport * from './createTheme.js'\nexport * from './createTamagui.js'\nexport * from './createFont.js'\nexport * from './createTokens.js'\nexport * from './createVariable.js'\nexport * from './createVariables.js'\nexport * from './insertFont.js'\nexport * from './addTheme.js'\nexport * from './updateTheme.js'\nexport * from './styled.js'\nexport * from './types.js'\nexport * from './setupReactNative.js'\n\nexport {
|
|
5
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,
|
|
4
|
+
"sourcesContent": ["export * from './Tamagui.js'\nexport * from './createComponent.js'\nexport * from './createShorthands.js'\nexport * from './createTheme.js'\nexport * from './createTamagui.js'\nexport * from './createFont.js'\nexport * from './createTokens.js'\nexport * from './createVariable.js'\nexport * from './createVariables.js'\nexport * from './insertFont.js'\nexport * from './addTheme.js'\nexport * from './updateTheme.js'\nexport * from './styled.js'\nexport * from './types.js'\nexport * from './setupReactNative.js'\n\nexport {\n getConfig,\n getThemes,\n getTokens,\n onConfiguredOnce,\n updateConfig,\n} from './config.js'\n\nexport * from './constants/constants.js'\n\nexport * from './helpers/useShallowSetState.js'\nexport * from './helpers/getVariantExtras.js'\nexport * from './helpers/getAnimationDriver.js'\nexport * from './helpers/getExpandedShorthands.js'\nexport * from './helpers/getSplitStyles.js'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors.js'\nexport * from './helpers/mergeProps.js'\nexport * from './helpers/expandStyles.js'\nexport * from './helpers/isTamaguiElement.js'\nexport * from './helpers/isTamaguiComponent.js'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themes.js'\nexport * from './helpers/getThemeCSSRules.js'\nexport * from './helpers/proxyThemeVariables.js'\nexport * from './helpers/themeable.js'\nexport * from './helpers/withStaticProperties.js'\nexport * from './helpers/normalizeColor.js'\n\nexport * from './contexts/ButtonNestingContext.js'\n\nexport * from './hooks/useId.js'\nexport * from './hooks/useIsTouchDevice.js'\n\nexport {\n configureMedia,\n getMedia,\n mediaState,\n useMedia,\n useMediaPropsActive,\n mediaObjectToString,\n mediaQueryConfig,\n} from './hooks/useMedia.js'\nexport * from './hooks/useTheme.js'\nexport * from './hooks/useThemeName.js'\nexport * from './hooks/useSafeRef.js'\nexport * from './hooks/useStyle.js'\nexport * from './hooks/useAnimationDriver.js'\n\nexport * from './views/Slot.js'\nexport * from './views/Stack.js'\nexport * from './views/Text.js'\nexport * from './contexts/TextAncestorContext.js'\nexport * from './views/Theme.js'\nexport * from './views/ThemeProvider.js'\nexport * from './views/FontLanguage'\nexport * from './views/TamaguiProvider.js'\nexport * from './views/AnimationDriverProvider.js'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-did-finish-ssr'\nexport * from '@tamagui/use-event'\nexport * from '@tamagui/compose-refs'\nexport * from '@tamagui/helpers'\nexport * from '@tamagui/constants'\n\nexport * from './setupHooks.js'\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAEd,cAAc;AACd,cAAc;AAEd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/updateTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { addTheme } from './addTheme.js'\nimport { activeThemeManagers } from './hooks/useTheme.js'\nimport type { ThemeDefinition } from './types.js'\n\nexport function updateTheme({\n name,\n theme,\n}: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n}) {\n const next = addTheme({ name, theme, insertCSS: true, update: true })\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n activeThemeManagers.forEach((manager) => {\n if (manager.state.name === name) {\n manager.updateState({\n name,\n forceTheme: next.theme,\n })\n }\n })\n }\n\n return next\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;
|
|
4
|
+
"sourcesContent": ["import { addTheme } from './addTheme.js'\nimport { activeThemeManagers } from './hooks/useTheme.js'\nimport type { ThemeDefinition } from './types.js'\n\n/** @deprecated import from @tamagui/theme instead */\nexport function updateTheme({\n name,\n theme,\n}: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n}) {\n const next = addTheme({ name, theme, insertCSS: true, update: true })\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n activeThemeManagers.forEach((manager) => {\n if (manager.state.name === name) {\n manager.updateState({\n name,\n forceTheme: next.theme,\n })\n }\n })\n }\n\n return next\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AAI7B,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AACF,GAGG;AACD,QAAM,OAAO,SAAS,EAAE,MAAM,OAAO,WAAW,MAAM,QAAQ,KAAK,CAAC;AAEpE,MAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,wBAAoB,QAAQ,CAAC,YAAY;AACvC,UAAI,QAAQ,MAAM,SAAS,MAAM;AAC/B,gBAAQ,YAAY;AAAA,UAClB;AAAA,UACA,YAAY,KAAK;AAAA,QACnB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/updateTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { addTheme } from './addTheme.js'\nimport { activeThemeManagers } from './hooks/useTheme.js'\nimport type { ThemeDefinition } from './types.js'\n\nexport function updateTheme({\n name,\n theme,\n}: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n}) {\n const next = addTheme({ name, theme, insertCSS: true, update: true })\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n activeThemeManagers.forEach((manager) => {\n if (manager.state.name === name) {\n manager.updateState({\n name,\n forceTheme: next.theme,\n })\n }\n })\n }\n\n return next\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;
|
|
4
|
+
"sourcesContent": ["import { addTheme } from './addTheme.js'\nimport { activeThemeManagers } from './hooks/useTheme.js'\nimport type { ThemeDefinition } from './types.js'\n\n/** @deprecated import from @tamagui/theme instead */\nexport function updateTheme({\n name,\n theme,\n}: {\n name: string\n theme: Partial<Record<keyof ThemeDefinition, any>>\n}) {\n const next = addTheme({ name, theme, insertCSS: true, update: true })\n\n if (process.env.TAMAGUI_TARGET === 'native') {\n activeThemeManagers.forEach((manager) => {\n if (manager.state.name === name) {\n manager.updateState({\n name,\n forceTheme: next.theme,\n })\n }\n })\n }\n\n return next\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AAI7B,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AACF,GAGG;AACD,QAAM,OAAO,SAAS,EAAE,MAAM,OAAO,WAAW,MAAM,QAAQ,KAAK,CAAC;AAEpE,MAAI,QAAQ,IAAI,mBAAmB,UAAU;AAC3C,wBAAoB,QAAQ,CAAC,YAAY;AACvC,UAAI,QAAQ,MAAM,SAAS,MAAM;AAC/B,gBAAQ,YAAY;AAAA,UAClB;AAAA,UACA,YAAY,KAAK;AAAA,QACnB,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
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.
|
|
31
|
-
"@tamagui/constants": "1.
|
|
32
|
-
"@tamagui/helpers": "1.
|
|
33
|
-
"@tamagui/normalize-css-color": "1.
|
|
34
|
-
"@tamagui/use-did-finish-ssr": "1.
|
|
35
|
-
"@tamagui/use-event": "1.
|
|
36
|
-
"@tamagui/use-force-update": "1.
|
|
30
|
+
"@tamagui/compose-refs": "1.11.0",
|
|
31
|
+
"@tamagui/constants": "1.11.0",
|
|
32
|
+
"@tamagui/helpers": "1.11.0",
|
|
33
|
+
"@tamagui/normalize-css-color": "1.11.0",
|
|
34
|
+
"@tamagui/use-did-finish-ssr": "1.11.0",
|
|
35
|
+
"@tamagui/use-event": "1.11.0",
|
|
36
|
+
"@tamagui/use-force-update": "1.11.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "*"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@tamagui/build": "1.
|
|
42
|
+
"@tamagui/build": "1.11.0",
|
|
43
43
|
"@testing-library/react": "^13.4.0",
|
|
44
44
|
"csstype": "^3.0.10",
|
|
45
45
|
"react": "^18.2.0",
|
package/src/addTheme.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { getThemeCSSRules } from './helpers/getThemeCSSRules'
|
|
|
5
5
|
import { ensureThemeVariable, proxyThemeToParents } from './helpers/themes.js'
|
|
6
6
|
import { ThemeDefinition, ThemeParsed } from './types.js'
|
|
7
7
|
|
|
8
|
+
/** @deprecated import from @tamagui/theme instead */
|
|
8
9
|
export function addTheme(props: {
|
|
9
10
|
name: string
|
|
10
11
|
theme: Partial<Record<keyof ThemeDefinition, any>>
|
package/src/index.ts
CHANGED
|
@@ -14,7 +14,13 @@ export * from './styled.js'
|
|
|
14
14
|
export * from './types.js'
|
|
15
15
|
export * from './setupReactNative.js'
|
|
16
16
|
|
|
17
|
-
export {
|
|
17
|
+
export {
|
|
18
|
+
getConfig,
|
|
19
|
+
getThemes,
|
|
20
|
+
getTokens,
|
|
21
|
+
onConfiguredOnce,
|
|
22
|
+
updateConfig,
|
|
23
|
+
} from './config.js'
|
|
18
24
|
|
|
19
25
|
export * from './constants/constants.js'
|
|
20
26
|
|
|
@@ -30,6 +36,8 @@ export * from './helpers/expandStyles.js'
|
|
|
30
36
|
export * from './helpers/isTamaguiElement.js'
|
|
31
37
|
export * from './helpers/isTamaguiComponent.js'
|
|
32
38
|
export * from './helpers/matchMedia'
|
|
39
|
+
export * from './helpers/themes.js'
|
|
40
|
+
export * from './helpers/getThemeCSSRules.js'
|
|
33
41
|
export * from './helpers/proxyThemeVariables.js'
|
|
34
42
|
export * from './helpers/themeable.js'
|
|
35
43
|
export * from './helpers/withStaticProperties.js'
|
package/src/updateTheme.ts
CHANGED
package/types/addTheme.d.ts
CHANGED
package/types/addTheme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTheme.d.ts","sourceRoot":"","sources":["../src/addTheme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAe,MAAM,YAAY,CAAA;AAEzD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,GAAG,CAAC,CAAC,CAAA;IAClD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;;;;;;;;;;;;;;;;;;;;;;;EAoDA"}
|
|
1
|
+
{"version":3,"file":"addTheme.d.ts","sourceRoot":"","sources":["../src/addTheme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAe,MAAM,YAAY,CAAA;AAEzD,qDAAqD;AACrD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,GAAG,CAAC,CAAC,CAAA;IAClD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;;;;;;;;;;;;;;;;;;;;;;;EAoDA"}
|
package/types/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export * from './updateTheme.js';
|
|
|
13
13
|
export * from './styled.js';
|
|
14
14
|
export * from './types.js';
|
|
15
15
|
export * from './setupReactNative.js';
|
|
16
|
-
export { getConfig, getThemes, getTokens, onConfiguredOnce } from './config.js';
|
|
16
|
+
export { getConfig, getThemes, getTokens, onConfiguredOnce, updateConfig, } from './config.js';
|
|
17
17
|
export * from './constants/constants.js';
|
|
18
18
|
export * from './helpers/useShallowSetState.js';
|
|
19
19
|
export * from './helpers/getVariantExtras.js';
|
|
@@ -27,6 +27,8 @@ export * from './helpers/expandStyles.js';
|
|
|
27
27
|
export * from './helpers/isTamaguiElement.js';
|
|
28
28
|
export * from './helpers/isTamaguiComponent.js';
|
|
29
29
|
export * from './helpers/matchMedia';
|
|
30
|
+
export * from './helpers/themes.js';
|
|
31
|
+
export * from './helpers/getThemeCSSRules.js';
|
|
30
32
|
export * from './helpers/proxyThemeVariables.js';
|
|
31
33
|
export * from './helpers/themeable.js';
|
|
32
34
|
export * from './helpers/withStaticProperties.js';
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,uBAAuB,CAAA;AAErC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cA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A;AAElD,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAElC,cAAc,iBAAiB,CAAA"}
|
package/types/updateTheme.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateTheme.d.ts","sourceRoot":"","sources":["../src/updateTheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,GAAG,CAAC,CAAC,CAAA;CACnD;;;;;;;;;;;;;;;;;;;;;;;;EAeA"}
|
|
1
|
+
{"version":3,"file":"updateTheme.d.ts","sourceRoot":"","sources":["../src/updateTheme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,qDAAqD;AACrD,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,eAAe,EAAE,GAAG,CAAC,CAAC,CAAA;CACnD;;;;;;;;;;;;;;;;;;;;;;;;EAeA"}
|