Skip to content

Commit 29fa9c8

Browse files
Merge branch 'develop' into document_link_param_option
2 parents dfe8b09 + 3a2502b commit 29fa9c8

File tree

50 files changed

+974
-116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+974
-116
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ gemspec
1313

1414
# To use a debugger
1515
# gem 'byebug', group: [:development, :test]
16+
# gem 'pry-byebug', group: [:development, :test]
1617

1718
gem "trailblazer"
1819
gem "trailblazer-rails"

app/concepts/matestack/ui/core/app/app.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class App < Trailblazer::Cell
1717
include ActionView::Helpers::JavaScriptHelper
1818
include ActionView::Helpers::NumberHelper
1919
include ActionView::Helpers::OutputSafetyHelper
20-
include ActionView::Helpers::RecordTagHelper
2120
# include ActionView::Helpers::RenderingHelper
2221
include ActionView::Helpers::SanitizeHelper
2322
include ActionView::Helpers::TagHelper

app/concepts/matestack/ui/core/component/dynamic.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class Dynamic < Trailblazer::Cell
1818
include ActionView::Helpers::JavaScriptHelper
1919
include ActionView::Helpers::NumberHelper
2020
include ActionView::Helpers::OutputSafetyHelper
21-
include ActionView::Helpers::RecordTagHelper
2221
# include ActionView::Helpers::RenderingHelper
2322
include ActionView::Helpers::SanitizeHelper
2423
include ActionView::Helpers::TagHelper
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%fieldset{@tag_attributes}
2+
-if options[:text].nil? && 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::Fieldset
2+
class Fieldset < Matestack::Ui::Core::Component::Static
3+
def setup
4+
@tag_attributes.merge!({
5+
disabled: options[:disabled]
6+
})
7+
end
8+
end
9+
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
%figure{@tag_attributes}
2+
- if block_given?
3+
= yield
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Matestack::Ui::Core::Figure
2+
class Figure < Matestack::Ui::Core::Component::Static
3+
4+
end
5+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%ins{@tag_attributes}
2+
- if options[:text].nil? && 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::Ins
2+
class Ins < Matestack::Ui::Core::Component::Static
3+
def setup
4+
@tag_attributes.merge!({
5+
cite: options[:cite],
6+
datetime: options[:datetime]
7+
})
8+
end
9+
end

app/concepts/matestack/ui/core/js/core.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import html from 'html/html'
1010
import transition from 'transition/transition'
1111
import action from 'action/action'
1212
import form from 'form/form'
13-
import view from 'view/view'
1413
import onclick from 'onclick/onclick'
1514
import collectionContent from 'collection/content/content'
1615
import collectionFilter from 'collection/filter/filter'
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
module Matestack::Ui::Core::Label
22
class Label < Matestack::Ui::Core::Component::Static
3-
3+
def setup
4+
@tag_attributes.merge!({
5+
for: options[:for],
6+
form: options[:form]
7+
})
8+
end
49
end
510
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%mark{@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::Mark
2+
class Mark < Matestack::Ui::Core::Component::Static
3+
end
4+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
%meter{@tag_attributes}
2+
- if block_given?
3+
= yield
4+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Matestack::Ui::Core::Meter
2+
class Meter < Matestack::Ui::Core::Component::Static
3+
def setup
4+
@tag_attributes.merge!({
5+
value: options[:value],
6+
min: options[:min],
7+
max: options[:max],
8+
low: options[:low],
9+
high: options[:high],
10+
optimum: options[:optimum]
11+
})
12+
end
13+
end
14+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
%var{@tag_attributes}
2+
- if options[:text].nil? && 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::Var
2+
class Var < Matestack::Ui::Core::Component::Static
3+
end
4+
end

app/concepts/matestack/ui/core/view/view.haml

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/concepts/matestack/ui/core/view/view.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

app/concepts/matestack/ui/core/view/view.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

config/routes.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Matestack::Ui::Core::Engine.routes.draw do
2-
get '/div', to: 'docs#div'
32
end

docs/architecture/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In this section, we take a deep dive into how Matestack is implemented.
44

55
**The Matestack core was developed while iterating concepts following the main goal of `just making it work`. Therefore, the core is not yet well engineered in some places. After we were happy with it working, we've spent quite some time writing tests to save the status quo, and now we're about to refactor the core.**
66

7-
Please refer to the [detailed architectural drawing](/docs/architecture/matestack_rendering.png) while reading the following documentation.
7+
Please refer to the [detailed architectural drawing](https://raw.githubusercontent.com/basemate/matestack-ui-core/master/docs/architecture/matestack_rendering.png) while reading the following documentation.
88

99
## Example
1010

docs/components/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ You can build your [own components](/docs/extend/custom_components.md) as well,
55

66
## Static Core Components
77

8+
- [b](/docs/components/b.md)
9+
- [br](/docs/components/br.md)
810
- [div](/docs/components/div.md)
9-
- [header](/docs/components/header.md)
11+
- [figure](/docs/components/figure.md)
1012
- [footer](/docs/components/footer.md)
13+
- [header](/docs/components/header.md)
14+
- [heading](/docs/components/heading.md)
15+
- [kbd](/docs/components/kbd.md)
16+
- [hr](/docs/components/hr.md)
17+
- [icon](/docs/components/icon.md)
18+
- [ins](/docs/components/ins.md)
1119
- [main](/docs/components/main.md)
1220
- [nav](/docs/components/nav.md)
13-
- [section](/docs/components/section.md)
14-
- [br](/docs/components/br.md)
15-
- [hr](/docs/components/hr.md)
16-
- [heading](/docs/components/heading.md)
1721
- [plain](/docs/components/plain.md)
1822
- [pg](/docs/components/pg.md)
23+
- [section](/docs/components/section.md)
1924
- [span](/docs/components/span.md)
20-
- [b](/docs/components/b.md)
21-
- [icon](/docs/components/icon.md)
2225
- [list](/docs/components/list.md)
2326
- ul
2427
- ol
@@ -28,7 +31,6 @@ You can build your [own components](/docs/extend/custom_components.md) as well,
2831
- tr
2932
- td
3033
- [img](/docs/components/img.md)
31-
- [video](/docs/components/video.md)
3234
- [button](/docs/components/button.md)
3335
- [link](/docs/components/link.md)
3436
- [label](/docs/components/label.md)
@@ -37,10 +39,12 @@ You can build your [own components](/docs/extend/custom_components.md) as well,
3739
- [rt](/docs/components/rb.md)
3840
- [rp](/docs/components/rt.md)
3941
- [legend](/docs/components/legend.md)
42+
- [mark](/docs/components/mark.md)
4043
- [noscript](/docs/components/noscript.md)
4144
- [sup](/docs/components/sup.md)
4245
- [sub](/docs/components/sub.md)
43-
- [kbd](/docs/components/kbd.md)
46+
- [var](/docs/components/var.md)
47+
- [video](/docs/components/video.md)
4448

4549
## Dynamic Core Components
4650

docs/components/fieldset.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# matestack core component: Fieldset
2+
3+
Show [specs](/spec/usage/components/fieldset_spec.rb)
4+
5+
Use Fieldset to group several `<input>` and `<label>` tags.
6+
7+
8+
## Parameters
9+
10+
`<fieldset>` can take two optional configuration params and optional content.
11+
12+
13+
### Optional configuration
14+
15+
#### id (optional)
16+
17+
Expects a string with all ids the details tag should have.
18+
19+
#### class (optional)
20+
21+
Expects a string with all classes the details tag should have.
22+
23+
#### Disabled (optional)
24+
25+
Set `disabled` attribute on `<fieldset>` to disable all controls inside the `<fieldset>`
26+
27+
## Example 1
28+
29+
```ruby
30+
fieldset do
31+
legend text: 'Your Inputs for Personal details'
32+
label text: 'Personal Detail'
33+
input
34+
end
35+
```
36+
37+
```html
38+
<fieldset>
39+
<legend>Your Inputs for Personal details</legend>
40+
<label>Personal Detail</label>
41+
<input>
42+
</fieldset>
43+
```
44+
45+
## Example 2
46+
47+
```ruby
48+
fieldset id: 'foo', class: 'bar' do
49+
legend id: 'baz', text: 'Your Inputs for Personal details'
50+
label text: 'Personal Detail'
51+
input
52+
end
53+
```
54+
55+
```html
56+
<fieldset id="foo" class="bar">
57+
<legend id="baz">Your Inputs for Personal details</legend>
58+
<label>Personal Detail</label>
59+
<input>
60+
</fieldset>
61+
```
62+
63+
64+
### Example 3
65+
66+
**With Disabled Attribute**
67+
68+
```ruby
69+
fieldset disabled: true do
70+
legend text: 'input legend'
71+
input
72+
end
73+
```
74+
75+
```html
76+
<fieldset disabled="disabled">
77+
<legend>input legend</legend>
78+
<input>
79+
</fieldset>
80+
```
81+

docs/components/figure.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# matestack core component: Figure
2+
3+
Show [specs](/spec/usage/components/figure_spec.rb)
4+
5+
The HTML `<figure>` tag implemented in ruby.
6+
7+
## Parameters
8+
9+
This component can take 2 optional configuration params and optional content.
10+
11+
#### # id (optional)
12+
Expects a string with all ids the figure tag should have.
13+
14+
#### # class (optional)
15+
Expects a string with all classes the figure tag should have.
16+
17+
## Example 1
18+
19+
```ruby
20+
figure id: "foo", class: "bar" do
21+
img path: 'matestack-logo.png', width: 500, height: 300, alt: "logo"
22+
end
23+
```
24+
25+
returns
26+
27+
```html
28+
<figure id="foo" class="bar">
29+
<img src="your-asset-path/matestack-logo.png" width="500" height="300" alt="logo"/>
30+
</figure>
31+
```

0 commit comments

Comments
 (0)