This repository has been archived by the owner on Jul 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
617555f
commit eed06a0
Showing
3 changed files
with
56 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import styled, { StyledComponent } from 'styled-components'; | ||
import { Variant } from 'lib/types'; | ||
|
||
const map = (properties: Variant) => ({ | ||
'data-variant': properties.variant || 'default', | ||
}); | ||
|
||
export const Separator = styled.div.attrs(map)` | ||
--local-margin-tb: 3px; | ||
width: 100%; | ||
border-top: var(--woly-border-width) solid var(--woly-canvas-disabled); | ||
margin: calc(var(--local-margin-tb) - (var(--woly-border-width) / 2)) 0; | ||
` as StyledComponent<'div', Record<string, unknown>, Variant>; |
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,41 @@ | ||
--- | ||
name: separator | ||
category: atoms | ||
package: 'woly' | ||
--- | ||
|
||
import { Playground, block } from 'box-styles' | ||
import { Heading, Input, Separator } from 'ui' | ||
|
||
`Sepatator` is a line that divides blocks or content. | ||
|
||
### Example | ||
|
||
<Playground direction="vertical"> | ||
<div style={{ width: '300px' }}> | ||
<div style={{ margin: '18px 0' }}> | ||
<Heading size={2}>User List</Heading> | ||
</div> | ||
<Separator variant="primary" /> | ||
<Input | ||
type="text" | ||
name="name" | ||
placeholder="Search" | ||
onChange={() => console.info('On input change')} | ||
variant="primary" | ||
style={{ margin: '10px 0' }} | ||
/> | ||
</div> | ||
</Playground> | ||
|
||
### Kinds | ||
|
||
| Name | Description | | ||
| ----------- | -------------- | | ||
| `Separator` | Base separator | | ||
|
||
### Props | ||
|
||
| Name | Type | Default | Description | | ||
| --------- | -------- | ----------- | ----------------------------------------- | | ||
| `variant` | `string` | `'default'` | Variant prop to style Separator component | |