-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Caleb Hoyoul Kang
authored
Jun 29, 2020
1 parent
d3f27c3
commit 2e10c64
Showing
6 changed files
with
190 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.base { | ||
height: 0; | ||
opacity: 0; | ||
position: relative; | ||
transition: height 0.2s ease-in-out, opacity 0.2s ease-in-out; | ||
|
||
.container { | ||
align-items: center; | ||
background-color: var(--theme-colors-monochrome-17); | ||
border: solid var(--theme-sizes-border-width) var(--theme-colors-monochrome-12); | ||
border-radius: var(--theme-sizes-border-radius); | ||
box-shadow: var(--theme-shadow); | ||
display: flex; | ||
height: 4.8rem; | ||
justify-content: space-between; | ||
padding: var(--theme-sizes-layout-medium); | ||
padding-right: var(--theme-sizes-layout-big); | ||
position: absolute; | ||
width: 100%; | ||
z-index: 2; | ||
} | ||
.container::before { | ||
background-color: var(--theme-colors-monochrome-17); | ||
border-color: var(--theme-colors-monochrome-12); | ||
border-style: solid; | ||
border-width: 0 var(--theme-sizes-border-width) var(--theme-sizes-border-width) 0; | ||
box-shadow: var(--theme-shadow); | ||
content: ''; | ||
display: block; | ||
height: 1.2rem; | ||
left: 3rem; | ||
position: absolute; | ||
top: 100%; | ||
transform: translate(-50%, -50%) rotate(45deg); | ||
width: 1.2rem; | ||
} | ||
.container::after { | ||
background-color: var(--theme-colors-monochrome-17); | ||
bottom: 0; | ||
content: ''; | ||
height: calc(var(--theme-sizes-layout-medium) - 1); | ||
left: 3rem; | ||
position: absolute; | ||
transform: translateX(-50%); | ||
width: 3rem; | ||
z-index: 1; | ||
} | ||
.actions { | ||
align-items: center; | ||
display: flex; | ||
} | ||
.actions > *:not(:last-child) { | ||
margin-right: var(--theme-sizes-layout-medium); | ||
} | ||
.message { | ||
font-size: var(--theme-sizes-font-medium); | ||
} | ||
&.show { | ||
height: 4rem; | ||
opacity: 1; | ||
} | ||
} |
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,19 @@ | ||
import { Button } from 'antd'; | ||
import React from 'react'; | ||
|
||
import TableBatch from './TableBatch'; | ||
|
||
export default { | ||
component: TableBatch, | ||
title: 'TableBatch', | ||
}; | ||
|
||
export const SampleTableBatch = (): React.ReactNode => { | ||
return ( | ||
<TableBatch message="Apply batch operations to multiple items."> | ||
<Button danger type="primary">Batch Operation 1</Button> | ||
<Button>Batch Operation 2</Button> | ||
<Button>Batch Operation 3</Button> | ||
</TableBatch> | ||
); | ||
}; |
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,33 @@ | ||
import React, { PropsWithChildren } from 'react'; | ||
|
||
import css from './TableBatch.module.scss'; | ||
|
||
interface Props { | ||
ids?: string[]; | ||
message: string; | ||
show?: boolean; | ||
} | ||
|
||
const defaultProps = { | ||
ids: [], | ||
show: true, | ||
}; | ||
|
||
const TableBatch: React.FC<Props> = (props: PropsWithChildren<Props>) => { | ||
const classes = [ css.base ]; | ||
|
||
if (props.show) classes.push(css.show); | ||
|
||
return ( | ||
<div className={classes.join(' ')}> | ||
<div className={css.container}> | ||
<div className={css.actions}>{props.children}</div> | ||
<div className={css.message}>{props.message}</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
TableBatch.defaultProps = defaultProps; | ||
|
||
export default TableBatch; |
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