material 0.7.2 → 0.7.5
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/LICENSE +9 -18
- package/index.js +26 -48
- package/package.json +4 -12
- package/src/card.js +0 -5
- package/src/checkbox.js +48 -52
- package/src/element/insert.js +6 -4
- package/src/list.js +1 -3
- package/src/loader.js +88 -0
- package/src/module/attach.js +3 -9
- package/src/module/attributes.js +7 -14
- package/src/module/build.js +1 -3
- package/src/module/cookie.js +24 -0
- package/src/module/dom.js +1 -0
- package/src/module/last.js +6 -16
- package/src/module/numabbr.js +24 -0
- package/src/module/object.js +2 -2
- package/src/module/passive.js +1 -1
- package/src/module/remove.js +3 -38
- package/src/module/request.js +32 -0
- package/src/module/ripple.js +2 -1
- package/src/module/touch.js +1 -1
- package/src/module/utils.js +0 -31
- package/src/module/viewport.js +4 -10
- package/src/navigation.js +53 -4
- package/src/skin/material/button/action.sass +6 -6
- package/src/skin/material/button/button.sass +6 -6
- package/src/skin/material/button/file.sass +1 -1
- package/src/skin/material/button/floating.sass +5 -5
- package/src/skin/material/button/raised.sass +5 -5
- package/src/skin/material/button/stroked.sass +5 -5
- package/src/skin/material/component/navigation.sass +6 -2
- package/src/skin/material/control/checkbox.sass +21 -21
- package/src/skin/material/module/ripple.sass +1 -1
- package/src/snackbar.js +4 -2
- package/src/styles/M3/abstracts/variables.sass +44 -0
- package/src/styles/M3/app/index.sass +19 -0
- package/src/styles/M3/base/body.sass +55 -0
- package/src/styles/M3/base/elevation.sass +50 -0
- package/src/styles/M3/base/grid.sass +63 -0
- package/src/styles/M3/base/typo.sass +107 -0
- package/src/styles/M3/components/button.sass +39 -0
- package/src/styles/M3/modules/ripple.sass +9 -0
- package/src/styles/M3/navigation/rail.sass +93 -0
- package/src/styles/M3/themes/classic.sass +2 -0
- package/src/styles/M3/view/view.sass +2 -0
- package/src/tabs.js +2 -3
- package/src/view.js +1 -2
- package/dist/demo-bundle.js +0 -2281
- package/dist/demo-bundle.js.map +0 -7
- package/dist/demo.css +0 -93
- package/dist/demo.css.map +0 -7
- package/dist/demo.html +0 -24
- package/dist/demo.js +0 -159
- package/dist/icon/accessibility.svg +0 -5
- package/dist/icon/apps.svg +0 -5
- package/dist/icon/happy.svg +0 -6
- package/dist/icon/link.svg +0 -5
- package/dist/icon/more.svg +0 -5
- package/dist/icon/navi.svg +0 -5
- package/dist/icon/phone.svg +0 -6
- package/dist/icon/share.svg +0 -6
- package/dist/icon/side.svg +0 -5
- package/dist/icon/star.svg +0 -7
- package/dist/icon/star_border.svg +0 -6
- package/dist/material.css +0 -2429
- package/dist/material.css.map +0 -7
- package/dist/styles/demo.sass +0 -110
- package/dist/styles.css +0 -23
- package/esbuild.js +0 -22
- package/esbuild.watch.js +0 -25
- package/src/container.js +0 -66
- package/src/field/email.js +0 -24
- package/src/field/image.js +0 -59
package/src/module/remove.js
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import extract from './extract'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* attach function to events
|
|
5
|
-
* @module module/attach
|
|
6
|
-
* @category module
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* [attach description]
|
|
11
|
-
* @param {object} component [description]
|
|
12
|
-
* @param {[type]} events [description]
|
|
13
|
-
* @return {[type]} [description]
|
|
14
|
-
*/
|
|
2
|
+
import last from './last'
|
|
15
3
|
export default {
|
|
16
|
-
remove:
|
|
4
|
+
remove: (events) => {
|
|
17
5
|
// console.log('attach', events)
|
|
18
6
|
events = events || this.options.events
|
|
19
7
|
if (!events) return
|
|
@@ -42,33 +30,10 @@ export default {
|
|
|
42
30
|
} else if (e && e.element && e.element.off && f && bound) {
|
|
43
31
|
e.element.off(e.name, f.bind(bound))
|
|
44
32
|
} else {
|
|
45
|
-
console.trace('can\'t
|
|
46
|
-
console.log('can\'t attach', def[0])
|
|
33
|
+
console.trace('can\'t be removed', def[0])
|
|
47
34
|
}
|
|
48
35
|
})
|
|
49
36
|
|
|
50
37
|
return this
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Return the last reference from an object
|
|
55
|
-
* @param {string} str Object path for example key1.key2.key3
|
|
56
|
-
* @return {value} The value of the last reference
|
|
57
|
-
*/
|
|
58
|
-
last: function (str) {
|
|
59
|
-
// console.log('_path', str)
|
|
60
|
-
if (!str) return this
|
|
61
|
-
else if (!str.match(/\./)) return this[str]
|
|
62
|
-
let last
|
|
63
|
-
|
|
64
|
-
const keys = str.split('.')
|
|
65
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
66
|
-
const key = keys[i]
|
|
67
|
-
|
|
68
|
-
last = last || this
|
|
69
|
-
last = last[key]
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return last
|
|
73
38
|
}
|
|
74
39
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const request = async (url, method = 'GET', body = null, headers = {}, signal = null) => {
|
|
2
|
+
const defaultHeaders = {
|
|
3
|
+
Accept: 'application/json',
|
|
4
|
+
'Content-Type': 'application/json'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const options = {
|
|
8
|
+
method,
|
|
9
|
+
headers: { ...defaultHeaders, ...headers },
|
|
10
|
+
signal
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (body) {
|
|
14
|
+
options.body = JSON.stringify(body)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const response = await fetch(url, options)
|
|
19
|
+
if (!response.ok) {
|
|
20
|
+
throw new Error(`HTTP error! status: ${response.status}`)
|
|
21
|
+
}
|
|
22
|
+
const data = await response.json()
|
|
23
|
+
|
|
24
|
+
return data
|
|
25
|
+
} catch (error) {
|
|
26
|
+
// Handle fetch or data processing errors
|
|
27
|
+
// console.log('error', error)
|
|
28
|
+
return { error }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default request
|
package/src/module/ripple.js
CHANGED
|
@@ -2,7 +2,8 @@ import insert from '../element/insert'
|
|
|
2
2
|
import offset from '../element/offset'
|
|
3
3
|
|
|
4
4
|
const defaults = {
|
|
5
|
-
transition: '.
|
|
5
|
+
// transition: '.375s cubic-bezier(0.4, 0.0, 0.2, 1)',
|
|
6
|
+
transition: '.375s linear',
|
|
6
7
|
opacity: ['1', '.3']
|
|
7
8
|
}
|
|
8
9
|
|
package/src/module/touch.js
CHANGED
package/src/module/utils.js
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions
|
|
3
|
-
* @module module/utils
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Checks if given value is an array
|
|
8
|
-
* @param {*} object
|
|
9
|
-
* @returns {boolean}
|
|
10
|
-
*/
|
|
11
1
|
const isArray = (object) => {
|
|
12
2
|
return Object.prototype.toString.call(object) === '[object Array]'
|
|
13
3
|
}
|
|
14
4
|
|
|
15
|
-
/**
|
|
16
|
-
* Checks if JavaScript object is a plain object
|
|
17
|
-
* @param {Object} object
|
|
18
|
-
* @returns {*|boolean}
|
|
19
|
-
*/
|
|
20
5
|
const isLiteralObject = (object) => {
|
|
21
6
|
return object && typeof object === 'object' && Object.getPrototypeOf(object) === Object.getPrototypeOf({})
|
|
22
7
|
}
|
|
23
8
|
|
|
24
|
-
/**
|
|
25
|
-
* Checks if object is iterable
|
|
26
|
-
* @param {Object} object
|
|
27
|
-
* @returns {boolean}
|
|
28
|
-
*/
|
|
29
9
|
const isIterable = (object) => {
|
|
30
10
|
return isLiteralObject(object) ||
|
|
31
11
|
isArray(object) ||
|
|
@@ -34,11 +14,6 @@ const isIterable = (object) => {
|
|
|
34
14
|
object.length !== undefined)
|
|
35
15
|
}
|
|
36
16
|
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @param {Object} object
|
|
40
|
-
* @param {Function} callback
|
|
41
|
-
*/
|
|
42
17
|
const each = (object, callback) => {
|
|
43
18
|
if (isArray(object) || (typeof object === 'object' && object.length !== undefined)) {
|
|
44
19
|
for (let i = 0, l = object.length; i < l; i++) {
|
|
@@ -54,12 +29,6 @@ const each = (object, callback) => {
|
|
|
54
29
|
}
|
|
55
30
|
}
|
|
56
31
|
|
|
57
|
-
/**
|
|
58
|
-
* Array.indexOf support
|
|
59
|
-
* @param {Array} array
|
|
60
|
-
* @param {*} obj
|
|
61
|
-
* @returns {number}
|
|
62
|
-
*/
|
|
63
32
|
const indexOf = (array, obj) => {
|
|
64
33
|
if (Array.prototype.indexOf) {
|
|
65
34
|
return Array.prototype.indexOf.call(array, obj)
|
package/src/module/viewport.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
function viewport (el) {
|
|
1
|
+
const viewport = el => {
|
|
3
2
|
if (!el) return
|
|
4
3
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const top = rect.top
|
|
8
|
-
const left = rect.left
|
|
9
|
-
const width = rect.width
|
|
10
|
-
const height = rect.height
|
|
4
|
+
const { top, left, width, height } = el.getBoundingClientRect()
|
|
11
5
|
|
|
12
6
|
return (
|
|
13
7
|
top >= window.pageYOffset &&
|
|
14
8
|
left >= window.pageXOffset &&
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
top + height <= window.pageYOffset + window.innerHeight &&
|
|
10
|
+
left + width <= window.pageXOffset + window.innerWidth
|
|
17
11
|
)
|
|
18
12
|
}
|
|
19
13
|
|
package/src/navigation.js
CHANGED
|
@@ -1,18 +1,67 @@
|
|
|
1
|
+
import EventEmitter from './mixin/emitter'
|
|
2
|
+
|
|
3
|
+
import * as css from './module/css'
|
|
1
4
|
import build from './module/build'
|
|
5
|
+
import attach from './module/attach'
|
|
6
|
+
import display from './mixin/display'
|
|
7
|
+
import Element from './element'
|
|
8
|
+
import Button from './button'
|
|
2
9
|
|
|
3
|
-
class Navigation {
|
|
10
|
+
class Navigation extends EventEmitter {
|
|
4
11
|
static defaults = {
|
|
5
|
-
class: 'navigation'
|
|
12
|
+
class: 'navigation',
|
|
13
|
+
tag: 'nav',
|
|
14
|
+
events: [
|
|
15
|
+
['element.click', 'toggle']
|
|
16
|
+
]
|
|
6
17
|
}
|
|
7
18
|
|
|
8
19
|
constructor (options) {
|
|
20
|
+
super()
|
|
21
|
+
|
|
9
22
|
this.init(options)
|
|
10
23
|
this.build()
|
|
24
|
+
this.attach()
|
|
25
|
+
this.setup()
|
|
11
26
|
}
|
|
12
27
|
|
|
13
28
|
init (options) {
|
|
14
|
-
this.options =
|
|
15
|
-
Object.assign(this, build)
|
|
29
|
+
this.options = { ...Navigation.defaults, ...options }
|
|
30
|
+
Object.assign(this, build, attach, display)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
setup () {
|
|
34
|
+
console.log('setup', this.options)
|
|
35
|
+
if (this.options.type) css.add(this.element, 'type-' + this.options.type)
|
|
36
|
+
if (this.options.type === 'rail') this.show()
|
|
37
|
+
if (this.options.items) this.render(this.options.items)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
render (items) {
|
|
41
|
+
if (items && Array.isArray(items)) {
|
|
42
|
+
for (let i = 0; i < items.length; i++) {
|
|
43
|
+
this.add(items[i])
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
add (obj) {
|
|
49
|
+
if (typeof obj !== 'object') return this
|
|
50
|
+
let item
|
|
51
|
+
if (obj.type === 'divider') {
|
|
52
|
+
item = new Element({ tag: 'li', class: 'divider' })
|
|
53
|
+
} else if (obj.type === 'divider') {
|
|
54
|
+
item = new Element({ tag: 'li', class: 'divider' })
|
|
55
|
+
} else {
|
|
56
|
+
obj.container = this.ui.list
|
|
57
|
+
obj.class = 'item'
|
|
58
|
+
item = new Button(obj).on('click', (ev) => {
|
|
59
|
+
// console.log('select', ev.target.name)
|
|
60
|
+
this.emit('select', ev.target.name)
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return this
|
|
16
65
|
}
|
|
17
66
|
}
|
|
18
67
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// type action
|
|
3
|
-
.
|
|
3
|
+
.button.type-action
|
|
4
4
|
min-width: 36px
|
|
5
5
|
transition: box-shadow .2s
|
|
6
6
|
box-shadow: none
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
fill: $default-color-text
|
|
16
16
|
|
|
17
17
|
// styles
|
|
18
|
-
.
|
|
18
|
+
.button.type-action
|
|
19
19
|
&.style-dense,
|
|
20
20
|
&.style-compact
|
|
21
21
|
height: 32px
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
// states
|
|
35
|
-
.
|
|
35
|
+
.button.type-action
|
|
36
36
|
&:hover
|
|
37
37
|
//background-color: #E0E0E0;
|
|
38
38
|
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
//background-color: rgba(255, 255, 255, 1)
|
|
44
44
|
|
|
45
45
|
// color
|
|
46
|
-
.
|
|
46
|
+
.button.type-action
|
|
47
47
|
&.primary-color
|
|
48
48
|
background-color: $primary-color
|
|
49
49
|
color: $primary-color-text
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
// theme
|
|
68
|
-
.dark-mode .
|
|
69
|
-
.
|
|
68
|
+
.dark-mode .button.type-action,
|
|
69
|
+
.button.type-action.dark-mode
|
|
70
70
|
|
|
71
71
|
//background-color: rgba(255, 255, 255, 0.95)
|
|
72
72
|
color: $primary-color-text-dark
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.button
|
|
2
2
|
display: flex
|
|
3
3
|
-webkit-font-smoothing: antialiased
|
|
4
4
|
white-space: nowrap
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
order: 1
|
|
61
61
|
|
|
62
62
|
// states
|
|
63
|
-
.
|
|
63
|
+
.button
|
|
64
64
|
&.is-disabled
|
|
65
65
|
pointer-events: none
|
|
66
66
|
opacity: .3
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
opacity: .3
|
|
87
87
|
|
|
88
88
|
// styles
|
|
89
|
-
.
|
|
89
|
+
.button
|
|
90
90
|
&.style-compact
|
|
91
91
|
> .button-label
|
|
92
92
|
padding-left: 0
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
padding-bottom: 2px
|
|
101
101
|
|
|
102
102
|
// color
|
|
103
|
-
.
|
|
103
|
+
.button
|
|
104
104
|
&.primary-color
|
|
105
105
|
color: $primary-color
|
|
106
106
|
&:focus
|
|
@@ -134,8 +134,8 @@
|
|
|
134
134
|
background-color: rgba($secondary-color, .05)
|
|
135
135
|
|
|
136
136
|
// theme
|
|
137
|
-
.dark-mode .
|
|
138
|
-
.
|
|
137
|
+
.dark-mode .button,
|
|
138
|
+
.button.dark-mode
|
|
139
139
|
color: $default-color-text-dark
|
|
140
140
|
.button-icon
|
|
141
141
|
svg
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// type floating
|
|
3
|
-
.
|
|
3
|
+
.button.type-floating
|
|
4
4
|
min-width: 56px
|
|
5
5
|
min-height: 56px
|
|
6
6
|
transition: box-shadow .2s
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
background-color: rgba(0, 0, 0, 1)
|
|
22
22
|
|
|
23
23
|
// states
|
|
24
|
-
.
|
|
24
|
+
.button.type-floating
|
|
25
25
|
background-color: rgba(0, 0, 0, 0.05)
|
|
26
26
|
&:focus
|
|
27
27
|
background-color: rgba(0, 0, 0, 0.15)
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
box-shadow: 0px 7px 8px -4px rgba(0, 0, 0, 0.2), 0px 12px 17px 2px rgba(0, 0, 0, 0.14), 0px 5px 22px 4px rgba(0, 0, 0, 0.12)
|
|
34
34
|
|
|
35
35
|
// color
|
|
36
|
-
.
|
|
36
|
+
.button.type-floating
|
|
37
37
|
&.primary-color
|
|
38
38
|
background-color: $primary-color
|
|
39
39
|
color: $primary-color-text
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
background-color: lighten($secondary-color, 5%)
|
|
69
69
|
|
|
70
70
|
// theme
|
|
71
|
-
.dark-mode .
|
|
72
|
-
.
|
|
71
|
+
.dark-mode .button.type-floating,
|
|
72
|
+
.button.type-floating.dark-mode
|
|
73
73
|
.material-ripple
|
|
74
74
|
opacity: .1
|
|
75
75
|
background-color: rgba(255, 255, 255, 1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// type raised
|
|
3
|
-
.
|
|
3
|
+
.button.type-raised
|
|
4
4
|
min-width: 36px
|
|
5
5
|
transition: box-shadow .2s
|
|
6
6
|
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)
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
background-color: rgba(0, 0, 0, 1)
|
|
10
10
|
|
|
11
11
|
// states
|
|
12
|
-
.
|
|
12
|
+
.button.type-raised
|
|
13
13
|
background-color: rgba(0, 0, 0, 0.05)
|
|
14
14
|
&:focus
|
|
15
15
|
background-color: rgba(0, 0, 0, 0.15)
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
box-shadow: 0px 4px 4px -3px rgba(0, 0, 0, 0.2), 0px 6px 8px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12)
|
|
22
22
|
|
|
23
23
|
// color
|
|
24
|
-
.
|
|
24
|
+
.button.type-raised
|
|
25
25
|
&.primary-color
|
|
26
26
|
background-color: $primary-color
|
|
27
27
|
color: $primary-color-text
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
background-color: lighten($secondary-color, 5%)
|
|
57
57
|
|
|
58
58
|
// theme
|
|
59
|
-
.dark-mode .
|
|
60
|
-
.
|
|
59
|
+
.dark-mode .button.type-raised,
|
|
60
|
+
.button.type-raised.dark-mode
|
|
61
61
|
.material-ripple
|
|
62
62
|
opacity: .1
|
|
63
63
|
background-color: rgba(255, 255, 255, 1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// type stroked
|
|
3
|
-
.
|
|
3
|
+
.button.type-stroked
|
|
4
4
|
min-width: 36px
|
|
5
5
|
transition: box-shadow .2s
|
|
6
6
|
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)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
background-color: rgba(255, 255, 255, .3)
|
|
9
9
|
|
|
10
10
|
// states
|
|
11
|
-
.
|
|
11
|
+
.button.type-stroked
|
|
12
12
|
&:hover
|
|
13
13
|
//background-color: #E0E0E0;
|
|
14
14
|
&:focus
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
box-shadow: 0px 4px 4px -3px rgba(0, 0, 0, 0.2), 0px 6px 8px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12)
|
|
20
20
|
|
|
21
21
|
// color
|
|
22
|
-
.
|
|
22
|
+
.button.type-stroked
|
|
23
23
|
&.primary-color
|
|
24
24
|
background-color: $primary-color
|
|
25
25
|
color: $primary-color-text
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
background-color: $secondary-color
|
|
47
47
|
|
|
48
48
|
// theme
|
|
49
|
-
.dark-mode .
|
|
50
|
-
.
|
|
49
|
+
.dark-mode .button.type-stroked,
|
|
50
|
+
.button.type-stroked.dark-mode
|
|
51
51
|
|
|
52
52
|
//background-color: rgba(255, 255, 255, 0.95)
|
|
53
53
|
color: $primary-color-text-dark
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
display: flex
|
|
4
4
|
flex-direction: column
|
|
5
5
|
width: 12px
|
|
6
|
-
background-color: #3a3a3a
|
|
7
6
|
margin: 0
|
|
8
7
|
overflow: hidden
|
|
9
|
-
|
|
8
|
+
background-color: #3a3a3a
|
|
9
|
+
transition: 0.1s linear width
|
|
10
|
+
&.type-rail
|
|
11
|
+
display: flex
|
|
12
|
+
flex-direction: column
|
|
13
|
+
width: 80px
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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
|
-
|
|
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
|
-
.
|
|
60
|
-
.
|
|
59
|
+
.control
|
|
60
|
+
.icon
|
|
61
61
|
transition: .3s
|
|
62
62
|
border-color: $secondary-color
|
|
63
63
|
background-color: $secondary-color
|
|
64
64
|
|
|
65
|
-
.
|
|
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
|
-
|
|
73
|
+
label
|
|
74
74
|
opacity: .4
|
|
75
75
|
|
|
76
|
-
.
|
|
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
|
-
.
|
|
82
|
-
.
|
|
81
|
+
.control
|
|
82
|
+
.icon
|
|
83
83
|
opacity: .4
|
|
84
84
|
|
|
85
85
|
&.is-focused
|
|
86
|
-
.
|
|
86
|
+
.control
|
|
87
87
|
background-color: rgba(34, 31, 31, 0.05)
|
|
88
88
|
|
|
89
89
|
&:active
|
|
90
|
-
.
|
|
91
|
-
|
|
90
|
+
.control
|
|
91
|
+
background-color: transparent
|
|
92
92
|
|
|
93
|
-
.dark-mode .
|
|
94
|
-
.
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
.
|
|
100
|
+
.control
|
|
101
101
|
background-color: rgba(255, 255, 255, 0.05)
|
|
102
102
|
|
|
103
103
|
&.is-checked
|
|
104
|
-
.
|
|
104
|
+
.control
|
|
105
105
|
background-color: rgba(255, 255, 255, 0.5)
|
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, '
|
|
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.
|
|
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,19 @@
|
|
|
1
|
+
html
|
|
2
|
+
font-size: 100%
|
|
3
|
+
line-height: 1.15
|
|
4
|
+
width: 100%
|
|
5
|
+
height: 100%
|
|
6
|
+
|
|
7
|
+
body
|
|
8
|
+
color: rgba(0, 0, 0, 0.67)
|
|
9
|
+
font-family: Roboto, arial, serif
|
|
10
|
+
font-size: 100%
|
|
11
|
+
display: flex
|
|
12
|
+
// position: relative
|
|
13
|
+
// display: block
|
|
14
|
+
// height: 100%
|
|
15
|
+
// width: 100%
|
|
16
|
+
// overflow: hidden
|
|
17
|
+
margin: 0
|
|
18
|
+
padding: 0
|
|
19
|
+
// user-select: none
|