Skip to content

Commit 130ecd4

Browse files
committed
Merge branch 'develop' of github.com:basemate/matestack-ui-core into issue-183
2 parents 2ab910c + 444f59e commit 130ecd4

File tree

24 files changed

+492
-11
lines changed

24 files changed

+492
-11
lines changed

Gemfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ gemspec
1111
# Git. Remember to move these dependencies to your gemspec before releasing
1212
# your gem to rubygems.org.
1313

14-
# To use a debugger
15-
# gem 'byebug', group: [:development, :test]
16-
# gem 'pry-byebug', group: [:development, :test]
17-
1814
gem "trailblazer"
1915
gem "trailblazer-rails"
2016
gem "trailblazer-cells"
@@ -31,6 +27,7 @@ group :development, :test do
3127
gem 'puma'
3228
gem 'simplecov', require: false, group: :test
3329
gem 'byebug'
30+
# gem 'pry-byebug'
3431
gem 'webmock'
3532
gem 'webdrivers', '~> 4.1'
3633
end

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
matestack-ui-core (0.7.2.1)
4+
matestack-ui-core (0.7.3)
55
cells-haml
66
cells-rails
77
haml
@@ -84,7 +84,7 @@ GEM
8484
concurrent-ruby (1.1.5)
8585
crack (0.4.3)
8686
safe_yaml (~> 1.0.0)
87-
crass (1.0.4)
87+
crass (1.0.5)
8888
declarative (0.0.10)
8989
declarative-builder (0.1.0)
9090
declarative-option (< 0.2.0)
@@ -111,7 +111,7 @@ GEM
111111
i18n (1.6.0)
112112
concurrent-ruby (~> 1.0)
113113
json (2.1.0)
114-
loofah (2.2.3)
114+
loofah (2.3.1)
115115
crass (~> 1.0.2)
116116
nokogiri (>= 1.5.9)
117117
mail (2.7.1)
@@ -124,7 +124,7 @@ GEM
124124
mini_portile2 (2.4.0)
125125
minitest (5.11.3)
126126
nio4r (2.5.2)
127-
nokogiri (1.10.4)
127+
nokogiri (1.10.5)
128128
mini_portile2 (~> 2.4.0)
129129
pipetree (0.1.1)
130130
poltergeist (1.18.1)
@@ -191,7 +191,7 @@ GEM
191191
rspec-mocks (~> 3.8.0)
192192
rspec-support (~> 3.8.0)
193193
rspec-support (3.8.0)
194-
rubyzip (1.2.2)
194+
rubyzip (1.3.0)
195195
safe_yaml (1.0.5)
196196
selenium-webdriver (3.14.1)
197197
childprocess (~> 0.5)
@@ -201,7 +201,7 @@ GEM
201201
json (>= 1.8, < 3)
202202
simplecov-html (~> 0.10.0)
203203
simplecov-html (0.10.2)
204-
sprockets (3.7.2)
204+
sprockets (4.0.0)
205205
concurrent-ruby (~> 1.0)
206206
rack (> 1, < 3)
207207
sprockets-rails (3.2.1)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%bdi{@tag_attributes}
2+
- if options[:text].blank? && block_given?
3+
= yield
4+
- else
5+
= options[:text]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Matestack::Ui::Core::Bdi
2+
class Bdi < Matestack::Ui::Core::Component::Static
3+
end
4+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%data{@tag_attributes}
2+
- if options[:text].blank? && block_given?
3+
= yield
4+
- else
5+
= options[:text]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Matestack::Ui::Core::Data
2+
class Data < Matestack::Ui::Core::Component::Static
3+
def setup
4+
@tag_attributes.merge!({
5+
"value": options[:value] ||= nil
6+
})
7+
end
8+
end
9+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%iframe{@tag_attributes}
2+
- if options[:text].nil? && block_given?
3+
= yield
4+
- else
5+
= options[:text]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Matestack::Ui::Core::Iframe
2+
class Iframe < Matestack::Ui::Core::Component::Static
3+
4+
def setup
5+
@tag_attributes.merge!({
6+
src: options[:src],
7+
height: options[:height],
8+
width: options[:width],
9+
srcdoc: options[:srcdoc]
10+
})
11+
end
12+
13+
end
14+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%samp{@tag_attributes}
2+
- if options[:text].blank? && block_given?
3+
= yield
4+
- else
5+
= options[:text]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Matestack::Ui::Core::Samp
2+
class Samp < Matestack::Ui::Core::Component::Static
3+
end
4+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
%wbr{@tag_attributes}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Matestack::Ui::Core::Wbr
2+
class Wbr < Matestack::Ui::Core::Component::Static
3+
end
4+
end

docs/components/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ You can build your [own components](/docs/extend/README.md) as well, both static
1212
- [article](/docs/components/article.md)
1313
- [aside](/docs/components/aside.md)
1414
- [b](/docs/components/b.md)
15+
- [bdi](/docs/components/bdi.md)
1516
- [blockquote](/docs/components/blockquote.md)
1617
- [br](/docs/components/br.md)
1718
- [button](/docs/components/button.md)
1819
- [caption](/docs/components/caption.md)
1920
- [cite](/docs/components/cite.md)
2021
- [code](/docs/components/code.md)
22+
- [data](/docs/components/data.md)
2123
- [dl](/docs/components/dl.md)
2224
- dd
2325
- dt
@@ -59,6 +61,7 @@ You can build your [own components](/docs/extend/README.md) as well, both static
5961
- [rt](/docs/components/rb.md)
6062
- [ruby](/docs/components/ruby.md)
6163
- [s](/docs/components/s.md)
64+
- [samp](/docs/components/samp.md)
6265
- [section](/docs/components/section.md)
6366
- [small](/docs/components/small.md)
6467
- [span](/docs/components/span.md)
@@ -72,6 +75,7 @@ You can build your [own components](/docs/extend/README.md) as well, both static
7275
- [var](/docs/components/var.md)
7376
- [video](/docs/components/video.md)
7477
- [youtube](/docs/components/youtube.md)
78+
- [wbr](/docs/components/wbr.md)
7579

7680
## Dynamic Core Components
7781

docs/components/bdi.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# matestack core component: Bdi
2+
3+
Show [specs](/spec/usage/components/bdi_spec.rb)
4+
5+
The HTML `<bdi>` tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take 2 optional configuration params and either yield content or display what gets passed to the `text` configuration param.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the `<bdi>` should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the `<bdi>` should have.
16+
17+
## Example 1: Yield a given block
18+
19+
```ruby
20+
bdi id: 'foo', class: 'bar' do
21+
plain 'Bdi example 1' # optional content
22+
end
23+
```
24+
25+
returns
26+
27+
```html
28+
<bdi id="foo" class="bar">
29+
Bdi example 1
30+
</bdi>
31+
```
32+
33+
## Example 2: Render `options[:text]` param
34+
35+
```ruby
36+
bdi id: 'foo', class: 'bar', text: 'Bdi example 2'
37+
```
38+
39+
returns
40+
41+
```html
42+
<bdi id="foo" class="bar">
43+
Bdi example 2
44+
</bdi>

docs/components/data.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# matestack core component: Data
2+
3+
Show [specs](/spec/usage/components/data_spec.rb)
4+
5+
The HTML `<data>` tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take 2 optional configuration params and either yield content or display what gets passed to the `text` configuration param.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the `<data>` should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the `<data>` should have.
16+
17+
#### # value (optional)
18+
Expects a string and specifies the machine-readable translation of the content of the `<data>` element.
19+
20+
## Example 1: Yield a given block
21+
22+
```ruby
23+
data id: 'foo', class: 'bar', value: '1300' do
24+
plain 'Data example 1' # optional content
25+
end
26+
```
27+
28+
returns
29+
30+
```html
31+
<data id="foo" class="bar" value="1300">
32+
Data example 1
33+
</data>
34+
```
35+
36+
## Example 2: Render `options[:text]` param
37+
38+
```ruby
39+
data id: 'foo', class: 'bar', value: '1301', text: 'Data example 2'
40+
```
41+
42+
returns
43+
44+
```html
45+
<data id="foo" class="bar" value="1301">
46+
Data example 2
47+
</data>

docs/components/iframe.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# matestack core component: Iframe
2+
3+
Show [specs](/spec/usage/components/iframe_spec.rb)
4+
5+
The HTML iframe tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take 3 configuration params and either yield content or display what gets passed to the `text` configuration param.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the `iframe` should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the `iframe` should have for styling purpose.
16+
17+
#### # height (optional)
18+
Specifies the height of an `iframe`.
19+
20+
#### # width (optional)
21+
Specifies the width of an `iframe`.
22+
23+
#### # src
24+
Specifies the address of the document to embed in the `iframe` tag.
25+
26+
#### # srcdoc
27+
Specifies the HTML content of the page to show in the inline frame.
28+
29+
## Example 1: Yield a given block
30+
31+
```ruby
32+
iframe id: "foo", class: "bar", src="https://www.demopage.com" do
33+
plain 'The browser does not support iframe.'
34+
end
35+
```
36+
37+
returns
38+
39+
```html
40+
<iframe id="foo" class="bar" src="https://www.demopage.com">
41+
The browser does not support iframe.
42+
</iframe>
43+
```
44+
45+
## Example 2: Render options[:text] param
46+
47+
```ruby
48+
iframe id: "foo", class: "bar", src="https://www.demopage.com", text: 'The browser does not support iframe.'
49+
```
50+
51+
returns
52+
53+
```html
54+
<iframe id="foo" class="bar" src="https://www.demopage.com">
55+
The browser does not support iframe.
56+
</iframe>
57+
```
58+

docs/components/samp.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# matestack core component: Samp
2+
3+
Show [specs](/spec/usage/components/samp_spec.rb)
4+
5+
The HTML `<samp>` tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take 2 optional configuration params and either yield content or display what gets passed to the `text` configuration param.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the `<samp>` should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the `<samp>` should have.
16+
17+
## Example 1: Yield a given block
18+
19+
```ruby
20+
samp id: 'foo', class: 'bar' do
21+
plain 'Samp example 1' # optional content
22+
end
23+
```
24+
25+
returns
26+
27+
```html
28+
<samp id="foo" class="bar">
29+
Samp example 1
30+
</samp>
31+
```
32+
33+
## Example 2: Render `options[:text]` param
34+
35+
```ruby
36+
samp id: 'foo', class: 'bar', text: 'Samp example 2'
37+
```
38+
39+
returns
40+
41+
```html
42+
<samp id="foo" class="bar">
43+
Samp example 2
44+
</samp>

docs/components/wbr.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# matestack core component: Wbr
2+
3+
Show [specs](/spec/usage/components/wbr_spec.rb)
4+
5+
The HTML `<wbr>` tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take 2 optional configuration params.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the `<wbr>` should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the `<wbr>` should have.
16+
17+
## Example 1: Usage
18+
19+
```ruby
20+
paragraph do
21+
plain 'First part of text'
22+
wbr id: 'foo', class: 'bar'
23+
plain 'Second part of text'
24+
end
25+
```
26+
27+
returns
28+
29+
```html
30+
<p>First part of text<wbr id="foo" class="bar">Second part of text</p>
31+
```

0 commit comments

Comments
 (0)