fleetio_spark 0.2.18 → 0.2.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spark/_icons.js +1 -1
- data/app/assets/javascripts/spark/components/app/sidebar/_toggle.js +14 -0
- data/app/assets/javascripts/spark/components/nav/_tabs.js +29 -0
- data/app/assets/javascripts/spark/components/nav/_toggle.js +25 -0
- data/app/assets/javascripts/spark/components/ui/_checklist_trigger.js +0 -0
- data/app/assets/javascripts/spark/form/_input-status.js +1 -1
- data/app/assets/javascripts/spark/shims/_scroll-detect.js +2 -2
- data/app/assets/javascripts/spark/spark.js +3 -1
- data/app/assets/stylesheets/spark/components/_index.scss +5 -0
- data/app/assets/stylesheets/spark/components/app/_banner.scss +4 -3
- data/app/assets/stylesheets/spark/components/app/_header.scss +14 -3
- data/app/assets/stylesheets/spark/components/app/_layout.scss +45 -25
- data/app/assets/stylesheets/spark/components/app/_sidebar.scss +35 -3
- data/app/assets/stylesheets/spark/components/app/sidebar/_footer.scss +8 -0
- data/app/assets/stylesheets/spark/components/app/sidebar/_toggle.scss +5 -57
- data/app/assets/stylesheets/spark/components/nav/_item.scss +0 -5
- data/app/assets/stylesheets/spark/components/nav/_pills.scss +45 -0
- data/app/assets/stylesheets/spark/components/nav/_tabs.scss +153 -0
- data/app/assets/stylesheets/spark/components/nav/_toggle.scss +60 -0
- data/app/assets/stylesheets/spark/components/ui/_checklist_trigger.scss +46 -0
- data/app/assets/stylesheets/spark/components_old/_nav-menu.scss +1 -3
- data/app/assets/stylesheets/spark/core/_animations.scss +9 -0
- data/app/assets/stylesheets/spark/core/_vars.scss +1 -0
- data/app/assets/svgs/spark/checklist.svg +1 -0
- data/app/components/spark/app/banner_component.rb +9 -12
- data/app/components/spark/app/header_component.rb +1 -1
- data/app/components/spark/app/layout_component.rb +18 -2
- data/app/components/spark/app/sidebar/_sidebar.js +17 -0
- data/app/components/spark/app/sidebar/header_component.rb +0 -1
- data/app/components/spark/app/sidebar_component.rb +16 -0
- data/app/components/spark/nav/group_component.rb +1 -1
- data/app/components/spark/nav/item_component.rb +8 -3
- data/app/components/spark/nav/pills_component.rb +22 -0
- data/app/components/spark/nav/tab_panels/panel_component.rb +34 -0
- data/app/components/spark/nav/tab_panels/tab_component.rb +13 -0
- data/app/components/spark/nav/tab_panels_component.rb +23 -0
- data/app/components/spark/nav/tabs_component.rb +48 -0
- data/app/components/spark/nav/toggle_component.rb +22 -0
- data/app/components/spark/ui/checklist_trigger_component.rb +20 -0
- data/lib/fleetio_spark/version.rb +1 -1
- data/public/{code-0.2.18.js → code-0.2.19.js} +1 -1
- data/public/{code-0.2.18.js.gz → code-0.2.19.js.gz} +0 -0
- data/public/{code-0.2.18.js.map → code-0.2.19.js.map} +1 -1
- data/public/spark-0.2.19.css +1 -0
- data/public/spark-0.2.19.css.gz +0 -0
- data/public/spark-0.2.19.js +2 -0
- data/public/spark-0.2.19.js.gz +0 -0
- data/public/spark-0.2.19.js.map +1 -0
- metadata +28 -13
- data/app/assets/javascripts/spark/components/sidebar/_toggle.js +0 -20
- data/app/components/spark/app/sidebar/header/_header.js +0 -11
- data/app/components/spark/app/sidebar/toggle_component.rb +0 -12
- data/public/spark-0.2.18.css +0 -1
- data/public/spark-0.2.18.css.gz +0 -0
- data/public/spark-0.2.18.js +0 -2
- data/public/spark-0.2.18.js.gz +0 -0
- data/public/spark-0.2.18.js.map +0 -1
@@ -3,7 +3,6 @@
|
|
3
3
|
display: flex;
|
4
4
|
align-items: center;
|
5
5
|
position: relative;
|
6
|
-
padding: ($pad-base + 1) 20px;
|
7
6
|
text-decoration: none;
|
8
7
|
font-size: 14px;
|
9
8
|
font-weight: 500;
|
@@ -12,10 +11,6 @@
|
|
12
11
|
|
13
12
|
&-icon {
|
14
13
|
flex-shrink: 0;
|
15
|
-
|
16
|
-
&:first-child {
|
17
|
-
margin-right: $pad-lg;
|
18
|
-
}
|
19
14
|
}
|
20
15
|
|
21
16
|
.expand-icon {
|
@@ -0,0 +1,45 @@
|
|
1
|
+
.spark-nav-pills {
|
2
|
+
padding: 0 $pad-lg;
|
3
|
+
font-size: $base-size - 1;
|
4
|
+
font-weight: 500;
|
5
|
+
|
6
|
+
.nav-group {
|
7
|
+
list-style: none;
|
8
|
+
display: flex;
|
9
|
+
flex-wrap: wrap;
|
10
|
+
margin: 0;
|
11
|
+
}
|
12
|
+
|
13
|
+
.nav-pills-wrapper {
|
14
|
+
display: flex;
|
15
|
+
align-items: flex-start;
|
16
|
+
justify-content: space-between;
|
17
|
+
}
|
18
|
+
|
19
|
+
.nav-item {
|
20
|
+
font-size: $base-size - 1;
|
21
|
+
font-weight: 500;
|
22
|
+
border-radius: 15px;
|
23
|
+
padding: 3px $pad-md;
|
24
|
+
margin: $pad-xs $pad-xs;
|
25
|
+
font-weight: normal;
|
26
|
+
color: $fl-blue-700;
|
27
|
+
|
28
|
+
&:hover, &:focus {
|
29
|
+
background-color: $fl-white;
|
30
|
+
}
|
31
|
+
|
32
|
+
&.active {
|
33
|
+
color: $fl-white;
|
34
|
+
background-color: $fl-blue-600;
|
35
|
+
}
|
36
|
+
|
37
|
+
&-icon {
|
38
|
+
width: 1em;
|
39
|
+
height: 1em;
|
40
|
+
&:first-child {
|
41
|
+
margin-right: $pad-sm;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
@@ -0,0 +1,153 @@
|
|
1
|
+
.nav-tabbed-panels {
|
2
|
+
width: 100%;
|
3
|
+
}
|
4
|
+
|
5
|
+
.spark-nav-tabs {
|
6
|
+
max-width: 100%;
|
7
|
+
overflow-x: auto;
|
8
|
+
|
9
|
+
.nav-tabs-wrapper {
|
10
|
+
display: flex;
|
11
|
+
align-items: flex-start;
|
12
|
+
justify-content: space-between;
|
13
|
+
padding: 0 4px;
|
14
|
+
border-bottom: 1px solid $fl-gray-100;
|
15
|
+
max-height: 80px;
|
16
|
+
transition: max-height $duration cubic-bezier(0.47, 0, 0.745, 0.715);
|
17
|
+
position: relative;
|
18
|
+
|
19
|
+
.app-content-header & {
|
20
|
+
border-bottom-color: $fl-gray-50;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
.nav-toggle {
|
25
|
+
display: none;
|
26
|
+
order: 100;
|
27
|
+
padding: { top: $pad-xs; right: $pad-sm; }
|
28
|
+
}
|
29
|
+
|
30
|
+
.nav-group {
|
31
|
+
display: flex;
|
32
|
+
flex-grow: 1;
|
33
|
+
list-style: none;
|
34
|
+
margin: 0;
|
35
|
+
}
|
36
|
+
|
37
|
+
.nav-item {
|
38
|
+
font-size: $base-size - 1;
|
39
|
+
font-weight: 500;
|
40
|
+
color: $fl-gray-500;
|
41
|
+
border-bottom: 2px solid transparent;
|
42
|
+
padding: ($pad-base + 1) 0;
|
43
|
+
margin: {
|
44
|
+
left: $pad-md;
|
45
|
+
right: $pad-md;
|
46
|
+
bottom: -1px;
|
47
|
+
}
|
48
|
+
|
49
|
+
&:hover, &:focus {
|
50
|
+
border-color: $fl-gray-100;
|
51
|
+
color: $fl-gray-900;
|
52
|
+
}
|
53
|
+
|
54
|
+
&.active {
|
55
|
+
border-color: $fl-blue-700;
|
56
|
+
color: $fl-gray-900;
|
57
|
+
}
|
58
|
+
|
59
|
+
&-icon {
|
60
|
+
width: 1em;
|
61
|
+
height: 1em;
|
62
|
+
|
63
|
+
&:first-child {
|
64
|
+
margin-right: $pad-sm;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
// Triggered by javascript when parent width constrains tabs
|
70
|
+
&.collapse-tabs {
|
71
|
+
|
72
|
+
// Show nav-toggle control
|
73
|
+
.nav-toggle {
|
74
|
+
display: block;
|
75
|
+
animation: fade-in $duration $timing;
|
76
|
+
cursor: pointer;
|
77
|
+
&:after {
|
78
|
+
content: "";
|
79
|
+
position: absolute;
|
80
|
+
left: 0;
|
81
|
+
right: 0;
|
82
|
+
top: 0;
|
83
|
+
bottom: 0;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
.nav-tab-wrapper:not(.active) {
|
88
|
+
transition: $duration * 1.5 cubic-bezier(0.39, 0.575, 0.565, 1);
|
89
|
+
transition-property: opacity, max-height;
|
90
|
+
}
|
91
|
+
|
92
|
+
.nav-group {
|
93
|
+
display: block;
|
94
|
+
}
|
95
|
+
|
96
|
+
.nav-item:not(.active) {
|
97
|
+
transition: padding $duration cubic-bezier(0.47, 0, 0.745, 0.715);
|
98
|
+
padding: 0;
|
99
|
+
}
|
100
|
+
|
101
|
+
// Hide all nav elements but the active one.
|
102
|
+
.nav-tab-wrapper {
|
103
|
+
&:not(.active) {
|
104
|
+
opacity: 0;
|
105
|
+
max-height: 0px;
|
106
|
+
overflow-y: hidden;
|
107
|
+
.nav-item {
|
108
|
+
border-bottom: 1px solid $fl-gray-100;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
// Don't permit click on active tab
|
112
|
+
// It is probably unintentional, expecting to open the menu
|
113
|
+
&.active {
|
114
|
+
pointer-events: none;
|
115
|
+
z-index: 0;
|
116
|
+
position: relative;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
// Triggered by clicking nav-toggle
|
121
|
+
&.nav-expanded {
|
122
|
+
|
123
|
+
// Expand panel containing tabs
|
124
|
+
.nav-tabs-wrapper {
|
125
|
+
overflow-y: auto;
|
126
|
+
max-height: 50vh;
|
127
|
+
}
|
128
|
+
|
129
|
+
// Show all tabs and expand their height
|
130
|
+
.nav-tab-wrapper {
|
131
|
+
opacity: 1;
|
132
|
+
max-height: 80px;
|
133
|
+
overflow: visible;
|
134
|
+
}
|
135
|
+
|
136
|
+
.nav-item {
|
137
|
+
padding: ($pad-base + 1) 0;
|
138
|
+
margin-bottom: 0;
|
139
|
+
&:hover, &:focus {
|
140
|
+
background-color: $fl-gray-50;
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
.main-body & {
|
146
|
+
.nav-tabs-wrapper {
|
147
|
+
padding: 0;
|
148
|
+
}
|
149
|
+
.nav-item:first-child {
|
150
|
+
margin-left: 0;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
.nav-toggle {
|
2
|
+
flex-shrink: 0;
|
3
|
+
cursor: default;
|
4
|
+
display: block;
|
5
|
+
border: none;
|
6
|
+
background: transparent;
|
7
|
+
|
8
|
+
.icon-wrapper {
|
9
|
+
cursor: pointer;
|
10
|
+
position: relative;
|
11
|
+
z-index: 101;
|
12
|
+
@include circular-button(32px);
|
13
|
+
transition: all $duration $timing;
|
14
|
+
&:hover {
|
15
|
+
background-color: $fl-gray-50;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
.nav-toggle-icon {
|
21
|
+
width: 18px;
|
22
|
+
color: $fl-gray-500;
|
23
|
+
|
24
|
+
&:hover {
|
25
|
+
color: $fl-gray-700;
|
26
|
+
}
|
27
|
+
|
28
|
+
&, &:before, &:after {
|
29
|
+
position: relative;
|
30
|
+
display: block;
|
31
|
+
height: 2px;
|
32
|
+
background: currentColor;
|
33
|
+
transform: translate3d(0,0,0);
|
34
|
+
transform-origin: center middle;
|
35
|
+
transition: $duration $timing;
|
36
|
+
transition-property: transform, background-color;
|
37
|
+
}
|
38
|
+
|
39
|
+
&:before, &:after {
|
40
|
+
width: 100%;
|
41
|
+
content: "";
|
42
|
+
}
|
43
|
+
|
44
|
+
&:before { top: -5px; }
|
45
|
+
&:after { top: 3px; }
|
46
|
+
|
47
|
+
.active & {
|
48
|
+
color: $fl-gray-1000;
|
49
|
+
background: transparent;
|
50
|
+
|
51
|
+
&:before {
|
52
|
+
transform: rotate(-45deg) translate3d(0,0,0);
|
53
|
+
top: 0px;
|
54
|
+
}
|
55
|
+
&:after {
|
56
|
+
transform: rotate(45deg) translate3d(0,0,0);
|
57
|
+
top: -2px;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
.checklist-trigger {
|
2
|
+
$checklist-trigger-bg: lighten(mix($fl-purple-600, $app-sidebar-bg, 40%), 5%);
|
3
|
+
cursor: pointer;
|
4
|
+
display: flex;
|
5
|
+
flex: 1 0 auto;
|
6
|
+
padding: $pad-base;
|
7
|
+
background: $checklist-trigger-bg;
|
8
|
+
align-items: center;
|
9
|
+
margin: $pad-base;
|
10
|
+
border-radius: $radius-md;
|
11
|
+
color: $fl-white;
|
12
|
+
text-decoration: none;
|
13
|
+
border: none;
|
14
|
+
text-align: left;
|
15
|
+
-webkit-appearance: none;
|
16
|
+
font-size: $base-size;
|
17
|
+
|
18
|
+
&:hover {
|
19
|
+
background: lighten($checklist-trigger-bg, 3%);
|
20
|
+
}
|
21
|
+
|
22
|
+
&-icon {
|
23
|
+
fill: $fl-white;
|
24
|
+
}
|
25
|
+
|
26
|
+
&-icon-wrapper {
|
27
|
+
background: rgba($fl-white, .15);
|
28
|
+
padding: $pad-base;
|
29
|
+
display: flex;
|
30
|
+
border-radius: 50%;
|
31
|
+
}
|
32
|
+
|
33
|
+
&-content {
|
34
|
+
padding: 0 $pad-base;
|
35
|
+
line-height: 1.4em;
|
36
|
+
}
|
37
|
+
|
38
|
+
&-title {
|
39
|
+
font-weight: 800;
|
40
|
+
}
|
41
|
+
&-subtitle {
|
42
|
+
font-weight: normal;
|
43
|
+
opacity: .5;
|
44
|
+
font-size: $base-size - 1;
|
45
|
+
}
|
46
|
+
}
|
@@ -64,7 +64,6 @@
|
|
64
64
|
|
65
65
|
&:hover, &:focus {
|
66
66
|
background-color: $focus-color;
|
67
|
-
outline: none;
|
68
67
|
position: relative;
|
69
68
|
z-index: 1;
|
70
69
|
box-shadow: 0 0 0 1px $focus-color;
|
@@ -72,10 +71,9 @@
|
|
72
71
|
.nav-menu-item-content {
|
73
72
|
border-color: transparent;
|
74
73
|
}
|
75
|
-
|
76
74
|
}
|
77
|
-
|
78
75
|
}
|
76
|
+
|
79
77
|
&-more {
|
80
78
|
color: $link-color;
|
81
79
|
font-size: 12px;
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><clipPath id="a"><path d="M0 0H14V14H0z"/></clipPath><g clip-path="url(#a)"><path d="M12.542 0H1.458C.658 0 0 .658 0 1.458v11.084C0 13.342.658 14 1.458 14h11.084c.8 0 1.458-.658 1.458-1.458V1.458C14 .658 13.342 0 12.542 0zm-1.75 5.542H8.167a.586.586 0 0 1-.583-.583c0-.321.263-.584.583-.584h2.625c.32 0 .583.263.583.583a.586.586 0 0 1-.583.584zm.583 4.666v.001c0 .32-.263.583-.583.583H8.167a.586.586 0 0 1-.583-.583c0-.321.263-.584.583-.584h2.625c.32 0 .583.263.583.583zM6.592 3.267L4.842 5.6a.582.582 0 0 1-.426.233h-.041a.584.584 0 0 1-.412-.17l-.875-.876a.585.585 0 0 1 .412-.996c.154 0 .303.062.412.171l.4.4 1.346-1.795a.583.583 0 1 1 .934.7zm0 5.833l-1.75 2.333a.59.59 0 0 1-.88.063l-.874-.875a.585.585 0 0 1 .824-.825l.4.4L5.658 8.4a.583.583 0 1 1 .934.7z" fill-rule="nonzero"/></g></svg>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
class App::BannerComponent < SparkComponents::Component
|
2
|
-
attribute
|
2
|
+
attribute action_text: "Learn more"
|
3
3
|
attribute :message, :href, :icon
|
4
|
+
add_theme default: "text", alert: "alert", admin: "admin"
|
5
|
+
tag_attr role: "banner"
|
4
6
|
|
5
7
|
base_class "app-banner"
|
6
8
|
|
7
9
|
def render
|
8
|
-
theme_defaults
|
9
|
-
|
10
10
|
content_tag(:header, attrs) do
|
11
11
|
concat content_tag(:div, class: join_class('content')) {
|
12
|
-
concat @view.use_svg(
|
12
|
+
concat @view.use_svg(theme_icon, class: join_class('icon'), size: "icon_m")
|
13
13
|
concat content_tag(:div, message || self, class: join_class("message"))
|
14
14
|
}
|
15
15
|
if href
|
@@ -20,16 +20,13 @@ class App::BannerComponent < SparkComponents::Component
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
@icon ||= case type
|
28
|
-
when "default"
|
23
|
+
def theme_icon
|
24
|
+
@icon || case theme
|
25
|
+
when :default
|
29
26
|
"message-text"
|
30
|
-
when
|
27
|
+
when :alert
|
31
28
|
"message-alert"
|
32
|
-
when
|
29
|
+
when :admin
|
33
30
|
"admin-user"
|
34
31
|
end
|
35
32
|
end
|
@@ -9,7 +9,7 @@ class App::HeaderComponent < SparkComponents::Component
|
|
9
9
|
|
10
10
|
def render
|
11
11
|
content_tag(:header, class: "app-header", role: "banner") do
|
12
|
-
concat component("
|
12
|
+
concat component("nav/toggle", target: "body", toggle_class: "show-sidebar", class: 'app-sidebar-toggle')
|
13
13
|
concat logo
|
14
14
|
concat search
|
15
15
|
if trial || actions
|
@@ -6,12 +6,28 @@ class App::LayoutComponent < SparkComponents::Component
|
|
6
6
|
|
7
7
|
def render
|
8
8
|
data_attr scroll: true
|
9
|
-
content_tag(:div,
|
9
|
+
content_tag(:div, attrs) do
|
10
|
+
concat header
|
11
|
+
concat nav
|
12
|
+
concat @yield
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
element :header do
|
17
|
+
def render
|
18
|
+
content_tag(:div, @yield, class: 'app-content-header') unless @yield.nil?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
element :nav do
|
23
|
+
def render
|
24
|
+
content_tag(:div, @yield, class: 'app-content-nav') unless @yield.nil?
|
25
|
+
end
|
10
26
|
end
|
11
27
|
end
|
12
28
|
|
13
29
|
def render
|
14
|
-
add_class "with-sidebar"
|
30
|
+
add_class @sidebar ? "with-sidebar" : "without-sidebar"
|
15
31
|
@view.capture do
|
16
32
|
@banner.each { |item| concat(item) } if @banner
|
17
33
|
concat content_tag(:div, attrs) {
|