/
position-positions-example.js
73 lines (66 loc) · 1.59 KB
/
position-positions-example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import React from 'react'
import core from '@pluralsight/ps-design-system-core'
import Button from '@pluralsight/ps-design-system-button'
import Tooltip from '@pluralsight/ps-design-system-tooltip/react.js'
import {
Above,
AboveLeft,
AboveRight,
BelowLeft,
BelowRight,
RightOf,
LeftOf
} from '@pluralsight/ps-design-system-position'
import { Head } from '../../src/ui/index.js'
const components = [
Above,
AboveLeft,
AboveRight,
BelowLeft,
BelowRight,
RightOf,
LeftOf
]
export default function PositionExample(props) {
return (
<ul className="positions">
<Head />
{Object.keys(components).map(key => {
const Position = components[key]
const name = `<${Position.displayName} />`
return (
<li className="position" key={key}>
<div className="box">
<Position show={<Tooltip>{name}</Tooltip>}>
<Button>Button</Button>
</Position>
</div>
</li>
)
})}
<style jsx>{`
.positions {
display: grid;
grid-template-columns: 1fr 1fr;
gap: ${core.layout.spacingLarge};
list-style: none;
margin: 0;
}
.position {
display: flex;
justify-content: center;
text-align: center;
}
.box {
height: 160px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background: ${core.colors.bone};
border-radius: 8px;
}
`}</style>
</ul>
)
}