polaris_view_helpers 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/polaris/_card.html.erb +10 -0
- data/app/views/polaris/_description_list.html.erb +5 -0
- data/app/views/polaris/_description_list_item.html.erb +2 -0
- data/app/views/polaris/_footer_help.html.erb +18 -0
- data/app/views/polaris/_layout_section.html.erb +4 -0
- data/app/views/polaris/_link_to.html.erb +3 -0
- data/app/views/polaris/_text_field.html.erb +6 -4
- data/lib/polaris_view_helpers/helper.rb +58 -0
- data/lib/polaris_view_helpers/version.rb +1 -1
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33973c64aa10c6e08fbe3419378a0db415545b78
|
4
|
+
data.tar.gz: 37e8a110adcf35b0316282bf246d1c56e58d7db7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd20cefd1bfc89535314c16fd2a8aee955f251a32b53bc876304feb0440d837592c83a08228ee5cb48c7522cf8c378dd371a4691b179dc58ed6c383a565618e8
|
7
|
+
data.tar.gz: 9159a21538d0d8cfa38716d769cfd75488021b9222ca70b1645a9799641390728904f4bc6b68f76ebd9867737b2bc45854f7a692e65cccd4412c7fa337bcd82c
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div class="Polaris-FooterHelp">
|
2
|
+
<div class="Polaris-FooterHelp__Content">
|
3
|
+
<div class="Polaris-FooterHelp__Icon">
|
4
|
+
<span class="Polaris-Icon Polaris-Icon--colorTeal Polaris-Icon--hasBackdropNo">
|
5
|
+
<svg role="img" class="Polaris-Icon__Svg" aria-labelledby="next-help-f4f13b47b896c4e3dda071982d260af5-title">
|
6
|
+
<title id="next-help-f4f13b47b896c4e3dda071982d260af5-title">Help</title>
|
7
|
+
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#<%= icon %>">
|
8
|
+
</use>
|
9
|
+
</svg>
|
10
|
+
</span>
|
11
|
+
</div>
|
12
|
+
<div class="Polaris-FooterHelp__Text">
|
13
|
+
<%= capture(&block) %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<% attribute.each do |att| %>
|
2
2
|
<div class="Polaris-FormLayout__Item">
|
3
3
|
<div class="">
|
4
|
-
|
5
|
-
<div class="Polaris-
|
6
|
-
|
4
|
+
<% unless options[:supress_label] %>
|
5
|
+
<div class="Polaris-Labelled__LabelWrapper">
|
6
|
+
<div class="Polaris-Label">
|
7
|
+
<%= form.label att, options[:label], class: 'Polaris-Label__Text' %>
|
8
|
+
</div>
|
7
9
|
</div>
|
8
|
-
|
10
|
+
<% end %>
|
9
11
|
<div class="Polaris-TextField">
|
10
12
|
<%= form.send element_type, att, id: "#{form.object.class.name.tableize.singularize}_#{att}", class: "Polaris-TextField__Input", placeholder: options[:placeholder] %>
|
11
13
|
<div class="Polaris-TextField__Backdrop"></div>
|
@@ -40,6 +40,14 @@ module PolarisViewHelpers
|
|
40
40
|
)
|
41
41
|
end
|
42
42
|
|
43
|
+
def polaris_layout_section(secondary: false, &block)
|
44
|
+
extra_class = secondary ? "Polaris-Layout__Section--secondary" : ""
|
45
|
+
render(
|
46
|
+
partial: 'polaris/layout_section',
|
47
|
+
locals: { block: block, extra_class: extra_class }
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
43
51
|
def polaris_form_layout(&block)
|
44
52
|
render(
|
45
53
|
partial: 'polaris/form_layout',
|
@@ -104,6 +112,28 @@ module PolarisViewHelpers
|
|
104
112
|
)
|
105
113
|
end
|
106
114
|
|
115
|
+
def polaris_link_to(name = nil, link_destination = nil, button_options = nil, &block)
|
116
|
+
if block_given?
|
117
|
+
button_options, link_destination, name = link_destination, name, nil
|
118
|
+
end
|
119
|
+
button_options ||= {}
|
120
|
+
|
121
|
+
additional_classes = ""
|
122
|
+
(button_options[:modifiers] || []).each do |modifier|
|
123
|
+
additional_classes += "Polaris-Button--#{modifier} "
|
124
|
+
end
|
125
|
+
render(
|
126
|
+
partial: 'polaris/link_to',
|
127
|
+
locals: {
|
128
|
+
name: name,
|
129
|
+
block: block,
|
130
|
+
additional_classes: additional_classes,
|
131
|
+
link_destination: link_destination,
|
132
|
+
method: button_options[:method]
|
133
|
+
}
|
134
|
+
)
|
135
|
+
end
|
136
|
+
|
107
137
|
def polaris_model_errors model
|
108
138
|
render(
|
109
139
|
partial: 'polaris/model_errors',
|
@@ -264,5 +294,33 @@ module PolarisViewHelpers
|
|
264
294
|
)
|
265
295
|
end
|
266
296
|
|
297
|
+
def polaris_description_list(&block)
|
298
|
+
render(
|
299
|
+
partial: 'polaris/description_list',
|
300
|
+
locals: { block: block }
|
301
|
+
)
|
302
|
+
end
|
303
|
+
|
304
|
+
def polaris_description_list_item(term, &block)
|
305
|
+
render(
|
306
|
+
partial: 'polaris/description_list_item',
|
307
|
+
locals: { block: block, term: term }
|
308
|
+
)
|
309
|
+
end
|
310
|
+
|
311
|
+
def polaris_card(heading = nil, &block)
|
312
|
+
render(
|
313
|
+
partial: 'polaris/card',
|
314
|
+
locals: { block: block, heading: heading }
|
315
|
+
)
|
316
|
+
end
|
317
|
+
|
318
|
+
def polaris_footer_help(icon: 'next-help-circle', &block)
|
319
|
+
render(
|
320
|
+
partial: 'polaris/footer_help',
|
321
|
+
locals: { block: block, icon: icon }
|
322
|
+
)
|
323
|
+
end
|
324
|
+
|
267
325
|
end
|
268
326
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polaris_view_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Green
|
@@ -56,11 +56,17 @@ files:
|
|
56
56
|
- app/views/polaris/_banner_actions.html.erb
|
57
57
|
- app/views/polaris/_button_link_to.html.erb
|
58
58
|
- app/views/polaris/_button_tag.html.erb
|
59
|
+
- app/views/polaris/_card.html.erb
|
60
|
+
- app/views/polaris/_description_list.html.erb
|
61
|
+
- app/views/polaris/_description_list_item.html.erb
|
62
|
+
- app/views/polaris/_footer_help.html.erb
|
59
63
|
- app/views/polaris/_form_layout.html.erb
|
60
64
|
- app/views/polaris/_form_layout_item.html.erb
|
61
65
|
- app/views/polaris/_form_layout_item_select.html.erb
|
62
66
|
- app/views/polaris/_heading.html.erb
|
63
67
|
- app/views/polaris/_layout.html.erb
|
68
|
+
- app/views/polaris/_layout_section.html.erb
|
69
|
+
- app/views/polaris/_link_to.html.erb
|
64
70
|
- app/views/polaris/_model_errors.html.erb
|
65
71
|
- app/views/polaris/_page.html.erb
|
66
72
|
- app/views/polaris/_page_actions.html.erb
|