@hig/theme-context
Advanced tools
Comparing version 1.0.1 to 2.0.0
import createReactContext from 'create-react-context'; | ||
import defaultTheme from '@hig/theme-data/build/json/lightGrayMediumDensityTheme/theme.json'; | ||
import defaultTheme from '@hig/theme-data/build/json/webLightMediumDensityTheme/theme.json'; | ||
import React, { Component } from 'react'; | ||
@@ -58,4 +58,3 @@ import PropTypes from 'prop-types'; | ||
null, | ||
function (value) { | ||
var theme = value.resolvedRoles ? value : defaultTheme; | ||
function (theme) { | ||
var isDebugging = process.env.NODE_ENV !== "production"; | ||
@@ -62,0 +61,0 @@ var result = isDebugging ? createThemeProxy(theme) : theme; |
@@ -8,3 +8,3 @@ 'use strict'; | ||
var createReactContext = _interopDefault(require('create-react-context')); | ||
var defaultTheme = _interopDefault(require('@hig/theme-data/build/json/lightGrayMediumDensityTheme/theme.json')); | ||
var defaultTheme = _interopDefault(require('@hig/theme-data/build/json/webLightMediumDensityTheme/theme.json')); | ||
var React = require('react'); | ||
@@ -66,4 +66,3 @@ var React__default = _interopDefault(React); | ||
null, | ||
function (value) { | ||
var theme = value.resolvedRoles ? value : defaultTheme; | ||
function (theme) { | ||
var isDebugging = process.env.NODE_ENV !== "production"; | ||
@@ -70,0 +69,0 @@ var result = isDebugging ? createThemeProxy(theme) : theme; |
@@ -0,1 +1,27 @@ | ||
# [@hig/theme-context-v2.0.0](https://github.com/Autodesk/hig/compare/@hig/theme-context@1.0.1...@hig/theme-context@2.0.0) (2019-01-17) | ||
### Bug Fixes | ||
* change default theme LightGray -> WebLight ([7d50a68](https://github.com/Autodesk/hig/commit/7d50a68)) | ||
### BREAKING CHANGES | ||
* If you would like to continue using the HIG Light Gray theme now that | ||
it's no longer the default, you will need to specify that theme when you | ||
initialize the `ThemeContext.Provider`. For instance | ||
``` | ||
import HIGLightTheme from "@hig/theme-data/build/json/lightGrayMediumDensityTheme/theme.json"; | ||
// ... | ||
<ThemeContext.Provider value={HIGLightTheme}> | ||
<ThemeContext.Consumer> | ||
// ... | ||
</ThemeContext.Consumer> | ||
</ThemeContext.Provider> | ||
``` | ||
# [@hig/theme-context-v1.0.1](https://github.com/Autodesk/hig/compare/@hig/theme-context@1.0.0...@hig/theme-context@1.0.1) (2018-11-27) | ||
@@ -2,0 +28,0 @@ |
{ | ||
"name": "@hig/theme-context", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "ThemeContext components to ease adoption of theme data from React components", | ||
@@ -21,3 +21,3 @@ "author": "Autodesk Inc.", | ||
"dependencies": { | ||
"@hig/theme-data": "^1.1.0", | ||
"@hig/theme-data": "^1.5.0", | ||
"create-react-context": "^0.2.3", | ||
@@ -24,0 +24,0 @@ "prop-types": "^15.6.1" |
@@ -28,3 +28,3 @@ # ThemeContext component | ||
function MyThemedComponent() { | ||
<ThemeContext.Consumer>{({ resolvedRoles, name }) => ( | ||
<ThemeContext.Consumer>{({ resolvedRoles, metadata }) => ( | ||
<div style={{ | ||
@@ -36,3 +36,3 @@ backgroundColor: resolvedRoles["colorScheme.surfaceLevel200Color"], | ||
}}> | ||
The current theme is "{name}". | ||
The current theme is "${metadata.name}". | ||
</div> | ||
@@ -39,0 +39,0 @@ )}</ThemeContext.Consumer> |
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
13567
152
Updated@hig/theme-data@^1.5.0