@khanacademy/wonder-blocks-theming
Advanced tools
Comparing version 1.1.1 to 1.2.0
# @khanacademy/wonder-blocks-theming | ||
## 1.2.0 | ||
### Minor Changes | ||
- 3f854fe8: Export supported themes list, change WB components to use these new exports | ||
## 1.1.1 | ||
@@ -4,0 +10,0 @@ |
@@ -12,2 +12,2 @@ import * as React from "react"; | ||
*/ | ||
export default function withScopedTheme<T>(styleSheet: ThemedStylesFn<T>, themeContext: React.Context<T>): <Props extends WithThemeProps>(WrappedComponent: React.ComponentType<Props>) => (props: WithoutTheme<Props>) => JSX.Element; | ||
export default function withScopedTheme<T extends object>(styleSheet: ThemedStylesFn<T>, themeContext: React.Context<T>): <Props extends WithThemeProps>(WrappedComponent: React.ComponentType<Props>) => (props: WithoutTheme<Props>) => JSX.Element; |
@@ -12,3 +12,3 @@ import * as React from "react"; | ||
}; | ||
export default function useScopedTheme<T>(themeContext: React.Context<T>): ScopedTheme<T>; | ||
export default function useScopedTheme<T extends object>(themeContext: React.Context<T>): ScopedTheme<T>; | ||
export {}; |
@@ -10,2 +10,2 @@ import { StyleDeclaration } from "aphrodite"; | ||
*/ | ||
export default function useStyles<T>(styles: ThemedStylesFn<T>, theme: T): StyleDeclaration; | ||
export default function useStyles<T extends object>(styles: ThemedStylesFn<T>, theme: T): StyleDeclaration; |
@@ -6,4 +6,4 @@ export { default as tokens } from "./tokens"; | ||
export { default as withScopedTheme, type WithThemeProps, } from "./components/with-scoped-theme"; | ||
export { type ThemedStylesFn } from "./types"; | ||
export { type ThemedStylesFn, type SupportedThemes, type Themes } from "./types"; | ||
export { default as useStyles } from "./hooks/use-styles"; | ||
export { ThemeSwitcherContext } from "./utils/theme-switcher-context"; |
import { StyleDeclaration } from "aphrodite"; | ||
export type ThemedStylesFn<T> = (theme: T) => StyleDeclaration; | ||
export type ThemedStylesFn<T extends object> = (theme: T) => StyleDeclaration; | ||
export type SupportedThemes = "default" | "khanmigo"; | ||
export type Themes<T extends object> = Partial<Record<SupportedThemes, T>>; |
import * as React from "react"; | ||
import { SupportedThemes } from "../types"; | ||
/** | ||
@@ -10,2 +11,2 @@ * A React Context that holds a reference to the selected theme. It should use | ||
*/ | ||
export declare const ThemeSwitcherContext: React.Context<string>; | ||
export declare const ThemeSwitcherContext: React.Context<SupportedThemes>; |
{ | ||
"name": "@khanacademy/wonder-blocks-theming", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -15,3 +15,3 @@ import * as React from "react"; | ||
export default function useScopedTheme<T>( | ||
export default function useScopedTheme<T extends object>( | ||
themeContext: React.Context<T>, | ||
@@ -18,0 +18,0 @@ ): ScopedTheme<T> { |
@@ -13,3 +13,3 @@ import * as React from "react"; | ||
*/ | ||
export default function useStyles<T>( | ||
export default function useStyles<T extends object>( | ||
styles: ThemedStylesFn<T>, | ||
@@ -16,0 +16,0 @@ theme: T, |
@@ -10,4 +10,4 @@ export {default as tokens} from "./tokens"; | ||
} from "./components/with-scoped-theme"; | ||
export {type ThemedStylesFn} from "./types"; | ||
export {type ThemedStylesFn, type SupportedThemes, type Themes} from "./types"; | ||
export {default as useStyles} from "./hooks/use-styles"; | ||
export {ThemeSwitcherContext} from "./utils/theme-switcher-context"; |
import {StyleDeclaration} from "aphrodite"; | ||
export type ThemedStylesFn<T> = (theme: T) => StyleDeclaration; | ||
export type ThemedStylesFn<T extends object> = (theme: T) => StyleDeclaration; | ||
export type SupportedThemes = "default" | "khanmigo"; | ||
export type Themes<T extends object> = Partial<Record<SupportedThemes, T>>; |
import * as React from "react"; | ||
import {SupportedThemes} from "../types"; | ||
@@ -11,2 +12,3 @@ /** | ||
*/ | ||
export const ThemeSwitcherContext = React.createContext<string>("default"); | ||
export const ThemeSwitcherContext = | ||
React.createContext<SupportedThemes>("default"); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86307
974