@tamagui/next-theme 1.135.2 → 1.135.3

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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@tamagui/next-theme",
3
- "version": "1.135.2",
3
+ "version": "1.135.3",
4
4
  "sideEffects": false,
5
5
  "source": "src/index.ts",
6
- "types": "./src/index.ts",
6
+ "types": "./types/index.d.ts",
7
7
  "main": "dist/cjs",
8
8
  "module": "dist/esm",
9
9
  "files": [
@@ -12,20 +12,29 @@
12
12
  "dist"
13
13
  ],
14
14
  "scripts": {
15
- "build": "tamagui-build --skip-types",
16
- "watch": "tamagui-build --skip-types --watch",
15
+ "build": "tamagui-build --skip-native",
16
+ "watch": "tamagui-build --skip-native --watch",
17
17
  "lint": "biome check src",
18
18
  "lint:fix": "biome check --write src",
19
19
  "clean": "tamagui-build clean",
20
20
  "clean:build": "tamagui-build clean:build"
21
21
  },
22
+ "exports": {
23
+ "./package.json": "./package.json",
24
+ ".": {
25
+ "types": "./types/index.d.ts",
26
+ "import": "./dist/esm/index.mjs",
27
+ "require": "./dist/cjs/index.cjs",
28
+ "default": "./dist/cjs/index.js"
29
+ }
30
+ },
22
31
  "dependencies": {
23
- "@tamagui/constants": "1.135.2",
24
- "@tamagui/use-event": "1.135.2",
32
+ "@tamagui/constants": "1.135.3",
33
+ "@tamagui/use-event": "1.135.3",
25
34
  "next": "^15.3.1"
26
35
  },
27
36
  "devDependencies": {
28
- "@tamagui/build": "1.135.2",
37
+ "@tamagui/build": "1.135.3",
29
38
  "react": "*"
30
39
  },
31
40
  "peerDependencies": {
@@ -0,0 +1,12 @@
1
+ // https://raw.githubusercontent.com/pacocoursey/next-themes/master/index.tsx
2
+ // forked temporarily
3
+ export * from "./NextThemeProvider";
4
+ export * from "./ThemeSettingContext";
5
+ export * from "./UseThemeProps";
6
+ export * from "./helpers";
7
+ export * from "./constants";
8
+ export * from "./useTheme";
9
+ export * from "./types";
10
+ export * from "./useRootTheme";
11
+
12
+ //# sourceMappingURL=NextTheme.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": ";;AAGA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc",
3
+ "names": [],
4
+ "sources": [
5
+ "src/NextTheme.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "// https://raw.githubusercontent.com/pacocoursey/next-themes/master/index.tsx\n// forked temporarily\n\nexport * from './NextThemeProvider'\nexport * from './ThemeSettingContext'\nexport * from './UseThemeProps'\nexport * from './helpers'\nexport * from './constants'\nexport * from './useTheme'\nexport * from './types'\nexport * from './useRootTheme'\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import type { ThemeProviderProps } from "./UseThemeProps";
3
+ export declare const NextThemeProvider: React.FunctionComponent<ThemeProviderProps>;
4
+
5
+ //# sourceMappingURL=NextThemeProvider.d.ts.map
@@ -0,0 +1,13 @@
1
+ {
2
+ "mappings": "AAGA,YAAY,WAAW,OAAO;AAO9B,cAAc,0BAAyC,iBAAiB;AAExE,OAAO,cAAMA,mBAAmB,MAAM,kBAAkB",
3
+ "names": [
4
+ "NextThemeProvider: React.FunctionComponent<ThemeProviderProps>"
5
+ ],
6
+ "sources": [
7
+ "src/NextThemeProvider.tsx"
8
+ ],
9
+ "sourcesContent": [
10
+ "import { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { useEvent } from '@tamagui/use-event'\nimport NextHead from 'next/head'\nimport * as React from 'react'\nimport { memo, useEffect, useMemo, useState } from 'react'\n\nimport { MEDIA, colorSchemes } from './constants'\nimport { getSystemTheme, getTheme } from './helpers'\nimport { ThemeSettingContext } from './ThemeSettingContext'\nimport type { ValueObject } from './types'\nimport type { ThemeProviderProps, UseThemeProps } from './UseThemeProps'\n\nexport const NextThemeProvider: React.FunctionComponent<ThemeProviderProps> = memo(\n ({\n forcedTheme,\n disableTransitionOnChange = false,\n enableSystem = true,\n enableColorScheme = true,\n storageKey = 'theme',\n themes = colorSchemes,\n defaultTheme = enableSystem ? 'system' : 'light',\n attribute = 'class',\n skipNextHead,\n onChangeTheme,\n value = {\n dark: 't_dark',\n light: 't_light',\n },\n children,\n }) => {\n const [theme, setThemeState] = useState(() => getTheme(storageKey, defaultTheme))\n const [resolvedTheme, setResolvedTheme] = useState(() => getTheme(storageKey))\n const attrs = !value ? themes : Object.values(value)\n\n const handleMediaQuery = useEvent((e?) => {\n const _ = getSystemTheme(e)\n const update = () => setResolvedTheme(_)\n if (disableTransitionOnChange) {\n update()\n } else {\n React.startTransition(() => update())\n }\n if (theme === 'system' && !forcedTheme) {\n handleChangeTheme(_, false)\n }\n })\n\n const handleChangeTheme = useEvent(\n (theme, updateStorage = true, updateDOM = true) => {\n let name = value?.[theme] || theme\n\n if (updateStorage) {\n try {\n localStorage.setItem(storageKey, theme)\n } catch (e) {\n // Unsupported\n }\n }\n\n if (theme === 'system' && enableSystem) {\n const resolved = getSystemTheme()\n name = value?.[resolved] || resolved\n }\n\n onChangeTheme?.(name.replace('t_', ''))\n\n if (updateDOM) {\n const d = document.documentElement\n if (attribute === 'class') {\n d.classList.remove(...attrs)\n d.classList.add(name)\n } else {\n d.setAttribute(attribute, name)\n }\n }\n }\n )\n\n useIsomorphicLayoutEffect(() => {\n // Always listen to System preference\n const media = window.matchMedia(MEDIA)\n // Intentionally use deprecated listener methods to support iOS & old browsers\n media.addListener(handleMediaQuery)\n handleMediaQuery(media)\n return () => {\n media.removeListener(handleMediaQuery)\n }\n }, [])\n\n const set = useEvent((newTheme) => {\n if (forcedTheme) {\n handleChangeTheme(newTheme, true, false)\n } else {\n handleChangeTheme(newTheme)\n }\n setThemeState(newTheme)\n })\n\n // localStorage event handling\n useEffect(() => {\n const handleStorage = (e: StorageEvent) => {\n if (e.key !== storageKey) {\n return\n }\n // If default theme set, use it if localstorage === null (happens on local storage manual deletion)\n const theme = e.newValue || defaultTheme\n set(theme)\n }\n window.addEventListener('storage', handleStorage)\n return () => {\n window.removeEventListener('storage', handleStorage)\n }\n }, [defaultTheme, set, storageKey])\n\n // color-scheme handling\n useIsomorphicLayoutEffect(() => {\n if (!enableColorScheme) return\n\n const colorScheme =\n // If theme is forced to light or dark, use that\n forcedTheme && colorSchemes.includes(forcedTheme as 'light' | 'dark')\n ? forcedTheme\n : // If regular theme is light or dark\n theme && colorSchemes.includes(theme)\n ? theme\n : // If theme is system, use the resolved version\n theme === 'system'\n ? resolvedTheme || null\n : null\n\n // color-scheme tells browser how to render built-in elements like forms, scrollbars, etc.\n // if color-scheme is null, this will remove the property\n const userPrefers =\n typeof window !== 'undefined' &&\n window.matchMedia &&\n window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light'\n\n const wePrefer = colorScheme || 'light'\n\n // avoid running this because it causes full page reflow\n if (userPrefers !== wePrefer) {\n document.documentElement.style.setProperty('color-scheme', colorScheme)\n }\n }, [enableColorScheme, theme, resolvedTheme, forcedTheme])\n\n const toggle = useEvent(() => {\n const order =\n resolvedTheme === 'dark'\n ? ['system', 'light', 'dark']\n : ['system', 'dark', 'light']\n const next = order[(order.indexOf(theme) + 1) % order.length]\n set(next)\n })\n\n const systemTheme = (enableSystem ? resolvedTheme : undefined) as\n | 'light'\n | 'dark'\n | undefined\n\n const contextValue = useMemo(() => {\n const value: UseThemeProps = {\n theme,\n current: theme,\n set,\n toggle,\n forcedTheme,\n resolvedTheme: theme === 'system' ? resolvedTheme : theme,\n themes: enableSystem ? [...themes, 'system'] : (themes as string[]),\n systemTheme,\n } as const\n return value\n }, [\n theme,\n set,\n toggle,\n forcedTheme,\n resolvedTheme,\n enableSystem,\n themes,\n systemTheme,\n ])\n\n return (\n <ThemeSettingContext.Provider value={contextValue}>\n <ThemeScript\n {...{\n forcedTheme,\n storageKey,\n systemTheme: resolvedTheme,\n attribute,\n value,\n enableSystem,\n defaultTheme,\n attrs,\n skipNextHead,\n }}\n />\n {/* because on SSR we re-run and can avoid whole tree re-render */}\n {useMemo(() => children, [children])}\n </ThemeSettingContext.Provider>\n )\n }\n)\n\nconst ThemeScript = memo(\n ({\n forcedTheme,\n storageKey,\n attribute,\n enableSystem,\n defaultTheme,\n value,\n attrs,\n skipNextHead,\n }: {\n forcedTheme?: string\n storageKey: string\n attribute?: string\n enableSystem?: boolean\n defaultTheme: string\n value?: ValueObject\n attrs: any\n skipNextHead?: boolean\n }) => {\n // Code-golfing the amount of characters in the script\n const optimization = (() => {\n if (attribute === 'class') {\n const removeClasses = attrs.map((t: string) => `d.remove('${t}')`).join(';')\n return `var d=document.documentElement.classList;${removeClasses};`\n }\n return `var d=document.documentElement;`\n })()\n\n const updateDOM = (name: string, literal?: boolean) => {\n name = value?.[name] || name\n const val = literal ? name : `'${name}'`\n\n if (attribute === 'class') {\n return `d.add(${val})`\n }\n\n return `d.setAttribute('${attribute}', ${val})`\n }\n\n const defaultSystem = defaultTheme === 'system'\n\n const contents = (\n <>\n {forcedTheme ? (\n <script\n // nonce={nonce}\n key=\"next-themes-script\"\n dangerouslySetInnerHTML={{\n // These are minified via Terser and then updated by hand, don't recommend\n __html: `!function(){${optimization}${updateDOM(forcedTheme)}}()`,\n }}\n />\n ) : enableSystem ? (\n <script\n // nonce={nonce}\n key=\"next-themes-script\"\n dangerouslySetInnerHTML={{\n __html: `!function(){try {${optimization}var e=localStorage.getItem('${storageKey}');${\n !defaultSystem ? updateDOM(defaultTheme) + ';' : ''\n }if(\"system\"===e||(!e&&${defaultSystem})){var t=\"${MEDIA}\",m=window.matchMedia(t);m.media!==t||m.matches?${updateDOM(\n 'dark'\n )}:${updateDOM('light')}}else if(e) ${\n value ? `var x=${JSON.stringify(value)};` : ''\n }${updateDOM(value ? 'x[e]' : 'e', true)}}catch(e){}}()`,\n }}\n />\n ) : (\n <script\n // nonce={nonce}\n key=\"next-themes-script\"\n dangerouslySetInnerHTML={{\n __html: `!function(){try{${optimization}var e=localStorage.getItem(\"${storageKey}\");if(e){${\n value ? `var x=${JSON.stringify(value)};` : ''\n }${updateDOM(value ? 'x[e]' : 'e', true)}}else{${updateDOM(\n defaultTheme\n )};}}catch(t){}}();`,\n }}\n />\n )}\n </>\n )\n\n if (skipNextHead) return contents\n\n return <NextHead>{contents}</NextHead>\n },\n (prevProps, nextProps) => {\n // Only re-render when forcedTheme changes\n // the rest of the props should be completely stable\n if (prevProps.forcedTheme !== nextProps.forcedTheme) return false\n return true\n }\n)\n"
11
+ ],
12
+ "version": 3
13
+ }
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { UseThemeProps } from "./UseThemeProps";
3
+ export declare const ThemeSettingContext: React.Context<UseThemeProps>;
4
+
5
+ //# sourceMappingURL=ThemeSettingContext.d.ts.map
@@ -0,0 +1,13 @@
1
+ {
2
+ "mappings": "AAAA,OAAO,WAAW,OAAO;AAEzB,cAAc,qBAAqB,iBAAiB;AAEpD,OAAO,cAAMA,qBAAqB,MAAM,QAAQ",
3
+ "names": [
4
+ "ThemeSettingContext: React.Context<UseThemeProps>"
5
+ ],
6
+ "sources": [
7
+ "src/ThemeSettingContext.tsx"
8
+ ],
9
+ "sourcesContent": [
10
+ "import React from 'react'\n\nimport type { UseThemeProps } from './UseThemeProps'\n\nexport const ThemeSettingContext: React.Context<UseThemeProps> =\n React.createContext<UseThemeProps>({\n toggle: () => {},\n set: (_) => {},\n themes: [],\n })\n"
11
+ ],
12
+ "version": 3
13
+ }
@@ -0,0 +1,45 @@
1
+ import type { ValueObject } from "./types";
2
+ export interface UseThemeProps {
3
+ /** List of all available theme names */
4
+ themes: string[];
5
+ /** Forced theme name for the current page */
6
+ forcedTheme?: string;
7
+ /** Update the theme */
8
+ set: (theme: string) => void;
9
+ toggle: () => void;
10
+ /** Active theme name - will return "system" if not overriden, see "resolvedTheme" for getting resolved system value */
11
+ current?: string;
12
+ /** @deprecated Use `current` instead (deprecating avoid confusion with useTheme) */
13
+ theme?: string;
14
+ /** If `enableSystem` is true and the active theme is "system", this returns whether the system preference resolved to "dark" or "light". Otherwise, identical to `theme` */
15
+ resolvedTheme?: string;
16
+ /** If enableSystem is true, returns the System theme preference ("dark" or "light"), regardless what the active theme is */
17
+ systemTheme?: "dark" | "light";
18
+ }
19
+ export interface ThemeProviderProps {
20
+ children?: any;
21
+ /** List of all available theme names */
22
+ themes?: string[];
23
+ /** Forced theme name for the current page */
24
+ forcedTheme?: string;
25
+ /** Whether to switch between dark and light themes based on prefers-color-scheme */
26
+ enableSystem?: boolean;
27
+ systemTheme?: string;
28
+ /** Disable all CSS transitions when switching themes */
29
+ disableTransitionOnChange?: boolean;
30
+ /** Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons */
31
+ enableColorScheme?: boolean;
32
+ /** Key used to store theme setting in localStorage */
33
+ storageKey?: string;
34
+ /** Default theme name (for v0.0.12 and lower the default was light). If `enableSystem` is false, the default theme is light */
35
+ defaultTheme?: string;
36
+ /** HTML attribute modified based on the active theme. Accepts `class` and `data-*` (meaning any data attribute, `data-mode`, `data-color`, etc.) */
37
+ attribute?: string | "class";
38
+ /** Mapping of theme name to HTML attribute value. Object where key is the theme name and value is the attribute value */
39
+ value?: ValueObject;
40
+ onChangeTheme?: (name: string) => void;
41
+ // avoids warning
42
+ skipNextHead?: boolean;
43
+ }
44
+
45
+ //# sourceMappingURL=UseThemeProps.d.ts.map
@@ -0,0 +1,14 @@
1
+ {
2
+ "mappings": "AAAA,cAAc,mBAAmB,SAAS;AAE1C,iBAAiB,cAAc;;CAE7B;;CAEA;;CAEA,MAAMA;CACN;;CAEA;;CAEA;;CAEA;;CAEA,cAAc,SAAS;AACxB;AAED,iBAAiB,mBAAmB;CAClC;;CAEA;;CAEA;;CAEA;CACA;;CAEA;;CAEA;;CAEA;;CAEA;;CAEA,qBAAqB;;CAErB,QAAQ;CACR,iBAAiBC;;CAGjB;AACD",
3
+ "names": [
4
+ "theme: string",
5
+ "name: string"
6
+ ],
7
+ "sources": [
8
+ "src/UseThemeProps.tsx"
9
+ ],
10
+ "sourcesContent": [
11
+ "import type { ValueObject } from './types'\n\nexport interface UseThemeProps {\n /** List of all available theme names */\n themes: string[]\n /** Forced theme name for the current page */\n forcedTheme?: string\n /** Update the theme */\n set: (theme: string) => void\n toggle: () => void\n /** Active theme name - will return \"system\" if not overriden, see \"resolvedTheme\" for getting resolved system value */\n current?: string\n /** @deprecated Use `current` instead (deprecating avoid confusion with useTheme) */\n theme?: string\n /** If `enableSystem` is true and the active theme is \"system\", this returns whether the system preference resolved to \"dark\" or \"light\". Otherwise, identical to `theme` */\n resolvedTheme?: string\n /** If enableSystem is true, returns the System theme preference (\"dark\" or \"light\"), regardless what the active theme is */\n systemTheme?: 'dark' | 'light'\n}\n\nexport interface ThemeProviderProps {\n children?: any\n /** List of all available theme names */\n themes?: string[]\n /** Forced theme name for the current page */\n forcedTheme?: string\n /** Whether to switch between dark and light themes based on prefers-color-scheme */\n enableSystem?: boolean\n systemTheme?: string\n /** Disable all CSS transitions when switching themes */\n disableTransitionOnChange?: boolean\n /** Whether to indicate to browsers which color scheme is used (dark or light) for built-in UI like inputs and buttons */\n enableColorScheme?: boolean\n /** Key used to store theme setting in localStorage */\n storageKey?: string\n /** Default theme name (for v0.0.12 and lower the default was light). If `enableSystem` is false, the default theme is light */\n defaultTheme?: string\n /** HTML attribute modified based on the active theme. Accepts `class` and `data-*` (meaning any data attribute, `data-mode`, `data-color`, etc.) */\n attribute?: string | 'class'\n /** Mapping of theme name to HTML attribute value. Object where key is the theme name and value is the attribute value */\n value?: ValueObject\n onChangeTheme?: (name: string) => void\n\n // avoids warning\n skipNextHead?: boolean\n}\n"
12
+ ],
13
+ "version": 3
14
+ }
@@ -0,0 +1,5 @@
1
+ export declare const constants: {};
2
+ export declare const colorSchemes: readonly ["light", "dark"];
3
+ export declare const MEDIA = "(prefers-color-scheme: dark)";
4
+
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,OAAO,cAAM;AACb,OAAO,cAAM,wBAAgB,SAAS;AACtC,OAAO,cAAM,QAAQ",
3
+ "names": [],
4
+ "sources": [
5
+ "src/constants.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "export const constants = {}\nexport const colorSchemes = ['light', 'dark'] as const\nexport const MEDIA = '(prefers-color-scheme: dark)'\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,6 @@
1
+ export declare const helpers: {};
2
+ // Helpers
3
+ export declare const getTheme: (key: string, fallback?: string) => any;
4
+ export declare const getSystemTheme: (e?: MediaQueryList) => "dark" | "light";
5
+
6
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1,15 @@
1
+ {
2
+ "mappings": "AAEA,OAAO,cAAM;;AAGb,OAAO,cAAM,WAAYA,aAAaC;AAWtC,OAAO,cAAM,iBAAkBC,IAAI,mBAAiB,SAAS",
3
+ "names": [
4
+ "key: string",
5
+ "fallback?: string",
6
+ "e?: MediaQueryList"
7
+ ],
8
+ "sources": [
9
+ "src/helpers.tsx"
10
+ ],
11
+ "sourcesContent": [
12
+ "import { MEDIA } from './constants'\n\nexport const helpers = {}\n// Helpers\n\nexport const getTheme = (key: string, fallback?: string): any => {\n if (typeof window === 'undefined') return undefined\n let theme\n try {\n theme = localStorage.getItem(key) || undefined\n } catch (e) {\n // Unsupported\n }\n return theme || fallback\n}\n\nexport const getSystemTheme = (e?: MediaQueryList): 'dark' | 'light' => {\n if (!e) {\n e = window.matchMedia(MEDIA)\n }\n\n const isDark = e.matches\n const systemTheme = isDark ? 'dark' : 'light'\n return systemTheme\n}\n"
13
+ ],
14
+ "version": 3
15
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./NextTheme";
2
+ export * from "./types";
3
+
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,cAAc;AACd,cAAc",
3
+ "names": [],
4
+ "sources": [
5
+ "src/index.ts"
6
+ ],
7
+ "sourcesContent": [
8
+ "export * from './NextTheme'\nexport * from './types'\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,6 @@
1
+ export type ColorScheme = "dark" | "light";
2
+ export interface ValueObject {
3
+ [themeName: string]: string;
4
+ }
5
+
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,YAAY,cAAc,SAAS;AAEnC,iBAAiB,YAAY;;AAE5B",
3
+ "names": [],
4
+ "sources": [
5
+ "src/types.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "export type ColorScheme = 'dark' | 'light'\n\nexport interface ValueObject {\n [themeName: string]: string\n}\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import type { ColorScheme } from "./types";
3
+ export declare const useRootTheme: ({ fallback }?: {
4
+ fallback?: ColorScheme;
5
+ }) => [ColorScheme, React.Dispatch<React.SetStateAction<ColorScheme>>];
6
+
7
+ //# sourceMappingURL=useRootTheme.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAAA,OAAO,WAAW,OAAO;AAGzB,cAAc,mBAAmB,SAAS;AAE1C,OAAO,cAAM,eAAgB,EAC3B,UAC2B,GAA1B;CAAE,WAAW;AAAa,OAC3B,aACA,MAAM,SAAS,MAAM,eAAe",
3
+ "names": [],
4
+ "sources": [
5
+ "src/useRootTheme.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "import React from 'react'\nimport { isClient } from '@tamagui/constants'\n\nimport type { ColorScheme } from './types'\n\nexport const useRootTheme = ({\n fallback = 'light',\n}: { fallback?: ColorScheme } = {}): [\n ColorScheme,\n React.Dispatch<React.SetStateAction<ColorScheme>>,\n] => {\n let initialVal = fallback\n\n if (isClient) {\n // @ts-ignore\n const classes = [...document.documentElement.classList]\n initialVal = classes.includes(`t_dark`)\n ? 'dark'\n : classes.includes(`t_light`)\n ? 'light'\n : fallback\n }\n\n return React.useState<ColorScheme>(initialVal)\n}\n"
9
+ ],
10
+ "version": 3
11
+ }
@@ -0,0 +1,8 @@
1
+ import type { UseThemeProps } from "./UseThemeProps";
2
+ /**
3
+ * @deprecated renamed to `useThemeSetting` to avoid confusion with core `useTheme` hook
4
+ */
5
+ export declare const useTheme: () => UseThemeProps;
6
+ export declare const useThemeSetting: () => UseThemeProps;
7
+
8
+ //# sourceMappingURL=useTheme.d.ts.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "mappings": "AAGA,cAAc,qBAAqB,iBAAiB;;;;AAMpD,OAAO,cAAM,gBAAe;AAE5B,OAAO,cAAM,uBAAsB",
3
+ "names": [],
4
+ "sources": [
5
+ "src/useTheme.tsx"
6
+ ],
7
+ "sourcesContent": [
8
+ "import React from 'react'\n\nimport { ThemeSettingContext } from './ThemeSettingContext'\nimport type { UseThemeProps } from './UseThemeProps'\n\n/**\n * @deprecated renamed to `useThemeSetting` to avoid confusion with core `useTheme` hook\n */\n\nexport const useTheme = (): UseThemeProps => React.useContext(ThemeSettingContext)\n\nexport const useThemeSetting = (): UseThemeProps => React.useContext(ThemeSettingContext)\n"
9
+ ],
10
+ "version": 3
11
+ }