generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding CSS and JS token display in storybook (#594)
* feat: adding css and js token stories * fix: order of color and name in swatch * fix: improving comments and removing console.log * fix:setting default text color for shadows bug fix * refactor: refactoring get css variable function to work for both brand and theme tokens * chore: adjusting line breaks * fix: updating brand colors to latest updates
- Loading branch information
1 parent
9bb60a2
commit 34bb957
Showing
11 changed files
with
292 additions
and
15 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
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,23 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { ColorSwatch } from './ColorSwatch'; | ||
|
||
const meta: Meta<typeof ColorSwatch> = { | ||
title: 'Documentation Components/ColorSwatch', | ||
component: ColorSwatch, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof ColorSwatch>; | ||
|
||
export const Default: Story = { | ||
render: () => ( | ||
<ColorSwatch | ||
color="#007bff" | ||
borderColor="#ced4da" | ||
textBackgroundColor="#f8f9fa" | ||
textColor="#212529" | ||
name="Primary Default" | ||
/> | ||
), | ||
}; |
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
36 changes: 36 additions & 0 deletions
36
docs/components/ColorSwatchGroup/ColorSwatchGroup.stories.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { ColorSwatchGroup } from './ColorSwatchGroup'; | ||
|
||
const meta: Meta<typeof ColorSwatchGroup> = { | ||
title: 'Documentation Components/ColorSwatchGroup', | ||
component: ColorSwatchGroup, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof ColorSwatchGroup>; | ||
|
||
export const Default: Story = { | ||
render: () => ( | ||
<ColorSwatchGroup | ||
swatchData={{ | ||
white: { | ||
white000: { | ||
value: '#FFFFFF', | ||
description: '(HEX: #FFFFFF)', | ||
type: 'color', | ||
}, | ||
white010: { | ||
value: '#FCFCFC', | ||
description: '(HEX: #FCFCFC)', | ||
type: 'color', | ||
}, | ||
}, | ||
}} | ||
borderColor="#ced4da" | ||
textBackgroundColor="#f8f9fa" | ||
textColor="#212529" | ||
name="Color Swatch Group" | ||
/> | ||
), | ||
}; |
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
Oops, something went wrong.