smbls 0.6.24 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/package.json +24 -36
- package/src/Banner/index.js +24 -0
- package/src/Banner/style.js +27 -0
- package/src/Block/index.js +95 -0
- package/src/Block/style.js +1 -0
- package/src/Box/index.js +10 -0
- package/src/Button/index.js +54 -0
- package/src/Button/style.js +13 -0
- package/src/ButtonSet/index.js +14 -0
- package/src/DatePicker/index.js +115 -0
- package/src/DatePicker/style.js +100 -0
- package/src/Direction/index.js +10 -0
- package/src/Dropdown/index.js +42 -0
- package/src/Dropdown/style.js +37 -0
- package/src/Field/index.js +21 -0
- package/src/Field/style.js +30 -0
- package/src/Flex/index.js +20 -0
- package/src/Flex/style.js +5 -0
- package/src/Grid/index.js +18 -0
- package/src/Grid/style.js +5 -0
- package/src/GridLayouts/index.js +20 -0
- package/src/GridLayouts/style.js +47 -0
- package/src/Icon/index.js +14 -0
- package/src/Icon/style.js +8 -0
- package/src/IconText/index.js +18 -0
- package/src/IconText/style.js +12 -0
- package/src/Img/index.js +17 -0
- package/src/Input/index.js +32 -0
- package/src/Label/index.js +20 -0
- package/src/Link/index.js +19 -0
- package/src/Notification/index.js +37 -0
- package/src/Overflow/index.js +7 -0
- package/src/Pills/index.js +30 -0
- package/src/Position/index.js +21 -0
- package/src/Responsive/index.js +48 -0
- package/src/SVG/index.js +14 -0
- package/src/Select/index.js +24 -0
- package/src/Select/style.js +8 -0
- package/src/Shape/index.js +66 -0
- package/src/Shape/style.js +102 -0
- package/src/SideBar/index.js +22 -0
- package/src/Slider/index.js +89 -0
- package/src/Slider/style.js +19 -0
- package/src/Text/index.js +18 -0
- package/src/Text/style.js +2 -0
- package/src/Tooltip/index.js +13 -0
- package/src/Tooltip/style.js +12 -0
- package/src/Transform/index.js +9 -0
- package/src/User/index.js +25 -0
- package/src/User/style.js +19 -0
- package/src/index.js +39 -0
- package/src/styles.js +7 -0
- package/index.js +0 -35
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { TYPOGRAPHY } from '@symbo.ls/scratch'
|
|
4
|
+
|
|
5
|
+
const primaryFont = Object.keys(TYPOGRAPHY)[0]
|
|
6
|
+
const defaultFont = primaryFont || '--system-default'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
appearance: 'none',
|
|
10
|
+
outline: 0,
|
|
11
|
+
border: 'none',
|
|
12
|
+
cursor: 'pointer',
|
|
13
|
+
fontFamily: 'inherit',
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
position: 'relative',
|
|
16
|
+
padding: 0,
|
|
17
|
+
|
|
18
|
+
width: '16em',
|
|
19
|
+
|
|
20
|
+
input: {
|
|
21
|
+
width: '100%',
|
|
22
|
+
height: '100%',
|
|
23
|
+
border: 'none'
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
svg: {
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
right: '1em'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import style from './style'
|
|
4
|
+
import { mapBasedOnRatio } from '../Block'
|
|
5
|
+
|
|
6
|
+
export const Flex = {
|
|
7
|
+
style,
|
|
8
|
+
|
|
9
|
+
props: {
|
|
10
|
+
flow: 'row'
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
class: {
|
|
14
|
+
flow: ({ props }) => ({ flexFlow: props.flow }),
|
|
15
|
+
flexDirection: ({ props }) => ({ flexDirection: props.flexDirection }),
|
|
16
|
+
alignItems: ({ props }) => ({ alignItems: props.alignItems }),
|
|
17
|
+
justifyContent: ({ props }) => ({ justifyContent: props.justifyContent }),
|
|
18
|
+
gap: ({ props }) => mapBasedOnRatio(props, 'gap')
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import style from './style'
|
|
4
|
+
import { mapBasedOnRatio } from '../Block'
|
|
5
|
+
|
|
6
|
+
export const Grid = {
|
|
7
|
+
style,
|
|
8
|
+
|
|
9
|
+
props: {},
|
|
10
|
+
|
|
11
|
+
class: {
|
|
12
|
+
columns: ({ props }) => ({ gridTemplateColumns: props.columns }),
|
|
13
|
+
rows: ({ props }) => ({ gridTemplateRows: props.rows }),
|
|
14
|
+
gap: ({ props }) => mapBasedOnRatio(props, 'gap'),
|
|
15
|
+
columnGap: ({ props }) => mapBasedOnRatio(props, 'columnGap'),
|
|
16
|
+
rowGap: ({ props }) => mapBasedOnRatio(props, 'rowGap')
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Button, Link } from '..'
|
|
4
|
+
|
|
5
|
+
import { styleGrid, styleGrid2 } from './style'
|
|
6
|
+
|
|
7
|
+
const componentLink = {
|
|
8
|
+
proto: Link,
|
|
9
|
+
attr: {
|
|
10
|
+
href: '#'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const grid = {
|
|
15
|
+
style: styleGrid
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const grid2 = {
|
|
19
|
+
style: styleGrid2
|
|
20
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export const styleGrid = {
|
|
4
|
+
display: 'grid',
|
|
5
|
+
gridTemplateColumns: 'repeat(15, 1fr)',
|
|
6
|
+
boxSizing: 'border-box',
|
|
7
|
+
padding: '0 8em',
|
|
8
|
+
marginBottom: '2em',
|
|
9
|
+
rowGap: '10px',
|
|
10
|
+
gridAutoColumns: 'auto',
|
|
11
|
+
gridAutoRows: 'auto',
|
|
12
|
+
gridAutoFlow: 'column',
|
|
13
|
+
'> a': {
|
|
14
|
+
padding: '70px 0',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
background: 'rgba(255, 255, 255, .05)',
|
|
18
|
+
borderRadius: '12px',
|
|
19
|
+
alignItems: 'center'
|
|
20
|
+
},
|
|
21
|
+
'> a:first-child': {
|
|
22
|
+
gridColumn: '1 / span 15'
|
|
23
|
+
},
|
|
24
|
+
'> a:nth-child(2)': {
|
|
25
|
+
gridRow: '2',
|
|
26
|
+
gridColumn: '1 / span 3',
|
|
27
|
+
marginRight: '10px'
|
|
28
|
+
},
|
|
29
|
+
'> a:nth-child(3)': {
|
|
30
|
+
gridRow: '2',
|
|
31
|
+
gridColumn: '4 / span 6',
|
|
32
|
+
marginRight: '10px'
|
|
33
|
+
},
|
|
34
|
+
'> a:nth-child(4)': {
|
|
35
|
+
gridRow: '2',
|
|
36
|
+
gridColumn: '10 / span 15'
|
|
37
|
+
},
|
|
38
|
+
'> a:nth-child(5)': {
|
|
39
|
+
gridRow: '3',
|
|
40
|
+
gridColumn: '1 / span 6',
|
|
41
|
+
marginRight: '10px'
|
|
42
|
+
},
|
|
43
|
+
'> a:nth-child(6)': {
|
|
44
|
+
gridRow: '3',
|
|
45
|
+
gridColumn: '7 / span 15'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import style from './style'
|
|
4
|
+
|
|
5
|
+
import { SVG } from '..'
|
|
6
|
+
|
|
7
|
+
export const Icon = {
|
|
8
|
+
proto: SVG,
|
|
9
|
+
style,
|
|
10
|
+
define: { name: param => param },
|
|
11
|
+
name: ({ props }) => props.icon,
|
|
12
|
+
attr: { viewBox: '0 0 24 24' },
|
|
13
|
+
src: ({ key, name }) => name || key || 'noIcon'
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import style from './style'
|
|
4
|
+
|
|
5
|
+
import { Icon, Text, Direction, Block } from '../'
|
|
6
|
+
import { } from '../Flex'
|
|
7
|
+
|
|
8
|
+
export const IconText = {
|
|
9
|
+
style,
|
|
10
|
+
|
|
11
|
+
props: {
|
|
12
|
+
flexAlign: 'center flex-start'
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
icon: { proto: Icon, if: ({ parent }) => parent.props.icon, props: ({ parent }) => ({ icon: parent.props.icon }) },
|
|
16
|
+
|
|
17
|
+
text: ({ props }) => props.text
|
|
18
|
+
}
|
package/src/Img/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Box } from '..'
|
|
4
|
+
|
|
5
|
+
export const Input = {
|
|
6
|
+
proto: Box,
|
|
7
|
+
tag: 'input',
|
|
8
|
+
|
|
9
|
+
props: {
|
|
10
|
+
type: 'input',
|
|
11
|
+
// value: s[el.key],
|
|
12
|
+
// placeholder: '',
|
|
13
|
+
round: 'C',
|
|
14
|
+
padding: 'A B',
|
|
15
|
+
theme: 'transparent'
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
attr: {
|
|
19
|
+
placeholder: ({ props }) => props.placeholder,
|
|
20
|
+
value: ({ props }) => props.value,
|
|
21
|
+
disabled: ({ props }) => props.disabled || null,
|
|
22
|
+
readonly: ({ props }) => props.readonly,
|
|
23
|
+
required: ({ props }) => props.required,
|
|
24
|
+
type: ({ props }) => props.type
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
on: {
|
|
28
|
+
input: ({ key, value, props }) => {
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import { Block } from '../Block'
|
|
3
|
+
import { Shape } from '../Shape'
|
|
4
|
+
import { Text } from '../Text'
|
|
5
|
+
|
|
6
|
+
export const Label = {
|
|
7
|
+
proto: [Shape, Block, Text],
|
|
8
|
+
|
|
9
|
+
style: { lineHeight: 1 },
|
|
10
|
+
|
|
11
|
+
props: {
|
|
12
|
+
emoji: '👍',
|
|
13
|
+
text: '3',
|
|
14
|
+
padding: 'X2 Z',
|
|
15
|
+
round: 'C',
|
|
16
|
+
depth: 16
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
emoji: ({ props }) => props.emoji
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Shape, Text } from '..'
|
|
4
|
+
|
|
5
|
+
export const Link = {
|
|
6
|
+
proto: [Shape, Text],
|
|
7
|
+
tag: 'a',
|
|
8
|
+
props: {
|
|
9
|
+
href: '',
|
|
10
|
+
target: '',
|
|
11
|
+
theme: 'link',
|
|
12
|
+
aria: {}
|
|
13
|
+
},
|
|
14
|
+
attr: {
|
|
15
|
+
href: ({ props }) => props.href,
|
|
16
|
+
target: ({ props }) => props.target,
|
|
17
|
+
'aria-label': ({ props }) => props.aria.label || props.text
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Shape, Block, IconText, Direction, Flex, Text } from '../'
|
|
4
|
+
|
|
5
|
+
export const Notification = {
|
|
6
|
+
style: { cursor: 'pointer' },
|
|
7
|
+
proto: [Shape, Block, Direction, Flex],
|
|
8
|
+
icon: {
|
|
9
|
+
proto: [IconText],
|
|
10
|
+
props: {
|
|
11
|
+
icon: 'info'
|
|
12
|
+
},
|
|
13
|
+
style: {
|
|
14
|
+
width: 'fit-content',
|
|
15
|
+
height: 'fit-content'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
article: {
|
|
19
|
+
proto: [Flex],
|
|
20
|
+
style: {
|
|
21
|
+
flexDirection: 'column',
|
|
22
|
+
alignItems: 'flex-start'
|
|
23
|
+
},
|
|
24
|
+
caption: {
|
|
25
|
+
proto: Text,
|
|
26
|
+
text: 'Notification'
|
|
27
|
+
},
|
|
28
|
+
p: {
|
|
29
|
+
proto: Text,
|
|
30
|
+
props: {
|
|
31
|
+
fontSize: 'Z',
|
|
32
|
+
text: 'is not always a distraction'
|
|
33
|
+
},
|
|
34
|
+
style: { margin: 0 }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import Shape from '../Shape'
|
|
3
|
+
|
|
4
|
+
export const Pills = {
|
|
5
|
+
style: {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
div: {
|
|
8
|
+
width: '6px',
|
|
9
|
+
height: '6px',
|
|
10
|
+
background: 'white'
|
|
11
|
+
},
|
|
12
|
+
'div:not(:last-child)': {
|
|
13
|
+
marginRight: '10px'
|
|
14
|
+
},
|
|
15
|
+
'div:first-child': { opacity: '.5' },
|
|
16
|
+
'div:nth-child(2)': { opacity: '.3' },
|
|
17
|
+
'div:nth-child(3)': { opacity: '.3' }
|
|
18
|
+
},
|
|
19
|
+
childProto: {
|
|
20
|
+
tag: 'div',
|
|
21
|
+
proto: Shape,
|
|
22
|
+
props: {
|
|
23
|
+
round: 42,
|
|
24
|
+
theme: 'White'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
...[
|
|
28
|
+
{}, {}, {}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { mapSpacing } from '@symbo.ls/scratch'
|
|
4
|
+
|
|
5
|
+
export const Position = {
|
|
6
|
+
props: {},
|
|
7
|
+
|
|
8
|
+
class: {
|
|
9
|
+
position: ({ props }) => props.position && ({ position: props.position }),
|
|
10
|
+
inset: ({ props }) => {
|
|
11
|
+
const { inset } = props
|
|
12
|
+
if (typeof inset !== 'string') return
|
|
13
|
+
return { inset: inset.split(' ').map(v => mapSpacing(v,'k').k).join(' ') }
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
left: ({ props }) => mapSpacing(props.left, 'left'),
|
|
17
|
+
top: ({ props }) => mapSpacing(props.top, 'top'),
|
|
18
|
+
right: ({ props }) => mapSpacing(props.right, 'right'),
|
|
19
|
+
bottom: ({ props }) => mapSpacing(props.bottom, 'bottom')
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { RESPONSIVE } from '@symbo.ls/scratch'
|
|
4
|
+
|
|
5
|
+
export const Responsive = {
|
|
6
|
+
on: {
|
|
7
|
+
init: (el, s) => {
|
|
8
|
+
const { props } = el
|
|
9
|
+
|
|
10
|
+
// Object.keys(props)
|
|
11
|
+
// .filter(v => v.slice(0, 1) === '@')
|
|
12
|
+
// .map()
|
|
13
|
+
|
|
14
|
+
for (const screen in props) {
|
|
15
|
+
if (screen.slice(0, 1) === '@') {
|
|
16
|
+
const screenName = screen.slice(1)
|
|
17
|
+
const responsiveKey = `@media screen and ${RESPONSIVE[screenName]}`
|
|
18
|
+
const screenProps = props[screen]
|
|
19
|
+
const calculatedScreenProps = {}
|
|
20
|
+
|
|
21
|
+
for (const prop in screenProps) {
|
|
22
|
+
// if (!el.class || !el.class[prop]) return
|
|
23
|
+
// const classProp = el.class[prop]
|
|
24
|
+
const classProp = el.class[prop]
|
|
25
|
+
if (typeof classProp !== 'function') continue
|
|
26
|
+
let calculatedProp = classProp({ props: screenProps })
|
|
27
|
+
|
|
28
|
+
if (Array.isArray(calculatedProp)) {
|
|
29
|
+
calculatedProp = Object.assign({}, ...calculatedProp)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
for (const finalProp in calculatedProp) {
|
|
33
|
+
calculatedScreenProps[finalProp] = calculatedProp[finalProp]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const { responsive } = el.class
|
|
38
|
+
if (responsive) responsive[responsiveKey] = calculatedScreenProps
|
|
39
|
+
else {
|
|
40
|
+
el.class.responsive = {
|
|
41
|
+
[responsiveKey]: calculatedScreenProps
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/SVG/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
var useSVGSymbol = file => `<use xlink:href="${file}" />`
|
|
4
|
+
|
|
5
|
+
// create icon
|
|
6
|
+
export const SVG = {
|
|
7
|
+
tag: 'svg',
|
|
8
|
+
attr: {
|
|
9
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
10
|
+
'xmlns:xlink': 'http://www.w3.org/1999/xlink'
|
|
11
|
+
},
|
|
12
|
+
define: { src: param => param },
|
|
13
|
+
html: ({ key, src, props }) => useSVGSymbol(props.src || src || key)
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import Shape from '../Shape'
|
|
4
|
+
import style from './style'
|
|
5
|
+
|
|
6
|
+
export const Select = {
|
|
7
|
+
proto: Shape,
|
|
8
|
+
tag: 'select',
|
|
9
|
+
style,
|
|
10
|
+
|
|
11
|
+
childProto: {
|
|
12
|
+
tag: 'option',
|
|
13
|
+
props: {
|
|
14
|
+
value: '',
|
|
15
|
+
selected: '',
|
|
16
|
+
disabled: ''
|
|
17
|
+
},
|
|
18
|
+
attr: {
|
|
19
|
+
value: ({ props }) => props.value,
|
|
20
|
+
selected: ({ props }) => props.selected,
|
|
21
|
+
disabled: ({ props }) => props.disabled
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { mapSpacing, getTheme, getColor } from '@symbo.ls/scratch'
|
|
4
|
+
|
|
5
|
+
import style, { shape, depth } from './style'
|
|
6
|
+
|
|
7
|
+
const isBorderStyle = str =>
|
|
8
|
+
['none','hidden','dotted','dashed','solid','double','groove','ridge','inset','outset','initial'].some(v => str.includes(v))
|
|
9
|
+
|
|
10
|
+
const diffBorder = (border, key = 'border') => {
|
|
11
|
+
const obj = {}
|
|
12
|
+
const arr = border.split(' ')
|
|
13
|
+
arr.map(v => {
|
|
14
|
+
if (v.includes('px')) obj[`${key}Width`] = v
|
|
15
|
+
else if (isBorderStyle(v)) obj[`${key}Style`] = v || 'solid'
|
|
16
|
+
else if (getColor(v)) obj[`${key}Color`] = getColor(v)
|
|
17
|
+
})
|
|
18
|
+
return obj
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Shape = {
|
|
22
|
+
class: {
|
|
23
|
+
default: style,
|
|
24
|
+
shape: ({ props }) => props.shape ? shape[props.shape] : null,
|
|
25
|
+
shapeDirection: ({ props }) => props.shape ? shape[props.shape][props.shapeDirection || 'top'] : null,
|
|
26
|
+
shapeDirectionColor: ({ props, ...el }) => props.shapeDirection ? { '&:before': { borderColor: el.class.backgroundColor } } : null,
|
|
27
|
+
depth: ({ props }) => depth[props.depth],
|
|
28
|
+
round: ({ props, key, ...el }) => props.round ? (mapSpacing(props.round, 'borderRadius') || ({ borderRadius: props.round })) : null,
|
|
29
|
+
theme: ({ props }) => props.theme ? getTheme(props.theme) : null,
|
|
30
|
+
color: ({ props }) => props.color ? ({ color: getColor(props.color) }) : null,
|
|
31
|
+
background: ({ props }) => props.background ? ({ backgroundColor: getColor(props.background) }) : null,
|
|
32
|
+
// border: ({ props }) => props.border ? ({ borderColor: getColor(props.border) }) : null,
|
|
33
|
+
|
|
34
|
+
border: ({ props }) => props.border ? diffBorder(props.border) : null,
|
|
35
|
+
borderLeft: ({ props }) => props.borderLeft ? diffBorder(props.borderLeft, 'borderLeft') : null,
|
|
36
|
+
borderTop: ({ props }) => props.borderTop ? diffBorder(props.borderTop, 'borderTop') : null,
|
|
37
|
+
borderRight: ({ props }) => props.borderRight ? diffBorder(props.borderRight, 'borderRight') : null,
|
|
38
|
+
borderBottom: ({ props }) => props.borderBottom ? diffBorder(props.borderBottom, 'borderBottom') : null,
|
|
39
|
+
|
|
40
|
+
opacity: ({ props }) => props.opacity && ({ opacity: props.opacity }),
|
|
41
|
+
visibility: ({ props }) => props.visibility && ({ visibility: props.visibility })
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// mode: {
|
|
45
|
+
// dark: {
|
|
46
|
+
// theme: 'white'
|
|
47
|
+
// }
|
|
48
|
+
// }
|
|
49
|
+
|
|
50
|
+
// theme: {
|
|
51
|
+
// default: 'primary',
|
|
52
|
+
// dark: 'whiteish'
|
|
53
|
+
// }
|
|
54
|
+
|
|
55
|
+
// size: {
|
|
56
|
+
// default: 'auto',
|
|
57
|
+
// mobile: 'fit'
|
|
58
|
+
// }
|
|
59
|
+
|
|
60
|
+
// padding: {
|
|
61
|
+
// default: ratio.phi,
|
|
62
|
+
// mobile: ratio.perfect
|
|
63
|
+
// }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default Shape
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { UNIT } from '@symbo.ls/scratch'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
boxSizing: 'border-box'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const depth = {
|
|
10
|
+
4: { boxShadow: `rgba(0,0,0,.10) 0 2${UNIT.default} 4${UNIT.default}` },
|
|
11
|
+
6: { boxShadow: `rgba(0,0,0,.10) 0 3${UNIT.default} 6${UNIT.default}` },
|
|
12
|
+
10: { boxShadow: `rgba(0,0,0,.10) 0 4${UNIT.default} 10${UNIT.default}` },
|
|
13
|
+
16: { boxShadow: `rgba(0,0,0,.10) 0 8${UNIT.default} 16${UNIT.default}` },
|
|
14
|
+
26: { boxShadow: `rgba(0,0,0,.10) 0 14${UNIT.default} 26${UNIT.default}` },
|
|
15
|
+
42: { boxShadow: `rgba(0,0,0,.10) 0 20${UNIT.default} 42${UNIT.default}` }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const shape = {
|
|
19
|
+
rectangle: {},
|
|
20
|
+
circle: { borderRadius: '100%' },
|
|
21
|
+
bubble: {},
|
|
22
|
+
tooltip: {
|
|
23
|
+
position: 'relative',
|
|
24
|
+
'&:before': {
|
|
25
|
+
content: '""',
|
|
26
|
+
display: 'block',
|
|
27
|
+
width: '0px',
|
|
28
|
+
height: '0px',
|
|
29
|
+
border: '6px solid #343434',
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
borderRadius: '2px'
|
|
32
|
+
},
|
|
33
|
+
top: {
|
|
34
|
+
'&:before': {
|
|
35
|
+
top: '2px',
|
|
36
|
+
left: '50%',
|
|
37
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
right: {
|
|
41
|
+
'&:before': {
|
|
42
|
+
top: '50%',
|
|
43
|
+
right: '-10px',
|
|
44
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
bottom: {
|
|
48
|
+
'&:before': {
|
|
49
|
+
bottom: '-10px',
|
|
50
|
+
left: '50%',
|
|
51
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
left: {
|
|
55
|
+
'&:before': {
|
|
56
|
+
top: '50%',
|
|
57
|
+
left: '2px',
|
|
58
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
tag: {
|
|
63
|
+
position: 'relative',
|
|
64
|
+
'&:before': {
|
|
65
|
+
content: '""',
|
|
66
|
+
display: 'block',
|
|
67
|
+
width: '0',
|
|
68
|
+
height: '0',
|
|
69
|
+
border: '16px solid #343434',
|
|
70
|
+
borderRadius: '6px',
|
|
71
|
+
position: 'absolute'
|
|
72
|
+
},
|
|
73
|
+
top: {
|
|
74
|
+
'&:before': {
|
|
75
|
+
bottom: '100%',
|
|
76
|
+
left: '50%',
|
|
77
|
+
transform: 'translate(-50%, 60%) rotate(45deg)'
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
right: {
|
|
81
|
+
'&:before': {
|
|
82
|
+
top: '50%',
|
|
83
|
+
left: '100%',
|
|
84
|
+
transform: 'translate(-60%, -50%) rotate(45deg)'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
bottom: {
|
|
88
|
+
'&:before': {
|
|
89
|
+
top: '100%',
|
|
90
|
+
left: '50%',
|
|
91
|
+
transform: 'translate(-50%, -60%) rotate(45deg)'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
left: {
|
|
95
|
+
'&:before': {
|
|
96
|
+
top: '50%',
|
|
97
|
+
right: '100%',
|
|
98
|
+
transform: 'translate(60%, -50%) rotate(45deg)'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|