-
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
Showing
24 changed files
with
552 additions
and
176 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { positionRelativeGet } from './position-relative'; | ||
export { keyboardEventHandle } from './keyboard-event'; | ||
export { keyHandlerGet } from './select-handlers'; | ||
export { Variant } from './types'; |
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,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 | |
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,48 @@ | ||
import styled from 'styled-components'; | ||
import { Variant } from 'lib/types'; | ||
|
||
const map = (properties: { columns: number } & Variant) => ({ | ||
'data-variant': properties.variant || 'default', | ||
style: { '--local-columns': properties.columns }, | ||
}); | ||
|
||
export const Table = styled.table.attrs(map)` | ||
--local-vertical: calc(1px * var(--woly-component-level) * var(--woly-main-level)); | ||
--local-horizontal: calc( | ||
var(--woly-const-m) + (1px * var(--woly-main-level)) + var(--local-vertical) | ||
); | ||
--local-cell-max-width: 240px; | ||
--local-gap: calc(var(--woly-const-m) / 2); | ||
display: grid; | ||
gap: var(--local-gap); | ||
grid-template-columns: repeat(var(--local-columns), auto); | ||
`; | ||
|
||
export const Thead = styled.thead` | ||
display: contents; | ||
`; | ||
|
||
export const Tbody = styled.tbody` | ||
display: contents; | ||
`; | ||
|
||
export const Th = styled.th` | ||
padding: var(--local-vertical) var(--local-horizontal); | ||
max-width: var(--local-cell-max-width); | ||
box-sizing: border-box; | ||
background: var(--woly-shape-text-default); | ||
color: var(--woly-canvas-text-disabled); | ||
`; | ||
|
||
export const Td = styled.td` | ||
padding: var(--local-vertical) var(--local-horizontal); | ||
max-width: var(--local-cell-max-width); | ||
box-sizing: border-box; | ||
background: var(--woly-shape-text-default); | ||
color: var(--woly-canvas-text-default); | ||
`; | ||
|
||
export const Tr = styled.tr` | ||
display: contents; | ||
`; |
Oops, something went wrong.