material 0.7.2 → 0.7.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.
Files changed (51) hide show
  1. package/LICENSE +9 -18
  2. package/index.js +25 -48
  3. package/package.json +2 -10
  4. package/src/checkbox.js +48 -52
  5. package/src/element/insert.js +4 -4
  6. package/src/list.js +1 -3
  7. package/src/module/build.js +1 -3
  8. package/src/module/dom.js +1 -0
  9. package/src/module/request.js +33 -0
  10. package/src/navigation.js +7 -1
  11. package/src/skin/material/button/action.sass +6 -6
  12. package/src/skin/material/button/button.sass +6 -6
  13. package/src/skin/material/button/file.sass +1 -1
  14. package/src/skin/material/button/floating.sass +5 -5
  15. package/src/skin/material/button/raised.sass +5 -5
  16. package/src/skin/material/button/stroked.sass +5 -5
  17. package/src/skin/material/component/navigation.sass +6 -2
  18. package/src/skin/material/control/checkbox.sass +21 -21
  19. package/src/skin/material/module/ripple.sass +1 -1
  20. package/src/snackbar.js +4 -2
  21. package/src/styles/M3/abstracts/variables.sass +44 -0
  22. package/src/styles/M3/components/button.sass +26 -0
  23. package/src/styles/M3/modules/ripple.sass +9 -0
  24. package/src/styles/M3/themes/classic.sass +2 -0
  25. package/src/tabs.js +2 -3
  26. package/dist/demo-bundle.js +0 -2281
  27. package/dist/demo-bundle.js.map +0 -7
  28. package/dist/demo.css +0 -93
  29. package/dist/demo.css.map +0 -7
  30. package/dist/demo.html +0 -24
  31. package/dist/demo.js +0 -159
  32. package/dist/icon/accessibility.svg +0 -5
  33. package/dist/icon/apps.svg +0 -5
  34. package/dist/icon/happy.svg +0 -6
  35. package/dist/icon/link.svg +0 -5
  36. package/dist/icon/more.svg +0 -5
  37. package/dist/icon/navi.svg +0 -5
  38. package/dist/icon/phone.svg +0 -6
  39. package/dist/icon/share.svg +0 -6
  40. package/dist/icon/side.svg +0 -5
  41. package/dist/icon/star.svg +0 -7
  42. package/dist/icon/star_border.svg +0 -6
  43. package/dist/material.css +0 -2429
  44. package/dist/material.css.map +0 -7
  45. package/dist/styles/demo.sass +0 -110
  46. package/dist/styles.css +0 -23
  47. package/esbuild.js +0 -22
  48. package/esbuild.watch.js +0 -25
  49. package/src/container.js +0 -66
  50. package/src/field/email.js +0 -24
  51. package/src/field/image.js +0 -59
@@ -1,4 +1,4 @@
1
- .material-checkbox
1
+ .checkbox
2
2
  display: block
3
3
  position: relative
4
4
  margin-left: 4px
@@ -17,7 +17,7 @@
17
17
  left: -10000px
18
18
  order: 2
19
19
 
20
- .checkbox-control
20
+ .control
21
21
  //flex: none;
22
22
  order: 1
23
23
  cursor: pointer
@@ -29,7 +29,7 @@
29
29
  border-radius: 50%
30
30
 
31
31
  //margin: 10px 10px 10px 4px;
32
- .checkbox-icon
32
+ .icon
33
33
  position: absolute
34
34
  top: 11px
35
35
  left: 11px
@@ -38,14 +38,14 @@
38
38
  transition: .3s
39
39
 
40
40
  //stroke: rgba(0, 0, 0, 0.5);
41
- .checkbox-check
41
+ .check
42
42
  opacity: 0
43
43
  position: absolute
44
44
  fill: rgba(255, 255, 255, 0.95)
45
45
  top: 8px
46
46
  left: 8px
47
47
 
48
- .checkbox-label
48
+ label
49
49
  flex: 1
50
50
  order: 3
51
51
  font-size: 1rem
@@ -56,13 +56,13 @@
56
56
  overflow: hidden
57
57
 
58
58
  &.is-checked
59
- .checkbox-control
60
- .checkbox-icon
59
+ .control
60
+ .icon
61
61
  transition: .3s
62
62
  border-color: $secondary-color
63
63
  background-color: $secondary-color
64
64
 
65
- .checkbox-check
65
+ .check
66
66
  opacity: 1
67
67
  position: absolute
68
68
  fill: rgba(255, 255, 255, 0.95)
@@ -70,36 +70,36 @@
70
70
  left: 8px
71
71
 
72
72
  &.is-disabled
73
- .checkbox-label
73
+ label
74
74
  opacity: .4
75
75
 
76
- .checkbox-icon
76
+ .icon
77
77
  background-color: rgba(0, 0, 0, 0.26)
78
78
  border-color: rgba(0, 0, 0, 0.26)
79
79
  //opacity: .4
80
80
 
81
- .checkbox-control
82
- .checkbox-icon
81
+ .control
82
+ .icon
83
83
  opacity: .4
84
84
 
85
85
  &.is-focused
86
- .checkbox-control
86
+ .control
87
87
  background-color: rgba(34, 31, 31, 0.05)
88
88
 
89
89
  &:active
90
- .checkbox-control
91
- //background-color: transparent;
90
+ .control
91
+ background-color: transparent
92
92
 
93
- .dark-mode .material-checkbox,
94
- .material-checkbox.dark-mode
95
- > .material-control
96
- > .checkbox-icon
93
+ .dark-mode .checkbox,
94
+ .checkbox.dark-mode
95
+ .control
96
+ .icon
97
97
  border: 2px solid rgba(255, 255, 255, 0.5)
98
98
 
99
99
  &.is-focused
100
- .checkbox-control
100
+ .control
101
101
  background-color: rgba(255, 255, 255, 0.05)
102
102
 
103
103
  &.is-checked
104
- .material-control
104
+ .control
105
105
  background-color: rgba(255, 255, 255, 0.5)
@@ -1,4 +1,4 @@
1
- .material-ripple
1
+ .material-ripple, .ripple
2
2
  opacity: 1
3
3
  pointer-events: none
4
4
  z-index: 1
package/src/snackbar.js CHANGED
@@ -13,9 +13,10 @@ class Snackbar extends EventEmitter {
13
13
  class: 'snackbar',
14
14
  transition: 225,
15
15
  duration: 4000,
16
+ stack: false,
16
17
  close: false,
17
18
  layout: [
18
- [Text, 'text', { tag: 'span', class: 'text' }],
19
+ [Text, 'message', { tag: 'span', class: 'message' }],
19
20
  [Button, 'action', { class: 'action', type: 'link' }],
20
21
  [Button, 'close', { class: 'close', type: 'action' }]
21
22
  ],
@@ -60,12 +61,13 @@ class Snackbar extends EventEmitter {
60
61
  this.options.container.classList.add('snackbars')
61
62
  container.appendChild(this.options.container)
62
63
  } else {
64
+ if (this.options.stack === false) snackbarContainer.innerHTML = ''
63
65
  this.options.container = snackbarContainer
64
66
  }
65
67
  }
66
68
 
67
69
  render () {
68
- this.ui.text.set(this.options.text)
70
+ this.ui.message.set(this.options.message)
69
71
 
70
72
  if (this.options.action) {
71
73
  this.ui.action.set(this.options.action)
@@ -0,0 +1,44 @@
1
+ // Color Palette
2
+ $color-primary: #3498db
3
+ $color-secondary: #2ecc71
4
+ $color-tertiary: #9b59b6
5
+ $color-tonal: #d9e7cc
6
+ $color-success: #2ecc71
7
+ $color-warning: #f1c40f
8
+ $color-danger: #e74c3c
9
+ $color-light: #ecf0f1
10
+ $color-dark: #34495e
11
+
12
+ $text-on-primary: #ffffff
13
+ $text-primary-on-dark: #ffffff
14
+ $text-primary-on-light: #333333
15
+ $text-on-tonal: #131F0D
16
+
17
+ // Typography
18
+ $font-primary: 'Helvetica Neue', Arial, sans-serif
19
+ $font-secondary: 'Georgia', serif
20
+ $font-size-base: 1rem // 16px
21
+ $font-size-large: 1.25rem // 20px
22
+ $font-size-small: 0.875rem // 14px
23
+
24
+ // Spacing
25
+ $spacing-unit: 10px
26
+
27
+ // Breakpoints for Responsive Design
28
+ $breakpoint-xs: 480px
29
+ $breakpoint-sm: 768px
30
+ $breakpoint-md: 992px
31
+ $breakpoint-lg: 1200px
32
+
33
+ // Z-index Layers
34
+ $zindex-dropdown: 1000
35
+ $zindex-sticky: 1020
36
+ $zindex-fixed: 1030
37
+ $zindex-modal-backdrop: 1040
38
+ $zindex-modal: 1050
39
+ $zindex-popover: 1060
40
+ $zindex-tooltip: 1070
41
+
42
+ // Other Variables
43
+ $border-radius: 4px
44
+ $box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
@@ -0,0 +1,26 @@
1
+ .button
2
+ font-size: 0.875rem
3
+ font-weight: 500
4
+ color: $text-on-primary
5
+ height: 40px
6
+ background-color: $color-primary
7
+ padding-left: 24px
8
+ padding-right: 24px
9
+ border-radius: 20px
10
+ border: none
11
+ overflow: hidden
12
+ &.style-filled
13
+ color: $text-on-primary
14
+ background-color: $color-primary
15
+ &.style-tonal
16
+ color: $text-on-tonal
17
+ background-color: $color-tonal
18
+ &.style-elevated
19
+ background-color: $color-primary
20
+ box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12)
21
+ &.style-outlined
22
+ color: $color-primary
23
+ background-color: transparent
24
+ border-color: 2px solid #72776C
25
+ &.style-text
26
+ color: $color-primary
@@ -0,0 +1,9 @@
1
+ .ripple
2
+ opacity: 1
3
+ pointer-events: none
4
+ z-index: 1
5
+ position: absolute
6
+ background-color: rgba(255, 255, 255, 0.1)
7
+ height: 5px
8
+ width: 5px
9
+ border-radius: 50%
@@ -0,0 +1,2 @@
1
+ $primary: #6750A4
2
+ $onPrimary: rgba(255,255,255,.87)
package/src/tabs.js CHANGED
@@ -1,5 +1,3 @@
1
- 'use strict'
2
-
3
1
  import create from './mixin/create'
4
2
  import insert from './mixin/insert'
5
3
  import emitter from './module/emitter'
@@ -49,6 +47,7 @@ class Tabs {
49
47
  if (this.options.list) {
50
48
  this.list = new List({
51
49
  tag: 'div',
50
+ container: this.element,
52
51
  list: this.options.list,
53
52
  target: '.material-button',
54
53
  height: 600,
@@ -74,7 +73,7 @@ class Tabs {
74
73
  this.selected = item
75
74
  this.click(item)
76
75
  }
77
- }).insert(this.element)
76
+ })
78
77
  }
79
78
 
80
79
  this.indicator = create(this.options.indicator)