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
8b80e63
commit 91e663b
Showing
3 changed files
with
65 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,21 @@ | ||
import * as React from 'react'; | ||
import styled, { StyledComponent } from 'styled-components'; | ||
import { Variant } from 'lib/types'; | ||
|
||
const SeparatorBase: React.FC<{ className: string } & Variant> = ({ className, variant }) => ( | ||
<div className={className} data-variant={variant}> | ||
<div data-line></div> | ||
</div> | ||
); | ||
|
||
export const Separator = styled(SeparatorBase)` | ||
--local-padding: 3px; | ||
width: 100%; | ||
padding: calc(var(--local-padding) - (var(--woly-border-width) / 2)) 0; | ||
[data-line] { | ||
height: var(--woly-border-width); | ||
background: var(--woly-canvas-disabled); | ||
} | ||
` 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,43 @@ | ||
--- | ||
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" /> | ||
<div style={{ margin: '18px 0' }}> | ||
<Input | ||
type="text" | ||
name="name" | ||
placeholder="Search" | ||
onChange={() => console.info('On input change')} | ||
variant="primary" | ||
style={{ margin: '10px 0' }} | ||
/> | ||
</div> | ||
</div> | ||
</Playground> | ||
|
||
### Kinds | ||
|
||
| Name | Description | | ||
| ----------- | -------------- | | ||
| `Separator` | Base separator | | ||
|
||
### Props | ||
|
||
| Name | Type | Default | Description | | ||
| --------- | -------- | ----------- | ----------------------------------------- | | ||
| `variant` | `string` | `'default'` | Variant prop to style Separator component | |