smbls 0.15.43 → 0.15.45

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI Library built on Scratch and DOMQL",
4
4
  "private": false,
5
5
  "author": "symbo.ls",
6
- "version": "0.15.43",
6
+ "version": "0.15.45",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
package/src/Input.js CHANGED
@@ -13,7 +13,7 @@ export const Input = {
13
13
  fontSize: 'A',
14
14
  round: 'C',
15
15
  lineHeight: 1,
16
- padding: 'Z A',
16
+ padding: 'Z A'
17
17
  },
18
18
 
19
19
  attr: {
@@ -0,0 +1,11 @@
1
+ 'use strict'
2
+
3
+ export const Form = {
4
+ tag: 'form',
5
+ props: {},
6
+ attr: {
7
+ action: ({ props }) => props.action,
8
+ method: ({ props }) => props.method,
9
+ enctype: ({ props }) => props.enctype
10
+ }
11
+ }
@@ -0,0 +1,16 @@
1
+ 'use strict'
2
+
3
+ export const Iframe = {
4
+ tag: 'iframe',
5
+ props: {
6
+ position: 'relative',
7
+ minWidth: 'H',
8
+ minHeight: 'H'
9
+ },
10
+ attr: {
11
+ src: ({ props }) => props.src,
12
+ loading: ({ props }) => props.loading,
13
+ allowfullscreen: ({ props }) => props.allowfullscreen,
14
+ referrerpolicy: ({ props }) => props.referrerpolicy
15
+ }
16
+ }
package/src/atoms/Text.js CHANGED
@@ -31,7 +31,7 @@ export const P = { tag: 'p' }
31
31
  export const Caption = { tag: 'caption' }
32
32
  export const Strong = {
33
33
  tag: 'strong',
34
- props: { fontWeight: '900' }
34
+ props: { fontWeight: '700' }
35
35
  }
36
36
  export const Underline = { tag: 'u' }
37
37
  export const Italic = { tag: 'i' }
@@ -11,7 +11,8 @@ const transformBorder = border => {
11
11
  const arr = border.split(', ')
12
12
  return arr.map(v => {
13
13
  v = v.trim()
14
- if (isBorderStyle(v)) return v || 'solid'
14
+ if (v.slice(0, 2) === '--') return `var(${v})`
15
+ else if (isBorderStyle(v)) return v || 'solid'
15
16
  else if (v.slice(-2) === 'px' || v.slice(-2) === 'em') return v // TODO: add map spacing
16
17
  else if (getColor(v).length > 2) return getColor(v)
17
18
  return getSpacingByKey(v, 'border').border
@@ -20,14 +21,16 @@ const transformBorder = border => {
20
21
 
21
22
  const transformTextStroke = stroke => ({
22
23
  WebkitTextStroke: stroke.split(', ').map(v => {
24
+ if (v.slice(0, 2) === '--') return `var(${v})`
23
25
  if (v.includes('px')) return v
24
26
  else if (getColor(v)) return getColor(v)
25
27
  }).join(' ')
26
28
  })
27
29
 
28
- const transformShadow = shadows => shadows.split('|').map(shadow => {
30
+ export const transformShadow = shadows => shadows.split('|').map(shadow => {
29
31
  return shadow.split(', ').map(v => {
30
32
  v = v.trim()
33
+ if (v.slice(0, 2) === '--') return `var(${v})`
31
34
  if (getColor(v).length > 2) return getColor(v)
32
35
  if (v.includes('px') || v.slice(-2) === 'em') return v
33
36
  const arr = v.split(' ')
@@ -38,6 +41,7 @@ const transformShadow = shadows => shadows.split('|').map(shadow => {
38
41
 
39
42
  const transformBackgroundImage = (backgroundImage, ctx, globalTheme) => ({
40
43
  backgroundImage: backgroundImage.split(', ').map(v => {
44
+ if (v.slice(0, 2) === '--') return `var(${v})`
41
45
  if (v.includes('url') || v.includes('gradient')) return v
42
46
  else if (ctx.SYSTEM.GRADIENT[backgroundImage]) {
43
47
  return getMediaColor(backgroundImage, 'backgroundImage', globalTheme)
@@ -122,6 +126,10 @@ export const Theme = {
122
126
  boxShadow: transformShadow(props.boxShadow)
123
127
  }),
124
128
 
129
+ textShadow: ({ props }) => props.textShadow && ({
130
+ textShadow: transformShadow(props.textShadow)
131
+ }),
132
+
125
133
  opacity: ({ props }) => props.opacity && ({ opacity: props.opacity }),
126
134
  visibility: ({ props }) => props.visibility && ({ visibility: props.visibility })
127
135
  }
@@ -9,6 +9,7 @@ export const transformTransition = transition => {
9
9
  if (!arr.length) return transition
10
10
 
11
11
  return arr.map(v => {
12
+ if (v.slice(0, 2) === '--') return `var(${v})`
12
13
  if (v.length < 3 || v.includes('ms')) {
13
14
  const mapWithSequence = getTimingByKey(v)
14
15
  return mapWithSequence.timing || v
@@ -5,7 +5,9 @@ export * from './Direction'
5
5
  export * from './Flex'
6
6
  export * from './Grid'
7
7
  export * from './Img'
8
+ export * from './Form'
8
9
  export * from './Media'
10
+ export * from './Iframe'
9
11
  export * from './Interaction'
10
12
  export * from './Overflow'
11
13
  export * from './Position'