dvl-core 0.0.4 → 0.0.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.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/dvl/{core/components → components}/flashes.rb +1 -1
- data/lib/dvl/{core/components → components}/footer.rb +1 -1
- data/lib/dvl/components/modal.rb +24 -0
- data/lib/dvl/core/version.rb +1 -1
- data/lib/dvl/core.rb +7 -11
- data/preview/app.rb +19 -16
- data/spec/dvl_flashes_spec.rb +1 -1
- data/spec/main_spec.rb +10 -8
- data/spec/spec_helper.rb +4 -18
- data/vendor/assets/stylesheets/dvl/core/modals.scss +40 -20
- data/vendor/assets/stylesheets/dvl/core/typography.scss +6 -8
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc2345f55387cc09bb5531eb7ae72c4ee9f45502
|
4
|
+
data.tar.gz: b17acdbf412ed3f8c82f094168d44fb7af2db5f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fda03c9527f401603ff5100b7e628b98adb33884578bf9018ce69484f176dbe28c07446ca400488e5eea976859de8154dc1c485da8f14d414a78a149c656293
|
7
|
+
data.tar.gz: 7fa211bbd00527a19a6e78222df7b268e44a887a92830c5a9b3a01766d7b63f4c34c293442032d7ac0306b50abdf6945bea979c40bf5399fa170f6f793b16322
|
data/README.md
CHANGED
@@ -33,6 +33,11 @@ gem 'dvl-core'
|
|
33
33
|

|
34
34
|

|
35
35
|
|
36
|
+
### Modals
|
37
|
+
|
38
|
+

|
39
|
+

|
40
|
+
|
36
41
|
## Development
|
37
42
|
|
38
43
|
1. `script/bootstrap`
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class Dvl::Components::Modal < Erector::Widget
|
2
|
+
needs :title,
|
3
|
+
id: nil,
|
4
|
+
html_opts: {}
|
5
|
+
|
6
|
+
def content
|
7
|
+
div(@html_opts.merge(class: "modal #{@html_opts[:class]}", tabindex: '-1', id: @id)) {
|
8
|
+
div.modal_dialog {
|
9
|
+
div.modal_content {
|
10
|
+
div.modal_header {
|
11
|
+
a.close '×'.html_safe, 'data-dismiss' => 'modal'
|
12
|
+
h3 @title.html_safe
|
13
|
+
}
|
14
|
+
|
15
|
+
modal_content
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def modal_content
|
22
|
+
call_block
|
23
|
+
end
|
24
|
+
end
|
data/lib/dvl/core/version.rb
CHANGED
data/lib/dvl/core.rb
CHANGED
@@ -1,21 +1,17 @@
|
|
1
1
|
require 'dvl/core/version'
|
2
2
|
|
3
|
-
|
4
|
-
module
|
5
|
-
|
3
|
+
module Dvl
|
4
|
+
module Core
|
5
|
+
if defined?(Rails)
|
6
6
|
class Engine < ::Rails::Engine
|
7
|
-
# nada
|
8
7
|
end
|
9
8
|
end
|
10
9
|
end
|
11
|
-
end
|
12
10
|
|
13
|
-
module
|
14
|
-
module Core
|
15
|
-
module Components
|
16
|
-
end
|
11
|
+
module Components
|
17
12
|
end
|
18
13
|
end
|
19
14
|
|
20
|
-
require 'dvl/
|
21
|
-
require 'dvl/
|
15
|
+
require 'dvl/components/footer'
|
16
|
+
require 'dvl/components/flashes'
|
17
|
+
require 'dvl/components/modal'
|
data/preview/app.rb
CHANGED
@@ -169,24 +169,27 @@ module Views
|
|
169
169
|
|
170
170
|
docs 'Modals' do
|
171
171
|
a 'Open modal', 'data-toggle' => 'modal', href: '#modal'
|
172
|
-
|
173
|
-
div.
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
h3 'Awesome modal'.html_safe
|
178
|
-
}
|
172
|
+
widget Dvl::Components::Modal.new(title: 'Awesome modal', id: 'modal') do
|
173
|
+
div.modal_body {
|
174
|
+
text 'This is the modal body!'
|
175
|
+
}
|
176
|
+
end
|
179
177
|
|
180
|
-
|
181
|
-
text 'This is the modal body!'
|
182
|
-
}
|
178
|
+
br
|
183
179
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
180
|
+
a 'Confirmation modal', 'data-toggle' => 'modal', href: '#confirmModal'
|
181
|
+
widget Dvl::Components::Modal.new(
|
182
|
+
title: 'Are you sure?',
|
183
|
+
id: 'confirmModal',
|
184
|
+
html_opts: { class: 'modal_confirm' }
|
185
|
+
) do
|
186
|
+
div.modal_body {
|
187
|
+
text 'Are you sure?'
|
188
188
|
}
|
189
|
-
|
189
|
+
div.modal_footer {
|
190
|
+
a.button.error 'OK'
|
191
|
+
}
|
192
|
+
end
|
190
193
|
end
|
191
194
|
|
192
195
|
docs 'Pagination' do
|
@@ -295,7 +298,7 @@ module Views
|
|
295
298
|
def main
|
296
299
|
br
|
297
300
|
br
|
298
|
-
widget Dvl::
|
301
|
+
widget Dvl::Components::Footer.new(application_name: 'dvl-core')
|
299
302
|
end
|
300
303
|
end
|
301
304
|
end
|
data/spec/dvl_flashes_spec.rb
CHANGED
data/spec/main_spec.rb
CHANGED
@@ -2,13 +2,15 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'Main' do
|
4
4
|
describe 'Screenshots', type: :feature, js: true do
|
5
|
-
take_screenshot '/', 'core_1200', 1200, 1000, full: true
|
6
|
-
take_screenshot '/', 'core_760', 760, 1000, full: true
|
7
|
-
take_screenshot '/', 'core_400', 400, 1000, full: true
|
8
|
-
take_screenshot '/footer', 'footer', 1000,
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
take_screenshot '/', 'core_1200', res_x: 1200, res_y: 1000, full: true
|
6
|
+
take_screenshot '/', 'core_760', res_x: 760, res_y: 1000, full: true
|
7
|
+
take_screenshot '/', 'core_400', res_x: 400, res_y: 1000, full: true
|
8
|
+
take_screenshot '/footer', 'footer', res_x: 1000, res_y: 200
|
9
|
+
take_screenshot '/flashes', 'flash_error', res_y: 100, before: Proc.new { click_link('Error') }
|
10
|
+
take_screenshot '/flashes', 'flash_success', res_y: 100, before: Proc.new { click_link('Success') }
|
11
|
+
take_screenshot '/flashes', 'flash_info', res_y: 100, before: Proc.new { click_link('Info') }
|
12
|
+
take_screenshot '/flashes', 'flash_error_mobile', res_x: 320, res_y: 100, before: Proc.new { click_link('Error') }
|
13
|
+
take_screenshot '/', 'modal', res_x: 1000, res_y: 250, before: Proc.new { click_link('Open modal') }
|
14
|
+
take_screenshot '/', 'confirm_modal', res_x: 1000, res_y: 250, before: Proc.new { click_link('Confirmation modal') }
|
13
15
|
end
|
14
16
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -9,30 +9,16 @@ require_relative '../preview/app'
|
|
9
9
|
Capybara.app = App
|
10
10
|
Capybara.javascript_driver = :poltergeist
|
11
11
|
|
12
|
-
def take_screenshot(path, name,
|
12
|
+
def take_screenshot(path, name, opts = {})
|
13
13
|
describe "taking screenshot: #{name}.png" do
|
14
14
|
before do
|
15
|
-
page.driver.resize(res_x, res_y)
|
15
|
+
page.driver.resize(opts[:res_x] || 900, opts[:res_y] || 500)
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'works' do
|
19
19
|
visit path
|
20
|
-
|
20
|
+
self.instance_eval(&opts[:before]) if opts[:before]
|
21
|
+
page.save_screenshot "screenshots/#{name}.png", opts.slice(:full)
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
24
|
-
|
25
|
-
def take_flash_screenshot(type, name, res_x = 900, res_y = 150, opts = {})
|
26
|
-
describe "taking flash screenshot: #{name}.png" do
|
27
|
-
before do
|
28
|
-
page.driver.resize(res_x, res_y)
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'works' do
|
32
|
-
visit '/flashes'
|
33
|
-
click_link type
|
34
|
-
page.save_screenshot "screenshots/#{name}.png", opts
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
@@ -46,10 +46,23 @@
|
|
46
46
|
position: relative;
|
47
47
|
background-color: #fff;
|
48
48
|
border: 1px solid rgba(#000,0.15);
|
49
|
-
border-radius: $radius
|
49
|
+
border-radius: $radius;
|
50
50
|
background-clip: padding-box;
|
51
51
|
// Remove focus outline from opened modal
|
52
52
|
outline: 0;
|
53
|
+
box-shadow: 0 1px 3px rgba(#000,0.18);
|
54
|
+
animation: modal_show 0.25s ease-out;
|
55
|
+
}
|
56
|
+
|
57
|
+
@keyframes modal_show {
|
58
|
+
0% {
|
59
|
+
opacity: 0;
|
60
|
+
transform: scale(0.93);
|
61
|
+
}
|
62
|
+
100% {
|
63
|
+
opacity: 1;
|
64
|
+
transform: scale(1);
|
65
|
+
}
|
53
66
|
}
|
54
67
|
|
55
68
|
// Modal background
|
@@ -60,11 +73,15 @@
|
|
60
73
|
bottom: 0;
|
61
74
|
left: 0;
|
62
75
|
background-color: #000;
|
63
|
-
|
64
|
-
|
76
|
+
opacity: 0.5;
|
77
|
+
animation: fade_half 170ms ease-in;
|
78
|
+
}
|
79
|
+
|
80
|
+
@keyframes fade_half {
|
81
|
+
0% {
|
65
82
|
opacity: 0;
|
66
83
|
}
|
67
|
-
|
84
|
+
100% {
|
68
85
|
opacity: 0.5;
|
69
86
|
}
|
70
87
|
}
|
@@ -75,29 +92,26 @@
|
|
75
92
|
padding: 1rem 2rem;
|
76
93
|
background-color: #f0f0f0;
|
77
94
|
margin-bottom: 1rem;
|
78
|
-
@include border_top_radius(($radius * 2) - 1);
|
79
95
|
position: relative;
|
96
|
+
padding: 0.5rem 1.75rem;
|
80
97
|
h3 {
|
81
|
-
font-size: 1.
|
82
|
-
font-weight:
|
98
|
+
font-size: 1.35rem;
|
99
|
+
font-weight: 600;
|
83
100
|
margin: 0;
|
84
|
-
color: #
|
101
|
+
color: #444;
|
102
|
+
line-height: 2rem;
|
85
103
|
}
|
86
104
|
.close {
|
87
|
-
|
88
|
-
|
89
|
-
right: -9px;
|
90
|
-
color: #fff;
|
91
|
-
background-color: $darkestGray;
|
92
|
-
border-radius: 50%;
|
93
|
-
width: 24px;
|
94
|
-
height: 24px;
|
105
|
+
float: right;
|
106
|
+
color: rgba(#000,0.6);
|
95
107
|
text-decoration: none;
|
96
|
-
text-align:
|
97
|
-
font-size:
|
98
|
-
|
108
|
+
text-align: right;
|
109
|
+
font-size: 2rem;
|
110
|
+
font-weight: 300;
|
111
|
+
line-height: 2rem;
|
112
|
+
width: 2rem;
|
99
113
|
&:hover {
|
100
|
-
|
114
|
+
color: rgba(#000,0.75);
|
101
115
|
}
|
102
116
|
}
|
103
117
|
}
|
@@ -149,6 +163,12 @@
|
|
149
163
|
color: #fff;
|
150
164
|
}
|
151
165
|
}
|
166
|
+
.close {
|
167
|
+
color: rgba(#fff,0.8);
|
168
|
+
&:hover {
|
169
|
+
color: rgba(#fff,0.92);
|
170
|
+
}
|
171
|
+
}
|
152
172
|
.modal_body p {
|
153
173
|
font-size: 1.1rem;
|
154
174
|
margin-bottom: 0;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dvl-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Becker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -177,9 +177,10 @@ files:
|
|
177
177
|
- circle.yml
|
178
178
|
- config/locales/en.yml
|
179
179
|
- dvl-core.gemspec
|
180
|
+
- lib/dvl/components/flashes.rb
|
181
|
+
- lib/dvl/components/footer.rb
|
182
|
+
- lib/dvl/components/modal.rb
|
180
183
|
- lib/dvl/core.rb
|
181
|
-
- lib/dvl/core/components/flashes.rb
|
182
|
-
- lib/dvl/core/components/footer.rb
|
183
184
|
- lib/dvl/core/version.rb
|
184
185
|
- preview/app.rb
|
185
186
|
- script/bootstrap
|