-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new
elevation
tokens (#1178)
- Loading branch information
1 parent
d61e202
commit 16d0e9e
Showing
117 changed files
with
3,193 additions
and
822 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,5 @@ | ||
--- | ||
"@razorpay/blade": minor | ||
--- | ||
|
||
feat: add new `elevation` tokens |
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
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { Meta, DocsContainer } from '@storybook/addon-docs'; | ||
import { useTheme, BladeProvider } from '../../src/components'; | ||
import { paymentTheme, bankingTheme } from '../../src/tokens'; | ||
|
||
<Meta | ||
title="Tokens/Elevation" | ||
parameters={{ | ||
docs: { | ||
container: ({ children, context }) => { | ||
const getThemeTokens = () => { | ||
if (context.globals.themeTokenName === 'paymentTheme') { | ||
return paymentTheme; | ||
} | ||
if (context.globals.themeTokenName === 'bankingTheme') { | ||
return bankingTheme; | ||
} | ||
return null; | ||
}; | ||
return ( | ||
<DocsContainer context={context}> | ||
<BladeProvider | ||
key={`${context.globals.themeTokenName}-${context.globals.colorScheme}`} | ||
themeTokens={getThemeTokens()} | ||
colorScheme={context.globals.colorScheme} | ||
> | ||
{children} | ||
</BladeProvider> | ||
</DocsContainer> | ||
); | ||
}, | ||
}, | ||
}} | ||
/> | ||
|
||
# 🪞 Elevation | ||
|
||
export const Border = () => { | ||
const { theme } = useTheme(); | ||
console.log(theme.colors.surface.text); | ||
return ( | ||
<table> | ||
<tbody> | ||
{Object.entries(theme.elevation).map(([key, value]) => ( | ||
<tr | ||
key={key} | ||
style={{ | ||
backgroundColor: theme.colors.surface.background.level1.lowContrast, | ||
}} | ||
> | ||
<td | ||
style={{ color: theme.colors.surface.text.normal.lowContrast }} | ||
>{`theme.elevation.${key}`}</td> | ||
<td style={{ padding: '20px' }}> | ||
<div | ||
style={{ | ||
width: '100px', | ||
height: '100px', | ||
backgroundColor: '#fff', | ||
borderRadius: '8px', | ||
boxShadow: `${value}`, | ||
}} | ||
/> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
); | ||
}; | ||
|
||
<Border /> |
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,3 @@ | ||
const babelOptions = require('./.babelrc.js'); | ||
const babelOptions = require('./.babelrc'); | ||
|
||
module.exports = require('babel-jest').createTransformer(babelOptions); |
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
2 changes: 1 addition & 1 deletion
2
packages/blade/src/components/ActionList/ActionListItemAsset.native.tsx
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
2 changes: 1 addition & 1 deletion
2
packages/blade/src/components/ActionList/ActionListItemAsset.web.tsx
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
Oops, something went wrong.