-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
57 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { Meta, Story } from '@metamask/snaps-storybook'; | ||
|
||
import { Box } from './Box'; | ||
import { Divider } from './Divider'; | ||
import { Text } from './Text'; | ||
|
||
const meta: Meta<typeof Divider> = { | ||
title: 'Divider', | ||
component: Divider, | ||
}; | ||
|
||
export default meta; | ||
|
||
/** | ||
* The divider component renders a horizontal line between elements. | ||
*/ | ||
export const Default: Story = { | ||
render: () => <Divider />, | ||
}; | ||
|
||
/** | ||
* It can be used to separate sections of content. | ||
*/ | ||
export const WithText: Story = { | ||
render: () => ( | ||
<Box> | ||
<Text>Some text</Text> | ||
<Divider /> | ||
<Text>Some more text</Text> | ||
</Box> | ||
), | ||
}; |
7 changes: 7 additions & 0 deletions
7
packages/snaps-storybook/src/components/snaps/divider/Divider.styles.ts
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,7 @@ | ||
import { defineStyle, defineStyleConfig } from '@chakra-ui/react'; | ||
|
||
export const styles = defineStyleConfig({ | ||
baseStyle: defineStyle({ | ||
borderColor: 'border.default', | ||
}), | ||
}); |
12 changes: 12 additions & 0 deletions
12
packages/snaps-storybook/src/components/snaps/divider/Divider.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,12 @@ | ||
import { Divider as ChakraDivider } from '@chakra-ui/react'; | ||
import type { FunctionComponent } from 'react'; | ||
|
||
/** | ||
* A divider component, which is used to create a horizontal line between | ||
* elements. | ||
* | ||
* This component does not have any props. | ||
* | ||
* @returns A divider element. | ||
*/ | ||
export const Divider: FunctionComponent = () => <ChakraDivider />; |
2 changes: 2 additions & 0 deletions
2
packages/snaps-storybook/src/components/snaps/divider/index.ts
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,2 @@ | ||
export { Divider as Component } from './Divider'; | ||
export { styles } from './Divider.styles'; |
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