smbls 0.14.0 → 0.14.1

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.14.0",
6
+ "version": "0.14.1",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
@@ -2,7 +2,8 @@
2
2
 
3
3
  import { exec, isString } from '@domql/utils'
4
4
  import { SHAPES } from './style'
5
- import { getSpacingBasedOnRatio } from '@symbo.ls/scratch'
5
+ import { getSpacingBasedOnRatio, getMediaColor } from '@symbo.ls/scratch'
6
+ import { Pseudo } from '../Pseudo'
6
7
 
7
8
  const transformBorderRadius = (radius, props, propertyName) => {
8
9
  if (!isString(radius)) return
@@ -12,6 +13,8 @@ const transformBorderRadius = (radius, props, propertyName) => {
12
13
  }
13
14
 
14
15
  export const Shape = {
16
+ extend: Pseudo,
17
+
15
18
  class: {
16
19
  shape: (element) => {
17
20
  const { props } = element
@@ -24,7 +27,12 @@ export const Shape = {
24
27
  const shapeDir = SHAPES[shape + 'Direction']
25
28
  return shape ? shapeDir[shapeDirection || 'top'] : null
26
29
  },
27
- shapeDirectionColor: ({ props, ...el }) => props.shapeDirection ? { '&:before': { borderColor: el.class.backgroundColor } } : null,
30
+ shapeDirectionColor: el => {
31
+ const { props } = el
32
+ const { background, backgroundColor } = props
33
+ const borderColor = getMediaColor(background || backgroundColor, 'borderColor')
34
+ return props.shapeDirection ? borderColor : null
35
+ },
28
36
 
29
37
  round: ({ props, key, ...el }) => transformBorderRadius(props.round || props.borderRadius, props, 'round'),
30
38
  borderRadius: ({ props, key, ...el }) => transformBorderRadius(props.borderRadius || props.round, props, 'borderRadius')
@@ -18,14 +18,14 @@ export const SHAPES = {
18
18
 
19
19
  tooltip: ({ props }) => ({
20
20
  position: props.position || 'relative',
21
- '&:before': {
21
+ ':before': {
22
22
  content: '""',
23
23
  display: 'block',
24
24
  width: '0px',
25
25
  height: '0px',
26
- border: `6px solid ${getColor(props.background) || (props.theme && getTheme(props.theme).background)}`,
26
+ border: `6px, solid`,
27
27
  position: 'absolute',
28
- borderRadius: '2px'
28
+ borderRadius: 'X2'
29
29
  }
30
30
  }),
31
31