smbls 0.7.0 → 0.8.3

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.
Files changed (54) hide show
  1. package/README.md +25 -0
  2. package/package.json +24 -36
  3. package/src/Banner/index.js +24 -0
  4. package/src/Banner/style.js +27 -0
  5. package/src/Block/index.js +95 -0
  6. package/src/Block/style.js +1 -0
  7. package/src/Box/index.js +10 -0
  8. package/src/Button/index.js +54 -0
  9. package/src/Button/style.js +13 -0
  10. package/src/ButtonSet/index.js +14 -0
  11. package/src/DatePicker/index.js +115 -0
  12. package/src/DatePicker/style.js +100 -0
  13. package/src/Direction/index.js +10 -0
  14. package/src/Dropdown/index.js +42 -0
  15. package/src/Dropdown/style.js +37 -0
  16. package/src/Field/index.js +21 -0
  17. package/src/Field/style.js +30 -0
  18. package/src/Flex/index.js +20 -0
  19. package/src/Flex/style.js +5 -0
  20. package/src/Grid/index.js +18 -0
  21. package/src/Grid/style.js +5 -0
  22. package/src/GridLayouts/index.js +20 -0
  23. package/src/GridLayouts/style.js +47 -0
  24. package/src/Icon/index.js +14 -0
  25. package/src/Icon/style.js +8 -0
  26. package/src/IconText/index.js +18 -0
  27. package/src/IconText/style.js +12 -0
  28. package/src/Img/index.js +17 -0
  29. package/src/Input/index.js +32 -0
  30. package/src/Label/index.js +20 -0
  31. package/src/Link/index.js +19 -0
  32. package/src/Notification/index.js +37 -0
  33. package/src/Overflow/index.js +7 -0
  34. package/src/Pills/index.js +30 -0
  35. package/src/Position/index.js +27 -0
  36. package/src/Responsive/index.js +48 -0
  37. package/src/SVG/index.js +14 -0
  38. package/src/Select/index.js +24 -0
  39. package/src/Select/style.js +8 -0
  40. package/src/Shape/index.js +66 -0
  41. package/src/Shape/style.js +102 -0
  42. package/src/SideBar/index.js +22 -0
  43. package/src/Slider/index.js +89 -0
  44. package/src/Slider/style.js +19 -0
  45. package/src/Text/index.js +18 -0
  46. package/src/Text/style.js +2 -0
  47. package/src/Tooltip/index.js +13 -0
  48. package/src/Tooltip/style.js +12 -0
  49. package/src/Transform/index.js +9 -0
  50. package/src/User/index.js +25 -0
  51. package/src/User/style.js +19 -0
  52. package/src/index.js +39 -0
  53. package/src/styles.js +7 -0
  54. package/index.js +0 -35
@@ -0,0 +1,22 @@
1
+ 'use strict'
2
+ import { Icon, Link } from '../'
3
+
4
+ const MenuItem = {
5
+ proto: Link,
6
+ props: { icon: '' },
7
+ glyph: {
8
+ proto: Icon,
9
+ name: ({ props }) => props.icon
10
+ }
11
+ }
12
+
13
+ export const Sidebar = {
14
+ caption: '',
15
+ nav: {
16
+ style: {
17
+ a: { cursor: 'pointer' }
18
+ },
19
+ childProto: MenuItem,
20
+ ...[{}]
21
+ }
22
+ }
@@ -0,0 +1,89 @@
1
+ 'use strict'
2
+
3
+ import style from './style'
4
+
5
+ import { SquareButton, Shape } from '..'
6
+ import * as Scratch from '@symbo.ls/scratch'
7
+ import { isFunction } from 'domql/src/utils'
8
+
9
+ // TODO: fix this
10
+ Scratch.setValue('THEME', {
11
+ background: 'white 0.2',
12
+
13
+ '&::-webkit-slider-thumb': {
14
+ background: '#232526',
15
+ borderColor: Scratch.opacify('#454646', 0.75)
16
+ },
17
+
18
+ '&:hover': {
19
+ '&::-webkit-slider-thumb': {
20
+ borderColor: Scratch.opacify('#fff', 0.35)
21
+ }
22
+ },
23
+
24
+ '&:focus, &:active': {
25
+ '&::-webkit-slider-thumb': {
26
+ borderColor: '#3C6AC0'
27
+ }
28
+ }
29
+ }, 'sliderThumb')
30
+
31
+ export const RangeSlider = {
32
+ style,
33
+ proto: Shape,
34
+ props: {
35
+ theme: 'sliderThumb'
36
+ },
37
+
38
+ tag: 'input',
39
+ attr: { type: 'range' }
40
+ }
41
+
42
+ const findOut = (el, s, prop, def) => {
43
+ const val = el.parent.parent.props[prop]
44
+ return isFunction(val) ? val(el, s) : val || def
45
+ }
46
+
47
+ export const Slider = {
48
+ proto: [Shape],
49
+
50
+ button0: {
51
+ proto: [SquareButton],
52
+ props: {
53
+ icon: 'minus'
54
+ },
55
+ on: {
56
+ click: (ev, el, s) => {
57
+ el.parent.parent.props.minusClick(ev, el, s)
58
+ }
59
+ }
60
+ },
61
+ value: {
62
+ tag: 'span',
63
+ // class: { w: { minWidth: `4ch` } },
64
+ text: (el, s) => `${findOut(el, s, 'value', 50)}${findOut(el, s, 'type') === 'fontSize' ? 'px' : ''}`
65
+ },
66
+ range: {
67
+ proto: RangeSlider,
68
+ attr: {
69
+ value: (el, s) => findOut(el, s, 'value', 50),
70
+ min: (el, s) => findOut(el, s, 'min', 0),
71
+ max: (el, s) => findOut(el, s, 'max', 100),
72
+ step: (el, s) => findOut(el, s, 'step', 1)
73
+ },
74
+ on: {
75
+ input: (ev, el, s) => el.parent.parent.props.input(ev, el, s)
76
+ }
77
+ },
78
+ button1: {
79
+ proto: [SquareButton],
80
+ props: {
81
+ icon: 'plus'
82
+ },
83
+ on: {
84
+ click: (ev, el, s) => {
85
+ el.parent.parent.props.plusClick(ev, el, s)
86
+ }
87
+ }
88
+ }
89
+ }
@@ -0,0 +1,19 @@
1
+ 'use strict'
2
+
3
+ export default {
4
+ appearance: 'none',
5
+ width: '100%',
6
+ height: '2px',
7
+ outline: 'none',
8
+ flex: 1,
9
+ '&::-webkit-slider-thumb': {
10
+ boxSizing: 'content-box',
11
+ appearance: 'none',
12
+ width: '8px',
13
+ height: '8px',
14
+ borderWidth: '2px',
15
+ borderStyle: 'solid',
16
+ borderRadius: '100%',
17
+ opacity: '.8'
18
+ }
19
+ }
@@ -0,0 +1,18 @@
1
+ 'use strict'
2
+
3
+ import { mapFontSize } from '@symbo.ls/scratch'
4
+
5
+ export const Text = {
6
+ props: {},
7
+
8
+ text: ({ props }) => props.text,
9
+
10
+ class: {
11
+ fontSize: ({ props }) => props.fontSize ? mapFontSize(props.fontSize) : null,
12
+ lineHeight: ({ props }) => ({ lineHeight: props.lineHeight }),
13
+ textDecoration: ({ props }) => ({ textDecoration: props.textDecoration }),
14
+ textTransform: ({ props }) => ({ textTransform: props.textTransform }),
15
+ textAlign: ({ props }) => ({ textAlign: props.textAlign }),
16
+ fontWeight: ({ props }) => ({ fontWeight: props.fontWeight })
17
+ }
18
+ }
@@ -0,0 +1,2 @@
1
+ 'use strict'
2
+
@@ -0,0 +1,13 @@
1
+ 'use strict'
2
+
3
+ import Shape from '../Shape'
4
+
5
+ import style from './style'
6
+
7
+ export const Tooltip = {
8
+ style,
9
+ proto: Shape,
10
+ props: { theme: 'purple2' },
11
+ caption: 'And tooltip is coming',
12
+ span: 'and winter too'
13
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+
3
+ export default {
4
+ textAlign: 'center',
5
+ padding: '1.2em',
6
+ caption: {
7
+ whiteSpace: 'nowrap',
8
+ },
9
+ span: {
10
+ opacity: '.5'
11
+ }
12
+ }
@@ -0,0 +1,9 @@
1
+ 'use strict'
2
+
3
+ export const Transform = {
4
+ class: {
5
+ transform: ({ props }) => ({
6
+ transform: props.transform
7
+ }),
8
+ }
9
+ }
@@ -0,0 +1,25 @@
1
+ 'use strict'
2
+
3
+ import { Shape, Block } from '..'
4
+ import { styleUser, styleUserBundle } from './style'
5
+
6
+ export const User = {
7
+ proto: [Shape, Block],
8
+ props: { boxSize: 'B B' },
9
+ style: styleUser,
10
+ tag: 'img',
11
+ attr: {
12
+ src: 'https://p194.p3.n0.cdn.getcloudapp.com/items/yAubz2KN/IMG_2375.jpg?v=c59a92ea47a959e386e952c3d84c08e5'
13
+ }
14
+ }
15
+
16
+ export const UserBundle = {
17
+ style: styleUserBundle,
18
+ users: {
19
+ childProto: User,
20
+ ...[{}]
21
+ },
22
+ span: 'join classroom'
23
+ }
24
+
25
+ export default User
@@ -0,0 +1,19 @@
1
+ 'use strict'
2
+
3
+ export const styleUser = {
4
+ cursor: 'pointer',
5
+ borderRadius: '100%'
6
+ }
7
+
8
+ export const styleUserBundle = {
9
+ display: 'flex',
10
+ alignItems: 'center',
11
+ textTransform: 'capitalize',
12
+ '> div': {
13
+ display: 'flex',
14
+ marginRight: '1em',
15
+ '> img': {
16
+ marginRight: '-0.5em'
17
+ }
18
+ }
19
+ }
package/src/index.js ADDED
@@ -0,0 +1,39 @@
1
+ 'use strict'
2
+
3
+ import './styles.js'
4
+
5
+ export * from './styles'
6
+
7
+ export * from './Text'
8
+ export * from './Block'
9
+ export * from './Shape'
10
+ export * from './Flex'
11
+ export * from './Grid'
12
+ export * from './Direction'
13
+ export * from './Position'
14
+ export * from './Overflow'
15
+ export * from './Transform'
16
+ export * from './Responsive'
17
+
18
+ export * from './Box'
19
+
20
+ export * from './SVG'
21
+ export * from './Icon'
22
+ export * from './Img'
23
+ export * from './Link'
24
+ export * from './IconText'
25
+ export * from './Input'
26
+ export * from './Field'
27
+ export * from './Button'
28
+
29
+ export * from './ButtonSet'
30
+ export * from './User'
31
+ export * from './Banner'
32
+ export * from './Slider'
33
+ export * from './Notification'
34
+ export * from './Dropdown'
35
+ export * from './DatePicker'
36
+ export * from './Tooltip'
37
+ export * from './Label'
38
+ export * from './Pills'
39
+ export * from './Select'
package/src/styles.js ADDED
@@ -0,0 +1,7 @@
1
+ 'use strict'
2
+
3
+ export const clickable = {
4
+ cursor: 'pointer',
5
+ userSelect: 'none'
6
+ //
7
+ }
package/index.js DELETED
@@ -1,35 +0,0 @@
1
- 'use strict'
2
-
3
- export * from './styles'
4
-
5
- export * from '@symbo.ls/responsive'
6
- export * from '@symbo.ls/block'
7
- export * from '@symbo.ls/shape'
8
- export * from '@symbo.ls/flex'
9
- export * from '@symbo.ls/grid'
10
- export * from '@symbo.ls/direction'
11
- export * from '@symbo.ls/position'
12
- export * from '@symbo.ls/overflow'
13
-
14
- export * from '@symbo.ls/box'
15
-
16
- export * from '@symbo.ls/svg'
17
- export * from '@symbo.ls/icon'
18
- export * from '@symbo.ls/img'
19
- export * from '@symbo.ls/link'
20
- export * from '@symbo.ls/icon-text'
21
- export * from '@symbo.ls/input'
22
- export * from '@symbo.ls/field'
23
- export * from '@symbo.ls/button'
24
-
25
- export * from '@symbo.ls/buttonset'
26
- export * from '@symbo.ls/user'
27
- export * from '@symbo.ls/banner'
28
- export * from '@symbo.ls/slider'
29
- export * from '@symbo.ls/notification'
30
- export * from '@symbo.ls/dropdown'
31
- export * from '@symbo.ls/datepicker'
32
- export * from '@symbo.ls/tooltip'
33
- export * from '@symbo.ls/label'
34
- export * from '@symbo.ls/pills'
35
- export * from '@symbo.ls/select'