smbls 0.8.6 → 0.8.9
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/package.json +1 -1
- package/src/Block/index.js +3 -0
- package/src/Box/index.js +2 -2
- package/src/Link/index.js +4 -2
- package/src/Responsive/index.js +4 -3
- package/src/Text/index.js +2 -1
- package/src/Transition/index.js +11 -0
- package/src/Transition/style.js +2 -0
- package/src/index.js +1 -0
package/package.json
CHANGED
package/src/Block/index.js
CHANGED
|
@@ -87,6 +87,9 @@ export const Block = {
|
|
|
87
87
|
},
|
|
88
88
|
flex: ({ props }) => props.flex && ({ flex: props.flex }),
|
|
89
89
|
|
|
90
|
+
gridColumn: ({ props }) => props.gridColumn && ({ gridColumn: props.gridColumn }),
|
|
91
|
+
gridRow: ({ props }) => props.gridRow && ({ gridRow: props.gridRow }),
|
|
92
|
+
|
|
90
93
|
size: ({ props }) => {
|
|
91
94
|
// if (typeof props.size !== 'string') return
|
|
92
95
|
// const [fontSize, padding, margin] = props.size.split(' ')
|
package/src/Box/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { Shape, Position, Block, Text, Responsive } from '..'
|
|
3
|
+
import { Shape, Position, Block, Text, Overflow, Transition, Transform, Responsive } from '..'
|
|
4
4
|
|
|
5
5
|
export const Box = {
|
|
6
|
-
proto: [Shape, Position, Block, Text, Responsive],
|
|
6
|
+
proto: [Shape, Position, Block, Text, Overflow, Transition, Transform, Responsive],
|
|
7
7
|
class: {
|
|
8
8
|
fromProps: ({ props }) => props && props.css
|
|
9
9
|
}
|
package/src/Link/index.js
CHANGED
|
@@ -10,10 +10,12 @@ export const Link = {
|
|
|
10
10
|
href: '',
|
|
11
11
|
target: '',
|
|
12
12
|
theme: 'link',
|
|
13
|
-
aria: {}
|
|
13
|
+
aria: {},
|
|
14
|
+
fontWeight: 'bold',
|
|
15
|
+
textDecoration: 'none'
|
|
14
16
|
},
|
|
15
17
|
attr: {
|
|
16
|
-
href: element => exec(element.props.href, element),
|
|
18
|
+
href: element => exec(element.props.href, element) || exec(element.props, element).href,
|
|
17
19
|
target: ({ props }) => props.target,
|
|
18
20
|
'aria-label': ({ props }) => props.aria.label || props.text
|
|
19
21
|
}
|
package/src/Responsive/index.js
CHANGED
|
@@ -41,15 +41,16 @@ export const Responsive = {
|
|
|
41
41
|
const selectorProps = {}
|
|
42
42
|
const selectorName = screen.slice(1)
|
|
43
43
|
const underSelectorProps = props[screen]
|
|
44
|
-
const selectorKey = `&${
|
|
44
|
+
const selectorKey = `&${screen}`
|
|
45
|
+
|
|
45
46
|
|
|
46
47
|
for (const prop in underSelectorProps) {
|
|
47
48
|
const classProp = el.class[prop]
|
|
48
49
|
if (typeof classProp !== 'function') continue
|
|
49
50
|
let calculatedProp = classProp({ props: underSelectorProps })
|
|
50
51
|
|
|
51
|
-
if (Array.isArray(
|
|
52
|
-
|
|
52
|
+
if (Array.isArray(calculatedProp)) {
|
|
53
|
+
calculatedProp = Object.assign({}, ...calculatedProp)
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
for (const finalProp in calculatedProp) {
|
package/src/Text/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { mapFontSize } from '@symbo.ls/scratch'
|
|
3
|
+
import { mapFontSize, getFontFamily, FONT_FAMILY } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
5
|
export const Text = {
|
|
6
6
|
props: {},
|
|
@@ -9,6 +9,7 @@ export const Text = {
|
|
|
9
9
|
|
|
10
10
|
class: {
|
|
11
11
|
fontSize: ({ props }) => props.fontSize ? mapFontSize(props.fontSize) : null,
|
|
12
|
+
fontFamily: ({ props }) => props.fontFamily && ({ fontFamily: getFontFamily(FONT_FAMILY, props.fontFamily) || props.fontFamily }),
|
|
12
13
|
lineHeight: ({ props }) => ({ lineHeight: props.lineHeight }),
|
|
13
14
|
textDecoration: ({ props }) => ({ textDecoration: props.textDecoration }),
|
|
14
15
|
textTransform: ({ props }) => ({ textTransform: props.textTransform }),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export const Transition = {
|
|
4
|
+
class: {
|
|
5
|
+
transition: ({ props }) => ({ transition: props.transition }),
|
|
6
|
+
transitionProperty: ({ props }) => ({
|
|
7
|
+
transitionProperty: props.transitionProperty,
|
|
8
|
+
willChange: props.transitionProperty
|
|
9
|
+
})
|
|
10
|
+
}
|
|
11
|
+
}
|