smbls 0.14.3 → 0.14.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/package.json +1 -1
- package/src/Box.js +2 -2
- package/src/Button.js +37 -4
- package/src/DatePicker/index.js +8 -4
- package/src/Timing.js +65 -0
- package/src/index.js +1 -1
- package/src/Transition.js +0 -37
package/package.json
CHANGED
package/src/Box.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { Shape, Position, Theme, Block, Text, Overflow,
|
|
3
|
+
import { Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Responsive, Interaction, XYZ } from '.'
|
|
4
4
|
|
|
5
5
|
const PropsCSS = {
|
|
6
6
|
class: {
|
|
@@ -9,5 +9,5 @@ const PropsCSS = {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const Box = {
|
|
12
|
-
extend: [Shape, Position, Theme, Block, Text, Overflow,
|
|
12
|
+
extend: [Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Responsive, PropsCSS, Interaction, XYZ]
|
|
13
13
|
}
|
package/src/Button.js
CHANGED
|
@@ -7,7 +7,10 @@ const style = {
|
|
|
7
7
|
border: 'none',
|
|
8
8
|
outline: 0,
|
|
9
9
|
cursor: 'pointer',
|
|
10
|
-
fontFamily: 'inherit'
|
|
10
|
+
fontFamily: 'inherit',
|
|
11
|
+
'& > *': {
|
|
12
|
+
pointerEvents: 'none'
|
|
13
|
+
}
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
export const Button = {
|
|
@@ -51,9 +54,39 @@ export const CircleButton = {
|
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
export const KangorooButton = {
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
extend: Button,
|
|
58
|
+
|
|
59
|
+
props: {
|
|
60
|
+
theme: 'quinary',
|
|
61
|
+
round: 'Z2',
|
|
62
|
+
padding: 'X1 X1 X1 A2',
|
|
63
|
+
size: 'A',
|
|
64
|
+
gap: 'A',
|
|
65
|
+
transition: 'A defaultBezier',
|
|
66
|
+
transitionProperty: 'background, color, opacity',
|
|
67
|
+
|
|
68
|
+
label: {
|
|
69
|
+
gap: 'X1',
|
|
70
|
+
text: 'Become PRO',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
fontWeight: 'bold',
|
|
73
|
+
icon: {
|
|
74
|
+
name: 'star',
|
|
75
|
+
color: 'yellow'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
child: {
|
|
79
|
+
theme: 'tertiary',
|
|
80
|
+
round: 'Z',
|
|
81
|
+
size: 'Z',
|
|
82
|
+
padding: 'Z A2',
|
|
83
|
+
text: '1 month free',
|
|
84
|
+
opacity: '.85'
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
style
|
|
88
|
+
},
|
|
56
89
|
|
|
57
|
-
|
|
90
|
+
label: { extend: IconText },
|
|
58
91
|
child: { extend: IconText }
|
|
59
92
|
}
|
package/src/DatePicker/index.js
CHANGED
|
@@ -121,13 +121,17 @@ const main = {
|
|
|
121
121
|
cnt: {
|
|
122
122
|
childExtend: {
|
|
123
123
|
extend: SquareButton,
|
|
124
|
-
|
|
124
|
+
|
|
125
|
+
props: ({ key, state }) => ({
|
|
125
126
|
...buttonProps,
|
|
126
|
-
theme: '
|
|
127
|
-
|
|
127
|
+
theme: 'quaternary',
|
|
128
|
+
active: key === '18',
|
|
129
|
+
'.active': {
|
|
130
|
+
theme: 'quinary'
|
|
131
|
+
}
|
|
132
|
+
})
|
|
128
133
|
},
|
|
129
134
|
|
|
130
|
-
// Generate days
|
|
131
135
|
...new Array(31).fill(undefined).map((_, i) => ({ text: i + 1 }))
|
|
132
136
|
}
|
|
133
137
|
}
|
package/src/Timing.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { isString } from '@domql/utils'
|
|
4
|
+
import { getTimingByKey, getTimingFunction } from '@symbo.ls/scratch'
|
|
5
|
+
|
|
6
|
+
const transformTransition = transition => {
|
|
7
|
+
const arr = transition.split(' ')
|
|
8
|
+
|
|
9
|
+
if (!arr.length) return transition
|
|
10
|
+
|
|
11
|
+
return arr.map(v => {
|
|
12
|
+
if (v.length < 3 || v.includes('ms')) {
|
|
13
|
+
const mapWithSequence = getTimingByKey(v)
|
|
14
|
+
return mapWithSequence.timing || v
|
|
15
|
+
}
|
|
16
|
+
if (getTimingFunction(v)) return getTimingFunction(v)
|
|
17
|
+
return v
|
|
18
|
+
}).join(' ')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const transformDuration = (duration, props, propertyName) => {
|
|
22
|
+
if (!isString(duration)) return
|
|
23
|
+
return duration.split(',').map(getTimingByKey).join(',')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const splitTransition = transition => {
|
|
27
|
+
const arr = transition.split(',')
|
|
28
|
+
if (!arr.length) return
|
|
29
|
+
return arr.map(transformTransition).join(',')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const Timing = {
|
|
33
|
+
class: {
|
|
34
|
+
transition: ({ props }) => props.transition && ({
|
|
35
|
+
transition: splitTransition(props.transition)
|
|
36
|
+
}),
|
|
37
|
+
transitionDuration: ({ props }) => props.transitionDuration && ({
|
|
38
|
+
transitionDuration: transformDuration(props.transitionDuration)
|
|
39
|
+
}),
|
|
40
|
+
transitionDelay: ({ props }) => props.transitionDelay && ({
|
|
41
|
+
transitionDelay: transformDuration(props.transitionDelay)
|
|
42
|
+
}),
|
|
43
|
+
transitionTimingFunction: ({ props }) => props.transitionTimingFunction && ({
|
|
44
|
+
transitionTimingFunction: getTimingFunction(props.transitionTimingFunction)
|
|
45
|
+
}),
|
|
46
|
+
transitionProperty: ({ props }) => props.transitionProperty && ({
|
|
47
|
+
transitionProperty: props.transitionProperty,
|
|
48
|
+
willChange: props.transitionProperty
|
|
49
|
+
}),
|
|
50
|
+
|
|
51
|
+
animationDuration: ({ props }) => props.animationDuration && ({
|
|
52
|
+
animationDuration: transformDuration(props.animationDuration)
|
|
53
|
+
}),
|
|
54
|
+
animationDelay: ({ props }) => props.animationDelay && ({
|
|
55
|
+
animationDelay: transformDuration(props.animationDelay)
|
|
56
|
+
}),
|
|
57
|
+
animationTimingFunction: ({ props }) => props.animationTimingFunction && ({
|
|
58
|
+
animationTimingFunction: getTimingFunction(props.animationTimingFunction)
|
|
59
|
+
}),
|
|
60
|
+
animationProperty: ({ props }) => props.animationProperty && ({
|
|
61
|
+
animationProperty: props.animationProperty,
|
|
62
|
+
willChange: props.animationProperty
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
}
|
package/src/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export * from './Direction'
|
|
|
17
17
|
export * from './Position'
|
|
18
18
|
export * from './Overflow'
|
|
19
19
|
export * from './Transform'
|
|
20
|
-
export * from './
|
|
20
|
+
export * from './Timing'
|
|
21
21
|
export * from './Media'
|
|
22
22
|
export * from './Interaction'
|
|
23
23
|
export * from './XYZ'
|
package/src/Transition.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { getTimingByKey } from '@symbo.ls/scratch'
|
|
4
|
-
|
|
5
|
-
const transformTransition = transition => {
|
|
6
|
-
const arr = transition.split(' ')
|
|
7
|
-
|
|
8
|
-
if (!arr.length) return transition
|
|
9
|
-
|
|
10
|
-
return arr.map(v => {
|
|
11
|
-
if (v.length < 3 || v.includes('ms')) {
|
|
12
|
-
const mapWithSequence = getTimingByKey(v)
|
|
13
|
-
return mapWithSequence.duration
|
|
14
|
-
}
|
|
15
|
-
return v
|
|
16
|
-
}).join(' ')
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const splitTransition = transition => {
|
|
20
|
-
const arr = transition.split(',')
|
|
21
|
-
if (!arr.length) return
|
|
22
|
-
return {
|
|
23
|
-
transition: arr.map(transformTransition).join(',')
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const Transition = {
|
|
28
|
-
class: {
|
|
29
|
-
transition: ({ props }) => props.transition && splitTransition(props.transition),
|
|
30
|
-
transitionEasing: ({ props }) => props.transitionEasing && ({ transitionEasing: props.transitionEasing }),
|
|
31
|
-
transitionTimingFunction: ({ props }) => props.transitionTimingFunction && ({ transitionTimingFunction: props.transitionTimingFunction }),
|
|
32
|
-
transitionProperty: ({ props }) => props.transitionProperty && ({
|
|
33
|
-
transitionProperty: props.transitionProperty,
|
|
34
|
-
willChange: props.transitionProperty
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
}
|