fleetio_spark 0.2.31 → 0.2.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spark/_icons.js +1 -1
  3. data/app/assets/javascripts/spark/code.js +2 -7
  4. data/app/assets/javascripts/spark/components/app/sidebar/_fix.js +3 -4
  5. data/app/assets/javascripts/spark/components/nav/_link-state.js +36 -0
  6. data/app/assets/javascripts/spark/components/nav/_tabs.js +23 -15
  7. data/app/assets/javascripts/spark/components/nav/_toggle.js +33 -7
  8. data/app/assets/javascripts/spark/components/nav/_tree.js +28 -4
  9. data/app/assets/javascripts/spark/form/_set-text.js +40 -0
  10. data/app/assets/javascripts/spark/spark.js +10 -7
  11. data/app/assets/stylesheets/spark/_icons.scss +1 -1
  12. data/app/assets/stylesheets/spark/components/_index.scss +8 -0
  13. data/app/assets/stylesheets/spark/components/app/_banner.scss +1 -1
  14. data/app/assets/stylesheets/spark/components/app/_header.scss +3 -3
  15. data/app/assets/stylesheets/spark/components/app/_layout.scss +14 -4
  16. data/app/assets/stylesheets/spark/components/app/_sidebar.scss +2 -2
  17. data/app/assets/stylesheets/spark/components/app/sidebar/_toggle.scss +3 -3
  18. data/app/assets/stylesheets/spark/components/form/_switch.scss +119 -0
  19. data/app/assets/{javascripts/spark/components/ui/_checklist_trigger.js → stylesheets/spark/components/layout/_base.scss} +0 -0
  20. data/app/assets/stylesheets/spark/components/layout/_header.scss +55 -0
  21. data/app/{components/spark/nav/breadcrumbs/_breadcrumbs.html.erb → assets/stylesheets/spark/components/layout/_page.scss} +0 -0
  22. data/app/assets/stylesheets/spark/components/nav/_item.scss +6 -2
  23. data/app/assets/stylesheets/spark/components/nav/_pills.scss +5 -1
  24. data/app/assets/stylesheets/spark/components/nav/_sidebar.scss +100 -0
  25. data/app/assets/stylesheets/spark/components/nav/_tabs.scss +46 -61
  26. data/app/assets/stylesheets/spark/components/nav/_toggle.scss +69 -33
  27. data/app/assets/stylesheets/spark/components/nav/tree/_group.scss +0 -1
  28. data/app/assets/stylesheets/spark/components/page/_header.scss +9 -0
  29. data/app/assets/stylesheets/spark/components/page/_main.scss +62 -0
  30. data/app/assets/stylesheets/spark/components/ui/_button.scss +0 -0
  31. data/app/assets/stylesheets/spark/components/ui/_card.scss +20 -0
  32. data/app/assets/stylesheets/spark/components/ui/_header.scss +56 -0
  33. data/app/assets/stylesheets/spark/components_old/header/_search.scss +1 -2
  34. data/app/assets/stylesheets/spark/core/_text.scss +1 -0
  35. data/app/assets/stylesheets/spark/core/_vars.scss +1 -0
  36. data/app/assets/stylesheets/spark/form/_check-switch.scss +0 -6
  37. data/app/assets/svgs/spark/comment.svg +3 -0
  38. data/app/assets/svgs/spark/description.svg +3 -0
  39. data/app/assets/svgs/spark/grid.svg +3 -0
  40. data/app/assets/svgs/spark/information-circle.svg +3 -0
  41. data/app/assets/svgs/spark/launch.svg +3 -0
  42. data/app/assets/svgs/spark/photo.svg +3 -0
  43. data/app/components/spark/app/banner_component.rb +12 -13
  44. data/app/components/spark/app/content_component.rb +32 -0
  45. data/app/components/spark/app/header_component.rb +4 -4
  46. data/app/components/spark/app/layout_component.rb +24 -8
  47. data/app/components/spark/app/sidebar/header_component.rb +11 -9
  48. data/app/components/spark/app/sidebar_component.rb +10 -9
  49. data/app/components/spark/display/tooltip_component.rb +13 -0
  50. data/app/components/spark/form/checkbox_component.rb +16 -0
  51. data/app/components/spark/form/input_component.rb +6 -0
  52. data/app/components/spark/form/label_component.rb +12 -0
  53. data/app/components/spark/form/switch_component.rb +29 -0
  54. data/app/components/spark/layout/base_component.rb +2 -0
  55. data/app/components/spark/layout/header_component.rb +26 -0
  56. data/app/components/spark/layout/page_component.rb +31 -0
  57. data/app/components/spark/nav/group_component.rb +4 -0
  58. data/app/components/spark/nav/item_component.rb +7 -7
  59. data/app/components/spark/nav/pills_component.rb +8 -2
  60. data/app/components/spark/nav/sidebar_component.rb +52 -6
  61. data/app/components/spark/nav/tab_panels/panel_component.rb +4 -8
  62. data/app/components/spark/nav/tab_panels/tab_component.rb +3 -3
  63. data/app/components/spark/nav/tab_panels_component.rb +7 -3
  64. data/app/components/spark/nav/tabs_component.rb +19 -5
  65. data/app/components/spark/nav/toggle_component.rb +19 -9
  66. data/app/components/spark/nav/tree/group_component.rb +4 -3
  67. data/app/components/spark/nav/tree_component.rb +16 -2
  68. data/app/components/spark/page/layout_component.rb +32 -0
  69. data/app/components/spark/page/main_component.rb +39 -0
  70. data/app/components/spark/ui/button_component.rb +2 -0
  71. data/app/components/spark/ui/card_component.rb +16 -0
  72. data/app/components/spark/ui/checklist_trigger_component.rb +2 -2
  73. data/app/components/spark/ui/header_component.rb +41 -0
  74. data/app/components/spark/ui/page_layout_component.rb +34 -0
  75. data/app/components/spark/ui/placeholder_component.rb +5 -5
  76. data/app/components/spark/ui/sticky_panel_component.rb +1 -1
  77. data/app/components/spark/ui/toolbar_component.rb +1 -1
  78. data/app/views/layouts/spark/default.html.slim +3 -5
  79. data/lib/fleetio_spark.rb +3 -0
  80. data/lib/fleetio_spark/component.rb +19 -0
  81. data/lib/fleetio_spark/version.rb +1 -1
  82. data/public/code-0.2.32.js +2 -0
  83. data/public/code-0.2.32.js.gz +0 -0
  84. data/public/code-0.2.32.js.map +1 -0
  85. data/public/spark-0.2.32.css +1 -0
  86. data/public/spark-0.2.32.css.gz +0 -0
  87. data/public/spark-0.2.32.js +2 -0
  88. data/public/spark-0.2.32.js.gz +0 -0
  89. data/public/spark-0.2.32.js.map +1 -0
  90. metadata +47 -16
  91. data/public/code-0.2.31.js +0 -2
  92. data/public/code-0.2.31.js.gz +0 -0
  93. data/public/code-0.2.31.js.map +0 -1
  94. data/public/spark-0.2.31.css +0 -1
  95. data/public/spark-0.2.31.css.gz +0 -0
  96. data/public/spark-0.2.31.js +0 -2
  97. data/public/spark-0.2.31.js.gz +0 -0
  98. data/public/spark-0.2.31.js.map +0 -1
@@ -18,9 +18,9 @@
18
18
  position: absolute;
19
19
  left: -$app-sidebar-width;
20
20
  max-height: 100vh;
21
-
21
+
22
22
  // Revealed sidebar styles
23
- .show-sidebar & {
23
+ .nav-active & {
24
24
  height: auto;
25
25
  position: static;
26
26
  }
@@ -1,8 +1,8 @@
1
1
  .app-sidebar-toggle {
2
2
  display: none;
3
3
  position: relative;
4
- left: -11px;
5
- margin-right: 4px;
4
+ margin-right: $pad-lg;
5
+ margin-left: -6px;
6
6
  z-index: 11;
7
7
 
8
8
  .with-sidebar & { display: block; }
@@ -31,7 +31,7 @@
31
31
  }
32
32
  }
33
33
 
34
- .icon-wrapper {
34
+ .nav-toggle-icon-wrapper {
35
35
  &:focus, &:hover {
36
36
  background: none;
37
37
  }
@@ -0,0 +1,119 @@
1
+ @mixin spark-switch-size($width: 46px, $height: 24px) {
2
+ $tick-width: ($width - 6)/2;
3
+ .spark-switch-panel {
4
+ width: $width;
5
+ height: $height;
6
+ border-radius: $height;
7
+ }
8
+
9
+ .spark-switch-tick {
10
+ width: $tick-width;
11
+ height: $height - 4;
12
+ border-radius: $height;
13
+ }
14
+
15
+ .spark-switch-input {
16
+ @include input-active {
17
+ ~ .spark-switch-panel {
18
+ box-shadow: 0 0 0 3px rgba(101, 133, 255, 0.5);
19
+ // transform: scale(1.1) translate3d( $tick-width , 0, 0 );
20
+ }
21
+ }
22
+ &[disabled] {
23
+ ~ .spark-switch-panel {
24
+ box-shadow: none;
25
+ }
26
+ }
27
+ }
28
+
29
+ input:checked + .spark-switch-panel .spark-switch-tick {
30
+ transform: translate3d( $tick-width + 2 , 0, 0 );
31
+ }
32
+ }
33
+
34
+ .spark-switch {
35
+ @include spark-switch-size();
36
+
37
+ .label-text {
38
+ margin-right: $pad-base;
39
+ padding-bottom: 0;
40
+ line-height: 1.5em;
41
+ }
42
+
43
+ &-label {
44
+ display: flex;
45
+ position: relative;
46
+ align-items: center;
47
+ flex: 1 0 auto;
48
+ transition: box-shadow, background-color;
49
+ cursor: pointer;
50
+ // justify-content: space-between;
51
+
52
+ *, *:before, *:after {
53
+ transition-duration: $duration;
54
+ transition-timing-function: $timing;
55
+ }
56
+ }
57
+
58
+ &-panel {
59
+ background: $fl-gray-300;
60
+ position: relative;
61
+ transition-property: background, box-shadow, border-color;
62
+ box-shadow: input-shadow( rgba( $fl-gray-300, .1 ) );
63
+ }
64
+
65
+ &-tick {
66
+ background: $fl-white;
67
+ position: absolute;
68
+ bottom: 2px;
69
+ left: 2px;
70
+ transition-property: transform;
71
+ transform: translate3d( 0, 0, 0 );
72
+ box-shadow: 0 1px 4px rgba($fl-gray-300, .4);
73
+ font-weight: 500;
74
+ }
75
+
76
+ &-input {
77
+ position: absolute;
78
+ border: none;
79
+ cursor: pointer;
80
+ opacity: 0;
81
+ z-index: -1;
82
+
83
+ &[disabled] {
84
+ ~ .spark-switch-panel {
85
+ background: rgba($fl-gray-300, 0.5);
86
+ }
87
+ }
88
+ }
89
+
90
+ &-input:checked {
91
+ ~ .spark-switch-panel {
92
+ background: $fl-green-600;
93
+ }
94
+
95
+ &[disabled] {
96
+ ~ .spark-switch-panel {
97
+ background: rgba($fl-green-600, 0.5);
98
+ }
99
+ }
100
+ }
101
+
102
+ &.small {
103
+ @include spark-switch-size(30px, 16px);
104
+ }
105
+
106
+ &.expanded {
107
+ .label-text { margin-right: auto; }
108
+ }
109
+
110
+ &-align-right {
111
+ .spark-switch-label {
112
+ flex-direction: row-reverse;
113
+ }
114
+ .label-text {
115
+ margin-right: 0;
116
+ margin-left: $pad-base;
117
+ }
118
+ }
119
+ }
@@ -0,0 +1,55 @@
1
+ .spark-header {
2
+ padding: $pad-md $pad-lg;
3
+ font-size: 14px;
4
+ font-weight: 600;
5
+ display: flex;
6
+ justify-content: space-between;
7
+
8
+ &-title {
9
+ display: flex;
10
+ align-items: center;
11
+
12
+ > * {
13
+ margin: 0 $pad-sm;
14
+
15
+ &:first-child { margin-left: 0; }
16
+ &:last-child { margin-right: 0; }
17
+ }
18
+
19
+ .tooltip {
20
+ margin-left: 0;
21
+ }
22
+ }
23
+
24
+ &-badge {
25
+ display: inline-flex;
26
+ padding: 0 $pad-base - 1;
27
+ font-size: .9em;
28
+ line-height: 1.4em;
29
+ border-radius: 15px;
30
+ background: $fl-gray-500;
31
+ color: #fff;
32
+ margin-left: $pad-base;
33
+ text-align: center;
34
+ }
35
+
36
+ .tooltip {
37
+ color: $fl-gray-200;
38
+
39
+ &-text {
40
+ background: $fl-gray-900;
41
+ display: none;
42
+ }
43
+ }
44
+
45
+ &-actions {
46
+ display: flex;
47
+ }
48
+
49
+ &-action {
50
+ margin: 0 $pad-sm;
51
+
52
+ &:first-child { margin-left: 0; }
53
+ &:last-child { margin-right: 0; }
54
+ }
55
+ }
@@ -7,10 +7,15 @@
7
7
  font-size: 14px;
8
8
  font-weight: 500;
9
9
  transition: color $duration-short $timing;
10
- color: inherit;
10
+ color: $fl-blue-700;
11
+
12
+ &.active {
13
+ color: $fl-blue-900;
14
+ }
11
15
 
12
16
  &-icon {
13
17
  flex-shrink: 0;
18
+ margin-right: $pad-base;
14
19
  }
15
20
 
16
21
  .expand-icon {
@@ -25,7 +30,6 @@
25
30
  min-width: 0;
26
31
  white-space: nowrap;
27
32
  text-overflow: ellipsis;
28
- overflow: hidden;
29
33
  }
30
34
 
31
35
  &-label {
@@ -1,5 +1,4 @@
1
1
  .spark-nav-pills {
2
- padding: 0 $pad-lg;
3
2
  font-size: $base-size - 1;
4
3
  font-weight: 500;
5
4
 
@@ -50,4 +49,9 @@
50
49
  }
51
50
  }
52
51
  }
52
+
53
+ &.layout-padded {
54
+ padding-left: $pad-lg;
55
+ padding-right: $pad-lg;
56
+ }
53
57
  }
@@ -0,0 +1,100 @@
1
+ .spark-nav-sidebar {
2
+ min-width: 230px;
3
+
4
+ .nav-toggle {
5
+ width: calc(100% + #{2 * $pad-lg});
6
+ background: $fl-white;
7
+ margin: 0 #{-$pad-lg};
8
+ padding: $pad-xs $pad-lg;
9
+
10
+ &-icon {
11
+ margin-right: -$pad-base;
12
+ }
13
+
14
+ @include at-least($width-base) {
15
+ display: none;
16
+ }
17
+ }
18
+
19
+ &-wrapper {
20
+ @include until($width-base) {
21
+ margin: 0 #{-$pad-lg};
22
+ padding: 0 $pad-lg;
23
+ background: $fl-white;
24
+ border-bottom: 1px solid $fl-gray-100;
25
+ max-height: 0;
26
+ transition: max-height ($duration * 1.5) $timing;
27
+ overflow: hidden;
28
+
29
+ > *:first-child {
30
+ margin-top: $pad-lg;
31
+ }
32
+ }
33
+ }
34
+
35
+ &.nav-active &-wrapper {
36
+ @include until($width-base) {
37
+ max-height: 900px;
38
+ }
39
+ }
40
+
41
+ &-header {
42
+ margin-bottom: $pad-lg;
43
+ }
44
+
45
+ &-title {
46
+ font-size: 16px;
47
+ line-height: 2em;
48
+ border-bottom: 1px solid $fl-gray-100;
49
+ margin-bottom: $pad-base;
50
+ }
51
+
52
+ .nav-group {
53
+ padding-bottom: $pad-md;
54
+ list-style: none;
55
+ &:not(:last-child) {
56
+ margin-bottom: $pad-md;
57
+ border-bottom: 1px solid $fl-gray-50;
58
+ }
59
+ }
60
+
61
+ .nav-item {
62
+ padding: 5px $pad-base;
63
+ border-radius: $radius-base;
64
+
65
+ &:hover, &:focus, &.active {
66
+ background: $fl-white;
67
+
68
+ .nav-item-icon {
69
+ color: $fl-gray-900;
70
+ }
71
+ }
72
+
73
+ &-icon {
74
+ color: $fl-gray-300;
75
+ }
76
+
77
+ &-content {
78
+ color: $fl-blue-600;
79
+ font-size: 13px;
80
+ }
81
+
82
+ &-detail {
83
+ color: $fl-gray-600;
84
+ font-size: .8em;
85
+ }
86
+
87
+ &.active {
88
+ .nav-item-content {
89
+ color: $fl-gray-900;
90
+ }
91
+ .nav-item-detail {
92
+ color: $fl-gray-700;
93
+ }
94
+ }
95
+ }
96
+
97
+ &-title + .nav-group, .nav-group:last-child {
98
+ border-bottom: none;
99
+ }
100
+ }
@@ -7,27 +7,38 @@
7
7
  }
8
8
 
9
9
  .spark-nav-tabs {
10
- max-width: 100%;
10
+ width: 100%;
11
11
  overflow-x: auto;
12
12
  position: relative;
13
13
 
14
14
  .nav-tabs-wrapper {
15
- padding: 0 4px;
16
15
  border-bottom: 1px solid $fl-gray-100;
17
16
  max-height: 80px;
18
- transition: max-height $duration cubic-bezier(0.47, 0, 0.745, 0.715);
17
+ transition: max-height $duration $timing;
19
18
  position: relative;
20
19
 
21
- .app-content-header & {
20
+ .spark-page-header & {
22
21
  border-bottom-color: $fl-gray-50;
23
22
  }
24
23
  }
25
24
 
25
+ .nav-tab-wrapper {
26
+ padding: 0 $pad-md;
27
+
28
+ &:first-child { padding-left: 0; }
29
+ &:last-child { padding-right: 0; }
30
+ }
31
+
26
32
  .nav-toggle {
33
+ width: 100%;
34
+ background: $fl-white;
35
+ padding: $pad-xs $pad-lg;
27
36
  display: none;
28
- padding: { top: $pad-xs; right: $pad-sm; }
29
- position: absolute;
30
- top: 0; right: 0;
37
+ margin: -1px 0 0;
38
+
39
+ &-icon {
40
+ margin-right: -$pad-base;
41
+ }
31
42
  }
32
43
 
33
44
  .nav-group {
@@ -43,11 +54,7 @@
43
54
  color: $fl-gray-500;
44
55
  border-bottom: 2px solid transparent;
45
56
  padding: ($pad-base + 1) 0;
46
- margin: {
47
- left: $pad-md;
48
- right: $pad-md;
49
- bottom: -1px;
50
- }
57
+ margin-bottom: -1px;
51
58
 
52
59
  &:hover, &:focus {
53
60
  border-color: $fl-gray-100;
@@ -76,9 +83,7 @@
76
83
 
77
84
  // Show nav-toggle control
78
85
  .nav-toggle {
79
- display: block;
80
- animation: fade-in $duration $timing;
81
- cursor: pointer;
86
+ display: flex;
82
87
  }
83
88
 
84
89
  .nav-group {
@@ -86,42 +91,27 @@
86
91
  }
87
92
 
88
93
  .nav-item {
89
- &.active {
90
- border-color: transparent;
91
- }
92
- }
93
-
94
- .nav-item:not(.active) {
94
+ padding: 0 $pad-lg;
95
95
  transition: padding $duration cubic-bezier(0.47, 0, 0.745, 0.715);
96
- padding: 0;
96
+ border-bottom: 1px solid $fl-gray-100;
97
97
  }
98
98
 
99
99
  // Hide all nav elements but the active one.
100
100
  .nav-tab-wrapper {
101
- margin-right: 28px;
102
-
103
- &:not(.active) {
104
- opacity: 0;
105
- max-height: 0px;
106
- overflow-y: hidden;
107
- transition: $duration * 1.5 cubic-bezier(0.39, 0.575, 0.565, 1);
108
- transition-property: opacity, max-height;
109
-
110
- .nav-item {
111
- border-bottom: 1px solid $fl-gray-100;
112
- }
113
- }
114
-
115
-
116
- // Don't permit click on active tab
117
- // It is probably unintentional, expecting to open the menu
118
- &.active {
119
- pointer-events: none;
120
- }
101
+ padding: 0;
102
+ opacity: 0;
103
+ max-height: 0px;
104
+ overflow-y: hidden;
105
+ transition: $duration * 1.5 cubic-bezier(0.39, 0.575, 0.565, 1);
106
+ transition-property: opacity, max-height;
121
107
  }
122
108
 
123
109
  // Triggered by clicking nav-toggle
124
- &.nav-expanded {
110
+ &.nav-active {
111
+
112
+ .nav-toggle {
113
+ border-bottom: 1px solid $fl-gray-100;
114
+ }
125
115
 
126
116
  // Expand panel containing tabs
127
117
  .nav-tabs-wrapper {
@@ -137,7 +127,7 @@
137
127
  }
138
128
 
139
129
  .nav-item {
140
- padding: ($pad-base + 1) 0;
130
+ padding: ($pad-base + 1) $pad-lg;
141
131
  &:hover, &:focus {
142
132
  background-color: $fl-gray-50;
143
133
  }
@@ -148,25 +138,20 @@
148
138
  }
149
139
  }
150
140
  }
151
- .main-body & {
152
- .nav-tabs-wrapper {
153
- padding: 0;
154
- }
155
- .nav-tab-wrapper:first-child .nav-item {
156
- margin-left: 0;
141
+
142
+ .spark-page-header-nav & {
143
+ .nav-toggle {
144
+ right: $pad-base;
157
145
  }
158
- .nav-tab-wrapper:last-child .nav-item {
159
- margin-right: 0;
146
+ }
147
+
148
+ &.layout-padded:not(.collapse-tabs) {
149
+ .nav-tab-wrapper:first-child {
150
+ padding-left: $pad-lg;
160
151
  }
161
- &.collapse-tabs {
162
- .nav-item {
163
- margin-right: 0;
164
- margin-left: 0;
165
- margin-bottom: 0;
166
- }
167
- .nav-tab-wrapper {
168
- margin-right: 44px;
169
- }
152
+ .nav-tab-wrapper:last-child {
153
+ padding-right: $pad-lg;
170
154
  }
171
155
  }
172
156
  }
157
+