-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: initial * chore: storybook config * chore: changeset * chore: improvements * refactor: cleanup * refactor: use new tokens * feat: leftovers * feat: further colors * feat: further colors * refactor: design tokens cleanup * chore: minor not patch * chore: minor not patch again --------- Co-authored-by: Carlos Cortizas <[email protected]>
- Loading branch information
1 parent
db371ba
commit 568c28e
Showing
10 changed files
with
236 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'visual-testing-app': minor | ||
'@commercetools-uikit/design-system': minor | ||
--- | ||
|
||
Restore theming support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import intlContext from './intl-context'; | ||
import themeContext from './theme-context'; | ||
|
||
export const contexts = [intlContext]; | ||
export const contexts = [intlContext, themeContext]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import PropTypes from 'prop-types'; | ||
import { ThemeProvider } from '../../../design-system'; | ||
|
||
const ThemeWrapper = (props) => { | ||
return ( | ||
<> | ||
<ThemeProvider | ||
theme={props.themeName} | ||
themeOverrides={props.themeOverrides} | ||
/> | ||
{props.children} | ||
</> | ||
); | ||
}; | ||
|
||
ThemeWrapper.propTypes = { | ||
theme: PropTypes.any, | ||
}; | ||
|
||
const themeParams = [ | ||
{ | ||
name: 'Default Theme', | ||
props: { themeName: 'default' }, | ||
}, | ||
{ | ||
name: 'Custom Theme', | ||
props: { themeName: 'recolouring' }, | ||
}, | ||
]; | ||
|
||
const themeContext = { | ||
icon: 'box', // a icon displayed in the Storybook toolbar to control contextual props | ||
title: 'Themes', // an unique name of a contextual environment | ||
components: [ThemeWrapper], | ||
params: themeParams, | ||
options: { | ||
deep: true, // pass the `props` deeply into all wrapping components | ||
disable: false, // disable this contextual environment completely | ||
cancelable: false, // allow this contextual environment to be opt-out optionally in toolbar | ||
}, | ||
}; | ||
|
||
export default themeContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters